|
|
|
|
@ -11,39 +11,42 @@
|
|
|
|
|
<header-content :auths="auths_auth_mixin">
|
|
|
|
|
<template v-slot:search>
|
|
|
|
|
<div style="display: flex; align-items: center">
|
|
|
|
|
<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 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-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"
|
|
|
|
|
@ -59,8 +62,6 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="
|
|
|
|
|
($refs['addRecruit'].originalForm.template_id = select.template_id),
|
|
|
|
|
($refs['addRecruit'].originalForm.template_item_id =
|
|
|
|
|
select.template_item_id),
|
|
|
|
|
($refs['addRecruit'].type = 'add'),
|
|
|
|
|
(isShowAdd = true)
|
|
|
|
|
"
|
|
|
|
|
@ -68,24 +69,24 @@
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:export>
|
|
|
|
|
<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>-->
|
|
|
|
|
<!-- <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.name"
|
|
|
|
|
>{{ item.name }}</el-dropdown-item
|
|
|
|
|
>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:import>
|
|
|
|
|
<Button
|
|
|
|
|
@ -93,7 +94,6 @@
|
|
|
|
|
@click="
|
|
|
|
|
isShowTip = true,
|
|
|
|
|
($refs['importRecruitInfo'].select.template_id = select.template_id),
|
|
|
|
|
($refs['importRecruitInfo'].select.template_item_id = select.template_item_id),
|
|
|
|
|
($refs['importRecruitInfo'].select.year = select.year),
|
|
|
|
|
(isShowImportRecruitInfo = true)
|
|
|
|
|
"
|
|
|
|
|
@ -137,6 +137,7 @@
|
|
|
|
|
<addRecruit
|
|
|
|
|
:is-show.sync="isShowAdd"
|
|
|
|
|
:province_ids="provinces"
|
|
|
|
|
:template-items="templateItems"
|
|
|
|
|
ref="addRecruit"
|
|
|
|
|
@refresh="$refs['xyTable'].getTableData()"
|
|
|
|
|
></addRecruit>
|
|
|
|
|
@ -144,20 +145,21 @@
|
|
|
|
|
<importRecruitInfo
|
|
|
|
|
ref="importRecruitInfo"
|
|
|
|
|
:province_ids="provinces"
|
|
|
|
|
:templates="templates"
|
|
|
|
|
:is-show.sync="isShowImportRecruitInfo"
|
|
|
|
|
@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>
|
|
|
|
|
|
|
|
|
|
@ -193,12 +195,10 @@ export default {
|
|
|
|
|
isShowAdd: false,
|
|
|
|
|
provinces: [],
|
|
|
|
|
select: {
|
|
|
|
|
year: `${new Date().getFullYear()}`,
|
|
|
|
|
keyword: "",
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
template_id: "",
|
|
|
|
|
template_item_id: "",
|
|
|
|
|
sort_name:"",
|
|
|
|
|
sort_type:""
|
|
|
|
|
},
|
|
|
|
|
@ -260,25 +260,22 @@ export default {
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getTemplateItemName(){
|
|
|
|
|
return this.$refs['templateSelect']?.selected?.label
|
|
|
|
|
async getTemplateItems(){
|
|
|
|
|
const res = await templateItemIndex({
|
|
|
|
|
template_id:this.select.template_id,
|
|
|
|
|
page_size:999,
|
|
|
|
|
page:1
|
|
|
|
|
})
|
|
|
|
|
this.templateItems = res.data
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getTemplateItemDetail() {
|
|
|
|
|
if (!this.select.template_item_id) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "warning",
|
|
|
|
|
message: "当前年份无模板内容",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const res = await filedIndex({
|
|
|
|
|
template_item_id:this.select.template_item_id,
|
|
|
|
|
template_id:this.select.template_id,
|
|
|
|
|
page:1,
|
|
|
|
|
page_size:999
|
|
|
|
|
});
|
|
|
|
|
const res = await templateShow({
|
|
|
|
|
id:this.select.template_id
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let temp =
|
|
|
|
|
res?.data?.map((item) => {
|
|
|
|
|
res?.fileds?.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
prop: item.en,
|
|
|
|
|
label: item.name,
|
|
|
|
|
@ -318,13 +315,11 @@ export default {
|
|
|
|
|
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,
|
|
|
|
|
@ -350,11 +345,11 @@ export default {
|
|
|
|
|
await this.getList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
downTemplate() {
|
|
|
|
|
downTemplate(command) {
|
|
|
|
|
exports({
|
|
|
|
|
year: this.select.year,
|
|
|
|
|
template_item_id: this.select.template_item_id,
|
|
|
|
|
},`${ this.getTemplateItemName() }模板.xlsx`);
|
|
|
|
|
},`${command}模板.xlsx`);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
@ -366,6 +361,7 @@ export default {
|
|
|
|
|
async created() {
|
|
|
|
|
await this.getTemplate();
|
|
|
|
|
await this.getTemplateItemDetail();
|
|
|
|
|
await this.getTemplateItems();
|
|
|
|
|
await this.getProvinces();
|
|
|
|
|
await this.getList();
|
|
|
|
|
}
|
|
|
|
|
|