safecheck-client 3.0.31-2 → 3.0.32-1

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,966 +1,999 @@
1
- <template>
2
- <div class="select-overspread repair-bg auto" style="padding-bottom:5px;">
3
- <!--<div class="bq-parent" v-if="shutype == 'heng'">-->
4
- <!--<blockquote class="blockquote">-->
5
- <!--<p><span>{{repairitem.header}}</span><a @click="mute()" style="float:right" href="#" class="repair-mute-class"><img src="../../assets/novoice.png" width="25px;" alt=""><span style="margin-left:10px;color: #304A66">关闭声音</span></a></p>-->
6
- <!--</blockquote>-->
7
- <!--</div>-->
8
- <div class="panel panel-default auto repair-info-content">
9
- <div class="panel-body" style="padding: 0">
10
- <!-- 安检项内容 -->
11
- <div class="auto repair-info-content compatible" style="padding: 0">
12
- <div class="row auto" style="padding: 0">
13
- <div v-show="false" class="{{shuclass}}" v-if=" device.device != '燃气表'">
14
- <button type="button" name="button" class="btn btn-primary" @click='adddetails()' :disabled="issee">增加</button>
15
- </div>
16
- <!--<div class="{{shuclass}}" v-if="device.device != '燃气表' && candelete">-->
17
- <!--<button type="button" name="button" class="btn btn-primary" @click='deletedetails()' :disabled="issee">删除</button>-->
18
- <!--</div>-->
19
- <div class="shuclass1" v-show="row.isshow" v-for="row in f_items" style="padding: 4px; border:1px solid #D4D4D4;border-bottom: 0" >
20
- <label v-if="row.type != 'radio' && row.type != 'text' && row.type != 'picture' && row.type != 'checkbox'" v-show="row.isshow" class="fivelabel">{{row.f_item_name}}<br/>{{row.remark}}</label>
21
- <label v-if="row.type == 'radio'" v-show="row.isshow" class="radiolabel">{{row.f_item_name}}<br/>{{row.remark}}</label>
22
- <label v-if="row.type == 'text' || 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="float: left;width:60%" class="form-group col-sm-12" v-if="row.type == 'date'" v-show="row.isshow">
32
- <datepicker id="f_making_date" :placeholder= row.f_item_name
33
- :value.sync="row.f_item_value"
34
- v-if="row.type == 'date'"
35
- v-show="row.isshow"
36
- :disabled-days-of-Week="[]"
37
- :format="'yyyy-MM-dd 00:00:00'"
38
- :show-reset-button="reset" readonly="readonly">
39
- </datepicker>
40
- </div>
41
- <div style="clear: both" v-if="row.type == 'picture'" class="form-group col-sm-12" >
42
- <div class="auto" >
43
- <div class="panel">
44
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
45
- <div class="row" style="height: 160px;width:160px;overflow: scroll;top: 1px">
46
- <div class="col-sm-4" v-show="row.f_path">
47
- <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
48
- </div>
49
- <div class="col-sm-4" v-show="!row.f_path" @click="takePic($index, row.f_item_name)">
50
- <img src="../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
51
- </div>
52
- <img v-show="row.f_path" src="../../assets/remove.png" :class="style__" @click="delfile($index, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
53
- </div>
54
- </div>
55
- </div>
56
- </div>
57
- </div>
58
- <div style="float: left;width:60%" class="form-group" v-if="row.type == 'string'" v-show="row.isshow">
59
- <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" :readonly="role == 'androidview' || row.readonly">
60
- </div>
61
- <div style="float: left;width:60%" class="form-group" v-if="!show && row.type == 'number'" v-show="row.isshow">
62
- <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" onkeyup="value=value.replace(/[^\d\.]/g,'')" :readonly="row.readonly">
63
- </div>
64
- <!--<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">-->
65
- <!--<input type="text" class="form-control" v-model="meternum" v-if="!show && row.type == 'string' && row.f_project == '表号' " :disabled="(!(ischecked == '有')) || issee" :readonly="issee" >-->
66
- <!--<button type="button" name="button" class="btn btn-primary" @click="scan" v-if="!show && row.f_project == '表号' ">扫码</button>-->
67
- <input-select v-if="row.type == 'inputSelector'"
68
- v-show="row.isshow"
69
- :value.sync="row.selected"
70
- v-model="row.selected"
71
- :readonly="false"
72
- :options="row.options"
73
- @change="changse"
74
- @click="transelation($index)"></input-select>
75
- <v-select style="float: left" :value.sync="row.selected"
76
- v-model="row.selected"
77
- v-if="row.type == 'selector'"
78
- v-show="row.isshow"
79
- placeholder='请选择'
80
- :options="row.options"
81
- :disabled="role == 'androidview' || row.readonly"
82
- @change="changse"
83
- @click="transelation($index)"
84
- :multiple="row.multiple"
85
- :close-on-select="!row.multiple" clear-button></v-select>
86
- <div style="float: left;width: 30%" class="form-group" v-if="!show && row.type == 'radio'">
87
- <div class="col-xs-6 col-sm-6 col-md-6" v-for="item in row.options">
88
- <input type="radio" :name="row.f_item_name" @click="disSelect($parent.$index,item.value)" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value" >
89
- <span>{{item.label}}</span>
90
- </div>
91
- </div>
92
- <div v-if="!show && row.type == 'checkbox'" class="col-xs-12 col-sm-12 col-md-12" style="white-space: nowrap" >
93
- <div style="float: left" v-for="item in row.options">
94
- <input type="checkbox" :name="row.f_item_name" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value">
95
- <span>{{item.label}}</span>
96
- </div>
97
- </div>
98
- <div style="clear: both">
99
- <label v-if="row.f_item_value.indexOf('其他') >-1" class="fivelabel">其他</label>
100
- <div style="float: left;width:60%" class="form-group" v-if="row.f_item_value.indexOf('其他') >-1">
101
- <input type="text" class="form-control" maxlength="100" v-model="row.f_else" :readonly="role == 'androidview' || row.readonly">
102
- </div>
103
- </div>
104
- <div style="clear: both">
105
- <div class="form-group" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '') && (livedispose == 'true' || livedispose == true) " >
106
- <label class="fivelabel">现场已处理</label>
107
- <v-select :value="row.f_live_dispose"
108
- :value-single="true"
109
- :options="lives"
110
- :disabled="role == 'androidview'"
111
- @change="changlive"
112
- @click="transelation($index)"
113
- close-on-select clear-button></v-select>
114
- </div>
115
- <div class="form-group col-sm-12" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '')" style="margin-top: 40px">
116
- <div class="auto" >
117
- <div class="panel">
118
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
119
- <div class="row" style="height: 160px;width:160px;overflow: scroll;top: 1px">
120
- <div class="col-sm-4" v-show="row.f_path">
121
- <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
122
- </div>
123
- <div class="col-sm-4" v-show="!row.f_path" @click="takePic($index, row.f_item_name)">
124
- <img src="../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
125
- </div>
126
- <img v-show="row.f_path" src="../../assets/remove.png" :class="style__" @click="delfile($index, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
127
- </div>
128
- </div>
129
- </div>
130
- </div>
131
- </div>
132
- <div class="auto" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && row.tooltip != undefined && row.tooltip != '' ">
133
- <div class="panel">
134
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: auto">
135
- {{row.tooltip}}
136
- </div>
137
- </div>
138
- </div>
139
- </div>
140
- <!--<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 != '气表品牌'"-->
141
- <!--&gt;</v-select>-->
142
- <!--<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 == '气表品牌'"-->
143
- <!--&gt;</v-select>-->
144
- <!-- <div class="auto" v-if="!show && row.type == 'checkbox' ">-->
145
- <!-- <input class="magic-checkbox" type="checkbox" id="shebeicheckbox"-->
146
- <!-- :checked="row.f_content == '有'"-->
147
- <!-- @click="switchDetails(row.f_project, $event)" :disabled="issee"/>-->
148
- <!-- <label for="shebeicheckbox" style="width:150px;padding-bottom: 10px">{{row.f_project}}</label>-->
149
- <!-- </div>-->
150
- <!--<img-area :model="Detail.imgs" :sutitle="row.f_project" v-if="row.type == 'picture'" :disabled="issee"></img-area>-->
151
- </div>
152
- <!--<div style="width: 100%;padding: 2px" v-if="device.device == '燃气表' && item.f_plan_meters[0].f_meter_type=='机表' && paper.f_is_meterreadding=='未抄表'">
153
- <button type="button" name="button" style="margin-left: 35%" class="btn btn-primary" @click="readmeter">
154
- 机表抄表
155
- </button>
156
- </div>-->
157
- </div>
158
- </div>
159
- <div style="border-top: 1px solid #D4D4D4"></div>
160
- </div>
161
- </div>
162
- </div>
163
- </template>
164
- <script>
165
- import Vue from 'vue'
166
- import * as Util from '../Util'
167
-
168
- export default {
169
- title: '维修列表信息',
170
- data() {
171
- return {
172
- // telphoneValid: '/^((0\\d{2,3}-\\d{7,8})|(1[3584]\\d{9}))$/',
173
- // meterstyle:[],
174
- shuclass:'col-xs-12 col-sm-12 col-md-12 form-input-group mg8',
175
- shuclass1:'col-xs-12 col-sm-12 col-md-12 mg8',
176
- // labels:[],
177
- meternum:'',
178
- ischecked:'有',
179
- gasmodel:'',
180
- textstyle:'color: red',
181
- paper: this.$parent.$parent.data,
182
- f_items:[],
183
- page:{},
184
- selectindex:null,
185
- lives:[{label: '是', value: '是'},{label: '否', value: '否'}],
186
- f_live_dispose:'否',
187
- // 初始表底
188
- f_initial_base: {},
189
- // 气量异常差值 计算公式 => 气量异常差值 = 累计购气量 - (已用气量 - 初始表底) - 剩余气量
190
- f_gas_aberrant_number: {},
191
- // 金额异常差值 计算公式 => 金额异常差值 = 累计购金额 - 已用金额 - 剩余金额
192
- f_fee_aberrant_number: {},
193
- // 累购气量
194
- f_total_gas: {},
195
- // 累购金额
196
- f_total_fee: {},
197
- // 已用气量
198
- f_table_base: {},
199
- // 已用金额
200
- f_fee_base: {},
201
- // 剩余气量
202
- f_gas_balance: {},
203
- // 剩余金额
204
- f_fee_balance: {},
205
- //本期表读数
206
- f_issue_reading:{},
207
- //上期表读数
208
- f_prior_reading:{},
209
- // 气量异常差值允许误差
210
- gasDeviation: (
211
- function (_this) {
212
- let deviation = _this.$appdata.getSingleValue('气量异常差值允许误差')
213
- if (deviation && !isNaN(deviation)) {
214
- return deviation
215
- } else {
216
- return 0
217
- }
218
- }
219
- )(this),
220
- // 金额异常差值允许误差
221
- feeDeviation: (
222
- function (_this) {
223
- let deviation = _this.$appdata.getSingleValue('金额异常差值允许误差')
224
- if (deviation && !isNaN(deviation)) {
225
- return deviation
226
- } else {
227
- return 0
228
- }
229
- }
230
- )(this),
231
- showElse:false, //控制其他选项是否显示
232
- }
233
- },
234
- props: ['config','device','idx','operation','item','role'],
235
- // props: {
236
- // // 维修对应的用户数据收集
237
- // model: {
238
- // type: Object
239
- // },
240
- // service:{
241
- // type: Object
242
- // },
243
- // show: {
244
- // type: Boolean,
245
- // default: false
246
- // },
247
- // repairitem:{
248
- // type: Object
249
- // },
250
- // shutype:'heng',
251
- // tabs:{
252
- // type: Object
253
- // },
254
- // repairdetails:{
255
- // type: Object
256
- // },
257
- // faultshow:{
258
- // type: Object
259
- // },
260
- // issee:''
261
- // },
262
- methods: {
263
- changse(val){
264
- if(val == undefined){
265
- return
266
- }
267
- if(this.selectindex != null) {
268
- if(this.f_items[this.selectindex].type == 'selector'){
269
- this.f_items[this.selectindex].f_item_value = val
270
- }else if(this.f_items[this.selectindex].type == 'inputSelector'){
271
- this.f_items[this.selectindex].f_item_value = val.target.value
272
- }
273
- }
274
- },
275
- changlive(val){
276
- if(val == undefined){
277
- return
278
- }
279
- if(this.selectindex != null) {
280
- this.f_items[this.selectindex].f_live_dispose = val
281
- }
282
- },
283
- switchDetails(detailsType, event){
284
- if (event.srcElement.checked) {
285
- for(var i = 0;i<this.Detail.details.length;i++){
286
- if(this.Detail.details[i].f_project == detailsType){
287
- this.Detail.details[i].f_content = '有'
288
- this.ischecked = '有'
289
- return
290
- }
291
- }
292
- } else {
293
- this.Detail.imgs = []
294
- for(var i = 0;i<this.Detail.details.length;i++){
295
- if(this.Detail.details[i].f_project == detailsType){
296
- this.Detail.details[i].f_content = '无'
297
- this.ischecked = '无'
298
- }else{
299
- this.Detail.details[i].f_content = ''
300
- }
301
- }
302
- }
303
- },
304
- getgasmodel(val){
305
- this.gasmodel = val
306
- },
307
- getradios(val,flag){
308
- let Reoptions = []
309
- for (let i = 0;i<this.repairdetails.length;i++) {
310
- var t = false
311
- if(this.repairdetails[i].f_type == this.repairitem.header ){
312
- for(var j =0;j<this.repairdetails[i].details.length;j++){
313
- if(this.repairdetails[i].details[j].f_project == val ){
314
- Reoptions = this.repairdetails[i].details[j].options
315
- t = true
316
- break
317
- }
318
- }
319
- }
320
- if(t){
321
- break
322
- }
323
- }
324
- for(let j = 0;j<Reoptions.length;j++){
325
- if(Reoptions[j].data == flag){
326
- for(var e = 0;e<this.Detail.details.length;e++){
327
- if(this.Detail.details[e].f_project == val){
328
- this.Detail.details[e].f_status = Reoptions[j].f_status
329
- return
330
- }
331
- }
332
- break
333
- }
334
- }
335
- },
336
- deletedetails(){
337
- this.$showMessage('该操作会删除所填信息,是否继续!', ['confirm', 'cancel']).then((res) => {
338
- if (res === 'confirm') {
339
- for(var i = 0;i<this.tabs.length;i++){
340
- if(this.tabs[i].number == this.repairitem.number){
341
- this.tabs.splice(i, 1)
342
- this.model.servicerepair.splice(this.repairitem.number, 1)
343
- for(let t = i;t < this.tabs.length;t++ ) {
344
- this.tabs[t].number -= 1
345
- }
346
- return
347
- }
348
- }
349
- }
350
- })
351
- },
352
- takePic(prop, title) {
353
- if (this.role == 'androidview') {
354
- return
355
- }
356
- HostApp.__callback__ = this.cameraCallBack
357
- HostApp.__this__ = this
358
- //tag
359
- let fileName
360
- if(!this.f_items[prop].f_path || this.f_items[prop].f_path.includes("nopic.png")) {
361
- fileName = Util.guid() + '-' + 'device'+this.device.n + '-' + this.idx + '-'+'f_items'+prop+ '.jpg'
362
- } else {
363
- fileName = Util.getFileName(this.f_items[prop].f_path)
364
- }
365
- HostApp._open_a_page({type: 'boomerang',
366
- page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
367
- param: {file: fileName, requestCode: 111, callback:'javascript:HostApp.__callback__("'+ prop +'", "%s");', watermark: title + '\t时间:'+ Util.toStandardTimeString() + '\t' + Vue.user.name}
368
- })
369
- },
370
- cameraCallBack(prop, fileName) {
371
- HostApp.__this__.$set( 'f_items['+prop+'].f_path', fileName + '?' + Math.random())
372
- //tag
373
- HostApp.__callback__ = null
374
- HostApp.__this__ = null
375
- },
376
- delfile(prop, fileName) {
377
- //tag
378
- //tag)
379
- if(fileName == Vue.nopic)
380
- return
381
- else {
382
- HostApp.delfile(fileName)
383
- this.f_items[prop].f_path = Vue.nopic
384
- }
385
- },
386
- adddetails(){
387
- // 下标作为序号,取值用。 增加 序号得依次增加
388
- if(this.tabs.length > 0){
389
- for(let i = this.tabs.length-1;i > 0 ;i-- ){
390
- if(this.tabs[i].header == this.repairitem.header){
391
- if(this.model.servicerepair.length > 0){
392
- for(let j = this.model.servicerepair.length -1;j > -1;j-- ){
393
- if(this.model.servicerepair[j].f_type == this.repairitem.header){
394
- this.model.servicerepair.splice(j+1, 0, Object.assign({}, JSON.parse(JSON.stringify(this.tabs[i].details))))
395
- 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})
396
- for(let t = i+2;t < this.tabs.length;t++ ) {
397
- this.tabs[t].number += 1
398
- }
399
- this.faultshow.number += this.faultshow.number + 1
400
- return
401
- }
402
- }
403
- }
404
- }
405
- }
406
- }
407
- },
408
- transelation(val){
409
- this.selectindex = val
410
- },
411
- towatch(){
412
- for(let n in this.f_items){
413
- if(this.f_items[n].type == 'selector' || this.f_items[n].type == 'inputSelector'){
414
- // 监听下拉框,如果有隐患,需要拍照
415
- this.$watch('f_items['+n+'].selected',function(val) {
416
- // 下拉框值
417
- //tag)
418
- // 下拉框所属设备
419
- //tag
420
- // 下拉框所属项
421
- //tag
422
- let shImage = false
423
- if(val.indexOf('其他') == -1){
424
- this.f_items[n].f_else = ''
425
- }
426
- // if(this.config[this.device.device].items[item].type == 'selector'){
427
- // this.f_items[n].f_item_value = val
428
- // }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
429
- // this.f_items[n].f_item_value = val[0]
430
- // }
431
- // 在配置中查找该项
432
- for (let item in this.config[this.device.device].items) {
433
- let type = this.config[this.device.device].items[item].type
434
- let multiple = this.config[this.device.device].items[item].multiple
435
- let options = this.config[this.device.device].items[item].options
436
- 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) {
437
- for (let i in options) {
438
- let value
439
- if(this.config[this.device.device].items[item].type == 'selector' && this.config[this.device.device].items[item].multiple == false){
440
- value = val[0]
441
- }else if (this.config[this.device.device].items[item].type == 'inputSelector'){
442
- value = val
443
- }
444
- //tag)
445
- // 如果未选择,清空图片、隐患信息等
446
- if((type == 'selector' && val.length == 0) || (type == 'inputSelector' && val == '')){
447
- this.f_items[n].f_path = ''
448
- this.f_items[n].f_is_defect = ''
449
- this.f_items[n].f_defect_level = ''
450
- this.f_items[n].f_live_dispose = ''
451
- this.f_items[n].tooltip = ''
452
- }
453
- 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)){
454
- // 找到选中的项了
455
- //tag
456
- if(options[i].isdefect == true ){
457
- shImage = true
458
- }
459
- if(options[i].isdefect == false || this.f_items[n].f_item_value == ''){
460
- shImage = false
461
- }
462
- //tag
463
- if(shImage){
464
- this.f_items[n].f_is_defect =true
465
- this.f_items[n].f_defect_level = options[i].level
466
- this.f_items[n].f_path = Vue.nopic
467
- this.f_items[n].f_live_dispose = '否'
468
- this.f_items[n].tooltip= options[i].tooltip
469
- }else{
470
- this.f_items[n].f_path = ''
471
- this.f_items[n].f_is_defect = ''
472
- this.f_items[n].f_defect_level = ''
473
- this.f_items[n].f_live_dispose = ''
474
- this.f_items[n].tooltip = ''
475
- }
476
- }
477
- }
478
- }
479
- }
480
- }
481
- )
482
- // this.$watch('other',function(val){
483
- // //tag
484
- // if(this.selectindex != null) {
485
- // let index = this.f_items[this.selectindex].f_item_value.indexOf('其他')
486
- // if(index > -1){
487
- // this.f_items[this.selectindex].f_item_value.splice(index,1,this.other)
488
- // }
489
- // }
490
- //
491
- // })
492
- }else if(this.f_items[n].type == 'radio') {
493
- // 监听单选框,如果有隐患,需要拍照
494
- this.$watch('f_items[' + n + '].f_item_value', function (val) {
495
- //tag)
496
- let options = this.f_items[n].options
497
- //tag)
498
- for (let i = 0; i < options.length; i++) {
499
- //tag)
500
- // 找到选中的项了
501
- if (options[i].value == val) {
502
- // 如果有隐患,拍图片
503
- if (options[i].isdefect) {
504
- this.f_items[n].f_is_defect = true
505
- this.f_items[n].f_defect_level = options[i].level
506
- this.f_items[n].f_path = Vue.nopic
507
- this.f_items[n].f_live_dispose = '否'
508
- this.f_items[n].tooltip = options[i].tooltip
509
- //tag)
510
- return
511
- }
512
- }
513
- }
514
- this.f_items[n].f_path = ''
515
- this.f_items[n].f_is_defect = ''
516
- this.f_items[n].f_defect_level = ''
517
- this.f_items[n].f_live_dispose = ''
518
- this.f_items[n].tooltip = ''
519
- })
520
- }else if(this.f_items[n].type == 'checkbox') {
521
- // 监听单选框,如果有隐患,需要拍照
522
- this.$watch('f_items[' + n + '].f_item_value', function (val) {
523
- //tag)
524
- // 如果是手动赋值,不执行下面逻辑
525
- if (this.f_items[n].isReSet) {
526
- this.f_items[n].isReSet = false
527
- return
528
- }
529
- let options = this.f_items[n].options
530
- //tag)
531
- // 取出选中项中有隐患的详细信息
532
- let selected = options.filter(item => { return val.indexOf(item.value) != -1 && item.isdefect })
533
-
534
- if(selected.length > 0){
535
- // 防止赋值无限调用
536
- this.f_items[n].isReSet = true
537
- let selectList = selected.map(item => {return item.value})
538
- // 如果选中的是非隐患项,取消选中isdefect为true的
539
- if (selectList.indexOf(val[val.length - 1]) == -1) {
540
- this.f_items[n].f_item_value = val.filter(item => {return selectList.indexOf(item) == -1})
541
- this.f_items[n].f_path = ''
542
- this.f_items[n].f_is_defect = ''
543
- this.f_items[n].f_defect_level = ''
544
- this.f_items[n].f_live_dispose = ''
545
- this.f_items[n].tooltip = ''
546
- return
547
- }
548
- // 如果选中的是隐患项,取消选中isdefect为false的
549
- this.f_items[n].f_item_value = selectList
550
- // 如果第一次选择隐患项,初始化
551
- if (!this.f_items[n].f_is_defect) {
552
- this.f_items[n].f_is_defect = true
553
- this.f_items[n].f_defect_level = selected[0].level
554
- this.f_items[n].f_path = Vue.nopic
555
- this.f_items[n].f_live_dispose = '否'
556
- this.f_items[n].tooltip = selected[0].tooltip
557
- }
558
- //tag)
559
- return
560
- }
561
- this.f_items[n].f_path = ''
562
- this.f_items[n].f_is_defect = ''
563
- this.f_items[n].f_defect_level = ''
564
- this.f_items[n].f_live_dispose = ''
565
- this.f_items[n].tooltip = ''
566
- })
567
- }
568
- }
569
- //tag)
570
- },
571
- //计算已用气量/金额
572
- getTableBaseNumber() {
573
- //tag
574
- if(!this.f_items[this.f_issue_reading.index].f_item_value || parseFloat(this.f_items[this.f_prior_reading.index].f_item_value).toString() == "NaN"){
575
- return
576
- }
577
- //tag
578
- //判断是金额表还是气量表
579
- if(this.item.f_plan_meters[0].f_meter_type=='机表' || this.item.f_plan_meters[0].f_collection_type=='按气量'){
580
- //tag
581
- //tag
582
- //tag
583
- //tag
584
- // 先清空
585
- this.f_items[this.f_table_base.index].f_item_value = null
586
- //已用气量=本期表读数-上期表读数
587
- this.f_items[this.f_table_base.index].f_item_value= this.f_items[this.f_issue_reading.index].f_item_value-this.f_items[this.f_prior_reading.index].f_item_value
588
- if (isNaN(this.f_items[this.f_table_base.index].f_item_value)) {
589
- this.f_items[this.f_table_base.index].f_item_value = null
590
- }
591
- }else{
592
- //tag
593
- // 先清空
594
- this.f_items[this.f_fee_base.index].f_item_value = null
595
- //已用金额=本期表读数-上期表读数
596
- this.f_items[this.f_fee_base.index].f_item_value= this.f_items[this.f_issue_reading.index].f_item_value-this.f_items[this.f_prior_reading.index].f_item_value
597
- if (isNaN(this.f_items[this.f_fee_base.index].f_item_value)) {
598
- this.f_items[this.f_fee_base.index].f_item_value = null
599
- }
600
- }
601
-
602
- },
603
- //计算剩余气量和金额
604
- getGasBalanceNumber() {
605
- //tag
606
- if(this.item.f_plan_meters[0].f_meter_type=='机表' || this.item.f_plan_meters[0].f_collection_type=='按气量'){//按气量
607
-
608
- if(!this.f_items[this.f_issue_reading.index].f_item_value || parseFloat(this.f_items[this.f_total_gas.index].f_item_value).toString() == "NaN"){
609
- return
610
- }
611
- //剩余气量 = 累购-本期表读数
612
- 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_issue_reading.index].f_item_value
613
- if (isNaN(this.f_items[this.f_gas_balance.index].f_item_value)) {
614
- this.f_items[this.f_gas_balance.index].f_item_value = null
615
- }
616
- }else{//按金额parseFloat(this.f_items[this.f_total_gas.index].f_item_value).toString() == "NaN"
617
- if (!this.f_items[this.f_issue_reading.index].f_item_value || parseFloat(this.f_items[this.f_total_fee.index].f_item_value).toString() == "NaN") {
618
- return
619
- }
620
- //剩余金额 = 累购-本期表读数
621
- 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_issue_reading.index].f_item_value
622
- if (isNaN(this.f_items[this.f_fee_balance.index].f_item_value)) {
623
- this.f_items[this.f_fee_balance.index].f_item_value = null
624
- }
625
- }
626
-
627
- },
628
- readmeter(){
629
- if(!this.f_items[this.f_issue_reading.index].f_item_value && parseFloat(this.f_items[this.f_issue_reading.index].f_item_value).toString() == "NaN"){
630
- this.$showMessage("请输入本期表读数!")
631
- return
632
- }
633
- if(this.paper.f_is_meterreadding=='已抄表'){
634
- this.$showMessage("本次安检已抄表,无法再次抄表!")
635
- return
636
- }
637
- let param={
638
- f_userinfoid:this.item.f_userinfoid,
639
- f_checker:this.paper.f_checker_name,
640
- f_checkerid:this.paper.f_checker_id,
641
- f_tablebase:this.f_items[this.f_issue_reading.index].f_item_value
642
- }
643
- //tag)
644
- HostApp.__this__ = this
645
- HostApp.logicWithHint({
646
- // logic别名,key必须为logic
647
- 'logic': 'rc_ReadMeterToJiBiao',
648
- // 回调执行方法名,key必须为callback
649
- 'callback': 'javascript:HostApp.__this__.readmeterCallBack()',
650
- // logic执行需要的业务参数
651
- 'data': {param:param},
652
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
653
- // 执行回调方法传入key为backresult
654
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
655
- 'backresult': 1
656
- })
657
- },
658
- readmeterCallBack(jo){
659
- //tag)
660
- if(jo.state == 'ok'){
661
- let res = JSON.parse(jo.result)
662
- //tag)
663
- //tag)
664
- if(res.code==200){
665
- if(res.data=='已欠费'){
666
- this.$showMessage(`抄表成功,该用户已欠费,欠费金额: ¥${res.oughtfee}`)
667
- }
668
- if(res.data=='未欠费'){
669
- this.$showMessage(`抄表成功!该用户账户剩余金额: ¥${res.balance}`)
670
- }
671
- this.paper.f_is_meterreadding='已抄表'
672
- }else{
673
- this.$showMessage("抄表失败!")
674
- }
675
- }else{
676
- this.$showMessage("服务器内部错误,抄表失败!")
677
- }
678
- },
679
- disSelect(index, itemValue) {
680
- //tag)
681
- //tag)
682
- if (this.f_items[index].f_item_value == itemValue) {
683
- this.$set(`f_items[${index}].f_item_value`, '')
684
- }
685
- }
686
- },
687
- ready() {
688
- //tag
689
- //tag
690
- if(Vue.config.safecheck != undefined){
691
- if(Vue.config.safecheck.ApproveConfig != undefined){
692
- if(Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
693
- this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
694
- }
695
- }
696
- }
697
- //tag
698
- //tag)
699
- //tag)
700
- //tag)
701
- //创建页面所需数据
702
- this.$set('piece', this.paper['device'+this.device.n][this.idx])
703
- //tag)
704
- //tag)
705
- let n = 0
706
- for (let item in this.config[this.device.device].items) {
707
- let index = this.config[this.device.device].items[item].index-1
708
- this.$set('page.options' + index, [])
709
- //tag)
710
- //tag)
711
- //tag)
712
- // 先根据配置组接页面
713
- let f_item_value
714
- if(this.config[this.device.device].items[item].type == 'selector' || this.config[this.device.device].items[item].type == 'checkbox'){
715
- f_item_value = []
716
- // 判断选项的默认值
717
- for (let defitem in this.config[this.device.device].items[item].options) {
718
- let defopt = this.config[this.device.device].items[item].options[defitem]
719
- if (defopt.isdefault) {
720
- //tag
721
- f_item_value[0] = defopt.data
722
- }
723
- }
724
- // if(this.config[this.device.device].items[item].data){
725
- // f_item_value.push(this.config[this.device.device].items[item].data)
726
- // }
727
- }else{
728
- f_item_value = this.config[this.device.device].items[item].data ? this.config[this.device.device].items[item].data : ''
729
- }
730
- //tag)
731
- let it = {
732
- type: this.config[this.device.device].items[item].type,
733
- f_item_name: item,
734
- checkmust: this.config[this.device.device].items[item].checkmust,
735
- f_item_value: f_item_value,
736
- f_is_defect: '',
737
- multiple:this.config[this.device.device].items[item].multiple == true?this.config[this.device.device].items[item].multiple:false,
738
- isshow:this.config[this.device.device].items[item].isshow == false?this.config[this.device.device].items[item].isshow:true,
739
- readonly: this.config[this.device.device].items[item].readonly == true?true:false,
740
- remark: this.config[this.device.device].items[item].remark ? this.config[this.device.device].items[item].remark : '',
741
- f_path: '',
742
- tooltip:'',
743
- f_live_dispose:'',
744
- f_else:''
745
- }
746
- //tag)
747
- //tag)
748
- this.$set('f_items['+index+']',it)
749
- if (this.config[this.device.device].items[item].type == 'selector' ||this.config[this.device.device].items[item].type == 'inputSelector') {
750
- if(this.config[this.device.device].items[item].type == 'selector'){
751
- this.page['options' + index].push({
752
- label: "请选择",
753
- value: ''
754
- })
755
- }
756
- for (let i in this.config[this.device.device].items[item].options) {
757
- this.page['options' + index].push({
758
- label: this.config[this.device.device].items[item].options[i].data,
759
- value: this.config[this.device.device].items[item].options[i].data
760
- })
761
- }
762
- if(this.config[this.device.device].items[item].type == 'selector'){
763
- this.$set('f_items['+index+'].selected', f_item_value)
764
- }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
765
- this.$set('f_items['+index+'].selected', f_item_value)
766
- }
767
-
768
- this.$set('f_items['+index+'].options',this.page['options' + index])
769
-
770
- //tag)
771
- } else if (this.config[this.device.device].items[item].type == 'radio' || this.config[this.device.device].items[item].type == 'checkbox') {
772
- for (let i in this.config[this.device.device].items[item].options) {
773
- this.page['options' + index].push({
774
- label: this.config[this.device.device].items[item].options[i].data,
775
- value: this.config[this.device.device].items[item].options[i].data,
776
- isdefect: this.config[this.device.device].items[item].options[i].isdefect,
777
- level: this.config[this.device.device].items[item].options[i].level
778
- })
779
- }
780
- this.$set('f_items[' + index + '].options', this.page['options' + index])
781
- this.$set('f_items[' + index + '].f_item_value', f_item_value)
782
- //tag)
783
- }
784
- n = n + 1
785
- }
786
- //tag)
787
- //tag)
788
- //tag)
789
- if(JSON.stringify(this.piece) == '{}') {
790
- // 如果没有,则新建
791
- this.$set('piece.f_items',this.f_items)
792
- this.$set('piece.f_device_type',this.device.device)
793
- } else {
794
- // 已经存在,把之前的数据重新填入
795
- for (let f in this.f_items){
796
- for(let p in this.piece.f_items) {
797
- if (this.f_items[f].f_item_name == this.piece.f_items[p].f_item_name) {
798
- //tag)
799
- //tag)
800
- //tag)
801
- //tag)
802
- this.f_items[f] = Object.assign(this.f_items[f], this.piece.f_items[p])
803
- //tag)
804
- if (this.f_items[f].type == 'selector' || this.f_items[f].type == 'inputSelector') {
805
- //tag)
806
- //tag)
807
- this.f_items[f].selected = this.piece.f_items[p].f_item_value
808
- //tag)
809
- }
810
- // 取出特殊值
811
- if (this.f_items[f].f_item_name == '初始表底') {
812
- //tag)
813
- this.f_initial_base.index = f
814
- } else if (this.f_items[f].f_item_name == '上期表读数') {
815
- //tag)
816
- this.f_prior_reading.index = f
817
- } else if (this.f_items[f].f_item_name == '本期表读数') {
818
- //tag)
819
- this.f_issue_reading.index = f
820
- /*this.$watch('f_items[' + f + '].f_item_value', function () {
821
- this.getTableBaseNumber()
822
- this.getGasBalanceNumber()
823
- })*/
824
- } else if (this.f_items[f].f_item_name == '累购气量') {
825
- //tag)
826
- this.f_total_gas.index = f
827
- } else if (this.f_items[f].f_item_name == '已用气量') {
828
- //tag)
829
- this.f_table_base.index = f
830
- /*this.$watch('f_items[' + f + '].f_item_value', function () {
831
- this.getGasAberrantNumber('已用气量')
832
- })*/
833
- } else if (this.f_items[f].f_item_name == '剩余气量') {
834
- //tag)
835
- this.f_gas_balance.index = f
836
- /*this.$watch('f_items[' + f + '].f_item_value', function () {
837
- this.getGasAberrantNumber('')
838
- })*/
839
- } else if (this.f_items[f].f_item_name == '气量异常差值') {
840
- //tag)
841
- this.f_gas_aberrant_number.index = f
842
- } else if (this.f_items[f].f_item_name == '累购金额') {
843
- //tag)
844
- this.f_total_fee.index = f
845
- } else if (this.f_items[f].f_item_name == '已用金额') {
846
- //tag)
847
- this.f_fee_base.index = f
848
- this.$watch('f_items[' + f + '].f_item_value', function () {
849
- this.getFeeAberrantNumber('已用金额')
850
- })
851
- } else if (this.f_items[f].f_item_name == '剩余金额') {
852
- //tag)
853
- this.f_fee_balance.index = f
854
- this.$watch('f_items[' + f + '].f_item_value', function () {
855
- this.getFeeAberrantNumber('')
856
- })
857
- } else if (this.f_items[f].f_item_name == '金额异常差值') {
858
- //tag)
859
- this.f_fee_aberrant_number.index = f
860
- }
861
- }
862
- }
863
- for (let em in this.config[this.device.device].items) {
864
- if (this.config[this.device.device].items[em].type == 'selector' && em == this.f_items[f].f_item_name) {
865
- this.f_items[f].options =[]
866
- for (let k in this.config[this.device.device].items[em].options) {
867
- this.f_items[f].options.push({
868
- label: this.config[this.device.device].items[em].options[k].data,
869
- value: this.config[this.device.device].items[em].options[k].data
870
- })
871
- }
872
- }
873
- }
874
- }
875
- //tag)
876
- this.$set('piece.f_items',this.f_items)
877
- }
878
- this.towatch()
879
- },
880
- destroyed(){
881
- let nullCount = 0
882
- let metertitles
883
- //判断当前是否有选中项
884
- for (let row in this.f_items){
885
- if(this.f_items[row].selected && this.f_items[row].selected != '' && this.f_items[row].selected instanceof Array){
886
- //tag
887
- this.f_items[row].f_item_value = this.f_items[row].selected
888
- }else if(this.f_items[row].selected && this.f_items[row].selected != ''){
889
- //tag
890
- this.f_items[row].f_item_value = this.f_items[row].selected
891
- }
892
- // if(this.f_items[row].f_item_value instanceof Array && this.f_items[row].f_item_value.length != 0 ){
893
- // nullCount = nullCount+1
894
- // }else if(this.f_items[row].f_item_value != ''){
895
- // nullCount = nullCount+1
896
- // }
897
- }
898
- let picture = []
899
- // for (let row in this.f_items){
900
- // let a={}
901
- // a.f_path = this.f_items[row].f_path
902
- // a.name = this.f_items[row].f_item_name
903
- // }
904
- // picture.push(a)
905
- this.$set(`paper['device${this.device.n}'][${this.idx}]`, this.piece)
906
- //tag
907
- },
908
- computed:{
909
-
910
- }
911
- }
912
- </script>
913
- <style lang="less" scoped>
914
- .class-erro {
915
- color: #a94442;
916
- }
917
- .fivelabel{
918
- border: none;
919
- border-left: 5px solid #A2C2EB;
920
- float: left;
921
- width: 35%;
922
- margin-bottom: 3px;
923
- text-align: left;
924
- word-wrap: break-word;
925
- white-space: normal;
926
- }
927
- .radiolabel{
928
- border: none;
929
- border-left: 5px solid #A2C2EB;
930
- float: left;
931
- width: 65%;
932
- margin-bottom: 3px;
933
- text-align: left;
934
- word-wrap: break-word;
935
- white-space: normal;
936
- }
937
-
938
- .textlabel {
939
- border: none;
940
- border-left: 5px solid #A2C2EB;
941
- width: 100%;
942
- margin-bottom: 3px;
943
- text-align: left;
944
- word-wrap: break-word;
945
- white-space: normal;
946
- }
947
- .spanrodio{
948
- margin-right: 10px;
949
- }
950
- .div-photo{
951
- width: auto;
952
- height: auto;
953
- /* margin-top: 10px; */
954
- position: absolute;
955
- bottom: 10px;
956
- right: 10px;
957
- }
958
- .btn-photo{
959
- border: 0;
960
- border-radius: 7px;
961
- background-color: #7dc1f4;
962
- font: 15px PingFang-SC-Bold;
963
- height: 20%;
964
- }
965
- </style>
966
-
1
+ <template>
2
+ <div class="select-overspread repair-bg auto" style="padding-bottom:5px;">
3
+ <!--<div class="bq-parent" v-if="shutype == 'heng'">-->
4
+ <!--<blockquote class="blockquote">-->
5
+ <!--<p><span>{{repairitem.header}}</span><a @click="mute()" style="float:right" href="#" class="repair-mute-class"><img src="../../assets/novoice.png" width="25px;" alt=""><span style="margin-left:10px;color: #304A66">关闭声音</span></a></p>-->
6
+ <!--</blockquote>-->
7
+ <!--</div>-->
8
+ <div class="panel panel-default auto repair-info-content">
9
+ <div class="panel-body" style="padding: 0">
10
+ <!-- 安检项内容 -->
11
+ <div class="auto repair-info-content compatible" style="padding: 0">
12
+ <div class="row auto" style="padding: 0">
13
+ <div v-show="false" class="{{shuclass}}" v-if=" device.device != '燃气表'">
14
+ <button type="button" name="button" class="btn btn-primary" @click='adddetails()' :disabled="issee">增加</button>
15
+ </div>
16
+ <!--<div class="{{shuclass}}" v-if="device.device != '燃气表' && candelete">-->
17
+ <!--<button type="button" name="button" class="btn btn-primary" @click='deletedetails()' :disabled="issee">删除</button>-->
18
+ <!--</div>-->
19
+ <div class="shuclass1" v-show="row.isshow" v-for="row in f_items" style="padding: 4px; border:1px solid #D4D4D4;border-bottom: 0" >
20
+ <label v-if="row.type != 'radio' && row.type != 'text' && row.type != 'picture' && row.type != 'checkbox'" v-show="row.isshow" class="fivelabel">{{row.f_item_name}}<br/>{{row.remark}}</label>
21
+ <label v-if="row.type == 'radio'" v-show="row.isshow" class="radiolabel">{{row.f_item_name}}<br/>{{row.remark}}</label>
22
+ <label v-if="row.type == 'text' || 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="float: left;width:60%" class="form-group col-sm-12" v-if="row.type == 'date'" v-show="row.isshow">
32
+ <datepicker id="f_making_date" :placeholder= row.f_item_name
33
+ :value.sync="row.f_item_value"
34
+ v-if="row.type == 'date'"
35
+ v-show="row.isshow"
36
+ :disabled-days-of-Week="[]"
37
+ :format=row.format
38
+ :show-reset-button="reset" readonly="readonly">
39
+ </datepicker>
40
+ </div>
41
+ <div style="clear: both" v-if="row.type == 'picture'" class="form-group col-sm-12" >
42
+ <div class="auto" >
43
+ <div class="panel">
44
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
45
+ <div class="row" style="height: 160px;width:160px;overflow: scroll;top: 1px">
46
+ <div class="col-sm-4" v-show="row.f_path">
47
+ <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
48
+ </div>
49
+ <div class="col-sm-4" v-show="!row.f_path" @click="takePic($index, row.f_item_name)">
50
+ <img src="../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
51
+ </div>
52
+ <img v-show="row.f_path" src="../../assets/remove.png" :class="style__" @click="delfile($index, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <div style="float: left;width:60%" class="form-group" v-if="row.type == 'string'" v-show="row.isshow">
59
+ <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" :readonly="role == 'androidview' || row.readonly">
60
+ </div>
61
+ <div style="float: left;width:60%" class="form-group" v-if="!show && row.type == 'number'" v-show="row.isshow">
62
+ <input type="text" class="form-control" maxlength="100" v-model="row.f_item_value" onkeyup="value=value.replace(/[^\d\.]/g,'')" :readonly="row.readonly">
63
+ </div>
64
+ <!--<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">-->
65
+ <!--<input type="text" class="form-control" v-model="meternum" v-if="!show && row.type == 'string' && row.f_project == '表号' " :disabled="(!(ischecked == '有')) || issee" :readonly="issee" >-->
66
+ <!--<button type="button" name="button" class="btn btn-primary" @click="scan" v-if="!show && row.f_project == '表号' ">扫码</button>-->
67
+ <input-select v-if="row.type == 'inputSelector'"
68
+ v-show="row.isshow"
69
+ :value.sync="row.selected"
70
+ v-model="row.selected"
71
+ :readonly="false"
72
+ :options="row.options"
73
+ @change="changse"
74
+ @click="transelation($index)"></input-select>
75
+ <v-select style="float: left" :value.sync="row.selected"
76
+ v-model="row.selected"
77
+ v-if="row.type == 'selector'"
78
+ v-show="row.isshow"
79
+ placeholder='请选择'
80
+ :options="row.options"
81
+ :disabled="role == 'androidview' || row.readonly"
82
+ @change="changse"
83
+ @click="transelation($index)"
84
+ :multiple="row.multiple"
85
+ :close-on-select="!row.multiple" clear-button></v-select>
86
+ <div style="float: left;width: 30%" class="form-group" v-if="!show && row.type == 'radio'">
87
+ <div class="col-xs-6 col-sm-6 col-md-6" v-for="item in row.options">
88
+ <input type="radio" :name="row.f_item_name" @click="disSelect($parent.$index,item.value)" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value" >
89
+ <span>{{item.label}}</span>
90
+ </div>
91
+ </div>
92
+ <div v-if="!show && row.type == 'checkbox'" class="col-xs-12 col-sm-12 col-md-12" style="white-space: nowrap" >
93
+ <div style="float: left" v-for="item in row.options">
94
+ <input type="checkbox" :name="row.f_item_name" :value="item.value" :disabled="(!(ischecked == '有')) || issee" v-model="row.f_item_value">
95
+ <span>{{item.label}}</span>
96
+ </div>
97
+ </div>
98
+ <div style="clear: both">
99
+ <label v-if="row.f_item_value.indexOf('其他') >-1" class="fivelabel">其他</label>
100
+ <div style="float: left;width:60%" class="form-group" v-if="row.f_item_value.indexOf('其他') >-1">
101
+ <input type="text" class="form-control" maxlength="100" v-model="row.f_else" :readonly="role == 'androidview' || row.readonly">
102
+ </div>
103
+ </div>
104
+ <div style="clear: both">
105
+ <div class="form-group" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '') && (livedispose == 'true' || livedispose == true) " >
106
+ <label class="fivelabel">现场已处理</label>
107
+ <v-select :value="row.f_live_dispose"
108
+ :value-single="true"
109
+ :options="lives"
110
+ :disabled="role == 'androidview'"
111
+ @change="changlive"
112
+ @click="transelation($index)"
113
+ close-on-select clear-button></v-select>
114
+ </div>
115
+ <div class="form-group col-sm-12" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && (row.f_path != '' || row.f_is_defect != '')" style="margin-top: 40px">
116
+ <div class="auto" >
117
+ <div class="panel">
118
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 160px;height: 160px;position: relative">
119
+ <div class="row" style="height: 160px;width:160px;overflow: scroll;top: 1px">
120
+ <div class="col-sm-4" v-show="row.f_path">
121
+ <img-self :src="row.f_path" :alt="row.f_item_name" width="140" height="140"></img-self>
122
+ </div>
123
+ <div class="col-sm-4" v-show="!row.f_path" @click="takePic($index, row.f_item_name)">
124
+ <img src="../../assets/tackpic.png" :alt="点击拍摄照片" width="140" height="140"></img>
125
+ </div>
126
+ <img v-show="row.f_path" src="../../assets/remove.png" :class="style__" @click="delfile($index, row.f_path)" v-if="role!='androidview'" style="width: 40px;height: 40px;position: absolute;left:110px;top:110px"></img>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ <div class="auto" v-if="(row.type == 'selector' || row.type == 'radio' || row.type =='checkbox') && row.tooltip != undefined && row.tooltip != '' ">
133
+ <div class="panel">
134
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: auto">
135
+ {{row.tooltip}}
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </div>
140
+ <!--<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 != '气表品牌'"-->
141
+ <!--&gt;</v-select>-->
142
+ <!--<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 == '气表品牌'"-->
143
+ <!--&gt;</v-select>-->
144
+ <!-- <div class="auto" v-if="!show && row.type == 'checkbox' ">-->
145
+ <!-- <input class="magic-checkbox" type="checkbox" id="shebeicheckbox"-->
146
+ <!-- :checked="row.f_content == '有'"-->
147
+ <!-- @click="switchDetails(row.f_project, $event)" :disabled="issee"/>-->
148
+ <!-- <label for="shebeicheckbox" style="width:150px;padding-bottom: 10px">{{row.f_project}}</label>-->
149
+ <!-- </div>-->
150
+ <!--<img-area :model="Detail.imgs" :sutitle="row.f_project" v-if="row.type == 'picture'" :disabled="issee"></img-area>-->
151
+ </div>
152
+ <!--<div style="width: 100%;padding: 2px" v-if="device.device == '燃气表' && item.f_plan_meters[0].f_meter_type=='机表' && paper.f_is_meterreadding=='未抄表'">
153
+ <button type="button" name="button" style="margin-left: 35%" class="btn btn-primary" @click="readmeter">
154
+ 机表抄表
155
+ </button>
156
+ </div>-->
157
+ </div>
158
+ </div>
159
+ <div style="border-top: 1px solid #D4D4D4"></div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </template>
164
+ <script>
165
+ import Vue from 'vue'
166
+ import * as Util from '../Util'
167
+
168
+ export default {
169
+ title: '维修列表信息',
170
+ data() {
171
+ return {
172
+ // telphoneValid: '/^((0\\d{2,3}-\\d{7,8})|(1[3584]\\d{9}))$/',
173
+ // meterstyle:[],
174
+ shuclass:'col-xs-12 col-sm-12 col-md-12 form-input-group mg8',
175
+ shuclass1:'col-xs-12 col-sm-12 col-md-12 mg8',
176
+ // labels:[],
177
+ meternum:'',
178
+ ischecked:'有',
179
+ gasmodel:'',
180
+ textstyle:'color: red',
181
+ paper: this.$parent.$parent.data,
182
+ f_items:[],
183
+ page:{},
184
+ selectindex:null,
185
+ lives:[{label: '是', value: '是'},{label: '否', value: '否'}],
186
+ f_live_dispose:'否',
187
+ // 初始表底
188
+ f_initial_base: {},
189
+ // 气量异常差值 计算公式 => 气量异常差值 = 累计购气量 - (已用气量 - 初始表底) - 剩余气量
190
+ f_gas_aberrant_number: {},
191
+ // 金额异常差值 计算公式 => 金额异常差值 = 累计购金额 - 已用金额 - 剩余金额
192
+ f_fee_aberrant_number: {},
193
+ // 累购气量
194
+ f_total_gas: {},
195
+ // 累购金额
196
+ f_total_fee: {},
197
+ // 已用气量
198
+ f_table_base: {},
199
+ // 已用金额
200
+ f_fee_base: {},
201
+ // 剩余气量
202
+ f_gas_balance: {},
203
+ // 剩余金额
204
+ f_fee_balance: {},
205
+ //本期表读数
206
+ f_issue_reading:{},
207
+ //上期表读数
208
+ f_prior_reading:{},
209
+ // 安装日期
210
+ f_install_date:{},
211
+ // 使用年限
212
+ f_use_limit:{},
213
+ // 到期日期
214
+ f_scrap_date:{},
215
+ // 气量异常差值允许误差
216
+ gasDeviation: (
217
+ function (_this) {
218
+ let deviation = _this.$appdata.getSingleValue('气量异常差值允许误差')
219
+ if (deviation && !isNaN(deviation)) {
220
+ return deviation
221
+ } else {
222
+ return 0
223
+ }
224
+ }
225
+ )(this),
226
+ // 金额异常差值允许误差
227
+ feeDeviation: (
228
+ function (_this) {
229
+ let deviation = _this.$appdata.getSingleValue('金额异常差值允许误差')
230
+ if (deviation && !isNaN(deviation)) {
231
+ return deviation
232
+ } else {
233
+ return 0
234
+ }
235
+ }
236
+ )(this),
237
+ showElse:false, //控制其他选项是否显示
238
+ }
239
+ },
240
+ props: ['config','device','idx','operation','item','role'],
241
+ // props: {
242
+ // // 维修对应的用户数据收集
243
+ // model: {
244
+ // type: Object
245
+ // },
246
+ // service:{
247
+ // type: Object
248
+ // },
249
+ // show: {
250
+ // type: Boolean,
251
+ // default: false
252
+ // },
253
+ // repairitem:{
254
+ // type: Object
255
+ // },
256
+ // shutype:'heng',
257
+ // tabs:{
258
+ // type: Object
259
+ // },
260
+ // repairdetails:{
261
+ // type: Object
262
+ // },
263
+ // faultshow:{
264
+ // type: Object
265
+ // },
266
+ // issee:''
267
+ // },
268
+ methods: {
269
+ changse(val){
270
+ if(val == undefined){
271
+ return
272
+ }
273
+ if(this.selectindex != null) {
274
+ if(this.f_items[this.selectindex].type == 'selector'){
275
+ this.f_items[this.selectindex].f_item_value = val
276
+ }else if(this.f_items[this.selectindex].type == 'inputSelector'){
277
+ this.f_items[this.selectindex].f_item_value = val.target.value
278
+ }
279
+ }
280
+ },
281
+ changlive(val){
282
+ if(val == undefined){
283
+ return
284
+ }
285
+ if(this.selectindex != null) {
286
+ this.f_items[this.selectindex].f_live_dispose = val
287
+ }
288
+ },
289
+ switchDetails(detailsType, event){
290
+ if (event.srcElement.checked) {
291
+ for(var i = 0;i<this.Detail.details.length;i++){
292
+ if(this.Detail.details[i].f_project == detailsType){
293
+ this.Detail.details[i].f_content = '有'
294
+ this.ischecked = '有'
295
+ return
296
+ }
297
+ }
298
+ } else {
299
+ this.Detail.imgs = []
300
+ for(var i = 0;i<this.Detail.details.length;i++){
301
+ if(this.Detail.details[i].f_project == detailsType){
302
+ this.Detail.details[i].f_content = '无'
303
+ this.ischecked = '无'
304
+ }else{
305
+ this.Detail.details[i].f_content = ''
306
+ }
307
+ }
308
+ }
309
+ },
310
+ getgasmodel(val){
311
+ this.gasmodel = val
312
+ },
313
+ getradios(val,flag){
314
+ let Reoptions = []
315
+ for (let i = 0;i<this.repairdetails.length;i++) {
316
+ var t = false
317
+ if(this.repairdetails[i].f_type == this.repairitem.header ){
318
+ for(var j =0;j<this.repairdetails[i].details.length;j++){
319
+ if(this.repairdetails[i].details[j].f_project == val ){
320
+ Reoptions = this.repairdetails[i].details[j].options
321
+ t = true
322
+ break
323
+ }
324
+ }
325
+ }
326
+ if(t){
327
+ break
328
+ }
329
+ }
330
+ for(let j = 0;j<Reoptions.length;j++){
331
+ if(Reoptions[j].data == flag){
332
+ for(var e = 0;e<this.Detail.details.length;e++){
333
+ if(this.Detail.details[e].f_project == val){
334
+ this.Detail.details[e].f_status = Reoptions[j].f_status
335
+ return
336
+ }
337
+ }
338
+ break
339
+ }
340
+ }
341
+ },
342
+ deletedetails(){
343
+ this.$showMessage('该操作会删除所填信息,是否继续!', ['confirm', 'cancel']).then((res) => {
344
+ if (res === 'confirm') {
345
+ for(var i = 0;i<this.tabs.length;i++){
346
+ if(this.tabs[i].number == this.repairitem.number){
347
+ this.tabs.splice(i, 1)
348
+ this.model.servicerepair.splice(this.repairitem.number, 1)
349
+ for(let t = i;t < this.tabs.length;t++ ) {
350
+ this.tabs[t].number -= 1
351
+ }
352
+ return
353
+ }
354
+ }
355
+ }
356
+ })
357
+ },
358
+ takePic(prop, title) {
359
+ if (this.role == 'androidview') {
360
+ return
361
+ }
362
+ HostApp.__callback__ = this.cameraCallBack
363
+ HostApp.__this__ = this
364
+ //tag
365
+ let fileName
366
+ if(!this.f_items[prop].f_path || this.f_items[prop].f_path.includes("nopic.png")) {
367
+ fileName = Util.guid() + '-' + 'device'+this.device.n + '-' + this.idx + '-'+'f_items'+prop+ '.jpg'
368
+ } else {
369
+ fileName = Util.getFileName(this.f_items[prop].f_path)
370
+ }
371
+ HostApp._open_a_page({type: 'boomerang',
372
+ page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
373
+ param: {file: fileName, requestCode: 111, callback:'javascript:HostApp.__callback__("'+ prop +'", "%s");', watermark: title + '\t时间:'+ Util.toStandardTimeString() + '\t' + Vue.user.name}
374
+ })
375
+ },
376
+ cameraCallBack(prop, fileName) {
377
+ HostApp.__this__.$set( 'f_items['+prop+'].f_path', fileName + '?' + Math.random())
378
+ //tag
379
+ HostApp.__callback__ = null
380
+ HostApp.__this__ = null
381
+ },
382
+ delfile(prop, fileName) {
383
+ //tag
384
+ //tag)
385
+ if(fileName == Vue.nopic)
386
+ return
387
+ else {
388
+ HostApp.delfile(fileName)
389
+ this.f_items[prop].f_path = Vue.nopic
390
+ }
391
+ },
392
+ adddetails(){
393
+ // 下标作为序号,取值用。 增加 序号得依次增加
394
+ if(this.tabs.length > 0){
395
+ for(let i = this.tabs.length-1;i > 0 ;i-- ){
396
+ if(this.tabs[i].header == this.repairitem.header){
397
+ if(this.model.servicerepair.length > 0){
398
+ for(let j = this.model.servicerepair.length -1;j > -1;j-- ){
399
+ if(this.model.servicerepair[j].f_type == this.repairitem.header){
400
+ this.model.servicerepair.splice(j+1, 0, Object.assign({}, JSON.parse(JSON.stringify(this.tabs[i].details))))
401
+ 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})
402
+ for(let t = i+2;t < this.tabs.length;t++ ) {
403
+ this.tabs[t].number += 1
404
+ }
405
+ this.faultshow.number += this.faultshow.number + 1
406
+ return
407
+ }
408
+ }
409
+ }
410
+ }
411
+ }
412
+ }
413
+ },
414
+ transelation(val){
415
+ this.selectindex = val
416
+ },
417
+ towatch(){
418
+ for(let n in this.f_items){
419
+ if(this.f_items[n].type == 'selector' || this.f_items[n].type == 'inputSelector'){
420
+ // 监听下拉框,如果有隐患,需要拍照
421
+ this.$watch('f_items['+n+'].selected',function(val) {
422
+ // 下拉框值
423
+ //tag)
424
+ // 下拉框所属设备
425
+ //tag
426
+ // 下拉框所属项
427
+ //tag
428
+ let shImage = false
429
+ if(val.indexOf('其他') == -1){
430
+ this.f_items[n].f_else = ''
431
+ }
432
+ // if(this.config[this.device.device].items[item].type == 'selector'){
433
+ // this.f_items[n].f_item_value = val
434
+ // }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
435
+ // this.f_items[n].f_item_value = val[0]
436
+ // }
437
+ // 在配置中查找该项
438
+ for (let item in this.config[this.device.device].items) {
439
+ let type = this.config[this.device.device].items[item].type
440
+ let multiple = this.config[this.device.device].items[item].multiple
441
+ let options = this.config[this.device.device].items[item].options
442
+ 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) {
443
+ for (let i in options) {
444
+ let value
445
+ if(this.config[this.device.device].items[item].type == 'selector' && this.config[this.device.device].items[item].multiple == false){
446
+ value = val[0]
447
+ }else if (this.config[this.device.device].items[item].type == 'inputSelector'){
448
+ value = val
449
+ }
450
+ //tag)
451
+ // 如果未选择,清空图片、隐患信息等
452
+ if((type == 'selector' && val.length == 0) || (type == 'inputSelector' && val == '')){
453
+ this.f_items[n].f_path = ''
454
+ this.f_items[n].f_is_defect = ''
455
+ this.f_items[n].f_defect_level = ''
456
+ this.f_items[n].f_live_dispose = ''
457
+ this.f_items[n].tooltip = ''
458
+ }
459
+ 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)){
460
+ // 找到选中的项了
461
+ //tag
462
+ if(options[i].isdefect == true ){
463
+ shImage = true
464
+ }
465
+ if(options[i].isdefect == false || this.f_items[n].f_item_value == ''){
466
+ shImage = false
467
+ }
468
+ //tag
469
+ if(shImage){
470
+ this.f_items[n].f_is_defect =true
471
+ this.f_items[n].f_defect_level = options[i].level
472
+ this.f_items[n].f_path = Vue.nopic
473
+ this.f_items[n].f_live_dispose = ''
474
+ this.f_items[n].tooltip= options[i].tooltip
475
+ }else{
476
+ this.f_items[n].f_path = ''
477
+ this.f_items[n].f_is_defect = ''
478
+ this.f_items[n].f_defect_level = ''
479
+ this.f_items[n].f_live_dispose = ''
480
+ this.f_items[n].tooltip = ''
481
+ }
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
487
+ )
488
+ // this.$watch('other',function(val){
489
+ // //tag
490
+ // if(this.selectindex != null) {
491
+ // let index = this.f_items[this.selectindex].f_item_value.indexOf('其他')
492
+ // if(index > -1){
493
+ // this.f_items[this.selectindex].f_item_value.splice(index,1,this.other)
494
+ // }
495
+ // }
496
+ //
497
+ // })
498
+ }else if(this.f_items[n].type == 'radio') {
499
+ // 监听单选框,如果有隐患,需要拍照
500
+ this.$watch('f_items[' + n + '].f_item_value', function (val) {
501
+ //tag)
502
+ let options = this.f_items[n].options
503
+ //tag)
504
+ for (let i = 0; i < options.length; i++) {
505
+ //tag)
506
+ // 找到选中的项了
507
+ if (options[i].value == val) {
508
+ // 如果有隐患,拍图片
509
+ if (options[i].isdefect) {
510
+ this.f_items[n].f_is_defect = true
511
+ this.f_items[n].f_defect_level = options[i].level
512
+ this.f_items[n].f_path = Vue.nopic
513
+ this.f_items[n].f_live_dispose = '否'
514
+ this.f_items[n].tooltip = options[i].tooltip
515
+ //tag)
516
+ return
517
+ }
518
+ }
519
+ }
520
+ this.f_items[n].f_path = ''
521
+ this.f_items[n].f_is_defect = ''
522
+ this.f_items[n].f_defect_level = ''
523
+ this.f_items[n].f_live_dispose = ''
524
+ this.f_items[n].tooltip = ''
525
+ })
526
+ }else if(this.f_items[n].type == 'checkbox') {
527
+ // 监听单选框,如果有隐患,需要拍照
528
+ this.$watch('f_items[' + n + '].f_item_value', function (val) {
529
+ //tag)
530
+ // 如果是手动赋值,不执行下面逻辑
531
+ if (this.f_items[n].isReSet) {
532
+ this.f_items[n].isReSet = false
533
+ return
534
+ }
535
+ let options = this.f_items[n].options
536
+ //tag)
537
+ // 取出选中项中有隐患的详细信息
538
+ let selected = options.filter(item => { return val.indexOf(item.value) != -1 && item.isdefect })
539
+
540
+ if(selected.length > 0){
541
+ // 防止赋值无限调用
542
+ this.f_items[n].isReSet = true
543
+ let selectList = selected.map(item => {return item.value})
544
+ // 如果选中的是非隐患项,取消选中isdefect为true的
545
+ if (selectList.indexOf(val[val.length - 1]) == -1) {
546
+ this.f_items[n].f_item_value = val.filter(item => {return selectList.indexOf(item) == -1})
547
+ this.f_items[n].f_path = ''
548
+ this.f_items[n].f_is_defect = ''
549
+ this.f_items[n].f_defect_level = ''
550
+ this.f_items[n].f_live_dispose = ''
551
+ this.f_items[n].tooltip = ''
552
+ return
553
+ }
554
+ // 如果选中的是隐患项,取消选中isdefect为false的
555
+ this.f_items[n].f_item_value = selectList
556
+ // 如果第一次选择隐患项,初始化
557
+ if (!this.f_items[n].f_is_defect) {
558
+ this.f_items[n].f_is_defect = true
559
+ this.f_items[n].f_defect_level = selected[0].level
560
+ this.f_items[n].f_path = Vue.nopic
561
+ this.f_items[n].f_live_dispose = ''
562
+ this.f_items[n].tooltip = selected[0].tooltip
563
+ }
564
+ //tag)
565
+ return
566
+ }
567
+ this.f_items[n].f_path = ''
568
+ this.f_items[n].f_is_defect = ''
569
+ this.f_items[n].f_defect_level = ''
570
+ this.f_items[n].f_live_dispose = ''
571
+ this.f_items[n].tooltip = ''
572
+ })
573
+ }
574
+ }
575
+ //tag)
576
+ },
577
+ //计算已用气量/金额
578
+ getTableBaseNumber() {
579
+ //tag
580
+ if(!this.f_items[this.f_issue_reading.index].f_item_value || parseFloat(this.f_items[this.f_prior_reading.index].f_item_value).toString() == "NaN"){
581
+ return
582
+ }
583
+ //tag
584
+ //判断是金额表还是气量表
585
+ if(this.item.f_plan_meters[0].f_meter_type=='机表' || this.item.f_plan_meters[0].f_collection_type=='按气量'){
586
+ //tag
587
+ //tag
588
+ //tag
589
+ //tag
590
+ // 先清空
591
+ this.f_items[this.f_table_base.index].f_item_value = null
592
+ //已用气量=本期表读数-上期表读数
593
+ this.f_items[this.f_table_base.index].f_item_value= this.f_items[this.f_issue_reading.index].f_item_value-this.f_items[this.f_prior_reading.index].f_item_value
594
+ if (isNaN(this.f_items[this.f_table_base.index].f_item_value)) {
595
+ this.f_items[this.f_table_base.index].f_item_value = null
596
+ }
597
+ }else{
598
+ //tag
599
+ // 先清空
600
+ this.f_items[this.f_fee_base.index].f_item_value = null
601
+ //已用金额=本期表读数-上期表读数
602
+ this.f_items[this.f_fee_base.index].f_item_value= this.f_items[this.f_issue_reading.index].f_item_value-this.f_items[this.f_prior_reading.index].f_item_value
603
+ if (isNaN(this.f_items[this.f_fee_base.index].f_item_value)) {
604
+ this.f_items[this.f_fee_base.index].f_item_value = null
605
+ }
606
+ }
607
+
608
+ },
609
+ //计算剩余气量和金额
610
+ getGasBalanceNumber() {
611
+ //tag
612
+ if(this.item.f_plan_meters[0].f_meter_type=='机表' || this.item.f_plan_meters[0].f_collection_type=='按气量'){//按气量
613
+
614
+ if(!this.f_items[this.f_issue_reading.index].f_item_value || parseFloat(this.f_items[this.f_total_gas.index].f_item_value).toString() == "NaN"){
615
+ return
616
+ }
617
+ //剩余气量 = 累购-本期表读数
618
+ 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_issue_reading.index].f_item_value
619
+ if (isNaN(this.f_items[this.f_gas_balance.index].f_item_value)) {
620
+ this.f_items[this.f_gas_balance.index].f_item_value = null
621
+ }
622
+ }else{//按金额parseFloat(this.f_items[this.f_total_gas.index].f_item_value).toString() == "NaN"
623
+ if (!this.f_items[this.f_issue_reading.index].f_item_value || parseFloat(this.f_items[this.f_total_fee.index].f_item_value).toString() == "NaN") {
624
+ return
625
+ }
626
+ //剩余金额 = 累购-本期表读数
627
+ 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_issue_reading.index].f_item_value
628
+ if (isNaN(this.f_items[this.f_fee_balance.index].f_item_value)) {
629
+ this.f_items[this.f_fee_balance.index].f_item_value = null
630
+ }
631
+ }
632
+
633
+ },
634
+ // 计算到期日期
635
+ getscrapNumber() {
636
+ //tag
637
+ if(!this.f_items[this.f_install_date.index].f_item_value || !this.f_items[this.f_use_limit.index].f_item_value ){
638
+ return
639
+ }
640
+ let data = new Date(this.f_items[this.f_install_date.index].f_item_value)
641
+ data.setFullYear(data.getFullYear() + parseInt(this.f_items[this.f_use_limit.index].f_item_value))
642
+ this.f_items[this.f_scrap_date.index].f_item_value = data.toISOString().split('T')[0];
643
+ },
644
+ readmeter(){
645
+ if(!this.f_items[this.f_issue_reading.index].f_item_value && parseFloat(this.f_items[this.f_issue_reading.index].f_item_value).toString() == "NaN"){
646
+ this.$showMessage("请输入本期表读数!")
647
+ return
648
+ }
649
+ if(this.paper.f_is_meterreadding=='已抄表'){
650
+ this.$showMessage("本次安检已抄表,无法再次抄表!")
651
+ return
652
+ }
653
+ let param={
654
+ f_userinfoid:this.item.f_userinfoid,
655
+ f_checker:this.paper.f_checker_name,
656
+ f_checkerid:this.paper.f_checker_id,
657
+ f_tablebase:this.f_items[this.f_issue_reading.index].f_item_value
658
+ }
659
+ //tag)
660
+ HostApp.__this__ = this
661
+ HostApp.logicWithHint({
662
+ // logic别名,key必须为logic
663
+ 'logic': 'rc_ReadMeterToJiBiao',
664
+ // 回调执行方法名,key必须为callback
665
+ 'callback': 'javascript:HostApp.__this__.readmeterCallBack()',
666
+ // logic执行需要的业务参数
667
+ 'data': {param:param},
668
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
669
+ // 执行回调方法传入key为backresult
670
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
671
+ 'backresult': 1
672
+ })
673
+ },
674
+ readmeterCallBack(jo){
675
+ //tag)
676
+ if(jo.state == 'ok'){
677
+ let res = JSON.parse(jo.result)
678
+ //tag)
679
+ //tag)
680
+ if(res.code==200){
681
+ if(res.data=='已欠费'){
682
+ this.$showMessage(`抄表成功,该用户已欠费,欠费金额: ¥${res.oughtfee}`)
683
+ }
684
+ if(res.data=='未欠费'){
685
+ this.$showMessage(`抄表成功!该用户账户剩余金额: ¥${res.balance}`)
686
+ }
687
+ this.paper.f_is_meterreadding='已抄表'
688
+ }else{
689
+ this.$showMessage("抄表失败!")
690
+ }
691
+ }else{
692
+ this.$showMessage("服务器内部错误,抄表失败!")
693
+ }
694
+ },
695
+ disSelect(index, itemValue) {
696
+ //tag)
697
+ //tag)
698
+ if (this.f_items[index].f_item_value == itemValue) {
699
+ this.$set(`f_items[${index}].f_item_value`, '')
700
+ }
701
+ }
702
+ },
703
+ ready() {
704
+ //tag
705
+ //tag
706
+ if(Vue.config.safecheck != undefined){
707
+ if(Vue.config.safecheck.ApproveConfig != undefined){
708
+ if(Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
709
+ this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
710
+ }
711
+ }
712
+ }
713
+ //tag
714
+ //tag)
715
+ //tag)
716
+ //tag)
717
+ //创建页面所需数据
718
+ this.$set('piece', this.paper['device'+this.device.n][this.idx])
719
+ //tag)
720
+ //tag)
721
+ let n = 0
722
+ for (let item in this.config[this.device.device].items) {
723
+ let index = this.config[this.device.device].items[item].index-1
724
+ this.$set('page.options' + index, [])
725
+ //tag)
726
+ //tag)
727
+ //tag)
728
+ // 先根据配置组接页面
729
+ let f_item_value
730
+ if(this.config[this.device.device].items[item].type == 'selector' || this.config[this.device.device].items[item].type == 'checkbox'){
731
+ f_item_value = []
732
+ // 判断选项的默认值
733
+ for (let defitem in this.config[this.device.device].items[item].options) {
734
+ let defopt = this.config[this.device.device].items[item].options[defitem]
735
+ if (defopt.isdefault) {
736
+ //tag
737
+ f_item_value[0] = defopt.data
738
+ }
739
+ }
740
+ // if(this.config[this.device.device].items[item].data){
741
+ // f_item_value.push(this.config[this.device.device].items[item].data)
742
+ // }
743
+ }else{
744
+ f_item_value = this.config[this.device.device].items[item].data ? this.config[this.device.device].items[item].data : ''
745
+ }
746
+ //tag)
747
+ let it = {
748
+ type: this.config[this.device.device].items[item].type,
749
+ f_item_name: item,
750
+ checkmust: this.config[this.device.device].items[item].checkmust,
751
+ f_item_value: f_item_value,
752
+ f_is_defect: '',
753
+ multiple:this.config[this.device.device].items[item].multiple == true?this.config[this.device.device].items[item].multiple:false,
754
+ isshow:this.config[this.device.device].items[item].isshow == false?this.config[this.device.device].items[item].isshow:true,
755
+ readonly: this.config[this.device.device].items[item].readonly == true?true:false,
756
+ remark: this.config[this.device.device].items[item].remark ? this.config[this.device.device].items[item].remark : '',
757
+ format: this.config[this.device.device].items[item].format ? this.config[this.device.device].items[item].format : 'yyyy-MM-dd 00:00:00',
758
+ f_path: '',
759
+ tooltip:'',
760
+ f_live_dispose:'',
761
+ f_else:''
762
+ }
763
+ //tag)
764
+ //tag)
765
+ this.$set('f_items['+index+']',it)
766
+ if (this.config[this.device.device].items[item].type == 'selector' ||this.config[this.device.device].items[item].type == 'inputSelector') {
767
+ if(this.config[this.device.device].items[item].type == 'selector'){
768
+ this.page['options' + index].push({
769
+ label: "请选择",
770
+ value: ''
771
+ })
772
+ }
773
+ for (let i in this.config[this.device.device].items[item].options) {
774
+ this.page['options' + index].push({
775
+ label: this.config[this.device.device].items[item].options[i].data,
776
+ value: this.config[this.device.device].items[item].options[i].data
777
+ })
778
+ }
779
+ if(this.config[this.device.device].items[item].type == 'selector'){
780
+ this.$set('f_items['+index+'].selected', f_item_value)
781
+ }else if(this.config[this.device.device].items[item].type == 'inputSelector'){
782
+ this.$set('f_items['+index+'].selected', f_item_value)
783
+ }
784
+
785
+ this.$set('f_items['+index+'].options',this.page['options' + index])
786
+
787
+ //tag)
788
+ } else if (this.config[this.device.device].items[item].type == 'radio' || this.config[this.device.device].items[item].type == 'checkbox') {
789
+ for (let i in this.config[this.device.device].items[item].options) {
790
+ this.page['options' + index].push({
791
+ label: this.config[this.device.device].items[item].options[i].data,
792
+ value: this.config[this.device.device].items[item].options[i].data,
793
+ isdefect: this.config[this.device.device].items[item].options[i].isdefect,
794
+ level: this.config[this.device.device].items[item].options[i].level
795
+ })
796
+ }
797
+ this.$set('f_items[' + index + '].options', this.page['options' + index])
798
+ this.$set('f_items[' + index + '].f_item_value', f_item_value)
799
+ //tag)
800
+ }
801
+ n = n + 1
802
+ }
803
+ //tag)
804
+ //tag)
805
+ //tag)
806
+ if(JSON.stringify(this.piece) == '{}') {
807
+ // 如果没有,则新建
808
+ this.$set('piece.f_items',this.f_items)
809
+ this.$set('piece.f_device_type',this.device.device)
810
+ } else {
811
+ // 已经存在,把之前的数据重新填入
812
+ for (let f in this.f_items){
813
+ for(let p in this.piece.f_items) {
814
+ if (this.f_items[f].f_item_name == this.piece.f_items[p].f_item_name) {
815
+ //tag)
816
+ //tag)
817
+ //tag)
818
+ //tag)
819
+ this.f_items[f] = Object.assign(this.f_items[f], this.piece.f_items[p])
820
+ //tag)
821
+ if (this.f_items[f].type == 'selector' || this.f_items[f].type == 'inputSelector') {
822
+ //tag)
823
+ //tag)
824
+ this.f_items[f].selected = this.piece.f_items[p].f_item_value
825
+ //tag)
826
+ }
827
+ // 取出特殊值
828
+ if (this.f_items[f].f_item_name == '初始表底') {
829
+ //tag)
830
+ this.f_initial_base.index = f
831
+ } else if (this.f_items[f].f_item_name == '上期表读数') {
832
+ //tag)
833
+ this.f_prior_reading.index = f
834
+ } else if (this.f_items[f].f_item_name == '本期表读数') {
835
+ //tag)
836
+ this.f_issue_reading.index = f
837
+ /*this.$watch('f_items[' + f + '].f_item_value', function () {
838
+ this.getTableBaseNumber()
839
+ this.getGasBalanceNumber()
840
+ })*/
841
+ } else if (this.f_items[f].f_item_name == '累购气量') {
842
+ //tag)
843
+ this.f_total_gas.index = f
844
+ } else if (this.f_items[f].f_item_name == '已用气量') {
845
+ //tag)
846
+ this.f_table_base.index = f
847
+ /*this.$watch('f_items[' + f + '].f_item_value', function () {
848
+ this.getGasAberrantNumber('已用气量')
849
+ })*/
850
+ } else if (this.f_items[f].f_item_name == '剩余气量') {
851
+ //tag)
852
+ this.f_gas_balance.index = f
853
+ /*this.$watch('f_items[' + f + '].f_item_value', function () {
854
+ this.getGasAberrantNumber('')
855
+ })*/
856
+ } else if (this.f_items[f].f_item_name == '气量异常差值') {
857
+ //tag)
858
+ this.f_gas_aberrant_number.index = f
859
+ } else if (this.f_items[f].f_item_name == '累购金额') {
860
+ //tag)
861
+ this.f_total_fee.index = f
862
+ } else if (this.f_items[f].f_item_name == '已用金额') {
863
+ //tag)
864
+ this.f_fee_base.index = f
865
+ this.$watch('f_items[' + f + '].f_item_value', function () {
866
+ this.getFeeAberrantNumber('已用金额')
867
+ })
868
+ } else if (this.f_items[f].f_item_name == '剩余金额') {
869
+ //tag)
870
+ this.f_fee_balance.index = f
871
+ this.$watch('f_items[' + f + '].f_item_value', function () {
872
+ this.getFeeAberrantNumber('')
873
+ })
874
+ } else if (this.f_items[f].f_item_name == '金额异常差值') {
875
+ //tag)
876
+ this.f_fee_aberrant_number.index = f
877
+ }
878
+ }
879
+ }
880
+ for (let em in this.config[this.device.device].items) {
881
+ if (this.config[this.device.device].items[em].type == 'selector' && em == this.f_items[f].f_item_name) {
882
+ this.f_items[f].options =[]
883
+ for (let k in this.config[this.device.device].items[em].options) {
884
+ this.f_items[f].options.push({
885
+ label: this.config[this.device.device].items[em].options[k].data,
886
+ value: this.config[this.device.device].items[em].options[k].data
887
+ })
888
+ }
889
+ }
890
+ }
891
+ if (this.f_items[f].f_item_name == '安装日期') {
892
+ //tag)
893
+ this.f_install_date.index = f
894
+ this.$watch('f_items[' + f + '].f_item_value', function () {
895
+ this.getscrapNumber()
896
+ })
897
+ }else if (this.f_items[f].f_item_name == '使用年限') {
898
+ //tag)
899
+ this.f_use_limit.index = f
900
+ this.$watch('f_items[' + f + '].f_item_value', function () {
901
+ this.getscrapNumber()
902
+ })
903
+ }else if (this.f_items[f].f_item_name == '到期日期') {
904
+ //tag)
905
+ this.f_scrap_date.index = f
906
+ }
907
+ }
908
+ //tag)
909
+ this.$set('piece.f_items',this.f_items)
910
+ }
911
+ this.towatch()
912
+ },
913
+ destroyed(){
914
+ let nullCount = 0
915
+ let metertitles
916
+ //判断当前是否有选中项
917
+ for (let row in this.f_items){
918
+ if(this.f_items[row].selected && this.f_items[row].selected != '' && this.f_items[row].selected instanceof Array){
919
+ //tag
920
+ this.f_items[row].f_item_value = this.f_items[row].selected
921
+ }else if(this.f_items[row].selected && this.f_items[row].selected != ''){
922
+ //tag
923
+ this.f_items[row].f_item_value = this.f_items[row].selected
924
+ }
925
+ // if(this.f_items[row].f_item_value instanceof Array && this.f_items[row].f_item_value.length != 0 ){
926
+ // nullCount = nullCount+1
927
+ // }else if(this.f_items[row].f_item_value != ''){
928
+ // nullCount = nullCount+1
929
+ // }
930
+ }
931
+ let picture = []
932
+ // for (let row in this.f_items){
933
+ // let a={}
934
+ // a.f_path = this.f_items[row].f_path
935
+ // a.name = this.f_items[row].f_item_name
936
+ // }
937
+ // picture.push(a)
938
+ this.$set(`paper['device${this.device.n}'][${this.idx}]`, this.piece)
939
+ //tag
940
+ },
941
+ computed:{
942
+
943
+ }
944
+ }
945
+ </script>
946
+ <style lang="less" scoped>
947
+ .class-erro {
948
+ color: #a94442;
949
+ }
950
+ .fivelabel{
951
+ border: none;
952
+ border-left: 5px solid #A2C2EB;
953
+ float: left;
954
+ width: 35%;
955
+ margin-bottom: 3px;
956
+ text-align: left;
957
+ word-wrap: break-word;
958
+ white-space: normal;
959
+ }
960
+ .radiolabel{
961
+ border: none;
962
+ border-left: 5px solid #A2C2EB;
963
+ float: left;
964
+ width: 65%;
965
+ margin-bottom: 3px;
966
+ text-align: left;
967
+ word-wrap: break-word;
968
+ white-space: normal;
969
+ }
970
+
971
+ .textlabel {
972
+ border: none;
973
+ border-left: 5px solid #A2C2EB;
974
+ width: 100%;
975
+ margin-bottom: 3px;
976
+ text-align: left;
977
+ word-wrap: break-word;
978
+ white-space: normal;
979
+ }
980
+ .spanrodio{
981
+ margin-right: 10px;
982
+ }
983
+ .div-photo{
984
+ width: auto;
985
+ height: auto;
986
+ /* margin-top: 10px; */
987
+ position: absolute;
988
+ bottom: 10px;
989
+ right: 10px;
990
+ }
991
+ .btn-photo{
992
+ border: 0;
993
+ border-radius: 7px;
994
+ background-color: #7dc1f4;
995
+ font: 15px PingFang-SC-Bold;
996
+ height: 20%;
997
+ }
998
+ </style>
999
+