master
xy 3 years ago
parent 58da0d8c7b
commit ce400bfef9

@ -1,5 +1,5 @@
<script> <script>
import { index as filedIndex} from "@/api/unifiedRecruitment/templateFiled" import { index as filedIndex } from "@/api/unifiedRecruitment/templateFiled";
import { show as templateShow } from "@/api/unifiedRecruitment/template"; import { show as templateShow } from "@/api/unifiedRecruitment/template";
import { show, save } from "@/api/unifiedRecruitment/recruit"; import { show, save } from "@/api/unifiedRecruitment/recruit";
@ -26,29 +26,43 @@ export default {
> >
取消 取消
</Button> </Button>
<Button type="primary" on={{ ["click"]: (e) => { <Button
this.$refs["oriElForm"].validate().then((res) => { type="primary"
if (res) { on={{
this.$refs["elForm"].validate().then((res) => { ["click"]: (e) => {
Object.defineProperty(this.originalForm, "fileds", { this.$refs["oriElForm"].validate().then((res) => {
enumerable: true, if (res) {
writable: true, this.$refs["elForm"].validate().then((res) => {
configurable: false, if (this.type === "editor") {
value: this.form, Object.defineProperty(this.originalForm, "id", {
}); enumerable: true,
writable: true,
configurable: false,
value: this.id,
});
}
save(this.originalForm).then((res) => { Object.defineProperty(this.originalForm, "fileds", {
this.$message({ enumerable: true,
type: "success", writable: true,
message: res.msg, configurable: false,
value: this.form,
});
save(this.originalForm).then((res) => {
this.$message({
type: "success",
message: res.msg,
});
this.$emit("refresh");
this.$emit("update:isShow", false);
}); });
this.$emit("refresh");
this.$emit("update:isShow", false);
}); });
}); }
} });
}); },
} }}> }}
>
确认 确认
</Button> </Button>
</div> </div>
@ -68,13 +82,11 @@ export default {
clearable={true} clearable={true}
v-model={this.originalForm.template_item_id} v-model={this.originalForm.template_item_id}
placeholder="请选择模板" placeholder="请选择模板"
on={ on={{
{ ["change"]: (e) => {
['change']:e => { this.getTemplate();
this.getTemplate() },
} }}
}
}
> >
{this.templateItems.map((item) => { {this.templateItems.map((item) => {
return ( return (
@ -93,11 +105,12 @@ export default {
<el-date-picker <el-date-picker
clearable={true} clearable={true}
placeholder="请选择年份" placeholder="请选择年份"
v-model={this.originalForm.year} value={String(this.originalForm.year)}
type="year" type="year"
value-format="yyyy" value-format="yyyy"
on={{ on={{
["change"]: (e) => { ["change"]: (e) => {
this.originalForm.year = e;
this.getTemplate(); this.getTemplate();
}, },
}} }}
@ -223,7 +236,7 @@ export default {
default: false, default: false,
}, },
province_ids: Array, province_ids: Array,
templateItems:Array, templateItems: Array,
}, },
data() { data() {
let idcardValidate = (rule, value, callback) => { let idcardValidate = (rule, value, callback) => {
@ -238,6 +251,7 @@ export default {
} }
}; };
return { return {
id: "",
type: "", type: "",
// //
@ -253,7 +267,7 @@ export default {
candidate_no: "", candidate_no: "",
allow_no: "", allow_no: "",
template_id: "", template_id: "",
template_item_id:"" template_item_id: "",
}, },
originalRules: { originalRules: {
year: [{ required: true, message: "请选择年份", trigger: "blur" }], year: [{ required: true, message: "请选择年份", trigger: "blur" }],
@ -275,13 +289,21 @@ export default {
}; };
}, },
methods: { methods: {
async getDetail() {
const res = await show({
id: this.id,
});
console.log("data", res);
this.$integrateData(this.originalForm, res);
this.$integrateData(this.form, res.fileds);
},
async getTemplate() { async getTemplate() {
const res = await filedIndex( const res = await filedIndex(
{ {
template_item_id: this.originalForm.template_item_id, template_item_id: this.originalForm.template_item_id,
template_id:this.originalForm.template_id, template_id: this.originalForm.template_id,
page:1, page: 1,
page_size:999 page_size: 999,
}, },
true true
); );
@ -313,15 +335,32 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
}, },
computed:{ computed: {
provincesFormat(){ provincesFormat() {
return this.$route.meta.params.type == 2 ? this.province_ids.filter(item => item.name == '江苏') : this.province_ids return this.$route.meta.params.type == 2
} ? this.province_ids.filter((item) => item.name == "江苏")
: this.province_ids;
},
}, },
watch: { watch: {
async isShow(newVal) { async isShow(newVal) {
if (newVal) { if (newVal) {
//await this.getTemplate(); if (this.type === "editor") {
await this.getTemplate();
await this.getDetail();
}
} else {
this.originalForm = {
year: `${new Date().getFullYear()}`,
province_id: "",
name: "",
idcard: "",
candidate_no: "",
allow_no: "",
template_id: "",
template_item_id: "",
};
this.form = {}
} }
}, },
}, },

@ -11,7 +11,7 @@
<header-content :auths="auths_auth_mixin"> <header-content :auths="auths_auth_mixin">
<template v-slot:search> <template v-slot:search>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<el-select v-model="select.template_id" size="small" placeholder="请选择年份" style="width: 160px; margin-right: 6px" @change="getTemplateItems"> <el-select ref="yearSelect" v-model="select.template_id" size="small" placeholder="请选择年份" style="width: 160px; margin-right: 6px" @change="getTemplateItems">
<el-option v-for="item in templates" :label="item.year" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in templates" :label="item.year" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
<!-- <el-date-picker--> <!-- <el-date-picker-->
@ -82,7 +82,7 @@
<el-dropdown-item <el-dropdown-item
v-for="item in templateItems" v-for="item in templateItems"
:key="item.id" :key="item.id"
:command="item.name" :command="`${item.name}\`${item.id}`"
>{{ item.name }}</el-dropdown-item >{{ item.name }}</el-dropdown-item
> >
</el-dropdown-menu> </el-dropdown-menu>
@ -114,8 +114,8 @@
:destroy-action="destroy" :destroy-action="destroy"
@editor=" @editor="
(row) => { (row) => {
$refs['addRecruit'].form.template_id = select.template_id; $refs['addRecruit'].originalForm.template_id = select.template_id;
$refs['addRecruit'].form.template_item_id = select.template_item_id; $refs['addRecruit'].originalForm.template_item_id = row.template_item_id;
$refs['addRecruit'].id = row.id; $refs['addRecruit'].id = row.id;
$refs['addRecruit'].type = 'editor'; $refs['addRecruit'].type = 'editor';
isShowAdd = true; isShowAdd = true;
@ -139,7 +139,7 @@
:province_ids="provinces" :province_ids="provinces"
:template-items="templateItems" :template-items="templateItems"
ref="addRecruit" ref="addRecruit"
@refresh="$refs['xyTable'].getTableData()" @refresh="getList"
></addRecruit> ></addRecruit>
<importRecruitInfo <importRecruitInfo
@ -346,10 +346,10 @@ export default {
}, },
downTemplate(command) { downTemplate(command) {
let temp = command.split('`')
exports({ exports({
year: this.select.year, template_item_id: Number(temp[1] || 1),
template_item_id: this.select.template_item_id, },`${temp[0] || ''}模板.xlsx`);
},`${command}模板.xlsx`);
}, },
}, },
computed: { computed: {

@ -145,6 +145,11 @@ export default {
label: "选科", label: "选科",
width: 180, width: 180,
}, },
{
prop: "specialize_name",
label: "专业",
width: 180,
},
{ {
prop: "max_socre", prop: "max_socre",
label: "最高分", label: "最高分",

@ -72,7 +72,7 @@
import { index, destroy } from "@/api/yearScore/yearScore"; import { index, destroy } from "@/api/yearScore/yearScore";
import { authMixin } from "@/mixin/authMixin"; import { authMixin } from "@/mixin/authMixin";
import { index as provinceIndex } from "@/api/manage/province"; import { index as provinceIndex } from "@/api/manage/province";
import { destroy as des } from "@/api/yearScore/yearScoreDetail"
import addYearScore from "./component/addYearScore.vue"; import addYearScore from "./component/addYearScore.vue";
import imports from "./component/imports.vue"; import imports from "./component/imports.vue";
export default { export default {

Loading…
Cancel
Save