apply-clients 4.1.74 → 4.1.77

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,489 +1,505 @@
1
- <template>
2
- <div class="col-sm-12" style="margin: 20px 0px;">
3
- <data-grid :model="model" v-ref:grid class="list_area table_sy" style="padding: 0px">
4
- <template partial='head'>
5
- <tr>
6
- <th>序号</th>
7
- <th>客户编号</th>
8
- <th>客户名称</th>
9
- <th>客户电话</th>
10
- <th>地址信息</th>
11
- <th v-if="selectdata.f_apply_type !== '开发商集体报建'">是否结清</th>
12
- <th>表具数量</th>
13
- <th>
14
- <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
15
- @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
16
- <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
17
- href="/apply/download/excel/v3报装表具批量导入.xlsx" download>模板下载</a>
18
- <export-excel :data="$parent.$parent.getCondition"
19
- :field="$parent.$parent.getfield"
20
- sqlurl="rs/logic/applyExportfile"
21
- sql-name="getInstallableAddress"
22
- template-name='可安装地址'
23
- btn-name="导出可安装"
24
- :choose-col="true"></export-excel>
25
- </th>
26
- </tr>
27
- </template>
28
- <template partial='body'>
29
- <tr>
30
- <td style="text-align: center;">
31
- <nobr>{{$index+1}}</nobr>
32
- </td>
33
- <td style="text-align: center;">
34
- <nobr>{{row.f_userinfo_code}}</nobr>
35
- </td>
36
- <td style="text-align: center;">
37
- <nobr>{{row.f_user_name}}</nobr>
38
- </td>
39
- <td style="text-align: center;">
40
- <nobr>{{row.f_user_phone}}</nobr>
41
- </td>
42
- <td style="text-align: center;">
43
- <nobr>{{row.f_address}}</nobr>
44
- </td>
45
- <td style="text-align: center;" v-if="selectdata.f_apply_type !== '开发商集体报建'">
46
- <nobr>{{row.f_cumulative_payment_money < $parent.$parent.selectdata.f_price ? '否' : '是'}}</nobr>
47
- </td>
48
- <td style="text-align: center;">
49
- <nobr>{{row.f_userfiles_num === null ? 0 : row.f_userfiles_num}}</nobr>
50
- </td>
51
- <td style="text-align: center;">
52
- <nobr>
53
- <button
54
- type="button" name="button" class="btn btn-link"
55
- :disabled="row.f_cumulative_payment_money < $parent.$parent.selectdata.f_price && selectdata.f_apply_type !== '开发商集体报建'"
56
- @click="$parent.$parent.showUserFileModal(row)">
57
- {{$parent.$parent.mark === 1 ? '查看' : row.f_userfiles_num > 0 ? '修正' : '添加'}}
58
- </button>
59
- </nobr>
60
- </td>
61
- </tr>
62
- </template>
63
- </data-grid>
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="确定" multiple v-ref:file></file-upload>
73
- </div>
74
- </article>
75
- <footer slot="modal-footer" class="modal-footer"></footer>
76
- </modal>
77
-
78
- <validator name="v">
79
- <modal v-if="showUserFile" :show.sync="showUserFile" v-ref:modal :large="true" :backdrop="false" title="安装明细">
80
- <header slot="modal-header" class="modal-header">
81
- <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
82
- <h4 class="modal-title">安装明细</h4>
83
- </header>
84
- <article slot="modal-body" class="modal-body clearfix">
85
- <div class="form-group col-sm-12">
86
- <label class="col-sm-2 control-label">地址信息:</label>
87
- <div class="col-sm-10">
88
- <input class="form-control input_view" style=""
89
- v-model="useradders.f_address"
90
- :value="useradders.f_address"
91
- :readonly="true"/>
92
- </div>
93
- </div>
94
-
95
- <div v-for="(i, item) in userinfo.userfiles" class="form-group col-sm-12 panel panel-info">
96
- <div class="panel-heading head" style="background-color: #e8f4ff;margin-bottom: 10px">表具{{$index+1}}信息</div>
97
- <div class="form-group col-sm-6" :class="[$v.gasbrand.required ? 'has-error' : '']">
98
- <label class="col-sm-4 control-label">气表品牌:</label>
99
- <div class="col-sm-8">
100
- <input type="text" v-show="false" v-model="item.gasbrand.id" v-validate:gasbrand = "['required']" >
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="[$v.gasmodel.required ? 'has-error' : '']">
112
- <label class="col-sm-4 control-label">气表型号:</label>
113
- <div class="col-sm-8">
114
- <input type="text" v-show="false" v-model="item.gasmodel.f_meter_style" :value.sync="item.gasmodel.f_meter_style" v-validate:gasmodel = "['required']" >
115
- <input-select
116
- class="select select_list"
117
- :value.sync="item.gasmodel"
118
- v-model="item.gasmodel"
119
- :options.sync="item.gasbrand.gasmodel"
120
- @change="gasmodelChange(i)"
121
- :disable="mark === 1"
122
- :valueSingle="true"></input-select>
123
- </div>
124
- </div>
125
- </div>
126
- <div class="form-group col-sm-6" :class="[$v.f_meternumber.required ? 'has-error' : '']">
127
- <label class="col-sm-4 control-label">表号:</label>
128
- <div class="col-sm-8">
129
- <input class="form-control input_view" style=""
130
- placeholder="表号"
131
- v-validate:f_meternumber = "['required']"
132
- v-model="item.f_meternumber"
133
- :value="item.f_meternumber"
134
- @change="meternumberValidate(i)"
135
- :readonly="mark === 1"/>
136
- </div>
137
- </div>
138
- <div class="form-group col-sm-6">
139
- <label class="col-sm-4 control-label">表封号:</label>
140
- <div class="col-sm-8">
141
- <input class="form-control input_view" style=""
142
- placeholder="表封号"
143
- v-model="item.f_metertitles"
144
- :value="item.f_metertitles"
145
- :readonly="mark === 1"/>
146
- </div>
147
- </div>
148
- <div class="form-group col-sm-6">
149
- <label class="col-sm-4 control-label">表读数:</label>
150
- <div class="col-sm-8">
151
- <input class="form-control input_view" style=""
152
- type="number"
153
- placeholder="表读数"
154
- v-model="item.f_meter_base"
155
- :value="item.f_meter_base"
156
- :readonly="mark === 1"/>
157
- </div>
158
- </div>
159
- <div class="form-group col-sm-6">
160
- <label class="col-sm-4 control-label">初始底数:</label>
161
- <div class="col-sm-8">
162
- <input class="form-control input_view" style=""
163
- type="number"
164
- v-model="item.f_initial_base"
165
- :value="item.f_initial_base"
166
- placeholder="初始底数"
167
- :readonly="mark === 1"/>
168
- </div>
169
- </div>
170
- <div class="form-group col-sm-6">
171
- <label class="col-sm-4 control-label">表向:</label>
172
- <div class="col-sm-8">
173
- <input-select
174
- class="select select_list"
175
- :value.sync="item.f_aroundmeter"
176
- v-model="item.f_aroundmeter"
177
- :options="aroundmeters"
178
- :disable="mark === 1"
179
- :valueSingle="true"></input-select>
180
- </div>
181
- </div>
182
- <div class="form-group col-sm-6">
183
- <label class="col-sm-4 control-label">安装位置:</label>
184
- <div class="col-sm-8">
185
- <input-select
186
- class="select select_list"
187
- :value.sync="item.f_position"
188
- v-model="item.f_position"
189
- :options="positions"
190
- :disable="mark === 1"
191
- :valueSingle="true"></input-select>
192
- </div>
193
- </div>
194
- <div class="form-group col-sm-6">
195
- <label class="col-sm-4 control-label">安装人:</label>
196
- <div class="col-sm-8">
197
- <input-select
198
- class="select select_list"
199
- :value.sync="item.f_install_person"
200
- v-model="item.f_install_person"
201
- :options="installperson"
202
- :disable="mark === 1"
203
- :valueSingle="true"></input-select>
204
- </div>
205
- </div>
206
- <div class="form-group col-sm-6">
207
- <label class="col-sm-4 control-label">安装日期:</label>
208
- <div class="col-sm-8">
209
- <datepicker
210
- placeholder="安装日期"
211
- :value.sync="item.f_install_date"
212
- v-model="item.f_install_date"
213
- format="yyyy-MM-dd HH:mm:ss"
214
- :disabled="mark === 1"
215
- :show-reset-button="reset">
216
- </datepicker>
217
- </div>
218
- </div>
219
- </div>
220
-
221
- </article>
222
- <footer slot="modal-footer" class="modal-footer">
223
- <!-- 去除一户多表 -->
224
- <button type="button" class="btn btn-primary" @click="addUserFile" v-if="false">添加表具</button>
225
- <button type="button" class="btn btn-primary" @click="saveUserFile" :disabled="!$v.valid">确认</button>
226
- </footer>
227
- </modal>
228
- </validator>
229
- </template>
230
- <script>
231
- import Vue from 'vue'
232
- import {PagedList} from 'vue-client'
233
- import {HttpResetClass} from 'vue-client'
234
- import {isEmpty} from '../../../Util'
235
-
236
- export default {
237
- title: '安装明细',
238
- props: {
239
- selectdata: {
240
- type: Object
241
- },
242
- mark: {
243
- type: Number,
244
- default: 0
245
- }
246
- },
247
- data () {
248
- return {
249
- showFile: false,
250
- showUserFile: false,
251
- model: {
252
- data: null
253
- },
254
- meterbrands: [], // 气表品牌
255
- useradders: null,
256
- userinfo: {},
257
- getfield: {
258
- 'f_address': '地址',
259
- 'f_meternumber': '表号',
260
- 'f_gasbrand': '气表品牌',
261
- 'f_gasmodel': '气表型号',
262
- 'f_metertitles': '表封号',
263
- 'f_meter_base': '表读数',
264
- 'f_initial_base': '初始底数',
265
- 'f_aroundmeter': '表向',
266
- 'f_position': '安装位置',
267
- 'f_install_person': '安装人',
268
- 'f_install_date': '安装日期'
269
- }
270
- }
271
- },
272
- ready () {
273
- this.search()
274
- this.getMeterbrands()
275
- },
276
- methods: {
277
- // 追加表具
278
- addUserFile() {
279
- this.userinfo.userfiles.push({})
280
- },
281
- // 保存档案
282
- async saveUserFile() {
283
- let data = {
284
- user: this.$login.f,
285
- useradders: this.useradders,
286
- userinfo: this.userinfo,
287
- selectdata: this.selectdata
288
- }
289
- let res = await this.$resetpost('rs/logic/addInstallationDetails', {data:data}, {
290
- resolveMsg: null,
291
- rejectMsg: '表具添加失败!!!'
292
- })
293
- this.$dispatch('breakControl', this.selectdata)
294
- },
295
- // 检查表号是否存在
296
- async meternumberValidate(i) {
297
- if (!this.userinfo.userfiles[i].f_gasbrand_id) {
298
- this.userinfo.userfiles[i].f_meternumber = ''
299
- this.$showAlert('请先选择气表品牌!!!', 'warning', 3000)
300
- return
301
- }
302
- if (this.userinfo.userfiles[i].f_gasbrand_id && this.userinfo.userfiles[i].f_meternumber) {
303
- let data = {
304
- f_meternumber: this.userinfo.userfiles[i].f_meternumber,
305
- f_gasbrand_id: this.userinfo.userfiles[i].f_gasbrand_id
306
- }
307
- if (this.userinfo.userfiles[i].f_userfiles_id) {
308
- data.f_userfiles_id = this.userinfo.userfiles[i].f_userfiles_id
309
- }
310
- let res = await this.$resetpost('rs/logic/meterbrandsNumberValidate', {data:data}, {
311
- resolveMsg: null,
312
- rejectMsg: '表号验证失败!!'
313
- })
314
- if (res.data) {
315
- this.userinfo.userfiles[i].f_meternumber = ''
316
- this.$showAlert('表号已存在!!', 'warning', 3000)
317
- }
318
- }
319
- },
320
- // 选择气表型号
321
- gasmodelChange(i) {
322
- if (this.userinfo.userfiles[i].gasmodel) {
323
- this.userinfo.userfiles[i].f_gasmodel_id = this.userinfo.userfiles[i].gasmodel.id
324
- }
325
- },
326
- // 选择气表品牌
327
- gasbrandChange(i) {
328
- // 清空已保存的气表型号
329
- this.userinfo.userfiles[i].f_gasmodel_id = null
330
- this.userinfo.userfiles[i].gasmodel = null
331
-
332
- if (this.userinfo.userfiles[i].gasbrand) {
333
- // 气表品牌id
334
- this.userinfo.userfiles[i].f_gasbrand_id = this.userinfo.userfiles[i].gasbrand.id
335
- // 气表分类
336
- this.userinfo.userfiles[i].f_meter_classify = this.userinfo.userfiles[i].gasbrand.f_meter_type
337
- }
338
- },
339
- // 打开安装明细
340
- async showUserFileModal (row) {
341
- this.useradders = row
342
-
343
- let http = new HttpResetClass()
344
- let data = {
345
- condition: `f_userinfo_id = '${row.f_userinfo_id}'`
346
- }
347
- let res = await http.load('POST', 'rs/logic/getUserinfoAndUserfiles', {data:data}, {
348
- resolveMsg: null,
349
- rejectMsg: null
350
- })
351
-
352
- this.userinfo = res.data
353
-
354
- // 已有表具的 气表信息补充
355
- for (let i = 0; i < this.userinfo.userfiles.length; i++) {
356
- for (const item of this.meterbrands) {
357
- if (item.value.id === this.userinfo.userfiles[i].f_gasbrand_id) {
358
- // this.userinfo.userfiles[i].gasbrand = item.value // 防止双向绑定失败
359
- Vue.set(this.userinfo.userfiles[i], 'gasbrand', item.value)
360
- }
361
- }
362
- if (this.userinfo.userfiles[i].gasbrand) {
363
- for (const item of this.userinfo.userfiles[i].gasbrand.gasmodel) {
364
- if (item.value.id === this.userinfo.userfiles[i].f_gasmodel_id) {
365
- // this.userinfo.userfiles[i].gasmodel = item.value
366
- Vue.set(this.userinfo.userfiles[i], 'gasmodel', item.value)
367
- }
368
- }
369
- }
370
- }
371
-
372
- this.showUserFile = true
373
- },
374
- // 获取气表品牌
375
- async getMeterbrands() {
376
- let http = new HttpResetClass()
377
- let data = {
378
- f_orgid: this.$login.f.orgid,
379
- f_filialeid: this.$login.f.orgid
380
- }
381
- let res = await http.load('POST', 'rs/logic/getMeterbrands', {data:data}, {
382
- resolveMsg: null,
383
- rejectMsg: null
384
- })
385
- this.meterbrands = res.data
386
- },
387
- // 查询
388
- async search () {
389
- let http = new HttpResetClass()
390
- let data = {
391
- condition: " 1=1",
392
- f_process_id: this.selectdata.f_process_id
393
- }
394
- let res = await http.load('POST', 'rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
395
- resolveMsg: null,
396
- rejectMsg: null
397
- })
398
- this.model.data = res.data
399
- if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户集体报建') {
400
- let f_installed_households = 0
401
- for (const item of res.data) {
402
- if (item.f_userfiles_num > 0) {
403
- f_installed_households++
404
- }
405
- }
406
- let f_uninstalled_households = this.selectdata.f_apply_count - f_installed_households
407
- for (const item of this.selectdata.fields) {
408
- if (item.label === '已安装户数') {
409
- item.value = f_installed_households
410
- }
411
- if (item.label === '未安装户数') {
412
- item.value = f_uninstalled_households
413
- }
414
- }
415
- }
416
- },
417
- // 关闭安装明细
418
- closeUserFile() {
419
- this.showUserFile = false
420
- this.useradders = null
421
- this.userinfo = {}
422
- this.search()
423
- },
424
- // 关闭文件上传对话框
425
- closeFile() {
426
- this.showFile = false
427
- // 将选的文件清空
428
- this.$refs.file.$el.querySelector('input').value = ''
429
- this.search()
430
- }
431
- },
432
- events: {
433
- async 'onFileUpload'(file, result) {
434
- let data = {
435
- selectdata: this.selectdata,
436
- filepath: result.f_downloadpath,
437
- user: this.$login.f
438
- }
439
- let res = await this.$resetpost(`rs/logic/importAddInstallationDetails`, {data:data}, {resolveMsg: null, rejectMsg: '导入失败!!!', silent: true}, 0)
440
-
441
- this.$dispatch('breakControl', this.selectdata)
442
- }
443
- },
444
- computed: {
445
- getCondition () {
446
- let data = {
447
- f_process_id: this.selectdata.f_process_id
448
- }
449
- return data
450
- },
451
- // 安装人
452
- installperson() {
453
- return this.$login.f.f_installman.map(item => {
454
- return {
455
- label: item.name,
456
- value: item.name
457
- }
458
- })
459
- },
460
- // 表向
461
- aroundmeters() {
462
- return this.$appdata.getParam('左右表')
463
- },
464
- // 安装位置
465
- positions() {
466
- return this.$appdata.getParam('安装位置')
467
- }
468
- },
469
- watch: {
470
- }
471
- }
472
- </script>
473
- <style scoped>
474
- .head-but{
475
- margin-left: 5px;
476
- height: 34px;
477
- /*background-color: #6aa6e2;*/
478
- border-radius: 4px;
479
- font-family: PingFang;
480
- color: #ffffff;
481
- }
482
- /*清除model中的浮动*/
483
- .clearfix:after,.clearfix:before{
484
- display: table;
485
- }
486
- .clearfix:after{
487
- clear: both;
488
- }
489
- </style>
1
+ <template>
2
+ <div class="col-sm-12" style="margin: 20px 0px;">
3
+ <data-grid :model="model" v-ref:grid class="list_area table_sy" style="padding: 0px">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th>序号</th>
7
+ <th>客户编号</th>
8
+ <th>客户名称</th>
9
+ <th>客户电话</th>
10
+ <th>地址信息</th>
11
+ <th v-if="selectdata.f_apply_type !== '开发商集体报建'">是否结清</th>
12
+ <th>表具数量</th>
13
+ <th>
14
+ <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
15
+ @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
16
+ <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
17
+ href="/apply/download/excel/v3报装表具批量导入.xlsx" download>模板下载</a>
18
+ <export-excel :data="$parent.$parent.getCondition"
19
+ :field="$parent.$parent.getfield"
20
+ sqlurl="rs/logic/applyExportfile"
21
+ sql-name="getInstallableAddress"
22
+ template-name='可安装地址'
23
+ btn-name="导出可安装"
24
+ :choose-col="true"></export-excel>
25
+ </th>
26
+ </tr>
27
+ </template>
28
+ <template partial='body'>
29
+ <tr>
30
+ <td style="text-align: center;">
31
+ <nobr>{{$index+1}}</nobr>
32
+ </td>
33
+ <td style="text-align: center;">
34
+ <nobr>{{row.f_userinfo_code}}</nobr>
35
+ </td>
36
+ <td style="text-align: center;">
37
+ <nobr>{{row.f_user_name}}</nobr>
38
+ </td>
39
+ <td style="text-align: center;">
40
+ <nobr>{{row.f_user_phone}}</nobr>
41
+ </td>
42
+ <td style="text-align: center;">
43
+ <nobr>{{row.f_address}}</nobr>
44
+ </td>
45
+ <td style="text-align: center;" v-if="selectdata.f_apply_type !== '开发商集体报建'">
46
+ <nobr>{{row.f_cumulative_payment_money < $parent.$parent.selectdata.f_price ? '否' : '是'}}</nobr>
47
+ </td>
48
+ <td style="text-align: center;">
49
+ <nobr>{{row.f_userfiles_num === null ? 0 : row.f_userfiles_num}}</nobr>
50
+ </td>
51
+ <td style="text-align: center;">
52
+ <nobr>
53
+ <button
54
+ type="button" name="button" class="btn btn-link"
55
+ :disabled="row.f_cumulative_payment_money < $parent.$parent.selectdata.f_price && selectdata.f_apply_type !== '开发商集体报建'"
56
+ @click="$parent.$parent.showUserFileModal(row)">
57
+ {{$parent.$parent.mark === 1 ? '查看' : row.f_userfiles_num > 0 ? '修正' : '添加'}}
58
+ </button>
59
+ </nobr>
60
+ </td>
61
+ </tr>
62
+ </template>
63
+ </data-grid>
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="确定" multiple v-ref:file></file-upload>
73
+ </div>
74
+ </article>
75
+ <footer slot="modal-footer" class="modal-footer"></footer>
76
+ </modal>
77
+
78
+ <validator name="v">
79
+ <modal v-if="showUserFile" :show.sync="showUserFile" v-ref:modal :large="true" :backdrop="false" title="安装明细">
80
+ <header slot="modal-header" class="modal-header">
81
+ <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
82
+ <h4 class="modal-title">安装明细</h4>
83
+ </header>
84
+ <article slot="modal-body" class="modal-body clearfix">
85
+ <div class="form-group col-sm-12">
86
+ <label class="col-sm-2 control-label">地址信息:</label>
87
+ <div class="col-sm-10">
88
+ <input class="form-control input_view" style=""
89
+ v-model="useradders.f_address"
90
+ :value="useradders.f_address"
91
+ :readonly="true"/>
92
+ </div>
93
+ </div>
94
+
95
+ <div v-for="(i, item) in userinfo.userfiles" class="form-group col-sm-12 panel panel-info">
96
+ <div class="panel-heading head" style="background-color: #e8f4ff;margin-bottom: 10px">表具{{$index+1}}信息</div>
97
+ <div class="form-group col-sm-6" :class="[$v.gasbrand.required ? 'has-error' : '']">
98
+ <label class="col-sm-4 control-label">气表品牌:</label>
99
+ <div class="col-sm-8">
100
+ <input type="text" v-show="false" v-model="item.gasbrand.id" v-validate:gasbrand = "['required']" >
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="[$v.gasmodel.required ? 'has-error' : '']">
112
+ <label class="col-sm-4 control-label">气表型号:</label>
113
+ <div class="col-sm-8">
114
+ <input type="text" v-show="false" v-model="item.gasmodel.f_meter_style" :value.sync="item.gasmodel.f_meter_style" v-validate:gasmodel = "['required']" >
115
+ <input-select
116
+ class="select select_list"
117
+ :value.sync="item.gasmodel"
118
+ v-model="item.gasmodel"
119
+ :options.sync="item.gasbrand.gasmodel"
120
+ @change="gasmodelChange(i)"
121
+ :disable="mark === 1"
122
+ :valueSingle="true"></input-select>
123
+ </div>
124
+ </div>
125
+ <div class="form-group col-sm-6" :class="[$v.f_meternumber.required ? 'has-error' : '']">
126
+ <label class="col-sm-4 control-label">表号:</label>
127
+ <div class="col-sm-8">
128
+ <input class="form-control input_view" style=""
129
+ placeholder="表号"
130
+ v-validate:f_meternumber = "['required']"
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">表读数:</label>
149
+ <div class="col-sm-8">
150
+ <input class="form-control input_view" style=""
151
+ type="number"
152
+ placeholder="表读数"
153
+ v-model="item.f_meter_base"
154
+ :value="item.f_meter_base"
155
+ :readonly="mark === 1"/>
156
+ </div>
157
+ </div>
158
+ <div class="form-group col-sm-6">
159
+ <label class="col-sm-4 control-label">初始底数:</label>
160
+ <div class="col-sm-8">
161
+ <input class="form-control input_view" style=""
162
+ type="number"
163
+ v-model="item.f_initial_base"
164
+ :value="item.f_initial_base"
165
+ placeholder="初始底数"
166
+ :readonly="mark === 1"/>
167
+ </div>
168
+ </div>
169
+ <div class="form-group col-sm-6">
170
+ <label class="col-sm-4 control-label">表向:</label>
171
+ <div class="col-sm-8">
172
+ <input-select
173
+ class="select select_list"
174
+ :value.sync="item.f_aroundmeter"
175
+ v-model="item.f_aroundmeter"
176
+ :options="aroundmeters"
177
+ :disable="mark === 1"
178
+ :valueSingle="true"></input-select>
179
+ </div>
180
+ </div>
181
+ <div class="form-group col-sm-6">
182
+ <label class="col-sm-4 control-label">安装位置:</label>
183
+ <div class="col-sm-8">
184
+ <input-select
185
+ class="select select_list"
186
+ :value.sync="item.f_position"
187
+ v-model="item.f_position"
188
+ :options="positions"
189
+ :disable="mark === 1"
190
+ :valueSingle="true"></input-select>
191
+ </div>
192
+ </div>
193
+ <div class="form-group col-sm-6">
194
+ <label class="col-sm-4 control-label">安装人:</label>
195
+ <div class="col-sm-8">
196
+ <input-select
197
+ class="select select_list"
198
+ :value.sync="item.f_install_person"
199
+ v-model="item.f_install_person"
200
+ :options="installperson"
201
+ :disable="mark === 1"
202
+ :valueSingle="true"></input-select>
203
+ </div>
204
+ </div>
205
+ <div class="form-group col-sm-6">
206
+ <label class="col-sm-4 control-label">安装日期:</label>
207
+ <div class="col-sm-8">
208
+ <datepicker
209
+ placeholder="安装日期"
210
+ :value.sync="item.f_install_date"
211
+ v-model="item.f_install_date"
212
+ format="yyyy-MM-dd HH:mm:ss"
213
+ :disabled="mark === 1"
214
+ :show-reset-button="reset">
215
+ </datepicker>
216
+ </div>
217
+ </div>
218
+ </div>
219
+
220
+ </article>
221
+ <footer slot="modal-footer" class="modal-footer">
222
+ <!-- 去除一户多表 -->
223
+ <button type="button" class="btn btn-primary" @click="addUserFile" v-if="false">添加表具</button>
224
+ <button type="button" class="btn btn-primary" @click="saveUserFile" :disabled="!$v.valid">确认</button>
225
+ </footer>
226
+ </modal>
227
+ </validator>
228
+ </template>
229
+ <script>
230
+ import Vue from 'vue'
231
+ import {PagedList} from 'vue-client'
232
+ import {HttpResetClass} from 'vue-client'
233
+ import {isEmpty} from '../../../Util'
234
+
235
+ export default {
236
+ title: '安装明细',
237
+ props: {
238
+ selectdata: {
239
+ type: Object
240
+ },
241
+ mark: {
242
+ type: Number,
243
+ default: 0
244
+ }
245
+ },
246
+ data () {
247
+ return {
248
+ showFile: false,
249
+ showUserFile: false,
250
+ model: {
251
+ data: null
252
+ },
253
+ meterbrands: [], // 气表品牌
254
+ useradders: null,
255
+ userinfo: {},
256
+ getfield: {
257
+ 'f_address': '地址',
258
+ 'f_meternumber': '表号',
259
+ 'f_gasbrand': '气表品牌',
260
+ 'f_gasmodel': '气表型号',
261
+ 'f_metertitles': '表封号',
262
+ 'f_meter_base': '表读数',
263
+ 'f_initial_base': '初始底数',
264
+ 'f_aroundmeter': '表向',
265
+ 'f_position': '安装位置',
266
+ 'f_install_person': '安装人',
267
+ 'f_install_date': '安装日期'
268
+ }
269
+ }
270
+ },
271
+ ready () {
272
+ this.search()
273
+ this.getMeterbrands()
274
+ },
275
+ methods: {
276
+ // 追加表具
277
+ addUserFile() {
278
+ this.userinfo.userfiles.push({})
279
+ },
280
+ // 保存档案
281
+ async saveUserFile() {
282
+ console.log("当前表具信息",this.userinfo.userfiles[0])
283
+ if ((this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋集中器' ||
284
+ this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋4G物联网表' ||
285
+ this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋NB物联网表') &&
286
+ !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[0].f_meternumber))
287
+ {
288
+ this.$showAlert('请输入10位表号!!!', 'warning', 2000)
289
+ return
290
+ }
291
+ let data = {
292
+ user: this.$login.f,
293
+ useradders: this.useradders,
294
+ userinfo: this.userinfo,
295
+ selectdata: this.selectdata
296
+ }
297
+ let res = await this.$resetpost('rs/logic/addInstallationDetails', {data:data}, {
298
+ resolveMsg: null,
299
+ rejectMsg: '表具添加失败!!!'
300
+ })
301
+ this.$dispatch('breakControl', this.selectdata)
302
+ },
303
+ // 检查表号是否存在
304
+ async meternumberValidate(i) {
305
+ if (!this.userinfo.userfiles[i].f_gasbrand_id) {
306
+ this.userinfo.userfiles[i].f_meternumber = ''
307
+ this.$showAlert('请先选择气表品牌!!!', 'warning', 2000)
308
+ return
309
+ }
310
+ if ((this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋集中器' ||
311
+ this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋4G物联网表' ||
312
+ this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋NB物联网表') &&
313
+ !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[i].f_meternumber))
314
+ {
315
+ this.$showAlert('请输入10位表号!!!', 'warning', 2000)
316
+ return
317
+ }
318
+ if (this.userinfo.userfiles[i].f_gasbrand_id && this.userinfo.userfiles[i].f_meternumber) {
319
+ let data = {
320
+ f_meternumber: this.userinfo.userfiles[i].f_meternumber,
321
+ f_gasbrand_id: this.userinfo.userfiles[i].f_gasbrand_id
322
+ }
323
+ if (this.userinfo.userfiles[i].f_userfiles_id) {
324
+ data.f_userfiles_id = this.userinfo.userfiles[i].f_userfiles_id
325
+ }
326
+ let res = await this.$resetpost('rs/logic/meterbrandsNumberValidate', {data:data}, {
327
+ resolveMsg: null,
328
+ rejectMsg: '表号验证失败!!'
329
+ })
330
+ if (res.data) {
331
+ this.userinfo.userfiles[i].f_meternumber = ''
332
+ this.$showAlert('表号已存在!!', 'warning', 3000)
333
+ }
334
+ }
335
+ },
336
+ // 选择气表型号
337
+ gasmodelChange(i) {
338
+ if (this.userinfo.userfiles[i].gasmodel) {
339
+ this.userinfo.userfiles[i].f_gasmodel_id = this.userinfo.userfiles[i].gasmodel.id
340
+ }
341
+ },
342
+ // 选择气表品牌
343
+ gasbrandChange(i) {
344
+ // 清空已保存的气表型号
345
+ this.userinfo.userfiles[i].f_gasmodel_id = null
346
+ this.userinfo.userfiles[i].gasmodel = null
347
+
348
+ if (this.userinfo.userfiles[i].gasbrand) {
349
+ // 气表品牌id
350
+ this.userinfo.userfiles[i].f_gasbrand_id = this.userinfo.userfiles[i].gasbrand.id
351
+ // 气表分类
352
+ this.userinfo.userfiles[i].f_meter_classify = this.userinfo.userfiles[i].gasbrand.f_meter_type
353
+ }
354
+ },
355
+ // 打开安装明细
356
+ async showUserFileModal (row) {
357
+ this.useradders = row
358
+
359
+ let http = new HttpResetClass()
360
+ let data = {
361
+ condition: `f_userinfo_id = '${row.f_userinfo_id}'`
362
+ }
363
+ let res = await http.load('POST', 'rs/logic/getUserinfoAndUserfiles', {data:data}, {
364
+ resolveMsg: null,
365
+ rejectMsg: null
366
+ })
367
+
368
+ this.userinfo = res.data
369
+
370
+ // 已有表具的 气表信息补充
371
+ for (let i = 0; i < this.userinfo.userfiles.length; i++) {
372
+ for (const item of this.meterbrands) {
373
+ if (item.value.id === this.userinfo.userfiles[i].f_gasbrand_id) {
374
+ // this.userinfo.userfiles[i].gasbrand = item.value // 防止双向绑定失败
375
+ Vue.set(this.userinfo.userfiles[i], 'gasbrand', item.value)
376
+ }
377
+ }
378
+ if (this.userinfo.userfiles[i].gasbrand) {
379
+ for (const item of this.userinfo.userfiles[i].gasbrand.gasmodel) {
380
+ if (item.value.id === this.userinfo.userfiles[i].f_gasmodel_id) {
381
+ // this.userinfo.userfiles[i].gasmodel = item.value
382
+ Vue.set(this.userinfo.userfiles[i], 'gasmodel', item.value)
383
+ }
384
+ }
385
+ }
386
+ }
387
+ console.log("表具信息",this.userinfo.userfiles)
388
+ this.showUserFile = true
389
+ },
390
+ // 获取气表品牌
391
+ async getMeterbrands() {
392
+ let http = new HttpResetClass()
393
+ let data = {
394
+ f_orgid: this.$login.f.orgid,
395
+ f_filialeid: this.$login.f.orgid
396
+ }
397
+ let res = await http.load('POST', 'rs/logic/getMeterbrands', {data:data}, {
398
+ resolveMsg: null,
399
+ rejectMsg: null
400
+ })
401
+ this.meterbrands = res.data
402
+ },
403
+ // 查询
404
+ async search () {
405
+ let http = new HttpResetClass()
406
+ let data = {
407
+ condition: " 1=1",
408
+ f_process_id: this.selectdata.f_process_id
409
+ }
410
+ let res = await http.load('POST', 'rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
411
+ resolveMsg: null,
412
+ rejectMsg: null
413
+ })
414
+ this.model.data = res.data
415
+ if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户集体报建') {
416
+ let f_installed_households = 0
417
+ for (const item of res.data) {
418
+ if (item.f_userfiles_num > 0) {
419
+ f_installed_households++
420
+ }
421
+ }
422
+ let f_uninstalled_households = this.selectdata.f_apply_count - f_installed_households
423
+ for (const item of this.selectdata.fields) {
424
+ if (item.label === '已安装户数') {
425
+ item.value = f_installed_households
426
+ }
427
+ if (item.label === '未安装户数') {
428
+ item.value = f_uninstalled_households
429
+ }
430
+ }
431
+ }
432
+ },
433
+ // 关闭安装明细
434
+ closeUserFile() {
435
+ this.showUserFile = false
436
+ this.useradders = null
437
+ this.userinfo = {}
438
+ this.search()
439
+ },
440
+ // 关闭文件上传对话框
441
+ closeFile() {
442
+ this.showFile = false
443
+ // 将选的文件清空
444
+ this.$refs.file.$el.querySelector('input').value = ''
445
+ this.search()
446
+ }
447
+ },
448
+ events: {
449
+ async 'onFileUpload'(file, result) {
450
+ let data = {
451
+ selectdata: this.selectdata,
452
+ filepath: result.f_downloadpath,
453
+ user: this.$login.f
454
+ }
455
+ let res = await this.$resetpost(`rs/logic/importAddInstallationDetails`, {data:data}, {resolveMsg: null, rejectMsg: '导入失败!!!', silent: true}, 0)
456
+
457
+ this.$dispatch('breakControl', this.selectdata)
458
+ }
459
+ },
460
+ computed: {
461
+ getCondition () {
462
+ let data = {
463
+ f_process_id: this.selectdata.f_process_id
464
+ }
465
+ return data
466
+ },
467
+ // 安装人
468
+ installperson() {
469
+ return this.$login.f.f_installman.map(item => {
470
+ return {
471
+ label: item.name,
472
+ value: item.name
473
+ }
474
+ })
475
+ },
476
+ // 表向
477
+ aroundmeters() {
478
+ return this.$appdata.getParam('左右表')
479
+ },
480
+ // 安装位置
481
+ positions() {
482
+ return this.$appdata.getParam('安装位置')
483
+ }
484
+ },
485
+ watch: {
486
+ }
487
+ }
488
+ </script>
489
+ <style scoped>
490
+ .head-but{
491
+ margin-left: 5px;
492
+ height: 34px;
493
+ /*background-color: #6aa6e2;*/
494
+ border-radius: 4px;
495
+ font-family: PingFang;
496
+ color: #ffffff;
497
+ }
498
+ /*清除model中的浮动*/
499
+ .clearfix:after,.clearfix:before{
500
+ display: table;
501
+ }
502
+ .clearfix:after{
503
+ clear: both;
504
+ }
505
+ </style>