gasImgIdentify.vue 106 KB

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