addQlr.vue
3.12 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
<template>
<dialogBox title="申请人信息" width="60%" isMain v-model="myValue" :isFullscreen="false" @submitForm="submitForm"
@closeDialog="closeDialog">
<el-form :model="ruleForm" ref="ruleForm" label-width="100px">
<el-row>
<el-col :span="8">
<el-form-item label="权利人类型" prop="qlrlx">
<el-select v-model="ruleForm.qlrlx" class="width100" placeholder="请选择">
<el-option v-for="item in dictData['A36']" :key="item.dcode" :label="item.dname" :value="item.dcode">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="姓名/名称" prop="xm">
<el-input v-model="ruleForm.xm" maxlegth="15"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="证件种类" prop="zjzl">
<el-select v-model="ruleForm.zjzl" class="width100" placeholder="请选择">
<el-option v-for="item in dictData['A30']" :key="item.dcode" :label="item.dname" :value="item.dcode">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="证件号" prop="zjh">
<el-input v-model="ruleForm.zjh" maxlegth="15"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话" prop="lxdh">
<el-input v-model="ruleForm.lxdh" maxlegth="11"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
</el-row>
</el-form>
</dialogBox>
</template>
<script>
import { mapGetters } from 'vuex'
import { validatePhone } from '@/utils/validate'
export default {
props: {
value: { type: Boolean, default: false },
},
computed: {
...mapGetters(["dictData"]),
},
data () {
return {
myValue: this.value,
ruleForm: {
qlrlx: '',
xm: '',
zjzl: '',
zjh: '',
lxdh: ''
},
rules: {
qlrlx: [
{ required: true, message: '权利人类型', trigger: 'change' }
],
xm: [
{ required: true, message: '姓名/名称', trigger: 'blur' }
],
zjzl: [
{ required: true, message: '证件种类', trigger: 'change' }
],
zjh: [
{ required: true, message: '证件号', trigger: 'blur' }
],
lxdh: [
{
required: true, // required就是这个框必须填写
message: '不能空着',
validator: validatePhone, // 规则
trigger: 'blur', // blur失去焦点,事件何时触发
},
]
}
}
},
watch: {
value (val) {
this.myValue = val;
},
},
methods: {
closeDialog () {
this.$emit("input", false);
},
submitForm () {
this.$emit("input", false);
},
},
};
</script>
<style scoped lang="scss">
.submit-button {
text-align: center;
height: 52px;
padding-top: 10px;
background-color: #fff;
}
</style>