|
|
|
|
@ -10,27 +10,52 @@
|
|
|
|
|
>
|
|
|
|
|
<div class="select">
|
|
|
|
|
<div class="select__item">
|
|
|
|
|
<span style="color: red;">*</span><span>年份</span>
|
|
|
|
|
<el-date-picker size="small" placeholder="请选择年份" v-model="select.year" value-format="yyyy" type="year" style="width: 200px;"></el-date-picker>
|
|
|
|
|
<span style="color: red">*</span><span>年份</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
size="small"
|
|
|
|
|
placeholder="请选择年份"
|
|
|
|
|
v-model="select.year"
|
|
|
|
|
value-format="yyyy"
|
|
|
|
|
type="year"
|
|
|
|
|
style="width: 200px"
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="select__item">
|
|
|
|
|
<span style="color: red;">*</span><span>省份</span>
|
|
|
|
|
<el-select size="small" placeholder="请选择省份" v-model="select.province_id" style="width: 200px;">
|
|
|
|
|
<el-option v-for="item in province_ids" :value="item.id" :key="item.id" :label="item.name"></el-option>
|
|
|
|
|
<span style="color: red">*</span><span>省份</span>
|
|
|
|
|
<el-select
|
|
|
|
|
size="small"
|
|
|
|
|
placeholder="请选择省份"
|
|
|
|
|
v-model="select.province_id"
|
|
|
|
|
style="width: 200px"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in province_ids"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="select__item" v-if="$route.meta.params.type == 1">
|
|
|
|
|
<span></span>
|
|
|
|
|
<span>更新统招进度为录取结束</span>
|
|
|
|
|
<el-checkbox v-model="select.isEnd" :true-label="1" :false-label="0"></el-checkbox>
|
|
|
|
|
<el-checkbox
|
|
|
|
|
v-model="select.isEnd"
|
|
|
|
|
:true-label="1"
|
|
|
|
|
:false-label="0"
|
|
|
|
|
></el-checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="select__item">
|
|
|
|
|
<span></span>
|
|
|
|
|
<span>更新邮寄信息</span>
|
|
|
|
|
<el-checkbox v-model="select.isEnd" :true-label="1" :false-label="0"></el-checkbox>
|
|
|
|
|
<el-checkbox
|
|
|
|
|
v-model="select.isEms"
|
|
|
|
|
:true-label="1"
|
|
|
|
|
:false-label="0"
|
|
|
|
|
></el-checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@ -40,21 +65,37 @@
|
|
|
|
|
ref="upload"
|
|
|
|
|
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
|
|
:headers="{
|
|
|
|
|
'Authorization':`Bearer ${getToken()}`
|
|
|
|
|
Authorization: `Bearer ${getToken()}`,
|
|
|
|
|
}"
|
|
|
|
|
:data="select"
|
|
|
|
|
:action="action"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
:on-success="successHandle"
|
|
|
|
|
:on-error="errorHandle"
|
|
|
|
|
:auto-upload="false">
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
|
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="$refs['upload'].submit()">开始上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">支持文件格式:EXCEL,扩展名为 XLSX、XLS</div>
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
>
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary"
|
|
|
|
|
>选取文件</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
size="small"
|
|
|
|
|
type="success"
|
|
|
|
|
@click="$refs['upload'].submit()"
|
|
|
|
|
>开始上传</el-button
|
|
|
|
|
>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">
|
|
|
|
|
支持文件格式:EXCEL,扩展名为 XLSX、XLS
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<xy-table :is-page="false" :list="list" :table-item="table" style="margin-top: 10px;">
|
|
|
|
|
<xy-table
|
|
|
|
|
:is-page="false"
|
|
|
|
|
:list="list"
|
|
|
|
|
:table-item="table"
|
|
|
|
|
style="margin-top: 10px"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns></template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
|
|
|
|
|
@ -67,35 +108,34 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<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";
|
|
|
|
|
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 {
|
|
|
|
|
props: {
|
|
|
|
|
isShow: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
province_ids:Array
|
|
|
|
|
province_ids: Array,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
action: `${process.env.VUE_APP_BASE_API}/api/admin/recruit/excel_analyse`,
|
|
|
|
|
fileList:[],
|
|
|
|
|
select:{
|
|
|
|
|
year:'',
|
|
|
|
|
province_id:'',
|
|
|
|
|
template_id:'',
|
|
|
|
|
template_item_id:'',
|
|
|
|
|
isEnd:0
|
|
|
|
|
fileList: [],
|
|
|
|
|
select: {
|
|
|
|
|
year: "",
|
|
|
|
|
province_id: "",
|
|
|
|
|
template_id: "",
|
|
|
|
|
template_item_id: "",
|
|
|
|
|
isEnd: 0,
|
|
|
|
|
isEms: 0,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
list:[],
|
|
|
|
|
table:[],
|
|
|
|
|
newTable:[],
|
|
|
|
|
list: [],
|
|
|
|
|
table: [],
|
|
|
|
|
newTable: [],
|
|
|
|
|
originalTable: [
|
|
|
|
|
{
|
|
|
|
|
prop: "name",
|
|
|
|
|
@ -126,22 +166,22 @@ export default {
|
|
|
|
|
methods: {
|
|
|
|
|
getToken,
|
|
|
|
|
|
|
|
|
|
successHandle(response, file, fileList){
|
|
|
|
|
this.list = response ?? []
|
|
|
|
|
successHandle(response, file, fileList) {
|
|
|
|
|
this.list = response ?? [];
|
|
|
|
|
},
|
|
|
|
|
errorHandle(err, file, fileList){
|
|
|
|
|
errorHandle(err, file, fileList) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type:'error',
|
|
|
|
|
message:err
|
|
|
|
|
})
|
|
|
|
|
type: "error",
|
|
|
|
|
message: err,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getTemplate() {
|
|
|
|
|
const res = await filedIndex({
|
|
|
|
|
template_item_id:this.select.template_item_id,
|
|
|
|
|
template_id:this.select.template_id,
|
|
|
|
|
page:1,
|
|
|
|
|
page_size:999
|
|
|
|
|
template_item_id: this.select.template_item_id,
|
|
|
|
|
template_id: this.select.template_id,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
});
|
|
|
|
|
let temp =
|
|
|
|
|
res?.data?.map((item) => {
|
|
|
|
|
@ -154,36 +194,56 @@ export default {
|
|
|
|
|
this.table = [...this.originalTable, ...temp];
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submit(){
|
|
|
|
|
if(!this.select.year || !this.select.province_id){
|
|
|
|
|
submit() {
|
|
|
|
|
if (!this.select.year || !this.select.province_id) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type:'warning',
|
|
|
|
|
message:'请先选择年份或省份'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
type: "warning",
|
|
|
|
|
message: "请先选择年份或省份",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let load = this.$loading({
|
|
|
|
|
text:"正在导入中...",
|
|
|
|
|
lock:true,
|
|
|
|
|
background:"rgba(0,0,0,0.4)",
|
|
|
|
|
})
|
|
|
|
|
text: "正在导入中...",
|
|
|
|
|
lock: true,
|
|
|
|
|
background: "rgba(0,0,0,0.4)",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let promiseAll = this.list.map(item => {
|
|
|
|
|
let form = {
|
|
|
|
|
template_item_id:this.select.template_item_id,
|
|
|
|
|
template_id:this.select.template_id,
|
|
|
|
|
year:this.select.year,
|
|
|
|
|
province_id:this.select.province_id,
|
|
|
|
|
is_end:this.select.isEnd,
|
|
|
|
|
detail:[item]
|
|
|
|
|
}
|
|
|
|
|
return imports(form)
|
|
|
|
|
})
|
|
|
|
|
Promise.all(promiseAll).then(res => {
|
|
|
|
|
// let promiseAll = this.list.map(item => {
|
|
|
|
|
// let form = {
|
|
|
|
|
// template_item_id:this.select.template_item_id,
|
|
|
|
|
// template_id:this.select.template_id,
|
|
|
|
|
// year:this.select.year,
|
|
|
|
|
// province_id:this.select.province_id,
|
|
|
|
|
// is_end:this.select.isEnd,
|
|
|
|
|
// is_ems:this.select.isEms,
|
|
|
|
|
// detail:[item]
|
|
|
|
|
// }
|
|
|
|
|
// return imports(form)
|
|
|
|
|
// })
|
|
|
|
|
// Promise.all(promiseAll).then(res => {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// type:'success',
|
|
|
|
|
// message:`成功导入${res.length}条`
|
|
|
|
|
// })
|
|
|
|
|
// this.$emit('refresh')
|
|
|
|
|
// this.$emit('update:isShow',false)
|
|
|
|
|
// load.close()
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
// console.log(err)
|
|
|
|
|
// })
|
|
|
|
|
imports({
|
|
|
|
|
template_item_id: this.select.template_item_id,
|
|
|
|
|
template_id: this.select.template_id,
|
|
|
|
|
year: this.select.year,
|
|
|
|
|
province_id: this.select.province_id,
|
|
|
|
|
is_end: this.select.isEnd,
|
|
|
|
|
is_ems: this.select.isEms,
|
|
|
|
|
detail: this.list,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type:'success',
|
|
|
|
|
message:`成功导入${res.length}条`
|
|
|
|
|
message:`导入成功`
|
|
|
|
|
})
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
this.$emit('update:isShow',false)
|
|
|
|
|
@ -191,31 +251,29 @@ export default {
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
watch: {
|
|
|
|
|
async isShow(val){
|
|
|
|
|
if(val){
|
|
|
|
|
await this.getTemplate()
|
|
|
|
|
async isShow(val) {
|
|
|
|
|
if (val) {
|
|
|
|
|
await this.getTemplate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.select{
|
|
|
|
|
.select {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
&>div + div{
|
|
|
|
|
& > div + div {
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
}
|
|
|
|
|
&__item{
|
|
|
|
|
|
|
|
|
|
&>span + span{
|
|
|
|
|
&__item {
|
|
|
|
|
& > span + span {
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
|
|
padding: 0 16px;
|
|
|
|
|
@ -223,7 +281,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.upload{
|
|
|
|
|
.upload {
|
|
|
|
|
width: 30%;
|
|
|
|
|
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|