apply-clients 7.1.36-yuchuan-21 → 7.1.36-yuchuan-24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,669 +1,671 @@
1
- <template>
2
- <div>
3
- <div class="col-xs-12 col-xs-12">
4
- <list :model="model" partial='list'>
5
- <div partial class="panel">
6
- <div class="panel-self">
7
- <div class="row">
8
- <p class="col-xs-3 text-left font"><b class="control-label-justify">客户编号</b></p>
9
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_userinfo_id }}</p>
10
- </div>
11
- <div class="row">
12
- <p class="col-xs-3 text-left font"><b class="control-label-justify">客户名称</b></p>
13
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_user_name }}</p>
14
- </div>
15
- <div class="row">
16
- <p class="col-xs-3 text-left font"><b class="control-label-justify">客户电话</b></p>
17
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_user_phone }}</p>
18
- </div>
19
- <div class="row">
20
- <p class="col-xs-3 text-left font"><b class="control-label-justify">地址信息</b></p>
21
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{row.f_address}}{{row.f_address_detail}}</p>
22
- </div>
23
- <div class="row">
24
- <p class="col-xs-3 text-left font"><b class="control-label-justify">表号</b></p>
25
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meternumber }}</p>
26
- </div>
27
- <div class="row">
28
- <p class="col-xs-3 text-left font"><b class="control-label-justify">气表品牌</b></p>
29
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meter_brand }}</p>
30
- </div>
31
- <div class="row">
32
- <p class="col-xs-3 text-left font"><b class="control-label-justify">气表型号</b></p>
33
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meter_style }}</p>
34
- </div>
35
- <div class="row text-right">
36
- <button class="btn btn-info"
37
- @click.prevent="$parent.$parent.openModal(row)">
38
- {{$parent.$parent.mark === 1 ? '查看' : '修正'}}
39
- </button>
40
- </div>
41
- </div>
42
- </div>
43
- </list>
44
- </div>
45
-
46
- <validator name="v">
47
- <modal v-if="showModal" :show.sync="showModal" v-ref:modal :large="true" :backdrop="false">
48
- <header slot="modal-header" class="modal-header">
49
- <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
50
- <h4 class="modal-title">安装明细</h4>
51
- </header>
52
- <article slot="modal-body" class="modal-body clearfix">
53
- <!-- 表具信息 -->
54
- <div class="form-group col-xs-12 panel panel-info" v-if="showUserFile">
55
- <div class="panel-heading head col-xs-12" style="background-color: #e8f4ff;margin-bottom: 10px">
56
- <div class="col-xs-6 text-left">旧表具信息</div>
57
- </div>
58
- <div class="form-group row vertical-center" :class="[$v.f_gasbrand_id.required ? 'has-error' : '']">
59
- <label class="col-xs-4 control-label">气表品牌:</label>
60
- <div class="col-xs-8">
61
- <input type="text" v-show="false" v-model="userfile.f_gasbrand_id" :value.sync="userfile.f_gasbrand_id" v-validate:f_gasbrand_id = "['required']" >
62
- <input-select
63
- class="select select_list"
64
- :value.sync="userfile.f_gasbrand_id"
65
- v-model="userfile.f_gasbrand_id"
66
- :options="meterBrandList"
67
- @change="gasbrandChange()"
68
- :disable="mark === 1 || userinfo.f_user_state === '正常' || gasbrandDisable"
69
- :valueSingle="true"></input-select>
70
- </div>
71
- </div>
72
- <div class="form-group row vertical-center" :class="[$v.f_gasmodel_id.required ? 'has-error' : '']">
73
- <label class="col-xs-4 control-label">气表型号:</label>
74
- <div class="col-xs-8">
75
- <input type="text" v-show="false" v-model="userfile.f_gasmodel_id" :value.sync="userfile.f_gasmodel_id" v-validate:f_gasmodel_id = "['required']" >
76
- <input-select
77
- class="select select_list"
78
- :value.sync="userfile.f_gasmodel_id"
79
- v-model="userfile.f_gasmodel_id"
80
- :options.sync="gasModelList"
81
- :disable="mark === 1 || userinfo.f_user_state === '正常' || gasbrandDisable"
82
- :valueSingle="true"></input-select>
83
- </div>
84
- </div>
85
- <div class="form-group row vertical-center" :class="[$v.f_meternumber.required ? 'has-error' : '']">
86
- <label class="col-xs-4 control-label">表&emsp;&emsp;号:</label>
87
- <div class="col-xs-8">
88
- <input class="form-control input_view" style=""
89
- placeholder="表号" v-validate:f_meternumber = "['required']"
90
- v-model="newUserfile.f_meternumber"
91
- :value.sync="userfile.f_meternumber"
92
- @change="meternumberValidate()"
93
- :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
94
- </div>
95
- </div>
96
- <div class="form-group row vertical-center">
97
- <label class="col-xs-4 control-label">表&ensp;封&ensp;号:</label>
98
- <div class="col-xs-8">
99
- <input class="form-control input_view" style=""
100
- placeholder="表封号"
101
- v-model="newUserfile.f_metertitles"
102
- :value="userfile.f_metertitles"
103
- :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
104
- </div>
105
- </div>
106
- <div class="form-group row vertical-center">
107
- <label class="col-xs-4 control-label">表&ensp;读&ensp;数:</label>
108
- <div class="col-xs-8">
109
- <input class="form-control input_view" style=""
110
- type="number"
111
- placeholder="表读数"
112
- v-model="newUserfile.f_meter_base"
113
- :value="userfile.f_meter_base"
114
- :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
115
- </div>
116
- </div>
117
- <div class="form-group row vertical-center">
118
- <label class="col-xs-4 control-label">初始底数:</label>
119
- <div class="col-xs-8">
120
- <input class="form-control input_view" style=""
121
- type="number"
122
- v-model="newUserfile.f_initial_base"
123
- :value="userfile.f_initial_base"
124
- placeholder="初始底数"
125
- :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
126
- </div>
127
- </div>
128
- <div class="form-group row vertical-center">
129
- <label class="col-xs-4 control-label">表&emsp;&emsp;向:</label>
130
- <div class="col-xs-8">
131
- <input-select
132
- class="select select_list"
133
- :value.sync="userfile.f_aroundmeter"
134
- v-model="newUserfile.f_aroundmeter"
135
- :options="aroundmeters"
136
- :disable="mark === 1 || userinfo.f_user_state === '正常'"
137
- :valueSingle="true"></input-select>
138
- </div>
139
- </div>
140
- <div class="form-group row vertical-center">
141
- <label class="col-xs-4 control-label">安装位置:</label>
142
- <div class="col-xs-8">
143
- <input-select
144
- class="select select_list"
145
- :value.sync="userfile.f_position"
146
- v-model="newUserfile.f_position"
147
- :options="positions"
148
- :disable="mark === 1 || userinfo.f_user_state === '正常'"
149
- :valueSingle="true"></input-select>
150
- </div>
151
- </div>
152
- <div class="form-group row vertical-center">
153
- <label class="col-xs-4 control-label">安&ensp;装&ensp;人:</label>
154
- <div class="col-xs-8">
155
- <input class="form-control input_view" style=""
156
- v-model="newUserfile.f_install_person"
157
- :value.sync="installperson(userfile.f_install_person)"
158
- placeholder="安装人"
159
- readonly/>
160
- </div>
161
- </div>
162
- <div class="form-group row vertical-center">
163
- <label class="col-xs-4 control-label">安装日期:</label>
164
- <div class="col-xs-8">
165
- <input class="form-control input_view" style=""
166
- v-model="newUserfile.f_install_date"
167
- :value.sync="installdate(userfile.f_install_date)"
168
- placeholder="安装日期"
169
- readonly/>
170
- </div>
171
- </div>
172
- <div class="form-group row vertical-center">
173
- <button type="button" class="btn btn-primary" @click="showNewUserFile = !showNewUserFile">换表</button>
174
- </div>
175
- <div class="form-group col-xs-12 panel panel-info" v-if="showNewUserFile">
176
- <div class="panel-heading head col-xs-12" style="background-color: #e8f4ff;margin-bottom: 10px">
177
- <div class="col-xs-6 text-left">新表具信息</div>
178
- <div class="col-xs-6 text-right">
179
- <svg @click="scanCode()" style="width: 25px;height: 25px;margin-right: 10px" t="1636095770822" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2457" width="64" height="64">
180
- <path d="M928.016126 543.908618 95.983874 543.908618c-17.717453 0-31.994625-14.277171-31.994625-31.994625S78.26642 479.919368 95.983874 479.919368l832.032253 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S945.73358 543.908618 928.016126 543.908618z" p-id="2458"></path>
181
- <path d="M832.032253 928.016126 639.892491 928.016126c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l191.967747 0c17.717453 0 31.994625-14.277171 31.994625-31.994625l0-159.973123c0-17.717453 14.277171-31.994625 31.994625-31.994625s31.994625 14.277171 31.994625 31.994625l0 159.973123C928.016126 884.840585 884.840585 928.016126 832.032253 928.016126z" p-id="2459"></path>
182
- <path d="M351.94087 928.016126l-159.973123 0c-52.980346 0-95.983874-43.003528-95.983874-95.983874l0-159.973123c0-17.717453 14.277171-31.994625 31.994625-31.994625S159.973123 654.341676 159.973123 672.05913l0 159.973123c0 17.717453 14.449185 31.994625 31.994625 31.994625l159.973123 0c17.717453 0 31.994625 14.277171 31.994625 31.994625C383.935495 913.738955 369.658324 928.016126 351.94087 928.016126z" p-id="2460"></path>
183
- <path d="M127.978498 383.935495c-17.717453 0-31.994625-14.277171-31.994625-31.994625l0-159.973123c0-52.980346 43.003528-95.983874 95.983874-95.983874l159.973123 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S369.658324 159.973123 351.94087 159.973123l-159.973123 0c-17.545439 0-31.994625 14.449185-31.994625 31.994625l0 159.973123C159.973123 369.658324 145.695952 383.935495 127.978498 383.935495z" p-id="2461"></path>
184
- <path d="M896.021502 383.935495c-17.717453 0-31.994625-14.277171-31.994625-31.994625l0-159.973123c0-17.545439-14.277171-31.994625-31.994625-31.994625L639.892491 159.973123c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l191.967747 0c52.980346 0 95.983874 43.003528 95.983874 95.983874l0 159.973123C928.016126 369.658324 913.738955 383.935495 896.021502 383.935495z" p-id="2462"></path>
185
- </svg>
186
- </div>
187
- </div>
188
- <div class="form-group row vertical-center" :class="[$v.f_gasbrand_id.required ? 'has-error' : '']">
189
- <label class="col-xs-4 control-label">新气表品牌:</label>
190
- <div class="col-xs-8">
191
- <input type="text" v-show="false" v-model="newUserfile.f_new_gasbrand_id" :value.sync="newUserfile.f_new_gasbrand_id" >
192
- <input-select
193
- class="select select_list"
194
- :value.sync="newUserfile.f_new_gasbrand_id"
195
- v-model="newUserfile.f_new_gasbrand_id"
196
- :options="meterBrandList"
197
- @change="gasbrandChange()"
198
- :disable="mark === 1 || gasbrandDisable"
199
- :valueSingle="true"></input-select>
200
- </div>
201
- </div>
202
- <div class="form-group row vertical-center" :class="[$v.f_gasmodel_id.required ? 'has-error' : '']">
203
- <label class="col-xs-4 control-label">新气表型号:</label>
204
- <div class="col-xs-8">
205
- <input type="text" v-show="false" v-model="newUserfile.f_new_gasmodel_id"
206
- :value.sync="newUserfile.f_new_gasmodel_id" >
207
- <input-select
208
- class="select select_list"
209
- :value.sync="newUserfile.f_new_gasmodel_id"
210
- v-model="newUserfile.f_new_gasmodel_id"
211
- :options.sync="newgasModelList"
212
- :disable="mark === 1 || gasbrandDisable"
213
- :valueSingle="true"></input-select>
214
- </div>
215
- </div>
216
- <div class="form-group row vertical-center" :class="[$v.f_meternumber.required ? 'has-error' : '']">
217
- <label class="col-xs-4 control-label">新&ensp;表&ensp;号:</label>
218
- <div class="col-xs-8">
219
- <input class="form-control input_view" style=""
220
- placeholder="表号"
221
- v-model="newUserfile.f_new_meternumber"
222
- :value.sync="newUserfile.f_new_meternumber"
223
- @change="meternumberValidate()"
224
- :readonly="mark === 1"/>
225
- </div>
226
- </div>
227
- <div class="form-group row vertical-center">
228
- <label class="col-xs-4 control-label">新表封号:</label>
229
- <div class="col-xs-8">
230
- <input class="form-control input_view" style=""
231
- placeholder="新表封号"
232
- v-model="newUserfile.f_new_metertitles"
233
- :value="newUserfile.f_new_metertitles"
234
- :readonly="mark === 1"/>
235
- </div>
236
- </div>
237
- <div class="form-group row vertical-center">
238
- <label class="col-xs-4 control-label">新表读数:</label>
239
- <div class="col-xs-8">
240
- <input class="form-control input_view" style=""
241
- type="number"
242
- placeholder="新表读数"
243
- v-model="newUserfile.f_new_meter_base"
244
- :value="newUserfile.f_new_meter_base"
245
- :readonly="mark === 1"/>
246
- </div>
247
- </div>
248
- <div class="form-group row vertical-center">
249
- <label class="col-xs-4 control-label">新初始底数:</label>
250
- <div class="col-xs-8">
251
- <input class="form-control input_view" style=""
252
- type="number"
253
- v-model="newUserfile.f_new_initial_base"
254
- :value="newUserfile.f_new_initial_base"
255
- placeholder="新初始底数"
256
- :readonly="mark === 1"/>
257
- </div>
258
- </div>
259
- <div class="form-group row vertical-center">
260
- <label class="col-xs-4 control-label">新&ensp;表&ensp;向:</label>
261
- <div class="col-xs-8">
262
- <input-select
263
- class="select select_list"
264
- :value.sync="newUserfile.f_new_aroundmeter"
265
- v-model="newUserfile.f_new_aroundmeter"
266
- :options="aroundmeters"
267
- :disable="mark === 1"
268
- :valueSingle="true"></input-select>
269
- </div>
270
- </div>
271
- <div class="form-group row vertical-center">
272
- <label class="col-xs-4 control-label">新安装位置:</label>
273
- <div class="col-xs-8">
274
- <input-select
275
- class="select select_list"
276
- :value.sync="newUserfile.f_new_position"
277
- v-model="newUserfile.f_new_position"
278
- :options="positions"
279
- :disable="mark === 1"
280
- :valueSingle="true"></input-select>
281
- </div>
282
- </div>
283
- </div>
284
- </div>
285
- </article>
286
- <footer slot="modal-footer" class="modal-footer">
287
- <template v-if="mark !== 1">
288
- <button type="button" class="btn btn-primary" @click="saveUserFile" :disabled="!$v.valid">确认</button>
289
- </template>
290
- </footer>
291
- </modal>
292
- </validator>
293
- </div>
294
-
295
- </template>
296
- <script>
297
- import Vue from 'vue'
298
- import {PagedList} from 'vue-client'
299
- import {HttpResetClass} from 'vue-client'
300
- import {isEmpty} from '../../../Util'
301
-
302
- export default {
303
- title: '安装明细',
304
- props: {
305
- selectdata: {
306
- type: Object
307
- },
308
- mark: {
309
- type: Number,
310
- default: 0
311
- }
312
- },
313
- data () {
314
- return {
315
- showModal: false,
316
- model: {
317
- rows: null
318
- },
319
- areaList: [],
320
- area: {},
321
- userinfo: {},
322
- userfile: {},
323
- meterBrandList: [],
324
- gasModelList: [],
325
- scanCodeConfig: null,
326
- gasbrandDisable: false,
327
- showNewUserFile: false,
328
- newUserfile: {},
329
- newgasModelList: []
330
- }
331
- },
332
- ready () {
333
- this.search()
334
- this.getMeterBrand()
335
-
336
- this.getScanCodeConfig()
337
- },
338
- methods: {
339
- async getScanCodeConfig () {
340
- let http = new HttpResetClass()
341
- let res = await http.load(
342
- 'POST',
343
- `${this.$androidUtil.getProxyUrl()}/rs/logic/getScanCodeConfig`,
344
- null,
345
- {resolveMsg: null, rejectMsg: '扫码配置获取失败!!!'}
346
- )
347
-
348
- this.scanCodeConfig = res.data
349
- },
350
- scanCode () {
351
- console.log('===============扫码===================')
352
- HostApp.__this__=this,
353
- HostApp.scanCode({callback:"javascript:HostApp.__this__.getCode();"})
354
-
355
- this.getCode()
356
- },
357
- getCode() {
358
- let code = HostApp.getCode().data;
359
- // let code = '012199312345'
360
- console.log('===========扫码结果=============')
361
- console.log(code)
362
- if (!/^\d{12}$/.test(code)) {
363
- this.$showAlert('表号不符合规则', 'danger', 3000)
364
- return
365
- }
366
-
367
- // 解析厂家
368
- let factory = null
369
- for (const item of this.scanCodeConfig.factory) {
370
- if (item.key === code.substring(0, 2)) {
371
- factory = item.val
372
- break
373
- }
374
- }
375
- if (isEmpty(factory)) {
376
- this.$showAlert('未知厂家!!!', 'danger', 3000)
377
- return
378
- }
379
- console.log(factory)
380
-
381
- // 解析运营商
382
- let ips = null
383
- for (const item of this.scanCodeConfig.ips) {
384
- if (item.key === code.substring(5, 6)) {
385
- ips = item.val
386
- break
387
- }
388
- }
389
- if (isEmpty(ips)) {
390
- this.$showAlert('未知运营商!!!', 'danger', 3000)
391
- return
392
- }
393
- console.log(ips)
394
-
395
- // 表向
396
- console.log(code.substring(6, 7) % 2 === 0 ? '偶数' : '奇数')
397
- console.log(code.substring(6, 7) % 2 === 0 ? '右表' : '左表')
398
- this.userfile.f_aroundmeter = code.substring(6, 7) % 2 === 0 ? '右表' : '左表'
399
-
400
- // 顺序号
401
- console.log(code.substring(7, 12))
402
- if (code.substring(7, 12) < this.scanCodeConfig.number.min || code.substring(7, 12) > this.scanCodeConfig.number.max) {
403
- this.$showAlert('顺序号超出范围!!!', 'danger', 3000)
404
- return
405
- }
406
-
407
- for (const item of this.meterBrandList) {
408
- if (item.label === factory) {
409
- // this.userfile.f_gasbrand_id = item.value
410
- // this.gasbrandChange()
411
- break
412
- }
413
- }
414
-
415
- Vue.set(this.userfile, 'f_meternumber', code)
416
-
417
- this.meternumberValidate()
418
- },
419
- // 保存档案
420
- async saveUserFile() {
421
- let data = {
422
- user: Vue.user,
423
- userinfo: this.userinfo,
424
- userfile: this.userfile,
425
- newUserfile: this.newUserfile,
426
- selectdata: this.selectdata
427
- }
428
- let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyAddNweUserfiles`, {data:data}, {
429
- resolveMsg: null,
430
- rejectMsg: '用户档案添加失败!!!'
431
- })
432
- this.$dispatch('breakControl', this.selectdata)
433
- },
434
- ifDisable() {
435
- if (this.selectdata.f_apply_type === '非民用报建' && this.selectdata.defname === '工程施工') {
436
- this.gasbrandDisable = true
437
- }
438
- },
439
- // 检查表号是否存在
440
- async meternumberValidate() {
441
- if (!this.newUserfile.f_gasbrand_id) {
442
- this.newUserfile.f_meternumber = ''
443
- this.$showAlert('请先选择气表品牌!!!', 'warning', 3000)
444
- return
445
- }
446
- if (this.newUserfile.f_new_gasbrand_id && this.newUserfile.f_new_meternumber) {
447
- let data = {
448
- f_meternumber: this.newUserfile.f_new_meternumber,
449
- f_gasbrand_id: this.newUserfile.f_new_gasbrand_id
450
- }
451
- if (this.newUserfile.f_user_id) {
452
- data.f_user_id = this.newUserfile.f_user_id
453
- }
454
- let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/meterbrandsNumberValidate`, {data:data}, {
455
- resolveMsg: null,
456
- rejectMsg: '表号验证失败!!'
457
- })
458
- console.log(`查询结果${res.data}`)
459
- console.log(res.data)
460
- if (res.data === '表号已存在' || res.data === '表号无效') {
461
- this.newUserfile.f_meternumber = ''
462
- this.$showAlert(res.data, 'warning', 3000)
463
- }
464
- }
465
- },
466
- // 选择气表品牌
467
- async gasbrandChange() {
468
- // 清空已保存的气表型号
469
- // this.newUserfile.f_new_gasbrand_id = null
470
- if (isEmpty(newUserfile.f_new_gasbrand_id)) {
471
- return
472
- }
473
- let data = {
474
- f_gasbrand_id: newUserfile.f_new_gasbrand_id
475
- }
476
- let http = new HttpResetClass()
477
- let res = await http.load(
478
- 'POST',
479
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
480
- {data: data},
481
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
482
- )
483
-
484
- this.newgasModelList = res.data
485
-
486
- data = {
487
- tablename: 't_gasbrand',
488
- condition: `id = '${this.newUserfile.f_new_gasbrand_id}'`
489
- }
490
- res = await http.load(
491
- 'POST',
492
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
493
- {data: data},
494
- {resolveMsg: null, rejectMsg: '表具类型查询失败!!!'}
495
- )
496
- this.newUserfile.f_new_meter_classify = res.data[0].f_meter_type
497
- },
498
- // 打开安装明细
499
- async openModal (row) {
500
- this.ifDisable()
501
- if (row) {
502
- console.log('------------------修正---------------------')
503
- this.userinfo = row
504
-
505
-
506
- let data = {
507
- tablename: 't_userfiles',
508
- condition: `f_userinfo_id = ${row.f_userinfo_id}`
509
- }
510
- let http = new HttpResetClass()
511
- let res = await http.load(
512
- 'POST',
513
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
514
- {data: data},
515
- {resolveMsg: null, rejectMsg: '表档案查询失败!!!'}
516
- )
517
- this.userfile = res.data[0]
518
-
519
- let newdata = {
520
- tablename: 't_userfiles_modify',
521
- condition: `f_userinfo_id = ${row.f_userinfo_id}`
522
- }
523
- let newRes = await http.load(
524
- 'POST',
525
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
526
- {data: newdata},
527
- {resolveMsg: null, rejectMsg: '表档案查询失败!!!'}
528
- )
529
- if (newRes.data.length > 0) {
530
-
531
- this.newUserfile = newRes.data[0]
532
- if (!isEmpty(this.newUserfile.f_new_gasbrand_id)) {
533
- let data = {
534
- f_gasbrand_id: this.newUserfile.f_new_gasbrand_id
535
- }
536
- let res = await http.load(
537
- 'POST',
538
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
539
- {data: data},
540
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
541
- )
542
- this.newgasModelList = res.data
543
- }
544
- }
545
-
546
-
547
- if (!isEmpty(this.userfile.f_gasbrand_id)) {
548
- let data = {
549
- f_gasbrand_id: this.userfile.f_gasbrand_id
550
- }
551
- let http = new HttpResetClass()
552
- let res = await http.load(
553
- 'POST',
554
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
555
- {data: data},
556
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
557
- )
558
-
559
- this.gasModelList = res.data
560
- }
561
- }
562
- this.showModal = true
563
- },
564
- // 获取气表品牌
565
- async getMeterBrand () {
566
- let data = {
567
- }
568
-
569
- let http = new HttpResetClass()
570
- let res = await http.load(
571
- 'POST',
572
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getMeterBrand`,
573
- {data: data},
574
- {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
575
- )
576
-
577
- this.meterBrandList = res.data
578
- this.meterBrandList.push({label: '无', value: 'null'})
579
- },
580
- // 查询
581
- async search () {
582
- let http = new HttpResetClass()
583
- let data = {
584
- condition: `ui.f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
585
- }
586
-
587
- let res = await http.load('POST',
588
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
589
- {data:data}, {
590
- resolveMsg: null,
591
- rejectMsg: '获取档案失败!!!'
592
- })
593
- this.model.rows = res.data
594
- },
595
- // 关闭安装明细
596
- closeUserFile() {
597
- this.showModal = false
598
- this.area = {}
599
- this.userinfo = {}
600
- this.userfile = {}
601
- this.gasModelList = {}
602
- this.newgasModelList = {}
603
- this.newUserfile = {}
604
- this.search()
605
- }
606
- },
607
- events: {
608
- },
609
- computed: {
610
- showAddress () {
611
- return this.selectdata.f_apply_type === '民用报建'
612
- },
613
- showUserInfo () {
614
- return this.selectdata.f_apply_type === '民用报建' && this.selectdata.f_apply_nature !== '分户挂表'
615
- },
616
- showUserFile () {
617
- return (this.selectdata.f_apply_type === '民用报建' && this.selectdata.f_apply_nature !== '分户挂表' && this.selectdata.defname === '工程施工') ||
618
- this.selectdata.f_apply_type === '非民用报建' ||
619
- this.selectdata.f_apply_type === '设备变更' ||
620
- this.selectdata.f_apply_type === '分户挂表'
621
- },
622
- showInstall () {
623
- return this.showUserFile && (this.selectdata.defname === '工程施工' || this.selectdata.defname === '施工通气' || this.selectdata.defname === '点火通气')
624
- },
625
- // 证件类型
626
- credentialsList() {
627
- return this.$appdata.getParam('证件类型')
628
- },
629
- // 安装人
630
- installperson() {
631
- return function (f_install_person) {
632
- if (isEmpty(f_install_person)) {
633
- return Vue.user.name
634
- }
635
- return f_install_person
636
- }
637
- },
638
- // 安装时间
639
- installdate() {
640
- return function (f_install_date) {
641
- if (isEmpty(f_install_date)) {
642
- return new Date().Format('yyyy-MM-dd HH:mm:ss')
643
- }
644
- return f_install_date
645
- }
646
- },
647
- // 表向
648
- aroundmeters() {
649
- return this.$appdata.getParam('左右表')
650
- },
651
- // 安装位置
652
- positions() {
653
- return this.$appdata.getParam('安装位置')
654
- }
655
- },
656
- watch: {
657
- }
658
- }
659
- </script>
660
- <style scoped>
661
- .panel {
662
- margin-bottom: 8px;
663
- }
664
- .panel-self{
665
- border-radius: 10px;
666
- border:1px solid #499EDF;
667
- padding: 8px;
668
- }
669
- </style>
1
+ <template>
2
+ <div>
3
+ <div class="col-xs-12 col-xs-12">
4
+ <list :model="model" partial='list'>
5
+ <div partial class="panel">
6
+ <div class="panel-self">
7
+ <div class="row">
8
+ <p class="col-xs-3 text-left font"><b class="control-label-justify">客户编号</b></p>
9
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_userinfo_id }}</p>
10
+ </div>
11
+ <div class="row">
12
+ <p class="col-xs-3 text-left font"><b class="control-label-justify">客户名称</b></p>
13
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_user_name }}</p>
14
+ </div>
15
+ <div class="row">
16
+ <p class="col-xs-3 text-left font"><b class="control-label-justify">客户电话</b></p>
17
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_user_phone }}</p>
18
+ </div>
19
+ <div class="row">
20
+ <p class="col-xs-3 text-left font"><b class="control-label-justify">地址信息</b></p>
21
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{row.f_address}}{{row.f_address_detail}}</p>
22
+ </div>
23
+ <div class="row">
24
+ <p class="col-xs-3 text-left font"><b class="control-label-justify">表号</b></p>
25
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meternumber }}</p>
26
+ </div>
27
+ <div class="row">
28
+ <p class="col-xs-3 text-left font"><b class="control-label-justify">气表品牌</b></p>
29
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meter_brand }}</p>
30
+ </div>
31
+ <div class="row">
32
+ <p class="col-xs-3 text-left font"><b class="control-label-justify">气表型号</b></p>
33
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meter_style }}</p>
34
+ </div>
35
+ <div class="row text-right">
36
+ <button class="btn btn-info"
37
+ @click.prevent="$parent.$parent.openModal(row)">
38
+ {{$parent.$parent.mark === 1 ? '查看' : '修正'}}
39
+ </button>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </list>
44
+ </div>
45
+
46
+ <validator name="v">
47
+ <modal v-if="showModal" :show.sync="showModal" v-ref:modal :large="true" :backdrop="false">
48
+ <header slot="modal-header" class="modal-header">
49
+ <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
50
+ <h4 class="modal-title">安装明细</h4>
51
+ </header>
52
+ <article slot="modal-body" class="modal-body clearfix">
53
+ <!-- 表具信息 -->
54
+ <div class="form-group col-xs-12 panel panel-info" v-if="showUserFile">
55
+ <div class="panel-heading head col-xs-12" style="background-color: #e8f4ff;margin-bottom: 10px">
56
+ <div class="col-xs-6 text-left">旧表具信息</div>
57
+ </div>
58
+ <div class="form-group row vertical-center" :class="[$v.f_gasbrand_id.required ? 'has-error' : '']">
59
+ <label class="col-xs-4 control-label">气表品牌:</label>
60
+ <div class="col-xs-8">
61
+ <input type="text" v-show="false" v-model="userfile.f_gasbrand_id" :value.sync="userfile.f_gasbrand_id" v-validate:f_gasbrand_id = "['required']" >
62
+ <input-select
63
+ class="select select_list"
64
+ :value.sync="userfile.f_gasbrand_id"
65
+ v-model="userfile.f_gasbrand_id"
66
+ :options="meterBrandList"
67
+ @change="gasbrandChange()"
68
+ :disable="mark === 1 || userinfo.f_user_state === '正常' || gasbrandDisable"
69
+ :valueSingle="true"></input-select>
70
+ </div>
71
+ </div>
72
+ <div class="form-group row vertical-center" :class="[$v.f_gasmodel_id.required ? 'has-error' : '']">
73
+ <label class="col-xs-4 control-label">气表型号:</label>
74
+ <div class="col-xs-8">
75
+ <input type="text" v-show="false" v-model="userfile.f_gasmodel_id" :value.sync="userfile.f_gasmodel_id" v-validate:f_gasmodel_id = "['required']" >
76
+ <input-select
77
+ class="select select_list"
78
+ :value.sync="userfile.f_gasmodel_id"
79
+ v-model="userfile.f_gasmodel_id"
80
+ :options.sync="gasModelList"
81
+ :disable="mark === 1 || userinfo.f_user_state === '正常' || gasbrandDisable"
82
+ :valueSingle="true"></input-select>
83
+ </div>
84
+ </div>
85
+ <div class="form-group row vertical-center" :class="[$v.f_meternumber.required ? 'has-error' : '']">
86
+ <label class="col-xs-4 control-label">表&emsp;&emsp;号:</label>
87
+ <div class="col-xs-8">
88
+ <input class="form-control input_view" style=""
89
+ placeholder="表号" v-validate:f_meternumber = "['required']"
90
+ v-model="newUserfile.f_meternumber"
91
+ :value.sync="userfile.f_meternumber"
92
+ @change="meternumberValidate()"
93
+ :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
94
+ </div>
95
+ </div>
96
+ <div class="form-group row vertical-center">
97
+ <label class="col-xs-4 control-label">表&ensp;封&ensp;号:</label>
98
+ <div class="col-xs-8">
99
+ <input class="form-control input_view" style=""
100
+ placeholder="表封号"
101
+ v-model="newUserfile.f_metertitles"
102
+ :value="userfile.f_metertitles"
103
+ :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
104
+ </div>
105
+ </div>
106
+ <div class="form-group row vertical-center">
107
+ <label class="col-xs-4 control-label">表&ensp;读&ensp;数:</label>
108
+ <div class="col-xs-8">
109
+ <input class="form-control input_view" style=""
110
+ type="number"
111
+ placeholder="表读数"
112
+ v-model="newUserfile.f_meter_base"
113
+ :value="userfile.f_meter_base"
114
+ :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
115
+ </div>
116
+ </div>
117
+ <div class="form-group row vertical-center">
118
+ <label class="col-xs-4 control-label">初始底数:</label>
119
+ <div class="col-xs-8">
120
+ <input class="form-control input_view" style=""
121
+ type="number"
122
+ v-model="newUserfile.f_initial_base"
123
+ :value="userfile.f_initial_base"
124
+ placeholder="初始底数"
125
+ :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
126
+ </div>
127
+ </div>
128
+ <div class="form-group row vertical-center">
129
+ <label class="col-xs-4 control-label">表&emsp;&emsp;向:</label>
130
+ <div class="col-xs-8">
131
+ <input-select
132
+ class="select select_list"
133
+ :value.sync="userfile.f_aroundmeter"
134
+ v-model="newUserfile.f_aroundmeter"
135
+ :options="aroundmeters"
136
+ :disable="mark === 1 || userinfo.f_user_state === '正常'"
137
+ :valueSingle="true"></input-select>
138
+ </div>
139
+ </div>
140
+ <div class="form-group row vertical-center">
141
+ <label class="col-xs-4 control-label">安装位置:</label>
142
+ <div class="col-xs-8">
143
+ <input-select
144
+ class="select select_list"
145
+ :value.sync="userfile.f_position"
146
+ v-model="newUserfile.f_position"
147
+ :options="positions"
148
+ :disable="mark === 1 || userinfo.f_user_state === '正常'"
149
+ :valueSingle="true"></input-select>
150
+ </div>
151
+ </div>
152
+ <div class="form-group row vertical-center">
153
+ <label class="col-xs-4 control-label">安&ensp;装&ensp;人:</label>
154
+ <div class="col-xs-8">
155
+ <input class="form-control input_view" style=""
156
+ v-model="newUserfile.f_install_person"
157
+ :value.sync="installperson(userfile.f_install_person)"
158
+ placeholder="安装人"
159
+ readonly/>
160
+ </div>
161
+ </div>
162
+ <div class="form-group row vertical-center">
163
+ <label class="col-xs-4 control-label">安装日期:</label>
164
+ <div class="col-xs-8">
165
+ <input class="form-control input_view" style=""
166
+ v-model="newUserfile.f_install_date"
167
+ :value.sync="installdate(userfile.f_install_date)"
168
+ placeholder="安装日期"
169
+ readonly/>
170
+ </div>
171
+ </div>
172
+ <div class="form-group row vertical-center">
173
+ <button type="button" class="btn btn-primary" @click="showNewUserFile = !showNewUserFile">换表</button>
174
+ </div>
175
+ <div class="form-group col-xs-12 panel panel-info" v-if="showNewUserFile">
176
+ <div class="panel-heading head col-xs-12" style="background-color: #e8f4ff;margin-bottom: 10px">
177
+ <div class="col-xs-6 text-left">新表具信息</div>
178
+ <div class="col-xs-6 text-right">
179
+ <svg @click="scanCode()" style="width: 25px;height: 25px;margin-right: 10px" t="1636095770822" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2457" width="64" height="64">
180
+ <path d="M928.016126 543.908618 95.983874 543.908618c-17.717453 0-31.994625-14.277171-31.994625-31.994625S78.26642 479.919368 95.983874 479.919368l832.032253 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S945.73358 543.908618 928.016126 543.908618z" p-id="2458"></path>
181
+ <path d="M832.032253 928.016126 639.892491 928.016126c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l191.967747 0c17.717453 0 31.994625-14.277171 31.994625-31.994625l0-159.973123c0-17.717453 14.277171-31.994625 31.994625-31.994625s31.994625 14.277171 31.994625 31.994625l0 159.973123C928.016126 884.840585 884.840585 928.016126 832.032253 928.016126z" p-id="2459"></path>
182
+ <path d="M351.94087 928.016126l-159.973123 0c-52.980346 0-95.983874-43.003528-95.983874-95.983874l0-159.973123c0-17.717453 14.277171-31.994625 31.994625-31.994625S159.973123 654.341676 159.973123 672.05913l0 159.973123c0 17.717453 14.449185 31.994625 31.994625 31.994625l159.973123 0c17.717453 0 31.994625 14.277171 31.994625 31.994625C383.935495 913.738955 369.658324 928.016126 351.94087 928.016126z" p-id="2460"></path>
183
+ <path d="M127.978498 383.935495c-17.717453 0-31.994625-14.277171-31.994625-31.994625l0-159.973123c0-52.980346 43.003528-95.983874 95.983874-95.983874l159.973123 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S369.658324 159.973123 351.94087 159.973123l-159.973123 0c-17.545439 0-31.994625 14.449185-31.994625 31.994625l0 159.973123C159.973123 369.658324 145.695952 383.935495 127.978498 383.935495z" p-id="2461"></path>
184
+ <path d="M896.021502 383.935495c-17.717453 0-31.994625-14.277171-31.994625-31.994625l0-159.973123c0-17.545439-14.277171-31.994625-31.994625-31.994625L639.892491 159.973123c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l191.967747 0c52.980346 0 95.983874 43.003528 95.983874 95.983874l0 159.973123C928.016126 369.658324 913.738955 383.935495 896.021502 383.935495z" p-id="2462"></path>
185
+ </svg>
186
+ </div>
187
+ </div>
188
+ <div class="form-group row vertical-center" :class="[$v.f_gasbrand_id.required ? 'has-error' : '']">
189
+ <label class="col-xs-4 control-label">新气表品牌:</label>
190
+ <div class="col-xs-8">
191
+ <input type="text" v-show="false" v-model="newUserfile.f_new_gasbrand_id" :value.sync="newUserfile.f_new_gasbrand_id" >
192
+ <input-select
193
+ class="select select_list"
194
+ :value.sync="newUserfile.f_new_gasbrand_id"
195
+ v-model="newUserfile.f_new_gasbrand_id"
196
+ :options="meterBrandList"
197
+ @change="gasbrandChange()"
198
+ :disable="mark === 1 || gasbrandDisable"
199
+ :valueSingle="true"></input-select>
200
+ </div>
201
+ </div>
202
+ <div class="form-group row vertical-center" :class="[$v.f_gasmodel_id.required ? 'has-error' : '']">
203
+ <label class="col-xs-4 control-label">新气表型号:</label>
204
+ <div class="col-xs-8">
205
+ <input type="text" v-show="false" v-model="newUserfile.f_new_gasmodel_id"
206
+ :value.sync="newUserfile.f_new_gasmodel_id" >
207
+ <input-select
208
+ class="select select_list"
209
+ :value.sync="newUserfile.f_new_gasmodel_id"
210
+ v-model="newUserfile.f_new_gasmodel_id"
211
+ :options.sync="newgasModelList"
212
+ :disable="mark === 1 || gasbrandDisable"
213
+ :valueSingle="true"></input-select>
214
+ </div>
215
+ </div>
216
+ <div class="form-group row vertical-center" :class="[$v.f_meternumber.required ? 'has-error' : '']">
217
+ <label class="col-xs-4 control-label">新&ensp;表&ensp;号:</label>
218
+ <div class="col-xs-8">
219
+ <input class="form-control input_view" style=""
220
+ placeholder="表号"
221
+ v-model="newUserfile.f_new_meternumber"
222
+ :value.sync="newUserfile.f_new_meternumber"
223
+ @change="meternumberValidate()"
224
+ :readonly="mark === 1"/>
225
+ </div>
226
+ </div>
227
+ <div class="form-group row vertical-center">
228
+ <label class="col-xs-4 control-label">新表封号:</label>
229
+ <div class="col-xs-8">
230
+ <input class="form-control input_view" style=""
231
+ placeholder="新表封号"
232
+ v-model="newUserfile.f_new_metertitles"
233
+ :value="newUserfile.f_new_metertitles"
234
+ :readonly="mark === 1"/>
235
+ </div>
236
+ </div>
237
+ <div class="form-group row vertical-center">
238
+ <label class="col-xs-4 control-label">新表读数:</label>
239
+ <div class="col-xs-8">
240
+ <input class="form-control input_view" style=""
241
+ type="number"
242
+ placeholder="新表读数"
243
+ v-model="newUserfile.f_new_meter_base"
244
+ :value="newUserfile.f_new_meter_base"
245
+ :readonly="mark === 1"/>
246
+ </div>
247
+ </div>
248
+ <div class="form-group row vertical-center">
249
+ <label class="col-xs-4 control-label">新初始底数:</label>
250
+ <div class="col-xs-8">
251
+ <input class="form-control input_view" style=""
252
+ type="number"
253
+ v-model="newUserfile.f_new_initial_base"
254
+ :value="newUserfile.f_new_initial_base"
255
+ placeholder="新初始底数"
256
+ :readonly="mark === 1"/>
257
+ </div>
258
+ </div>
259
+ <div class="form-group row vertical-center">
260
+ <label class="col-xs-4 control-label">新&ensp;表&ensp;向:</label>
261
+ <div class="col-xs-8">
262
+ <input-select
263
+ class="select select_list"
264
+ :value.sync="newUserfile.f_new_aroundmeter"
265
+ v-model="newUserfile.f_new_aroundmeter"
266
+ :options="aroundmeters"
267
+ :disable="mark === 1"
268
+ :valueSingle="true"></input-select>
269
+ </div>
270
+ </div>
271
+ <div class="form-group row vertical-center">
272
+ <label class="col-xs-4 control-label">新安装位置:</label>
273
+ <div class="col-xs-8">
274
+ <input-select
275
+ class="select select_list"
276
+ :value.sync="newUserfile.f_new_position"
277
+ v-model="newUserfile.f_new_position"
278
+ :options="positions"
279
+ :disable="mark === 1"
280
+ :valueSingle="true"></input-select>
281
+ </div>
282
+ </div>
283
+ </div>
284
+ </div>
285
+ </article>
286
+ <footer slot="modal-footer" class="modal-footer">
287
+ <template v-if="mark !== 1">
288
+ <button type="button" class="btn btn-primary" @click="saveUserFile" :disabled="!$v.valid">确认</button>
289
+ </template>
290
+ </footer>
291
+ </modal>
292
+ </validator>
293
+ </div>
294
+
295
+ </template>
296
+ <script>
297
+ import Vue from 'vue'
298
+ import {PagedList} from 'vue-client'
299
+ import {HttpResetClass} from 'vue-client'
300
+ import {isEmpty} from '../../../Util'
301
+
302
+ export default {
303
+ title: '安装明细',
304
+ props: {
305
+ selectdata: {
306
+ type: Object
307
+ },
308
+ mark: {
309
+ type: Number,
310
+ default: 0
311
+ }
312
+ },
313
+ data () {
314
+ return {
315
+ showModal: false,
316
+ model: {
317
+ rows: null
318
+ },
319
+ areaList: [],
320
+ area: {},
321
+ userinfo: {},
322
+ userfile: {},
323
+ meterBrandList: [],
324
+ gasModelList: [],
325
+ scanCodeConfig: null,
326
+ gasbrandDisable: false,
327
+ showNewUserFile: false,
328
+ newUserfile: {},
329
+ newgasModelList: []
330
+ }
331
+ },
332
+ ready () {
333
+ this.search()
334
+ this.getMeterBrand()
335
+
336
+ this.getScanCodeConfig()
337
+ },
338
+ methods: {
339
+ async getScanCodeConfig () {
340
+ let http = new HttpResetClass()
341
+ let res = await http.load(
342
+ 'POST',
343
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/getScanCodeConfig`,
344
+ null,
345
+ {resolveMsg: null, rejectMsg: '扫码配置获取失败!!!'}
346
+ )
347
+
348
+ this.scanCodeConfig = res.data
349
+ },
350
+ scanCode () {
351
+ console.log('===============扫码===================')
352
+ HostApp.__this__=this,
353
+ HostApp.scanCode({callback:"javascript:HostApp.__this__.getCode();"})
354
+
355
+ this.getCode()
356
+ },
357
+ getCode() {
358
+ let code = HostApp.getCode().data;
359
+ // let code = '012199312345'
360
+ console.log('===========扫码结果=============')
361
+ console.log(code)
362
+ if (!/^\d{12}$/.test(this.userfile.f_meternumber)) {
363
+ if(!/^\d{14}$/.test(this.userfile.f_meternumber)){
364
+ this.$showAlert('表号不符合规则', 'danger', 3000)
365
+ return
366
+ }
367
+ }
368
+
369
+ // 解析厂家
370
+ let factory = null
371
+ for (const item of this.scanCodeConfig.factory) {
372
+ if (item.key === code.substring(0, 2)) {
373
+ factory = item.val
374
+ break
375
+ }
376
+ }
377
+ if (isEmpty(factory)) {
378
+ this.$showAlert('未知厂家!!!', 'danger', 3000)
379
+ return
380
+ }
381
+ console.log(factory)
382
+
383
+ // 解析运营商
384
+ let ips = null
385
+ for (const item of this.scanCodeConfig.ips) {
386
+ if (item.key === code.substring(5, 6)) {
387
+ ips = item.val
388
+ break
389
+ }
390
+ }
391
+ if (isEmpty(ips)) {
392
+ this.$showAlert('未知运营商!!!', 'danger', 3000)
393
+ return
394
+ }
395
+ console.log(ips)
396
+
397
+ // 表向
398
+ console.log(code.substring(6, 7) % 2 === 0 ? '偶数' : '奇数')
399
+ console.log(code.substring(6, 7) % 2 === 0 ? '右表' : '左表')
400
+ this.userfile.f_aroundmeter = code.substring(6, 7) % 2 === 0 ? '右表' : '左表'
401
+
402
+ // 顺序号
403
+ console.log(code.substring(7, 12))
404
+ if (code.substring(7, 12) < this.scanCodeConfig.number.min || code.substring(7, 12) > this.scanCodeConfig.number.max) {
405
+ this.$showAlert('顺序号超出范围!!!', 'danger', 3000)
406
+ return
407
+ }
408
+
409
+ for (const item of this.meterBrandList) {
410
+ if (item.label === factory) {
411
+ // this.userfile.f_gasbrand_id = item.value
412
+ // this.gasbrandChange()
413
+ break
414
+ }
415
+ }
416
+
417
+ Vue.set(this.userfile, 'f_meternumber', code)
418
+
419
+ this.meternumberValidate()
420
+ },
421
+ // 保存档案
422
+ async saveUserFile() {
423
+ let data = {
424
+ user: Vue.user,
425
+ userinfo: this.userinfo,
426
+ userfile: this.userfile,
427
+ newUserfile: this.newUserfile,
428
+ selectdata: this.selectdata
429
+ }
430
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyAddNweUserfiles`, {data:data}, {
431
+ resolveMsg: null,
432
+ rejectMsg: '用户档案添加失败!!!'
433
+ })
434
+ this.$dispatch('breakControl', this.selectdata)
435
+ },
436
+ ifDisable() {
437
+ if (this.selectdata.f_apply_type === '非民用报建' && this.selectdata.defname === '工程施工') {
438
+ this.gasbrandDisable = true
439
+ }
440
+ },
441
+ // 检查表号是否存在
442
+ async meternumberValidate() {
443
+ if (!this.newUserfile.f_gasbrand_id) {
444
+ this.newUserfile.f_meternumber = ''
445
+ this.$showAlert('请先选择气表品牌!!!', 'warning', 3000)
446
+ return
447
+ }
448
+ if (this.newUserfile.f_new_gasbrand_id && this.newUserfile.f_new_meternumber) {
449
+ let data = {
450
+ f_meternumber: this.newUserfile.f_new_meternumber,
451
+ f_gasbrand_id: this.newUserfile.f_new_gasbrand_id
452
+ }
453
+ if (this.newUserfile.f_user_id) {
454
+ data.f_user_id = this.newUserfile.f_user_id
455
+ }
456
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/meterbrandsNumberValidate`, {data:data}, {
457
+ resolveMsg: null,
458
+ rejectMsg: '表号验证失败!!'
459
+ })
460
+ console.log(`查询结果${res.data}`)
461
+ console.log(res.data)
462
+ if (res.data === '表号已存在' || res.data === '表号无效') {
463
+ this.newUserfile.f_meternumber = ''
464
+ this.$showAlert(res.data, 'warning', 3000)
465
+ }
466
+ }
467
+ },
468
+ // 选择气表品牌
469
+ async gasbrandChange() {
470
+ // 清空已保存的气表型号
471
+ // this.newUserfile.f_new_gasbrand_id = null
472
+ if (isEmpty(newUserfile.f_new_gasbrand_id)) {
473
+ return
474
+ }
475
+ let data = {
476
+ f_gasbrand_id: newUserfile.f_new_gasbrand_id
477
+ }
478
+ let http = new HttpResetClass()
479
+ let res = await http.load(
480
+ 'POST',
481
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
482
+ {data: data},
483
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
484
+ )
485
+
486
+ this.newgasModelList = res.data
487
+
488
+ data = {
489
+ tablename: 't_gasbrand',
490
+ condition: `id = '${this.newUserfile.f_new_gasbrand_id}'`
491
+ }
492
+ res = await http.load(
493
+ 'POST',
494
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
495
+ {data: data},
496
+ {resolveMsg: null, rejectMsg: '表具类型查询失败!!!'}
497
+ )
498
+ this.newUserfile.f_new_meter_classify = res.data[0].f_meter_type
499
+ },
500
+ // 打开安装明细
501
+ async openModal (row) {
502
+ this.ifDisable()
503
+ if (row) {
504
+ console.log('------------------修正---------------------')
505
+ this.userinfo = row
506
+
507
+
508
+ let data = {
509
+ tablename: 't_userfiles',
510
+ condition: `f_userinfo_id = ${row.f_userinfo_id}`
511
+ }
512
+ let http = new HttpResetClass()
513
+ let res = await http.load(
514
+ 'POST',
515
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
516
+ {data: data},
517
+ {resolveMsg: null, rejectMsg: '表档案查询失败!!!'}
518
+ )
519
+ this.userfile = res.data[0]
520
+
521
+ let newdata = {
522
+ tablename: 't_userfiles_modify',
523
+ condition: `f_userinfo_id = ${row.f_userinfo_id}`
524
+ }
525
+ let newRes = await http.load(
526
+ 'POST',
527
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
528
+ {data: newdata},
529
+ {resolveMsg: null, rejectMsg: '表档案查询失败!!!'}
530
+ )
531
+ if (newRes.data.length > 0) {
532
+
533
+ this.newUserfile = newRes.data[0]
534
+ if (!isEmpty(this.newUserfile.f_new_gasbrand_id)) {
535
+ let data = {
536
+ f_gasbrand_id: this.newUserfile.f_new_gasbrand_id
537
+ }
538
+ let res = await http.load(
539
+ 'POST',
540
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
541
+ {data: data},
542
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
543
+ )
544
+ this.newgasModelList = res.data
545
+ }
546
+ }
547
+
548
+
549
+ if (!isEmpty(this.userfile.f_gasbrand_id)) {
550
+ let data = {
551
+ f_gasbrand_id: this.userfile.f_gasbrand_id
552
+ }
553
+ let http = new HttpResetClass()
554
+ let res = await http.load(
555
+ 'POST',
556
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
557
+ {data: data},
558
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
559
+ )
560
+
561
+ this.gasModelList = res.data
562
+ }
563
+ }
564
+ this.showModal = true
565
+ },
566
+ // 获取气表品牌
567
+ async getMeterBrand () {
568
+ let data = {
569
+ }
570
+
571
+ let http = new HttpResetClass()
572
+ let res = await http.load(
573
+ 'POST',
574
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getMeterBrand`,
575
+ {data: data},
576
+ {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
577
+ )
578
+
579
+ this.meterBrandList = res.data
580
+ this.meterBrandList.push({label: '无', value: 'null'})
581
+ },
582
+ // 查询
583
+ async search () {
584
+ let http = new HttpResetClass()
585
+ let data = {
586
+ condition: `ui.f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
587
+ }
588
+
589
+ let res = await http.load('POST',
590
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
591
+ {data:data}, {
592
+ resolveMsg: null,
593
+ rejectMsg: '获取档案失败!!!'
594
+ })
595
+ this.model.rows = res.data
596
+ },
597
+ // 关闭安装明细
598
+ closeUserFile() {
599
+ this.showModal = false
600
+ this.area = {}
601
+ this.userinfo = {}
602
+ this.userfile = {}
603
+ this.gasModelList = {}
604
+ this.newgasModelList = {}
605
+ this.newUserfile = {}
606
+ this.search()
607
+ }
608
+ },
609
+ events: {
610
+ },
611
+ computed: {
612
+ showAddress () {
613
+ return this.selectdata.f_apply_type === '民用报建'
614
+ },
615
+ showUserInfo () {
616
+ return this.selectdata.f_apply_type === '民用报建' && this.selectdata.f_apply_nature !== '分户挂表'
617
+ },
618
+ showUserFile () {
619
+ return (this.selectdata.f_apply_type === '民用报建' && this.selectdata.f_apply_nature !== '分户挂表' && this.selectdata.defname === '工程施工') ||
620
+ this.selectdata.f_apply_type === '非民用报建' ||
621
+ this.selectdata.f_apply_type === '设备变更' ||
622
+ this.selectdata.f_apply_type === '分户挂表'
623
+ },
624
+ showInstall () {
625
+ return this.showUserFile && (this.selectdata.defname === '工程施工' || this.selectdata.defname === '施工通气' || this.selectdata.defname === '点火通气')
626
+ },
627
+ // 证件类型
628
+ credentialsList() {
629
+ return this.$appdata.getParam('证件类型')
630
+ },
631
+ // 安装人
632
+ installperson() {
633
+ return function (f_install_person) {
634
+ if (isEmpty(f_install_person)) {
635
+ return Vue.user.name
636
+ }
637
+ return f_install_person
638
+ }
639
+ },
640
+ // 安装时间
641
+ installdate() {
642
+ return function (f_install_date) {
643
+ if (isEmpty(f_install_date)) {
644
+ return new Date().Format('yyyy-MM-dd HH:mm:ss')
645
+ }
646
+ return f_install_date
647
+ }
648
+ },
649
+ // 表向
650
+ aroundmeters() {
651
+ return this.$appdata.getParam('左右表')
652
+ },
653
+ // 安装位置
654
+ positions() {
655
+ return this.$appdata.getParam('安装位置')
656
+ }
657
+ },
658
+ watch: {
659
+ }
660
+ }
661
+ </script>
662
+ <style scoped>
663
+ .panel {
664
+ margin-bottom: 8px;
665
+ }
666
+ .panel-self{
667
+ border-radius: 10px;
668
+ border:1px solid #499EDF;
669
+ padding: 8px;
670
+ }
671
+ </style>