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