master
xy 3 years ago
parent a9f90c7ee7
commit de18f212aa

@ -206,6 +206,7 @@ export default {
getTableData(isRefresh = false) {
if (isRefresh) {
this.selectOpt.page = 1;
this.listData = [];
}
setTimeout(() => {
switch (typeof this.action) {
@ -840,7 +841,7 @@ export default {
}
.xy-table__page {
display: flex;
justify-content: right;
justify-content: flex-end;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
background: rgba(140, 140, 140, 0.6);

@ -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 yeartemplate_item_idnameidcard
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()

@ -18,7 +18,7 @@
style="width: 160px"
value-format="yyyy"
v-model="select.year"
@change="$refs['xyTable'].getTableData()"
@change="$refs['xyTable'].getTableData(true)"
></el-date-picker>
</template>
<template v-slot:init>

@ -129,7 +129,6 @@
:destroy-action="destroy"
@editor="
(row) => {
selectedFileds = row.fileds_all;
$refs['addRecruit'].originalForm.template_id = select.template_id;
$refs['addRecruit'].originalForm.template_item_id =
row.template_item_id;
@ -165,7 +164,6 @@
:is-show.sync="isShowAdd"
:province_ids="provinces"
:template-items="templateItems"
:fields-all="selectedFileds"
ref="addRecruit"
@refresh="getList"
></addRecruit>
@ -216,7 +214,6 @@ export default {
},
data() {
return {
selectedFileds: {},
sortFlag: 0,
isShowTip: false,
tipTemplate: "",

@ -18,7 +18,7 @@
style="width: 160px"
value-format="yyyy"
v-model="select.year"
@change="$refs['xyTable'].getTableData()"
@change="$refs['xyTable'].getTableData(true)"
></el-date-picker>
</template>
<template v-slot:create>

@ -18,7 +18,7 @@
style="width: 160px"
value-format="yyyy"
v-model="select.year"
@change="$refs['xyTable'].getTableData()"
@change="$refs['xyTable'].getTableData(true)"
></el-date-picker>
</template>
<template v-slot:create>

Loading…
Cancel
Save