master
xy 3 years ago
parent 1f05d28893
commit 2e1f3898e9

@ -11,8 +11,20 @@
<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 ref="yearSelect" v-model="select.template_id" size="small" placeholder="请选择年份" style="width: 160px; margin-right: 6px" @change="getTemplateItems"> <el-select
<el-option v-for="item in templates" :label="item.year" :value="item.id" :key="item.id"></el-option> 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-select> </el-select>
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- :clearable="false"--> <!-- :clearable="false"-->
@ -61,7 +73,8 @@
<Button <Button
type="primary" type="primary"
@click=" @click="
($refs['addRecruit'].originalForm.template_id = select.template_id), ($refs['addRecruit'].originalForm.template_id =
select.template_id),
($refs['addRecruit'].type = 'add'), ($refs['addRecruit'].type = 'add'),
(isShowAdd = true) (isShowAdd = true)
" "
@ -92,8 +105,9 @@
<Button <Button
type="primary" type="primary"
@click=" @click="
isShowTip = true, (isShowTip = true),
($refs['importRecruitInfo'].select.template_id = select.template_id), ($refs['importRecruitInfo'].select.template_id =
select.template_id),
($refs['importRecruitInfo'].select.year = select.year), ($refs['importRecruitInfo'].select.year = select.year),
(isShowImportRecruitInfo = true) (isShowImportRecruitInfo = true)
" "
@ -115,22 +129,27 @@
@editor=" @editor="
(row) => { (row) => {
$refs['addRecruit'].originalForm.template_id = select.template_id; $refs['addRecruit'].originalForm.template_id = select.template_id;
$refs['addRecruit'].originalForm.template_item_id = row.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;
} }
" "
@destroyed="getList" @destroyed="getList"
@pageSizeChange="e => { @pageSizeChange="
(e) => {
select.page = 1; select.page = 1;
select.page_size = e; select.page_size = e;
getList(); getList();
}" }
@pageIndexChange="e => { "
@pageIndexChange="
(e) => {
select.page = e; select.page = e;
getList() getList();
}" }
"
@sort-change="sortChange" @sort-change="sortChange"
></xy-table> ></xy-table>
@ -167,7 +186,7 @@
import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit"; import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit";
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 { index as filedIndex } from "@/api/unifiedRecruitment/templateFiled" import { index as filedIndex } from "@/api/unifiedRecruitment/templateFiled";
import { import {
show as templateShow, show as templateShow,
index as templateIndex, index as templateIndex,
@ -200,7 +219,8 @@ export default {
page_size: 10, page_size: 10,
template_id: "", template_id: "",
sort_name: "", sort_name: "",
sort_type:"" sort_type: "",
year: "",
}, },
templateItems: [], templateItems: [],
templates: [], templates: [],
@ -227,7 +247,7 @@ export default {
{ {
prop: "idcard", prop: "idcard",
label: "身份证号", label: "身份证号",
width: 180 width: 180,
}, },
{ {
prop: "candidate_no", prop: "candidate_no",
@ -250,29 +270,29 @@ export default {
sortChange({ column, prop, order }) { sortChange({ column, prop, order }) {
if (prop === this.select.sort_name) { if (prop === this.select.sort_name) {
this.sortFlag ++ this.sortFlag++;
} else { } else {
this.sortFlag = 0 this.sortFlag = 0;
} }
this.select.sort_name = prop; this.select.sort_name = prop;
this.select.sort_type = ['ASC','DESC',null][this.sortFlag % 3] this.select.sort_type = ["ASC", "DESC", null][this.sortFlag % 3];
this.select.page = 1 this.select.page = 1;
this.getList() this.getList();
}, },
async getTemplateItems() { async getTemplateItems() {
const res = await templateItemIndex({ const res = await templateItemIndex({
template_id: this.select.template_id, template_id: this.select.template_id,
page_size: 999, page_size: 999,
page:1 page: 1,
}) });
this.templateItems = res.data this.templateItems = res.data;
}, },
async getTemplateItemDetail() { async getTemplateItemDetail() {
const res = await templateShow({ const res = await templateShow({
id:this.select.template_id id: this.select.template_id,
}) });
let temp = let temp =
res?.fileds?.map((item) => { res?.fileds?.map((item) => {
@ -284,14 +304,14 @@ export default {
}) ?? []; }) ?? [];
let totalTable = [...this.originalTable, ...temp]; let totalTable = [...this.originalTable, ...temp];
let set = new Set(); let set = new Set();
this.table = totalTable.filter(a => { this.table = totalTable.filter((a) => {
if (set.has(a.prop)) { if (set.has(a.prop)) {
return false; return false;
} else { } else {
set.add(a.prop); set.add(a.prop);
return true; return true;
} }
}) });
}, },
async getList() { async getList() {
this.$refs["xyTable"].loading = true; this.$refs["xyTable"].loading = true;
@ -355,10 +375,13 @@ export default {
}, },
downTemplate(command) { downTemplate(command) {
let temp = command.split('`') let temp = command.split("`");
exports({ exports(
{
template_item_id: Number(temp[1] || 1), template_item_id: Number(temp[1] || 1),
},`${temp[0] || ''}模板.xlsx`); },
`${temp[0] || ""}模板.xlsx`
);
}, },
}, },
computed: { computed: {
@ -373,7 +396,7 @@ export default {
await this.getTemplateItems(); await this.getTemplateItems();
await this.getProvinces(); await this.getProvinces();
await this.getList(); await this.getList();
} },
}; };
</script> </script>

Loading…
Cancel
Save