gasImgIdentify.vue 114 KB

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