master
xy 3 years ago
parent 1f05d28893
commit 2e1f3898e9

@ -11,42 +11,54 @@
<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"-->
<!-- size="small"--> <!-- size="small"-->
<!-- type="year"--> <!-- type="year"-->
<!-- placement="bottom"--> <!-- placement="bottom"-->
<!-- placeholder="年份选择"--> <!-- placeholder="年份选择"-->
<!-- style="width: 160px; margin-right: 6px"--> <!-- style="width: 160px; margin-right: 6px"-->
<!-- value-format="yyyy"--> <!-- value-format="yyyy"-->
<!-- v-model="select.year"--> <!-- v-model="select.year"-->
<!-- @change="getTemplate"--> <!-- @change="getTemplate"-->
<!-- ></el-date-picker>--> <!-- ></el-date-picker>-->
<!-- <el-select--> <!-- <el-select-->
<!-- ref="templateSelect"--> <!-- ref="templateSelect"-->
<!-- v-model="select.template_item_id"--> <!-- v-model="select.template_item_id"-->
<!-- size="small"--> <!-- size="small"-->
<!-- placeholder="模板类型"--> <!-- placeholder="模板类型"-->
<!-- style="width: 160px; margin-right: 6px"--> <!-- style="width: 160px; margin-right: 6px"-->
<!-- >--> <!-- >-->
<!-- <el-option-group--> <!-- <el-option-group-->
<!-- v-for="group in templates"--> <!-- v-for="group in templates"-->
<!-- :key="group.id"--> <!-- :key="group.id"-->
<!-- :label="String(group.year)"--> <!-- :label="String(group.year)"-->
<!-- >--> <!-- >-->
<!-- <el-option--> <!-- <el-option-->
<!-- v-for="item in group.items"--> <!-- v-for="item in group.items"-->
<!-- :key="item.id"--> <!-- :key="item.id"-->
<!-- :label="item.name"--> <!-- :label="item.name"-->
<!-- :value="item.id"--> <!-- :value="item.id"-->
<!-- >--> <!-- >-->
<!-- </el-option>--> <!-- </el-option>-->
<!-- </el-option-group>--> <!-- </el-option-group>-->
<!-- </el-select>--> <!-- </el-select>-->
<el-input <el-input
v-model="select.keyword" v-model="select.keyword"
@ -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)
" "
@ -69,11 +82,11 @@
> >
</template> </template>
<template v-slot:export> <template v-slot:export>
<!-- <Button--> <!-- <Button-->
<!-- type="primary"--> <!-- type="primary"-->
<!-- @click="downTemplate"--> <!-- @click="downTemplate"-->
<!-- >下载模板</Button--> <!-- >下载模板</Button-->
<!-- >--> <!-- >-->
<el-dropdown @command="downTemplate"> <el-dropdown @command="downTemplate">
<el-button size="small" type="primary"> <el-button size="small" type="primary">
下载模板<i class="el-icon-arrow-down el-icon--right"></i> 下载模板<i class="el-icon-arrow-down el-icon--right"></i>
@ -92,9 +105,10 @@
<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 =
($refs['importRecruitInfo'].select.year = select.year), select.template_id),
($refs['importRecruitInfo'].select.year = select.year),
(isShowImportRecruitInfo = true) (isShowImportRecruitInfo = true)
" "
>导入信息</Button >导入信息</Button
@ -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="
select.page = 1; (e) => {
select.page_size = e; select.page = 1;
getList(); select.page_size = e;
}" getList();
@pageIndexChange="e => { }
select.page = e; "
getList() @pageIndexChange="
}" (e) => {
select.page = e;
getList();
}
"
@sort-change="sortChange" @sort-change="sortChange"
></xy-table> ></xy-table>
@ -150,16 +169,16 @@
@refresh="getList" @refresh="getList"
></importRecruitInfo> ></importRecruitInfo>
<!-- <el-dialog--> <!-- <el-dialog-->
<!-- title="提示"--> <!-- title="提示"-->
<!-- :visible.sync="isShowTip"--> <!-- :visible.sync="isShowTip"-->
<!-- width="30%"--> <!-- width="30%"-->
<!-- center>--> <!-- center>-->
<!-- <span>当前选择导入的模板为{{ getTemplateItemName() }}</span>--> <!-- <span>当前选择导入的模板为{{ getTemplateItemName() }}</span>-->
<!-- <span slot="footer" class="dialog-footer">--> <!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="isShowTip = false"> </el-button>--> <!-- <el-button type="primary" @click="isShowTip = false"> </el-button>-->
<!-- </span>--> <!-- </span>-->
<!-- </el-dialog>--> <!-- </el-dialog>-->
</div> </div>
</template> </template>
@ -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,
@ -188,9 +207,9 @@ export default {
}, },
data() { data() {
return { return {
sortFlag:0, sortFlag: 0,
isShowTip:false, isShowTip: false,
tipTemplate:"", tipTemplate: "",
isShowImportRecruitInfo: false, isShowImportRecruitInfo: false,
isShowAdd: false, isShowAdd: false,
provinces: [], provinces: [],
@ -199,8 +218,9 @@ export default {
page: 1, page: 1,
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",
@ -248,31 +268,31 @@ export default {
index, index,
destroy, destroy,
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,18 +304,18 @@ 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;
try{ try {
let res = await index(this.select, false); let res = await index(this.select, false);
this.total = res.total ?? 0; this.total = res.total ?? 0;
this.list = res.data.map((item) => { this.list = res.data.map((item) => {
@ -304,7 +324,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.$refs["xyTable"].loading = false; this.$refs["xyTable"].loading = false;
}, 500); }, 500);
}catch (e){ } catch (e) {
setTimeout(() => { setTimeout(() => {
this.$refs["xyTable"].loading = false; this.$refs["xyTable"].loading = false;
}, 500); }, 500);
@ -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), {
},`${temp[0] || ''}模板.xlsx`); template_item_id: Number(temp[1] || 1),
},
`${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