gasImgIdentify.vue 113 KB

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