gasImgIdentify.vue 132 KB

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