master
xy 3 years ago
parent 1f05d28893
commit 2e1f3898e9

@ -11,42 +11,54 @@
<header-content :auths="auths_auth_mixin">
<template v-slot:search>
<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-option v-for="item in templates" :label="item.year" :value="item.id" :key="item.id"></el-option>
<el-select
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-date-picker-->
<!-- :clearable="false"-->
<!-- size="small"-->
<!-- type="year"-->
<!-- placement="bottom"-->
<!-- placeholder="年份选择"-->
<!-- style="width: 160px; margin-right: 6px"-->
<!-- value-format="yyyy"-->
<!-- v-model="select.year"-->
<!-- @change="getTemplate"-->
<!-- ></el-date-picker>-->
<!-- <el-date-picker-->
<!-- :clearable="false"-->
<!-- size="small"-->
<!-- type="year"-->
<!-- placement="bottom"-->
<!-- placeholder="年份选择"-->
<!-- style="width: 160px; margin-right: 6px"-->
<!-- value-format="yyyy"-->
<!-- v-model="select.year"-->
<!-- @change="getTemplate"-->
<!-- ></el-date-picker>-->
<!-- <el-select-->
<!-- ref="templateSelect"-->
<!-- 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-select-->
<!-- ref="templateSelect"-->
<!-- 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
v-model="select.keyword"
@ -61,7 +73,8 @@
<Button
type="primary"
@click="
($refs['addRecruit'].originalForm.template_id = select.template_id),
($refs['addRecruit'].originalForm.template_id =
select.template_id),
($refs['addRecruit'].type = 'add'),
(isShowAdd = true)
"
@ -69,11 +82,11 @@
>
</template>
<template v-slot:export>
<!-- <Button-->
<!-- type="primary"-->
<!-- @click="downTemplate"-->
<!-- >下载模板</Button-->
<!-- >-->
<!-- <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>
@ -92,9 +105,10 @@
<Button
type="primary"
@click="
isShowTip = true,
($refs['importRecruitInfo'].select.template_id = select.template_id),
($refs['importRecruitInfo'].select.year = select.year),
(isShowTip = true),
($refs['importRecruitInfo'].select.template_id =
select.template_id),
($refs['importRecruitInfo'].select.year = select.year),
(isShowImportRecruitInfo = true)
"
>导入信息</Button
@ -115,22 +129,27 @@
@editor="
(row) => {
$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'].type = 'editor';
isShowAdd = true;
}
"
@destroyed="getList"
@pageSizeChange="e => {
select.page = 1;
select.page_size = e;
getList();
}"
@pageIndexChange="e => {
select.page = e;
getList()
}"
@pageSizeChange="
(e) => {
select.page = 1;
select.page_size = e;
getList();
}
"
@pageIndexChange="
(e) => {
select.page = e;
getList();
}
"
@sort-change="sortChange"
></xy-table>
@ -150,16 +169,16 @@
@refresh="getList"
></importRecruitInfo>
<!-- <el-dialog-->
<!-- title="提示"-->
<!-- :visible.sync="isShowTip"-->
<!-- width="30%"-->
<!-- center>-->
<!-- <span>当前选择导入的模板为{{ getTemplateItemName() }}</span>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="isShowTip = false"> </el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
<!-- <el-dialog-->
<!-- title="提示"-->
<!-- :visible.sync="isShowTip"-->
<!-- width="30%"-->
<!-- center>-->
<!-- <span>当前选择导入的模板为{{ getTemplateItemName() }}</span>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="isShowTip = false"> </el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
</div>
</template>
@ -167,7 +186,7 @@
import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit";
import { authMixin } from "@/mixin/authMixin";
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 {
show as templateShow,
index as templateIndex,
@ -188,9 +207,9 @@ export default {
},
data() {
return {
sortFlag:0,
isShowTip:false,
tipTemplate:"",
sortFlag: 0,
isShowTip: false,
tipTemplate: "",
isShowImportRecruitInfo: false,
isShowAdd: false,
provinces: [],
@ -199,8 +218,9 @@ export default {
page: 1,
page_size: 10,
template_id: "",
sort_name:"",
sort_type:""
sort_name: "",
sort_type: "",
year: "",
},
templateItems: [],
templates: [],
@ -227,7 +247,7 @@ export default {
{
prop: "idcard",
label: "身份证号",
width: 180
width: 180,
},
{
prop: "candidate_no",
@ -248,31 +268,31 @@ export default {
index,
destroy,
sortChange({ column, prop, order }){
if(prop === this.select.sort_name){
this.sortFlag ++
}else{
this.sortFlag = 0
sortChange({ column, prop, order }) {
if (prop === this.select.sort_name) {
this.sortFlag++;
} else {
this.sortFlag = 0;
}
this.select.sort_name = prop;
this.select.sort_type = ['ASC','DESC',null][this.sortFlag % 3]
this.select.page = 1
this.getList()
this.select.sort_type = ["ASC", "DESC", null][this.sortFlag % 3];
this.select.page = 1;
this.getList();
},
async getTemplateItems(){
async getTemplateItems() {
const res = await templateItemIndex({
template_id:this.select.template_id,
page_size:999,
page:1
})
this.templateItems = res.data
template_id: this.select.template_id,
page_size: 999,
page: 1,
});
this.templateItems = res.data;
},
async getTemplateItemDetail() {
const res = await templateShow({
id:this.select.template_id
})
id: this.select.template_id,
});
let temp =
res?.fileds?.map((item) => {
@ -284,18 +304,18 @@ export default {
}) ?? [];
let totalTable = [...this.originalTable, ...temp];
let set = new Set();
this.table = totalTable.filter(a => {
this.table = totalTable.filter((a) => {
if (set.has(a.prop)) {
return false;
} else {
set.add(a.prop);
return true;
}
})
});
},
async getList() {
this.$refs["xyTable"].loading = true;
try{
try {
let res = await index(this.select, false);
this.total = res.total ?? 0;
this.list = res.data.map((item) => {
@ -304,7 +324,7 @@ export default {
setTimeout(() => {
this.$refs["xyTable"].loading = false;
}, 500);
}catch (e){
} catch (e) {
setTimeout(() => {
this.$refs["xyTable"].loading = false;
}, 500);
@ -355,10 +375,13 @@ export default {
},
downTemplate(command) {
let temp = command.split('`')
exports({
template_item_id: Number(temp[1] || 1),
},`${temp[0] || ''}模板.xlsx`);
let temp = command.split("`");
exports(
{
template_item_id: Number(temp[1] || 1),
},
`${temp[0] || ""}模板.xlsx`
);
},
},
computed: {
@ -373,7 +396,7 @@ export default {
await this.getTemplateItems();
await this.getProvinces();
await this.getList();
}
},
};
</script>

Loading…
Cancel
Save