gasImgIdentify.vue 134 KB

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