|
|
|
|
@ -79,12 +79,12 @@ export default {
|
|
|
|
|
<el-col span={12}>
|
|
|
|
|
<el-form-item label="模板选择" prop="year">
|
|
|
|
|
<el-select
|
|
|
|
|
clearable={true}
|
|
|
|
|
v-model={this.originalForm.template_item_id}
|
|
|
|
|
placeholder="请选择模板"
|
|
|
|
|
on={{
|
|
|
|
|
["change"]: (e) => {
|
|
|
|
|
this.getTemplate();
|
|
|
|
|
["change"]: async(e) => {
|
|
|
|
|
await this.getTemplate();
|
|
|
|
|
await this.getDetail(2);
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
@ -105,13 +105,12 @@ export default {
|
|
|
|
|
<el-date-picker
|
|
|
|
|
clearable={true}
|
|
|
|
|
placeholder="请选择年份"
|
|
|
|
|
value={String(this.originalForm.year)}
|
|
|
|
|
v-model={this.originalForm.year}
|
|
|
|
|
type="year"
|
|
|
|
|
value-format="yyyy"
|
|
|
|
|
on={{
|
|
|
|
|
["change"]: (e) => {
|
|
|
|
|
this.originalForm.year = e;
|
|
|
|
|
this.getTemplate();
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
@ -261,7 +260,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
province_ids: Array,
|
|
|
|
|
templateItems: Array,
|
|
|
|
|
fieldsAll: Object,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
let idcardValidate = (rule, value, callback) => {
|
|
|
|
|
@ -314,14 +312,26 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getDetail() {
|
|
|
|
|
const res = await show({
|
|
|
|
|
id: this.id,
|
|
|
|
|
});
|
|
|
|
|
async getDetail(type = 1) {
|
|
|
|
|
//type 1 用id查 2 用year、template_item_id、name、idcard查看
|
|
|
|
|
let res = {}
|
|
|
|
|
if(type === 1){
|
|
|
|
|
res = await show({
|
|
|
|
|
id: this.id,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if(type === 2){
|
|
|
|
|
res = await show({
|
|
|
|
|
year: this.originalForm.year,
|
|
|
|
|
template_item_id: this.originalForm.template_item_id,
|
|
|
|
|
name: this.originalForm.name,
|
|
|
|
|
idcard: this.originalForm.idcard,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
console.log("data", res);
|
|
|
|
|
this.id = res.id
|
|
|
|
|
this.$integrateData(this.originalForm, res);
|
|
|
|
|
|
|
|
|
|
this.$integrateData(this.form, this.fieldsAll);
|
|
|
|
|
this.$integrateData(this.form,res.fileds || {});
|
|
|
|
|
},
|
|
|
|
|
async getTemplate() {
|
|
|
|
|
const res = await filedIndex(
|
|
|
|
|
@ -334,6 +344,7 @@ export default {
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
if (res?.data) {
|
|
|
|
|
this.form = {}
|
|
|
|
|
res?.data.forEach((item) => {
|
|
|
|
|
Object.defineProperty(this.form, item.en, {
|
|
|
|
|
value: "",
|
|
|
|
|
@ -341,7 +352,6 @@ export default {
|
|
|
|
|
enumerable: true,
|
|
|
|
|
configurable: false,
|
|
|
|
|
});
|
|
|
|
|
//this.form[item.en] = "";
|
|
|
|
|
this.rules[item.en] = {
|
|
|
|
|
validator: (rule, value, callback) => {
|
|
|
|
|
if (!this.form[item.en]) {
|
|
|
|
|
@ -357,7 +367,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.formInfo = res?.data ?? [];
|
|
|
|
|
this.$integrateData(this.form, this.fieldsAll);
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
@ -389,6 +398,11 @@ export default {
|
|
|
|
|
this.form = {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"originalForm.year":{
|
|
|
|
|
handler:function (val) {
|
|
|
|
|
this.originalForm.year = val.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
//this.getTemplate()
|
|
|
|
|
|