You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
5.6 KiB

3 years ago
<template>
<div>
3 years ago
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增统招进度' : '编辑统招进度'"
:form="form"
:rules="rules"
@submit="submit"
>
3 years ago
<template v-slot:year>
<div class="xy-table-item">
<div class="xy-table-item-label">
3 years ago
<span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>
3 years ago
年份
</div>
<div class="xy-table-item-content">
3 years ago
<el-date-picker
v-model="form.year"
type="year"
placeholder="请选择年份"
style="width: 300px"
value-format="yyyy"
></el-date-picker>
3 years ago
</div>
</div>
</template>
<template v-slot:province_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
3 years ago
<span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>
3 years ago
省份
</div>
<div class="xy-table-item-content">
3 years ago
<el-select
v-model="form.province_id"
clearable
placeholder="请选择省份 "
style="width: 300px"
>
<el-option
v-for="item in province_ids"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
3 years ago
</el-select>
</div>
</div>
</template>
<template v-slot:status_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
3 years ago
<span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>
3 years ago
进度
</div>
<div class="xy-table-item-content">
3 years ago
<el-select
v-model="form.status_id"
clearable
placeholder="请选择进度 "
style="width: 300px"
>
<el-option
v-for="item in getConst('progressStatus', 'array')"
:key="item.id"
:label="item.value"
:value="item.id"
></el-option>
3 years ago
</el-select>
</div>
</div>
</template>
<template v-slot:start_date>
<div class="xy-table-item">
3 years ago
<div class="xy-table-item-label">开始时间 </div>
3 years ago
<div class="xy-table-item-content">
3 years ago
<el-date-picker
v-model="form.start_date"
placeholder="请选择开始时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
3 years ago
</div>
</div>
</template>
<template v-slot:end_date>
<div class="xy-table-item">
3 years ago
<div class="xy-table-item-label">结束时间 </div>
3 years ago
<div class="xy-table-item-content">
3 years ago
<el-date-picker
v-model="form.end_date"
placeholder="请选择结束时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
3 years ago
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
3 years ago
<div class="xy-table-item-label">备注 </div>
3 years ago
<div class="xy-table-item-content">
3 years ago
<el-input
type="textarea"
:autosize="{ minRows: 2 }"
v-model="form.remark"
clearable
placeholder="请输入备注 "
style="width: 300px"
/>
3 years ago
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
3 years ago
import { show, save } from "@/api/unifiedRecruitment/progress";
import { getConst } from "@/const";
export default {
props: {
province_ids: {
type: Array,
default: () => [],
3 years ago
},
3 years ago
},
data() {
return {
isShow: false,
id: "",
type: "",
3 years ago
3 years ago
form: {
year: "",
province_id: "",
status_id: "",
start_date: "",
end_date: "",
remark: "",
},
rules: {
year: [
{
3 years ago
required: true,
3 years ago
message: "请填写年份",
},
],
province_id: [
{
3 years ago
required: true,
3 years ago
message: "请填写省份",
},
],
status_id: [
{
3 years ago
required: true,
3 years ago
message: "请填写进度",
},
],
3 years ago
},
3 years ago
};
},
methods: {
getConst,
3 years ago
3 years ago
async getDetail() {
const res = await show({
id: this.id,
});
this.$integrateData(this.form, res);
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
3 years ago
}
}
3 years ago
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
save(this.form).then((res) => {
this.$successMessage(this.type, "");
this.isShow = false;
this.$emit("refresh");
});
3 years ago
},
3 years ago
},
watch: {
isShow(val) {
if (val) {
if (this.type === "editor") {
this.getDetail();
3 years ago
}
3 years ago
} else {
this.id = "";
this.type = "";
this.$refs["dialog"].reset();
delete this.form.id;
3 years ago
}
3 years ago
},
"form.year"(val) {
this.form.year = "" + val;
},
},
};
3 years ago
</script>
<style scoped lang="scss">
3 years ago
::v-deep .el-input__inner {
text-align: left;
}
3 years ago
</style>