gasImgIdentify.vue 134 KB

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