master
xy 3 years ago
parent ef9d9e6d78
commit 58da0d8c7b

@ -62,6 +62,32 @@ export default {
props={{ model: this.originalForm }}
rules={this.originalRules}
>
<el-col span={12}>
<el-form-item label="模板选择" prop="year">
<el-select
clearable={true}
v-model={this.originalForm.template_item_id}
placeholder="请选择模板"
on={
{
['change']:e => {
this.getTemplate()
}
}
}
>
{this.templateItems.map((item) => {
return (
<el-option
value={item.id}
label={item.name}
key={item.id}
></el-option>
);
})}
</el-select>
</el-form-item>
</el-col>
<el-col span={12}>
<el-form-item label="年份" prop="year">
<el-date-picker
@ -197,6 +223,7 @@ export default {
default: false,
},
province_ids: Array,
templateItems:Array,
},
data() {
let idcardValidate = (rule, value, callback) => {
@ -294,7 +321,7 @@ export default {
watch: {
async isShow(newVal) {
if (newVal) {
await this.getTemplate();
//await this.getTemplate();
}
},
},

@ -9,10 +9,36 @@
@on-ok="submit"
>
<div class="select">
<div class="select__item">
<span style="color: red">*</span><span>导入模板</span>
<el-select
size="small"
placeholder="请选择导入模板"
v-model="select.template_item_id"
style="width: 200px"
@change="getTemplate"
>
<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>
</div>
<div class="select__item">
<span style="color: red">*</span><span>年份</span>
<el-date-picker
size="small"
:clearable="false"
placeholder="请选择年份"
v-model="select.year"
value-format="yyyy"
@ -72,6 +98,7 @@
:file-list="fileList"
:on-success="successHandle"
:on-error="errorHandle"
:before-upload="beforeUploadHandle"
:auto-upload="false"
>
<el-button slot="trigger" size="small" type="primary"
@ -109,7 +136,6 @@
<script>
import { getToken } from "@/utils/auth";
import { show as templateShow } from "@/api/unifiedRecruitment/template";
import { imports } from "@/api/unifiedRecruitment/recruit";
import { index as filedIndex } from "@/api/unifiedRecruitment/templateFiled";
export default {
@ -119,6 +145,7 @@ export default {
default: false,
},
province_ids: Array,
templates:Array,
},
data() {
return {
@ -166,6 +193,15 @@ export default {
methods: {
getToken,
beforeUploadHandle(file){
if(!this.select.template_item_id){
this.$message({
type:'warning',
message:"请先选择导入模板"
})
return false
}
},
successHandle(response, file, fileList) {
this.list = response ?? [];
},

@ -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&#45;&#45;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();
}

@ -130,13 +130,23 @@ export default {
align: "left",
customFn: (row) => {
return (
<div>
<div style={
{
'display':'flex',
'flex-wrap':'wrap'
}
}>
{row.province_ids.map((val) => {
return (
<el-button
type="primary"
size="mini"
plain={true}
style={
{
'margin':'0 6px 4px 0'
}
}
on={{
["click"]: (e) => {
this.showImport(row, Number(val.province_id));

Loading…
Cancel
Save