master
xy 4 years ago
parent 93015fe238
commit 45825debd7

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save