safecheck-client 3.0.34-32 → 3.0.34-34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1248 +1,1258 @@
1
- <template>
2
- <div class="select-overspread repair-bg auto" style="padding-bottom:5px;">
3
- <!--<div class="bq-parent" v-if="shutype == 'heng'">-->
4
- <!--<blockquote class="blockquote">-->
5
- <!--<p><span>{{repairitem.header}}</span><a @click="mute()" style="float:right" href="#" class="repair-mute-class"><img src="../../../assets/novoice.png" width="25px;" alt=""><span style="margin-left:10px;color: #304A66">关闭声音</span></a></p>-->
6
- <!--</blockquote>-->
7
- <!--</div>-->
8
- <div class="panel panel-default auto repair-info-content">
9
- <div class="panel-body" style="padding: 0">
10
- <!-- 安检项内容 -->
11
- <div class="auto repair-info-content compatible" style="padding: 0">
12
- <div class="row auto" style="padding: 0">
13
- <div v-show="false" class="{{shuclass}}" v-if=" device.device != '燃气表'">
14
- <button type="button" name="button" class="btn btn-primary" @click='adddetails()' :disabled="issee">增加</button>
15
- </div>
16
- <!--<div class="{{shuclass}}" v-if="device.device != '燃气表' && candelete">-->
17
- <!--<button type="button" name="button" class="btn btn-primary" @click='deletedetails()' :disabled="issee">删除</button>-->
18
- <!--</div>-->
19
- <div class="shuclass1" v-show="row.isshow" v-for="(idxs,row) in f_items" style="padding: 4px; border:1px solid #D4D4D4;border-bottom: 0" >
20
- <label v-if="row.type != 'radio' && row.type != 'text' && row.type != 'picture' && row.type != 'checkbox'" v-show="row.isshow" class="fivelabel">{{row.f_item_name}}<span v-if="row.unit">({{row.unit}})</span><br/>{{row.remark}}</label>
21
- <label v-if="row.type == 'radio'" v-show="row.isshow" class="radiolabel">{{row.f_item_name}}<span v-if="row.unit">({{row.unit}})</span><br/>{{row.remark}}</label>
22
- <label v-if="row.type == 'text'" v-show="row.isshow" class="textlabel1">{{row.f_item_name}}<span v-if="row.unit">({{row.unit}})</span><br/>{{row.remark}}</label>
23
- <label v-if="row.type == 'picture' || row.type == 'checkbox'" v-show="row.isshow" class="textlabel">{{row.f_item_name}}<br/>{{row.remark}}</label>
24
- <!--<span v-if="show" style="font-weight:bold">{{row.f_content}}</span>-->
25
- <!--<datepicker placeholder="请选择时间"-->
26
- <!--:value.sync="row.f_content"-->
27
- <!--v-model="row.f_content"-->
28
- <!--:format="'yyyy-MM-dd'"-->
29
- <!--v-if="!show && row.type == 'date'"-->
30
- <!--:readonly="true"-->
31
- <!--&gt;</datepicker>-->
32
- <div style="clear: both" v-if="row.type == 'picture'" class="form-group col-sm-12" >
33
- <div class="auto" >
34
- <div class="panel">
35
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
36
- <div class="row" style="height: 160px;width:160px;overflow: scroll;top: 1px">
37
- <div class="col-sm-4" v-show="row.f_path">
38
- <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
39
- </div>
40
- <div class="col-sm-4" v-show="!row.f_path" @click="takePic(idxs, row.f_item_name)">
41
- <img src="../../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
42
- </div>
43
- <img v-show="row.f_path" src="../../../assets/remove.png" :class="style__" @click="delfile(idxs, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
44
- </div>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
- <div style="float: left;width:60%" class="form-group" v-if="row.type == 'string'" v-show="row.isshow">
50
- <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" :readonly="role == 'androidview' || row.readonly">
51
- </div>
52
- <div style="float: left;width:60%" class="form-group col-sm-12" v-if="row.type == 'date'" v-show="row.isshow">
53
- <datepicker id="f_making_date" :placeholder= row.f_item_name
54
- :value.sync="row.f_item_value"
55
- v-if="row.type == 'date'"
56
- v-show="row.isshow"
57
- :disabled-days-of-Week="[]"
58
- :format="'yyyy-MM-dd HH:mm:ss'"
59
- :show-reset-button="reset" readonly="readonly">
60
- </datepicker>
61
- </div>
62
-
63
- <div style="float: left;width:60%" class="form-group" v-if="!show && row.type == 'number'" v-show="row.isshow">
64
- <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" onkeyup="value=value.replace(/[^\d\.]/g,'')" :readonly="row.readonly">
65
- </div>
66
- <!--<input type="text" class="form-control" v-model="row.f_content" v-if="!show && row.type == 'string' && row.f_project != '表号'" :disabled="(!(ischecked == '有')) || issee" :readonly="issee">-->
67
- <!--<input type="text" class="form-control" v-model="meternum" v-if="!show && row.type == 'string' && row.f_project == '表号' " :disabled="(!(ischecked == '有')) || issee" :readonly="issee" >-->
68
- <!--<button type="button" name="button" class="btn btn-primary" @click="scan" v-if="!show && row.f_project == '表号' ">扫码</button>-->
69
- <input-select v-if="row.type == 'inputSelector'"
70
- v-show="row.isshow"
71
- :value.sync="row.selected"
72
- v-model="row.selected"
73
- :readonly="false"
74
- :options="row.options"
75
- @change="changse"
76
- @click="transelation(idxs)"></input-select>
77
- <v-select style="float: left" :value.sync="row.selected"
78
- v-model="row.selected"
79
- v-if="row.type == 'selector'"
80
- :search="false"
81
- v-show="row.isshow"
82
- placeholder='请选择'
83
- :options="row.options"
84
- :disabled="role == 'androidview' || row.readonly"
85
- @change="changse"
86
- @click="transelation(idxs)"
87
- :multiple="row.multiple"
88
- :close-on-select="!row.multiple" clear-button></v-select>
89
- <div style="float: left;width: 30%" class="form-group" v-if="!show && row.type == 'radio'">
90
- <div class="col-xs-6 col-sm-6 col-md-6" v-for="item in row.options">
91
- <!-- <input type="radio" :name="row.f_item_name" @click="disSelect($parent.idxs,item.value)" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value" >-->
92
- <input type="radio" :name="row.f_item_name" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value" >
93
- <span>{{item.label}}</span>
94
- </div>
95
- </div>
96
- <div v-if="!show && row.type == 'checkbox'" class="col-xs-12 col-sm-12 col-md-12" style="white-space: nowrap" >
97
- <div style="float: left" v-for="item in row.options">
98
- <input type="checkbox" :name="row.f_item_name" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value">
99
- <span>{{item.label}}</span>
100
- </div>
101
- </div>
102
- <div style="clear: both">
103
- <label v-if="row.f_item_value.indexOf('其他') >-1" class="fivelabel">其他</label>
104
- <div style="float: left;width:60%" class="form-group" v-if="row.f_item_value.indexOf('其他') >-1">
105
- <input type="text" class="form-control" maxlength="100" v-model="row.f_else" :readonly="role == 'androidview' || row.readonly">
106
- </div>
107
- </div>
108
- <div style="clear: both">
109
- <!-- <div class="form-group" style="display: flex;flex-wrap: wrap" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '') && (livedispose == 'true' || livedispose == true) " >-->
110
- <!-- <label class="fivelabel">现场已处理</label>-->
111
- <!-- <v-select :value="row.f_live_dispose"-->
112
- <!-- :value-single="true"-->
113
- <!-- :options="lives"-->
114
- <!-- :disabled="role == 'androidview'"-->
115
- <!-- @change="changlive"-->
116
- <!-- @click="transelation(idxs)"-->
117
- <!-- close-on-select clear-button></v-select>-->
118
- <!-- </div>-->
119
- <div class="form-group" style="display: flex;flex-wrap: wrap" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '') && (dealdispose == 'true' || dealdispose == true) " >
120
- <label class="fivelabel">处理方式</label>
121
- <v-select :value="row.f_deal_dispose"
122
- :value-single="true"
123
- :options="deals"
124
- :disabled="role == 'androidview'"
125
- @change="changdeal"
126
- @click="transelation(idxs)"
127
- close-on-select clear-button></v-select>
128
- </div>
129
- <div style="margin-left: 10px" class="form-group col-sm-10" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && row.tooltip != undefined && row.tooltip != '' ">
130
- ☆{{row.tooltip}}
131
- </div>
132
- <div class="form-group col-sm-12" style="display: flex;flex-wrap: wrap" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '')">
133
- <div class="auto" style="margin:1px;">
134
- <div class="panel">
135
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
136
- <div class="col-xs-6" style="height: 160px;width:160px;overflow: scroll;top: 1px">
137
- <div class="col-sm-4" v-show="row.f_path">
138
- <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
139
- </div>
140
- <div class="col-sm-4" v-show="!row.f_path" @click="takePic(idxs, row.f_item_name)">
141
- <img src="../../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
142
- </div>
143
- <img v-show="row.f_path" src="../../../assets/remove.png" :class="style__" @click="delfile(idxs, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
144
- </div>
145
- </div>
146
- </div>
147
- </div>
148
- <!--多张隐患照片-->
149
- <div class="auto" v-for="itemIndex in hiddenDangerImgNumber" style="margin: 1px;">
150
- <div class="panel">
151
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
152
- <div class="col-xs-6" style="height: 160px;width:160px;overflow: scroll;top: 1px">
153
- <div class="col-sm-4" v-show="row['f_p' + (itemIndex+1) + '_path']">
154
- <img-self :src="row['f_p' + (itemIndex+1) + '_path']" :alt="row.f_item_name" width="140" height="140"></img-self>
155
- </div>
156
- <div class="col-sm-4" v-show="!row['f_p' + (itemIndex+1) + '_path']" @click="takePic(idxs, row.f_item_name,'f_p' + (itemIndex+1)+ '_path')">
157
- <img src="../../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
158
- </div>
159
- <img v-show="row['f_p' + (itemIndex+1)+'_path']" src="../../../assets/remove.png" :class="style__" @click="delfile(idxs,row['f_p' + (itemIndex+1)+'_path'],'f_p' + (itemIndex+1)+ '_path')" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
160
- </div >
161
- </div>
162
- </div>
163
- </div>
164
- </div>
165
- </div>
166
-
167
- <!--<v-select :value.sync="row.f_content" :options='getOptions(row.f_project)' placeholder='请选择' :disabled="(!(ischecked == '有')) || issee" close-on-select :value-single="true" v-if="!show && row.type == 'selector' && row.f_project != '气表品牌'"-->
168
- <!--&gt;</v-select>-->
169
- <!--<v-select :value.sync="row.f_content" :options='getOptions(row.f_project)' @change="getgasmodel" placeholder='请选择' :disabled="(!(ischecked == '有')) || issee" close-on-select :value-single="true" v-if="!show && row.type == 'selector' && row.f_project == '气表品牌'"-->
170
- <!--&gt;</v-select>-->
171
- <!-- <div class="auto" v-if="!show && row.type == 'checkbox' ">-->
172
- <!-- <input class="magic-checkbox" type="checkbox" id="shebeicheckbox"-->
173
- <!-- :checked="row.f_content == '有'"-->
174
- <!-- @click="switchDetails(row.f_project, $event)" :disabled="issee"/>-->
175
- <!-- <label for="shebeicheckbox" style="width:150px;padding-bottom: 10px">{{row.f_project}}</label>-->
176
- <!-- </div>-->
177
- <!--<img-area :model="Detail.imgs" :sutitle="row.f_project" v-if="row.type == 'picture'" :disabled="issee"></img-area>-->
178
- </div>
179
- </div>
180
- </div>
181
- <div style="border-top: 1px solid #D4D4D4"></div>
182
- </div>
183
- </div>
184
- </div>
185
- </template>
186
- <script>
187
- import Vue from 'vue'
188
- import * as Util from '../../Util'
189
-
190
- export default {
191
- title: '维修列表信息',
192
- data() {
193
- return {
194
- // telphoneValid: '/^((0\\d{2,3}-\\d{7,8})|(1[3584]\\d{9}))$/',
195
- // meterstyle:[],
196
- hiddenDangerImgNumber: 0,//隐患图片数
197
- shuclass: 'col-xs-12 col-sm-12 col-md-12 form-input-group mg8',
198
- shuclass1: 'col-xs-12 col-sm-12 col-md-12 mg8',
199
- // labels:[],
200
- meternum: '',
201
- ischecked: '有',
202
- gasmodel: '',
203
- textstyle: 'color: red',
204
- paper: this.$parent.$parent.data,
205
- f_items: [],
206
- page: {},
207
- selectindex: null,
208
- lives: [{label: '是', value: '是'}, {label: '否', value: '否'}],
209
- deals: [{label: '现场整改', value: '现场整改'}, {label: '自行处理', value: '自行处理'}, {
210
- label: '未处理',
211
- value: '未处理'
212
- }],
213
- f_live_dispose: '否',
214
- f_deal_dispose: '未处理',
215
- // 初始表底
216
- f_initial_base: {},
217
- // 气量异常差值 计算公式 => 气量异常差值 = 累计购气量 - (已用气量 - 初始表底) - 剩余气量
218
- f_gas_aberrant_number: {},
219
- // 金额异常差值 计算公式 => 金额异常差值 = 累计购金额 - 已用金额 - 剩余金额
220
- f_fee_aberrant_number: {},
221
- // 累购气量
222
- f_total_gas: {},
223
- // 累购金额
224
- f_total_fee: {},
225
- // 已用气量
226
- f_table_base: {},
227
- // 已用金额
228
- f_fee_base: {},
229
- // 剩余气量
230
- f_gas_balance: {},
231
- // 剩余金额
232
- f_fee_balance: {},
233
- // 气量异常差值允许误差
234
-
235
- //物联网表数据存储
236
- f_balance_amount: {},//物联网表剩余金额
237
- f_meter_base: {},//物联网表读数
238
- f_meter_base_jixie: {},//机械读表数
239
- f_meter_base_yejing: {},//液晶读表数
240
- f_balance_amount1: {},//物联网表现场录入的表上剩余金额
241
- f_meter_base1: {},//物联网表现场录入的表字轮数
242
- f_meter_aberrant_number1: {},//物联网表 表数异常差值
243
- f_meter_aberrant_number2: {},//物联网表 表底数异常差值
244
- f_fee_aberrant_number1: {},//物联网 表金额异常差值
245
- gasDeviation: (
246
- function (_this) {
247
- let deviation = _this.$appdata.getSingleValue('气量异常差值允许误差')
248
- if (deviation && !isNaN(deviation)) {
249
- return deviation
250
- } else {
251
- return 0
252
- }
253
- }
254
- )(this),
255
- // 金额异常差值允许误差
256
- feeDeviation: (
257
- function (_this) {
258
- let deviation = _this.$appdata.getSingleValue('金额异常差值允许误差')
259
- if (deviation && !isNaN(deviation)) {
260
- return deviation
261
- } else {
262
- return 0
263
- }
264
- }
265
- )(this),
266
- // 字轮异常差值允许误差
267
- meterbase: (
268
- function (_this) {
269
- let deviation = _this.$appdata.getSingleValue('字轮异常差值允许误差')
270
- if (deviation && !isNaN(deviation)) {
271
- return deviation
272
- } else {
273
- return 0
274
- }
275
- }
276
- )(this),
277
- showElse: false, //控制其他选项是否显示
278
- }
279
- },
280
- props: ['config', 'device', 'idx', 'operation', 'role'],
281
- // props: {
282
- // // 维修对应的用户数据收集
283
- // model: {
284
- // type: Object
285
- // },
286
- // service:{
287
- // type: Object
288
- // },
289
- // show: {
290
- // type: Boolean,
291
- // default: false
292
- // },
293
- // repairitem:{
294
- // type: Object
295
- // },
296
- // shutype:'heng',
297
- // tabs:{
298
- // type: Object
299
- // },
300
- // repairdetails:{
301
- // type: Object
302
- // },
303
- // faultshow:{
304
- // type: Object
305
- // },
306
- // issee:''
307
- // },
308
- methods: {
309
- changse(val) {
310
- if (val == undefined) {
311
- return
312
- }
313
- if (this.selectindex != null) {
314
- if (this.f_items[this.selectindex].type == 'selector') {
315
- this.f_items[this.selectindex].f_item_value = val
316
- } else if (this.f_items[this.selectindex].type == 'inputSelector') {
317
- this.f_items[this.selectindex].f_item_value = val.target.value
318
- }
319
- }
320
- },
321
- changlive(val) {
322
- if (val == undefined) {
323
- return
324
- }
325
- if (this.selectindex != null) {
326
- this.f_items[this.selectindex].f_live_dispose = val
327
- }
328
- },
329
- changdeal(val) {
330
- if (val == undefined) {
331
- return
332
- }
333
- if (this.selectindex != null) {
334
- this.f_items[this.selectindex].f_deal_dispose = val
335
- }
336
- },
337
- switchDetails(detailsType, event) {
338
- if (event.srcElement.checked) {
339
- for (var i = 0; i < this.Detail.details.length; i++) {
340
- if (this.Detail.details[i].f_project == detailsType) {
341
- this.Detail.details[i].f_content = '有'
342
- this.ischecked = '有'
343
- return
344
- }
345
- }
346
- } else {
347
- this.Detail.imgs = []
348
- for (var i = 0; i < this.Detail.details.length; i++) {
349
- if (this.Detail.details[i].f_project == detailsType) {
350
- this.Detail.details[i].f_content = '无'
351
- this.ischecked = '无'
352
- } else {
353
- this.Detail.details[i].f_content = ''
354
- }
355
- }
356
- }
357
- },
358
- getgasmodel(val) {
359
- this.gasmodel = val
360
- },
361
- getradios(val, flag) {
362
- let Reoptions = []
363
- for (let i = 0; i < this.repairdetails.length; i++) {
364
- var t = false
365
- if (this.repairdetails[i].f_type == this.repairitem.header) {
366
- for (var j = 0; j < this.repairdetails[i].details.length; j++) {
367
- if (this.repairdetails[i].details[j].f_project == val) {
368
- Reoptions = this.repairdetails[i].details[j].options
369
- t = true
370
- break
371
- }
372
- }
373
- }
374
- if (t) {
375
- break
376
- }
377
- }
378
- for (let j = 0; j < Reoptions.length; j++) {
379
- if (Reoptions[j].data == flag) {
380
- for (var e = 0; e < this.Detail.details.length; e++) {
381
- if (this.Detail.details[e].f_project == val) {
382
- this.Detail.details[e].f_status = Reoptions[j].f_status
383
- return
384
- }
385
- }
386
- break
387
- }
388
- }
389
- },
390
- deletedetails() {
391
- this.$showMessage('该操作会删除所填信息,是否继续!', ['confirm', 'cancel']).then((res) => {
392
- if (res === 'confirm') {
393
- for (var i = 0; i < this.tabs.length; i++) {
394
- if (this.tabs[i].number == this.repairitem.number) {
395
- this.tabs.splice(i, 1)
396
- this.model.servicerepair.splice(this.repairitem.number, 1)
397
- for (let t = i; t < this.tabs.length; t++) {
398
- this.tabs[t].number -= 1
399
- }
400
- return
401
- }
402
- }
403
- }
404
- })
405
- },
406
- takePic(prop, title, pathname = 'null') {
407
- if (this.role == 'androidview') {
408
- return
409
- }
410
- HostApp.__callback__ = this.cameraCallBack
411
- HostApp.__this__ = this
412
- //tag
413
- let fileName
414
- if (pathname == 'null') {
415
- if (!this.f_items[prop].f_path || this.f_items[prop].f_path.includes("nopic.png")) {
416
- fileName = Util.guid() + '-' + 'device' + this.device.n + '-' + this.idx + '-' + 'f_items' + prop + '.jpg'
417
- } else {
418
- fileName = Util.getFileName(this.f_items[prop].f_path)
419
- }
420
- } else {
421
- if (!this.f_items[prop][pathname] || this.f_items[prop][pathname].includes("nopic.png")) {
422
- fileName = Util.guid() + '-' + 'device' + this.device.n + '-' + this.idx + '-' + 'f_items' + prop + '.jpg'
423
- } else {
424
- fileName = Util.getFileName(this.f_items[prop][pathname])
425
- }
426
- }
427
- //tag
428
- //tag
429
- HostApp._open_a_page({
430
- type: 'boomerang',
431
- page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
432
- param: {
433
- file: fileName,
434
- requestCode: 111,
435
- callback: 'javascript:HostApp.__callback__("' + prop + '", "%s","' + pathname + '");',
436
- watermark: title + '\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name
437
- }
438
- })
439
- },
440
- cameraCallBack(prop, fileName, pathname) {
441
- //tag
442
- if (pathname == 'null') {
443
- //tag
444
- HostApp.__this__.$set('f_items[' + prop + '].f_path', fileName + '?' + Math.random())
445
- //tag
446
- HostApp.__callback__ = null
447
- HostApp.__this__ = null
448
- } else {
449
- //tag
450
- //tag)
451
- HostApp.__this__.$set('f_items[' + prop + '].' + pathname + '', fileName + '?' + Math.random())
452
- HostApp.__callback__ = null
453
- HostApp.__this__ = null
454
- }
455
- },
456
- delfile(prop, fileName, pathname = 'null') {
457
- if (pathname == 'null') {
458
- //tag
459
- //tag)
460
- if (fileName == Vue.nopic) {
461
- return
462
- } else {
463
- HostApp.delfile(fileName)
464
- this.f_items[prop].f_path = Vue.nopic
465
- }
466
- } else {
467
- //tag
468
- //tag)
469
- if (fileName == Vue.nopic) {
470
- return
471
- } else {
472
- HostApp.delfile(fileName)
473
- this.f_items[prop][pathname] = Vue.nopic
474
- }
475
- }
476
- },
477
- adddetails() {
478
- // 下标作为序号,取值用。 增加 序号得依次增加
479
- if (this.tabs.length > 0) {
480
- for (let i = this.tabs.length - 1; i > 0; i--) {
481
- if (this.tabs[i].header == this.repairitem.header) {
482
- if (this.model.servicerepair.length > 0) {
483
- for (let j = this.model.servicerepair.length - 1; j > -1; j--) {
484
- if (this.model.servicerepair[j].f_type == this.repairitem.header) {
485
- this.model.servicerepair.splice(j + 1, 0, Object.assign({}, JSON.parse(JSON.stringify(this.tabs[i].details))))
486
- this.tabs.splice(i + 1, 0, {
487
- header: `${this.repairitem.header}`,
488
- details: this.tabs[i].details,
489
- complete: 'repair-details',
490
- class: 'repair-details-class',
491
- number: j + 1,
492
- items: this.tabs[i].items
493
- })
494
- for (let t = i + 2; t < this.tabs.length; t++) {
495
- this.tabs[t].number += 1
496
- }
497
- this.faultshow.number += this.faultshow.number + 1
498
- return
499
- }
500
- }
501
- }
502
- }
503
- }
504
- }
505
- },
506
- transelation(val) {
507
- this.selectindex = val
508
- },
509
- towatch() {
510
- for (let n in this.f_items) {
511
- if (typeof this.f_items[n] == 'function') {
512
- continue
513
- }
514
- if (this.f_items[n].type == 'selector' || this.f_items[n].type == 'inputSelector') {
515
- // 监听下拉框,如果有隐患,需要拍照
516
- this.$watch('f_items[' + n + '].selected', function (val) {
517
- // 下拉框值
518
- //tag)
519
- // 下拉框所属设备
520
- //tag
521
- // 下拉框所属项
522
- //tag
523
- let shImage = false
524
- if (val.indexOf('其他') == -1) {
525
- this.f_items[n].f_else = ''
526
- }
527
- // if(this.config[this.device.device].items[item].type == 'selector'){
528
- // this.f_items[n].f_item_value = val
529
- // }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
530
- // this.f_items[n].f_item_value = val[0]
531
- // }
532
- // 在配置中查找该项
533
- for (let item in this.config[this.device.device].items) {
534
- if (typeof this.config[this.device.device].items[item] == 'function') {
535
- continue
536
- }
537
- let type = this.config[this.device.device].items[item].type
538
- let multiple = this.config[this.device.device].items[item].multiple ? this.config[this.device.device].items[item].multiple : false
539
- let options = this.config[this.device.device].items[item].options
540
- if ((this.config[this.device.device].items[item].type == 'selector' || this.config[this.device.device].items[item].type == 'inputSelector') && item == this.f_items[n].f_item_name) {
541
- for (let i in options) {
542
- if (typeof options[i] == 'function') {
543
- continue
544
- }
545
- let value
546
- if (this.config[this.device.device].items[item].type == 'selector' && this.config[this.device.device].items[item].multiple == false) {
547
- value = val[0]
548
- } else if (this.config[this.device.device].items[item].type == 'inputSelector') {
549
- value = val
550
- }
551
- //tag)
552
- // 如果未选择,清空图片、隐患信息等
553
- if ((type == 'selector' && val.length == 0) || (type == 'inputSelector' && val == '')) {
554
- this.f_items[n].f_path = ''
555
- this.f_items[n].f_is_defect = ''
556
- this.f_items[n].f_defect_level = ''
557
- this.f_items[n].f_live_dispose = ''
558
- this.f_items[n].f_deal_dispose = ''
559
- this.f_items[n].tooltip = ''
560
- }
561
- if ((type == 'selector' && multiple == false && options[i].data == val[0]) || (type == 'inputSelector' && options[i].data == val) || (type == 'selector' && multiple == true && val.indexOf(options[i].data) > -1)) {
562
- // 找到选中的项了
563
- //tag
564
- if (options[i].isdefect == true) {
565
- shImage = true
566
- }
567
- if (options[i].isdefect == false || this.f_items[n].f_item_value == '') {
568
- shImage = false
569
- }
570
- //tag
571
- if (shImage) {
572
- this.f_items[n].f_is_defect = true
573
- this.f_items[n].f_defect_level = options[i].level
574
- this.f_items[n].f_path = Vue.nopic
575
- this.f_items[n].f_live_dispose = '否'
576
- this.f_items[n].f_deal_dispose = '未处理'
577
- //tag
578
- this.f_items[n].tooltip = options[i].tooltip
579
- } else {
580
- this.f_items[n].f_path = ''
581
- this.f_items[n].f_is_defect = ''
582
- this.f_items[n].f_defect_level = ''
583
- this.f_items[n].f_live_dispose = ''
584
- this.f_items[n].f_deal_dispose = ''
585
- this.f_items[n].tooltip = ''
586
- }
587
- }
588
- }
589
- }
590
- }
591
- }
592
- )
593
- // this.$watch('other',function(val){
594
- // //tag
595
- // if(this.selectindex != null) {
596
- // let index = this.f_items[this.selectindex].f_item_value.indexOf('其他')
597
- // if(index > -1){
598
- // this.f_items[this.selectindex].f_item_value.splice(index,1,this.other)
599
- // }
600
- // }
601
- //
602
- // })
603
- } else if (this.f_items[n].type == 'radio') {
604
- // 监听单选框,如果有隐患,需要拍照
605
- this.$watch('f_items[' + n + '].f_item_value', function (val) {
606
- //tag)
607
- let options = this.f_items[n].options
608
- //tag)
609
- for (let i = 0; i < options.length; i++) {
610
- //tag)
611
- // 找到选中的项了
612
- if (options[i].value == val) {
613
- // 如果有隐患,拍图片
614
- if (options[i].isdefect) {
615
- this.f_items[n].f_is_defect = true
616
- this.f_items[n].f_defect_level = options[i].level
617
- this.f_items[n].f_path = Vue.nopic
618
- this.f_items[n].f_live_dispose = '否'
619
- this.f_items[n].f_deal_dispose = '未处理'
620
- this.f_items[n].tooltip = options[i].tooltip
621
- //tag)
622
- return
623
- }
624
- }
625
- }
626
- this.f_items[n].f_path = ''
627
- this.f_items[n].f_is_defect = ''
628
- this.f_items[n].f_defect_level = ''
629
- this.f_items[n].f_live_dispose = ''
630
- this.f_items[n].f_deal_dispose = ''
631
- this.f_items[n].tooltip = ''
632
- })
633
- } else if (this.f_items[n].type == 'checkbox') {
634
- // 监听单选框,如果有隐患,需要拍照
635
- this.$watch('f_items[' + n + '].f_item_value', function (val) {
636
- //tag)
637
- // 如果是手动赋值,不执行下面逻辑
638
- if (this.f_items[n].isReSet) {
639
- this.f_items[n].isReSet = false
640
- return
641
- }
642
- let options = this.f_items[n].options
643
- //tag)
644
- // 取出选中项中有隐患的详细信息
645
- let selected = options.filter(item => {
646
- return val.indexOf(item.value) != -1 && item.isdefect
647
- })
648
-
649
- if (selected.length > 0) {
650
- // 防止赋值无限调用
651
- this.f_items[n].isReSet = true
652
- let selectList = selected.map(item => {
653
- return item.value
654
- })
655
- // 如果选中的是非隐患项,取消选中isdefect为true的
656
- if (selectList.indexOf(val[val.length - 1]) == -1) {
657
- this.f_items[n].f_item_value = val.filter(item => {
658
- return selectList.indexOf(item) == -1
659
- })
660
- this.f_items[n].f_path = ''
661
- this.f_items[n].f_is_defect = ''
662
- this.f_items[n].f_defect_level = ''
663
- this.f_items[n].f_live_dispose = ''
664
- this.f_items[n].f_deal_dispose = ''
665
- this.f_items[n].tooltip = ''
666
- return
667
- }
668
- // 如果选中的是隐患项,取消选中isdefect为false的
669
- this.f_items[n].f_item_value = selectList
670
- // 如果第一次选择隐患项,初始化
671
- if (!this.f_items[n].f_is_defect) {
672
- this.f_items[n].f_is_defect = true
673
- this.f_items[n].f_defect_level = selected[0].level
674
- this.f_items[n].f_path = Vue.nopic
675
- this.f_items[n].f_live_dispose = '否'
676
- this.f_items[n].f_deal_dispose = '未处理'
677
- //tag
678
- this.f_items[n].tooltip = selected[0].tooltip
679
- }
680
- //tag)
681
- return
682
- }
683
- this.f_items[n].f_path = ''
684
- this.f_items[n].f_is_defect = ''
685
- this.f_items[n].f_defect_level = ''
686
- this.f_items[n].f_live_dispose = ''
687
- this.f_items[n].f_deal_dispose = ''
688
- this.f_items[n].tooltip = ''
689
- })
690
- }
691
- }
692
- //tag)
693
- },
694
-
695
- getNumber(val) {
696
- //tag
697
- console.log('this.f_meter_base_jixie.index', this.f_meter_base_jixie.index)
698
- console.log('this.f_meter_base_yejing.index', this.f_meter_base_yejing.index)
699
- if (!this.f_meter_base_jixie.index || !this.f_meter_base_yejing.index) {
700
- //tag
701
- return
702
- }
703
- //tag)
704
- //tag
705
- console.log('this.f_items[this.f_meter_base_jixie.index].f_item_value', this.f_items[this.f_meter_base_jixie.index].f_item_value)
706
- console.log('this.f_items[this.f_meter_base_yejing.index].f_item_value', this.f_items[this.f_meter_base_yejing.index].f_item_value)
707
- this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_base_jixie.index].f_item_value - this.f_items[this.f_meter_base_yejing.index].f_item_value
708
- this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_aberrant_number2.index].f_item_value.toFixed(3)
709
- // 如果数值有误,清空结果s
710
- if (isNaN(this.f_items[this.f_meter_aberrant_number2.index].f_item_value)) {
711
- this.f_items[this.f_meter_aberrant_number2.index].f_item_value = null
712
- }
713
- //tag ===> ' + Math.abs(this.f_items[this.f_gas_aberrant_number.index].f_item_value))
714
- //tag ===> ' + JSON.stringify(Number(this.gasDeviation)))
715
- // 计算差值是否在范围内
716
-
717
- if (Math.abs(this.f_items[this.f_meter_aberrant_number2.index].f_item_value) > Number(this.gasDeviation)) {
718
- this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = true
719
- this.f_items[this.f_meter_aberrant_number2.index].f_deal_dispose = '未处理'
720
- }else{
721
- this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = null
722
- this.f_items[this.f_meter_aberrant_number2.index].f_deal_dispose = null
723
- }
724
- },
725
-
726
- getGasAberrantNumber(val) {
727
- //tag
728
- if (!this.f_table_base.index || !this.f_gas_balance.index) {
729
- //tag
730
- return
731
- }
732
- // 先清空
733
- this.f_items[this.f_gas_aberrant_number.index].f_item_value = null
734
- this.f_items[this.f_gas_aberrant_number.index].f_is_defect = false
735
- if (val == '已用气量') {
736
- //剩余气量 = 累购-已用
737
- this.f_items[this.f_gas_balance.index].f_item_value = this.f_items[this.f_total_gas.index].f_item_value - this.f_items[this.f_table_base.index].f_item_value
738
- if (isNaN(this.f_items[this.f_gas_balance.index].f_item_value)) {
739
- this.f_items[this.f_gas_balance.index].f_item_value = null
740
- }
741
- }
742
-
743
- // 只有两个值都填了才会计算
744
- if (!this.f_items[this.f_table_base.index].f_item_value || !this.f_items[this.f_gas_balance.index].f_item_value) {
745
- return
746
- }
747
- //tag)
748
- //tag
749
- //tag
750
-
751
- // 计算公式 => 气量异常差值 = 累计购气量 - (已用气量 - 初始表底) - 剩余气量
752
- this.f_items[this.f_gas_aberrant_number.index].f_item_value = this.f_items[this.f_total_gas.index].f_item_value - this.f_items[this.f_gas_balance.index].f_item_value - (this.f_items[this.f_table_base.index].f_item_value - this.f_items[this.f_initial_base.index].f_item_value)
753
- this.f_items[this.f_gas_aberrant_number.index].f_item_value = this.f_items[this.f_gas_aberrant_number.index].f_item_value.toFixed(3)
754
- // 如果数值有误,清空结果s
755
- if (isNaN(this.f_items[this.f_gas_aberrant_number.index].f_item_value)) {
756
- this.f_items[this.f_gas_aberrant_number.index].f_item_value = null
757
- }
758
- //tag ===> ' + Math.abs(this.f_items[this.f_gas_aberrant_number.index].f_item_value))
759
- //tag ===> ' + JSON.stringify(Number(this.gasDeviation)))
760
- // 计算差值是否在范围内
761
- if (Math.abs(this.f_items[this.f_gas_aberrant_number.index].f_item_value) > Number(this.gasDeviation)) {
762
- this.f_items[this.f_gas_aberrant_number.index].f_is_defect = true
763
- this.f_items[this.f_gas_aberrant_number.index].f_deal_dispose = '未处理'
764
- }else{
765
- this.f_items[this.f_gas_aberrant_number.index].f_is_defect = null
766
- this.f_items[this.f_gas_aberrant_number.index].f_deal_dispose = null
767
- }
768
- },
769
- //tag)
770
- getFeeAberrantNumber(val){
771
- //tag
772
- // 只有两个值都填了才会计算
773
- if (!this.f_fee_base.index || !this.f_fee_balance.index) {
774
- //tag
775
- return
776
- }
777
- // 先清空
778
- this.f_items[this.f_fee_aberrant_number.index].f_item_value = null
779
- this.f_items[this.f_fee_aberrant_number.index].f_is_defect = false
780
-
781
- if (val == '已用金额') {
782
- this.f_items[this.f_fee_balance.index].f_item_value = this.f_items[this.f_total_fee.index].f_item_value - this.f_items[this.f_fee_base.index].f_item_value
783
- if (isNaN(this.f_items[this.f_fee_balance.index].f_item_value)) {
784
- this.f_items[this.f_fee_balance.index].f_item_value = null
785
- }
786
- }
787
-
788
- if (!this.f_items[this.f_fee_base.index].f_item_value || !this.f_items[this.f_fee_balance.index].f_item_value) {
789
- return
790
- }
791
-
792
- // 计算公式 => 金额异常差值 = 累计购金额 - 已用金额 - 剩余金额
793
- this.f_items[this.f_fee_aberrant_number.index].f_item_value = this.f_items[this.f_total_fee.index].f_item_value - this.f_items[this.f_fee_balance.index].f_item_value - this.f_items[this.f_fee_base.index].f_item_value
794
- this.f_items[this.f_fee_aberrant_number.index].f_item_value = this.f_items[this.f_fee_aberrant_number.index].f_item_value.toFixed(3)
795
- if (isNaN(this.f_items[this.f_fee_aberrant_number.index].f_item_value)) {
796
- this.f_items[this.f_fee_aberrant_number.index].f_item_value = null
797
- }
798
- //tag ===> ' + Math.abs(this.f_items[this.f_fee_aberrant_number.index].f_item_value))
799
- //tag ===> ' + JSON.stringify(Number(this.feeDeviation)))
800
- // 计算差值是否在范围内
801
- if (Math.abs(this.f_items[this.f_fee_aberrant_number.index].f_item_value) > Number(this.feeDeviation)) {
802
- this.f_items[this.f_fee_aberrant_number.index].f_is_defect = true
803
- this.f_items[this.f_fee_aberrant_number.index].f_deal_dispose = '未处理'
804
- }else{
805
- this.f_items[this.f_fee_aberrant_number.index].f_is_defect = null
806
- this.f_items[this.f_fee_aberrant_number.index].f_deal_dispose = null
807
- }
808
- //tag)
809
- },
810
- //物联网表字轮数改变触发
811
- getmeteraberrantnumber(){
812
- //tag
813
- // 先清空
814
- this.f_items[this.f_meter_aberrant_number1.index].f_item_value = null
815
- this.f_items[this.f_meter_aberrant_number1.index].f_is_defect = false
816
-
817
- this.f_items[this.f_meter_aberrant_number2.index].f_item_value = null
818
- this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = false
819
- //tag
820
- // 只有两个值都填了才会计算
821
- if (!this.f_items[this.f_meter_base.index].f_item_value || !this.f_items[this.f_meter_base1.index].f_item_value) {
822
- return
823
- }
824
- if (!this.f_items[this.f_meter_base_yejing.index].f_item_value || !this.f_items[this.f_meter_base_jixie.index].f_item_value) {
825
- return
826
- }
827
- //tag
828
- // 计算公式 => 表数异常差值= - 字轮数 - 后台表读数
829
- this.f_items[this.f_meter_aberrant_number1.index].f_item_value = this.f_items[this.f_meter_base1.index].f_item_value - this.f_items[this.f_meter_base.index].f_item_value
830
- this.f_items[this.f_meter_aberrant_number1.index].f_item_value = this.f_items[this.f_meter_aberrant_number1.index].f_item_value.toFixed(3)
831
- if (isNaN(this.f_items[this.f_meter_aberrant_number1.index].f_item_value)) {
832
- this.f_items[this.f_meter_aberrant_number1.index].f_item_value = null
833
- }
834
- // 计算公式 => 表底数异常差值= - 机械 - 液晶表读数
835
- this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_base_jixie.index].f_item_value - this.f_items[this.f_meter_base_yejing.index].f_item_value
836
- this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_aberrant_number2.index].f_item_value.toFixed(3)
837
- if (isNaN(this.f_items[this.f_meter_aberrant_number2.index].f_item_value)) {
838
- this.f_items[this.f_meter_aberrant_number2.index].f_item_value = null
839
- }
840
- //tag ===> ' + Math.abs(this.f_items[this.f_meter_aberrant_number1.index].f_item_value))
841
- // 计算差值是否在范围内
842
- //tag)
843
- if (Math.abs(this.f_items[this.f_meter_aberrant_number1.index].f_item_value) > Number(this.meterbase)) {
844
- this.f_items[this.f_meter_aberrant_number1.index].f_is_defect = true
845
- }
846
- if (Math.abs(this.f_items[this.f_meter_aberrant_number2.index].f_item_value) > Number(this.meterbase)) {
847
- this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = true
848
- }
849
- //tag)
850
- },
851
-
852
- disSelect(index, itemValue) {
853
- //tag)
854
- //tag)
855
- if (this.f_items[index].f_item_value == itemValue) {
856
- this.$set(`f_items[${index}].f_item_value`, '')
857
- }
858
- }
859
- },
860
- ready() {
861
- //tag
862
- //tag
863
- if(Vue.config.safecheck != undefined){
864
- if(Vue.config.safecheck.ApproveConfig != undefined){
865
- if(Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
866
- this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
867
- }
868
- if(Vue.config.safecheck.ApproveConfig.dealdispose != undefined) {
869
- this.dealdispose = Vue.config.safecheck.ApproveConfig.dealdispose
870
- }
871
- if(Vue.config.safecheck.ApproveConfig.showtorepair) {
872
- this.deals=[{label: '现场整改', value: '现场整改'},
873
- {label: '自行处理', value: '自行处理'},
874
- {label: '未处理', value: '未处理'},
875
- {label: '转维修', value: '报修'}
876
- ]
877
- }
878
- if(Vue.config.safecheck.ApproveConfig.hiddendanger != undefined) {
879
- if (parseInt(Vue.config.safecheck.ApproveConfig.hiddendanger) >= 3) {
880
- this.hiddenDangerImgNumber = 3
881
- }else {
882
- this.hiddenDangerImgNumber = parseInt(Vue.config.safecheck.ApproveConfig.hiddendanger)
883
- }
884
- }
885
- }
886
- }
887
- //tag
888
- //tag)
889
- //tag)
890
- //tag)
891
- //创建页面所需数据
892
- this.$set('piece', this.paper['device'+this.device.n][this.idx])
893
- //tag)
894
- //tag)
895
- let n = 0
896
- for (let item in this.config[this.device.device].items) {
897
- if(typeof this.config[this.device.device].items[item]=='function'){
898
- continue
899
- }
900
- let index = this.config[this.device.device].items[item].index-1
901
- this.$set('page.options' + index, [])
902
- //tag)
903
- //tag)
904
- //tag)
905
- // 先根据配置组接页面
906
- let f_item_value
907
- if(this.config[this.device.device].items[item].type == 'selector' || this.config[this.device.device].items[item].type == 'checkbox'){
908
- f_item_value = []
909
- // 判断选项的默认值
910
- for (let defitem in this.config[this.device.device].items[item].options) {
911
- if(typeof this.config[this.device.device].items[item].options[defitem]=='function'){
912
- continue
913
- }
914
- let defopt = this.config[this.device.device].items[item].options[defitem]
915
- if (defopt.isdefault) {
916
- //tag
917
- f_item_value[0] = defopt.data
918
- }
919
- }
920
- // if(this.config[this.device.device].items[item].data){
921
- // f_item_value.push(this.config[this.device.device].items[item].data)
922
- // }
923
- }else if(this.config[this.device.device].items[item].type == 'radio'){
924
- //为radio添加默认值
925
- f_item_value=''
926
- //tag)
927
- for (let defitem in this.config[this.device.device].items[item].options) {
928
- if(typeof this.config[this.device.device].items[item].options[defitem]=='function'){
929
- continue
930
- }
931
- //tag)
932
- let defopt = this.config[this.device.device].items[item].options[defitem]
933
- if (defopt.isdefault) {
934
- //tag)
935
- f_item_value = defopt.data
936
- }
937
- }
938
- }else{
939
- f_item_value = this.config[this.device.device].items[item].data ? this.config[this.device.device].items[item].data : ''
940
- }
941
- //tag)
942
- let it = {
943
- type: this.config[this.device.device].items[item].type,
944
- f_item_name: item,
945
- checkmust: this.config[this.device.device].items[item].checkmust,
946
- f_item_value: f_item_value,
947
- f_is_defect: '',
948
- multiple:this.config[this.device.device].items[item].multiple == true?this.config[this.device.device].items[item].multiple:false,
949
- isshow:this.config[this.device.device].items[item].isshow == false?this.config[this.device.device].items[item].isshow:true,
950
- readonly: this.config[this.device.device].items[item].readonly == true?true:false,
951
- remark: this.config[this.device.device].items[item].remark ? this.config[this.device.device].items[item].remark : '',
952
- f_path: '',
953
- unit: this.config[this.device.device].items[item].unit ? this.config[this.device.device].items[item].unit : '',
954
- tooltip:'',
955
- f_live_dispose:'',
956
- f_deal_dispose:'',
957
- f_else: '',
958
- f_p1_path: '',
959
- f_p2_path: '',
960
- f_p3_path: ''
961
- }
962
- //tag)
963
- //tag)
964
- this.$set('f_items['+index+']',it)
965
- if (this.config[this.device.device].items[item].type == 'selector' ||this.config[this.device.device].items[item].type == 'inputSelector') {
966
- if(this.config[this.device.device].items[item].type == 'selector'){
967
- this.page['options' + index].push({
968
- label: "请选择",
969
- value: ''
970
- })
971
- }
972
- for (let i in this.config[this.device.device].items[item].options) {
973
- if(typeof this.config[this.device.device].items[item].options[i]=='function'){
974
- continue
975
- }
976
- this.page['options' + index].push({
977
- label: this.config[this.device.device].items[item].options[i].data,
978
- value: this.config[this.device.device].items[item].options[i].data,
979
- tooltip: this.config[this.device.device].items[item].options[i].tooltip
980
- })
981
- }
982
- if(this.config[this.device.device].items[item].type == 'selector'){
983
- this.$set('f_items['+index+'].selected', f_item_value)
984
- }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
985
- this.$set('f_items['+index+'].selected', f_item_value)
986
- }
987
-
988
- this.$set('f_items['+index+'].options',this.page['options' + index])
989
-
990
- //tag)
991
- } else if (this.config[this.device.device].items[item].type == 'radio' || this.config[this.device.device].items[item].type == 'checkbox') {
992
- //tag)
993
- //tag
994
- //tag)
995
- for (let i in this.config[this.device.device].items[item].options) {
996
- if(typeof this.config[this.device.device].items[item].options[i]=='function'){
997
- continue
998
- }
999
- //tag
1000
- this.page['options' + index].push({
1001
- label: this.config[this.device.device].items[item].options[i].data,
1002
- value: this.config[this.device.device].items[item].options[i].data,
1003
- isdefect: this.config[this.device.device].items[item].options[i].isdefect,
1004
- level: this.config[this.device.device].items[item].options[i].level,
1005
- tooltip: this.config[this.device.device].items[item].options[i].tooltip
1006
- })
1007
- //tag)
1008
- }
1009
- //tag)
1010
- this.$set('f_items[' + index + '].options', this.page['options' + index])
1011
- this.$set('f_items[' + index + '].f_item_value', f_item_value)
1012
- //tag)
1013
- }
1014
- n = n + 1
1015
- }
1016
- if(JSON.stringify(this.piece) == '{}') {
1017
- // 如果没有,则新建
1018
- this.$set('piece.f_items',this.f_items)
1019
- this.$set('piece.f_device_type',this.device.device)
1020
- } else {
1021
- // 已经存在,把之前的数据重新填入
1022
- for (let f in this.f_items){
1023
- if(typeof this.f_items[f]=='function'){
1024
- continue
1025
- }
1026
- for(let p in this.piece.f_items) {
1027
- if(typeof this.piece.f_items[p]=='function'){
1028
- continue
1029
- }
1030
- if (this.f_items[f].f_item_name == this.piece.f_items[p].f_item_name) {
1031
- //tag)
1032
- //tag)
1033
- this.f_items[f] = Object.assign(this.f_items[f], this.piece.f_items[p])
1034
- //tag)
1035
- if (this.f_items[f].type == 'selector' || this.f_items[f].type == 'inputSelector') {
1036
- //tag)
1037
- //tag)
1038
- this.f_items[f].selected = this.piece.f_items[p].f_item_value
1039
- //tag)
1040
- }
1041
- // 取出特殊值
1042
- if (this.f_items[f].f_item_name == '初始表底') {
1043
- //tag)
1044
- this.f_initial_base.index = f
1045
- } else if (this.f_items[f].f_item_name == '累购气量') {
1046
- //tag)
1047
- this.f_total_gas.index = f
1048
- } else if (this.f_items[f].f_item_name == '已用气量') {
1049
- //tag)
1050
- this.f_table_base.index = f
1051
- this.$watch('f_items[' + f + '].f_item_value', () => {
1052
- this.getGasAberrantNumber('已用气量')
1053
- })
1054
- }else if (this.f_items[f].f_item_name == '机械表底数') {
1055
- //tag)
1056
- console.log('机械表底数---', f)
1057
- this.f_meter_base_jixie.index = f
1058
- }else if (this.f_items[f].f_item_name == '液晶表底数') {
1059
- //tag)
1060
- console.log('液晶表底数---', f)
1061
- this.f_meter_base_yejing.index = f
1062
- this.$watch('f_items[' + f + '].f_item_value', () => {
1063
- this.getNumber('液晶表底数')
1064
- })
1065
- } else if (this.f_items[f].f_item_name == '剩余气量') {
1066
- //tag)
1067
- this.f_gas_balance.index = f
1068
- this.$watch('f_items[' + f + '].f_item_value', () => {
1069
- this.getGasAberrantNumber('')
1070
- })
1071
- } else if (this.f_items[f].f_item_name == '气量异常差值') {
1072
- //tag)
1073
- this.f_gas_aberrant_number.index = f
1074
- } else if (this.f_items[f].f_item_name == '累购金额') {
1075
- //tag)
1076
- this.f_total_fee.index = f
1077
- } else if (this.f_items[f].f_item_name == '已用金额') {
1078
- //tag)
1079
- this.f_fee_base.index = f
1080
- this.$watch('f_items[' + f + '].f_item_value', () => {
1081
- this.getFeeAberrantNumber('已用金额')
1082
- })
1083
- } else if (this.f_items[f].f_item_name == '剩余金额') {
1084
- //tag)
1085
- this.f_fee_balance.index = f
1086
- this.$watch('f_items[' + f + '].f_item_value', () => {
1087
- this.getFeeAberrantNumber('')
1088
- })
1089
- } else if (this.f_items[f].f_item_name == '金额异常差值') {
1090
- //tag)
1091
- this.f_fee_aberrant_number.index = f
1092
- }else if (this.f_items[f].f_item_name == '表读数') {
1093
- //tag)
1094
- this.f_meter_base.index = f
1095
- }else if (this.f_items[f].f_item_name == '表剩余金额') {
1096
- //tag)
1097
- this.f_balance_amount.index = f
1098
- }else if (this.f_items[f].f_item_name == '字轮数') {
1099
- //tag)
1100
- this.f_meter_base1.index = f
1101
- this.$watch('f_items[' + f + '].f_item_value', () => {
1102
- this.getmeteraberrantnumber()
1103
- })
1104
- }else if (this.f_items[f].f_item_name == '表余额') {
1105
- //tag)
1106
- this.f_balance_amount1.index = f
1107
- this.$watch('f_items[' + f + '].f_item_value', () => {
1108
- this.getfeeaberrantnumber1()
1109
- })
1110
- }else if (this.f_items[f].f_item_name == '表数异常差值') {
1111
- //tag)
1112
- this.f_meter_aberrant_number1.index = f
1113
- }else if (this.f_items[f].f_item_name == '表底数异常差值') {
1114
- //tag)
1115
- this.f_meter_aberrant_number2.index = f
1116
- }else if (this.f_items[f].f_item_name == '表金额异常差值') {
1117
- //tag)
1118
- this.f_fee_aberrant_number1.index = f
1119
- }
1120
- }
1121
- }
1122
- for (let em in this.config[this.device.device].items) {
1123
- if(typeof this.config[this.device.device].items[em]=='function'){
1124
- continue
1125
- }
1126
- if (this.config[this.device.device].items[em].type == 'selector' && em == this.f_items[f].f_item_name) {
1127
- this.f_items[f].options =[]
1128
- for (let k in this.config[this.device.device].items[em].options) {
1129
- if(typeof this.config[this.device.device].items[em].options[k]=='function'){
1130
- continue
1131
- }
1132
- this.f_items[f].options.push({
1133
- label: this.config[this.device.device].items[em].options[k].data,
1134
- value: this.config[this.device.device].items[em].options[k].data
1135
- })
1136
- }
1137
- }
1138
- }
1139
- }
1140
- //tag)
1141
- this.$set('piece.f_items',this.f_items)
1142
- }
1143
- this.towatch()
1144
- },
1145
- destroyed(){
1146
- let nullCount = 0
1147
- let metertitles
1148
- //判断当前是否有选中项
1149
- for (let row in this.f_items){
1150
- if(typeof this.f_items[row]=='function'){
1151
- continue
1152
- }
1153
- if(this.f_items[row].selected && this.f_items[row].selected != '' && this.f_items[row].selected instanceof Array){
1154
- //tag
1155
- this.f_items[row].f_item_value = this.f_items[row].selected
1156
- }else if(this.f_items[row].selected && this.f_items[row].selected != ''){
1157
- //tag
1158
- this.f_items[row].f_item_value = this.f_items[row].selected
1159
- }
1160
- // if(this.f_items[row].f_item_value instanceof Array && this.f_items[row].f_item_value.length != 0 ){
1161
- // nullCount = nullCount+1
1162
- // }else if(this.f_items[row].f_item_value != ''){
1163
- // nullCount = nullCount+1
1164
- // }
1165
- }
1166
- let picture = []
1167
- // for (let row in this.f_items){
1168
- // let a={}
1169
- // a.f_path = this.f_items[row].f_path
1170
- // a.name = this.f_items[row].f_item_name
1171
- // }
1172
- // picture.push(a)
1173
- this.$set(`paper['device${this.device.n}'][${this.idx}]`, this.piece)
1174
- //tag
1175
- },
1176
- computed:{
1177
-
1178
- }
1179
- }
1180
- </script>
1181
- <style lang="less" scoped>
1182
- .class-erro {
1183
- color: #a94442;
1184
- }
1185
- .fivelabel{
1186
- border: none;
1187
- border-left: 5px solid #A2C2EB;
1188
- float: left;
1189
- width: 35%;
1190
- margin-bottom: 3px;
1191
- text-align: left;
1192
- word-wrap: break-word;
1193
- white-space: normal;
1194
- }
1195
- .radiolabel{
1196
- border: none;
1197
- border-left: 5px solid #A2C2EB;
1198
- float: left;
1199
- width: 65%;
1200
- margin-bottom: 3px;
1201
- text-align: left;
1202
- word-wrap: break-word;
1203
- white-space: normal;
1204
- }
1205
-
1206
- .textlabel {
1207
- border: none;
1208
- border-left: 5px solid #A2C2EB;
1209
- width: 100%;
1210
- margin-bottom: 3px;
1211
- text-align: left;
1212
- word-wrap: break-word;
1213
- white-space: normal;
1214
- }
1215
- .textlabel1 {
1216
- border: none;
1217
- border-left: 5px solid #f7cb32;
1218
- width: 100%;
1219
- margin-bottom: 3px;
1220
- text-align: left;
1221
- word-wrap: break-word;
1222
- white-space: normal;
1223
- }
1224
- .spanrodio{
1225
- margin-right: 10px;
1226
- }
1227
- .div-photo{
1228
- width: auto;
1229
- height: auto;
1230
- /* margin-top: 10px; */
1231
- position: absolute;
1232
- bottom: 10px;
1233
- right: 10px;
1234
- }
1235
- .panel-self{
1236
- border-radius: 5px;
1237
- border:1px solid #c5e1f7;
1238
- //background-color: #F2F6FA;
1239
- }
1240
- .btn-photo{
1241
- border: 0;
1242
- border-radius: 7px;
1243
- background-color: #7dc1f4;
1244
- font: 15px PingFang-SC-Bold;
1245
- height: 20%;
1246
- }
1247
- </style>
1248
-
1
+ <template>
2
+ <div class="select-overspread repair-bg auto" style="padding-bottom:5px;">
3
+ <!--<div class="bq-parent" v-if="shutype == 'heng'">-->
4
+ <!--<blockquote class="blockquote">-->
5
+ <!--<p><span>{{repairitem.header}}</span><a @click="mute()" style="float:right" href="#" class="repair-mute-class"><img src="../../../assets/novoice.png" width="25px;" alt=""><span style="margin-left:10px;color: #304A66">关闭声音</span></a></p>-->
6
+ <!--</blockquote>-->
7
+ <!--</div>-->
8
+ <div class="panel panel-default auto repair-info-content">
9
+ <div class="panel-body" style="padding: 0">
10
+ <!-- 安检项内容 -->
11
+ <div class="auto repair-info-content compatible" style="padding: 0">
12
+ <div class="row auto" style="padding: 0">
13
+ <div v-show="false" class="{{shuclass}}" v-if=" device.device != '燃气表'">
14
+ <button type="button" name="button" class="btn btn-primary" @click='adddetails()' :disabled="issee">增加</button>
15
+ </div>
16
+ <!--<div class="{{shuclass}}" v-if="device.device != '燃气表' && candelete">-->
17
+ <!--<button type="button" name="button" class="btn btn-primary" @click='deletedetails()' :disabled="issee">删除</button>-->
18
+ <!--</div>-->
19
+ <div class="shuclass1" v-show="row.isshow" v-for="(idxs,row) in f_items" style="padding: 4px; border:1px solid #D4D4D4;border-bottom: 0" >
20
+ <label v-if="row.type != 'radio' && row.type != 'text' && row.type != 'picture' && row.type != 'checkbox'" v-show="row.isshow" class="fivelabel">{{row.f_item_name}}<span v-if="row.unit">({{row.unit}})</span><br/>{{row.remark}}</label>
21
+ <label v-if="row.type == 'radio'" v-show="row.isshow" class="radiolabel">{{row.f_item_name}}<span v-if="row.unit">({{row.unit}})</span><br/>{{row.remark}}</label>
22
+ <label v-if="row.type == 'text'" v-show="row.isshow" class="textlabel1">{{row.f_item_name}}<span v-if="row.unit">({{row.unit}})</span><br/>{{row.remark}}</label>
23
+ <label v-if="row.type == 'picture' || row.type == 'checkbox'" v-show="row.isshow" class="textlabel">{{row.f_item_name}}<br/>{{row.remark}}</label>
24
+ <!--<span v-if="show" style="font-weight:bold">{{row.f_content}}</span>-->
25
+ <!--<datepicker placeholder="请选择时间"-->
26
+ <!--:value.sync="row.f_content"-->
27
+ <!--v-model="row.f_content"-->
28
+ <!--:format="'yyyy-MM-dd'"-->
29
+ <!--v-if="!show && row.type == 'date'"-->
30
+ <!--:readonly="true"-->
31
+ <!--&gt;</datepicker>-->
32
+ <div style="clear: both" v-if="row.type == 'picture'" class="form-group col-sm-12" >
33
+ <div class="auto" >
34
+ <div class="panel">
35
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
36
+ <div class="row" style="height: 160px;width:160px;overflow: scroll;top: 1px">
37
+ <div class="col-sm-4" v-show="row.f_path">
38
+ <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
39
+ </div>
40
+ <div class="col-sm-4" v-show="!row.f_path" @click="takePic(idxs, row.f_item_name)">
41
+ <img src="../../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
42
+ </div>
43
+ <img v-show="row.f_path" src="../../../assets/remove.png" :class="style__" @click="delfile(idxs, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <div style="float: left;width:60%" class="form-group" v-if="row.type == 'string'" v-show="row.isshow">
50
+ <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" :readonly="role == 'androidview' || row.readonly">
51
+ </div>
52
+ <div style="float: left;width:60%" class="form-group col-sm-12" v-if="row.type == 'date'" v-show="row.isshow">
53
+ <datepicker id="f_making_date" :placeholder= row.f_item_name
54
+ :value.sync="row.f_item_value"
55
+ v-if="row.type == 'date'"
56
+ v-show="row.isshow"
57
+ :disabled-days-of-Week="[]"
58
+ :format="'yyyy-MM-dd HH:mm:ss'"
59
+ :show-reset-button="reset" readonly="readonly">
60
+ </datepicker>
61
+ </div>
62
+
63
+ <div style="float: left;width:60%" class="form-group" v-if="!show && row.type == 'number'" v-show="row.isshow">
64
+ <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" onkeyup="value=value.replace(/[^\d\.]/g,'')" :readonly="row.readonly">
65
+ </div>
66
+ <!--<input type="text" class="form-control" v-model="row.f_content" v-if="!show && row.type == 'string' && row.f_project != '表号'" :disabled="(!(ischecked == '有')) || issee" :readonly="issee">-->
67
+ <!--<input type="text" class="form-control" v-model="meternum" v-if="!show && row.type == 'string' && row.f_project == '表号' " :disabled="(!(ischecked == '有')) || issee" :readonly="issee" >-->
68
+ <!--<button type="button" name="button" class="btn btn-primary" @click="scan" v-if="!show && row.f_project == '表号' ">扫码</button>-->
69
+ <input-select v-if="row.type == 'inputSelector'"
70
+ v-show="row.isshow"
71
+ :value.sync="row.selected"
72
+ v-model="row.selected"
73
+ :readonly="false"
74
+ :options="row.options"
75
+ @change="changse"
76
+ @click="transelation(idxs)"></input-select>
77
+ <v-select style="float: left" :value.sync="row.selected"
78
+ v-model="row.selected"
79
+ v-if="row.type == 'selector'"
80
+ :search="false"
81
+ v-show="row.isshow"
82
+ placeholder='请选择'
83
+ :options="row.options"
84
+ :disabled="role == 'androidview' || row.readonly"
85
+ @change="changse"
86
+ @click="transelation(idxs)"
87
+ :multiple="row.multiple"
88
+ :close-on-select="!row.multiple" clear-button></v-select>
89
+ <div style="float: left;width: 30%" class="form-group" v-if="!show && row.type == 'radio'">
90
+ <div class="col-xs-6 col-sm-6 col-md-6" v-for="item in row.options">
91
+ <!-- <input type="radio" :name="row.f_item_name" @click="disSelect($parent.idxs,item.value)" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value" >-->
92
+ <input type="radio" :name="row.f_item_name" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value" >
93
+ <span>{{item.label}}</span>
94
+ </div>
95
+ </div>
96
+ <div v-if="!show && row.type == 'checkbox'" class="col-xs-12 col-sm-12 col-md-12" style="white-space: nowrap" >
97
+ <div style="float: left" v-for="item in row.options">
98
+ <input type="checkbox" :name="row.f_item_name" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value">
99
+ <span>{{item.label}}</span>
100
+ </div>
101
+ </div>
102
+ <div style="clear: both">
103
+ <label v-if="row.f_item_value.indexOf('其他') >-1" class="fivelabel">其他</label>
104
+ <div style="float: left;width:60%" class="form-group" v-if="row.f_item_value.indexOf('其他') >-1">
105
+ <input type="text" class="form-control" maxlength="100" v-model="row.f_else" :readonly="role == 'androidview' || row.readonly">
106
+ </div>
107
+ </div>
108
+ <div style="clear: both">
109
+ <!-- <div class="form-group" style="display: flex;flex-wrap: wrap" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '') && (livedispose == 'true' || livedispose == true) " >-->
110
+ <!-- <label class="fivelabel">现场已处理</label>-->
111
+ <!-- <v-select :value="row.f_live_dispose"-->
112
+ <!-- :value-single="true"-->
113
+ <!-- :options="lives"-->
114
+ <!-- :disabled="role == 'androidview'"-->
115
+ <!-- @change="changlive"-->
116
+ <!-- @click="transelation(idxs)"-->
117
+ <!-- close-on-select clear-button></v-select>-->
118
+ <!-- </div>-->
119
+ <div class="form-group" style="display: flex;flex-wrap: wrap" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '') && (dealdispose == 'true' || dealdispose == true) " >
120
+ <label class="fivelabel">处理方式</label>
121
+ <v-select :value="row.f_deal_dispose"
122
+ :value-single="true"
123
+ :options="deals"
124
+ :disabled="role == 'androidview'"
125
+ @change="changdeal"
126
+ @click="transelation(idxs)"
127
+ close-on-select clear-button></v-select>
128
+ </div>
129
+ <div style="margin-left: 10px" class="form-group col-sm-10" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && row.tooltip != undefined && row.tooltip != '' ">
130
+ ☆{{row.tooltip}}
131
+ </div>
132
+ <div class="form-group col-sm-12" style="display: flex;flex-wrap: wrap" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '')">
133
+ <div class="auto" style="margin:1px;">
134
+ <div class="panel">
135
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
136
+ <div class="col-xs-6" style="height: 160px;width:160px;overflow: scroll;top: 1px">
137
+ <div class="col-sm-4" v-show="row.f_path">
138
+ <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
139
+ </div>
140
+ <div class="col-sm-4" v-show="!row.f_path" @click="takePic(idxs, row.f_item_name)">
141
+ <img src="../../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
142
+ </div>
143
+ <img v-show="row.f_path" src="../../../assets/remove.png" :class="style__" @click="delfile(idxs, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <!--多张隐患照片-->
149
+ <div class="auto" v-for="itemIndex in hiddenDangerImgNumber" style="margin: 1px;">
150
+ <div class="panel">
151
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
152
+ <div class="col-xs-6" style="height: 160px;width:160px;overflow: scroll;top: 1px">
153
+ <div class="col-sm-4" v-show="row['f_p' + (itemIndex+1) + '_path']">
154
+ <img-self :src="row['f_p' + (itemIndex+1) + '_path']" :alt="row.f_item_name" width="140" height="140"></img-self>
155
+ </div>
156
+ <div class="col-sm-4" v-show="!row['f_p' + (itemIndex+1) + '_path']" @click="takePic(idxs, row.f_item_name,'f_p' + (itemIndex+1)+ '_path')">
157
+ <img src="../../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
158
+ </div>
159
+ <img v-show="row['f_p' + (itemIndex+1)+'_path']" src="../../../assets/remove.png" :class="style__" @click="delfile(idxs,row['f_p' + (itemIndex+1)+'_path'],'f_p' + (itemIndex+1)+ '_path')" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
160
+ </div >
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </div>
165
+ </div>
166
+
167
+ <!--<v-select :value.sync="row.f_content" :options='getOptions(row.f_project)' placeholder='请选择' :disabled="(!(ischecked == '有')) || issee" close-on-select :value-single="true" v-if="!show && row.type == 'selector' && row.f_project != '气表品牌'"-->
168
+ <!--&gt;</v-select>-->
169
+ <!--<v-select :value.sync="row.f_content" :options='getOptions(row.f_project)' @change="getgasmodel" placeholder='请选择' :disabled="(!(ischecked == '有')) || issee" close-on-select :value-single="true" v-if="!show && row.type == 'selector' && row.f_project == '气表品牌'"-->
170
+ <!--&gt;</v-select>-->
171
+ <!-- <div class="auto" v-if="!show && row.type == 'checkbox' ">-->
172
+ <!-- <input class="magic-checkbox" type="checkbox" id="shebeicheckbox"-->
173
+ <!-- :checked="row.f_content == '有'"-->
174
+ <!-- @click="switchDetails(row.f_project, $event)" :disabled="issee"/>-->
175
+ <!-- <label for="shebeicheckbox" style="width:150px;padding-bottom: 10px">{{row.f_project}}</label>-->
176
+ <!-- </div>-->
177
+ <!--<img-area :model="Detail.imgs" :sutitle="row.f_project" v-if="row.type == 'picture'" :disabled="issee"></img-area>-->
178
+ </div>
179
+ </div>
180
+ </div>
181
+ <div style="border-top: 1px solid #D4D4D4"></div>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ </template>
186
+ <script>
187
+ import Vue from 'vue'
188
+ import * as Util from '../../Util'
189
+
190
+ export default {
191
+ title: '维修列表信息',
192
+ data() {
193
+ return {
194
+ // telphoneValid: '/^((0\\d{2,3}-\\d{7,8})|(1[3584]\\d{9}))$/',
195
+ // meterstyle:[],
196
+ hiddenDangerImgNumber: 0,//隐患图片数
197
+ shuclass: 'col-xs-12 col-sm-12 col-md-12 form-input-group mg8',
198
+ shuclass1: 'col-xs-12 col-sm-12 col-md-12 mg8',
199
+ // labels:[],
200
+ meternum: '',
201
+ ischecked: '有',
202
+ gasmodel: '',
203
+ textstyle: 'color: red',
204
+ paper: this.$parent.$parent.data,
205
+ f_items: [],
206
+ page: {},
207
+ selectindex: null,
208
+ lives: [{label: '是', value: '是'}, {label: '否', value: '否'}],
209
+ deals: [{label: '现场整改', value: '现场整改'}, {label: '自行处理', value: '自行处理'}, {
210
+ label: '未处理',
211
+ value: '未处理'
212
+ }],
213
+ f_live_dispose: '否',
214
+ f_deal_dispose: '未处理',
215
+ // 初始表底
216
+ f_initial_base: {},
217
+ // 气量异常差值 计算公式 => 气量异常差值 = 累计购气量 - (已用气量 - 初始表底) - 剩余气量
218
+ f_gas_aberrant_number: {},
219
+ // 金额异常差值 计算公式 => 金额异常差值 = 累计购金额 - 已用金额 - 剩余金额
220
+ f_fee_aberrant_number: {},
221
+ // 累购气量
222
+ f_total_gas: {},
223
+ // 累购金额
224
+ f_total_fee: {},
225
+ // 已用气量
226
+ f_table_base: {},
227
+ // 已用金额
228
+ f_fee_base: {},
229
+ // 剩余气量
230
+ f_gas_balance: {},
231
+ // 剩余金额
232
+ f_fee_balance: {},
233
+ // 气量异常差值允许误差
234
+
235
+ //物联网表数据存储
236
+ f_balance_amount: {},//物联网表剩余金额
237
+ f_meter_base: {},//物联网表读数
238
+ f_meter_base_jixie: {},//机械读表数
239
+ f_meter_base_yejing: {},//液晶读表数
240
+ f_balance_amount1: {},//物联网表现场录入的表上剩余金额
241
+ f_meter_base1: {},//物联网表现场录入的表字轮数
242
+ f_meter_aberrant_number1: {},//物联网表 表数异常差值
243
+ f_meter_aberrant_number2: {},//物联网表 表底数异常差值
244
+ f_fee_aberrant_number1: {},//物联网 表金额异常差值
245
+ gasDeviation: (
246
+ function (_this) {
247
+ let deviation = _this.$appdata.getSingleValue('气量异常差值允许误差')
248
+ if (deviation && !isNaN(deviation)) {
249
+ return deviation
250
+ } else {
251
+ return 0
252
+ }
253
+ }
254
+ )(this),
255
+ // 金额异常差值允许误差
256
+ feeDeviation: (
257
+ function (_this) {
258
+ let deviation = _this.$appdata.getSingleValue('金额异常差值允许误差')
259
+ if (deviation && !isNaN(deviation)) {
260
+ return deviation
261
+ } else {
262
+ return 0
263
+ }
264
+ }
265
+ )(this),
266
+ // 字轮异常差值允许误差
267
+ meterbase: (
268
+ function (_this) {
269
+ let deviation = _this.$appdata.getSingleValue('字轮异常差值允许误差')
270
+ if (deviation && !isNaN(deviation)) {
271
+ return deviation
272
+ } else {
273
+ return 0
274
+ }
275
+ }
276
+ )(this),
277
+ showElse: false, //控制其他选项是否显示
278
+ }
279
+ },
280
+ props: ['config', 'device', 'idx', 'operation', 'role'],
281
+ // props: {
282
+ // // 维修对应的用户数据收集
283
+ // model: {
284
+ // type: Object
285
+ // },
286
+ // service:{
287
+ // type: Object
288
+ // },
289
+ // show: {
290
+ // type: Boolean,
291
+ // default: false
292
+ // },
293
+ // repairitem:{
294
+ // type: Object
295
+ // },
296
+ // shutype:'heng',
297
+ // tabs:{
298
+ // type: Object
299
+ // },
300
+ // repairdetails:{
301
+ // type: Object
302
+ // },
303
+ // faultshow:{
304
+ // type: Object
305
+ // },
306
+ // issee:''
307
+ // },
308
+ methods: {
309
+ changse(val) {
310
+ if (val == undefined) {
311
+ return
312
+ }
313
+ if (this.selectindex != null) {
314
+ if (this.f_items[this.selectindex].type == 'selector') {
315
+ this.f_items[this.selectindex].f_item_value = val
316
+ } else if (this.f_items[this.selectindex].type == 'inputSelector') {
317
+ this.f_items[this.selectindex].f_item_value = val.target.value
318
+ }
319
+ }
320
+ },
321
+ changlive(val) {
322
+ if (val == undefined) {
323
+ return
324
+ }
325
+ if (this.selectindex != null) {
326
+ this.f_items[this.selectindex].f_live_dispose = val
327
+ }
328
+ },
329
+ changdeal(val) {
330
+ if (val == undefined) {
331
+ return
332
+ }
333
+ if (this.selectindex != null) {
334
+ this.f_items[this.selectindex].f_deal_dispose = val
335
+ }
336
+ },
337
+ switchDetails(detailsType, event) {
338
+ if (event.srcElement.checked) {
339
+ for (var i = 0; i < this.Detail.details.length; i++) {
340
+ if (this.Detail.details[i].f_project == detailsType) {
341
+ this.Detail.details[i].f_content = '有'
342
+ this.ischecked = '有'
343
+ return
344
+ }
345
+ }
346
+ } else {
347
+ this.Detail.imgs = []
348
+ for (var i = 0; i < this.Detail.details.length; i++) {
349
+ if (this.Detail.details[i].f_project == detailsType) {
350
+ this.Detail.details[i].f_content = '无'
351
+ this.ischecked = '无'
352
+ } else {
353
+ this.Detail.details[i].f_content = ''
354
+ }
355
+ }
356
+ }
357
+ },
358
+ getgasmodel(val) {
359
+ this.gasmodel = val
360
+ },
361
+ getradios(val, flag) {
362
+ let Reoptions = []
363
+ for (let i = 0; i < this.repairdetails.length; i++) {
364
+ var t = false
365
+ if (this.repairdetails[i].f_type == this.repairitem.header) {
366
+ for (var j = 0; j < this.repairdetails[i].details.length; j++) {
367
+ if (this.repairdetails[i].details[j].f_project == val) {
368
+ Reoptions = this.repairdetails[i].details[j].options
369
+ t = true
370
+ break
371
+ }
372
+ }
373
+ }
374
+ if (t) {
375
+ break
376
+ }
377
+ }
378
+ for (let j = 0; j < Reoptions.length; j++) {
379
+ if (Reoptions[j].data == flag) {
380
+ for (var e = 0; e < this.Detail.details.length; e++) {
381
+ if (this.Detail.details[e].f_project == val) {
382
+ this.Detail.details[e].f_status = Reoptions[j].f_status
383
+ return
384
+ }
385
+ }
386
+ break
387
+ }
388
+ }
389
+ },
390
+ deletedetails() {
391
+ this.$showMessage('该操作会删除所填信息,是否继续!', ['confirm', 'cancel']).then((res) => {
392
+ if (res === 'confirm') {
393
+ for (var i = 0; i < this.tabs.length; i++) {
394
+ if (this.tabs[i].number == this.repairitem.number) {
395
+ this.tabs.splice(i, 1)
396
+ this.model.servicerepair.splice(this.repairitem.number, 1)
397
+ for (let t = i; t < this.tabs.length; t++) {
398
+ this.tabs[t].number -= 1
399
+ }
400
+ return
401
+ }
402
+ }
403
+ }
404
+ })
405
+ },
406
+ takePic(prop, title, pathname = 'null') {
407
+ if (this.role == 'androidview') {
408
+ return
409
+ }
410
+ HostApp.__callback__ = this.cameraCallBack
411
+ HostApp.__this__ = this
412
+ //tag
413
+ let fileName
414
+ if (pathname == 'null') {
415
+ if (!this.f_items[prop].f_path || this.f_items[prop].f_path.includes("nopic.png")) {
416
+ fileName = Util.guid() + '-' + 'device' + this.device.n + '-' + this.idx + '-' + 'f_items' + prop + '.jpg'
417
+ } else {
418
+ fileName = Util.getFileName(this.f_items[prop].f_path)
419
+ }
420
+ } else {
421
+ if (!this.f_items[prop][pathname] || this.f_items[prop][pathname].includes("nopic.png")) {
422
+ fileName = Util.guid() + '-' + 'device' + this.device.n + '-' + this.idx + '-' + 'f_items' + prop + '.jpg'
423
+ } else {
424
+ fileName = Util.getFileName(this.f_items[prop][pathname])
425
+ }
426
+ }
427
+ //tag
428
+ //tag
429
+ HostApp._open_a_page({
430
+ type: 'boomerang',
431
+ page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
432
+ param: {
433
+ file: fileName,
434
+ requestCode: 111,
435
+ callback: 'javascript:HostApp.__callback__("' + prop + '", "%s","' + pathname + '");',
436
+ watermark: title + '\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name
437
+ }
438
+ })
439
+ },
440
+ cameraCallBack(prop, fileName, pathname) {
441
+ //tag
442
+ if (pathname == 'null') {
443
+ //tag
444
+ HostApp.__this__.$set('f_items[' + prop + '].f_path', fileName + '?' + Math.random())
445
+ //tag
446
+ HostApp.__callback__ = null
447
+ HostApp.__this__ = null
448
+ } else {
449
+ //tag
450
+ //tag)
451
+ HostApp.__this__.$set('f_items[' + prop + '].' + pathname + '', fileName + '?' + Math.random())
452
+ HostApp.__callback__ = null
453
+ HostApp.__this__ = null
454
+ }
455
+ },
456
+ delfile(prop, fileName, pathname = 'null') {
457
+ if (pathname == 'null') {
458
+ //tag
459
+ //tag)
460
+ if (fileName == Vue.nopic) {
461
+ return
462
+ } else {
463
+ HostApp.delfile(fileName)
464
+ this.f_items[prop].f_path = Vue.nopic
465
+ }
466
+ } else {
467
+ //tag
468
+ //tag)
469
+ if (fileName == Vue.nopic) {
470
+ return
471
+ } else {
472
+ HostApp.delfile(fileName)
473
+ this.f_items[prop][pathname] = Vue.nopic
474
+ }
475
+ }
476
+ },
477
+ adddetails() {
478
+ // 下标作为序号,取值用。 增加 序号得依次增加
479
+ if (this.tabs.length > 0) {
480
+ for (let i = this.tabs.length - 1; i > 0; i--) {
481
+ if (this.tabs[i].header == this.repairitem.header) {
482
+ if (this.model.servicerepair.length > 0) {
483
+ for (let j = this.model.servicerepair.length - 1; j > -1; j--) {
484
+ if (this.model.servicerepair[j].f_type == this.repairitem.header) {
485
+ this.model.servicerepair.splice(j + 1, 0, Object.assign({}, JSON.parse(JSON.stringify(this.tabs[i].details))))
486
+ this.tabs.splice(i + 1, 0, {
487
+ header: `${this.repairitem.header}`,
488
+ details: this.tabs[i].details,
489
+ complete: 'repair-details',
490
+ class: 'repair-details-class',
491
+ number: j + 1,
492
+ items: this.tabs[i].items
493
+ })
494
+ for (let t = i + 2; t < this.tabs.length; t++) {
495
+ this.tabs[t].number += 1
496
+ }
497
+ this.faultshow.number += this.faultshow.number + 1
498
+ return
499
+ }
500
+ }
501
+ }
502
+ }
503
+ }
504
+ }
505
+ },
506
+ transelation(val) {
507
+ this.selectindex = val
508
+ },
509
+ towatch() {
510
+ for (let n in this.f_items) {
511
+ if (typeof this.f_items[n] == 'function') {
512
+ continue
513
+ }
514
+ if (this.f_items[n].type == 'selector' || this.f_items[n].type == 'inputSelector') {
515
+ // 监听下拉框,如果有隐患,需要拍照
516
+ this.$watch('f_items[' + n + '].selected', function (val) {
517
+ // 下拉框值
518
+ //tag)
519
+ // 下拉框所属设备
520
+ //tag
521
+ // 下拉框所属项
522
+ //tag
523
+ let shImage = false
524
+ if (val.indexOf('其他') == -1) {
525
+ this.f_items[n].f_else = ''
526
+ }
527
+ // if(this.config[this.device.device].items[item].type == 'selector'){
528
+ // this.f_items[n].f_item_value = val
529
+ // }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
530
+ // this.f_items[n].f_item_value = val[0]
531
+ // }
532
+ // 在配置中查找该项
533
+ for (let item in this.config[this.device.device].items) {
534
+ if (typeof this.config[this.device.device].items[item] == 'function') {
535
+ continue
536
+ }
537
+ let type = this.config[this.device.device].items[item].type
538
+ let multiple = this.config[this.device.device].items[item].multiple ? this.config[this.device.device].items[item].multiple : false
539
+ let options = this.config[this.device.device].items[item].options
540
+ if ((this.config[this.device.device].items[item].type == 'selector' || this.config[this.device.device].items[item].type == 'inputSelector') && item == this.f_items[n].f_item_name) {
541
+ for (let i in options) {
542
+ if (typeof options[i] == 'function') {
543
+ continue
544
+ }
545
+ let value
546
+ if (this.config[this.device.device].items[item].type == 'selector' && this.config[this.device.device].items[item].multiple == false) {
547
+ value = val[0]
548
+ } else if (this.config[this.device.device].items[item].type == 'inputSelector') {
549
+ value = val
550
+ }
551
+ //tag)
552
+ // 如果未选择,清空图片、隐患信息等
553
+ if ((type == 'selector' && val.length == 0) || (type == 'inputSelector' && val == '')) {
554
+ this.f_items[n].f_path = ''
555
+ this.f_items[n].f_is_defect = ''
556
+ this.f_items[n].f_defect_level = ''
557
+ this.f_items[n].f_live_dispose = ''
558
+ this.f_items[n].f_deal_dispose = ''
559
+ this.f_items[n].tooltip = ''
560
+ }
561
+ if ((type == 'selector' && multiple == false && options[i].data == val[0]) || (type == 'inputSelector' && options[i].data == val) || (type == 'selector' && multiple == true && val.indexOf(options[i].data) > -1)) {
562
+ // 找到选中的项了
563
+ //tag
564
+ if (options[i].isdefect == true) {
565
+ shImage = true
566
+ }
567
+ if (options[i].isdefect == false || this.f_items[n].f_item_value == '') {
568
+ shImage = false
569
+ }
570
+ //tag
571
+ if (shImage) {
572
+ this.f_items[n].f_is_defect = true
573
+ this.f_items[n].f_defect_level = options[i].level
574
+ this.f_items[n].f_path = Vue.nopic
575
+ this.f_items[n].f_live_dispose = '否'
576
+ this.f_items[n].f_deal_dispose = '未处理'
577
+ //tag
578
+ this.f_items[n].tooltip = options[i].tooltip
579
+ } else {
580
+ this.f_items[n].f_path = ''
581
+ this.f_items[n].f_is_defect = ''
582
+ this.f_items[n].f_defect_level = ''
583
+ this.f_items[n].f_live_dispose = ''
584
+ this.f_items[n].f_deal_dispose = ''
585
+ this.f_items[n].tooltip = ''
586
+ }
587
+ }
588
+ }
589
+ }
590
+ }
591
+ }
592
+ )
593
+ // this.$watch('other',function(val){
594
+ // //tag
595
+ // if(this.selectindex != null) {
596
+ // let index = this.f_items[this.selectindex].f_item_value.indexOf('其他')
597
+ // if(index > -1){
598
+ // this.f_items[this.selectindex].f_item_value.splice(index,1,this.other)
599
+ // }
600
+ // }
601
+ //
602
+ // })
603
+ } else if (this.f_items[n].type == 'radio') {
604
+ // 监听单选框,如果有隐患,需要拍照
605
+ this.$watch('f_items[' + n + '].f_item_value', function (val) {
606
+ //tag)
607
+ let options = this.f_items[n].options
608
+ //tag)
609
+ for (let i = 0; i < options.length; i++) {
610
+ //tag)
611
+ // 找到选中的项了
612
+ if (options[i].value == val) {
613
+ // 如果有隐患,拍图片
614
+ if (options[i].isdefect) {
615
+ this.f_items[n].f_is_defect = true
616
+ this.f_items[n].f_defect_level = options[i].level
617
+ this.f_items[n].f_path = Vue.nopic
618
+ this.f_items[n].f_live_dispose = '否'
619
+ this.f_items[n].f_deal_dispose = '未处理'
620
+ this.f_items[n].tooltip = options[i].tooltip
621
+ //tag)
622
+ return
623
+ }
624
+ }
625
+ }
626
+ this.f_items[n].f_path = ''
627
+ this.f_items[n].f_is_defect = ''
628
+ this.f_items[n].f_defect_level = ''
629
+ this.f_items[n].f_live_dispose = ''
630
+ this.f_items[n].f_deal_dispose = ''
631
+ this.f_items[n].tooltip = ''
632
+ })
633
+ } else if (this.f_items[n].type == 'checkbox') {
634
+ // 监听单选框,如果有隐患,需要拍照
635
+ this.$watch('f_items[' + n + '].f_item_value', function (val) {
636
+ //tag)
637
+ // 如果是手动赋值,不执行下面逻辑
638
+ if (this.f_items[n].isReSet) {
639
+ this.f_items[n].isReSet = false
640
+ return
641
+ }
642
+ let options = this.f_items[n].options
643
+ //tag)
644
+ // 取出选中项中有隐患的详细信息
645
+ let selected = options.filter(item => {
646
+ return val.indexOf(item.value) != -1 && item.isdefect
647
+ })
648
+
649
+ if (selected.length > 0) {
650
+ // 防止赋值无限调用
651
+ this.f_items[n].isReSet = true
652
+ let selectList = selected.map(item => {
653
+ return item.value
654
+ })
655
+ // 如果选中的是非隐患项,取消选中isdefect为true的
656
+ if (selectList.indexOf(val[val.length - 1]) == -1) {
657
+ this.f_items[n].f_item_value = val.filter(item => {
658
+ return selectList.indexOf(item) == -1
659
+ })
660
+ this.f_items[n].f_path = ''
661
+ this.f_items[n].f_is_defect = ''
662
+ this.f_items[n].f_defect_level = ''
663
+ this.f_items[n].f_live_dispose = ''
664
+ this.f_items[n].f_deal_dispose = ''
665
+ this.f_items[n].tooltip = ''
666
+ return
667
+ }
668
+ // 如果选中的是隐患项,取消选中isdefect为false的
669
+ this.f_items[n].f_item_value = selectList
670
+ // 如果第一次选择隐患项,初始化
671
+ if (!this.f_items[n].f_is_defect) {
672
+ this.f_items[n].f_is_defect = true
673
+ this.f_items[n].f_defect_level = selected[0].level
674
+ this.f_items[n].f_path = Vue.nopic
675
+ this.f_items[n].f_live_dispose = '否'
676
+ this.f_items[n].f_deal_dispose = '未处理'
677
+ //tag
678
+ this.f_items[n].tooltip = selected[0].tooltip
679
+ }
680
+ //tag)
681
+ return
682
+ }
683
+ this.f_items[n].f_path = ''
684
+ this.f_items[n].f_is_defect = ''
685
+ this.f_items[n].f_defect_level = ''
686
+ this.f_items[n].f_live_dispose = ''
687
+ this.f_items[n].f_deal_dispose = ''
688
+ this.f_items[n].tooltip = ''
689
+ })
690
+ }
691
+ }
692
+ //tag)
693
+ },
694
+
695
+ getNumber(val) {
696
+ //tag
697
+ console.log('this.f_meter_base_jixie.index', this.f_meter_base_jixie.index)
698
+ console.log('this.f_meter_base_yejing.index', this.f_meter_base_yejing.index)
699
+ if (!this.f_meter_base_jixie.index || !this.f_meter_base_yejing.index) {
700
+ //tag
701
+ return
702
+ }
703
+ //tag)
704
+ //tag
705
+ console.log('this.f_items[this.f_meter_base_jixie.index].f_item_value', this.f_items[this.f_meter_base_jixie.index].f_item_value)
706
+ console.log('this.f_items[this.f_meter_base_yejing.index].f_item_value', this.f_items[this.f_meter_base_yejing.index].f_item_value)
707
+ this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_base_jixie.index].f_item_value - this.f_items[this.f_meter_base_yejing.index].f_item_value
708
+ this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_aberrant_number2.index].f_item_value.toFixed(3)
709
+ // 如果数值有误,清空结果s
710
+ if (isNaN(this.f_items[this.f_meter_aberrant_number2.index].f_item_value)) {
711
+ this.f_items[this.f_meter_aberrant_number2.index].f_item_value = null
712
+ }
713
+ //tag ===> ' + Math.abs(this.f_items[this.f_gas_aberrant_number.index].f_item_value))
714
+ //tag ===> ' + JSON.stringify(Number(this.gasDeviation)))
715
+ // 计算差值是否在范围内
716
+ if (Math.abs(this.f_items[this.f_meter_aberrant_number2.index].f_item_value) > Number(this.gasDeviation)) {
717
+ this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = true
718
+ this.f_items[this.f_meter_aberrant_number2.index].f_deal_dispose = '未处理'
719
+ }else{
720
+ this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = null
721
+ this.f_items[this.f_meter_aberrant_number2.index].f_deal_dispose = null
722
+ }
723
+ if( this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = true){
724
+ this.$showMessage(`表底数异常差值为:${this.f_items[this.f_meter_aberrant_number2.index].f_item_value},是否为隐患?`, ['confirm', 'cancel']).then((res) => {
725
+ if (res === 'confirm') {
726
+ this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = true
727
+ this.f_items[this.f_meter_aberrant_number2.index].f_deal_dispose = '未处理'
728
+ }else{
729
+ this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = null
730
+ this.f_items[this.f_meter_aberrant_number2.index].f_deal_dispose = null
731
+ }
732
+ })
733
+ }
734
+ },
735
+
736
+ getGasAberrantNumber(val) {
737
+ //tag
738
+ if (!this.f_table_base.index || !this.f_gas_balance.index) {
739
+ //tag
740
+ return
741
+ }
742
+ // 先清空
743
+ this.f_items[this.f_gas_aberrant_number.index].f_item_value = null
744
+ this.f_items[this.f_gas_aberrant_number.index].f_is_defect = false
745
+ if (val == '已用气量') {
746
+ //剩余气量 = 累购-已用
747
+ this.f_items[this.f_gas_balance.index].f_item_value = this.f_items[this.f_total_gas.index].f_item_value - this.f_items[this.f_table_base.index].f_item_value
748
+ if (isNaN(this.f_items[this.f_gas_balance.index].f_item_value)) {
749
+ this.f_items[this.f_gas_balance.index].f_item_value = null
750
+ }
751
+ }
752
+
753
+ // 只有两个值都填了才会计算
754
+ if (!this.f_items[this.f_table_base.index].f_item_value || !this.f_items[this.f_gas_balance.index].f_item_value) {
755
+ return
756
+ }
757
+ //tag)
758
+ //tag
759
+ //tag
760
+
761
+ // 计算公式 => 气量异常差值 = 累计购气量 - (已用气量 - 初始表底) - 剩余气量
762
+ this.f_items[this.f_gas_aberrant_number.index].f_item_value = this.f_items[this.f_total_gas.index].f_item_value - this.f_items[this.f_gas_balance.index].f_item_value - (this.f_items[this.f_table_base.index].f_item_value - this.f_items[this.f_initial_base.index].f_item_value)
763
+ this.f_items[this.f_gas_aberrant_number.index].f_item_value = this.f_items[this.f_gas_aberrant_number.index].f_item_value.toFixed(3)
764
+ // 如果数值有误,清空结果s
765
+ if (isNaN(this.f_items[this.f_gas_aberrant_number.index].f_item_value)) {
766
+ this.f_items[this.f_gas_aberrant_number.index].f_item_value = null
767
+ }
768
+ //tag ===> ' + Math.abs(this.f_items[this.f_gas_aberrant_number.index].f_item_value))
769
+ //tag ===> ' + JSON.stringify(Number(this.gasDeviation)))
770
+ // 计算差值是否在范围内
771
+ if (Math.abs(this.f_items[this.f_gas_aberrant_number.index].f_item_value) > Number(this.gasDeviation)) {
772
+ this.f_items[this.f_gas_aberrant_number.index].f_is_defect = true
773
+ this.f_items[this.f_gas_aberrant_number.index].f_deal_dispose = '未处理'
774
+ }else{
775
+ this.f_items[this.f_gas_aberrant_number.index].f_is_defect = null
776
+ this.f_items[this.f_gas_aberrant_number.index].f_deal_dispose = null
777
+ }
778
+ },
779
+ //tag)
780
+ getFeeAberrantNumber(val){
781
+ //tag
782
+ // 只有两个值都填了才会计算
783
+ if (!this.f_fee_base.index || !this.f_fee_balance.index) {
784
+ //tag
785
+ return
786
+ }
787
+ // 先清空
788
+ this.f_items[this.f_fee_aberrant_number.index].f_item_value = null
789
+ this.f_items[this.f_fee_aberrant_number.index].f_is_defect = false
790
+
791
+ if (val == '已用金额') {
792
+ this.f_items[this.f_fee_balance.index].f_item_value = this.f_items[this.f_total_fee.index].f_item_value - this.f_items[this.f_fee_base.index].f_item_value
793
+ if (isNaN(this.f_items[this.f_fee_balance.index].f_item_value)) {
794
+ this.f_items[this.f_fee_balance.index].f_item_value = null
795
+ }
796
+ }
797
+
798
+ if (!this.f_items[this.f_fee_base.index].f_item_value || !this.f_items[this.f_fee_balance.index].f_item_value) {
799
+ return
800
+ }
801
+
802
+ // 计算公式 => 金额异常差值 = 累计购金额 - 已用金额 - 剩余金额
803
+ this.f_items[this.f_fee_aberrant_number.index].f_item_value = this.f_items[this.f_total_fee.index].f_item_value - this.f_items[this.f_fee_balance.index].f_item_value - this.f_items[this.f_fee_base.index].f_item_value
804
+ this.f_items[this.f_fee_aberrant_number.index].f_item_value = this.f_items[this.f_fee_aberrant_number.index].f_item_value.toFixed(3)
805
+ if (isNaN(this.f_items[this.f_fee_aberrant_number.index].f_item_value)) {
806
+ this.f_items[this.f_fee_aberrant_number.index].f_item_value = null
807
+ }
808
+ //tag ===> ' + Math.abs(this.f_items[this.f_fee_aberrant_number.index].f_item_value))
809
+ //tag ===> ' + JSON.stringify(Number(this.feeDeviation)))
810
+ // 计算差值是否在范围内
811
+ if (Math.abs(this.f_items[this.f_fee_aberrant_number.index].f_item_value) > Number(this.feeDeviation)) {
812
+ this.f_items[this.f_fee_aberrant_number.index].f_is_defect = true
813
+ this.f_items[this.f_fee_aberrant_number.index].f_deal_dispose = '未处理'
814
+ }else{
815
+ this.f_items[this.f_fee_aberrant_number.index].f_is_defect = null
816
+ this.f_items[this.f_fee_aberrant_number.index].f_deal_dispose = null
817
+ }
818
+ //tag)
819
+ },
820
+ //物联网表字轮数改变触发
821
+ getmeteraberrantnumber(){
822
+ //tag
823
+ // 先清空
824
+ this.f_items[this.f_meter_aberrant_number1.index].f_item_value = null
825
+ this.f_items[this.f_meter_aberrant_number1.index].f_is_defect = false
826
+
827
+ this.f_items[this.f_meter_aberrant_number2.index].f_item_value = null
828
+ this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = false
829
+ //tag
830
+ // 只有两个值都填了才会计算
831
+ if (!this.f_items[this.f_meter_base.index].f_item_value || !this.f_items[this.f_meter_base1.index].f_item_value) {
832
+ return
833
+ }
834
+ if (!this.f_items[this.f_meter_base_yejing.index].f_item_value || !this.f_items[this.f_meter_base_jixie.index].f_item_value) {
835
+ return
836
+ }
837
+ //tag
838
+ // 计算公式 => 表数异常差值= - 字轮数 - 后台表读数
839
+ this.f_items[this.f_meter_aberrant_number1.index].f_item_value = this.f_items[this.f_meter_base1.index].f_item_value - this.f_items[this.f_meter_base.index].f_item_value
840
+ this.f_items[this.f_meter_aberrant_number1.index].f_item_value = this.f_items[this.f_meter_aberrant_number1.index].f_item_value.toFixed(3)
841
+ if (isNaN(this.f_items[this.f_meter_aberrant_number1.index].f_item_value)) {
842
+ this.f_items[this.f_meter_aberrant_number1.index].f_item_value = null
843
+ }
844
+ // 计算公式 => 表底数异常差值= - 机械 - 液晶表读数
845
+ this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_base_jixie.index].f_item_value - this.f_items[this.f_meter_base_yejing.index].f_item_value
846
+ this.f_items[this.f_meter_aberrant_number2.index].f_item_value = this.f_items[this.f_meter_aberrant_number2.index].f_item_value.toFixed(3)
847
+ if (isNaN(this.f_items[this.f_meter_aberrant_number2.index].f_item_value)) {
848
+ this.f_items[this.f_meter_aberrant_number2.index].f_item_value = null
849
+ }
850
+ //tag ===> ' + Math.abs(this.f_items[this.f_meter_aberrant_number1.index].f_item_value))
851
+ // 计算差值是否在范围内
852
+ //tag)
853
+ if (Math.abs(this.f_items[this.f_meter_aberrant_number1.index].f_item_value) > Number(this.meterbase)) {
854
+ this.f_items[this.f_meter_aberrant_number1.index].f_is_defect = true
855
+ }
856
+ if (Math.abs(this.f_items[this.f_meter_aberrant_number2.index].f_item_value) > Number(this.meterbase)) {
857
+ this.f_items[this.f_meter_aberrant_number2.index].f_is_defect = true
858
+ }
859
+ //tag)
860
+ },
861
+
862
+ disSelect(index, itemValue) {
863
+ //tag)
864
+ //tag)
865
+ if (this.f_items[index].f_item_value == itemValue) {
866
+ this.$set(`f_items[${index}].f_item_value`, '')
867
+ }
868
+ }
869
+ },
870
+ ready() {
871
+ //tag
872
+ //tag
873
+ if(Vue.config.safecheck != undefined){
874
+ if(Vue.config.safecheck.ApproveConfig != undefined){
875
+ if(Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
876
+ this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
877
+ }
878
+ if(Vue.config.safecheck.ApproveConfig.dealdispose != undefined) {
879
+ this.dealdispose = Vue.config.safecheck.ApproveConfig.dealdispose
880
+ }
881
+ if(Vue.config.safecheck.ApproveConfig.showtorepair) {
882
+ this.deals=[{label: '现场整改', value: '现场整改'},
883
+ {label: '自行处理', value: '自行处理'},
884
+ {label: '未处理', value: '未处理'},
885
+ {label: '转维修', value: '报修'}
886
+ ]
887
+ }
888
+ if(Vue.config.safecheck.ApproveConfig.hiddendanger != undefined) {
889
+ if (parseInt(Vue.config.safecheck.ApproveConfig.hiddendanger) >= 3) {
890
+ this.hiddenDangerImgNumber = 3
891
+ }else {
892
+ this.hiddenDangerImgNumber = parseInt(Vue.config.safecheck.ApproveConfig.hiddendanger)
893
+ }
894
+ }
895
+ }
896
+ }
897
+ //tag
898
+ //tag)
899
+ //tag)
900
+ //tag)
901
+ //创建页面所需数据
902
+ this.$set('piece', this.paper['device'+this.device.n][this.idx])
903
+ //tag)
904
+ //tag)
905
+ let n = 0
906
+ for (let item in this.config[this.device.device].items) {
907
+ if(typeof this.config[this.device.device].items[item]=='function'){
908
+ continue
909
+ }
910
+ let index = this.config[this.device.device].items[item].index-1
911
+ this.$set('page.options' + index, [])
912
+ //tag)
913
+ //tag)
914
+ //tag)
915
+ // 先根据配置组接页面
916
+ let f_item_value
917
+ if(this.config[this.device.device].items[item].type == 'selector' || this.config[this.device.device].items[item].type == 'checkbox'){
918
+ f_item_value = []
919
+ // 判断选项的默认值
920
+ for (let defitem in this.config[this.device.device].items[item].options) {
921
+ if(typeof this.config[this.device.device].items[item].options[defitem]=='function'){
922
+ continue
923
+ }
924
+ let defopt = this.config[this.device.device].items[item].options[defitem]
925
+ if (defopt.isdefault) {
926
+ //tag
927
+ f_item_value[0] = defopt.data
928
+ }
929
+ }
930
+ // if(this.config[this.device.device].items[item].data){
931
+ // f_item_value.push(this.config[this.device.device].items[item].data)
932
+ // }
933
+ }else if(this.config[this.device.device].items[item].type == 'radio'){
934
+ //为radio添加默认值
935
+ f_item_value=''
936
+ //tag)
937
+ for (let defitem in this.config[this.device.device].items[item].options) {
938
+ if(typeof this.config[this.device.device].items[item].options[defitem]=='function'){
939
+ continue
940
+ }
941
+ //tag)
942
+ let defopt = this.config[this.device.device].items[item].options[defitem]
943
+ if (defopt.isdefault) {
944
+ //tag)
945
+ f_item_value = defopt.data
946
+ }
947
+ }
948
+ }else{
949
+ f_item_value = this.config[this.device.device].items[item].data ? this.config[this.device.device].items[item].data : ''
950
+ }
951
+ //tag)
952
+ let it = {
953
+ type: this.config[this.device.device].items[item].type,
954
+ f_item_name: item,
955
+ checkmust: this.config[this.device.device].items[item].checkmust,
956
+ f_item_value: f_item_value,
957
+ f_is_defect: '',
958
+ multiple:this.config[this.device.device].items[item].multiple == true?this.config[this.device.device].items[item].multiple:false,
959
+ isshow:this.config[this.device.device].items[item].isshow == false?this.config[this.device.device].items[item].isshow:true,
960
+ readonly: this.config[this.device.device].items[item].readonly == true?true:false,
961
+ remark: this.config[this.device.device].items[item].remark ? this.config[this.device.device].items[item].remark : '',
962
+ f_path: '',
963
+ unit: this.config[this.device.device].items[item].unit ? this.config[this.device.device].items[item].unit : '',
964
+ tooltip:'',
965
+ f_live_dispose:'',
966
+ f_deal_dispose:'',
967
+ f_else: '',
968
+ f_p1_path: '',
969
+ f_p2_path: '',
970
+ f_p3_path: ''
971
+ }
972
+ //tag)
973
+ //tag)
974
+ this.$set('f_items['+index+']',it)
975
+ if (this.config[this.device.device].items[item].type == 'selector' ||this.config[this.device.device].items[item].type == 'inputSelector') {
976
+ if(this.config[this.device.device].items[item].type == 'selector'){
977
+ this.page['options' + index].push({
978
+ label: "请选择",
979
+ value: ''
980
+ })
981
+ }
982
+ for (let i in this.config[this.device.device].items[item].options) {
983
+ if(typeof this.config[this.device.device].items[item].options[i]=='function'){
984
+ continue
985
+ }
986
+ this.page['options' + index].push({
987
+ label: this.config[this.device.device].items[item].options[i].data,
988
+ value: this.config[this.device.device].items[item].options[i].data,
989
+ tooltip: this.config[this.device.device].items[item].options[i].tooltip
990
+ })
991
+ }
992
+ if(this.config[this.device.device].items[item].type == 'selector'){
993
+ this.$set('f_items['+index+'].selected', f_item_value)
994
+ }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
995
+ this.$set('f_items['+index+'].selected', f_item_value)
996
+ }
997
+
998
+ this.$set('f_items['+index+'].options',this.page['options' + index])
999
+
1000
+ //tag)
1001
+ } else if (this.config[this.device.device].items[item].type == 'radio' || this.config[this.device.device].items[item].type == 'checkbox') {
1002
+ //tag)
1003
+ //tag
1004
+ //tag)
1005
+ for (let i in this.config[this.device.device].items[item].options) {
1006
+ if(typeof this.config[this.device.device].items[item].options[i]=='function'){
1007
+ continue
1008
+ }
1009
+ //tag
1010
+ this.page['options' + index].push({
1011
+ label: this.config[this.device.device].items[item].options[i].data,
1012
+ value: this.config[this.device.device].items[item].options[i].data,
1013
+ isdefect: this.config[this.device.device].items[item].options[i].isdefect,
1014
+ level: this.config[this.device.device].items[item].options[i].level,
1015
+ tooltip: this.config[this.device.device].items[item].options[i].tooltip
1016
+ })
1017
+ //tag)
1018
+ }
1019
+ //tag)
1020
+ this.$set('f_items[' + index + '].options', this.page['options' + index])
1021
+ this.$set('f_items[' + index + '].f_item_value', f_item_value)
1022
+ //tag)
1023
+ }
1024
+ n = n + 1
1025
+ }
1026
+ if(JSON.stringify(this.piece) == '{}') {
1027
+ // 如果没有,则新建
1028
+ this.$set('piece.f_items',this.f_items)
1029
+ this.$set('piece.f_device_type',this.device.device)
1030
+ } else {
1031
+ // 已经存在,把之前的数据重新填入
1032
+ for (let f in this.f_items){
1033
+ if(typeof this.f_items[f]=='function'){
1034
+ continue
1035
+ }
1036
+ for(let p in this.piece.f_items) {
1037
+ if(typeof this.piece.f_items[p]=='function'){
1038
+ continue
1039
+ }
1040
+ if (this.f_items[f].f_item_name == this.piece.f_items[p].f_item_name) {
1041
+ //tag)
1042
+ //tag)
1043
+ this.f_items[f] = Object.assign(this.f_items[f], this.piece.f_items[p])
1044
+ //tag)
1045
+ if (this.f_items[f].type == 'selector' || this.f_items[f].type == 'inputSelector') {
1046
+ //tag)
1047
+ //tag)
1048
+ this.f_items[f].selected = this.piece.f_items[p].f_item_value
1049
+ //tag)
1050
+ }
1051
+ // 取出特殊值
1052
+ if (this.f_items[f].f_item_name == '初始表底') {
1053
+ //tag)
1054
+ this.f_initial_base.index = f
1055
+ } else if (this.f_items[f].f_item_name == '累购气量') {
1056
+ //tag)
1057
+ this.f_total_gas.index = f
1058
+ } else if (this.f_items[f].f_item_name == '已用气量') {
1059
+ //tag)
1060
+ this.f_table_base.index = f
1061
+ this.$watch('f_items[' + f + '].f_item_value', () => {
1062
+ this.getGasAberrantNumber('已用气量')
1063
+ })
1064
+ }else if (this.f_items[f].f_item_name == '机械表底数') {
1065
+ //tag)
1066
+ console.log('机械表底数---', f)
1067
+ this.f_meter_base_jixie.index = f
1068
+ }else if (this.f_items[f].f_item_name == '液晶表底数') {
1069
+ //tag)
1070
+ console.log('液晶表底数---', f)
1071
+ this.f_meter_base_yejing.index = f
1072
+ this.$watch('f_items[' + f + '].f_item_value', () => {
1073
+ this.getNumber('液晶表底数')
1074
+ })
1075
+ } else if (this.f_items[f].f_item_name == '剩余气量') {
1076
+ //tag)
1077
+ this.f_gas_balance.index = f
1078
+ this.$watch('f_items[' + f + '].f_item_value', () => {
1079
+ this.getGasAberrantNumber('')
1080
+ })
1081
+ } else if (this.f_items[f].f_item_name == '气量异常差值') {
1082
+ //tag)
1083
+ this.f_gas_aberrant_number.index = f
1084
+ } else if (this.f_items[f].f_item_name == '累购金额') {
1085
+ //tag)
1086
+ this.f_total_fee.index = f
1087
+ } else if (this.f_items[f].f_item_name == '已用金额') {
1088
+ //tag)
1089
+ this.f_fee_base.index = f
1090
+ this.$watch('f_items[' + f + '].f_item_value', () => {
1091
+ this.getFeeAberrantNumber('已用金额')
1092
+ })
1093
+ } else if (this.f_items[f].f_item_name == '剩余金额') {
1094
+ //tag)
1095
+ this.f_fee_balance.index = f
1096
+ this.$watch('f_items[' + f + '].f_item_value', () => {
1097
+ this.getFeeAberrantNumber('')
1098
+ })
1099
+ } else if (this.f_items[f].f_item_name == '金额异常差值') {
1100
+ //tag)
1101
+ this.f_fee_aberrant_number.index = f
1102
+ }else if (this.f_items[f].f_item_name == '表读数') {
1103
+ //tag)
1104
+ this.f_meter_base.index = f
1105
+ }else if (this.f_items[f].f_item_name == '表剩余金额') {
1106
+ //tag)
1107
+ this.f_balance_amount.index = f
1108
+ }else if (this.f_items[f].f_item_name == '字轮数') {
1109
+ //tag)
1110
+ this.f_meter_base1.index = f
1111
+ this.$watch('f_items[' + f + '].f_item_value', () => {
1112
+ this.getmeteraberrantnumber()
1113
+ })
1114
+ }else if (this.f_items[f].f_item_name == '表余额') {
1115
+ //tag)
1116
+ this.f_balance_amount1.index = f
1117
+ this.$watch('f_items[' + f + '].f_item_value', () => {
1118
+ this.getfeeaberrantnumber1()
1119
+ })
1120
+ }else if (this.f_items[f].f_item_name == '表数异常差值') {
1121
+ //tag)
1122
+ this.f_meter_aberrant_number1.index = f
1123
+ }else if (this.f_items[f].f_item_name == '表底数异常差值') {
1124
+ //tag)
1125
+ this.f_meter_aberrant_number2.index = f
1126
+ }else if (this.f_items[f].f_item_name == '表金额异常差值') {
1127
+ //tag)
1128
+ this.f_fee_aberrant_number1.index = f
1129
+ }
1130
+ }
1131
+ }
1132
+ for (let em in this.config[this.device.device].items) {
1133
+ if(typeof this.config[this.device.device].items[em]=='function'){
1134
+ continue
1135
+ }
1136
+ if (this.config[this.device.device].items[em].type == 'selector' && em == this.f_items[f].f_item_name) {
1137
+ this.f_items[f].options =[]
1138
+ for (let k in this.config[this.device.device].items[em].options) {
1139
+ if(typeof this.config[this.device.device].items[em].options[k]=='function'){
1140
+ continue
1141
+ }
1142
+ this.f_items[f].options.push({
1143
+ label: this.config[this.device.device].items[em].options[k].data,
1144
+ value: this.config[this.device.device].items[em].options[k].data
1145
+ })
1146
+ }
1147
+ }
1148
+ }
1149
+ }
1150
+ //tag)
1151
+ this.$set('piece.f_items',this.f_items)
1152
+ }
1153
+ this.towatch()
1154
+ },
1155
+ destroyed(){
1156
+ let nullCount = 0
1157
+ let metertitles
1158
+ //判断当前是否有选中项
1159
+ for (let row in this.f_items){
1160
+ if(typeof this.f_items[row]=='function'){
1161
+ continue
1162
+ }
1163
+ if(this.f_items[row].selected && this.f_items[row].selected != '' && this.f_items[row].selected instanceof Array){
1164
+ //tag
1165
+ this.f_items[row].f_item_value = this.f_items[row].selected
1166
+ }else if(this.f_items[row].selected && this.f_items[row].selected != ''){
1167
+ //tag
1168
+ this.f_items[row].f_item_value = this.f_items[row].selected
1169
+ }
1170
+ // if(this.f_items[row].f_item_value instanceof Array && this.f_items[row].f_item_value.length != 0 ){
1171
+ // nullCount = nullCount+1
1172
+ // }else if(this.f_items[row].f_item_value != ''){
1173
+ // nullCount = nullCount+1
1174
+ // }
1175
+ }
1176
+ let picture = []
1177
+ // for (let row in this.f_items){
1178
+ // let a={}
1179
+ // a.f_path = this.f_items[row].f_path
1180
+ // a.name = this.f_items[row].f_item_name
1181
+ // }
1182
+ // picture.push(a)
1183
+ this.$set(`paper['device${this.device.n}'][${this.idx}]`, this.piece)
1184
+ //tag
1185
+ },
1186
+ computed:{
1187
+
1188
+ }
1189
+ }
1190
+ </script>
1191
+ <style lang="less" scoped>
1192
+ .class-erro {
1193
+ color: #a94442;
1194
+ }
1195
+ .fivelabel{
1196
+ border: none;
1197
+ border-left: 5px solid #A2C2EB;
1198
+ float: left;
1199
+ width: 35%;
1200
+ margin-bottom: 3px;
1201
+ text-align: left;
1202
+ word-wrap: break-word;
1203
+ white-space: normal;
1204
+ }
1205
+ .radiolabel{
1206
+ border: none;
1207
+ border-left: 5px solid #A2C2EB;
1208
+ float: left;
1209
+ width: 65%;
1210
+ margin-bottom: 3px;
1211
+ text-align: left;
1212
+ word-wrap: break-word;
1213
+ white-space: normal;
1214
+ }
1215
+
1216
+ .textlabel {
1217
+ border: none;
1218
+ border-left: 5px solid #A2C2EB;
1219
+ width: 100%;
1220
+ margin-bottom: 3px;
1221
+ text-align: left;
1222
+ word-wrap: break-word;
1223
+ white-space: normal;
1224
+ }
1225
+ .textlabel1 {
1226
+ border: none;
1227
+ border-left: 5px solid #f7cb32;
1228
+ width: 100%;
1229
+ margin-bottom: 3px;
1230
+ text-align: left;
1231
+ word-wrap: break-word;
1232
+ white-space: normal;
1233
+ }
1234
+ .spanrodio{
1235
+ margin-right: 10px;
1236
+ }
1237
+ .div-photo{
1238
+ width: auto;
1239
+ height: auto;
1240
+ /* margin-top: 10px; */
1241
+ position: absolute;
1242
+ bottom: 10px;
1243
+ right: 10px;
1244
+ }
1245
+ .panel-self{
1246
+ border-radius: 5px;
1247
+ border:1px solid #c5e1f7;
1248
+ //background-color: #F2F6FA;
1249
+ }
1250
+ .btn-photo{
1251
+ border: 0;
1252
+ border-radius: 7px;
1253
+ background-color: #7dc1f4;
1254
+ font: 15px PingFang-SC-Bold;
1255
+ height: 20%;
1256
+ }
1257
+ </style>
1258
+