gasImgIdentify.vue 110 KB

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