From 5ad4dd02b16cabb6859a327d659bdff21caf70cf Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Wed, 25 Sep 2024 16:20:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/task/unit.js | 11 +- src/views/dashboard/article.vue | 19 +- src/views/task/list/components/addUnit.vue | 69 ++-- src/views/task/list/components/checkUnit.vue | 94 ++++- src/views/task/list/components/sendNotice.vue | 6 +- src/views/task/list/unit.vue | 375 ++---------------- vue.config.js | 2 +- 7 files changed, 176 insertions(+), 400 deletions(-) diff --git a/src/api/task/unit.js b/src/api/task/unit.js index 8cbcf6b..ad4bab0 100644 --- a/src/api/task/unit.js +++ b/src/api/task/unit.js @@ -21,7 +21,16 @@ export function save(data) { method: 'post', data }) -} +} + +export function updateDistribute(data) { + return request({ + url: '/api/admin/mission/batch-update-mission-distribute', + method: 'post', + data + }) +} + export function del(id) { return request({ diff --git a/src/views/dashboard/article.vue b/src/views/dashboard/article.vue index c82f1ac..b69dbe0 100644 --- a/src/views/dashboard/article.vue +++ b/src/views/dashboard/article.vue @@ -17,6 +17,8 @@ @@ -36,10 +38,13 @@ index, destroy } from '@/api/task/newplan.js' - import addArticle from "@/views/dashboard/components/addArticle.vue" + import addArticle from "@/views/dashboard/components/addArticle.vue" + import showDashboardArticle from '@/views/dashboard/components/showDashboardArticle.vue' + export default { components: { - addArticle + addArticle, + showDashboardArticle }, data() { return { @@ -47,8 +52,8 @@ keyword: "", page: 1, page_size: 15, - table_name: 'articles', - with_relations:['image'] + table_name: 'articles', + with_relations: ['image'] }, list: [], table: [{ @@ -80,6 +85,10 @@ }) this.list = res.data this.total = res.total + }, + showArticle(id){ + this.$refs.showDashboardArticle.id = id + this.$refs.showDashboardArticle.isShow = true }, editArticle(type, id) { if (id) { diff --git a/src/views/task/list/components/addUnit.vue b/src/views/task/list/components/addUnit.vue index e395537..97674a3 100644 --- a/src/views/task/list/components/addUnit.vue +++ b/src/views/task/list/components/addUnit.vue @@ -399,7 +399,8 @@ save, get, del, - updatemission + updatemission, + updateDistribute } from "@/api/task/unit.js"; import { save as saveLog @@ -443,6 +444,7 @@ type: 'add', stateObj:{}, typeName:'新增任务', + now_do_admin_ids:[], //每次转办记录选择的人员id plan_unit:'', // 年度计划发布任务不用选参与对象 subtitle:'', is_what_unitType: '', @@ -797,11 +799,18 @@ value.map(item => { _arr.push(item.id) }) - if (this.type === 'send') { - this.form.do_admin_ids = _arr + if (this.type === 'send') { + this.now_do_admin_ids = _arr + console.log("this.now_do_admin_ids",this.now_do_admin_ids) + if(this.form.do_admin_ids && this.form.do_admin_ids.length>0){ + _arr.map(item=>{ + if(!this.form.do_admin_ids.includes(item)){ + this.form.do_admin_ids.push(item) + } + }) + } } else { this.form.accept_admin_ids = _arr - } } else { if (this.type === 'send') { @@ -968,14 +977,16 @@ } // 有do_admin_ids 放入到人员选择器初始数据 if (this.type == "send" && res.do_admin_ids && res.do_admin_ids.length > 0) { - this.userdatabefore.map(item => { - res.do_admin_ids.map(item1 => { - if (item.id == item1) { - this.valueMultiple.push(item) - } - }) - }) - this.valueArr = res.do_admin_ids + // this.userdatabefore.map(item => { + // res.do_admin_ids.map(item1 => { + // if (item.id == item1) { + // this.valueMultiple.push(item) + // } + // }) + // }) + this.valueMultiple = [] + this.valueArr = [] + // this.valueArr = res.do_admin_ids // res.accept_department_ids = [] } // 责任部门 责任人 分解任务 需要重新制定责任人 @@ -1125,13 +1136,7 @@ this.form.mission_groups = arr } - if (this.is_what_unitType == '答题' && this.form.ask.length == 0) { - Message({ - type: 'warning', - message: `请增加题库题目` - }) - return - } + if(!(this.form.audit_status==3||this.form.audit_status==5)){ console.log("this.betweenSe",this.form.start_date, this.form.end_date) this.betweenSe(this.form.start_date, this.form.end_date) @@ -1162,6 +1167,7 @@ if(res.mission_distribute && res.mission_distribute.length>0){ this.sendNotice({ id:res.model.id, + name:res.model.name, mission_distribute:res.mission_distribute }) } @@ -1171,10 +1177,6 @@ this.$emit('refresh') this.$emit('toUnit', this.form.type) }) - - // this.isShow = false - // this.$emit('refresh') - // this.$emit("uploadOa") }) return } @@ -1186,7 +1188,7 @@ }).then(res => { Message({ type: 'success', - message: '编辑任务成功' + message: this.type=== 'send'?'任务转办成功':'编辑任务成功' }) saveLog({ table_name:"missions_logs", @@ -1198,8 +1200,27 @@ console.log("this.type",this.type) if(this.type==="send"){ if(res.mission_distribute && res.mission_distribute.length>0){ + // form_user_id 插入到这一个的 承办人中去 + + // 本次由我转办的人的记录id + let this_doAdmins = [] + res.mission_distribute.map(item=>{ + if(this.now_do_admin_ids.includes(item.accept_admin_id)){ + this_doAdmins.push(item.id) + } + }) + // 批量更新 这次转办记录中的 from_user_id + if(this_doAdmins.length>0){ + updateDistribute({ + id:this_doAdmins, + from_user_id:this.stateObj.login_id + }) + } + + this.sendNotice({ id:res.model.id, + name:res.model.name, mission_distribute:res.mission_distribute }) } diff --git a/src/views/task/list/components/checkUnit.vue b/src/views/task/list/components/checkUnit.vue index cc492bf..27a890d 100644 --- a/src/views/task/list/components/checkUnit.vue +++ b/src/views/task/list/components/checkUnit.vue @@ -74,13 +74,39 @@ - - + + - + + + + + + + + + + + + + + + + + + +