gasImgIdentify.vue 137 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600
  1. <template>
  2. <view class="gas-fill">
  3. <u-navbar
  4. :bgStatusImage="backPic0"
  5. :bgImage="backPic"
  6. :title="gasTitle"
  7. :safeAreaInsetTop="true"
  8. leftIcon="arrow-left"
  9. @leftClick="handlerToggle"
  10. >
  11. </u-navbar>
  12. <!-- 瓦斯上报列表 -->
  13. <view v-if="statusShow != 'edit'">
  14. <view class="top-gas-list">
  15. <u-button
  16. type="primary"
  17. icon="camera-fill"
  18. size="small"
  19. @click="GalleryFile"
  20. style="margin: 2px 0px"
  21. >图片选取</u-button
  22. >
  23. <!-- 图片预览 -->
  24. <view class="imgView">
  25. <image
  26. v-if="imageSrc"
  27. style="width: 100%"
  28. :src="imageSrc"
  29. @click="getPreview"
  30. >
  31. </image>
  32. </view>
  33. <view
  34. style="
  35. width: 100%;
  36. display: flex;
  37. justify-content: space-between;
  38. margin: 2px 0px;
  39. "
  40. >
  41. <!-- <u-button
  42. icon="eye"
  43. type="primary"
  44. size="small"
  45. :loading="loading"
  46. loadingText="识别中"
  47. style="width: 49%; margin: 0"
  48. @click="getGasIdentify"
  49. >识别</u-button
  50. > -->
  51. <u-button
  52. icon="trash"
  53. type="primary"
  54. size="small"
  55. style="width: 100%; margin: 0"
  56. @click="delSb"
  57. >删除</u-button
  58. >
  59. </view>
  60. <!-- <helang-compress ref="helangCompress"></helang-compress> -->
  61. </view>
  62. </view>
  63. <view v-if="statusShow == 'edit'">
  64. <view class="top-gas-list">
  65. <u-button
  66. type="primary"
  67. icon="camera-fill"
  68. size="small"
  69. @click="GalleryFile"
  70. style="margin: 2px 0px"
  71. >图片更新</u-button
  72. >
  73. <!-- 图片预览 -->
  74. <view class="imgView">
  75. <image
  76. v-if="imageSrcView"
  77. style="width: 100%"
  78. :src="imageSrcView"
  79. @click="getPreview"
  80. >
  81. </image>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 新增弹窗 -->
  86. <view
  87. v-if="isShowAdd"
  88. :style="{
  89. padding: imageSrcView
  90. ? '295px 0px 10px 0px'
  91. : imageSrc
  92. ? '330px 0px 10px 0px'
  93. : '54px 0px 10px 0px',
  94. }"
  95. :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'"
  96. >
  97. <view class="top-dialog-area">
  98. <view class="dialog-item">
  99. <text class="dialog-label">班次:</text>
  100. <u--input
  101. inputAlign="center"
  102. disabled
  103. v-model="formState.bc"
  104. clearable
  105. ></u--input>
  106. </view>
  107. <view class="dialog-item">
  108. <text class="dialog-label">检测次数:</text>
  109. <u--input
  110. inputAlign="center"
  111. disabled
  112. v-model="formState.count"
  113. clearable
  114. ></u--input>
  115. </view>
  116. <view class="dialog-item">
  117. <text class="dialog-label">检测地点:</text>
  118. <u--textarea
  119. v-model="formState.jcdd"
  120. :height="14"
  121. disabled
  122. ></u--textarea>
  123. </view>
  124. <view class="dialog-item" @click="getChangeTime">
  125. <text class="dialog-label">检测时间:</text>
  126. <u--input
  127. readonly
  128. v-model="formState.time"
  129. placeholder="请选择检测时间"
  130. inputAlign="center"
  131. :disabled="statusShow == 'edit'"
  132. suffixIcon="arrow-right"
  133. ></u--input>
  134. <u-datetime-picker
  135. :show="showCalendar"
  136. v-model="timeRan"
  137. mode="datetime"
  138. closeOnClickOverlay
  139. @confirm="showCalendar = false"
  140. @cancel="showCalendar = false"
  141. @change="change"
  142. @close="showCalendar = false"
  143. ></u-datetime-picker>
  144. </view>
  145. <view class="dialog-item">
  146. <text class="dialog-label">填报日期:</text>
  147. <u--input
  148. inputAlign="center"
  149. readonly
  150. v-model="formState.tbrq"
  151. placeholder="请选择填报日期"
  152. :disabled="statusShow == 'edit'"
  153. ></u--input>
  154. </view>
  155. <view class="dialog-item">
  156. <text class="dialog-label">检查工:</text>
  157. <u--input
  158. inputAlign="center"
  159. disabled
  160. v-model="formState.jcy"
  161. placeholder="请输入"
  162. ></u--input>
  163. </view>
  164. </view>
  165. <view>
  166. <view class="center-dialog-area">
  167. <div class="dialog-title">气体检测数据</div>
  168. <view class="dialog-item">
  169. <text class="dialog-label">CH₄(%):</text>
  170. <u--input
  171. inputAlign="center"
  172. v-model="formState.ch4"
  173. :placeholder="isRule2 ? '请输入' : '数据有误'"
  174. type="number"
  175. @blur="getBlurCH4"
  176. @input="changeInput($event, 'ch4')"
  177. clearable
  178. :placeholderStyle="isRule2 ? 'color:#c0c4cc' : 'color:#ff0000'"
  179. ></u--input>
  180. </view>
  181. <view class="dialog-item">
  182. <text class="dialog-label">CO₂(%):</text>
  183. <u--input
  184. inputAlign="center"
  185. v-model="formState.co2"
  186. :placeholder="isRule ? '请输入' : '数据有误'"
  187. type="number"
  188. @blur="getBlurCO2"
  189. @input="changeInput($event, 'co2')"
  190. clearable
  191. :placeholderStyle="isRule ? 'color:#c0c4cc' : 'color:#ff0000'"
  192. ></u--input>
  193. </view>
  194. <view class="dialog-item">
  195. <text class="dialog-label">CO(ppm):</text>
  196. <u--input
  197. inputAlign="center"
  198. v-model="formState.co"
  199. :placeholder="isRule14 ? '请输入' : '数据有误'"
  200. clearable
  201. :placeholderStyle="isRule14 ? 'color:#c0c4cc' : 'color:#ff0000'"
  202. type="number"
  203. @blur="getBlurCO"
  204. @input="changeInput($event, 'co')"
  205. ></u--input>
  206. </view>
  207. <view class="dialog-item">
  208. <text class="dialog-label">O₂(%):</text>
  209. <u--input
  210. inputAlign="center"
  211. clearable
  212. type="number"
  213. v-model="formState.o2"
  214. placeholder="请输入"
  215. @input="changeInput($event, 'o2')"
  216. ></u--input>
  217. </view>
  218. <view class="dialog-item">
  219. <text class="dialog-label">T(℃):</text>
  220. <u--input
  221. inputAlign="center"
  222. clearable
  223. type="number"
  224. @input="changeInput($event, 'temp')"
  225. v-model="formState.temp"
  226. placeholder="请输入"
  227. ></u--input>
  228. </view>
  229. </view>
  230. <view class="bottom-dialog-area">
  231. <div class="dialog-title">三对照数据</div>
  232. <view class="dialog-item">
  233. <text class="dialog-label">甲烷传感器:</text>
  234. <u--input
  235. inputAlign="center"
  236. v-model="formState.jw"
  237. placeholder="请输入"
  238. clearable
  239. @input="changeInput($event, 'jw')"
  240. ></u--input>
  241. </view>
  242. <view class="dialog-item">
  243. <text class="dialog-label">光瓦:</text>
  244. <u--input
  245. inputAlign="center"
  246. type="number"
  247. v-model="formState.ch4"
  248. placeholder="请输入"
  249. clearable
  250. @input="changeInput($event, 'ch4')"
  251. ></u--input>
  252. </view>
  253. <view class="dialog-item">
  254. <text class="dialog-label">便携仪:</text>
  255. <u--input
  256. inputAlign="center"
  257. :placeholderStyle="isRule3 ? 'color:#c0c4cc' : 'color:#ff0000'"
  258. :placeholder="isRule3 ? '请输入' : '数据有误'"
  259. type="number"
  260. v-model="formState.bxy"
  261. clearable
  262. @blur="getBlurBxy"
  263. @input="changeInput($event, 'bxy')"
  264. ></u--input>
  265. </view>
  266. </view>
  267. </view>
  268. <view class="dialog-btn">
  269. <u-button
  270. type="success"
  271. v-if="statusShow == 'add' || statusShow == 'edit'"
  272. size="small"
  273. @click="getConfirm"
  274. >保存</u-button
  275. >
  276. <u-button type="primary" size="small" @click="getCancel">取消</u-button>
  277. </view>
  278. </view>
  279. </view>
  280. </template>
  281. <script>
  282. import api from "@/api/api";
  283. import moment from "moment";
  284. import configService from "@/common/service/config.service.js";
  285. // import { RHFselcet } from "@/uni_modules/fz-media-selcet";
  286. // import helangCompress from "@/components/helang-compress/helang-compress";
  287. export default {
  288. name: "gasFill",
  289. components: {
  290. // helangCompress,
  291. },
  292. props: {
  293. Ids: {
  294. type: String,
  295. default: "",
  296. },
  297. //巡检次数
  298. checkNum: {
  299. type: String,
  300. default: "",
  301. },
  302. //巡检班次
  303. classType: {
  304. type: String,
  305. default: "",
  306. },
  307. isSensor: {
  308. type: String,
  309. default: "",
  310. },
  311. deviceID: {
  312. type: String,
  313. defualt: "",
  314. },
  315. deviceName: {
  316. type: String,
  317. default: "",
  318. },
  319. checkState: {
  320. type: String,
  321. default: "",
  322. },
  323. sbData: {
  324. type: Array,
  325. default: () => {
  326. return [];
  327. },
  328. },
  329. urlData: {
  330. type: String,
  331. default: "",
  332. },
  333. },
  334. data() {
  335. return {
  336. imageSrcView: "", //任务明细查看图片详情
  337. tempFilePaths: [],
  338. gasTitle: "数据采集", //标题
  339. backPic0: "url(/static/topnavbar0.png)",
  340. backPic: "url(../../static/topnavbar.png)",
  341. loading: false,
  342. paramData: {},
  343. statusShow: "",
  344. editData: {},
  345. indexList: [], //识别数据
  346. indexParam: {}, //当前选中识别的数据
  347. imageSrc: "",
  348. deviceId: "",
  349. rangeBc: [
  350. { value: "夜班", text: "夜班" },
  351. { value: "早班", text: "早班" },
  352. { value: "中班", text: "中班" },
  353. ],
  354. // rangeMcgzm: [],
  355. rangeJcdd: [],
  356. rangeCount: [
  357. { value: "第一次", text: "第一次" },
  358. { value: "第二次", text: "第二次" },
  359. ],
  360. rangeJw: [
  361. { value: "0", text: "0" },
  362. { value: "-", text: "-" },
  363. ],
  364. isRule: true,
  365. isRule1: true,
  366. isRule14: true,
  367. isRule2: true,
  368. isRule3: true,
  369. //新增参数信息
  370. isShowAdd: false, //是否显示新增弹窗
  371. showCalendar: false, //控制日期选型下拉开启
  372. timeRan: Number(new Date()),
  373. gasList: [], //瓦斯填报列表数据
  374. // tbTime: moment(new Date()).format('YYYY-MM-DD'),//查询条件-填报时间
  375. // showCalendarTb: false,//控制填报时间组件弹出
  376. saveShowList: {},
  377. formState: {
  378. id: "",
  379. bc: "",
  380. count: "第一次",
  381. jcdd: "",
  382. jcy: "",
  383. time: "",
  384. ch4: "",
  385. co2: "",
  386. co: "",
  387. o2: "",
  388. jw: "",
  389. bxy: "",
  390. tbrq: "",
  391. temp: "",
  392. // mcgzm: '',
  393. },
  394. };
  395. },
  396. computed: {
  397. username: function () {
  398. return uni.getStorageSync("login_user_info")["realname"];
  399. },
  400. searchTime: function () {
  401. return uni.getStorageSync("searchTime");
  402. },
  403. },
  404. watch: {
  405. checkState: {
  406. handler(newV, oldV) {
  407. let that = this;
  408. if (newV && newV != "0") {
  409. this.isShowAdd = true;
  410. this.statusShow = "edit";
  411. this.gasTitle = "数据详情";
  412. this.getGasList();
  413. //获取任务详情图片
  414. this.getTaskImg();
  415. } else {
  416. that.isShowAdd = true;
  417. that.statusShow = "add";
  418. that.gasTitle = "数据填报";
  419. //识别数据填充
  420. that.getSbFill();
  421. }
  422. },
  423. immediate: true,
  424. },
  425. },
  426. mounted() {},
  427. methods: {
  428. //打开选择器选择
  429. GalleryFile() {
  430. let that = this;
  431. let parameter = {
  432. MediaType: 1, //设置选择类型 0: ALL(全部) 1: IMAGE(图片) 2: VIDEO(视频) 3: AUDIO(音频) 不传默认为1图片
  433. Single: 2, //设置单选或多选, 1为单选,2为多选,不传默认为多选
  434. maxNum: 1, //设置最大选中数,不传默认为9 仅多选时生效
  435. minNum: 0, //最少选中数,不传为默认为0 仅多选时生效
  436. isOriginal: true, //是否开启原图功能,不传默认为false
  437. isDisplayCamera: true, //是否显示拍摄按钮,不传默认为true
  438. //语言设置, 0:简体中文,1:繁体,2:英语,3:韩语,4:德语,5:法语,6:日语,7:越语,8:西班牙语,9:葡萄牙语,10:阿拉伯语,11:俄语,12:捷克,13:哈萨克斯坦,不传默认为0
  439. Language: 0,
  440. //主题界面样式设置,不传为默认样式
  441. theme: {
  442. titleBarStyle: {
  443. TitleBackgroundColor: "#20a0ff",
  444. },
  445. bottomNavBarStyle: {
  446. PreviewNormalTextColor: "#20a0ff",
  447. PreviewSelectTextColor: "#20a0ff",
  448. BarBackgroundColor: "#FFFFFF",
  449. EditorTextColor: "#20a0ff",
  450. OriginalTextColor: "#20a0ff",
  451. },
  452. selectMainStyle: {
  453. NumberStyle: true, //选中样式是否为数字,不传默认显示勾选样式
  454. isbtn: true, //完成按钮是否为显示背景,不传为默认不显示按钮背景
  455. SelectTextColor: "#ffffff", //选择结果文字颜色
  456. // SelectText:'%1$d/%2$d 完成',
  457. SelectText: "使用(%1$d)", //选择结果要显示的文字,不传默认显示:已完成
  458. StatusBarColor: "#20a0ff",
  459. OriginalTextColor: "#20a0ff",
  460. },
  461. },
  462. };
  463. RHFselcet.getPicture(parameter, (data) => {
  464. that.tempFilePaths = [];
  465. let arrData = data.mediaArray;
  466. if (that.statusShow == "edit") {
  467. that.imageSrcView = arrData[0].Pathurl;
  468. that.tempFilePaths.push(that.imageSrcView);
  469. //更新图片
  470. that.getUpdateImg();
  471. } else {
  472. that.imageSrc = arrData[0].Pathurl;
  473. that.tempFilePaths.push(that.imageSrc);
  474. uni.setStorageSync(that.deviceID, that.imageSrc);
  475. }
  476. });
  477. },
  478. //点击返回上一级
  479. handlerToggle() {
  480. this.$emit("getBackAddress");
  481. },
  482. //图片点击预览
  483. getPreview() {
  484. let that = this;
  485. // 预览图片
  486. if (statusShow == "edit") {
  487. uni.previewImage({
  488. urls: this.tempFilePaths,
  489. current: 0,
  490. });
  491. } else {
  492. uni.previewImage({
  493. urls: this.tempFilePaths,
  494. current: 0,
  495. });
  496. }
  497. },
  498. //识别填充
  499. getSbFill() {
  500. let that = this;
  501. that.deviceId = that.deviceID;
  502. that.imageSrc = that.urlData;
  503. let status = that.sbData[0].status;
  504. if (status != "2") {
  505. if (that.sbData.length != 0) {
  506. that.indexParam = that.sbData[0];
  507. that.formState = {
  508. id: "",
  509. bc: that.classType || "",
  510. count:
  511. that.checkNum == "1"
  512. ? "第一次"
  513. : that.checkNum == "2"
  514. ? "第二次"
  515. : "",
  516. jcdd: that.deviceName || "",
  517. jcy:
  518. that.indexParam && that.indexParam["检查人"]
  519. ? that.indexParam["检查人"]
  520. : that.username,
  521. time:
  522. that.indexParam && that.indexParam["检查时间"]
  523. ? that.indexParam["检查时间"]
  524. : "",
  525. ch4:
  526. that.indexParam && that.indexParam["CH4%"]
  527. ? that.indexParam["CH4%"]
  528. : "",
  529. co2:
  530. that.indexParam && that.indexParam["CO2%"]
  531. ? that.indexParam["CO2%"]
  532. : "",
  533. co:
  534. that.indexParam && that.indexParam["CO(ppm)"]
  535. ? that.indexParam["CO(ppm)"]
  536. : "",
  537. o2:
  538. that.indexParam && that.indexParam["O2%"]
  539. ? that.indexParam["O2%"]
  540. : "",
  541. jw: that.isSensor == "1" ? "0" : "-",
  542. bxy: "0",
  543. tbrq:
  544. that.indexParam && that.indexParam["检查时间"]
  545. ? that.indexParam["检查时间"].substring(
  546. 0,
  547. that.indexParam["检查时间"].indexOf(" ")
  548. )
  549. : "",
  550. temp:
  551. that.indexParam && that.indexParam["温度(℃)"]
  552. ? that.indexParam["温度(℃)"]
  553. : "",
  554. };
  555. new Promise((resolve, reject) => {
  556. api
  557. .getGas({
  558. reportTime: that.formState.tbrq,
  559. deviceId: that.deviceId,
  560. })
  561. .then((response) => {
  562. if (response.data.code == 200) {
  563. let data = response.data.result.records;
  564. if (data.length != 0) {
  565. that.saveShowList = data[0];
  566. if (
  567. that.formState.bc == "早班" &&
  568. that.formState.count == "第一次"
  569. ) {
  570. let param = {
  571. taskDetailsId: that.Ids,
  572. deviceId: that.deviceId,
  573. bxySdzEarly1: that.formState.bxy,
  574. ch4Early1: that.formState.ch4,
  575. checkPersonEarly: that.formState.jcy,
  576. co2Early1: that.formState.co2,
  577. coEarly1: that.formState.co,
  578. gwSdzEarly1: that.formState.ch4,
  579. jwSdzEarly1: that.formState.jw,
  580. o2Early1: that.formState.o2,
  581. strInstallPos: that.formState.jcdd,
  582. timeEarly1: that.formState.time,
  583. reportTime: that.formState.tbrq,
  584. tearly1: that.formState.temp,
  585. };
  586. that.paramData = Object.assign(
  587. {},
  588. that.saveShowList,
  589. param
  590. );
  591. } else if (
  592. that.formState.bc == "早班" &&
  593. that.formState.count == "第二次"
  594. ) {
  595. let param = {
  596. taskDetailsId: that.Ids,
  597. deviceId: that.deviceId,
  598. bxySdzEarly2: that.formState.bxy,
  599. ch4Early2: that.formState.ch4,
  600. checkPersonEarly: that.formState.jcy,
  601. co2Early2: that.formState.co2,
  602. coEarly2: that.formState.co,
  603. gwSdzEarly2: that.formState.ch4,
  604. jwSdzEarly2: that.formState.jw,
  605. o2Early2: that.formState.o2,
  606. strInstallPos: that.formState.jcdd,
  607. timeEarly2: that.formState.time,
  608. reportTime: that.formState.tbrq,
  609. tearly2: that.formState.temp,
  610. };
  611. that.paramData = Object.assign(
  612. {},
  613. that.saveShowList,
  614. param
  615. );
  616. } else if (
  617. that.formState.bc == "中班" &&
  618. that.formState.count == "第一次"
  619. ) {
  620. let param = {
  621. taskDetailsId: that.Ids,
  622. deviceId: that.deviceId,
  623. bxySdzNoon1: that.formState.bxy,
  624. ch4Noon1: that.formState.ch4,
  625. checkPersonNoon: that.formState.jcy,
  626. co2Noon1: that.formState.co2,
  627. coNoon1: that.formState.co,
  628. gwSdzNoon1: that.formState.ch4,
  629. jwSdzNoon1: that.formState.jw,
  630. o2Noon1: that.formState.o2,
  631. strInstallPos: that.formState.jcdd,
  632. timeNoon1: that.formState.time,
  633. reportTime: that.formState.tbrq,
  634. tnoon1: that.formState.temp,
  635. };
  636. that.paramData = Object.assign(
  637. {},
  638. that.saveShowList,
  639. param
  640. );
  641. } else if (
  642. that.formState.bc == "中班" &&
  643. that.formState.count == "第二次"
  644. ) {
  645. let param = {
  646. taskDetailsId: that.Ids,
  647. deviceId: that.deviceId,
  648. bxySdzNoon2: that.formState.bxy,
  649. ch4Noon2: that.formState.ch4,
  650. checkPersonNoon: that.formState.jcy,
  651. co2Noon2: that.formState.co2,
  652. coNoon2: that.formState.co,
  653. gwSdzNoon2: that.formState.ch4,
  654. jwSdzNoon2: that.formState.jw,
  655. o2Noon2: that.formState.o2,
  656. strInstallPos: that.formState.jcdd,
  657. timeNoon2: that.formState.time,
  658. reportTime: that.formState.tbrq,
  659. tnoon2: that.formState.temp,
  660. };
  661. that.paramData = Object.assign(
  662. {},
  663. that.saveShowList,
  664. param
  665. );
  666. } else if (
  667. that.formState.bc == "夜班" &&
  668. that.formState.count == "第一次"
  669. ) {
  670. let param = {
  671. taskDetailsId: that.Ids,
  672. deviceId: that.deviceId,
  673. bxySdzNight1: that.formState.bxy,
  674. ch4Night1: that.formState.ch4,
  675. checkPersonNight: that.formState.jcy,
  676. co2Night1: that.formState.co2,
  677. coNight1: that.formState.co,
  678. gwSdzNight1: that.formState.ch4,
  679. jwSdzNight1: that.formState.jw,
  680. o2Night1: that.formState.o2,
  681. strInstallPos: that.formState.jcdd,
  682. timeNight1: that.formState.time,
  683. reportTime: that.formState.tbrq,
  684. tnight1: that.formState.temp,
  685. };
  686. that.paramData = Object.assign(
  687. {},
  688. that.saveShowList,
  689. param
  690. );
  691. } else if (
  692. that.formState.bc == "夜班" &&
  693. that.formState.count == "第二次"
  694. ) {
  695. let param = {
  696. taskDetailsId: that.Ids,
  697. deviceId: that.deviceId,
  698. bxySdzNight2: that.formState.bxy,
  699. ch4Night2: that.formState.ch4,
  700. checkPersonNight: that.formState.jcy,
  701. co2Night2: that.formState.co2,
  702. coNight2: that.formState.co,
  703. gwSdzNight2: that.formState.ch4,
  704. jwSdzNight2: that.formState.jw,
  705. o2Night2: that.formState.o2,
  706. strInstallPos: that.formState.jcdd,
  707. timeNight2: that.formState.time,
  708. reportTime: that.formState.tbrq,
  709. tnight2: that.formState.temp,
  710. };
  711. that.paramData = Object.assign(
  712. {},
  713. that.saveShowList,
  714. param
  715. );
  716. }
  717. } else {
  718. that.saveShowList = {};
  719. if (
  720. that.formState.bc == "早班" &&
  721. that.formState.count == "第一次"
  722. ) {
  723. let param = {
  724. taskDetailsId: that.Ids,
  725. deviceId: that.deviceId,
  726. bxySdzEarly1: that.formState.bxy,
  727. ch4Early1: that.formState.ch4,
  728. checkPersonEarly: that.formState.jcy,
  729. co2Early1: that.formState.co2,
  730. coEarly1: that.formState.co,
  731. gwSdzEarly1: that.formState.ch4,
  732. jwSdzEarly1: that.formState.jw,
  733. o2Early1: that.formState.o2,
  734. strInstallPos: that.formState.jcdd,
  735. timeEarly1: that.formState.time,
  736. reportTime: that.formState.tbrq,
  737. tearly1: that.formState.temp,
  738. };
  739. that.paramData = Object.assign(
  740. {},
  741. that.saveShowList,
  742. param
  743. );
  744. } else if (
  745. that.formState.bc == "早班" &&
  746. that.formState.count == "第二次"
  747. ) {
  748. let param = {
  749. taskDetailsId: that.Ids,
  750. deviceId: that.deviceId,
  751. bxySdzEarly2: that.formState.bxy,
  752. ch4Early2: that.formState.ch4,
  753. checkPersonEarly: that.formState.jcy,
  754. co2Early2: that.formState.co2,
  755. coEarly2: that.formState.co,
  756. gwSdzEarly2: that.formState.ch4,
  757. jwSdzEarly2: that.formState.jw,
  758. o2Early2: that.formState.o2,
  759. strInstallPos: that.formState.jcdd,
  760. timeEarly2: that.formState.time,
  761. reportTime: that.formState.tbrq,
  762. tearly2: that.formState.temp,
  763. };
  764. that.paramData = Object.assign(
  765. {},
  766. that.saveShowList,
  767. param
  768. );
  769. } else if (
  770. that.formState.bc == "中班" &&
  771. that.formState.count == "第一次"
  772. ) {
  773. let param = {
  774. taskDetailsId: that.Ids,
  775. deviceId: that.deviceId,
  776. bxySdzNoon1: that.formState.bxy,
  777. ch4Noon1: that.formState.ch4,
  778. checkPersonNoon: that.formState.jcy,
  779. co2Noon1: that.formState.co2,
  780. coNoon1: that.formState.co,
  781. gwSdzNoon1: that.formState.ch4,
  782. jwSdzNoon1: that.formState.jw,
  783. o2Noon1: that.formState.o2,
  784. strInstallPos: that.formState.jcdd,
  785. timeNoon1: that.formState.time,
  786. reportTime: that.formState.tbrq,
  787. tnoon1: that.formState.temp,
  788. };
  789. that.paramData = Object.assign(
  790. {},
  791. that.saveShowList,
  792. param
  793. );
  794. } else if (
  795. that.formState.bc == "中班" &&
  796. that.formState.count == "第二次"
  797. ) {
  798. let param = {
  799. taskDetailsId: that.Ids,
  800. deviceId: that.deviceId,
  801. bxySdzNoon2: that.formState.bxy,
  802. ch4Noon2: that.formState.ch4,
  803. checkPersonNoon: that.formState.jcy,
  804. co2Noon2: that.formState.co2,
  805. coNoon2: that.formState.co,
  806. gwSdzNoon2: that.formState.ch4,
  807. jwSdzNoon2: that.formState.jw,
  808. o2Noon2: that.formState.o2,
  809. strInstallPos: that.formState.jcdd,
  810. timeNoon2: that.formState.time,
  811. reportTime: that.formState.tbrq,
  812. tnoon2: that.formState.temp,
  813. };
  814. that.paramData = Object.assign(
  815. {},
  816. that.saveShowList,
  817. param
  818. );
  819. } else if (
  820. that.formState.bc == "夜班" &&
  821. that.formState.count == "第一次"
  822. ) {
  823. let param = {
  824. taskDetailsId: that.Ids,
  825. deviceId: that.deviceId,
  826. bxySdzNight1: that.formState.bxy,
  827. ch4Night1: that.formState.ch4,
  828. checkPersonNight: that.formState.jcy,
  829. co2Night1: that.formState.co2,
  830. coNight1: that.formState.co,
  831. gwSdzNight1: that.formState.ch4,
  832. jwSdzNight1: that.formState.jw,
  833. o2Night1: that.formState.o2,
  834. strInstallPos: that.formState.jcdd,
  835. timeNight1: that.formState.time,
  836. reportTime: that.formState.tbrq,
  837. tnight1: that.formState.temp,
  838. };
  839. that.paramData = Object.assign(
  840. {},
  841. that.saveShowList,
  842. param
  843. );
  844. } else if (
  845. that.formState.bc == "夜班" &&
  846. that.formState.count == "第二次"
  847. ) {
  848. let param = {
  849. taskDetailsId: that.Ids,
  850. deviceId: that.deviceId,
  851. bxySdzNight2: that.formState.bxy,
  852. ch4Night2: that.formState.ch4,
  853. checkPersonNight: that.formState.jcy,
  854. co2Night2: that.formState.co2,
  855. coNight2: that.formState.co,
  856. gwSdzNight2: that.formState.ch4,
  857. jwSdzNight2: that.formState.jw,
  858. o2Night2: that.formState.o2,
  859. strInstallPos: that.formState.jcdd,
  860. timeNight2: that.formState.time,
  861. reportTime: that.formState.tbrq,
  862. tnight2: that.formState.temp,
  863. };
  864. that.paramData = Object.assign(
  865. {},
  866. that.saveShowList,
  867. param
  868. );
  869. }
  870. }
  871. } else {
  872. reject(response);
  873. }
  874. })
  875. .catch((error) => {
  876. console.log("catch===>response", response);
  877. reject(error);
  878. });
  879. });
  880. } else {
  881. that.formState = {
  882. id: "",
  883. bc: that.classType || "",
  884. count:
  885. that.checkNum == "1"
  886. ? "第一次"
  887. : that.checkNum == "2"
  888. ? "第二次"
  889. : "",
  890. jcdd: that.deviceName || "",
  891. jcy: that.username,
  892. time: "",
  893. ch4: "",
  894. co2: "",
  895. co: "",
  896. o2: "",
  897. jw: that.isSensor == "1" ? "0" : "-",
  898. bxy: "0",
  899. tbrq: "",
  900. temp: "",
  901. };
  902. }
  903. } else {
  904. that.formState = {
  905. id: "",
  906. bc: that.classType || "",
  907. count:
  908. that.checkNum == "1"
  909. ? "第一次"
  910. : that.checkNum == "2"
  911. ? "第二次"
  912. : "",
  913. jcdd: that.deviceName || "",
  914. jcy: that.username,
  915. time: "",
  916. ch4: "",
  917. co2: "",
  918. co: "",
  919. o2: "",
  920. jw: that.isSensor == "1" ? "0" : "-",
  921. bxy: "0",
  922. tbrq: "",
  923. temp: "",
  924. };
  925. }
  926. },
  927. //先压缩后识别
  928. // getScale() {
  929. // let that = this;
  930. // // 单张压缩
  931. // that.$refs.helangCompress
  932. // .compress({
  933. // src: that.imageSrc,
  934. // maxSize: 800,
  935. // fileType: "png",
  936. // quality: 0.85,
  937. // minSize: 640, //最小压缩尺寸,图片尺寸小于该时值不压缩,非H5平台有效。若需要忽略该设置,可设置为一个极小的值,比如负数。
  938. // })
  939. // .then((res) => {
  940. // that.imageSrc = res;
  941. // // 压缩成功回调
  942. // that.loading = true;
  943. // let jcNum = that.deviceName.indexOf("第三次") != -1 ? 3 : null;
  944. // let apiUrlImg = `${configService.apiUrlP}:6008`;
  945. // uni.uploadFile({
  946. // url: `${apiUrlImg}/gasIdentify`,
  947. // filePath: that.imageSrc,
  948. // name: "img",
  949. // formData: {
  950. // user: that.username,
  951. // order: that.classType,
  952. // reportdate: that.searchTime,
  953. // checkorder: jcNum ? jcNum : Number(that.checkNum),
  954. // checkpath: that.deviceName,
  955. // imgpath: that.imageSrc,
  956. // },
  957. // success: (res) => {
  958. // if (res) {
  959. // uni.showToast({
  960. // title: "识别成功!",
  961. // icon: "none", // 可选图标,'success', 'loading', 'none'
  962. // });
  963. // that.indexList = JSON.parse(res.data).data || [];
  964. // that.isShowAdd = true;
  965. // that.loading = false;
  966. // that.isShowAdd = true;
  967. // that.statusShow = "add";
  968. // that.deviceId = that.deviceID;
  969. // if (that.indexList.length != 0) {
  970. // that.indexParam = that.indexList[0];
  971. // that.formState = {
  972. // id: "",
  973. // bc: that.classType || "",
  974. // count:
  975. // that.checkNum == "1"
  976. // ? "第一次"
  977. // : that.checkNum == "2"
  978. // ? "第二次"
  979. // : "",
  980. // jcdd: that.deviceName || "",
  981. // jcy:
  982. // that.indexParam && that.indexParam["检查人"]
  983. // ? that.indexParam["检查人"]
  984. // : that.username,
  985. // time:
  986. // that.indexParam && that.indexParam["检查时间"]
  987. // ? that.indexParam["检查时间"]
  988. // : "",
  989. // ch4:
  990. // that.indexParam && that.indexParam["CH4%"]
  991. // ? that.indexParam["CH4%"]
  992. // : "",
  993. // co2:
  994. // that.indexParam && that.indexParam["CO2%"]
  995. // ? that.indexParam["CO2%"]
  996. // : "",
  997. // co:
  998. // that.indexParam && that.indexParam["CO(ppm)"]
  999. // ? that.indexParam["CO(ppm)"]
  1000. // : "",
  1001. // o2:
  1002. // that.indexParam && that.indexParam["O2%"]
  1003. // ? that.indexParam["O2%"]
  1004. // : "",
  1005. // jw: that.isSensor == "1" ? "0" : "-",
  1006. // bxy: "0",
  1007. // tbrq:
  1008. // that.indexParam && that.indexParam["检查时间"]
  1009. // ? that.indexParam["检查时间"].substring(
  1010. // 0,
  1011. // that.indexParam["检查时间"].indexOf(" ")
  1012. // )
  1013. // : "",
  1014. // temp:
  1015. // that.indexParam && that.indexParam["温度(℃)"]
  1016. // ? that.indexParam["温度(℃)"]
  1017. // : "",
  1018. // };
  1019. // new Promise((resolve, reject) => {
  1020. // api
  1021. // .getGas({
  1022. // reportTime: that.formState.tbrq,
  1023. // deviceId: that.deviceId,
  1024. // })
  1025. // .then((response) => {
  1026. // if (response.data.code == 200) {
  1027. // let data = response.data.result.records;
  1028. // if (data.length != 0) {
  1029. // that.saveShowList = data[0];
  1030. // if (
  1031. // that.formState.bc == "早班" &&
  1032. // that.formState.count == "第一次"
  1033. // ) {
  1034. // let param = {
  1035. // taskDetailsId: that.Ids,
  1036. // deviceId: that.deviceId,
  1037. // bxySdzEarly1: that.formState.bxy,
  1038. // ch4Early1: that.formState.ch4,
  1039. // checkPersonEarly: that.formState.jcy,
  1040. // co2Early1: that.formState.co2,
  1041. // coEarly1: that.formState.co,
  1042. // gwSdzEarly1: that.formState.ch4,
  1043. // jwSdzEarly1: that.formState.jw,
  1044. // o2Early1: that.formState.o2,
  1045. // strInstallPos: that.formState.jcdd,
  1046. // timeEarly1: that.formState.time,
  1047. // reportTime: that.formState.tbrq,
  1048. // tearly1: that.formState.temp,
  1049. // };
  1050. // that.paramData = Object.assign(
  1051. // {},
  1052. // that.saveShowList,
  1053. // param
  1054. // );
  1055. // } else if (
  1056. // that.formState.bc == "早班" &&
  1057. // that.formState.count == "第二次"
  1058. // ) {
  1059. // let param = {
  1060. // taskDetailsId: that.Ids,
  1061. // deviceId: that.deviceId,
  1062. // bxySdzEarly2: that.formState.bxy,
  1063. // ch4Early2: that.formState.ch4,
  1064. // checkPersonEarly: that.formState.jcy,
  1065. // co2Early2: that.formState.co2,
  1066. // coEarly2: that.formState.co,
  1067. // gwSdzEarly2: that.formState.ch4,
  1068. // jwSdzEarly2: that.formState.jw,
  1069. // o2Early2: that.formState.o2,
  1070. // strInstallPos: that.formState.jcdd,
  1071. // timeEarly2: that.formState.time,
  1072. // reportTime: that.formState.tbrq,
  1073. // tearly2: that.formState.temp,
  1074. // };
  1075. // that.paramData = Object.assign(
  1076. // {},
  1077. // that.saveShowList,
  1078. // param
  1079. // );
  1080. // } else if (
  1081. // that.formState.bc == "中班" &&
  1082. // that.formState.count == "第一次"
  1083. // ) {
  1084. // let param = {
  1085. // taskDetailsId: that.Ids,
  1086. // deviceId: that.deviceId,
  1087. // bxySdzNoon1: that.formState.bxy,
  1088. // ch4Noon1: that.formState.ch4,
  1089. // checkPersonNoon: that.formState.jcy,
  1090. // co2Noon1: that.formState.co2,
  1091. // coNoon1: that.formState.co,
  1092. // gwSdzNoon1: that.formState.ch4,
  1093. // jwSdzNoon1: that.formState.jw,
  1094. // o2Noon1: that.formState.o2,
  1095. // strInstallPos: that.formState.jcdd,
  1096. // timeNoon1: that.formState.time,
  1097. // reportTime: that.formState.tbrq,
  1098. // tnoon1: that.formState.temp,
  1099. // };
  1100. // that.paramData = Object.assign(
  1101. // {},
  1102. // that.saveShowList,
  1103. // param
  1104. // );
  1105. // } else if (
  1106. // that.formState.bc == "中班" &&
  1107. // that.formState.count == "第二次"
  1108. // ) {
  1109. // let param = {
  1110. // taskDetailsId: that.Ids,
  1111. // deviceId: that.deviceId,
  1112. // bxySdzNoon2: that.formState.bxy,
  1113. // ch4Noon2: that.formState.ch4,
  1114. // checkPersonNoon: that.formState.jcy,
  1115. // co2Noon2: that.formState.co2,
  1116. // coNoon2: that.formState.co,
  1117. // gwSdzNoon2: that.formState.ch4,
  1118. // jwSdzNoon2: that.formState.jw,
  1119. // o2Noon2: that.formState.o2,
  1120. // strInstallPos: that.formState.jcdd,
  1121. // timeNoon2: that.formState.time,
  1122. // reportTime: that.formState.tbrq,
  1123. // tnoon2: that.formState.temp,
  1124. // };
  1125. // that.paramData = Object.assign(
  1126. // {},
  1127. // that.saveShowList,
  1128. // param
  1129. // );
  1130. // } else if (
  1131. // that.formState.bc == "夜班" &&
  1132. // that.formState.count == "第一次"
  1133. // ) {
  1134. // let param = {
  1135. // taskDetailsId: that.Ids,
  1136. // deviceId: that.deviceId,
  1137. // bxySdzNight1: that.formState.bxy,
  1138. // ch4Night1: that.formState.ch4,
  1139. // checkPersonNight: that.formState.jcy,
  1140. // co2Night1: that.formState.co2,
  1141. // coNight1: that.formState.co,
  1142. // gwSdzNight1: that.formState.ch4,
  1143. // jwSdzNight1: that.formState.jw,
  1144. // o2Night1: that.formState.o2,
  1145. // strInstallPos: that.formState.jcdd,
  1146. // timeNight1: that.formState.time,
  1147. // reportTime: that.formState.tbrq,
  1148. // tnight1: that.formState.temp,
  1149. // };
  1150. // that.paramData = Object.assign(
  1151. // {},
  1152. // that.saveShowList,
  1153. // param
  1154. // );
  1155. // } else if (
  1156. // that.formState.bc == "夜班" &&
  1157. // that.formState.count == "第二次"
  1158. // ) {
  1159. // let param = {
  1160. // taskDetailsId: that.Ids,
  1161. // deviceId: that.deviceId,
  1162. // bxySdzNight2: that.formState.bxy,
  1163. // ch4Night2: that.formState.ch4,
  1164. // checkPersonNight: that.formState.jcy,
  1165. // co2Night2: that.formState.co2,
  1166. // coNight2: that.formState.co,
  1167. // gwSdzNight2: that.formState.ch4,
  1168. // jwSdzNight2: that.formState.jw,
  1169. // o2Night2: that.formState.o2,
  1170. // strInstallPos: that.formState.jcdd,
  1171. // timeNight2: that.formState.time,
  1172. // reportTime: that.formState.tbrq,
  1173. // tnight2: that.formState.temp,
  1174. // };
  1175. // that.paramData = Object.assign(
  1176. // {},
  1177. // that.saveShowList,
  1178. // param
  1179. // );
  1180. // }
  1181. // } else {
  1182. // that.saveShowList = {};
  1183. // if (
  1184. // that.formState.bc == "早班" &&
  1185. // that.formState.count == "第一次"
  1186. // ) {
  1187. // let param = {
  1188. // taskDetailsId: that.Ids,
  1189. // deviceId: that.deviceId,
  1190. // bxySdzEarly1: that.formState.bxy,
  1191. // ch4Early1: that.formState.ch4,
  1192. // checkPersonEarly: that.formState.jcy,
  1193. // co2Early1: that.formState.co2,
  1194. // coEarly1: that.formState.co,
  1195. // gwSdzEarly1: that.formState.ch4,
  1196. // jwSdzEarly1: that.formState.jw,
  1197. // o2Early1: that.formState.o2,
  1198. // strInstallPos: that.formState.jcdd,
  1199. // timeEarly1: that.formState.time,
  1200. // reportTime: that.formState.tbrq,
  1201. // tearly1: that.formState.temp,
  1202. // };
  1203. // that.paramData = Object.assign(
  1204. // {},
  1205. // that.saveShowList,
  1206. // param
  1207. // );
  1208. // } else if (
  1209. // that.formState.bc == "早班" &&
  1210. // that.formState.count == "第二次"
  1211. // ) {
  1212. // let param = {
  1213. // taskDetailsId: that.Ids,
  1214. // deviceId: that.deviceId,
  1215. // bxySdzEarly2: that.formState.bxy,
  1216. // ch4Early2: that.formState.ch4,
  1217. // checkPersonEarly: that.formState.jcy,
  1218. // co2Early2: that.formState.co2,
  1219. // coEarly2: that.formState.co,
  1220. // gwSdzEarly2: that.formState.ch4,
  1221. // jwSdzEarly2: that.formState.jw,
  1222. // o2Early2: that.formState.o2,
  1223. // strInstallPos: that.formState.jcdd,
  1224. // timeEarly2: that.formState.time,
  1225. // reportTime: that.formState.tbrq,
  1226. // tearly2: that.formState.temp,
  1227. // };
  1228. // that.paramData = Object.assign(
  1229. // {},
  1230. // that.saveShowList,
  1231. // param
  1232. // );
  1233. // } else if (
  1234. // that.formState.bc == "中班" &&
  1235. // that.formState.count == "第一次"
  1236. // ) {
  1237. // let param = {
  1238. // taskDetailsId: that.Ids,
  1239. // deviceId: that.deviceId,
  1240. // bxySdzNoon1: that.formState.bxy,
  1241. // ch4Noon1: that.formState.ch4,
  1242. // checkPersonNoon: that.formState.jcy,
  1243. // co2Noon1: that.formState.co2,
  1244. // coNoon1: that.formState.co,
  1245. // gwSdzNoon1: that.formState.ch4,
  1246. // jwSdzNoon1: that.formState.jw,
  1247. // o2Noon1: that.formState.o2,
  1248. // strInstallPos: that.formState.jcdd,
  1249. // timeNoon1: that.formState.time,
  1250. // reportTime: that.formState.tbrq,
  1251. // tnoon1: that.formState.temp,
  1252. // };
  1253. // that.paramData = Object.assign(
  1254. // {},
  1255. // that.saveShowList,
  1256. // param
  1257. // );
  1258. // } else if (
  1259. // that.formState.bc == "中班" &&
  1260. // that.formState.count == "第二次"
  1261. // ) {
  1262. // let param = {
  1263. // taskDetailsId: that.Ids,
  1264. // deviceId: that.deviceId,
  1265. // bxySdzNoon2: that.formState.bxy,
  1266. // ch4Noon2: that.formState.ch4,
  1267. // checkPersonNoon: that.formState.jcy,
  1268. // co2Noon2: that.formState.co2,
  1269. // coNoon2: that.formState.co,
  1270. // gwSdzNoon2: that.formState.ch4,
  1271. // jwSdzNoon2: that.formState.jw,
  1272. // o2Noon2: that.formState.o2,
  1273. // strInstallPos: that.formState.jcdd,
  1274. // timeNoon2: that.formState.time,
  1275. // reportTime: that.formState.tbrq,
  1276. // tnoon2: that.formState.temp,
  1277. // };
  1278. // that.paramData = Object.assign(
  1279. // {},
  1280. // that.saveShowList,
  1281. // param
  1282. // );
  1283. // } else if (
  1284. // that.formState.bc == "夜班" &&
  1285. // that.formState.count == "第一次"
  1286. // ) {
  1287. // let param = {
  1288. // taskDetailsId: that.Ids,
  1289. // deviceId: that.deviceId,
  1290. // bxySdzNight1: that.formState.bxy,
  1291. // ch4Night1: that.formState.ch4,
  1292. // checkPersonNight: that.formState.jcy,
  1293. // co2Night1: that.formState.co2,
  1294. // coNight1: that.formState.co,
  1295. // gwSdzNight1: that.formState.ch4,
  1296. // jwSdzNight1: that.formState.jw,
  1297. // o2Night1: that.formState.o2,
  1298. // strInstallPos: that.formState.jcdd,
  1299. // timeNight1: that.formState.time,
  1300. // reportTime: that.formState.tbrq,
  1301. // tnight1: that.formState.temp,
  1302. // };
  1303. // that.paramData = Object.assign(
  1304. // {},
  1305. // that.saveShowList,
  1306. // param
  1307. // );
  1308. // } else if (
  1309. // that.formState.bc == "夜班" &&
  1310. // that.formState.count == "第二次"
  1311. // ) {
  1312. // let param = {
  1313. // taskDetailsId: that.Ids,
  1314. // deviceId: that.deviceId,
  1315. // bxySdzNight2: that.formState.bxy,
  1316. // ch4Night2: that.formState.ch4,
  1317. // checkPersonNight: that.formState.jcy,
  1318. // co2Night2: that.formState.co2,
  1319. // coNight2: that.formState.co,
  1320. // gwSdzNight2: that.formState.ch4,
  1321. // jwSdzNight2: that.formState.jw,
  1322. // o2Night2: that.formState.o2,
  1323. // strInstallPos: that.formState.jcdd,
  1324. // timeNight2: that.formState.time,
  1325. // reportTime: that.formState.tbrq,
  1326. // tnight2: that.formState.temp,
  1327. // };
  1328. // that.paramData = Object.assign(
  1329. // {},
  1330. // that.saveShowList,
  1331. // param
  1332. // );
  1333. // }
  1334. // }
  1335. // } else {
  1336. // reject(response);
  1337. // }
  1338. // })
  1339. // .catch((error) => {
  1340. // console.log("catch===>response", response);
  1341. // reject(error);
  1342. // });
  1343. // });
  1344. // } else {
  1345. // that.formState = {
  1346. // id: "",
  1347. // bc: that.classType || "",
  1348. // count:
  1349. // that.checkNum == "1"
  1350. // ? "第一次"
  1351. // : that.checkNum == "2"
  1352. // ? "第二次"
  1353. // : "",
  1354. // jcdd: that.deviceName || "",
  1355. // jcy: that.username,
  1356. // time: "",
  1357. // ch4: "",
  1358. // co2: "",
  1359. // co: "",
  1360. // o2: "",
  1361. // jw: that.isSensor == "1" ? "0" : "-",
  1362. // bxy: "0",
  1363. // tbrq: "",
  1364. // temp: "",
  1365. // };
  1366. // }
  1367. // }
  1368. // },
  1369. // fail: (error) => {
  1370. // uni.showToast({
  1371. // title: "识别失败!",
  1372. // icon: "none", // 可选图标,'success', 'loading', 'none'
  1373. // });
  1374. // that.loading = false;
  1375. // },
  1376. // });
  1377. // })
  1378. // .catch((err) => {
  1379. // // 压缩失败回调
  1380. // uni.showToast({
  1381. // title: "压缩失败!",
  1382. // icon: "none", // 可选图标,'success', 'loading', 'none'
  1383. // });
  1384. // that.loading = false;
  1385. // });
  1386. // },
  1387. //直接识别
  1388. // getIdentyfe() {
  1389. // let that = this;
  1390. // that.loading = true;
  1391. // let jcNum = that.deviceName.indexOf("第三次") != -1 ? 3 : null;
  1392. // let apiUrlImg = `${configService.apiUrlP}:6008`;
  1393. // uni.uploadFile({
  1394. // url: `${apiUrlImg}/gasIdentify`,
  1395. // filePath: that.saveImg,
  1396. // name: "img",
  1397. // formData: {
  1398. // user: that.username,
  1399. // order: that.classType,
  1400. // reportdate: that.searchTime,
  1401. // checkorder: jcNum ? jcNum : Number(that.checkNum),
  1402. // checkpath: that.deviceName,
  1403. // imgpath: that.saveImg,
  1404. // },
  1405. // success: (res) => {
  1406. // if (res) {
  1407. // uni.showToast({
  1408. // title: "识别成功!",
  1409. // icon: "none", // 可选图标,'success', 'loading', 'none'
  1410. // });
  1411. // that.indexList = JSON.parse(res.data).data || [];
  1412. // that.isShowAdd = true;
  1413. // that.loading = false;
  1414. // that.isShowAdd = true;
  1415. // that.statusShow = "add";
  1416. // that.deviceId = that.deviceID;
  1417. // if (that.indexList.length != 0) {
  1418. // that.indexParam = that.indexList[0];
  1419. // that.formState = {
  1420. // id: "",
  1421. // bc: that.classType || "",
  1422. // count:
  1423. // that.checkNum == "1"
  1424. // ? "第一次"
  1425. // : that.checkNum == "2"
  1426. // ? "第二次"
  1427. // : "",
  1428. // jcdd: that.deviceName || "",
  1429. // jcy:
  1430. // that.indexParam && that.indexParam["检查人"]
  1431. // ? that.indexParam["检查人"]
  1432. // : that.username,
  1433. // time:
  1434. // that.indexParam && that.indexParam["检查时间"]
  1435. // ? that.indexParam["检查时间"]
  1436. // : "",
  1437. // ch4:
  1438. // that.indexParam && that.indexParam["CH4%"]
  1439. // ? that.indexParam["CH4%"]
  1440. // : "",
  1441. // co2:
  1442. // that.indexParam && that.indexParam["CO2%"]
  1443. // ? that.indexParam["CO2%"]
  1444. // : "",
  1445. // co:
  1446. // that.indexParam && that.indexParam["CO(ppm)"]
  1447. // ? that.indexParam["CO(ppm)"]
  1448. // : "",
  1449. // o2:
  1450. // that.indexParam && that.indexParam["O2%"]
  1451. // ? that.indexParam["O2%"]
  1452. // : "",
  1453. // jw: that.isSensor == "1" ? "0" : "-",
  1454. // bxy: "0",
  1455. // tbrq:
  1456. // that.indexParam && that.indexParam["检查时间"]
  1457. // ? that.indexParam["检查时间"].substring(
  1458. // 0,
  1459. // that.indexParam["检查时间"].indexOf(" ")
  1460. // )
  1461. // : "",
  1462. // temp:
  1463. // that.indexParam && that.indexParam["温度(℃)"]
  1464. // ? that.indexParam["温度(℃)"]
  1465. // : "",
  1466. // };
  1467. // new Promise((resolve, reject) => {
  1468. // api
  1469. // .getGas({
  1470. // reportTime: that.formState.tbrq,
  1471. // deviceId: that.deviceId,
  1472. // })
  1473. // .then((response) => {
  1474. // if (response.data.code == 200) {
  1475. // let data = response.data.result.records;
  1476. // if (data.length != 0) {
  1477. // that.saveShowList = data[0];
  1478. // if (
  1479. // that.formState.bc == "早班" &&
  1480. // that.formState.count == "第一次"
  1481. // ) {
  1482. // let param = {
  1483. // taskDetailsId: that.Ids,
  1484. // deviceId: that.deviceId,
  1485. // bxySdzEarly1: that.formState.bxy,
  1486. // ch4Early1: that.formState.ch4,
  1487. // checkPersonEarly: that.formState.jcy,
  1488. // co2Early1: that.formState.co2,
  1489. // coEarly1: that.formState.co,
  1490. // gwSdzEarly1: that.formState.ch4,
  1491. // jwSdzEarly1: that.formState.jw,
  1492. // o2Early1: that.formState.o2,
  1493. // strInstallPos: that.formState.jcdd,
  1494. // timeEarly1: that.formState.time,
  1495. // reportTime: that.formState.tbrq,
  1496. // tearly1: that.formState.temp,
  1497. // };
  1498. // that.paramData = Object.assign(
  1499. // {},
  1500. // that.saveShowList,
  1501. // param
  1502. // );
  1503. // } else if (
  1504. // that.formState.bc == "早班" &&
  1505. // that.formState.count == "第二次"
  1506. // ) {
  1507. // let param = {
  1508. // taskDetailsId: that.Ids,
  1509. // deviceId: that.deviceId,
  1510. // bxySdzEarly2: that.formState.bxy,
  1511. // ch4Early2: that.formState.ch4,
  1512. // checkPersonEarly: that.formState.jcy,
  1513. // co2Early2: that.formState.co2,
  1514. // coEarly2: that.formState.co,
  1515. // gwSdzEarly2: that.formState.ch4,
  1516. // jwSdzEarly2: that.formState.jw,
  1517. // o2Early2: that.formState.o2,
  1518. // strInstallPos: that.formState.jcdd,
  1519. // timeEarly2: that.formState.time,
  1520. // reportTime: that.formState.tbrq,
  1521. // tearly2: that.formState.temp,
  1522. // };
  1523. // that.paramData = Object.assign(
  1524. // {},
  1525. // that.saveShowList,
  1526. // param
  1527. // );
  1528. // } else if (
  1529. // that.formState.bc == "中班" &&
  1530. // that.formState.count == "第一次"
  1531. // ) {
  1532. // let param = {
  1533. // taskDetailsId: that.Ids,
  1534. // deviceId: that.deviceId,
  1535. // bxySdzNoon1: that.formState.bxy,
  1536. // ch4Noon1: that.formState.ch4,
  1537. // checkPersonNoon: that.formState.jcy,
  1538. // co2Noon1: that.formState.co2,
  1539. // coNoon1: that.formState.co,
  1540. // gwSdzNoon1: that.formState.ch4,
  1541. // jwSdzNoon1: that.formState.jw,
  1542. // o2Noon1: that.formState.o2,
  1543. // strInstallPos: that.formState.jcdd,
  1544. // timeNoon1: that.formState.time,
  1545. // reportTime: that.formState.tbrq,
  1546. // tnoon1: that.formState.temp,
  1547. // };
  1548. // that.paramData = Object.assign(
  1549. // {},
  1550. // that.saveShowList,
  1551. // param
  1552. // );
  1553. // } else if (
  1554. // that.formState.bc == "中班" &&
  1555. // that.formState.count == "第二次"
  1556. // ) {
  1557. // let param = {
  1558. // taskDetailsId: that.Ids,
  1559. // deviceId: that.deviceId,
  1560. // bxySdzNoon2: that.formState.bxy,
  1561. // ch4Noon2: that.formState.ch4,
  1562. // checkPersonNoon: that.formState.jcy,
  1563. // co2Noon2: that.formState.co2,
  1564. // coNoon2: that.formState.co,
  1565. // gwSdzNoon2: that.formState.ch4,
  1566. // jwSdzNoon2: that.formState.jw,
  1567. // o2Noon2: that.formState.o2,
  1568. // strInstallPos: that.formState.jcdd,
  1569. // timeNoon2: that.formState.time,
  1570. // reportTime: that.formState.tbrq,
  1571. // tnoon2: that.formState.temp,
  1572. // };
  1573. // that.paramData = Object.assign(
  1574. // {},
  1575. // that.saveShowList,
  1576. // param
  1577. // );
  1578. // } else if (
  1579. // that.formState.bc == "夜班" &&
  1580. // that.formState.count == "第一次"
  1581. // ) {
  1582. // let param = {
  1583. // taskDetailsId: that.Ids,
  1584. // deviceId: that.deviceId,
  1585. // bxySdzNight1: that.formState.bxy,
  1586. // ch4Night1: that.formState.ch4,
  1587. // checkPersonNight: that.formState.jcy,
  1588. // co2Night1: that.formState.co2,
  1589. // coNight1: that.formState.co,
  1590. // gwSdzNight1: that.formState.ch4,
  1591. // jwSdzNight1: that.formState.jw,
  1592. // o2Night1: that.formState.o2,
  1593. // strInstallPos: that.formState.jcdd,
  1594. // timeNight1: that.formState.time,
  1595. // reportTime: that.formState.tbrq,
  1596. // tnight1: that.formState.temp,
  1597. // };
  1598. // that.paramData = Object.assign(
  1599. // {},
  1600. // that.saveShowList,
  1601. // param
  1602. // );
  1603. // } else if (
  1604. // that.formState.bc == "夜班" &&
  1605. // that.formState.count == "第二次"
  1606. // ) {
  1607. // let param = {
  1608. // taskDetailsId: that.Ids,
  1609. // deviceId: that.deviceId,
  1610. // bxySdzNight2: that.formState.bxy,
  1611. // ch4Night2: that.formState.ch4,
  1612. // checkPersonNight: that.formState.jcy,
  1613. // co2Night2: that.formState.co2,
  1614. // coNight2: that.formState.co,
  1615. // gwSdzNight2: that.formState.ch4,
  1616. // jwSdzNight2: that.formState.jw,
  1617. // o2Night2: that.formState.o2,
  1618. // strInstallPos: that.formState.jcdd,
  1619. // timeNight2: that.formState.time,
  1620. // reportTime: that.formState.tbrq,
  1621. // tnight2: that.formState.temp,
  1622. // };
  1623. // that.paramData = Object.assign(
  1624. // {},
  1625. // that.saveShowList,
  1626. // param
  1627. // );
  1628. // }
  1629. // } else {
  1630. // that.saveShowList = {};
  1631. // if (
  1632. // that.formState.bc == "早班" &&
  1633. // that.formState.count == "第一次"
  1634. // ) {
  1635. // let param = {
  1636. // taskDetailsId: that.Ids,
  1637. // deviceId: that.deviceId,
  1638. // bxySdzEarly1: that.formState.bxy,
  1639. // ch4Early1: that.formState.ch4,
  1640. // checkPersonEarly: that.formState.jcy,
  1641. // co2Early1: that.formState.co2,
  1642. // coEarly1: that.formState.co,
  1643. // gwSdzEarly1: that.formState.ch4,
  1644. // jwSdzEarly1: that.formState.jw,
  1645. // o2Early1: that.formState.o2,
  1646. // strInstallPos: that.formState.jcdd,
  1647. // timeEarly1: that.formState.time,
  1648. // reportTime: that.formState.tbrq,
  1649. // tearly1: that.formState.temp,
  1650. // };
  1651. // that.paramData = Object.assign(
  1652. // {},
  1653. // that.saveShowList,
  1654. // param
  1655. // );
  1656. // } else if (
  1657. // that.formState.bc == "早班" &&
  1658. // that.formState.count == "第二次"
  1659. // ) {
  1660. // let param = {
  1661. // taskDetailsId: that.Ids,
  1662. // deviceId: that.deviceId,
  1663. // bxySdzEarly2: that.formState.bxy,
  1664. // ch4Early2: that.formState.ch4,
  1665. // checkPersonEarly: that.formState.jcy,
  1666. // co2Early2: that.formState.co2,
  1667. // coEarly2: that.formState.co,
  1668. // gwSdzEarly2: that.formState.ch4,
  1669. // jwSdzEarly2: that.formState.jw,
  1670. // o2Early2: that.formState.o2,
  1671. // strInstallPos: that.formState.jcdd,
  1672. // timeEarly2: that.formState.time,
  1673. // reportTime: that.formState.tbrq,
  1674. // tearly2: that.formState.temp,
  1675. // };
  1676. // that.paramData = Object.assign(
  1677. // {},
  1678. // that.saveShowList,
  1679. // param
  1680. // );
  1681. // } else if (
  1682. // that.formState.bc == "中班" &&
  1683. // that.formState.count == "第一次"
  1684. // ) {
  1685. // let param = {
  1686. // taskDetailsId: that.Ids,
  1687. // deviceId: that.deviceId,
  1688. // bxySdzNoon1: that.formState.bxy,
  1689. // ch4Noon1: that.formState.ch4,
  1690. // checkPersonNoon: that.formState.jcy,
  1691. // co2Noon1: that.formState.co2,
  1692. // coNoon1: that.formState.co,
  1693. // gwSdzNoon1: that.formState.ch4,
  1694. // jwSdzNoon1: that.formState.jw,
  1695. // o2Noon1: that.formState.o2,
  1696. // strInstallPos: that.formState.jcdd,
  1697. // timeNoon1: that.formState.time,
  1698. // reportTime: that.formState.tbrq,
  1699. // tnoon1: that.formState.temp,
  1700. // };
  1701. // that.paramData = Object.assign(
  1702. // {},
  1703. // that.saveShowList,
  1704. // param
  1705. // );
  1706. // } else if (
  1707. // that.formState.bc == "中班" &&
  1708. // that.formState.count == "第二次"
  1709. // ) {
  1710. // let param = {
  1711. // taskDetailsId: that.Ids,
  1712. // deviceId: that.deviceId,
  1713. // bxySdzNoon2: that.formState.bxy,
  1714. // ch4Noon2: that.formState.ch4,
  1715. // checkPersonNoon: that.formState.jcy,
  1716. // co2Noon2: that.formState.co2,
  1717. // coNoon2: that.formState.co,
  1718. // gwSdzNoon2: that.formState.ch4,
  1719. // jwSdzNoon2: that.formState.jw,
  1720. // o2Noon2: that.formState.o2,
  1721. // strInstallPos: that.formState.jcdd,
  1722. // timeNoon2: that.formState.time,
  1723. // reportTime: that.formState.tbrq,
  1724. // tnoon2: that.formState.temp,
  1725. // };
  1726. // that.paramData = Object.assign(
  1727. // {},
  1728. // that.saveShowList,
  1729. // param
  1730. // );
  1731. // } else if (
  1732. // that.formState.bc == "夜班" &&
  1733. // that.formState.count == "第一次"
  1734. // ) {
  1735. // let param = {
  1736. // taskDetailsId: that.Ids,
  1737. // deviceId: that.deviceId,
  1738. // bxySdzNight1: that.formState.bxy,
  1739. // ch4Night1: that.formState.ch4,
  1740. // checkPersonNight: that.formState.jcy,
  1741. // co2Night1: that.formState.co2,
  1742. // coNight1: that.formState.co,
  1743. // gwSdzNight1: that.formState.ch4,
  1744. // jwSdzNight1: that.formState.jw,
  1745. // o2Night1: that.formState.o2,
  1746. // strInstallPos: that.formState.jcdd,
  1747. // timeNight1: that.formState.time,
  1748. // reportTime: that.formState.tbrq,
  1749. // tnight1: that.formState.temp,
  1750. // };
  1751. // that.paramData = Object.assign(
  1752. // {},
  1753. // that.saveShowList,
  1754. // param
  1755. // );
  1756. // } else if (
  1757. // that.formState.bc == "夜班" &&
  1758. // that.formState.count == "第二次"
  1759. // ) {
  1760. // let param = {
  1761. // taskDetailsId: that.Ids,
  1762. // deviceId: that.deviceId,
  1763. // bxySdzNight2: that.formState.bxy,
  1764. // ch4Night2: that.formState.ch4,
  1765. // checkPersonNight: that.formState.jcy,
  1766. // co2Night2: that.formState.co2,
  1767. // coNight2: that.formState.co,
  1768. // gwSdzNight2: that.formState.ch4,
  1769. // jwSdzNight2: that.formState.jw,
  1770. // o2Night2: that.formState.o2,
  1771. // strInstallPos: that.formState.jcdd,
  1772. // timeNight2: that.formState.time,
  1773. // reportTime: that.formState.tbrq,
  1774. // tnight2: that.formState.temp,
  1775. // };
  1776. // that.paramData = Object.assign(
  1777. // {},
  1778. // that.saveShowList,
  1779. // param
  1780. // );
  1781. // }
  1782. // }
  1783. // } else {
  1784. // reject(response);
  1785. // }
  1786. // })
  1787. // .catch((error) => {
  1788. // console.log("catch===>response", response);
  1789. // reject(error);
  1790. // });
  1791. // });
  1792. // } else {
  1793. // that.formState = {
  1794. // id: "",
  1795. // bc: that.classType || "",
  1796. // count:
  1797. // that.checkNum == "1"
  1798. // ? "第一次"
  1799. // : that.checkNum == "2"
  1800. // ? "第二次"
  1801. // : "",
  1802. // jcdd: that.deviceName || "",
  1803. // jcy: that.username,
  1804. // time: "",
  1805. // ch4: "",
  1806. // co2: "",
  1807. // co: "",
  1808. // o2: "",
  1809. // jw: that.isSensor == "1" ? "0" : "-",
  1810. // bxy: "0",
  1811. // tbrq: "",
  1812. // temp: "",
  1813. // };
  1814. // }
  1815. // }
  1816. // },
  1817. // fail: (error) => {
  1818. // uni.showToast({
  1819. // title: "识别失败!",
  1820. // icon: "none", // 可选图标,'success', 'loading', 'none'
  1821. // });
  1822. // that.loading = false;
  1823. // },
  1824. // });
  1825. // },
  1826. //获取图片识别数据
  1827. // getGasIdentify() {
  1828. // let that = this;
  1829. // if (that.imageSrc) {
  1830. // that.getScale();
  1831. // } else if (that.saveImg) {
  1832. // that.getIdentyfe();
  1833. // } else {
  1834. // uni.showToast({
  1835. // title: "请选择上传图片!",
  1836. // icon: "none", // 可选图标,'success', 'loading', 'none'
  1837. // });
  1838. // }
  1839. // },
  1840. // // 选择图片的方法
  1841. // chooseImage() {
  1842. // uni.chooseImage({
  1843. // count: 1, // 默认9,设置图片的最大选择数
  1844. // sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  1845. // sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  1846. // success: (res) => {
  1847. // console.log(res, 'res===')
  1848. // // 获取选中的图片路径,这里我们只取第一张图进行预览
  1849. // this.imageSrc = res.tempFilePaths[0];
  1850. // this.tempFilePaths = res.tempFilePaths
  1851. // this.imageSrcList = res.tempFiles
  1852. // },
  1853. // fail: (err) => {
  1854. // console.error('选择图片失败:', err);
  1855. // }
  1856. // });
  1857. // },
  1858. //删除
  1859. delSb() {
  1860. this.isShowAdd = false;
  1861. this.indexList = [];
  1862. this.indexParam = {};
  1863. this.imageSrc = "";
  1864. that.$emit("clearImg", true);
  1865. },
  1866. //甲烷三对照选项切换
  1867. changeJw(e) {
  1868. this.formState.jw = e;
  1869. },
  1870. //检测时间下拉选项切换
  1871. change(e) {
  1872. let that = this;
  1873. that.formState.time = moment(e.value).format("YYYY-MM-DD HH:mm:ss");
  1874. that.formState.tbrq = moment(e.value).format("YYYY-MM-DD");
  1875. new Promise((resolve, reject) => {
  1876. api
  1877. .getGas({ reportTime: that.formState.tbrq, deviceId: that.deviceId })
  1878. .then((response) => {
  1879. if (response.data.code == 200) {
  1880. let data = response.data.result.records;
  1881. if (data.length != 0) {
  1882. that.saveShowList = data[0];
  1883. if (
  1884. that.formState.bc == "早班" &&
  1885. that.formState.count == "第一次"
  1886. ) {
  1887. let param = {
  1888. taskDetailsId: that.Ids,
  1889. deviceId: that.deviceId,
  1890. bxySdzEarly1: that.formState.bxy,
  1891. ch4Early1: that.formState.ch4,
  1892. checkPersonEarly: that.formState.jcy,
  1893. co2Early1: that.formState.co2,
  1894. coEarly1: that.formState.co,
  1895. gwSdzEarly1: that.formState.ch4,
  1896. jwSdzEarly1: that.formState.jw,
  1897. o2Early1: that.formState.o2,
  1898. strInstallPos: that.formState.jcdd,
  1899. timeEarly1: that.formState.time,
  1900. reportTime: that.formState.tbrq,
  1901. tearly1: that.formState.temp,
  1902. };
  1903. that.paramData = Object.assign({}, that.saveShowList, param);
  1904. } else if (
  1905. that.formState.bc == "早班" &&
  1906. that.formState.count == "第二次"
  1907. ) {
  1908. let param = {
  1909. taskDetailsId: that.Ids,
  1910. deviceId: that.deviceId,
  1911. bxySdzEarly2: that.formState.bxy,
  1912. ch4Early2: that.formState.ch4,
  1913. checkPersonEarly: that.formState.jcy,
  1914. co2Early2: that.formState.co2,
  1915. coEarly2: that.formState.co,
  1916. gwSdzEarly2: that.formState.ch4,
  1917. jwSdzEarly2: that.formState.jw,
  1918. o2Early2: that.formState.o2,
  1919. strInstallPos: that.formState.jcdd,
  1920. timeEarly2: that.formState.time,
  1921. reportTime: that.formState.tbrq,
  1922. tearly2: that.formState.temp,
  1923. };
  1924. that.paramData = Object.assign({}, that.saveShowList, param);
  1925. } else if (
  1926. that.formState.bc == "中班" &&
  1927. that.formState.count == "第一次"
  1928. ) {
  1929. let param = {
  1930. taskDetailsId: that.Ids,
  1931. deviceId: that.deviceId,
  1932. bxySdzNoon1: that.formState.bxy,
  1933. ch4Noon1: that.formState.ch4,
  1934. checkPersonNoon: that.formState.jcy,
  1935. co2Noon1: that.formState.co2,
  1936. coNoon1: that.formState.co,
  1937. gwSdzNoon1: that.formState.ch4,
  1938. jwSdzNoon1: that.formState.jw,
  1939. o2Noon1: that.formState.o2,
  1940. strInstallPos: that.formState.jcdd,
  1941. timeNoon1: that.formState.time,
  1942. reportTime: that.formState.tbrq,
  1943. tnoon1: that.formState.temp,
  1944. };
  1945. that.paramData = Object.assign({}, that.saveShowList, param);
  1946. } else if (
  1947. that.formState.bc == "中班" &&
  1948. that.formState.count == "第二次"
  1949. ) {
  1950. let param = {
  1951. taskDetailsId: that.Ids,
  1952. deviceId: that.deviceId,
  1953. bxySdzNoon2: that.formState.bxy,
  1954. ch4Noon2: that.formState.ch4,
  1955. checkPersonNoon: that.formState.jcy,
  1956. co2Noon2: that.formState.co2,
  1957. coNoon2: that.formState.co,
  1958. gwSdzNoon2: that.formState.ch4,
  1959. jwSdzNoon2: that.formState.jw,
  1960. o2Noon2: that.formState.o2,
  1961. strInstallPos: that.formState.jcdd,
  1962. timeNoon2: that.formState.time,
  1963. reportTime: that.formState.tbrq,
  1964. tnoon2: that.formState.temp,
  1965. };
  1966. that.paramData = Object.assign({}, that.saveShowList, param);
  1967. } else if (
  1968. that.formState.bc == "夜班" &&
  1969. that.formState.count == "第一次"
  1970. ) {
  1971. let param = {
  1972. taskDetailsId: that.Ids,
  1973. deviceId: that.deviceId,
  1974. bxySdzNight1: that.formState.bxy,
  1975. ch4Night1: that.formState.ch4,
  1976. checkPersonNight: that.formState.jcy,
  1977. co2Night1: that.formState.co2,
  1978. coNight1: that.formState.co,
  1979. gwSdzNight1: that.formState.ch4,
  1980. jwSdzNight1: that.formState.jw,
  1981. o2Night1: that.formState.o2,
  1982. strInstallPos: that.formState.jcdd,
  1983. timeNight1: that.formState.time,
  1984. reportTime: that.formState.tbrq,
  1985. tnight1: that.formState.temp,
  1986. };
  1987. that.paramData = Object.assign({}, that.saveShowList, param);
  1988. } else if (
  1989. that.formState.bc == "夜班" &&
  1990. that.formState.count == "第二次"
  1991. ) {
  1992. let param = {
  1993. taskDetailsId: that.Ids,
  1994. deviceId: that.deviceId,
  1995. bxySdzNight2: that.formState.bxy,
  1996. ch4Night2: that.formState.ch4,
  1997. checkPersonNight: that.formState.jcy,
  1998. co2Night2: that.formState.co2,
  1999. coNight2: that.formState.co,
  2000. gwSdzNight2: that.formState.ch4,
  2001. jwSdzNight2: that.formState.jw,
  2002. o2Night2: that.formState.o2,
  2003. strInstallPos: that.formState.jcdd,
  2004. timeNight2: that.formState.time,
  2005. reportTime: that.formState.tbrq,
  2006. tnight2: that.formState.temp,
  2007. };
  2008. that.paramData = Object.assign({}, that.saveShowList, param);
  2009. }
  2010. } else {
  2011. that.saveShowList = {};
  2012. if (
  2013. that.formState.bc == "早班" &&
  2014. that.formState.count == "第一次"
  2015. ) {
  2016. let param = {
  2017. taskDetailsId: that.Ids,
  2018. deviceId: that.deviceId,
  2019. bxySdzEarly1: that.formState.bxy,
  2020. ch4Early1: that.formState.ch4,
  2021. checkPersonEarly: that.formState.jcy,
  2022. co2Early1: that.formState.co2,
  2023. coEarly1: that.formState.co,
  2024. gwSdzEarly1: that.formState.ch4,
  2025. jwSdzEarly1: that.formState.jw,
  2026. o2Early1: that.formState.o2,
  2027. strInstallPos: that.formState.jcdd,
  2028. timeEarly1: that.formState.time,
  2029. reportTime: that.formState.tbrq,
  2030. tearly1: that.formState.temp,
  2031. };
  2032. that.paramData = Object.assign({}, that.saveShowList, param);
  2033. } else if (
  2034. that.formState.bc == "早班" &&
  2035. that.formState.count == "第二次"
  2036. ) {
  2037. let param = {
  2038. taskDetailsId: that.Ids,
  2039. deviceId: that.deviceId,
  2040. bxySdzEarly2: that.formState.bxy,
  2041. ch4Early2: that.formState.ch4,
  2042. checkPersonEarly: that.formState.jcy,
  2043. co2Early2: that.formState.co2,
  2044. coEarly2: that.formState.co,
  2045. gwSdzEarly2: that.formState.ch4,
  2046. jwSdzEarly2: that.formState.jw,
  2047. o2Early2: that.formState.o2,
  2048. strInstallPos: that.formState.jcdd,
  2049. timeEarly2: that.formState.time,
  2050. reportTime: that.formState.tbrq,
  2051. tearly2: that.formState.temp,
  2052. };
  2053. that.paramData = Object.assign({}, that.saveShowList, param);
  2054. } else if (
  2055. that.formState.bc == "中班" &&
  2056. that.formState.count == "第一次"
  2057. ) {
  2058. let param = {
  2059. taskDetailsId: that.Ids,
  2060. deviceId: that.deviceId,
  2061. bxySdzNoon1: that.formState.bxy,
  2062. ch4Noon1: that.formState.ch4,
  2063. checkPersonNoon: that.formState.jcy,
  2064. co2Noon1: that.formState.co2,
  2065. coNoon1: that.formState.co,
  2066. gwSdzNoon1: that.formState.ch4,
  2067. jwSdzNoon1: that.formState.jw,
  2068. o2Noon1: that.formState.o2,
  2069. strInstallPos: that.formState.jcdd,
  2070. timeNoon1: that.formState.time,
  2071. reportTime: that.formState.tbrq,
  2072. tnoon1: that.formState.temp,
  2073. };
  2074. that.paramData = Object.assign({}, that.saveShowList, param);
  2075. } else if (
  2076. that.formState.bc == "中班" &&
  2077. that.formState.count == "第二次"
  2078. ) {
  2079. let param = {
  2080. taskDetailsId: that.Ids,
  2081. deviceId: that.deviceId,
  2082. bxySdzNoon2: that.formState.bxy,
  2083. ch4Noon2: that.formState.ch4,
  2084. checkPersonNoon: that.formState.jcy,
  2085. co2Noon2: that.formState.co2,
  2086. coNoon2: that.formState.co,
  2087. gwSdzNoon2: that.formState.ch4,
  2088. jwSdzNoon2: that.formState.jw,
  2089. o2Noon2: that.formState.o2,
  2090. strInstallPos: that.formState.jcdd,
  2091. timeNoon2: that.formState.time,
  2092. reportTime: that.formState.tbrq,
  2093. tnoon2: that.formState.temp,
  2094. };
  2095. that.paramData = Object.assign({}, that.saveShowList, param);
  2096. } else if (
  2097. that.formState.bc == "夜班" &&
  2098. that.formState.count == "第一次"
  2099. ) {
  2100. let param = {
  2101. taskDetailsId: that.Ids,
  2102. deviceId: that.deviceId,
  2103. bxySdzNight1: that.formState.bxy,
  2104. ch4Night1: that.formState.ch4,
  2105. checkPersonNight: that.formState.jcy,
  2106. co2Night1: that.formState.co2,
  2107. coNight1: that.formState.co,
  2108. gwSdzNight1: that.formState.ch4,
  2109. jwSdzNight1: that.formState.jw,
  2110. o2Night1: that.formState.o2,
  2111. strInstallPos: that.formState.jcdd,
  2112. timeNight1: that.formState.time,
  2113. reportTime: that.formState.tbrq,
  2114. tnight1: that.formState.temp,
  2115. };
  2116. that.paramData = Object.assign({}, that.saveShowList, param);
  2117. } else if (
  2118. that.formState.bc == "夜班" &&
  2119. that.formState.count == "第二次"
  2120. ) {
  2121. let param = {
  2122. taskDetailsId: that.Ids,
  2123. deviceId: that.deviceId,
  2124. bxySdzNight2: that.formState.bxy,
  2125. ch4Night2: that.formState.ch4,
  2126. checkPersonNight: that.formState.jcy,
  2127. co2Night2: that.formState.co2,
  2128. coNight2: that.formState.co,
  2129. gwSdzNight2: that.formState.ch4,
  2130. jwSdzNight2: that.formState.jw,
  2131. o2Night2: that.formState.o2,
  2132. strInstallPos: that.formState.jcdd,
  2133. timeNight2: that.formState.time,
  2134. reportTime: that.formState.tbrq,
  2135. tnight2: that.formState.temp,
  2136. };
  2137. that.paramData = Object.assign({}, that.saveShowList, param);
  2138. }
  2139. }
  2140. } else {
  2141. reject(response);
  2142. }
  2143. })
  2144. .catch((error) => {
  2145. console.log("catch===>response", response);
  2146. reject(error);
  2147. });
  2148. });
  2149. },
  2150. //点击弹出日期下拉选项
  2151. getChangeTime() {
  2152. this.showCalendar = true;
  2153. },
  2154. //输入框内容变换
  2155. changeInput(val, data) {
  2156. if (/^00/.test(val)) {
  2157. this.formState[data] = val.replace(/^00/, "0");
  2158. if (this.formState.bc == "早班" && this.formState.count == "第一次") {
  2159. switch (data) {
  2160. case "ch4":
  2161. this.paramData.ch4Early1 = val;
  2162. this.paramData.gwSdzEarly1 = val;
  2163. break;
  2164. case "co2":
  2165. this.paramData.co2Early1 = val;
  2166. break;
  2167. case "co":
  2168. this.paramData.coEarly1 = val;
  2169. break;
  2170. case "o2":
  2171. this.paramData.o2Early1 = val;
  2172. break;
  2173. case "temp":
  2174. this.paramData.tearly1 = val;
  2175. break;
  2176. case "bxy":
  2177. this.paramData.bxySdzEarly1 = val;
  2178. break;
  2179. case "jw":
  2180. this.paramData.jwSdzEarly1 = val;
  2181. break;
  2182. }
  2183. } else if (
  2184. this.formState.bc == "早班" &&
  2185. this.formState.count == "第二次"
  2186. ) {
  2187. switch (data) {
  2188. case "ch4":
  2189. this.paramData.ch4Early2 = val;
  2190. this.paramData.gwSdzEarly2 = val;
  2191. break;
  2192. case "co2":
  2193. this.paramData.co2Early2 = val;
  2194. break;
  2195. case "co":
  2196. this.paramData.coEarly2 = val;
  2197. break;
  2198. case "o2":
  2199. this.paramData.o2Early2 = val;
  2200. break;
  2201. case "temp":
  2202. this.paramData.tearly2 = val;
  2203. break;
  2204. case "bxy":
  2205. this.paramData.bxySdzEarly2 = val;
  2206. break;
  2207. case "jw":
  2208. this.paramData.jwSdzEarly2 = val;
  2209. break;
  2210. }
  2211. } else if (
  2212. this.formState.bc == "中班" &&
  2213. this.formState.count == "第一次"
  2214. ) {
  2215. switch (data) {
  2216. case "ch4":
  2217. this.paramData.ch4Noon1 = val;
  2218. this.paramData.gwSdzNoon1 = val;
  2219. break;
  2220. case "co2":
  2221. this.paramData.co2Noon1 = val;
  2222. break;
  2223. case "co":
  2224. this.paramData.coNoon1 = val;
  2225. break;
  2226. case "o2":
  2227. this.paramData.o2Noon1 = val;
  2228. break;
  2229. case "temp":
  2230. this.paramData.tnoon1 = val;
  2231. break;
  2232. case "bxy":
  2233. this.paramData.bxySdzNoon1 = val;
  2234. break;
  2235. case "jw":
  2236. this.paramData.jwSdzNoon1 = val;
  2237. break;
  2238. }
  2239. } else if (
  2240. this.formState.bc == "中班" &&
  2241. this.formState.count == "第二次"
  2242. ) {
  2243. switch (data) {
  2244. case "ch4":
  2245. this.paramData.ch4Noon2 = val;
  2246. this.paramData.gwSdzNoon2 = val;
  2247. break;
  2248. case "co2":
  2249. this.paramData.co2Noon2 = val;
  2250. break;
  2251. case "co":
  2252. this.paramData.coNoon2 = val;
  2253. break;
  2254. case "o2":
  2255. this.paramData.o2Noon2 = val;
  2256. break;
  2257. case "temp":
  2258. this.paramData.tnoon2 = val;
  2259. break;
  2260. case "bxy":
  2261. this.paramData.bxySdzNoon2 = val;
  2262. break;
  2263. case "jw":
  2264. this.paramData.jwSdzNoon2 = val;
  2265. break;
  2266. }
  2267. } else if (
  2268. this.formState.bc == "夜班" &&
  2269. this.formState.count == "第一次"
  2270. ) {
  2271. switch (data) {
  2272. case "ch4":
  2273. this.paramData.ch4Night1 = val;
  2274. this.paramData.gwSdzNight1 = val;
  2275. break;
  2276. case "co2":
  2277. this.paramData.co2Night1 = val;
  2278. break;
  2279. case "co":
  2280. this.paramData.coNight1 = val;
  2281. break;
  2282. case "o2":
  2283. this.paramData.o2Night1 = val;
  2284. break;
  2285. case "temp":
  2286. this.paramData.tnight1 = val;
  2287. break;
  2288. case "bxy":
  2289. this.paramData.bxySdzNight1 = val;
  2290. break;
  2291. case "jw":
  2292. this.paramData.jwSdzNight1 = val;
  2293. break;
  2294. }
  2295. } else if (
  2296. this.formState.bc == "夜班" &&
  2297. this.formState.count == "第二次"
  2298. ) {
  2299. switch (data) {
  2300. case "ch4":
  2301. this.paramData.ch4Night2 = val;
  2302. this.paramData.gwSdzNight2 = val;
  2303. break;
  2304. case "co2":
  2305. this.paramData.co2Night2 = val;
  2306. break;
  2307. case "co":
  2308. this.paramData.coNight2 = val;
  2309. break;
  2310. case "o2":
  2311. this.paramData.o2Night2 = val;
  2312. break;
  2313. case "temp":
  2314. this.paramData.tnight2 = val;
  2315. break;
  2316. case "bxy":
  2317. this.paramData.bxySdzNight2 = val;
  2318. break;
  2319. case "jw":
  2320. this.paramData.jwSdzNight2 = val;
  2321. break;
  2322. }
  2323. }
  2324. } else {
  2325. this.formState[data] = val;
  2326. if (this.formState.bc == "早班" && this.formState.count == "第一次") {
  2327. switch (data) {
  2328. case "ch4":
  2329. this.paramData.ch4Early1 = val;
  2330. this.paramData.gwSdzEarly1 = val;
  2331. break;
  2332. case "co2":
  2333. this.paramData.co2Early1 = val;
  2334. break;
  2335. case "co":
  2336. this.paramData.coEarly1 = val;
  2337. break;
  2338. case "o2":
  2339. this.paramData.o2Early1 = val;
  2340. break;
  2341. case "temp":
  2342. this.paramData.tearly1 = val;
  2343. break;
  2344. case "bxy":
  2345. this.paramData.bxySdzEarly1 = val;
  2346. break;
  2347. case "jw":
  2348. this.paramData.jwSdzEarly1 = val;
  2349. break;
  2350. }
  2351. } else if (
  2352. this.formState.bc == "早班" &&
  2353. this.formState.count == "第二次"
  2354. ) {
  2355. switch (data) {
  2356. case "ch4":
  2357. this.paramData.ch4Early2 = val;
  2358. this.paramData.gwSdzEarly2 = val;
  2359. break;
  2360. case "co2":
  2361. this.paramData.co2Early2 = val;
  2362. break;
  2363. case "co":
  2364. this.paramData.coEarly2 = val;
  2365. break;
  2366. case "o2":
  2367. this.paramData.o2Early2 = val;
  2368. break;
  2369. case "temp":
  2370. this.paramData.tearly2 = val;
  2371. break;
  2372. case "bxy":
  2373. this.paramData.bxySdzEarly2 = val;
  2374. break;
  2375. case "jw":
  2376. this.paramData.jwSdzEarly2 = val;
  2377. break;
  2378. }
  2379. } else if (
  2380. this.formState.bc == "中班" &&
  2381. this.formState.count == "第一次"
  2382. ) {
  2383. switch (data) {
  2384. case "ch4":
  2385. this.paramData.ch4Noon1 = val;
  2386. this.paramData.gwSdzNoon1 = val;
  2387. break;
  2388. case "co2":
  2389. this.paramData.co2Noon1 = val;
  2390. break;
  2391. case "co":
  2392. this.paramData.coNoon1 = val;
  2393. break;
  2394. case "o2":
  2395. this.paramData.o2Noon1 = val;
  2396. break;
  2397. case "temp":
  2398. this.paramData.tnoon1 = val;
  2399. break;
  2400. case "bxy":
  2401. this.paramData.bxySdzNoon1 = val;
  2402. break;
  2403. case "jw":
  2404. this.paramData.jwSdzNoon1 = val;
  2405. break;
  2406. }
  2407. } else if (
  2408. this.formState.bc == "中班" &&
  2409. this.formState.count == "第二次"
  2410. ) {
  2411. switch (data) {
  2412. case "ch4":
  2413. this.paramData.ch4Noon2 = val;
  2414. this.paramData.gwSdzNoon2 = val;
  2415. break;
  2416. case "co2":
  2417. this.paramData.co2Noon2 = val;
  2418. break;
  2419. case "co":
  2420. this.paramData.coNoon2 = val;
  2421. break;
  2422. case "o2":
  2423. this.paramData.o2Noon2 = val;
  2424. break;
  2425. case "temp":
  2426. this.paramData.tnoon2 = val;
  2427. break;
  2428. case "bxy":
  2429. this.paramData.bxySdzNoon2 = val;
  2430. break;
  2431. case "jw":
  2432. this.paramData.jwSdzNoon2 = val;
  2433. break;
  2434. }
  2435. } else if (
  2436. this.formState.bc == "夜班" &&
  2437. this.formState.count == "第一次"
  2438. ) {
  2439. switch (data) {
  2440. case "ch4":
  2441. this.paramData.ch4Night1 = val;
  2442. this.paramData.gwSdzNight1 = val;
  2443. break;
  2444. case "co2":
  2445. this.paramData.co2Night1 = val;
  2446. break;
  2447. case "co":
  2448. this.paramData.coNight1 = val;
  2449. break;
  2450. case "o2":
  2451. this.paramData.o2Night1 = val;
  2452. break;
  2453. case "temp":
  2454. this.paramData.tnight1 = val;
  2455. break;
  2456. case "bxy":
  2457. this.paramData.bxySdzNight1 = val;
  2458. break;
  2459. case "jw":
  2460. this.paramData.jwSdzNight1 = val;
  2461. break;
  2462. }
  2463. } else if (
  2464. this.formState.bc == "夜班" &&
  2465. this.formState.count == "第二次"
  2466. ) {
  2467. switch (data) {
  2468. case "ch4":
  2469. this.paramData.ch4Night2 = val;
  2470. this.paramData.gwSdzNight2 = val;
  2471. break;
  2472. case "co2":
  2473. this.paramData.co2Night2 = val;
  2474. break;
  2475. case "co":
  2476. this.paramData.coNight2 = val;
  2477. break;
  2478. case "o2":
  2479. this.paramData.o2Night2 = val;
  2480. break;
  2481. case "temp":
  2482. this.paramData.tnight2 = val;
  2483. break;
  2484. case "bxy":
  2485. this.paramData.bxySdzNight2 = val;
  2486. break;
  2487. case "jw":
  2488. this.paramData.jwSdzNight2 = val;
  2489. break;
  2490. }
  2491. }
  2492. }
  2493. },
  2494. //便携仪失去焦点时参数校验
  2495. getBlurBxy(val) {
  2496. let str = val.substring(val.indexOf(".") + 1).split("");
  2497. if (/^(\-|\+)?\d+$/.test(val)) {
  2498. this.formState.bxy = val;
  2499. this.isRule3 = true;
  2500. } else if (
  2501. /^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val) &&
  2502. str.length <= 2
  2503. ) {
  2504. this.formState.bxy = val;
  2505. this.isRule3 = true;
  2506. } else {
  2507. this.formState.bxy = "";
  2508. this.isRule3 = false;
  2509. }
  2510. },
  2511. //新增CO2失去焦点时参数校验
  2512. getBlurCO2(val) {
  2513. let str = val.substring(val.indexOf(".") + 1).split("");
  2514. if (
  2515. val.slice(-1) == "0" ||
  2516. val.slice(-1) == "2" ||
  2517. val.slice(-1) == "4" ||
  2518. val.slice(-1) == "6" ||
  2519. val.slice(-1) == "8"
  2520. ) {
  2521. if (/^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val)) {
  2522. if (str.length <= 2) {
  2523. this.formState.co2 = val;
  2524. this.isRule = true;
  2525. } else {
  2526. this.formState.co2 = "";
  2527. this.isRule = false;
  2528. }
  2529. } else {
  2530. this.formState.co2 = val;
  2531. this.isRule = true;
  2532. }
  2533. } else {
  2534. this.formState.co2 = "";
  2535. this.isRule = false;
  2536. }
  2537. },
  2538. //新增CH4失去焦点时参数校验
  2539. getBlurCH4(val) {
  2540. let str = val.substring(val.indexOf(".") + 1).split("");
  2541. if (
  2542. val.slice(-1) == "0" ||
  2543. val.slice(-1) == "2" ||
  2544. val.slice(-1) == "4" ||
  2545. val.slice(-1) == "6" ||
  2546. val.slice(-1) == "8"
  2547. ) {
  2548. if (/^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val)) {
  2549. if (str.length <= 2) {
  2550. this.formState.ch4 = val;
  2551. this.isRule2 = true;
  2552. } else {
  2553. this.formState.ch4 = "";
  2554. this.isRule2 = false;
  2555. }
  2556. } else {
  2557. this.formState.ch4 = val;
  2558. this.isRule2 = true;
  2559. }
  2560. } else {
  2561. this.formState.ch4 = "";
  2562. this.isRule2 = false;
  2563. }
  2564. },
  2565. getBlurCO(val) {
  2566. let str = val.substring(val.indexOf(".") + 1).split("");
  2567. if (/^(\-|\+)?\d+$/.test(val) && parseFloat(val) <= 24) {
  2568. this.formState.co = val;
  2569. this.isRule14 = true;
  2570. } else if (
  2571. /^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val) &&
  2572. str.length <= 2 &&
  2573. parseFloat(val) <= 24
  2574. ) {
  2575. this.formState.co = val;
  2576. this.isRule14 = true;
  2577. } else {
  2578. this.formState.co = "";
  2579. this.isRule14 = false;
  2580. }
  2581. },
  2582. getAddSave() {
  2583. let that = this;
  2584. console.log(that.paramData, "paramData---------");
  2585. new Promise((resolve, reject) => {
  2586. api
  2587. .getAdd({ ...that.paramData })
  2588. .then((response) => {
  2589. if (response.data.code == 200) {
  2590. that.isShowAdd = false;
  2591. that.saveShowList = {};
  2592. that.paramData = {};
  2593. that.indexList = [];
  2594. that.indexParam = {};
  2595. that.imageSrc = "";
  2596. that.clearData();
  2597. uni.removeStorageSync(that.deviceID);
  2598. that.$emit("clearImg", true);
  2599. that.$emit("getBackAddress");
  2600. } else {
  2601. reject(response);
  2602. uni.showToast({
  2603. title: response.data,
  2604. icon: "none", // 可选图标,'success', 'loading', 'none'
  2605. });
  2606. }
  2607. })
  2608. .catch((error) => {
  2609. console.log("catch===>response", response);
  2610. reject(error);
  2611. uni.showToast({
  2612. title: "保存失败!",
  2613. icon: "none", // 可选图标,'success', 'loading', 'none'
  2614. });
  2615. });
  2616. });
  2617. },
  2618. getEditSave() {
  2619. let that = this;
  2620. let param = {};
  2621. if (that.classType == "早班" && that.checkNum == "1") {
  2622. param = {
  2623. id: that.formState.id,
  2624. bxySdzEarly1: that.formState.bxy,
  2625. ch4Early1: that.formState.ch4,
  2626. checkPersonEarly: that.formState.jcy,
  2627. co2Early1: that.formState.co2,
  2628. coEarly1: that.formState.co,
  2629. gwSdzEarly1: that.formState.ch4,
  2630. jwSdzEarly1: that.formState.jw,
  2631. o2Early1: that.formState.o2,
  2632. strInstallPos: that.formState.jcdd,
  2633. timeEarly1: that.formState.time,
  2634. tearly1: that.formState.temp,
  2635. bxySdzEarly2: that.editData.bxySdzEarly2,
  2636. ch4Early2: that.editData.ch4Early2,
  2637. co2Early2: that.editData.co2Early2,
  2638. coEarly2: that.editData.coEarly2,
  2639. gwSdzEarly2: that.editData.gwSdzEarly2,
  2640. jwSdzEarly2: that.editData.jwSdzEarly2,
  2641. o2Early2: that.editData.o2Early2,
  2642. timeEarly2: that.editData.timeEarly2,
  2643. tearly2: that.editData.tearly2,
  2644. bxySdzNoon1: that.editData.bxySdzNoon1,
  2645. ch4Noon1: that.editData.ch4Noon1,
  2646. checkPersonNoon: that.editData.checkPersonNoon,
  2647. co2Noon1: that.editData.co2Noon1,
  2648. coNoon1: that.editData.coNoon1,
  2649. gwSdzNoon1: that.editData.gwSdzNoon1,
  2650. jwSdzNoon1: that.editData.jwSdzNoon1,
  2651. o2Noon1: that.editData.o2Noon1,
  2652. strInstallPos: that.editData.strInstallPos,
  2653. timeNoon1: that.editData.timeNoon1,
  2654. tnoon1: that.editData.tnoon1,
  2655. bxySdzNoon2: that.editData.bxySdzNoon2,
  2656. ch4Noon2: that.editData.ch4Noon2,
  2657. co2Noon2: that.editData.co2Noon2,
  2658. coNoon2: that.editData.coNoon2,
  2659. gwSdzNoon2: that.editData.gwSdzNoon2,
  2660. jwSdzNoon2: that.editData.jwSdzNoon2,
  2661. o2Noon2: that.editData.o2Noon2,
  2662. timeNoon2: that.editData.timeNoon2,
  2663. tnoon2: that.editData.tnoon2,
  2664. bxySdzNight1: that.editData.bxySdzNight1,
  2665. ch4Night1: that.editData.ch4Night1,
  2666. checkPersonNight: that.editData.checkPersonNight,
  2667. co2Night1: that.editData.co2Night1,
  2668. coNight1: that.editData.coNight1,
  2669. gwSdzNight1: that.editData.gwSdzNight1,
  2670. jwSdzNight1: that.editData.jwSdzNight1,
  2671. o2Night1: that.editData.o2Night1,
  2672. strInstallPos: that.editData.strInstallPos,
  2673. timeNight1: that.editData.timeNight1,
  2674. tnight1: that.editData.tnight1,
  2675. bxySdzNight2: that.editData.bxySdzNight2,
  2676. ch4Night2: that.editData.ch4Night2,
  2677. co2Night2: that.editData.co2Night2,
  2678. coNight2: that.editData.coNight2,
  2679. gwSdzNight2: that.editData.gwSdzNight2,
  2680. jwSdzNight2: that.editData.jwSdzNight2,
  2681. o2Night2: that.editData.o2Night2,
  2682. timeNight2: that.editData.timeNight2,
  2683. tnight2: that.editData.tnight2,
  2684. };
  2685. } else if (that.classType == "早班" && that.checkNum == "2") {
  2686. param = {
  2687. id: that.editData.id,
  2688. bxySdzEarly1: that.editData.bxySdzEarly1,
  2689. ch4Early1: that.editData.ch4Early1,
  2690. co2Early1: that.editData.co2Early1,
  2691. coEarly1: that.editData.coEarly1,
  2692. gwSdzEarly1: that.editData.gwSdzEarly1,
  2693. jwSdzEarly1: that.editData.jwSdzEarly1,
  2694. o2Early1: that.editData.o2Early1,
  2695. timeEarly1: that.editData.timeEarly1,
  2696. tearly1: that.editData.tearly1,
  2697. bxySdzEarly2: that.formState.bxy,
  2698. ch4Early2: that.formState.ch4,
  2699. checkPersonEarly: that.formState.jcy,
  2700. co2Early2: that.formState.co2,
  2701. coEarly2: that.formState.co,
  2702. gwSdzEarly2: that.formState.ch4,
  2703. jwSdzEarly2: that.formState.jw,
  2704. o2Early2: that.formState.o2,
  2705. strInstallPos: that.formState.jcdd,
  2706. timeEarly2: that.formState.time,
  2707. tearly2: that.formState.temp,
  2708. bxySdzNoon1: that.editData.bxySdzNoon1,
  2709. ch4Noon1: that.editData.ch4Noon1,
  2710. checkPersonNoon: that.editData.checkPersonNoon,
  2711. co2Noon1: that.editData.co2Noon1,
  2712. coNoon1: that.editData.coNoon1,
  2713. gwSdzNoon1: that.editData.gwSdzNoon1,
  2714. jwSdzNoon1: that.editData.jwSdzNoon1,
  2715. o2Noon1: that.editData.o2Noon1,
  2716. strInstallPos: that.editData.strInstallPos,
  2717. timeNoon1: that.editData.timeNoon1,
  2718. tnoon1: that.editData.tnoon1,
  2719. bxySdzNoon2: that.editData.bxySdzNoon2,
  2720. ch4Noon2: that.editData.ch4Noon2,
  2721. co2Noon2: that.editData.co2Noon2,
  2722. coNoon2: that.editData.coNoon2,
  2723. gwSdzNoon2: that.editData.gwSdzNoon2,
  2724. jwSdzNoon2: that.editData.jwSdzNoon2,
  2725. o2Noon2: that.editData.o2Noon2,
  2726. timeNoon2: that.editData.timeNoon2,
  2727. tnoon2: that.editData.tnoon2,
  2728. bxySdzNight1: that.editData.bxySdzNight1,
  2729. ch4Night1: that.editData.ch4Night1,
  2730. checkPersonNight: that.editData.checkPersonNight,
  2731. co2Night1: that.editData.co2Night1,
  2732. coNight1: that.editData.coNight1,
  2733. gwSdzNight1: that.editData.gwSdzNight1,
  2734. jwSdzNight1: that.editData.jwSdzNight1,
  2735. o2Night1: that.editData.o2Night1,
  2736. strInstallPos: that.editData.strInstallPos,
  2737. timeNight1: that.editData.timeNight1,
  2738. tnight1: that.editData.tnight1,
  2739. bxySdzNight2: that.editData.bxySdzNight2,
  2740. ch4Night2: that.editData.ch4Night2,
  2741. co2Night2: that.editData.co2Night2,
  2742. coNight2: that.editData.coNight2,
  2743. gwSdzNight2: that.editData.gwSdzNight2,
  2744. jwSdzNight2: that.editData.jwSdzNight2,
  2745. o2Night2: that.editData.o2Night2,
  2746. timeNight2: that.editData.timeNight2,
  2747. tnight2: that.editData.tnight2,
  2748. };
  2749. } else if (that.classType == "中班" && that.checkNum == "1") {
  2750. param = {
  2751. id: that.editData.id,
  2752. bxySdzEarly1: that.editData.bxySdzEarly1,
  2753. ch4Early1: that.editData.ch4Early1,
  2754. co2Early1: that.editData.co2Early1,
  2755. coEarly1: that.editData.coEarly1,
  2756. gwSdzEarly1: that.editData.gwSdzEarly1,
  2757. jwSdzEarly1: that.editData.jwSdzEarly1,
  2758. o2Early1: that.editData.o2Early1,
  2759. timeEarly1: that.editData.timeEarly1,
  2760. checkPersonEarly: that.editData.checkPersonEarly,
  2761. strInstallPos: that.editData.strInstallPos,
  2762. tearly1: that.editData.tearly1,
  2763. bxySdzEarly2: that.editData.bxySdzEarly2,
  2764. ch4Early2: that.editData.ch4Early2,
  2765. co2Early2: that.editData.co2Early2,
  2766. coEarly2: that.editData.coEarly2,
  2767. gwSdzEarly2: that.editData.gwSdzEarly2,
  2768. jwSdzEarly2: that.editData.jwSdzEarly2,
  2769. o2Early2: that.editData.o2Early2,
  2770. timeEarly2: that.editData.timeEarly2,
  2771. tearly2: that.editData.tearly2,
  2772. bxySdzNoon1: that.formState.bxy,
  2773. ch4Noon1: that.formState.ch4,
  2774. checkPersonNoon: that.formState.jcy,
  2775. co2Noon1: that.formState.co2,
  2776. coNoon1: that.formState.co,
  2777. gwSdzNoon1: that.formState.ch4,
  2778. jwSdzNoon1: that.formState.jw,
  2779. o2Noon1: that.formState.o2,
  2780. strInstallPos: that.formState.jcdd,
  2781. timeNoon1: that.formState.time,
  2782. tnoon1: that.formState.temp,
  2783. bxySdzNoon2: that.editData.bxySdzNoon2,
  2784. ch4Noon2: that.editData.ch4Noon2,
  2785. co2Noon2: that.editData.co2Noon2,
  2786. coNoon2: that.editData.coNoon2,
  2787. gwSdzNoon2: that.editData.gwSdzNoon2,
  2788. jwSdzNoon2: that.editData.jwSdzNoon2,
  2789. o2Noon2: that.editData.o2Noon2,
  2790. timeNoon2: that.editData.timeNoon2,
  2791. tnoon2: that.editData.tnoon2,
  2792. bxySdzNight1: that.editData.bxySdzNight1,
  2793. ch4Night1: that.editData.ch4Night1,
  2794. checkPersonNight: that.editData.checkPersonNight,
  2795. co2Night1: that.editData.co2Night1,
  2796. coNight1: that.editData.coNight1,
  2797. gwSdzNight1: that.editData.gwSdzNight1,
  2798. jwSdzNight1: that.editData.jwSdzNight1,
  2799. o2Night1: that.editData.o2Night1,
  2800. strInstallPos: that.editData.strInstallPos,
  2801. timeNight1: that.editData.timeNight1,
  2802. tnight1: that.editData.tnight1,
  2803. bxySdzNight2: that.editData.bxySdzNight2,
  2804. ch4Night2: that.editData.ch4Night2,
  2805. co2Night2: that.editData.co2Night2,
  2806. coNight2: that.editData.coNight2,
  2807. gwSdzNight2: that.editData.gwSdzNight2,
  2808. jwSdzNight2: that.editData.jwSdzNight2,
  2809. o2Night2: that.editData.o2Night2,
  2810. timeNight2: that.editData.timeNight2,
  2811. tnight2: that.editData.tnight2,
  2812. };
  2813. } else if (that.classType == "中班" && that.checkNum == "2") {
  2814. param = {
  2815. id: that.editData.id,
  2816. bxySdzEarly1: that.editData.bxySdzEarly1,
  2817. ch4Early1: that.editData.ch4Early1,
  2818. co2Early1: that.editData.co2Early1,
  2819. coEarly1: that.editData.coEarly1,
  2820. gwSdzEarly1: that.editData.gwSdzEarly1,
  2821. jwSdzEarly1: that.editData.jwSdzEarly1,
  2822. o2Early1: that.editData.o2Early1,
  2823. timeEarly1: that.editData.timeEarly1,
  2824. checkPersonEarly: that.editData.checkPersonEarly,
  2825. strInstallPos: that.editData.strInstallPos,
  2826. tearly1: that.editData.tearly1,
  2827. bxySdzEarly2: that.editData.bxySdzEarly2,
  2828. ch4Early2: that.editData.ch4Early2,
  2829. co2Early2: that.editData.co2Early2,
  2830. coEarly2: that.editData.coEarly2,
  2831. gwSdzEarly2: that.editData.gwSdzEarly2,
  2832. jwSdzEarly2: that.editData.jwSdzEarly2,
  2833. o2Early2: that.editData.o2Early2,
  2834. timeEarly2: that.editData.timeEarly2,
  2835. tearly2: that.editData.tearly2,
  2836. bxySdzNoon1: that.editData.bxySdzNoon1,
  2837. ch4Noon1: that.editData.ch4Noon1,
  2838. co2Noon1: that.editData.co2Noon1,
  2839. coNoon1: that.editData.coNoon1,
  2840. gwSdzNoon1: that.editData.gwSdzNoon1,
  2841. jwSdzNoon1: that.editData.jwSdzNoon1,
  2842. o2Noon1: that.editData.o2Noon1,
  2843. timeNoon1: that.editData.timeNoon1,
  2844. tnoon1: that.editData.tnoon1,
  2845. bxySdzNoon2: that.formState.bxy,
  2846. ch4Noon2: that.formState.ch4,
  2847. checkPersonNoon: that.formState.jcy,
  2848. co2Noon2: that.formState.co2,
  2849. coNoon2: that.formState.co,
  2850. gwSdzNoon2: that.formState.ch4,
  2851. jwSdzNoon2: that.formState.jw,
  2852. o2Noon2: that.formState.o2,
  2853. strInstallPos: that.formState.jcdd,
  2854. timeNoon2: that.formState.time,
  2855. tnoon2: that.formState.temp,
  2856. bxySdzNight1: that.editData.bxySdzNight1,
  2857. ch4Night1: that.editData.ch4Night1,
  2858. checkPersonNight: that.editData.checkPersonNight,
  2859. co2Night1: that.editData.co2Night1,
  2860. coNight1: that.editData.coNight1,
  2861. gwSdzNight1: that.editData.gwSdzNight1,
  2862. jwSdzNight1: that.editData.jwSdzNight1,
  2863. o2Night1: that.editData.o2Night1,
  2864. strInstallPos: that.editData.strInstallPos,
  2865. timeNight1: that.editData.timeNight1,
  2866. tnight1: that.editData.tnight1,
  2867. bxySdzNight2: that.editData.bxySdzNight2,
  2868. ch4Night2: that.editData.ch4Night2,
  2869. co2Night2: that.editData.co2Night2,
  2870. coNight2: that.editData.coNight2,
  2871. gwSdzNight2: that.editData.gwSdzNight2,
  2872. jwSdzNight2: that.editData.jwSdzNight2,
  2873. o2Night2: that.editData.o2Night2,
  2874. timeNight2: that.editData.timeNight2,
  2875. tnight2: that.editData.tnight2,
  2876. };
  2877. } else if (that.classType == "夜班" && that.checkNum == "1") {
  2878. param = {
  2879. id: that.editData.id,
  2880. bxySdzEarly1: that.editData.bxySdzEarly1,
  2881. ch4Early1: that.editData.ch4Early1,
  2882. co2Early1: that.editData.co2Early1,
  2883. coEarly1: that.editData.coEarly1,
  2884. gwSdzEarly1: that.editData.gwSdzEarly1,
  2885. jwSdzEarly1: that.editData.jwSdzEarly1,
  2886. o2Early1: that.editData.o2Early1,
  2887. timeEarly1: that.editData.timeEarly1,
  2888. checkPersonEarly: that.editData.checkPersonEarly,
  2889. strInstallPos: that.editData.strInstallPos,
  2890. tearly1: that.editData.tearly1,
  2891. bxySdzEarly2: that.editData.bxySdzEarly2,
  2892. ch4Early2: that.editData.ch4Early2,
  2893. co2Early2: that.editData.co2Early2,
  2894. coEarly2: that.editData.coEarly2,
  2895. gwSdzEarly2: that.editData.gwSdzEarly2,
  2896. jwSdzEarly2: that.editData.jwSdzEarly2,
  2897. o2Early2: that.editData.o2Early2,
  2898. timeEarly2: that.editData.timeEarly2,
  2899. tearly2: that.editData.tearly2,
  2900. bxySdzNoon1: that.editData.bxySdzNoon1,
  2901. ch4Noon1: that.editData.ch4Noon1,
  2902. co2Noon1: that.editData.co2Noon1,
  2903. coNoon1: that.editData.coNoon1,
  2904. gwSdzNoon1: that.editData.gwSdzNoon1,
  2905. jwSdzNoon1: that.editData.jwSdzNoon1,
  2906. o2Noon1: that.editData.o2Noon1,
  2907. timeNoon1: that.editData.timeNoon1,
  2908. tnoon1: that.editData.tnoon1,
  2909. bxySdzNoon2: that.editData.bxySdzNoon2,
  2910. ch4Noon2: that.editData.ch4Noon2,
  2911. checkPersonNoon: that.editData.checkPersonNoon,
  2912. co2Noon2: that.editData.co2Noon2,
  2913. coNoon2: that.editData.coNoon2,
  2914. gwSdzNoon2: that.editData.gwSdzNoon2,
  2915. jwSdzNoon2: that.editData.jwSdzNoon2,
  2916. o2Noon2: that.editData.o2Noon2,
  2917. strInstallPos: that.editData.strInstallPos,
  2918. timeNoon2: that.editData.timeNoon2,
  2919. tnoon2: that.editData.tnoon2,
  2920. bxySdzNight1: that.formState.bxy,
  2921. ch4Night1: that.formState.ch4,
  2922. checkPersonNight: that.formState.jcy,
  2923. co2Night1: that.formState.co2,
  2924. coNight1: that.formState.co,
  2925. gwSdzNight1: that.formState.ch4,
  2926. jwSdzNight1: that.formState.jw,
  2927. o2Night1: that.formState.o2,
  2928. strInstallPos: that.formState.jcdd,
  2929. timeNight1: that.formState.time,
  2930. tnight1: that.formState.temp,
  2931. bxySdzNight2: that.editData.bxySdzNight2,
  2932. ch4Night2: that.editData.ch4Night2,
  2933. co2Night2: that.editData.co2Night2,
  2934. coNight2: that.editData.coNight2,
  2935. gwSdzNight2: that.editData.gwSdzNight2,
  2936. jwSdzNight2: that.editData.jwSdzNight2,
  2937. o2Night2: that.editData.o2Night2,
  2938. timeNight2: that.editData.timeNight2,
  2939. tnight2: that.editData.tnight2,
  2940. };
  2941. } else if (that.classType == "夜班" && that.checkNum == "2") {
  2942. param = {
  2943. id: that.editData.id,
  2944. bxySdzEarly1: that.editData.bxySdzEarly1,
  2945. ch4Early1: that.editData.ch4Early1,
  2946. co2Early1: that.editData.co2Early1,
  2947. coEarly1: that.editData.coEarly1,
  2948. gwSdzEarly1: that.editData.gwSdzEarly1,
  2949. jwSdzEarly1: that.editData.jwSdzEarly1,
  2950. o2Early1: that.editData.o2Early1,
  2951. timeEarly1: that.editData.timeEarly1,
  2952. checkPersonEarly: that.editData.checkPersonEarly,
  2953. strInstallPos: that.editData.strInstallPos,
  2954. tearly1: that.editData.tearly1,
  2955. bxySdzEarly2: that.editData.bxySdzEarly2,
  2956. ch4Early2: that.editData.ch4Early2,
  2957. co2Early2: that.editData.co2Early2,
  2958. coEarly2: that.editData.coEarly2,
  2959. gwSdzEarly2: that.editData.gwSdzEarly2,
  2960. jwSdzEarly2: that.editData.jwSdzEarly2,
  2961. o2Early2: that.editData.o2Early2,
  2962. timeEarly2: that.editData.timeEarly2,
  2963. tearly2: that.editData.tearly2,
  2964. bxySdzNoon1: that.editData.bxySdzNoon1,
  2965. ch4Noon1: that.editData.ch4Noon1,
  2966. co2Noon1: that.editData.co2Noon1,
  2967. coNoon1: that.editData.coNoon1,
  2968. gwSdzNoon1: that.editData.gwSdzNoon1,
  2969. jwSdzNoon1: that.editData.jwSdzNoon1,
  2970. o2Noon1: that.editData.o2Noon1,
  2971. timeNoon1: that.editData.timeNoon1,
  2972. tnoon1: that.editData.tnoon1,
  2973. bxySdzNoon2: that.editData.bxySdzNoon2,
  2974. ch4Noon2: that.editData.ch4Noon2,
  2975. checkPersonNoon: that.editData.checkPersonNoon,
  2976. co2Noon2: that.editData.co2Noon2,
  2977. coNoon2: that.editData.coNoon2,
  2978. gwSdzNoon2: that.editData.gwSdzNoon2,
  2979. jwSdzNoon2: that.editData.jwSdzNoon2,
  2980. o2Noon2: that.editData.o2Noon2,
  2981. strInstallPos: that.editData.strInstallPos,
  2982. timeNoon2: that.editData.timeNoon2,
  2983. tnoon2: that.editData.tnoon2,
  2984. bxySdzNight1: that.editData.bxySdzNight1,
  2985. ch4Night1: that.editData.ch4Night1,
  2986. co2Night1: that.editData.co2Night1,
  2987. coNight1: that.editData.coNight1,
  2988. gwSdzNight1: that.editData.gwSdzNight1,
  2989. jwSdzNight1: that.editData.jwSdzNight1,
  2990. o2Night1: that.editData.o2Night1,
  2991. timeNight1: that.editData.timeNight1,
  2992. tnight1: that.editData.tnight1,
  2993. bxySdzNight2: that.formState.bxy,
  2994. ch4Night2: that.formState.ch4,
  2995. checkPersonNight: that.formState.jcy,
  2996. co2Night2: that.formState.co2,
  2997. coNight2: that.formState.co,
  2998. gwSdzNight2: that.formState.ch4,
  2999. jwSdzNight2: that.formState.jw,
  3000. o2Night2: that.formState.o2,
  3001. strInstallPos: that.formState.jcdd,
  3002. timeNight2: that.formState.time,
  3003. tnight2: that.formState.temp,
  3004. };
  3005. }
  3006. new Promise((resolve, reject) => {
  3007. api
  3008. .getEdit({ ...param })
  3009. .then((response) => {
  3010. if (response.data.code == 200) {
  3011. that.isShowAdd = false;
  3012. that.editData = {};
  3013. that.clearData();
  3014. that.$emit("getBackAddress");
  3015. } else {
  3016. reject(response);
  3017. }
  3018. })
  3019. .catch((error) => {
  3020. console.log("catch===>response", response);
  3021. reject(error);
  3022. });
  3023. });
  3024. },
  3025. //新增保存
  3026. getConfirm() {
  3027. let that = this;
  3028. let flag = false;
  3029. Object.keys(that.formState).forEach((el) => {
  3030. if (el != "id" && that.formState[el] == "") {
  3031. flag = true;
  3032. }
  3033. });
  3034. if (that.statusShow == "add") {
  3035. if (flag) {
  3036. uni.showToast({
  3037. title: "请检查上报数据选项是否为空!",
  3038. icon: "none", // 可选图标,'success', 'loading', 'none'
  3039. });
  3040. } else {
  3041. that.getAddSave();
  3042. }
  3043. } else {
  3044. if (flag) {
  3045. uni.showToast({
  3046. title: "请检查上报数据选项是否为空!",
  3047. icon: "none", // 可选图标,'success', 'loading', 'none'
  3048. });
  3049. } else {
  3050. that.getEditSave();
  3051. }
  3052. }
  3053. },
  3054. clearData() {
  3055. this.formState = {
  3056. id: "",
  3057. bc: "",
  3058. count: "",
  3059. jcdd: "",
  3060. // mcgzm: '',
  3061. jcy: "",
  3062. time: "",
  3063. ch4: "",
  3064. co2: "",
  3065. co: "",
  3066. o2: "",
  3067. jw: "",
  3068. bxy: "",
  3069. tbrq: "",
  3070. temp: "",
  3071. };
  3072. this.isRule = true;
  3073. this.isRule2 = true;
  3074. this.isRule1 = true;
  3075. this.isRule3 = true;
  3076. this.isRule14 = true;
  3077. },
  3078. //新增取消
  3079. getCancel() {
  3080. this.isShowAdd = false;
  3081. // this.statusShow = ''
  3082. this.saveShowList = {};
  3083. this.indexParam = {};
  3084. this.paramData = {};
  3085. this.clearData();
  3086. if (this.statusShow == "edit") {
  3087. this.$emit("getBackAddress");
  3088. }
  3089. },
  3090. //获取瓦斯上报列表数据
  3091. getGasList() {
  3092. let that = this;
  3093. new Promise((resolve, reject) => {
  3094. api
  3095. .getGas({ reportTime: that.searchTime, deviceId: that.deviceID })
  3096. .then((response) => {
  3097. if (response.data.code == 200) {
  3098. that.gasList = response.data.result.records;
  3099. if (that.gasList.length != 0) {
  3100. that.editData = that.gasList.filter(
  3101. (v) => v.deviceId == that.deviceID
  3102. )[0];
  3103. if (that.classType == "夜班" && that.checkNum == "1") {
  3104. that.formState = {
  3105. id: that.editData.id || "",
  3106. bc: "夜班",
  3107. count: "第一次",
  3108. jcdd: that.editData.strInstallPos || "",
  3109. jcy: that.editData.checkPersonNight || "",
  3110. time: that.editData.timeNight1 || "",
  3111. ch4: that.editData.ch4Night1 || "",
  3112. co2: that.editData.co2Night1 || "",
  3113. co: that.editData.coNight1 || "",
  3114. o2: that.editData.o2Night1 || "",
  3115. jw: that.editData.jwSdzNight1 || "-",
  3116. bxy: that.editData.bxySdzNight1 || "",
  3117. tbrq: that.editData.reportTime,
  3118. temp: that.editData.tnight1 || "",
  3119. // mcgzm: that.formState.mcgzm,
  3120. };
  3121. } else if (that.classType == "夜班" && that.checkNum == "2") {
  3122. that.formState = {
  3123. id: that.editData.id || "",
  3124. bc: "夜班",
  3125. count: "第二次",
  3126. jcdd: that.editData.strInstallPos || "",
  3127. jcy: that.editData.checkPersonNight || "",
  3128. time: that.editData.timeNight2 || "",
  3129. ch4: that.editData.ch4Night2 || "",
  3130. co2: that.editData.co2Night2 || "",
  3131. co: that.editData.coNight2 || "",
  3132. o2: that.editData.o2Night2 || "",
  3133. jw: that.editData.jwSdzNight2 || "-",
  3134. bxy: that.editData.bxySdzNight2 || "",
  3135. tbrq: that.editData.reportTime,
  3136. temp: that.editData.tnight2 || "",
  3137. // mcgzm: that.formState.mcgzm,
  3138. };
  3139. } else if (that.classType == "早班" && that.checkNum == "1") {
  3140. that.formState = {
  3141. id: that.editData.id || "",
  3142. bc: "早班",
  3143. count: "第一次",
  3144. jcdd: that.editData.strInstallPos || "",
  3145. jcy: that.editData.checkPersonEarly || "",
  3146. time: that.editData.timeEarly1 || "",
  3147. ch4: that.editData.ch4Early1 || "",
  3148. co2: that.editData.co2Early1 || "",
  3149. co: that.editData.coEarly1 || "",
  3150. o2: that.editData.o2Early1 || "",
  3151. jw: that.editData.jwSdzEarly1 || "-",
  3152. bxy: that.editData.bxySdzEarly1 || "",
  3153. tbrq: that.editData.reportTime,
  3154. temp: that.editData.tearly1 || "",
  3155. // mcgzm: that.formState.mcgzm,
  3156. };
  3157. } else if (that.classType == "早班" && that.checkNum == "2") {
  3158. that.formState = {
  3159. id: that.editData.id || "",
  3160. bc: "早班",
  3161. count: "第二次",
  3162. jcdd: that.editData.strInstallPos || "",
  3163. jcy: that.editData.checkPersonEarly || "",
  3164. time: that.editData.timeEarly2 || "",
  3165. ch4: that.editData.ch4Early2 || "",
  3166. co2: that.editData.co2Early2 || "",
  3167. co: that.editData.coEarly2 || "",
  3168. o2: that.editData.o2Early2 || "",
  3169. jw: that.editData.jwSdzEarly2 || "-",
  3170. bxy: that.editData.bxySdzEarly2 || "",
  3171. tbrq: that.editData.reportTime,
  3172. temp: that.editData.tearly2 || "",
  3173. // mcgzm: that.formState.mcgzm,
  3174. };
  3175. } else if (that.classType == "中班" && that.checkNum == "1") {
  3176. that.formState = {
  3177. id: that.editData.id || "",
  3178. bc: "中班",
  3179. count: "第一次",
  3180. jcdd: that.editData.strInstallPos || "",
  3181. jcy: that.editData.checkPersonNoon || "",
  3182. time: that.editData.timeNoon1 || "",
  3183. ch4: that.editData.ch4Noon1 || "",
  3184. co2: that.editData.co2Noon1 || "",
  3185. co: that.editData.coNoon1 || "",
  3186. o2: that.editData.o2Noon1 || "",
  3187. jw: that.editData.jwSdzNoon1 || "-",
  3188. bxy: that.editData.bxySdzNoon1 || "",
  3189. tbrq: that.editData.reportTime,
  3190. temp: that.editData.tnoon1 || "",
  3191. // mcgzm: that.formState.mcgzm,
  3192. };
  3193. } else if (that.classType == "中班" && that.checkNum == "2") {
  3194. that.formState = {
  3195. id: that.editData.id || "",
  3196. bc: "中班",
  3197. count: "第二次",
  3198. jcdd: that.editData.strInstallPos || "",
  3199. jcy: that.editData.checkPersonNoon || "",
  3200. time: that.editData.timeNoon2 || "",
  3201. ch4: that.editData.ch4Noon2 || "",
  3202. co2: that.editData.co2Noon2 || "",
  3203. co: that.editData.coNoon2 || "",
  3204. o2: that.editData.o2Noon2 || "",
  3205. jw: that.editData.jwSdzNoon2 || "-",
  3206. bxy: that.editData.bxySdzNoon2 || "",
  3207. tbrq: that.editData.reportTime,
  3208. temp: that.editData.tnoon2 || "",
  3209. // mcgzm: that.formState.mcgzm,
  3210. };
  3211. }
  3212. } else {
  3213. that.editData = {};
  3214. }
  3215. } else {
  3216. reject(response);
  3217. }
  3218. });
  3219. });
  3220. },
  3221. //获取任务详情图片
  3222. getTaskImg() {
  3223. let that = this;
  3224. let apiUrlImg = `${configService.apiUrlP}:6008`;
  3225. // let formDataStr = {
  3226. // reportdate: '2025-04-10',
  3227. // checkpath: '22106工作面',
  3228. // order: '中班',
  3229. // checkorder: 1,
  3230. // }
  3231. let formDataStr = {
  3232. reportdate: that.searchTime,
  3233. checkpath: that.deviceName,
  3234. order: that.classType,
  3235. checkorder: Number(that.checkNum),
  3236. };
  3237. uni.request({
  3238. url: `${apiUrlImg}/gasServerImg`,
  3239. method: "post",
  3240. responseType: "arraybuffer", // 确保以二进制形式接收数据
  3241. data: formDataStr,
  3242. success: (res) => {
  3243. if (res.data instanceof ArrayBuffer) {
  3244. let arrayBufferView = new Uint8Array(res.data);
  3245. // 你可以在这里对arrayBufferView进行操作
  3246. console.log(arrayBufferView);
  3247. const base64 =
  3248. "data:image/png;base64," +
  3249. uni.arrayBufferToBase64(arrayBufferView);
  3250. that.imageSrcView = base64 || "";
  3251. }
  3252. },
  3253. fail: (err) => {
  3254. console.error("请求失败:", err);
  3255. },
  3256. });
  3257. },
  3258. //更新图片
  3259. getUpdateImg() {
  3260. let that = this;
  3261. let apiUrlImg = `${configService.apiUrlP}:6008`;
  3262. uni.uploadFile({
  3263. url: `${apiUrlImg}/gasImgUpdate`,
  3264. filePath: that.imageSrcView,
  3265. name: "img",
  3266. formData: {
  3267. order: that.classType,
  3268. checkorder: Number(that.checkNum),
  3269. reportdate: that.searchTime,
  3270. checkpath: that.deviceName,
  3271. },
  3272. success: (res) => {
  3273. if (res.statusCode == 200) {
  3274. uni.showToast({
  3275. title: JSON.parse(res.data).res,
  3276. icon: "none", // 可选图标,'success', 'loading', 'none'
  3277. });
  3278. }
  3279. },
  3280. fail: (error) => {
  3281. uni.showToast({
  3282. title: "图片更新失败!",
  3283. icon: "none", // 可选图标,'success', 'loading', 'none'
  3284. });
  3285. },
  3286. });
  3287. },
  3288. },
  3289. };
  3290. </script>
  3291. <style lang="scss" scoped>
  3292. .gas-fill {
  3293. position: relative;
  3294. width: 100%;
  3295. height: 100%;
  3296. .top-title {
  3297. height: 28px;
  3298. margin-bottom: 5px;
  3299. display: flex;
  3300. justify-content: space-between;
  3301. align-items: center;
  3302. }
  3303. .top-content {
  3304. .content-title {
  3305. height: 26px;
  3306. line-height: 26px;
  3307. padding: 0px 20px;
  3308. font-size: 12px;
  3309. background: url("/static/warndata/title.png") no-repeat;
  3310. background-size: 100% 100%;
  3311. }
  3312. .content-item-box {
  3313. padding: 10px 0px;
  3314. .content-item {
  3315. height: 50px;
  3316. display: flex;
  3317. justify-content: space-between;
  3318. align-items: center;
  3319. background: linear-gradient(
  3320. to right,
  3321. rgba(55, 135, 254, 0.08),
  3322. rgba(4, 184, 255, 0.08),
  3323. rgba(60, 161, 237, 0.08)
  3324. );
  3325. border-radius: 10px;
  3326. margin-bottom: 5px;
  3327. .item-l {
  3328. width: calc(50% - 2px);
  3329. height: 100%;
  3330. display: flex;
  3331. flex-direction: column;
  3332. justify-content: center;
  3333. // align-items: center;
  3334. align-items: flex-start;
  3335. padding: 0px 5px 0px 10px;
  3336. box-sizing: border-box;
  3337. }
  3338. .item-c {
  3339. width: 4px;
  3340. height: 70%;
  3341. border-left: 2px solid;
  3342. border-image: linear-gradient(
  3343. to bottom,
  3344. transparent,
  3345. rgba(140, 203, 254, 1),
  3346. transparent
  3347. )
  3348. 1 1 1;
  3349. }
  3350. .item-r {
  3351. width: calc(50% - 2px);
  3352. height: 100%;
  3353. display: flex;
  3354. flex-direction: column;
  3355. justify-content: center;
  3356. // align-items: center;
  3357. align-items: flex-start;
  3358. padding: 0px 5px 0px 10px;
  3359. box-sizing: border-box;
  3360. }
  3361. }
  3362. }
  3363. }
  3364. .item-value {
  3365. display: flex;
  3366. justify-content: space-between;
  3367. align-items: center;
  3368. width: 100%;
  3369. height: 20px;
  3370. line-height: 20px;
  3371. color: #0eb4fc;
  3372. font-weight: bold;
  3373. }
  3374. .item-label {
  3375. font-size: 12px;
  3376. }
  3377. .top-dialog-area,
  3378. .center-dialog-area,
  3379. .bottom-dialog-area {
  3380. width: 100%;
  3381. padding: 10px 20px;
  3382. box-sizing: border-box;
  3383. background-color: #fff;
  3384. margin-bottom: 2px;
  3385. }
  3386. .top-gas-list {
  3387. position: fixed;
  3388. display: flex;
  3389. flex-direction: column;
  3390. align-items: center;
  3391. width: 100%;
  3392. padding: 10px 20px;
  3393. box-sizing: border-box;
  3394. background-color: #fff;
  3395. margin-bottom: 2px;
  3396. z-index: 999;
  3397. }
  3398. .bot-gas-list {
  3399. width: 100%;
  3400. height: 100%;
  3401. padding: 10px;
  3402. box-sizing: border-box;
  3403. background-color: #fff;
  3404. overflow-y: auto;
  3405. }
  3406. .bot-gas-list1 {
  3407. width: 100%;
  3408. height: 100%;
  3409. // padding: 10px;
  3410. margin-bottom: 2px;
  3411. box-sizing: border-box;
  3412. background-color: #fff;
  3413. overflow-y: auto;
  3414. }
  3415. .dialog-btn {
  3416. display: flex;
  3417. width: 100%;
  3418. padding: 8px 10px;
  3419. box-sizing: border-box;
  3420. background-color: #fff;
  3421. // margin-bottom: 2px;
  3422. .u-button {
  3423. margin: 0px 10px;
  3424. }
  3425. }
  3426. .dialog-title {
  3427. height: 26px;
  3428. line-height: 26px;
  3429. padding: 0px 20px;
  3430. margin-bottom: 10px;
  3431. font-size: 12px;
  3432. background: url("/static/warndata/title.png") no-repeat;
  3433. background-size: 100% 100%;
  3434. }
  3435. .dialog-item {
  3436. display: flex;
  3437. align-items: center;
  3438. justify-content: center;
  3439. margin-bottom: 10px;
  3440. .dialog-label {
  3441. // width: 120px;
  3442. width: 84px;
  3443. text-align: right;
  3444. }
  3445. }
  3446. .content-title-gas {
  3447. position: relative;
  3448. height: 26px;
  3449. line-height: 26px;
  3450. padding-left: 20px;
  3451. font-size: 12px;
  3452. background: url("/static/warndata/title.png") no-repeat;
  3453. background-size: 100% 100%;
  3454. }
  3455. .icon-gas-edit {
  3456. position: absolute;
  3457. right: 35px;
  3458. top: 0;
  3459. cursor: pointer;
  3460. }
  3461. .icon-gas-del {
  3462. position: absolute;
  3463. right: 10px;
  3464. top: 0;
  3465. cursor: pointer;
  3466. }
  3467. .zoomable {
  3468. transition: transform 0.5s;
  3469. /* 平滑过渡效果 */
  3470. }
  3471. .imgView {
  3472. width: 100%;
  3473. overflow: hidden;
  3474. }
  3475. }
  3476. ::v-deep .u-input {
  3477. padding: 2px 6px !important;
  3478. }
  3479. ::v-deep .u-popup {
  3480. flex: 0;
  3481. }
  3482. ::v-deep .uni-select {
  3483. height: 30px;
  3484. border: 1px solid #dadbde;
  3485. }
  3486. ::v-deep .uni-select__input-box {
  3487. height: 30px;
  3488. }
  3489. ::v-deep .uni-select__input-placeholder {
  3490. font-size: 14px;
  3491. text-align: center;
  3492. color: rgb(192, 196, 204);
  3493. }
  3494. ::v-deep .u-modal__title {
  3495. font-size: 16px;
  3496. font-weight: bold;
  3497. color: #606266;
  3498. text-align: center;
  3499. padding-top: 10px;
  3500. }
  3501. ::v-deep .u-modal__content {
  3502. padding: 12px 25px 20px 25px;
  3503. }
  3504. ::v-deep .u-modal__button-group__wrapper {
  3505. height: 36px;
  3506. }
  3507. ::v-deep .u-modal__content {
  3508. margin: 15px 15px 0px 15px;
  3509. padding: 0;
  3510. overflow: hidden;
  3511. }
  3512. </style>