apply-clients 4.1.24-weinan → 4.1.25-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apply-clients",
3
- "version": "4.1.24-weinan",
3
+ "version": "4.1.25-weinan",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -41,4 +41,8 @@ export default function () {
41
41
  Vue.component('service-control-app', (resolve) => { require(['./components/app_apply/ServiceControl'], resolve) })
42
42
  // 公共业务显示(view层)页
43
43
  Vue.component('service-view-app', (resolve) => { require(['./components/app_apply/ServiceView'], resolve) })
44
+ // 表具信息
45
+ Vue.component('app-installation-details', (resolve) => { require(['./components/app_apply/AppInstallationDetails'], resolve) })
46
+ // 点火信息
47
+ Vue.component('app-devices-details', (resolve) => { require(['./components/app_apply/AppdevicesDetails'], resolve) })
44
48
  }
@@ -0,0 +1,512 @@
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" style="background-color: #e8f4ff;margin-bottom: 10px">表具{{$index+1}}信息</div>
98
+ <div class="form-group col-sm-6" :class="[$v.gasbrand.required ? 'has-error' : '']">
99
+ <label class="col-sm-4 control-label">气表品牌:</label>
100
+ <div class="col-sm-8">
101
+ <input type="text" v-show="false" v-model="item.gasbrand.id" v-validate:gasbrand = "['required']" >
102
+ <input-select
103
+ class="select select_list"
104
+ :value.sync="item.gasbrand"
105
+ v-model="item.gasbrand"
106
+ :options="meterbrands"
107
+ @change="gasbrandChange(i)"
108
+ :disable="mark === 1"
109
+ :valueSingle="true"></input-select>
110
+ </div>
111
+ </div>
112
+ <div class="form-group col-sm-6" :class="[$v.gasmodel.required ? 'has-error' : '']">
113
+ <label class="col-sm-4 control-label">气表型号:</label>
114
+ <div class="col-sm-8">
115
+ <input type="text" v-show="false" v-model="item.gasmodel.f_meter_style" :value.sync="item.gasmodel.f_meter_style" v-validate:gasmodel = "['required']" >
116
+ <input-select
117
+ class="select select_list"
118
+ :value.sync="item.gasmodel"
119
+ v-model="item.gasmodel"
120
+ :options.sync="item.gasbrand.gasmodel"
121
+ @change="gasmodelChange(i)"
122
+ :disable="mark === 1"
123
+ :valueSingle="true"></input-select>
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="installpersons"
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 {HttpResetClass} from 'vue-client'
233
+
234
+ export default {
235
+ title: '安装明细',
236
+ props: {
237
+ selectdata: {
238
+ type: Object
239
+ },
240
+ mark: {
241
+ type: Number,
242
+ default: 0
243
+ }
244
+ },
245
+ data () {
246
+ return {
247
+ showFile: false,
248
+ showUserFile: false,
249
+ model: {
250
+ data: null
251
+ },
252
+ meterbrands: [], // 气表品牌
253
+ useradders: null,
254
+ userinfo: {},
255
+ installpersons:[],
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
+ this.installperson()
275
+ },
276
+ methods: {
277
+ // 追加表具
278
+ addUserFile() {
279
+ this.userinfo.userfiles.push({})
280
+ },
281
+ // 保存档案
282
+ async saveUserFile() {
283
+ console.log("当前表具信息",this.userinfo.userfiles[0])
284
+ if ((this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋集中器' ||
285
+ this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋4G物联网表' ||
286
+ this.userinfo.userfiles[0].gasbrand.f_meter_brand === '先锋NB物联网表') &&
287
+ !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[0].f_meternumber))
288
+ {
289
+ this.$showAlert('请输入10位表号!!!', 'warning', 2000)
290
+ return
291
+ }
292
+ let data = {
293
+ user: Vue.user,
294
+ useradders: this.useradders,
295
+ userinfo: this.userinfo,
296
+ selectdata: this.selectdata
297
+ }
298
+ let res = await this.$resetpost(this.$androidUtil.getProxyUrl() +'/rs/logic/addInstallationDetails', {data:data}, {
299
+ resolveMsg: null,
300
+ rejectMsg: '表具添加失败!!!'
301
+ })
302
+ this.$dispatch('breakControl', this.selectdata)
303
+ },
304
+ // 检查表号是否存在
305
+ async meternumberValidate(i) {
306
+ if (!this.userinfo.userfiles[i].f_gasbrand_id) {
307
+ this.userinfo.userfiles[i].f_meternumber = ''
308
+ this.$showAlert('请先选择气表品牌!!!', 'warning', 2000)
309
+ return
310
+ }
311
+ if ((this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋集中器' ||
312
+ this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋4G物联网表' ||
313
+ this.userinfo.userfiles[i].gasbrand.f_meter_brand === '先锋NB物联网表') &&
314
+ !/^[a-zA-Z0-9]{10}$/.test(this.userinfo.userfiles[i].f_meternumber))
315
+ {
316
+ this.$showAlert('请输入10位表号!!!', 'warning', 2000)
317
+ return
318
+ }
319
+ if (this.userinfo.userfiles[i].f_gasbrand_id && this.userinfo.userfiles[i].f_meternumber) {
320
+ let data = {
321
+ f_meternumber: this.userinfo.userfiles[i].f_meternumber,
322
+ f_gasbrand_id: this.userinfo.userfiles[i].f_gasbrand_id
323
+ }
324
+ if (this.userinfo.userfiles[i].f_userfiles_id) {
325
+ data.f_userfiles_id = this.userinfo.userfiles[i].f_userfiles_id
326
+ }
327
+ let res = await this.$resetpost(this.$androidUtil.getProxyUrl() +'/rs/logic/meterbrandsNumberValidate', {data:data}, {
328
+ resolveMsg: null,
329
+ rejectMsg: '表号验证失败!!'
330
+ })
331
+ if (res.data) {
332
+ this.userinfo.userfiles[i].f_meternumber = ''
333
+ this.$showAlert('表号已存在!!', 'warning', 3000)
334
+ }
335
+ }
336
+ },
337
+ // 选择气表型号
338
+ gasmodelChange(i) {
339
+ if (this.userinfo.userfiles[i].gasmodel) {
340
+ this.userinfo.userfiles[i].f_gasmodel_id = this.userinfo.userfiles[i].gasmodel.id
341
+ }
342
+ },
343
+ // 选择气表品牌
344
+ gasbrandChange(i) {
345
+ // 清空已保存的气表型号
346
+ this.userinfo.userfiles[i].f_gasmodel_id = null
347
+ this.userinfo.userfiles[i].gasmodel = null
348
+
349
+ if (this.userinfo.userfiles[i].gasbrand) {
350
+ // 气表品牌id
351
+ this.userinfo.userfiles[i].f_gasbrand_id = this.userinfo.userfiles[i].gasbrand.id
352
+ // 气表分类
353
+ this.userinfo.userfiles[i].f_meter_classify = this.userinfo.userfiles[i].gasbrand.f_meter_type
354
+ }
355
+ },
356
+ // 打开安装明细
357
+ async showUserFileModal (row) {
358
+ this.useradders = row
359
+
360
+ let http = new HttpResetClass()
361
+ let data = {
362
+ condition: `f_userinfo_id = '${row.f_userinfo_id}'`
363
+ }
364
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/logic/getUserinfoAndUserfiles', {data:data}, {
365
+ resolveMsg: null,
366
+ rejectMsg: null
367
+ })
368
+
369
+ this.userinfo = res.data
370
+
371
+ // 已有表具的 气表信息补充
372
+ for (let i = 0; i < this.userinfo.userfiles.length; i++) {
373
+ for (const item of this.meterbrands) {
374
+ if (item.value.id === this.userinfo.userfiles[i].f_gasbrand_id) {
375
+ // this.userinfo.userfiles[i].gasbrand = item.value // 防止双向绑定失败
376
+ Vue.set(this.userinfo.userfiles[i], 'gasbrand', item.value)
377
+ }
378
+ }
379
+ if (this.userinfo.userfiles[i].gasbrand) {
380
+ for (const item of this.userinfo.userfiles[i].gasbrand.gasmodel) {
381
+ if (item.value.id === this.userinfo.userfiles[i].f_gasmodel_id) {
382
+ // this.userinfo.userfiles[i].gasmodel = item.value
383
+ Vue.set(this.userinfo.userfiles[i], 'gasmodel', item.value)
384
+ }
385
+ }
386
+ }
387
+ }
388
+ console.log("表具信息",this.userinfo.userfiles)
389
+ this.showUserFile = true
390
+ },
391
+ // 获取气表品牌
392
+ async getMeterbrands() {
393
+ let http = new HttpResetClass()
394
+ let data = {
395
+ f_orgid: Vue.user.orgid,
396
+ f_filialeid: Vue.user.orgid
397
+ }
398
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/logic/getMeterbrands', {data:data}, {
399
+ resolveMsg: null,
400
+ rejectMsg: null
401
+ })
402
+ this.meterbrands = res.data
403
+ },
404
+ // 查询
405
+ async search () {
406
+ let http = new HttpResetClass()
407
+ let data = {
408
+ condition: " 1=1",
409
+ f_process_id: this.selectdata.f_process_id
410
+ }
411
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
412
+ resolveMsg: null,
413
+ rejectMsg: null
414
+ })
415
+ this.model.data = res.data
416
+ if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户集体报建') {
417
+ let f_installed_households = 0
418
+ for (const item of res.data) {
419
+ if (item.f_userfiles_num > 0) {
420
+ f_installed_households++
421
+ }
422
+ }
423
+ let f_uninstalled_households = this.selectdata.f_apply_count - f_installed_households
424
+ for (const item of this.selectdata.fields) {
425
+ if (item.label === '已安装户数') {
426
+ item.value = f_installed_households
427
+ }
428
+ if (item.label === '未安装户数') {
429
+ item.value = f_uninstalled_households
430
+ }
431
+ }
432
+ }
433
+ },
434
+ // 安装人
435
+ async installperson() {
436
+ let http = new HttpResetClass()
437
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/search', {
438
+ source: "this.getParentByType($organization$).getChildByName($安全员$).getChildren()",
439
+ userid: Vue.user.id
440
+ }, {resolveMsg: null, rejectMsg: null})
441
+
442
+ this.installpersons = res.data.map(item =>{
443
+ return {
444
+ label: item.name,
445
+ value: item.name
446
+ }
447
+ })
448
+ },
449
+ // 关闭安装明细
450
+ closeUserFile() {
451
+ this.showUserFile = false
452
+ this.useradders = null
453
+ this.userinfo = {}
454
+ this.search()
455
+ },
456
+ // 关闭文件上传对话框
457
+ closeFile() {
458
+ this.showFile = false
459
+ // 将选的文件清空
460
+ this.$refs.file.$el.querySelector('input').value = ''
461
+ this.search()
462
+ }
463
+ },
464
+ events: {
465
+ async 'onFileUpload'(file, result) {
466
+ let data = {
467
+ selectdata: this.selectdata,
468
+ filepath: result.f_downloadpath,
469
+ user: Vue.user
470
+ }
471
+ let res = await this.$resetpost(this.$androidUtil.getProxyUrl() +`/rs/logic/importAddInstallationDetails`, {data:data}, {resolveMsg: null, rejectMsg: '导入失败!!!', silent: true}, 0)
472
+
473
+ this.$dispatch('breakControl', this.selectdata)
474
+ }
475
+ },
476
+ computed: {
477
+ getCondition () {
478
+ let data = {
479
+ f_process_id: this.selectdata.f_process_id
480
+ }
481
+ return data
482
+ },
483
+ // 表向
484
+ aroundmeters() {
485
+ return this.$appdata.getParam('左右表')
486
+ },
487
+ // 安装位置
488
+ positions() {
489
+ return this.$appdata.getParam('安装位置')
490
+ }
491
+ },
492
+ watch: {
493
+ }
494
+ }
495
+ </script>
496
+ <style scoped>
497
+ .head-but{
498
+ margin-left: 5px;
499
+ height: 34px;
500
+ /*background-color: #6aa6e2;*/
501
+ border-radius: 4px;
502
+ font-family: PingFang;
503
+ color: #ffffff;
504
+ }
505
+ /*清除model中的浮动*/
506
+ .clearfix:after,.clearfix:before{
507
+ display: table;
508
+ }
509
+ .clearfix:after{
510
+ clear: both;
511
+ }
512
+ </style>