master
xy 3 years ago
parent 93015fe238
commit 45825debd7

@ -44,11 +44,11 @@ export function imports(data,isLoading = true){
return request({
url:"/api/admin/recruit/import",
method:"post",
data:qs.stringify(data),
data:data,
isLoading,
headers:{
'Content-Type':'application/x-www-form-urlencoded'
}
// headers:{
// 'Content-Type':'application/x-www-form-urlencoded'
// }
})
}

@ -50,10 +50,7 @@ export function imports(data,isLoading = true){
return request({
url:"/api/admin/year_socre_detail/import",
method:"post",
data:qs.stringify(data),
isLoading,
headers:{
'Content-Type':'application/x-www-form-urlencoded'
}
data:data,
isLoading
})
}

@ -318,6 +318,7 @@ export default {
}else{
this.sortFlag = 0
}
this.selectOpt.page = 1;
this.selectOpt.sort_name = prop;
this.selectOpt.sort_type = ['ASC','DESC',null][this.sortFlag % 3]
// TODO:

@ -14,7 +14,7 @@ let loading ;
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 5000, // request timeout
timeout: 20000, // request timeout
isLoading:true
})

@ -42,7 +42,7 @@
:transfer="true"
confirm
title="确认要删除吗"
@on-ok="destroy"
@on-ok="destroy">
<Button type="error" ghost>删除</Button>
</Poptip>
</template>

@ -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扩展名为 XLSXXLS</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扩展名为 XLSXXLS
</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;

@ -14,7 +14,12 @@
justify-content: space-between;
"
>
<el-tabs type="card" style="flex: 1" v-model="activeName" @tab-click="tabClick">
<el-tabs
type="card"
style="flex: 1"
v-model="activeName"
@tab-click="tabClick"
>
<el-tab-pane
v-for="item in templateItems"
:key="item.id"
@ -65,7 +70,10 @@
<addTemplateItem
ref="addTemplateItem"
@refresh="getTemplateItem"
@refresh="() => {
getTemplateItem();
$emit('refresh')
}"
></addTemplateItem>
</div>
</template>
@ -222,8 +230,8 @@ export default {
on={{
["click"]: (e) => {
save({
template_item_id:Number(this.activeName),
...row
template_item_id: Number(this.activeName),
...row,
}).then((res) => {
this.$message({
type: "success",
@ -299,8 +307,8 @@ export default {
};
},
methods: {
tabClick(){
this.getDetail()
tabClick() {
this.getDetail();
},
async getTemplateItem() {
@ -316,7 +324,7 @@ export default {
async getDetail() {
const res = await index({
template_id: this.id,
template_item_id:Number(this.activeName)
template_item_id: Number(this.activeName),
});
this.list = [...this.originalList, ...res.data];
},

@ -153,4 +153,5 @@ export default {
};
</script>
<style scoped></style>
<style>
</style>

@ -92,6 +92,7 @@
type="primary"
@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)
@ -121,6 +122,16 @@
}
"
@destroyed="getList"
@pageSizeChange="e => {
select.page = 1;
select.page_size = e;
getList();
}"
@pageIndexChange="e => {
select.page = e;
getList()
}"
@sort-change="sortChange"
></xy-table>
<addRecruit
@ -175,6 +186,7 @@ export default {
},
data() {
return {
sortFlag:0,
isShowTip:false,
tipTemplate:"",
isShowImportRecruitInfo: false,
@ -187,6 +199,8 @@ export default {
page_size: 10,
template_id: "",
template_item_id: "",
sort_name:"",
sort_type:""
},
templateItems: [],
templates: [],
@ -213,8 +227,7 @@ export default {
{
prop: "idcard",
label: "身份证号",
width: 180,
sortable: "custom",
width: 180
},
{
prop: "candidate_no",
@ -235,6 +248,18 @@ export default {
index,
destroy,
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()
},
getTemplateItemName(){
return this.$refs['templateSelect']?.selected?.label
},
@ -261,24 +286,6 @@ export default {
};
}) ?? [];
this.table = [...this.originalTable, ...temp];
// const res = await templateShow(
// {
// year: this.select.year,
// type: this.$route.meta.params?.type,
// },
// false
// );
// this.select.template_id = res.id;
// let temp =
// res?.fileds?.map((item) => {
// return {
// prop: item.en,
// label: item.name,
// width: 140,
// };
// }) ?? [];
// this.table = [...this.originalTable, ...temp];
},
async getList() {
this.$refs["xyTable"].loading = true;
@ -347,7 +354,7 @@ export default {
exports({
year: this.select.year,
template_item_id: this.select.template_item_id,
});
},`${ this.getTemplateItemName() }模板.xlsx`);
},
},
computed: {

@ -72,7 +72,7 @@
@refresh="$refs['xyTable'].getTableData()"
></addTemplate>
<setting ref="setting" :is-show.sync="isShowSetting"></setting>
<setting ref="setting" :is-show.sync="isShowSetting" @refresh="$refs['xyTable'].getTableData()"></setting>
</div>
</template>

@ -247,6 +247,13 @@ export default {
this.$refs["xyTable"].loading = false;
},
successHandle(response, file, fileList) {
if(response.errcode){
this.$message({
type: "error",
message: response.msg,
});
return
}
this.list = response ?? [];
},
errorHandle(err, file, fileList) {

@ -110,6 +110,7 @@ export default {
sortable: "custom",
},
{
prop:"province_nums",
label: "省份数",
width: 100,
customFn: (row) => {
@ -123,6 +124,7 @@ export default {
align: "left",
},
{
prop:"province_detail",
label: "具体省份",
minWidth: 180,
align: "left",

Loading…
Cancel
Save