gasImgIdentify.vue 141 KB

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