safecheck-client 3.0.32-34 → 3.0.32-36

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