apply-clients 3.5.4-7 → 3.5.4-9

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,586 +1,587 @@
1
- <template>
2
- <work-busy :is-busy="showWork" v-show="showWork"></work-busy>
3
-
4
- <div class="col-sm-12" style="margin: 20px 0px;">
5
- <criteria-paged :model="model" v-ref:cp :pager="false">
6
- <criteria partial='criteria' @condition-changed='$parent.searchCondition' v-ref:cri>
7
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
8
- </div>
9
- </criteria>
10
- <data-grid :model="model" v-ref:grid partial='list' class="list_area table_sy" style="padding: 0px">
11
- <template partial='head'>
12
- <tr>
13
- <th>序号</th>
14
- <th>气表类型</th>
15
- <th>气表品牌</th>
16
- <th>气表型号</th>
17
- <th>表号</th>
18
- <th>安装位置</th>
19
- <th>安装人</th>
20
- <th>安装时间</th>
21
- <th>操作</th>
22
- </tr>
23
- </template>
24
- <template partial='body'>
25
- <tr>
26
- <td style="text-align: center;">
27
- <nobr>{{$index+1}}</nobr>
28
- </td>
29
- <td style="text-align: center;">
30
- <nobr>{{row.f_meter_classify}}</nobr>
31
- </td>
32
- <td style="text-align: center;">
33
- <nobr>{{row.f_gasbrand}}</nobr>
34
- </td>
35
- <td style="text-align: center;">
36
- <nobr>{{row.f_gasmodel}}</nobr>
37
- </td>
38
- <td style="text-align: center;">
39
- <nobr>{{row.f_meternumber}}</nobr>
40
- </td>
41
- <td style="text-align: center;">
42
- <nobr>{{row.f_position}}</nobr>
43
- </td>
44
- <td style="text-align: center;">
45
- <nobr>{{row.f_install_person}}</nobr>
46
- </td>
47
- <td style="text-align: center;">
48
- <nobr>{{row.f_install_date}}</nobr>
49
- </td>
50
- <td style="text-align: center;">
51
- <nobr>
52
- <button
53
- type="button" name="button" class="btn btn-link"
54
- :disabled="row.f_cumulative_payment_money < $parent.$parent.$parent.selectdata.f_price && $parent.$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'"
55
- @click="$parent.$parent.$parent.showUserFileModal(row)">
56
- {{$parent.$parent.$parent.mark === 1 ? '查看' : row.f_gasbrand ? '修正' : '添加'}}
57
- </button>
58
- </nobr>
59
- </td>
60
- </tr>
61
- </template>
62
- </data-grid>
63
- </criteria-paged>
64
- </div>
65
- <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
66
- <header slot="modal-header" class="modal-header">
67
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
68
- <h4 class="modal-title">选择文件</h4>
69
- </header>
70
- <article slot="modal-body" class="modal-body">
71
- <div class="form-group">
72
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
73
- </div>
74
- </article>
75
- <footer slot="modal-footer" class="modal-footer"></footer>
76
- </modal>
77
-
78
- <modal v-if="showUserFile" :show.sync="showUserFile" v-ref:modal :large="true" :backdrop="false" title="安装明细">
79
- <header slot="modal-header" class="modal-header">
80
- <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
81
- <h4 class="modal-title">安装明细</h4>
82
- </header>
83
- <article slot="modal-body" class="modal-body clearfix">
84
- <!-- <div class="form-group col-sm-12">
85
- <label class="col-sm-2 control-label">地址信息:</label>
86
- <div class="col-sm-10">
87
- <input class="form-control input_view" style=""
88
- v-model="useradders.f_address"
89
- :value="useradders.f_address"
90
- :readonly="true"/>
91
- </div>
92
- </div>-->
93
-
94
- <div v-for="(i, item) in userinfo.userfiles" class="form-group col-sm-12 panel panel-info">
95
- <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
96
- <div class="col-sm-6 text-left">表具{{$index+1}}信息</div>
97
- </div>
98
- <div class="form-group col-sm-6" :class="[item.gasbrand ? '' : 'has-error']">
99
- <label class="col-sm-4 control-label">气表品牌:</label>
100
- <div class="col-sm-8">
101
- <input-select
102
- class="select select_list"
103
- :value.sync="item.gasbrand"
104
- v-model="item.gasbrand"
105
- :options="meterbrands"
106
- @change="gasbrandChange(i)"
107
- :disable="mark === 1"
108
- :valueSingle="true"></input-select>
109
- </div>
110
- </div>
111
- <div class="form-group col-sm-6" :class="[item.gasmodel ? '' : 'has-error']">
112
- <label class="col-sm-4 control-label">气表型号:</label>
113
- <div class="col-sm-8">
114
- <input-select
115
- class="select select_list"
116
- :value.sync="item.gasmodel"
117
- v-model="item.gasmodel"
118
- :options.sync="item.gasbrand.gasmodel"
119
- @change="gasmodelChange(i)"
120
- :disable="mark === 1"
121
- :valueSingle="true"></input-select>
122
- </div>
123
- </div>
124
- <div class="form-group col-sm-6" >
125
- <label class="col-sm-4 control-label">表&emsp;&emsp;号:</label>
126
- <div class="col-sm-8">
127
- <input class="form-control input_view" style=""
128
- placeholder="表号"
129
- type="number"
130
- οnkeyup="this.value=this.value.replace(/\s+/g,'')"
131
- v-model="item.f_meternumber"
132
- :value="item.f_meternumber"
133
- @change="meternumberValidate(i)"
134
- :readonly="mark === 1"/>
135
- </div>
136
- </div>
137
- <div class="form-group col-sm-6">
138
- <label class="col-sm-4 control-label">质检号:</label>
139
- <div class="col-sm-8">
140
- <input class="form-control input_view" style=""
141
- placeholder="质检号"
142
- v-model="item.f_metertitles"
143
- :value="item.f_metertitles"
144
- :readonly="mark === 1"/>
145
- </div>
146
- </div>
147
- <div class="form-group col-sm-6">
148
- <label class="col-sm-4 control-label">防盗卡号1:</label>
149
- <div class="col-sm-8">
150
- <input class="form-control input_view" style=""
151
- placeholder="防盗卡号1"
152
- v-model="item.f_defendcard"
153
- :value="item.f_defendcard"
154
- :readonly="mark === 1"/>
155
- </div>
156
- </div>
157
- <div class="form-group col-sm-6">
158
- <label class="col-sm-4 control-label">防盗卡号2:</label>
159
- <div class="col-sm-8">
160
- <input class="form-control input_view" style=""
161
- placeholder="防盗卡号2"
162
- v-model="item.f_defendcard_two"
163
- :value="item.f_defendcard_two"
164
- :readonly="mark === 1"/>
165
- </div>
166
- </div>
167
- <div class="form-group col-sm-6">
168
- <label class="col-sm-4 control-label">调压箱编号:</label>
169
- <div class="col-sm-8">
170
- <input class="form-control input_view" style=""
171
- v-model="item.f_adjustable_id"
172
- placeholder="调压箱编号"
173
- :readonly="mark === 1"
174
- />
175
- </div>
176
- </div>
177
- <div class="form-group col-sm-6">
178
- <label class="col-sm-4 control-label">表箱号:</label>
179
- <div class="col-sm-8">
180
- <input class="form-control input_view" style=""
181
- v-model="item.f_box_number"
182
- placeholder="表箱号"
183
- :readonly="mark === 1"
184
- />
185
- </div>
186
- </div>
187
- <div class="form-group col-sm-6">
188
- <label class="col-sm-4 control-label">表&ensp;读&ensp;数:</label>
189
- <div class="col-sm-8">
190
- <input class="form-control input_view" style=""
191
- type="number"
192
- placeholder="表读数"
193
- v-model="item.f_meter_base"
194
- :value="item.f_meter_base"
195
- :readonly="mark === 1"/>
196
- </div>
197
- </div>
198
- <div class="form-group col-sm-6">
199
- <label class="col-sm-4 control-label">初始底数:</label>
200
- <div class="col-sm-8">
201
- <input class="form-control input_view" style=""
202
- type="number"
203
- v-model="item.f_initial_base"
204
- :value="item.f_initial_base"
205
- placeholder="初始底数"
206
- :readonly="mark === 1"/>
207
- </div>
208
- </div>
209
- <div class="form-group col-sm-6">
210
- <label class="col-sm-4 control-label">表&emsp;&emsp;向:</label>
211
- <div class="col-sm-8">
212
- <input-select
213
- class="select select_list"
214
- :value.sync="item.f_aroundmeter"
215
- v-model="item.f_aroundmeter"
216
- :options="aroundmeters"
217
- :disable="mark === 1"
218
- :valueSingle="true"></input-select>
219
- </div>
220
- </div>
221
- <div class="form-group col-sm-6">
222
- <label class="col-sm-4 control-label">安装位置:</label>
223
- <div class="col-sm-8">
224
- <input-select
225
- class="select select_list"
226
- :value.sync="item.f_position"
227
- v-model="item.f_position"
228
- :options="positions"
229
- :disable="mark === 1"
230
- :valueSingle="true"></input-select>
231
- </div>
232
- </div>
233
- <div class="form-group col-sm-6">
234
- <label class="col-sm-4 control-label">安&ensp;装&ensp;人:</label>
235
- <div class="col-sm-8">
236
- <input class="form-control input_view" style=""
237
- v-model="item.f_install_person"
238
- :value.sync="item.f_install_person"
239
- placeholder="安装人"
240
- :readonly="mark === 1"
241
- />
242
- <!-- <input-select-->
243
- <!-- class="select select_list"-->
244
- <!-- :value.sync="item.f_install_person"-->
245
- <!-- v-model="item.f_install_person"-->
246
- <!-- :options="installperson"-->
247
- <!-- :disable="mark === 1"-->
248
- <!-- :valueSingle="true"></input-select>-->
249
- </div>
250
- </div>
251
- <div class="form-group col-sm-6">
252
- <label class="col-sm-4 control-label">安装日期:</label>
253
- <div class="col-sm-8">
254
- <!-- <input class="form-control input_view" style=""
255
- v-model="item.f_install_date"
256
- :value.sync="installdate(item.f_install_date)"
257
- placeholder="安装日期"
258
- :readonly="mark === 1"
259
- />-->
260
- <datepicker
261
- placeholder="安装日期"
262
- :value.sync="item.f_install_date"
263
- v-model="item.f_install_date"
264
- :default="true"
265
- :format="'yyyy-MM-dd HH:mm:ss'"
266
- :disabled="mark === 1"
267
- :show-reset-button="reset">
268
- </datepicker>
269
- </div>
270
- </div>
271
- <div class="form-group col-sm-6">
272
- <label class="col-sm-4 control-label">生产日期:</label>
273
- <div class="col-sm-8">
274
- <datepicker
275
- placeholder="生产日期"
276
- :value.sync="item.f_factory_date"
277
- v-model="item.f_factory_date"
278
- :format="'yyyy-MM-dd HH:mm:ss'"
279
- :disabled="mark === 1"
280
- :show-reset-button="reset">
281
- </datepicker>
282
- </div>
283
- </div>
284
- </div>
285
-
286
- </article>
287
- <footer slot="modal-footer" class="modal-footer">
288
- <template v-if="mark !== 1">
289
- <!-- 去除一户多表 -->
290
- <button type="button" class="btn btn-primary" @click="saveUserFile" :disabled="!$v.valid">确认</button>
291
- </template>
292
- </footer>
293
- </modal>
294
- </template>
295
- <script>
296
- import Vue from 'vue'
297
- import {PagedList} from 'vue-client'
298
- import {HttpResetClass} from 'vue-client'
299
- import {isEmpty} from '../../../components/Util'
300
- // Date格式化
301
- Date.prototype.Format = function (fmt) {
302
- var o = {
303
- 'M+': this.getMonth() + 1, // 月份
304
- 'd+': this.getDate(), //
305
- 'H+': this.getHours(), // 小时
306
- 'm+': this.getMinutes(), //
307
- 's+': this.getSeconds(), //
308
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
309
- 'S': this.getMilliseconds() // 毫秒
310
- }
311
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
312
- for (var k in o) {
313
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
314
- }
315
- return fmt
316
- }
317
-
318
- export default {
319
- title: '安装明细',
320
- props: {
321
- selectdata: {
322
- type: Object
323
- },
324
- mark: {
325
- type: Number,
326
- default: 0
327
- }
328
- },
329
- data () {
330
- return {
331
- showFile: false,
332
- showUserFile: false,
333
- model: new PagedList('rs/sql/getAddresAndUserinfoAndUserfilesAmount', 20, null),
334
- meterbrands: [], // 气表品牌
335
- useradders: null,
336
- userinfo: {},
337
- getfield: {
338
- 'f_address': '地址',
339
- 'f_user_name': '用户姓名/单位名称',
340
- 'f_meternumber': '表号',
341
- 'f_gasbrand': '气表品牌',
342
- 'f_gasmodel': '气表型号',
343
- 'f_metertitles': '表封号',
344
- 'f_meter_base': '表读数',
345
- 'f_initial_base': '初始底数',
346
- 'f_aroundmeter': '表向',
347
- 'f_user_phone': '电话',
348
- 'f_userinfo_comments': '备注',
349
- 'f_position': '安装位置',
350
- 'f_userinfo_code': '用户编号',
351
- 'f_material_name': '材料名称',
352
- 'f_material_style': '材料型号',
353
- 'f_material_price': '材料价格',
354
- 'f_material_unit': '材料单位',
355
- 'f_material_number': '材料数量'
356
- },
357
- showWork: false
358
- }
359
- },
360
- ready () {
361
- this.search()
362
- this.getMeterbrands()
363
- },
364
- methods: {
365
- // 保存档案
366
- async saveUserFile() {
367
- // 检查必填项
368
- for (let i = 0; i < this.userinfo.userfiles.length; i++) {
369
- let userfile = this.userinfo.userfiles[i]
370
- if (userfile.f_gasbrand_id === null || userfile.f_gasbrand_id === '') {
371
- this.$showMessage(`表具${i+1}气表品牌没有选择!!!`)
372
- return
373
- }
374
- if (userfile.f_gasmodel_id === null || userfile.f_gasmodel_id === '') {
375
- this.$showMessage(`表具${i+1}气表型号没有选择!!!`)
376
- return
377
- }
378
- /*if (userfile.f_meternumber === null || userfile.f_meternumber === '') {
379
- this.$showMessage(`表具${i+1}表号没有填写!!!`)
380
- return
381
- }*/
382
- }
383
- let data = {
384
- user: this.$login.f,
385
- useradders: this.useradders,
386
- userinfo: this.userinfo,
387
- selectdata: this.selectdata
388
- }
389
- let res = await this.$resetpost('rs/logic/addInstallationDetails', {data:data}, {
390
- resolveMsg: null,
391
- rejectMsg: '表具添加失败!!!'
392
- })
393
- this.$dispatch('breakControl', this.selectdata)
394
- },
395
- // 检查表号是否存在
396
- async meternumberValidate(i) {
397
- if (!this.userinfo.userfiles[i].f_gasbrand_id) {
398
- this.userinfo.userfiles[i].f_meternumber = ''
399
- this.$showAlert('请先选择气表品牌!!!', 'warning', 3000)
400
- return
401
- }
402
- if (this.userinfo.userfiles[i].f_gasbrand_id && this.userinfo.userfiles[i].f_meternumber) {
403
- let data = {
404
- f_meternumber: this.userinfo.userfiles[i].f_meternumber,
405
- f_gasbrand_id: this.userinfo.userfiles[i].f_gasbrand_id
406
- }
407
- if (this.userinfo.userfiles[i].f_userfiles_id) {
408
- data.f_userfiles_id = this.userinfo.userfiles[i].f_userfiles_id
409
- }
410
- let res = await this.$resetpost('rs/logic/meterbrandsNumberValidate', {data:data}, {
411
- resolveMsg: null,
412
- rejectMsg: '表号验证失败!!'
413
- })
414
- if (res.data) {
415
- this.userinfo.userfiles[i].f_meternumber = ''
416
- this.$showAlert('表号已存在!!', 'warning', 3000)
417
- }
418
- }
419
- },
420
- // 选择气表型号
421
- gasmodelChange(i) {
422
- if (this.userinfo.userfiles[i].gasmodel) {
423
- this.userinfo.userfiles[i].f_gasmodel_id = this.userinfo.userfiles[i].gasmodel.id
424
- }
425
- },
426
- // 选择气表品牌
427
- gasbrandChange(i) {
428
- // 清空已保存的气表型号
429
- this.userinfo.userfiles[i].f_gasmodel_id = null
430
- this.userinfo.userfiles[i].gasmodel = null
431
-
432
- if (this.userinfo.userfiles[i].gasbrand) {
433
- // 气表品牌id
434
- this.userinfo.userfiles[i].f_gasbrand_id = this.userinfo.userfiles[i].gasbrand.id
435
- // 气表分类
436
- this.userinfo.userfiles[i].f_meter_classify = this.userinfo.userfiles[i].gasbrand.f_meter_type
437
- }
438
- },
439
- // 打开安装明细
440
- async showUserFileModal (row) {
441
- this.useradders = row
442
-
443
- let http = new HttpResetClass()
444
- let data = {
445
- condition: `f_userinfo_id = '${row.f_userinfo_id}'`
446
- }
447
- let res = await http.load('POST', 'rs/logic/getUserinfoAndUserfiles', {data:data}, {
448
- resolveMsg: null,
449
- rejectMsg: null
450
- })
451
-
452
- this.userinfo = res.data
453
-
454
- // 已有表具的 气表信息补充
455
- for (let i = 0; i < this.userinfo.userfiles.length; i++) {
456
- for (const item of this.meterbrands) {
457
- if (item.value.id === this.userinfo.userfiles[i].f_gasbrand_id) {
458
- // this.userinfo.userfiles[i].gasbrand = item.value // 防止双向绑定失败
459
- Vue.set(this.userinfo.userfiles[i], 'gasbrand', item.value)
460
- }
461
- }
462
- if (this.userinfo.userfiles[i].gasbrand) {
463
- for (const item of this.userinfo.userfiles[i].gasbrand.gasmodel) {
464
- if (item.value.id === this.userinfo.userfiles[i].f_gasmodel_id) {
465
- // this.userinfo.userfiles[i].gasmodel = item.value
466
- Vue.set(this.userinfo.userfiles[i], 'gasmodel', item.value)
467
- }
468
- }
469
- }
470
- }
471
-
472
- this.showUserFile = true
473
- },
474
- // 获取气表品牌
475
- async getMeterbrands() {
476
- let http = new HttpResetClass()
477
- let data = {
478
- f_orgid: this.$login.f.orgid
479
- }
480
- let res = await http.load('POST', 'rs/logic/getMeterbrands', {data:data}, {
481
- resolveMsg: null,
482
- rejectMsg: null
483
- })
484
- this.meterbrands = res.data
485
- },
486
- searchCondition (args) {
487
- var tablestate=''
488
- if(this.selectdata.f_sub_state==='完工' ){
489
- tablestate='正常'
490
- }else{
491
- tablestate='待开通'
492
- }
493
- if (this.selectdata.f_apply_type === '居民团体单户报建' || this.selectdata.f_apply_type === '其他报建') {
494
- args.condition = args.condition + `and ui.f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
495
- } else {
496
- args.condition = args.condition + `and ua.f_process_id = '${this.selectdata.f_process_id}'`
497
- }
498
- this.model.search(args.condition, args.model,tablestate)
499
- },
500
- // 查询
501
- async search () {
502
- this.$refs.cp.$refs.cri.search()
503
- },
504
- // 关闭安装明细
505
- closeUserFile() {
506
- this.showUserFile = false
507
- this.useradders = null
508
- this.userinfo = {}
509
- this.search()
510
- },
511
-
512
- },
513
- events: {
514
- },
515
- computed: {
516
- getCondition () {
517
- let condition = `ua.f_process_id = '${this.selectdata.f_process_id}'`
518
-
519
- return {
520
- condition: condition
521
- }
522
- },
523
- // 安装人
524
- installperson() {
525
- return function (f_install_person) {
526
- if (isEmpty(f_install_person)) {
527
- return this.$login.f.name
528
- }
529
- return f_install_person
530
- }
531
- },
532
- installdate() {
533
- return function (f_install_date) {
534
- if (isEmpty(f_install_date)) {
535
- return new Date().Format('yyyy-MM-dd')
536
- }
537
- return f_install_date
538
- }
539
- },
540
- // 表向
541
- aroundmeters() {
542
- return this.$appdata.getParam('左右表')
543
- },
544
- // 安装位置
545
- positions() {
546
- return this.$appdata.getParam('安装位置')
547
- }
548
- },
549
- watch: {
550
- }
551
- }
552
- </script>
553
- <style scoped>
554
- .head-but{
555
- margin-left: 5px;
556
- height: 34px;
557
- /*background-color: #6aa6e2;*/
558
- border-radius: 4px;
559
- font-family: PingFang;
560
- color: #ffffff;
561
- }
562
- /*清除model中的浮动*/
563
- .clearfix:after,.clearfix:before{
564
- display: table;
565
- }
566
- .clearfix:after{
567
- clear: both;
568
- }
569
- .input_view{
570
- padding: 8px;
571
- background-color: #ffffff;
572
- border-radius: 2px;
573
- border: solid 1px #c7c7c7!important;
574
- color: #333333!important;
575
- font-size: 15px!important;
576
- }
577
-
578
- .input_view[readonly]{
579
- border: 1px solid #DDD!important;
580
- color:#ACA899!important;
581
- }
582
- .input_view:disabled{
583
- border: 1px solid #DDD!important;
584
- color:#ACA899!important;
585
- }
586
- </style>
1
+ <template>
2
+ <work-busy :is-busy="showWork" v-show="showWork"></work-busy>
3
+
4
+ <div class="col-sm-12" style="margin: 20px 0px;">
5
+ <criteria-paged :model="model" v-ref:cp :pager="false">
6
+ <criteria partial='criteria' @condition-changed='$parent.searchCondition' v-ref:cri>
7
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
8
+ </div>
9
+ </criteria>
10
+ <data-grid :model="model" v-ref:grid partial='list' class="list_area table_sy" style="padding: 0px">
11
+ <template partial='head'>
12
+ <tr>
13
+ <th>序号</th>
14
+ <th>气表类型</th>
15
+ <th>气表品牌</th>
16
+ <th>气表型号</th>
17
+ <th>表号</th>
18
+ <th>安装位置</th>
19
+ <th>安装人</th>
20
+ <th>安装时间</th>
21
+ <th>操作</th>
22
+ </tr>
23
+ </template>
24
+ <template partial='body'>
25
+ <tr>
26
+ <td style="text-align: center;">
27
+ <nobr>{{$index+1}}</nobr>
28
+ </td>
29
+ <td style="text-align: center;">
30
+ <nobr>{{row.f_meter_classify}}</nobr>
31
+ </td>
32
+ <td style="text-align: center;">
33
+ <nobr>{{row.f_gasbrand}}</nobr>
34
+ </td>
35
+ <td style="text-align: center;">
36
+ <nobr>{{row.f_gasmodel}}</nobr>
37
+ </td>
38
+ <td style="text-align: center;">
39
+ <nobr>{{row.f_meternumber}}</nobr>
40
+ </td>
41
+ <td style="text-align: center;">
42
+ <nobr>{{row.f_position}}</nobr>
43
+ </td>
44
+ <td style="text-align: center;">
45
+ <nobr>{{row.f_install_person}}</nobr>
46
+ </td>
47
+ <td style="text-align: center;">
48
+ <nobr>{{row.f_install_date}}</nobr>
49
+ </td>
50
+ <td style="text-align: center;">
51
+ <nobr>
52
+ <button
53
+ type="button" name="button" class="btn btn-link"
54
+ :disabled="row.f_cumulative_payment_money < $parent.$parent.$parent.selectdata.f_price && $parent.$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'"
55
+ @click="$parent.$parent.$parent.showUserFileModal(row)">
56
+ {{$parent.$parent.$parent.mark === 1 ? '查看' : row.f_gasbrand ? '修正' : '添加'}}
57
+ </button>
58
+ </nobr>
59
+ </td>
60
+ </tr>
61
+ </template>
62
+ </data-grid>
63
+ </criteria-paged>
64
+ </div>
65
+ <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
66
+ <header slot="modal-header" class="modal-header">
67
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
68
+ <h4 class="modal-title">选择文件</h4>
69
+ </header>
70
+ <article slot="modal-body" class="modal-body">
71
+ <div class="form-group">
72
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
73
+ </div>
74
+ </article>
75
+ <footer slot="modal-footer" class="modal-footer"></footer>
76
+ </modal>
77
+
78
+ <modal v-if="showUserFile" :show.sync="showUserFile" v-ref:modal :large="true" :backdrop="false" title="安装明细">
79
+ <header slot="modal-header" class="modal-header">
80
+ <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
81
+ <h4 class="modal-title">安装明细</h4>
82
+ </header>
83
+ <article slot="modal-body" class="modal-body clearfix">
84
+ <!-- <div class="form-group col-sm-12">
85
+ <label class="col-sm-2 control-label">地址信息:</label>
86
+ <div class="col-sm-10">
87
+ <input class="form-control input_view" style=""
88
+ v-model="useradders.f_address"
89
+ :value="useradders.f_address"
90
+ :readonly="true"/>
91
+ </div>
92
+ </div>-->
93
+
94
+ <div v-for="(i, item) in userinfo.userfiles" class="form-group col-sm-12 panel panel-info">
95
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
96
+ <div class="col-sm-6 text-left">表具{{$index+1}}信息</div>
97
+ </div>
98
+ <div class="form-group col-sm-6" :class="[item.gasbrand ? '' : 'has-error']">
99
+ <label class="col-sm-4 control-label">气表品牌:</label>
100
+ <div class="col-sm-8">
101
+ <input-select
102
+ class="select select_list"
103
+ :value.sync="item.gasbrand"
104
+ v-model="item.gasbrand"
105
+ :options="meterbrands"
106
+ @change="gasbrandChange(i)"
107
+ :disable="mark === 1"
108
+ :valueSingle="true"></input-select>
109
+ </div>
110
+ </div>
111
+ <div class="form-group col-sm-6" :class="[item.gasmodel ? '' : 'has-error']">
112
+ <label class="col-sm-4 control-label">气表型号:</label>
113
+ <div class="col-sm-8">
114
+ <input-select
115
+ class="select select_list"
116
+ :value.sync="item.gasmodel"
117
+ v-model="item.gasmodel"
118
+ :options.sync="item.gasbrand.gasmodel"
119
+ @change="gasmodelChange(i)"
120
+ :disable="mark === 1"
121
+ :valueSingle="true"></input-select>
122
+ </div>
123
+ </div>
124
+ <div class="form-group col-sm-6" >
125
+ <label class="col-sm-4 control-label">表&emsp;&emsp;号:</label>
126
+ <div class="col-sm-8">
127
+ <input class="form-control input_view" style=""
128
+ placeholder="表号"
129
+ type="number"
130
+ οnkeyup="this.value=this.value.replace(/\s+/g,'')"
131
+ v-model="item.f_meternumber"
132
+ :value="item.f_meternumber"
133
+ @change="meternumberValidate(i)"
134
+ :readonly="mark === 1"/>
135
+ </div>
136
+ </div>
137
+ <div class="form-group col-sm-6">
138
+ <label class="col-sm-4 control-label">质检号:</label>
139
+ <div class="col-sm-8">
140
+ <input class="form-control input_view" style=""
141
+ placeholder="质检号"
142
+ v-model="item.f_metertitles"
143
+ :value="item.f_metertitles"
144
+ :readonly="mark === 1"/>
145
+ </div>
146
+ </div>
147
+ <div class="form-group col-sm-6">
148
+ <label class="col-sm-4 control-label">防盗卡号1:</label>
149
+ <div class="col-sm-8">
150
+ <input class="form-control input_view" style=""
151
+ placeholder="防盗卡号1"
152
+ v-model="item.f_defendcard"
153
+ :value="item.f_defendcard"
154
+ :readonly="mark === 1"/>
155
+ </div>
156
+ </div>
157
+ <div class="form-group col-sm-6">
158
+ <label class="col-sm-4 control-label">防盗卡号2:</label>
159
+ <div class="col-sm-8">
160
+ <input class="form-control input_view" style=""
161
+ placeholder="防盗卡号2"
162
+ v-model="item.f_defendcard_two"
163
+ :value="item.f_defendcard_two"
164
+ :readonly="mark === 1"/>
165
+ </div>
166
+ </div>
167
+ <div class="form-group col-sm-6">
168
+ <label class="col-sm-4 control-label">调压箱编号:</label>
169
+ <div class="col-sm-8">
170
+ <input class="form-control input_view" style=""
171
+ v-model="item.f_adjustable_id"
172
+ placeholder="调压箱编号"
173
+ :readonly="mark === 1"
174
+ />
175
+ </div>
176
+ </div>
177
+ <div class="form-group col-sm-6">
178
+ <label class="col-sm-4 control-label">表箱号:</label>
179
+ <div class="col-sm-8">
180
+ <input class="form-control input_view" style=""
181
+ v-model="item.f_box_number"
182
+ placeholder="表箱号"
183
+ :readonly="mark === 1"
184
+ />
185
+ </div>
186
+ </div>
187
+ <div class="form-group col-sm-6">
188
+ <label class="col-sm-4 control-label">表&ensp;读&ensp;数:</label>
189
+ <div class="col-sm-8">
190
+ <input class="form-control input_view" style=""
191
+ type="number"
192
+ placeholder="表读数"
193
+ v-model="item.f_meter_base"
194
+ :value="item.f_meter_base"
195
+ :readonly="mark === 1"/>
196
+ </div>
197
+ </div>
198
+ <div class="form-group col-sm-6">
199
+ <label class="col-sm-4 control-label">初始底数:</label>
200
+ <div class="col-sm-8">
201
+ <input class="form-control input_view" style=""
202
+ type="number"
203
+ v-model="item.f_initial_base"
204
+ :value="item.f_initial_base"
205
+ placeholder="初始底数"
206
+ :readonly="mark === 1"/>
207
+ </div>
208
+ </div>
209
+ <div class="form-group col-sm-6">
210
+ <label class="col-sm-4 control-label">表&emsp;&emsp;向:</label>
211
+ <div class="col-sm-8">
212
+ <input-select
213
+ class="select select_list"
214
+ :value.sync="item.f_aroundmeter"
215
+ v-model="item.f_aroundmeter"
216
+ :options="aroundmeters"
217
+ :disable="mark === 1"
218
+ :valueSingle="true"></input-select>
219
+ </div>
220
+ </div>
221
+ <div class="form-group col-sm-6">
222
+ <label class="col-sm-4 control-label">安装位置:</label>
223
+ <div class="col-sm-8">
224
+ <input-select
225
+ class="select select_list"
226
+ :value.sync="item.f_position"
227
+ v-model="item.f_position"
228
+ :options="positions"
229
+ :disable="mark === 1"
230
+ :valueSingle="true"></input-select>
231
+ </div>
232
+ </div>
233
+ <div class="form-group col-sm-6">
234
+ <label class="col-sm-4 control-label">安&ensp;装&ensp;人:</label>
235
+ <div class="col-sm-8">
236
+ <input class="form-control input_view" style=""
237
+ v-model="item.f_install_person"
238
+ :value.sync="item.f_install_person"
239
+ placeholder="安装人"
240
+ :readonly="mark === 1"
241
+ />
242
+ <!-- <input-select-->
243
+ <!-- class="select select_list"-->
244
+ <!-- :value.sync="item.f_install_person"-->
245
+ <!-- v-model="item.f_install_person"-->
246
+ <!-- :options="installperson"-->
247
+ <!-- :disable="mark === 1"-->
248
+ <!-- :valueSingle="true"></input-select>-->
249
+ </div>
250
+ </div>
251
+ <div class="form-group col-sm-6">
252
+ <label class="col-sm-4 control-label">安装日期:</label>
253
+ <div class="col-sm-8">
254
+ <!-- <input class="form-control input_view" style=""
255
+ v-model="item.f_install_date"
256
+ :value.sync="installdate(item.f_install_date)"
257
+ placeholder="安装日期"
258
+ :readonly="mark === 1"
259
+ />-->
260
+ <datepicker
261
+ placeholder="安装日期"
262
+ :value.sync="item.f_install_date"
263
+ v-model="item.f_install_date"
264
+ :default="true"
265
+ :format="'yyyy-MM-dd'"
266
+ :disabled="mark === 1"
267
+ :show-reset-button="reset">
268
+ </datepicker>
269
+ </div>
270
+ </div>
271
+ <div class="form-group col-sm-6">
272
+ <label class="col-sm-4 control-label">生产日期:</label>
273
+ <div class="col-sm-8">
274
+ <datepicker
275
+ placeholder="生产日期"
276
+ :value.sync="item.f_factory_date"
277
+ v-model="item.f_factory_date"
278
+ :format="'yyyy-MM-dd'"
279
+ :default="true"
280
+ :disabled="mark === 1"
281
+ :show-reset-button="reset">
282
+ </datepicker>
283
+ </div>
284
+ </div>
285
+ </div>
286
+
287
+ </article>
288
+ <footer slot="modal-footer" class="modal-footer">
289
+ <template v-if="mark !== 1">
290
+ <!-- 去除一户多表 -->
291
+ <button type="button" class="btn btn-primary" @click="saveUserFile" :disabled="!$v.valid">确认</button>
292
+ </template>
293
+ </footer>
294
+ </modal>
295
+ </template>
296
+ <script>
297
+ import Vue from 'vue'
298
+ import {PagedList} from 'vue-client'
299
+ import {HttpResetClass} from 'vue-client'
300
+ import {isEmpty} from '../../../components/Util'
301
+ // Date格式化
302
+ Date.prototype.Format = function (fmt) {
303
+ var o = {
304
+ 'M+': this.getMonth() + 1, // 月份
305
+ 'd+': this.getDate(), //
306
+ 'H+': this.getHours(), // 小时
307
+ 'm+': this.getMinutes(), //
308
+ 's+': this.getSeconds(), //
309
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
310
+ 'S': this.getMilliseconds() // 毫秒
311
+ }
312
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
313
+ for (var k in o) {
314
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
315
+ }
316
+ return fmt
317
+ }
318
+
319
+ export default {
320
+ title: '安装明细',
321
+ props: {
322
+ selectdata: {
323
+ type: Object
324
+ },
325
+ mark: {
326
+ type: Number,
327
+ default: 0
328
+ }
329
+ },
330
+ data () {
331
+ return {
332
+ showFile: false,
333
+ showUserFile: false,
334
+ model: new PagedList('rs/sql/getAddresAndUserinfoAndUserfilesAmount', 20, null),
335
+ meterbrands: [], // 气表品牌
336
+ useradders: null,
337
+ userinfo: {},
338
+ getfield: {
339
+ 'f_address': '地址',
340
+ 'f_user_name': '用户姓名/单位名称',
341
+ 'f_meternumber': '表号',
342
+ 'f_gasbrand': '气表品牌',
343
+ 'f_gasmodel': '气表型号',
344
+ 'f_metertitles': '表封号',
345
+ 'f_meter_base': '表读数',
346
+ 'f_initial_base': '初始底数',
347
+ 'f_aroundmeter': '表向',
348
+ 'f_user_phone': '电话',
349
+ 'f_userinfo_comments': '备注',
350
+ 'f_position': '安装位置',
351
+ 'f_userinfo_code': '用户编号',
352
+ 'f_material_name': '材料名称',
353
+ 'f_material_style': '材料型号',
354
+ 'f_material_price': '材料价格',
355
+ 'f_material_unit': '材料单位',
356
+ 'f_material_number': '材料数量'
357
+ },
358
+ showWork: false
359
+ }
360
+ },
361
+ ready () {
362
+ this.search()
363
+ this.getMeterbrands()
364
+ },
365
+ methods: {
366
+ // 保存档案
367
+ async saveUserFile() {
368
+ // 检查必填项
369
+ for (let i = 0; i < this.userinfo.userfiles.length; i++) {
370
+ let userfile = this.userinfo.userfiles[i]
371
+ if (userfile.f_gasbrand_id === null || userfile.f_gasbrand_id === '') {
372
+ this.$showMessage(`表具${i+1}气表品牌没有选择!!!`)
373
+ return
374
+ }
375
+ if (userfile.f_gasmodel_id === null || userfile.f_gasmodel_id === '') {
376
+ this.$showMessage(`表具${i+1}气表型号没有选择!!!`)
377
+ return
378
+ }
379
+ /*if (userfile.f_meternumber === null || userfile.f_meternumber === '') {
380
+ this.$showMessage(`表具${i+1}表号没有填写!!!`)
381
+ return
382
+ }*/
383
+ }
384
+ let data = {
385
+ user: this.$login.f,
386
+ useradders: this.useradders,
387
+ userinfo: this.userinfo,
388
+ selectdata: this.selectdata
389
+ }
390
+ let res = await this.$resetpost('rs/logic/addInstallationDetails', {data:data}, {
391
+ resolveMsg: null,
392
+ rejectMsg: '表具添加失败!!!'
393
+ })
394
+ this.$dispatch('breakControl', this.selectdata)
395
+ },
396
+ // 检查表号是否存在
397
+ async meternumberValidate(i) {
398
+ if (!this.userinfo.userfiles[i].f_gasbrand_id) {
399
+ this.userinfo.userfiles[i].f_meternumber = ''
400
+ this.$showAlert('请先选择气表品牌!!!', 'warning', 3000)
401
+ return
402
+ }
403
+ if (this.userinfo.userfiles[i].f_gasbrand_id && this.userinfo.userfiles[i].f_meternumber) {
404
+ let data = {
405
+ f_meternumber: this.userinfo.userfiles[i].f_meternumber,
406
+ f_gasbrand_id: this.userinfo.userfiles[i].f_gasbrand_id
407
+ }
408
+ if (this.userinfo.userfiles[i].f_userfiles_id) {
409
+ data.f_userfiles_id = this.userinfo.userfiles[i].f_userfiles_id
410
+ }
411
+ let res = await this.$resetpost('rs/logic/meterbrandsNumberValidate', {data:data}, {
412
+ resolveMsg: null,
413
+ rejectMsg: '表号验证失败!!'
414
+ })
415
+ if (res.data) {
416
+ this.userinfo.userfiles[i].f_meternumber = ''
417
+ this.$showAlert('表号已存在!!', 'warning', 3000)
418
+ }
419
+ }
420
+ },
421
+ // 选择气表型号
422
+ gasmodelChange(i) {
423
+ if (this.userinfo.userfiles[i].gasmodel) {
424
+ this.userinfo.userfiles[i].f_gasmodel_id = this.userinfo.userfiles[i].gasmodel.id
425
+ }
426
+ },
427
+ // 选择气表品牌
428
+ gasbrandChange(i) {
429
+ // 清空已保存的气表型号
430
+ this.userinfo.userfiles[i].f_gasmodel_id = null
431
+ this.userinfo.userfiles[i].gasmodel = null
432
+
433
+ if (this.userinfo.userfiles[i].gasbrand) {
434
+ // 气表品牌id
435
+ this.userinfo.userfiles[i].f_gasbrand_id = this.userinfo.userfiles[i].gasbrand.id
436
+ // 气表分类
437
+ this.userinfo.userfiles[i].f_meter_classify = this.userinfo.userfiles[i].gasbrand.f_meter_type
438
+ }
439
+ },
440
+ // 打开安装明细
441
+ async showUserFileModal (row) {
442
+ this.useradders = row
443
+
444
+ let http = new HttpResetClass()
445
+ let data = {
446
+ condition: `f_userinfo_id = '${row.f_userinfo_id}'`
447
+ }
448
+ let res = await http.load('POST', 'rs/logic/getUserinfoAndUserfiles', {data:data}, {
449
+ resolveMsg: null,
450
+ rejectMsg: null
451
+ })
452
+
453
+ this.userinfo = res.data
454
+
455
+ // 已有表具的 气表信息补充
456
+ for (let i = 0; i < this.userinfo.userfiles.length; i++) {
457
+ for (const item of this.meterbrands) {
458
+ if (item.value.id === this.userinfo.userfiles[i].f_gasbrand_id) {
459
+ // this.userinfo.userfiles[i].gasbrand = item.value // 防止双向绑定失败
460
+ Vue.set(this.userinfo.userfiles[i], 'gasbrand', item.value)
461
+ }
462
+ }
463
+ if (this.userinfo.userfiles[i].gasbrand) {
464
+ for (const item of this.userinfo.userfiles[i].gasbrand.gasmodel) {
465
+ if (item.value.id === this.userinfo.userfiles[i].f_gasmodel_id) {
466
+ // this.userinfo.userfiles[i].gasmodel = item.value
467
+ Vue.set(this.userinfo.userfiles[i], 'gasmodel', item.value)
468
+ }
469
+ }
470
+ }
471
+ }
472
+
473
+ this.showUserFile = true
474
+ },
475
+ // 获取气表品牌
476
+ async getMeterbrands() {
477
+ let http = new HttpResetClass()
478
+ let data = {
479
+ f_orgid: this.$login.f.orgid
480
+ }
481
+ let res = await http.load('POST', 'rs/logic/getMeterbrands', {data:data}, {
482
+ resolveMsg: null,
483
+ rejectMsg: null
484
+ })
485
+ this.meterbrands = res.data
486
+ },
487
+ searchCondition (args) {
488
+ var tablestate=''
489
+ if(this.selectdata.f_sub_state==='完工' ){
490
+ tablestate='正常'
491
+ }else{
492
+ tablestate='待开通'
493
+ }
494
+ if (this.selectdata.f_apply_type === '居民团体单户报建' || this.selectdata.f_apply_type === '其他报建') {
495
+ args.condition = args.condition + `and ui.f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
496
+ } else {
497
+ args.condition = args.condition + `and ua.f_process_id = '${this.selectdata.f_process_id}'`
498
+ }
499
+ this.model.search(args.condition, args.model,tablestate)
500
+ },
501
+ // 查询
502
+ async search () {
503
+ this.$refs.cp.$refs.cri.search()
504
+ },
505
+ // 关闭安装明细
506
+ closeUserFile() {
507
+ this.showUserFile = false
508
+ this.useradders = null
509
+ this.userinfo = {}
510
+ this.search()
511
+ },
512
+
513
+ },
514
+ events: {
515
+ },
516
+ computed: {
517
+ getCondition () {
518
+ let condition = `ua.f_process_id = '${this.selectdata.f_process_id}'`
519
+
520
+ return {
521
+ condition: condition
522
+ }
523
+ },
524
+ // 安装人
525
+ installperson() {
526
+ return function (f_install_person) {
527
+ if (isEmpty(f_install_person)) {
528
+ return this.$login.f.name
529
+ }
530
+ return f_install_person
531
+ }
532
+ },
533
+ installdate() {
534
+ return function (f_install_date) {
535
+ if (isEmpty(f_install_date)) {
536
+ return new Date().Format('yyyy-MM-dd')
537
+ }
538
+ return f_install_date
539
+ }
540
+ },
541
+ // 表向
542
+ aroundmeters() {
543
+ return this.$appdata.getParam('左右表')
544
+ },
545
+ // 安装位置
546
+ positions() {
547
+ return this.$appdata.getParam('安装位置')
548
+ }
549
+ },
550
+ watch: {
551
+ }
552
+ }
553
+ </script>
554
+ <style scoped>
555
+ .head-but{
556
+ margin-left: 5px;
557
+ height: 34px;
558
+ /*background-color: #6aa6e2;*/
559
+ border-radius: 4px;
560
+ font-family: PingFang;
561
+ color: #ffffff;
562
+ }
563
+ /*清除model中的浮动*/
564
+ .clearfix:after,.clearfix:before{
565
+ display: table;
566
+ }
567
+ .clearfix:after{
568
+ clear: both;
569
+ }
570
+ .input_view{
571
+ padding: 8px;
572
+ background-color: #ffffff;
573
+ border-radius: 2px;
574
+ border: solid 1px #c7c7c7!important;
575
+ color: #333333!important;
576
+ font-size: 15px!important;
577
+ }
578
+
579
+ .input_view[readonly]{
580
+ border: 1px solid #DDD!important;
581
+ color:#ACA899!important;
582
+ }
583
+ .input_view:disabled{
584
+ border: 1px solid #DDD!important;
585
+ color:#ACA899!important;
586
+ }
587
+ </style>