apply-clients 3.5.4-74 → 3.5.4-76

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