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