apply-clients 4.1.63-weinan → 4.1.64-weinan

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.
Files changed (31) hide show
  1. package/index.html +30 -30
  2. package/package.json +1 -1
  3. package/src/apply.js +81 -81
  4. package/src/applyAndroid.js +52 -52
  5. package/src/components/app_apply/AppChargeManagement.vue +753 -749
  6. package/src/components/app_apply/AppInstallationDetails.vue +529 -529
  7. package/src/components/app_apply/AppProcessSupervisory.vue +214 -214
  8. package/src/components/app_apply/AppSupervisoryCart.vue +68 -68
  9. package/src/components/app_apply/AppTakePic.vue +146 -146
  10. package/src/components/app_apply/AppdevicesDetails.vue +867 -867
  11. package/src/components/app_apply/ApplyInfo.vue +56 -56
  12. package/src/components/app_apply/ApplyToDoList.vue +292 -292
  13. package/src/components/app_apply/PlaceControler.vue +274 -274
  14. package/src/components/app_apply/ServiceControl.vue +440 -440
  15. package/src/components/app_apply/ServiceView.vue +394 -394
  16. package/src/components/app_apply/materialshoufei.vue +248 -248
  17. package/src/components/product/ApplyCharge/ApplyChargeList.vue +252 -252
  18. package/src/components/product/Process/ExplorationSelect.vue +377 -377
  19. package/src/components/product/Process/ExplorationUser.vue +134 -134
  20. package/src/components/product/Process/Processes/InstallationDetails.vue +515 -515
  21. package/src/components/product/Process/Processes/chargeManagement.vue +545 -545
  22. package/src/components/product/Process/Processes/devicesDetails.vue +843 -843
  23. package/src/components/product/Process/Processes/materialshoufei.vue +187 -187
  24. package/src/components/product/Process/Service/ServiceControl.vue +1490 -1490
  25. package/src/components/product/Stop/StopApply.vue +101 -101
  26. package/src/components/product/Stop/StopApplyList.vue +266 -266
  27. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +200 -200
  28. package/src/components/product/Supervisory/SupervisoryControl.vue +124 -124
  29. package/src/components/product/Supervisory/SupervisoryList.vue +221 -221
  30. package/src/components/product/VueUtils/ApplyUpload.vue +276 -276
  31. package/src/main.js +25 -25
@@ -1,515 +1,515 @@
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="installpersons"
201
- :disable="mark === 1"
202
- :valueSingle="true"></input-select>
203
- </div>
204
- </div>-->
205
- <div class="form-group col-sm-6" :class="[$v.f_install_date.required ? 'has-error' : '']">
206
- <label class="col-sm-4 control-label">安装日期:</label>
207
- <div class="col-sm-8">
208
- <input type="text" v-show="false" v-model="item.f_install_date" :value.sync="item.f_install_date" v-validate:f_install_date = "['required']" >
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
- installpersons:[],
258
- getfield: {
259
- 'f_address': '地址',
260
- 'f_meternumber': '表号',
261
- 'f_gasbrand': '气表品牌',
262
- 'f_gasmodel': '气表型号',
263
- 'f_metertitles': '表封号',
264
- 'f_meter_base': '表读数',
265
- 'f_initial_base': '初始底数',
266
- 'f_aroundmeter': '表向',
267
- 'f_position': '安装位置',
268
- 'f_install_person': '安装人',
269
- 'f_install_date': '安装日期'
270
- }
271
- }
272
- },
273
- ready () {
274
- this.search()
275
- this.getMeterbrands()
276
- this.installperson()
277
- },
278
- methods: {
279
- // 追加表具
280
- addUserFile() {
281
- this.userinfo.userfiles.push({})
282
- },
283
- // 保存档案
284
- async saveUserFile() {
285
- console.log("当前表具信息",this.userinfo.userfiles[0])
286
- if ((this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋集中器' ||
287
- this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋4G物联网表' ||
288
- this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋NB物联网表') &&
289
- !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[0].f_meternumber))
290
- {
291
- this.$showAlert('请输入10位表号!!!', 'warning', 2000)
292
- return
293
- }
294
- let data = {
295
- user: this.$login.f,
296
- useradders: this.useradders,
297
- userinfo: this.userinfo,
298
- selectdata: this.selectdata
299
- }
300
- let res = await this.$resetpost('rs/logic/addInstallationDetails', {data:data}, {
301
- resolveMsg: null,
302
- rejectMsg: '表具添加失败!!!'
303
- })
304
- this.showUserFile = false
305
- this.search()
306
- },
307
- // 检查表号是否存在
308
- async meternumberValidate(i) {
309
- if (!this.userinfo.userfiles[i].f_gasbrand_id) {
310
- this.userinfo.userfiles[i].f_meternumber = ''
311
- this.$showAlert('请先选择气表品牌!!!', 'warning', 2000)
312
- return
313
- }
314
- if ((this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋集中器' ||
315
- this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋4G物联网表' ||
316
- this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋NB物联网表') &&
317
- !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[i].f_meternumber))
318
- {
319
- this.$showAlert('请输入10位表号!!!', 'warning', 2000)
320
- return
321
- }
322
- if (this.userinfo.userfiles[i].f_gasbrand_id && this.userinfo.userfiles[i].f_meternumber) {
323
- let data = {
324
- f_meternumber: this.userinfo.userfiles[i].f_meternumber,
325
- f_gasbrand_id: this.userinfo.userfiles[i].f_gasbrand_id
326
- }
327
- if (this.userinfo.userfiles[i].f_userfiles_id) {
328
- data.f_userfiles_id = this.userinfo.userfiles[i].f_userfiles_id
329
- }
330
- let res = await this.$resetpost('rs/logic/meterbrandsNumberValidate', {data:data}, {
331
- resolveMsg: null,
332
- rejectMsg: '表号验证失败!!'
333
- })
334
- if (res.data) {
335
- this.userinfo.userfiles[i].f_meternumber = ''
336
- this.$showAlert('表号已存在!!', 'warning', 3000)
337
- }
338
- }
339
- },
340
- // 选择气表型号
341
- gasmodelChange(i) {
342
- if (this.userinfo.userfiles[i].gasmodel) {
343
- this.userinfo.userfiles[i].f_gasmodel_id = this.userinfo.userfiles[i].gasmodel.id
344
- }
345
- },
346
- // 选择气表品牌
347
- gasbrandChange(i) {
348
- // 清空已保存的气表型号
349
- this.userinfo.userfiles[i].f_gasmodel_id = null
350
- this.userinfo.userfiles[i].gasmodel = null
351
-
352
- if (this.userinfo.userfiles[i].gasbrand) {
353
- // 气表品牌id
354
- this.userinfo.userfiles[i].f_gasbrand_id = this.userinfo.userfiles[i].gasbrand.id
355
- // 气表分类
356
- this.userinfo.userfiles[i].f_meter_classify = this.userinfo.userfiles[i].gasbrand.f_meter_type
357
- }
358
- },
359
- // 打开安装明细
360
- async showUserFileModal (row) {
361
- this.useradders = row
362
-
363
- let http = new HttpResetClass()
364
- let data = {
365
- condition: `f_userinfo_id = '${row.f_userinfo_id}'`
366
- }
367
- let res = await http.load('POST', 'rs/logic/getUserinfoAndUserfiles', {data:data}, {
368
- resolveMsg: null,
369
- rejectMsg: null
370
- })
371
-
372
- this.userinfo = res.data
373
-
374
- // 已有表具的 气表信息补充
375
- for (let i = 0; i < this.userinfo.userfiles.length; i++) {
376
- for (const item of this.meterbrands) {
377
- if (item.value.id === this.userinfo.userfiles[i].f_gasbrand_id) {
378
- // this.userinfo.userfiles[i].gasbrand = item.value // 防止双向绑定失败
379
- Vue.set(this.userinfo.userfiles[i], 'gasbrand', item.value)
380
- }
381
- }
382
- if (this.userinfo.userfiles[i].gasbrand) {
383
- for (const item of this.userinfo.userfiles[i].gasbrand.gasmodel) {
384
- if (item.value.id === this.userinfo.userfiles[i].f_gasmodel_id) {
385
- // this.userinfo.userfiles[i].gasmodel = item.value
386
- Vue.set(this.userinfo.userfiles[i], 'gasmodel', item.value)
387
- }
388
- }
389
- }
390
- }
391
- console.log("表具信息",this.userinfo.userfiles)
392
- this.showUserFile = true
393
- },
394
- // 获取气表品牌
395
- async getMeterbrands() {
396
- let http = new HttpResetClass()
397
- let data = {
398
- f_orgid: this.$login.f.orgid,
399
- f_filialeid: this.$login.f.orgid
400
- }
401
- let res = await http.load('POST', 'rs/logic/getMeterbrands', {data:data}, {
402
- resolveMsg: null,
403
- rejectMsg: null
404
- })
405
- this.meterbrands = res.data
406
- },
407
- // 查询
408
- async search () {
409
- let http = new HttpResetClass()
410
- let data = {
411
- condition: " 1=1",
412
- f_process_id: this.selectdata.f_process_id
413
- }
414
- let res = await http.load('POST', 'rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
415
- resolveMsg: null,
416
- rejectMsg: null
417
- })
418
- this.model.data = res.data
419
- if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户集体报建') {
420
- let f_installed_households = 0
421
- for (const item of res.data) {
422
- if (item.f_userfiles_num > 0) {
423
- f_installed_households++
424
- }
425
- }
426
- let f_uninstalled_households = this.selectdata.f_apply_count - f_installed_households
427
- for (const item of this.selectdata.fields) {
428
- if (item.label === '已安装户数') {
429
- item.value = f_installed_households
430
- }
431
- if (item.label === '未安装户数') {
432
- item.value = f_uninstalled_households
433
- }
434
- }
435
- }
436
- },
437
- // 安装人
438
- async installperson() {
439
- let http = new HttpResetClass()
440
- let res = await http.load('POST', 'rs/search', {
441
- source: "this.getParentByType($organization$).getChildByName($安全员$).getChildren()",
442
- userid: this.$login.f.id
443
- }, {resolveMsg: null, rejectMsg: null})
444
-
445
- this.installpersons = res.data.map(item =>{
446
- return {
447
- label: item.name,
448
- value: item.name
449
- }
450
- })
451
- },
452
- // 关闭安装明细
453
- closeUserFile() {
454
- this.showUserFile = false
455
- this.useradders = null
456
- this.userinfo = {}
457
- this.search()
458
- },
459
- // 关闭文件上传对话框
460
- closeFile() {
461
- this.showFile = false
462
- // 将选的文件清空
463
- this.$refs.file.$el.querySelector('input').value = ''
464
- this.search()
465
- }
466
- },
467
- events: {
468
- async 'onFileUpload'(file, result) {
469
- let data = {
470
- selectdata: this.selectdata,
471
- filepath: result.f_downloadpath,
472
- user: this.$login.f
473
- }
474
- let res = await this.$resetpost(`rs/logic/importAddInstallationDetails`, {data:data}, {resolveMsg: null, rejectMsg: '导入失败!!!', silent: true}, 0)
475
-
476
- this.$dispatch('breakControl', this.selectdata)
477
- }
478
- },
479
- computed: {
480
- getCondition () {
481
- let data = {
482
- f_process_id: this.selectdata.f_process_id
483
- }
484
- return data
485
- },
486
- // 表向
487
- aroundmeters() {
488
- return this.$appdata.getParam('左右表')
489
- },
490
- // 安装位置
491
- positions() {
492
- return this.$appdata.getParam('安装位置')
493
- }
494
- },
495
- watch: {
496
- }
497
- }
498
- </script>
499
- <style scoped>
500
- .head-but{
501
- margin-left: 5px;
502
- height: 34px;
503
- /*background-color: #6aa6e2;*/
504
- border-radius: 4px;
505
- font-family: PingFang;
506
- color: #ffffff;
507
- }
508
- /*清除model中的浮动*/
509
- .clearfix:after,.clearfix:before{
510
- display: table;
511
- }
512
- .clearfix:after{
513
- clear: both;
514
- }
515
- </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="installpersons"
201
+ :disable="mark === 1"
202
+ :valueSingle="true"></input-select>
203
+ </div>
204
+ </div>-->
205
+ <div class="form-group col-sm-6" :class="[$v.f_install_date.required ? 'has-error' : '']">
206
+ <label class="col-sm-4 control-label">安装日期:</label>
207
+ <div class="col-sm-8">
208
+ <input type="text" v-show="false" v-model="item.f_install_date" :value.sync="item.f_install_date" v-validate:f_install_date = "['required']" >
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
+ installpersons:[],
258
+ getfield: {
259
+ 'f_address': '地址',
260
+ 'f_meternumber': '表号',
261
+ 'f_gasbrand': '气表品牌',
262
+ 'f_gasmodel': '气表型号',
263
+ 'f_metertitles': '表封号',
264
+ 'f_meter_base': '表读数',
265
+ 'f_initial_base': '初始底数',
266
+ 'f_aroundmeter': '表向',
267
+ 'f_position': '安装位置',
268
+ 'f_install_person': '安装人',
269
+ 'f_install_date': '安装日期'
270
+ }
271
+ }
272
+ },
273
+ ready () {
274
+ this.search()
275
+ this.getMeterbrands()
276
+ this.installperson()
277
+ },
278
+ methods: {
279
+ // 追加表具
280
+ addUserFile() {
281
+ this.userinfo.userfiles.push({})
282
+ },
283
+ // 保存档案
284
+ async saveUserFile() {
285
+ console.log("当前表具信息",this.userinfo.userfiles[0])
286
+ if ((this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋集中器' ||
287
+ this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋4G物联网表' ||
288
+ this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋NB物联网表') &&
289
+ !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[0].f_meternumber))
290
+ {
291
+ this.$showAlert('请输入10位表号!!!', 'warning', 2000)
292
+ return
293
+ }
294
+ let data = {
295
+ user: this.$login.f,
296
+ useradders: this.useradders,
297
+ userinfo: this.userinfo,
298
+ selectdata: this.selectdata
299
+ }
300
+ let res = await this.$resetpost('rs/logic/addInstallationDetails', {data:data}, {
301
+ resolveMsg: null,
302
+ rejectMsg: '表具添加失败!!!'
303
+ })
304
+ this.showUserFile = false
305
+ this.search()
306
+ },
307
+ // 检查表号是否存在
308
+ async meternumberValidate(i) {
309
+ if (!this.userinfo.userfiles[i].f_gasbrand_id) {
310
+ this.userinfo.userfiles[i].f_meternumber = ''
311
+ this.$showAlert('请先选择气表品牌!!!', 'warning', 2000)
312
+ return
313
+ }
314
+ if ((this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋集中器' ||
315
+ this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋4G物联网表' ||
316
+ this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋NB物联网表') &&
317
+ !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[i].f_meternumber))
318
+ {
319
+ this.$showAlert('请输入10位表号!!!', 'warning', 2000)
320
+ return
321
+ }
322
+ if (this.userinfo.userfiles[i].f_gasbrand_id && this.userinfo.userfiles[i].f_meternumber) {
323
+ let data = {
324
+ f_meternumber: this.userinfo.userfiles[i].f_meternumber,
325
+ f_gasbrand_id: this.userinfo.userfiles[i].f_gasbrand_id
326
+ }
327
+ if (this.userinfo.userfiles[i].f_userfiles_id) {
328
+ data.f_userfiles_id = this.userinfo.userfiles[i].f_userfiles_id
329
+ }
330
+ let res = await this.$resetpost('rs/logic/meterbrandsNumberValidate', {data:data}, {
331
+ resolveMsg: null,
332
+ rejectMsg: '表号验证失败!!'
333
+ })
334
+ if (res.data) {
335
+ this.userinfo.userfiles[i].f_meternumber = ''
336
+ this.$showAlert('表号已存在!!', 'warning', 3000)
337
+ }
338
+ }
339
+ },
340
+ // 选择气表型号
341
+ gasmodelChange(i) {
342
+ if (this.userinfo.userfiles[i].gasmodel) {
343
+ this.userinfo.userfiles[i].f_gasmodel_id = this.userinfo.userfiles[i].gasmodel.id
344
+ }
345
+ },
346
+ // 选择气表品牌
347
+ gasbrandChange(i) {
348
+ // 清空已保存的气表型号
349
+ this.userinfo.userfiles[i].f_gasmodel_id = null
350
+ this.userinfo.userfiles[i].gasmodel = null
351
+
352
+ if (this.userinfo.userfiles[i].gasbrand) {
353
+ // 气表品牌id
354
+ this.userinfo.userfiles[i].f_gasbrand_id = this.userinfo.userfiles[i].gasbrand.id
355
+ // 气表分类
356
+ this.userinfo.userfiles[i].f_meter_classify = this.userinfo.userfiles[i].gasbrand.f_meter_type
357
+ }
358
+ },
359
+ // 打开安装明细
360
+ async showUserFileModal (row) {
361
+ this.useradders = row
362
+
363
+ let http = new HttpResetClass()
364
+ let data = {
365
+ condition: `f_userinfo_id = '${row.f_userinfo_id}'`
366
+ }
367
+ let res = await http.load('POST', 'rs/logic/getUserinfoAndUserfiles', {data:data}, {
368
+ resolveMsg: null,
369
+ rejectMsg: null
370
+ })
371
+
372
+ this.userinfo = res.data
373
+
374
+ // 已有表具的 气表信息补充
375
+ for (let i = 0; i < this.userinfo.userfiles.length; i++) {
376
+ for (const item of this.meterbrands) {
377
+ if (item.value.id === this.userinfo.userfiles[i].f_gasbrand_id) {
378
+ // this.userinfo.userfiles[i].gasbrand = item.value // 防止双向绑定失败
379
+ Vue.set(this.userinfo.userfiles[i], 'gasbrand', item.value)
380
+ }
381
+ }
382
+ if (this.userinfo.userfiles[i].gasbrand) {
383
+ for (const item of this.userinfo.userfiles[i].gasbrand.gasmodel) {
384
+ if (item.value.id === this.userinfo.userfiles[i].f_gasmodel_id) {
385
+ // this.userinfo.userfiles[i].gasmodel = item.value
386
+ Vue.set(this.userinfo.userfiles[i], 'gasmodel', item.value)
387
+ }
388
+ }
389
+ }
390
+ }
391
+ console.log("表具信息",this.userinfo.userfiles)
392
+ this.showUserFile = true
393
+ },
394
+ // 获取气表品牌
395
+ async getMeterbrands() {
396
+ let http = new HttpResetClass()
397
+ let data = {
398
+ f_orgid: this.$login.f.orgid,
399
+ f_filialeid: this.$login.f.orgid
400
+ }
401
+ let res = await http.load('POST', 'rs/logic/getMeterbrands', {data:data}, {
402
+ resolveMsg: null,
403
+ rejectMsg: null
404
+ })
405
+ this.meterbrands = res.data
406
+ },
407
+ // 查询
408
+ async search () {
409
+ let http = new HttpResetClass()
410
+ let data = {
411
+ condition: " 1=1",
412
+ f_process_id: this.selectdata.f_process_id
413
+ }
414
+ let res = await http.load('POST', 'rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
415
+ resolveMsg: null,
416
+ rejectMsg: null
417
+ })
418
+ this.model.data = res.data
419
+ if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户集体报建') {
420
+ let f_installed_households = 0
421
+ for (const item of res.data) {
422
+ if (item.f_userfiles_num > 0) {
423
+ f_installed_households++
424
+ }
425
+ }
426
+ let f_uninstalled_households = this.selectdata.f_apply_count - f_installed_households
427
+ for (const item of this.selectdata.fields) {
428
+ if (item.label === '已安装户数') {
429
+ item.value = f_installed_households
430
+ }
431
+ if (item.label === '未安装户数') {
432
+ item.value = f_uninstalled_households
433
+ }
434
+ }
435
+ }
436
+ },
437
+ // 安装人
438
+ async installperson() {
439
+ let http = new HttpResetClass()
440
+ let res = await http.load('POST', 'rs/search', {
441
+ source: "this.getParentByType($organization$).getChildByName($安全员$).getChildren()",
442
+ userid: this.$login.f.id
443
+ }, {resolveMsg: null, rejectMsg: null})
444
+
445
+ this.installpersons = res.data.map(item =>{
446
+ return {
447
+ label: item.name,
448
+ value: item.name
449
+ }
450
+ })
451
+ },
452
+ // 关闭安装明细
453
+ closeUserFile() {
454
+ this.showUserFile = false
455
+ this.useradders = null
456
+ this.userinfo = {}
457
+ this.search()
458
+ },
459
+ // 关闭文件上传对话框
460
+ closeFile() {
461
+ this.showFile = false
462
+ // 将选的文件清空
463
+ this.$refs.file.$el.querySelector('input').value = ''
464
+ this.search()
465
+ }
466
+ },
467
+ events: {
468
+ async 'onFileUpload'(file, result) {
469
+ let data = {
470
+ selectdata: this.selectdata,
471
+ filepath: result.f_downloadpath,
472
+ user: this.$login.f
473
+ }
474
+ let res = await this.$resetpost(`rs/logic/importAddInstallationDetails`, {data:data}, {resolveMsg: null, rejectMsg: '导入失败!!!', silent: true}, 0)
475
+
476
+ this.$dispatch('breakControl', this.selectdata)
477
+ }
478
+ },
479
+ computed: {
480
+ getCondition () {
481
+ let data = {
482
+ f_process_id: this.selectdata.f_process_id
483
+ }
484
+ return data
485
+ },
486
+ // 表向
487
+ aroundmeters() {
488
+ return this.$appdata.getParam('左右表')
489
+ },
490
+ // 安装位置
491
+ positions() {
492
+ return this.$appdata.getParam('安装位置')
493
+ }
494
+ },
495
+ watch: {
496
+ }
497
+ }
498
+ </script>
499
+ <style scoped>
500
+ .head-but{
501
+ margin-left: 5px;
502
+ height: 34px;
503
+ /*background-color: #6aa6e2;*/
504
+ border-radius: 4px;
505
+ font-family: PingFang;
506
+ color: #ffffff;
507
+ }
508
+ /*清除model中的浮动*/
509
+ .clearfix:after,.clearfix:before{
510
+ display: table;
511
+ }
512
+ .clearfix:after{
513
+ clear: both;
514
+ }
515
+ </style>