diff --git a/src/views/recruitment/recruit.vue b/src/views/recruitment/recruit.vue index 05c786d..a00f667 100644 --- a/src/views/recruitment/recruit.vue +++ b/src/views/recruitment/recruit.vue @@ -11,42 +11,54 @@ @@ -167,7 +186,7 @@ import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit"; import { authMixin } from "@/mixin/authMixin"; import { index as provinceIndex } from "@/api/manage/province"; -import { index as filedIndex } from "@/api/unifiedRecruitment/templateFiled" +import { index as filedIndex } from "@/api/unifiedRecruitment/templateFiled"; import { show as templateShow, index as templateIndex, @@ -188,9 +207,9 @@ export default { }, data() { return { - sortFlag:0, - isShowTip:false, - tipTemplate:"", + sortFlag: 0, + isShowTip: false, + tipTemplate: "", isShowImportRecruitInfo: false, isShowAdd: false, provinces: [], @@ -199,8 +218,9 @@ export default { page: 1, page_size: 10, template_id: "", - sort_name:"", - sort_type:"" + sort_name: "", + sort_type: "", + year: "", }, templateItems: [], templates: [], @@ -227,7 +247,7 @@ export default { { prop: "idcard", label: "身份证号", - width: 180 + width: 180, }, { prop: "candidate_no", @@ -248,31 +268,31 @@ export default { index, destroy, - sortChange({ column, prop, order }){ - if(prop === this.select.sort_name){ - this.sortFlag ++ - }else{ - this.sortFlag = 0 + 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() + this.select.sort_type = ["ASC", "DESC", null][this.sortFlag % 3]; + this.select.page = 1; + this.getList(); }, - async getTemplateItems(){ + async getTemplateItems() { const res = await templateItemIndex({ - template_id:this.select.template_id, - page_size:999, - page:1 - }) - this.templateItems = res.data + template_id: this.select.template_id, + page_size: 999, + page: 1, + }); + this.templateItems = res.data; }, async getTemplateItemDetail() { const res = await templateShow({ - id:this.select.template_id - }) + id: this.select.template_id, + }); let temp = res?.fileds?.map((item) => { @@ -284,18 +304,18 @@ export default { }) ?? []; let totalTable = [...this.originalTable, ...temp]; let set = new Set(); - this.table = totalTable.filter(a => { + this.table = totalTable.filter((a) => { if (set.has(a.prop)) { return false; } else { set.add(a.prop); return true; } - }) + }); }, async getList() { this.$refs["xyTable"].loading = true; - try{ + try { let res = await index(this.select, false); this.total = res.total ?? 0; this.list = res.data.map((item) => { @@ -304,7 +324,7 @@ export default { setTimeout(() => { this.$refs["xyTable"].loading = false; }, 500); - }catch (e){ + } catch (e) { setTimeout(() => { this.$refs["xyTable"].loading = false; }, 500); @@ -355,10 +375,13 @@ export default { }, downTemplate(command) { - let temp = command.split('`') - exports({ - template_item_id: Number(temp[1] || 1), - },`${temp[0] || ''}模板.xlsx`); + let temp = command.split("`"); + exports( + { + template_item_id: Number(temp[1] || 1), + }, + `${temp[0] || ""}模板.xlsx` + ); }, }, computed: { @@ -373,7 +396,7 @@ export default { await this.getTemplateItems(); await this.getProvinces(); await this.getList(); - } + }, };