gasImgIdentify.vue 137 KB

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