safecheck-client 3.0.33-43 → 3.0.33-45

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