gasImgIdentify.vue 142 KB

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