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