gasImgIdentify.vue 135 KB

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