addjtfc.vue
15.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
<template>
<div class="jtfccx-edit">
<div class="jtfccx-edit-con">
<b class="title">申请信息</b>
<el-form :model="form" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="查询用途" label-width="90px">
<el-input v-model="form.djSqcxDO.cxyt" class="width200px"></el-input>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="与产权人的关系">
<el-radio-group v-model="form.djSqcxDO.ycqrgx">
<el-radio label="1">房屋权利人</el-radio>
<el-radio label="2">产权利害关系人</el-radio>
<el-radio label="3">委托人</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 申请人 -->
<lb-table :column="sqrColumns" :data="form.sqrList" heightNumSetting
:pagination="false">
</lb-table>
<!-- 权利人 -->
<b class="title">权利人</b>
<lb-table :column="qlrColumns" :data="form.qlrList" heightNumSetting :heightNum="300"
:pagination="false">
</lb-table>
<div v-show="isSearch">
<b class="title">查询结果</b>
<p>查询编号:{{ form.djSqcxDO.cxbh }}</p>
<lb-table :column="cxjgColumns" :data="form.cxjgList" :maxHeight="230" heightNumSetting :pagination="false">
</lb-table>
</div>
</div>
<el-divider></el-divider>
<div class="submit-button">
<el-button v-show="isSearch == false" @click="resetClick">重置</el-button>
<el-button type="primary" v-show="isSearch == false" @click="queryChick">查询</el-button>
<el-button type="primary" v-show="isSearch && form.cxjgList.length > 0" @click="printResult">
房产结果打印({{ form.djSqcxDO.dycs }})
</el-button>
<el-button type="primary" v-show="isSearch && form.cxjgList.length == 0" @click="printResult">
无房证明打印({{ form.djSqcxDO.dycs }})
</el-button>
<el-button @click="closeDialog">关闭</el-button>
</div>
<!-- 打印模板需要此模块 -->
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false">
<embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe" />
</object>
</div>
</template>
<script>
import axios from 'axios'
import store from '@/store/index.js'
import { getLodop } from "@/utils/LodopFuncs"
import { datas } from "./addjtfcdata";
import { getPrintTemplateByCode } from "@/api/system";
import { addJtfcCxjgXx, getJtfcInfo, printJtcfInfo } from "@/api/sqcx";
export default {
props: {
formData: {
type: Object,
default: () => { },
},
},
data () {
return {
key: 0,
//是否查询
isSearch: false,
//查询结果列表字段
cxjgColumns: datas.columns(),
//申请人列表字段
sqrColumns: [{
width: "60",
renderHeader: (h, scope) => {
return (
<i
class="el-icon-plus pointer"
onClick={() => {
this.handleAddsqr("sqr");
}}
style="color:#409EFF"
></i>
);
},
render: (h, scope) => {
return (
<i
class="el-icon-minus pointer"
onClick={() => {
this.remove(scope.$index, scope.row, "sqr");
}}
></i>
);
},
},
{
width: "150",
label: "身份证读卡器",
render: (h, scope) => {
return (
<div>
<el-button
type="text"
icon="el-icon-edit-outline"
onClick={() => {
this.handleRead(scope.row, 'sqr');
}}
>
读取
</el-button>
</div>
);
},
},
{
width: "150",
prop: "sqrxm",
label: "姓名/名称",
render: (h, scope) => {
return (
<el-input
placeholder="姓名/名称"
value={scope.row[scope.column.property]}
onInput={(val) => {
scope.row[scope.column.property] = val;
}}
></el-input>
);
},
},
{
prop: "sqrzjlxbm",
label: "证件种类",
render: (h, scope) => {
return (
<el-select
class="width100"
clearable
value={scope.row[scope.column.property]}
onChange={(val) => {
scope.row[scope.column.property] = val;
}}
>
{this.getDictData('A30').map((option) => {
return (
<el-option
label={option.dname}
value={option.dcode}
></el-option>
);
})}
</el-select>
);
},
},
{
prop: "sqrzjhm",
label: "证件号",
render: (h, scope) => {
return (
<el-input
placeholder="证件号"
value={scope.row[scope.column.property]}
onInput={(val) => {
scope.row[scope.column.property] = val;
}}
maxlength="21"
></el-input>
);
},
},
{
prop: "lxdh",
label: "联系电话",
render: (h, scope) => {
return (
<div class="typePhone">
<el-input
placeholder="联系电话"
value={scope.row[scope.column.property]}
onInput={(val) => {
scope.row[scope.column.property] = val;
}}
onBlur={(val) => {
vm.teltest(scope.row);
}}
type="tel"
maxlength="11"
></el-input>
<span
v-show={scope.row.inputErr}
style={{
fontSize: "12px",
color: "red",
position: "absolute",
bottom: "-2px",
left: "0",
}}
>
请输入正确手机号
</span>
</div>
);
},
}],
//权利人列表字段
qlrColumns: [{
width: "60",
renderHeader: (h, scope) => {
return (
<i
class="el-icon-plus pointer"
onClick={() => {
this.handleAddqlr();
}}
style="color:#409EFF"
></i>
);
},
render: (h, scope) => {
return (
<i
class="el-icon-minus pointer"
onClick={() => {
this.remove(scope.$index, scope.row, "qlr");
}}
></i>
);
},
},
{
width: "150",
label: "身份证读卡器",
render: (h, scope) => {
return (
<div>
<el-button
type="text"
icon="el-icon-edit-outline"
onClick={() => {
this.handleRead(scope.row, 'qlr');
}}
>
读取
</el-button>
</div>
);
},
},
{
width: "150",
prop: "sqrxm",
label: "姓名/名称",
render: (h, scope) => {
return (
<el-input
placeholder="姓名/名称"
value={scope.row[scope.column.property]}
onInput={(val) => {
scope.row[scope.column.property] = val;
}}
></el-input>
);
},
},
{
prop: "sqrzjlxbm",
label: "证件种类",
render: (h, scope) => {
return (
<el-select
class="width100"
value={scope.row[scope.column.property]}
onChange={(val) => {
scope.row[scope.column.property] = val;
}}
>
{this.getDictData('A30').map((option) => {
return (
<el-option
label={option.dname}
value={option.dcode}
></el-option>
);
})}
</el-select>
);
},
},
{
prop: "sqrzjhm",
label: "证件号",
render: (h, scope) => {
return (
<el-input
placeholder="证件号"
value={scope.row[scope.column.property]}
onInput={(val) => {
scope.row[scope.column.property] = val;
}}
maxlength="21"
></el-input>
);
},
},
{
prop: "lxdh",
label: "联系电话",
render: (h, scope) => {
return (
<div class="typePhone">
<el-input
placeholder="联系电话"
value={scope.row[scope.column.property]}
onInput={(val) => {
scope.row[scope.column.property] = val;
}}
onBlur={(val) => {
this.teltest(scope.row);
}}
type="tel"
maxlength="11"
></el-input>
<span
v-show={scope.row.inputErr}
style={{
fontSize: "12px",
color: "red",
position: "absolute",
bottom: "-2px",
left: "0",
}}
>
请输入正确手机号
</span>
</div>
);
},
}],
newData: {
sqrxm: "",
sqrzjlxbm: "",
sqrzjhm: "",
lxdh: "",
inputErr: false,
},
form: {
djSqcxDO: { ycqrgx: "1", cxyt: "" },
sqrList: [],
qlrList: [],
cxjgList: [],
dyjlList: [],
},
};
},
mounted () {
this.form.sqrList = []
this.form.qlrList = []
this.isSearch = false
if (this.formData.sqcxBsm == "") {
this.add("sqr");
this.add("qlr");
} else {
this.loadData();
}
},
watch: {
"form.djSqcxDO.ycqrgx" (val) {
if (val == "1") {
this.form.qlrList = _.cloneDeep(this.form.sqrList);
} else {
this.form.qlrList = [];
this.add("qlr");
}
},
"form.sqrList" (val) {
if (this.form.djSqcxDO.ycqrgx == '1') {
console.log(val, 'valvalvalval');
this.form.qlrList = _.cloneDeep(val)
}
}
},
methods: {
// 字典
getDictData (val) {
return store.getters.dictData[val]
},
closeDialog () {
this.$popupCacel()
this.form = {
djSqcxDO: { ycqrgx: "1", cxyt: "" },
sqrList: [],
qlrList: [],
cxjgList: [],
dyjlList: [],
}
},
//加载详细信息
loadData () {
this.$startLoading();
getJtfcInfo({ sqcxBsm: this.formData.sqcxBsm }).then((res) => {
this.$endLoading();
if (res.code == 200) {
this.form = res.result;
this.isSearch = true;
}
});
},
//查询结果
queryChick () {
this.$startLoading();
addJtfcCxjgXx(this.form).then((res) => {
this.$endLoading();
if (res.code == 200) {
this.form = res.result;
this.isSearch = true;
this.$parent.queryClick();
}
});
},
//重置
resetClick () {
this.form.djSqcxDO = { ycqrgx: "1", cxyt: "" };
this.form.sqrList = _.cloneDeep([this.newData]);
this.form.qlrList = _.cloneDeep([this.newData]);
this.form.cxjgList = [];
this.form.dyjlList = [];
this.isSearch = false;
},
handleRead (row, type) {
axios.post(this.BASE_API.IDCARDURL).then(res => {
if (res.data.code == 0) {
let data = res.data.IDCardInfo
row.sqrxm = data.name
row.sqrzjlxbm = '1'
row.sqrzjhm = data.cardID
this.$message({
message: '读取成功!',
type: 'success'
})
if (type == 'sqr') {
this.form.qlrList = _.cloneDeep(this.form.sqrList)
}
console.log(this.form.sqrList);
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
}
})
},
//添加申请人
handleAddsqr () {
this.form.sqrList.push(_.cloneDeep(this.newData));
},
handleAddqlr () {
this.form.qlrList.push(_.cloneDeep(this.newData));
},
//移除申请人或权利人
remove (index, row, type) {
console.log(type, 'type');
if (type == "sqr") {
this.form.sqrList.splice(index, 1);
} else {
this.form.qlrList.splice(index, 1);
}
},
//电话号码校验
teltest (row) {
const reg = /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/;
if (row.lxdh == "" || row.lxdh.length <= 10 || !reg.test(row.lxdh)) {
row.inputErr = true;
return false;
} else {
row.inputErr = false;
return true;
}
},
//打印
printResult () {
this.openPrintPrew();
var formdata = new FormData();
formdata.append("sqcxBsm", this.form.djSqcxDO.bsmSqcx);
formdata.append("dylx", '1');
printJtcfInfo(formdata).then(res => {
if (res.code == 200) {
this.form.djSqcxDO.dycs = this.form.djSqcxDO.dycs + 1
}
});
},
//打开打印预览
openPrintPrew () {
//根据编号获取对应信息
getPrintTemplateByCode({ tmpno: 'jtfcdys' }).then(res => {
if (res.code == 200) {
let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent); //装载模板
LODOP.PREVIEW();
}
})
}
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
.title {
padding-bottom: 10px;
margin-bottom: 10px;
display: block;
border-bottom: 1px solid $borderColor;
}
.jtfccx-edit {
@include flex;
flex-direction: column;
overflow-y: hidden;
max-height: 85vh;
padding: 0 2px;
.submit-button {
text-align: center;
height: 52px;
padding-top: 10px;
background-color: #fff;
}
}
</style>