9484e889 by 任超
2 parents a8656269 d7630003
<template>
<dialogBox title="申请人信息" width="60%" isMain v-model="myValue" :isFullscreen="false" @submitForm="submitForm"
@closeDialog="closeDialog">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px">
<dialogBox
title="申请人信息"
width="60%"
isMain
v-model="myValue"
:isFullscreen="false"
@submitForm="submitForm"
@closeDialog="closeDialog"
>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="120px"
>
<el-row>
<el-col :span="8">
<el-form-item label="权利人类型" prop="sqrlx">
<el-select clearable v-model="ruleForm.sqrlx" class="width100" placeholder="请选择">
<el-option v-for="item in dictData['A36']" :key="item.dcode" :label="item.dname" :value="item.dcode">
<el-select
clearable
v-model="ruleForm.sqrlx"
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>
......@@ -18,8 +40,18 @@
</el-col>
<el-col :span="8">
<el-form-item label="证件种类" prop="zjzl">
<el-select clearable 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-select
clearable
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>
......@@ -38,8 +70,18 @@
</el-col>
<el-col :span="8">
<el-form-item label="性别">
<el-select clearable v-model="ruleForm.xb" class="width100" placeholder="请选择">
<el-option v-for="item in dictData['A43']" :key="item.dcode" :label="item.dname" :value="item.dcode">
<el-select
clearable
v-model="ruleForm.xb"
class="width100"
placeholder="请选择"
>
<el-option
v-for="item in dictData['A43']"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
>
</el-option>
</el-select>
</el-form-item>
......@@ -120,8 +162,18 @@
</el-col>
<el-col :span="8">
<el-form-item label="代理人证件类型">
<el-select clearable v-model="ruleForm.dlrzjlx" class="width100" placeholder="请选择">
<el-option v-for="item in dictData['A30']" :key="item.dcode" :label="item.dname" :value="item.dcode">
<el-select
clearable
v-model="ruleForm.dlrzjlx"
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>
......@@ -138,74 +190,64 @@
</dialogBox>
</template>
<script>
import { mapGetters } from 'vuex'
import { mapGetters } from "vuex";
export default {
props: {
value: { type: Boolean, default: false },
details: { type: Object, default: {} }
details: { type: Object, default: {} },
},
computed: {
...mapGetters(["dictData"]),
},
data () {
data() {
return {
myValue: this.value,
ruleForm: {
sqrlx: '',
sqrmc: '',
zjzl: '',
zjh: '',
dh: '',
xb: '',
frmc: '',
gjdq: '',
szss: '',
dz: '',
yb: '',
fzjg: '',
dzyj: '',
qlbl: '',
gzdw: '',
dljg: '',
dlrxm: '',
dlrzjlx: '',
dlrzjh: ''
sqrlx: "",
sqrmc: "",
zjzl: "",
zjh: "",
dh: "",
xb: "",
frmc: "",
gjdq: "",
szss: "",
dz: "",
yb: "",
fzjg: "",
dzyj: "",
qlbl: "",
gzdw: "",
dljg: "",
dlrxm: "",
dlrzjlx: "",
dlrzjh: "",
},
rules: {
sqrlx: [
{ required: true, message: '权利人类型', trigger: 'change' }
],
sqrmc: [
{ required: true, message: '姓名/名称', trigger: 'blur' }
],
zjzl: [
{ required: true, message: '证件种类', trigger: 'change' }
],
zjh: [
{ required: true, message: '证件号', trigger: 'blur' }
]
}
}
sqrlx: [{ required: true, message: "权利人类型", trigger: "change" }],
sqrmc: [{ required: true, message: "姓名/名称", trigger: "blur" }],
zjzl: [{ required: true, message: "证件种类", trigger: "change" }],
zjh: [{ required: true, message: "证件号", trigger: "blur" }],
},
};
},
watch: {
value (val) {
this.myValue = _.cloneDeep(val)
value(val) {
this.myValue = _.cloneDeep(val);
},
details: {
handler: function (val, oldVal) {
this.ruleForm = val
this.ruleForm = val;
},
deep: true
}
deep: true,
},
},
methods: {
closeDialog () {
closeDialog() {
this.$emit("input", false);
this.$refs['ruleForm'].resetFields();
this.$refs["ruleForm"].resetFields();
},
submitForm () {
this.$emit("input", false);
this.$emit("updateDetail", _.cloneDeep(this.ruleForm));
submitForm() {
// this.$refs['ruleForm'].validate((valid) => {
// if (valid) {
// this.$message({
......@@ -217,9 +259,18 @@ export default {
// this.$message.error('请完善必填项');
// }
// })
}
}
}
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.$emit("input", false);
this.$emit("updateDetail", _.cloneDeep(this.ruleForm));
} else {
return false;
}
});
},
},
};
</script>
<style scoped lang="scss">
.submit-button {
......
......@@ -304,6 +304,7 @@ export default {
Init(formdata).then((res) => {
if (res.code === 200 && res.result) {
this.ruleForm = res.result;
this.ruleForm.diyaq.sfczjzhxz="0";
}
});
},
......
......@@ -304,6 +304,7 @@ export default {
Init(formdata).then((res) => {
if (res.code === 200 && res.result) {
this.ruleForm = res.result;
this.ruleForm.diyaq.sfczjzhxz="0";
}
});
},
......