gasImgIdentify.vue 134 KB

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