gasImgIdentify.vue 134 KB

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