gasImgIdentify.vue 110 KB

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