|
|
|
|
@ -12,6 +12,7 @@
|
|
|
|
|
<template v-slot:search>
|
|
|
|
|
<div style="display: flex; align-items: center">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
:clearable="false"
|
|
|
|
|
size="small"
|
|
|
|
|
type="year"
|
|
|
|
|
placement="bottom"
|
|
|
|
|
@ -19,10 +20,28 @@
|
|
|
|
|
style="width: 160px; margin-right: 6px"
|
|
|
|
|
value-format="yyyy"
|
|
|
|
|
v-model="select.year"
|
|
|
|
|
@change="getTemplate"
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
|
|
|
|
|
<el-select v-model="select.template_item_id" size="small" placeholder="模板类型" style="width: 160px; margin-right: 6px">
|
|
|
|
|
<el-option v-for="item in templateItems" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="select.template_item_id"
|
|
|
|
|
size="small"
|
|
|
|
|
placeholder="模板类型"
|
|
|
|
|
style="width: 160px; margin-right: 6px"
|
|
|
|
|
>
|
|
|
|
|
<el-option-group
|
|
|
|
|
v-for="group in templates"
|
|
|
|
|
:key="group.id"
|
|
|
|
|
:label="String(group.year)"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in group.items"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-option-group>
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
@ -37,29 +56,41 @@
|
|
|
|
|
<template v-slot:create>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="($refs['addRecruit'].type = 'add'), (isShowAdd = true)"
|
|
|
|
|
@click="
|
|
|
|
|
($refs['addRecruit'].form.template_id = select.template_id),
|
|
|
|
|
($refs['addRecruit'].form.template_item_id =
|
|
|
|
|
select.template_item_id),
|
|
|
|
|
($refs['addRecruit'].type = 'add'),
|
|
|
|
|
(isShowAdd = true)
|
|
|
|
|
"
|
|
|
|
|
>新建</Button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:export>
|
|
|
|
|
<el-dropdown @command="downTemplate">
|
|
|
|
|
<el-button size="small" type="primary">
|
|
|
|
|
下载模板<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
<el-dropdown-item
|
|
|
|
|
v-for="item in templateItems"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:command="item.id"
|
|
|
|
|
>{{ item.name }}</el-dropdown-item
|
|
|
|
|
>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="downTemplate"
|
|
|
|
|
>下载模板</Button
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-dropdown @command="downTemplate">-->
|
|
|
|
|
<!-- <el-button size="small" type="primary">-->
|
|
|
|
|
<!-- 下载模板<i class="el-icon-arrow-down el-icon--right"></i>-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!-- <el-dropdown-menu slot="dropdown">-->
|
|
|
|
|
<!-- <el-dropdown-item-->
|
|
|
|
|
<!-- v-for="item in templateItems"-->
|
|
|
|
|
<!-- :key="item.id"-->
|
|
|
|
|
<!-- :command="item.id"-->
|
|
|
|
|
<!-- >{{ item.name }}</el-dropdown-item-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- </el-dropdown-menu>-->
|
|
|
|
|
<!-- </el-dropdown>-->
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:import>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="
|
|
|
|
|
($refs['importRecruitInfo'].select.template_item_id = select.template_item_id),
|
|
|
|
|
($refs['importRecruitInfo'].select.year = select.year),
|
|
|
|
|
(isShowImportRecruitInfo = true)
|
|
|
|
|
"
|
|
|
|
|
@ -81,6 +112,7 @@
|
|
|
|
|
@editor="
|
|
|
|
|
(row) => {
|
|
|
|
|
$refs['addRecruit'].form.template_id = select.template_id;
|
|
|
|
|
$refs['addRecruit'].form.template_item_id = select.template_item_id;
|
|
|
|
|
$refs['addRecruit'].id = row.id;
|
|
|
|
|
$refs['addRecruit'].type = 'editor';
|
|
|
|
|
isShowAdd = true;
|
|
|
|
|
@ -100,7 +132,7 @@
|
|
|
|
|
ref="importRecruitInfo"
|
|
|
|
|
:province_ids="provinces"
|
|
|
|
|
:is-show.sync="isShowImportRecruitInfo"
|
|
|
|
|
@refresh="$refs['xyTable'].getTableData()"
|
|
|
|
|
@refresh="getList"
|
|
|
|
|
></importRecruitInfo>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
@ -109,9 +141,15 @@
|
|
|
|
|
import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit";
|
|
|
|
|
import { authMixin } from "@/mixin/authMixin";
|
|
|
|
|
import { index as provinceIndex } from "@/api/manage/province";
|
|
|
|
|
import { show as templateShow } from "@/api/unifiedRecruitment/template";
|
|
|
|
|
import {
|
|
|
|
|
show as templateShow,
|
|
|
|
|
index as templateIndex,
|
|
|
|
|
} from "@/api/unifiedRecruitment/template";
|
|
|
|
|
import { getConst } from "@/const";
|
|
|
|
|
import { index as templateItemIndex } from "@/api/unifiedRecruitment/templateItem";
|
|
|
|
|
import {
|
|
|
|
|
index as templateItemIndex,
|
|
|
|
|
show as templateItemShow,
|
|
|
|
|
} from "@/api/unifiedRecruitment/templateItem";
|
|
|
|
|
|
|
|
|
|
import addRecruit from "./component/addRecruit.vue";
|
|
|
|
|
import importRecruitInfo from "./component/importRecruitInfo.vue";
|
|
|
|
|
@ -132,9 +170,10 @@ export default {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
template_id: "",
|
|
|
|
|
template_item_id:"",
|
|
|
|
|
template_item_id: "",
|
|
|
|
|
},
|
|
|
|
|
templateItems: [],
|
|
|
|
|
templates: [],
|
|
|
|
|
|
|
|
|
|
total: 0,
|
|
|
|
|
list: [],
|
|
|
|
|
@ -151,14 +190,9 @@ export default {
|
|
|
|
|
width: 120,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "province_id",
|
|
|
|
|
prop: "province.name",
|
|
|
|
|
label: "省份",
|
|
|
|
|
width: 120,
|
|
|
|
|
formatter: (cell, data, val) => {
|
|
|
|
|
return (
|
|
|
|
|
this.provinces.filter((item) => item.id === val)[0]?.name ?? ""
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "idcard",
|
|
|
|
|
@ -185,38 +219,18 @@ export default {
|
|
|
|
|
index,
|
|
|
|
|
destroy,
|
|
|
|
|
|
|
|
|
|
async getTemplateItem() {
|
|
|
|
|
const res = await templateItemIndex({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
template_id: this.select.template_id,
|
|
|
|
|
},false);
|
|
|
|
|
this.templateItems = res.data;
|
|
|
|
|
this.select.template_item_id = this.templateItems[0]?.id
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
this.$refs['xyTable'].loading = true
|
|
|
|
|
let res = await index(this.select, false);
|
|
|
|
|
this.total = res.total ?? 0;
|
|
|
|
|
this.list = res.data.map((item) => {
|
|
|
|
|
return item.fileds ? { ...item, ...item.fileds } : item;
|
|
|
|
|
});
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$refs['xyTable'].loading = false
|
|
|
|
|
},500)
|
|
|
|
|
},
|
|
|
|
|
async getProvinces() {
|
|
|
|
|
const res = await provinceIndex(
|
|
|
|
|
{
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.provinces = res.data;
|
|
|
|
|
},
|
|
|
|
|
async getTemplateItemDetail() {
|
|
|
|
|
if (!this.select.template_item_id) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "warning",
|
|
|
|
|
message: "当前年份无模板内容",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// const res = await templateItemShow({
|
|
|
|
|
// id: this.select.template_item_id,
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
async getTemplate() {
|
|
|
|
|
const res = await templateShow(
|
|
|
|
|
{
|
|
|
|
|
year: this.select.year,
|
|
|
|
|
@ -235,17 +249,73 @@ export default {
|
|
|
|
|
}) ?? [];
|
|
|
|
|
this.table = [...this.originalTable, ...temp];
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
this.$refs["xyTable"].loading = true;
|
|
|
|
|
try{
|
|
|
|
|
let res = await index(this.select, false);
|
|
|
|
|
this.total = res.total ?? 0;
|
|
|
|
|
this.list = res.data.map((item) => {
|
|
|
|
|
return item.fileds ? { ...item, ...item.fileds } : item;
|
|
|
|
|
});
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$refs["xyTable"].loading = false;
|
|
|
|
|
}, 500);
|
|
|
|
|
}catch (e){
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$refs["xyTable"].loading = false;
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getProvinces() {
|
|
|
|
|
const res = await provinceIndex(
|
|
|
|
|
{
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.provinces = res.data;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getTemplate() {
|
|
|
|
|
const res = await templateIndex({
|
|
|
|
|
type: Number(this.$route.meta.params.type),
|
|
|
|
|
year: this.select.year,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
});
|
|
|
|
|
this.templates = res.data;
|
|
|
|
|
this.select.template_id = this.templates[0]?.id;
|
|
|
|
|
this.select.template_item_id = this.templates[0]?.items[0]?.id;
|
|
|
|
|
// const res = await templateShow(
|
|
|
|
|
// {
|
|
|
|
|
// year: this.select.year,
|
|
|
|
|
// type: this.$route.meta.params?.type,
|
|
|
|
|
// },
|
|
|
|
|
// false
|
|
|
|
|
// );
|
|
|
|
|
// this.select.template_id = res.id;
|
|
|
|
|
// let temp =
|
|
|
|
|
// res?.fileds?.map((item) => {
|
|
|
|
|
// return {
|
|
|
|
|
// prop: item.en,
|
|
|
|
|
// label: item.name,
|
|
|
|
|
// width: 140,
|
|
|
|
|
// };
|
|
|
|
|
// }) ?? [];
|
|
|
|
|
// this.table = [...this.originalTable, ...temp];
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async search() {
|
|
|
|
|
await this.getTemplate();
|
|
|
|
|
await this.getTemplateItem();
|
|
|
|
|
//await this.getTemplate();
|
|
|
|
|
//await this.getTemplateItemDetail();
|
|
|
|
|
await this.getList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
downTemplate(command) {
|
|
|
|
|
downTemplate() {
|
|
|
|
|
exports({
|
|
|
|
|
year: this.select.year,
|
|
|
|
|
template_item_id: command,
|
|
|
|
|
template_item_id: this.select.template_item_id,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
@ -257,12 +327,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
async created() {
|
|
|
|
|
await this.getTemplate();
|
|
|
|
|
await this.getTemplateItem();
|
|
|
|
|
await this.getTemplateItemDetail();
|
|
|
|
|
await this.getProvinces();
|
|
|
|
|
await this.getList();
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|