From 8333165f0257d80d6c82e770e8a50aba8ee411dc Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Fri, 17 Feb 2023 17:28:18 +0800 Subject: [PATCH] 2023-2-17 --- .../recruitment/component/addTemplate.vue | 4 +- src/views/recruitment/component/setting.vue | 29 ++-- src/views/recruitment/recruit.vue | 2 +- src/views/recruitment/template.vue | 66 ++++++-- .../yearScore/component/addYearScore.vue | 155 ++++++++++++++---- src/views/yearScore/component/imports.vue | 3 +- 6 files changed, 194 insertions(+), 65 deletions(-) diff --git a/src/views/recruitment/component/addTemplate.vue b/src/views/recruitment/component/addTemplate.vue index 9df4ec1..b172097 100644 --- a/src/views/recruitment/component/addTemplate.vue +++ b/src/views/recruitment/component/addTemplate.vue @@ -30,14 +30,14 @@ @@ -123,7 +132,70 @@ export default { type: "", action: process.env.VUE_APP_UPLOAD_API, fileList: [], - + provinceTable: [ + { + type: "selection", + width: 46, + }, + { + prop: "name", + label: "省份", + width: 140, + }, + { + label: "选课", + align:'left', + customFn: (row) => { + return ( +
+ {row.subject?.map((item, index) => { + return ( + + {item} + + ); + })} + {row.inputVisible ? ( + { + if(!row.subject){ + row.subject = [] + } + let inputValue = row.inputValue; + if (inputValue) { + row.subject?.push(inputValue); + } + row.inputVisible = false; + row.inputValue = ""; + }, + }} + > + ) : ( + { + row.inputVisible = true; + this.$nextTick((_) => { + this.$refs['saveTagInput']?.$refs?.input?.focus() + }); + }, + }} + > + + 新增 + + )} +
+ ); + }, + }, + ], form: { year: "", province_ids: "", @@ -137,12 +209,6 @@ export default { message: "请填写年份", }, ], - province_ids: [ - { - required: true, - message: "请填写录取查询省份说明", - }, - ], }, }; }, @@ -151,8 +217,8 @@ export default { successHandle(response, file, fileList) { this.fileList = fileList; }, - removeHande(file,fileList){ - this.fileList = fileList + removeHande(file, fileList) { + this.fileList = fileList; }, uploadBefore(file) { console.log(file); @@ -169,22 +235,28 @@ export default { let res = await show({ id: this.id, }); - res.year = String(res?.year) - res.province_ids = res?.province_ids?.map(item => Number(item)) - this.fileList = res.files.map(item => { + res.year = String(res?.year); + res.province_ids = res?.province_ids?.map((item) => Number(item)); + this.fileList = res.files.map((item) => { return { - name:item.original_name, - url:item.url, - response:item - } - }) + name: item.original_name, + url: item.url, + response: item, + }; + }); this.$integrateData(this.form, res); }, submit() { - this.form.file_ids = this.fileList.map((item) => { - return item?.response?.id; - }); + if(this.$refs["xyTable"].getSelection().length > 0){ + this.form.province_ids = this.$refs["xyTable"].getSelection().map(item => { + return { + province_id:item.id, + province_name:item.name, + subjec:item.subject.toString() + } + }) + } if (this.type === "add") { if (this.form.hasOwnProperty("id")) { @@ -277,3 +349,20 @@ export default { text-align: left; } + diff --git a/src/views/yearScore/component/imports.vue b/src/views/yearScore/component/imports.vue index e6f25eb..49d2a7b 100644 --- a/src/views/yearScore/component/imports.vue +++ b/src/views/yearScore/component/imports.vue @@ -10,7 +10,7 @@ >
省份选择
- +
@@ -23,7 +23,6 @@ :headers="{ 'Authorization':`Bearer ${getToken()}` }" - :data="select" :action="action" :file-list="fileList" :on-success="successHandle"