diff --git a/src/api/indexDiscuss.js b/src/api/indexDiscuss.js index 5167f69c..7141214c 100644 --- a/src/api/indexDiscuss.js +++ b/src/api/indexDiscuss.js @@ -1,13 +1,16 @@ import http from "./config"; +//import qs from 'qs'; //创建讨论 export const createDiscuss = (obj) => http.post('/discuss/createDiscuss', obj); //获取讨论信息接口 -export const getDiscussDetail = (obj) => http.post('/discuss/getDiscussDetail', { params: obj }); +export const getDiscussDetail = (obj) => http.post('/discuss/getDiscussDetail', obj); //删除讨论接口 export const deleteDiscuss = (obj) => http.post('/discuss/deleteDiscuss', { params: obj }); //修改讨论接口 -export const updateDiscuss = (obj) => http.post('/discuss/updateDiscuss', obj ); \ No newline at end of file +export const updateDiscuss = (obj) => http.post('/discuss/updateDiscuss', obj ); +//修改阶段任务信息 +export const updateTask=(obj)=>http.post('/admin/project/editTask',obj) \ No newline at end of file diff --git a/src/components/drawers/AddDiscuss.vue b/src/components/drawers/AddDiscuss.vue index e13afc92..5005158b 100644 --- a/src/components/drawers/AddDiscuss.vue +++ b/src/components/drawers/AddDiscuss.vue @@ -144,13 +144,34 @@ export default { const closeDrawer = () => { ctx.emit("update:adddiscussVisible", false); ctx.emit("update:edit", false); + console.log("编辑状态",props.edit); state.inputV1 = ""; state.textV1 = ""; }; const afterVisibleChange = (bool) => { console.log("state", bool); + if(bool){ + if(props.isStudiscuss == false){ + if(props.edit){ + //编辑讨论 + console.log("props.editDiscussId",props.editDiscussId) + let formData = new FormData(); + formData.append('discussId',props.editDiscussId); + api.getDiscussDetail(formData).then(res => { + console.log('获取讨论信息成功',res.data.data) + //更新讨论信息 + state.inputV1 = res.data.data.discussName; + state.textV1 = res.data.data.discussExplain; + state.checkedC1 = res.data.data.discussSettings; + }).catch(err=>{ + console.log('获取讨论信息失败',err) + }) + + } + } + } }; - + //console.log("编辑状态",props.edit); //创建讨论(项目任务列表) const createDiscuss = () => { if (!state.inputV1) { @@ -169,26 +190,9 @@ export default { discussTag: "", //是否必修的标识 updateTime: "", //更新时间 updateUser: 0, //更新人 - projectId: 0, //项目id + projectId: props.projectId, //项目id }; - if(props.edit){ - //console.log("编辑"); - console.log("props.editDiscussId",props.editDiscussId) - - let obj = { - discussId: props.editDiscussId, - } - console.log(obj) - api - .getDiscussDetail(obj) - .then((res) => { - console.log("获取成功",res.data); - }) - .catch((err) => { - console.log("获取失败",err.data); - }) - - }else{ + if(props.edit == false){ api .createDiscuss(obj) .then((res) => { @@ -213,8 +217,7 @@ export default { console.log("新增关卡任务成功",res); setTimeout(()=>{ message.success("创建成功"); - ctx.emit("update:adddiscussVisible", false); - closeDrawer(); + ctx.emit("update:adddiscussVisible", false); state.addLoading=false },1000) }).catch(err => { @@ -229,7 +232,7 @@ export default { flag: true, name: obj.discussName, projectId: props.projectId, - projectTaskId: 0, + projectTaskId: "", stageId: props.chooseStageId, type: 8, }) @@ -248,10 +251,35 @@ export default { }) .catch((err) => { console.log("创建失败", err); - }); + }); + }else{ + api + .updateDiscuss(obj) + .then((res)=> { + console.log("更新成功",res) + let taskObj={ + courseId: res.data.data.discussId, + name: obj.discussName, + projectId: props.projectId, + projectTaskId: "", + stageId: props.stageId, + type: 8, + + } + api.updateTask(taskObj).then(taskRes=>{ + console.log('更新阶段任务成功',taskRes) + }).catch(taskErr=>{ + console.log('更新阶段任务失败',taskErr) + }) + }) + .catch((err) => { + console.log("更新失败",err) + }) } - + + }; + return { ...toRefs(state), afterVisibleChange, diff --git a/src/views/projectcenter/TaskAdd.vue b/src/views/projectcenter/TaskAdd.vue index 78618837..448471d9 100644 --- a/src/views/projectcenter/TaskAdd.vue +++ b/src/views/projectcenter/TaskAdd.vue @@ -306,7 +306,7 @@
任务列表
- +
+ + +
+
+
+
+
选择任务移动到阶段
+
+
+
+
+
已选中{{selectRow.length}}个任务
+
+ +
+
+ + +
+
+
+
@@ -993,6 +1031,7 @@ export default { selectedRowKeys: [], valuesname: "", valuesnotice: "", + visiblene: false,//移动任务弹窗 confirmModal: false, //确认添加阶段弹窗 cC: false, cancelModal: false, //确认取消阶段弹窗 @@ -1006,6 +1045,7 @@ export default { deleteActivityID: null, //删除活动id deleteID: "", selectRow: [], //选择行 + curLevel: [], //阶段名称 selectAll: 0, //0:未选择,1:全选,2:部分选择 }); console.log("projectId", state.projectId); @@ -1251,13 +1291,19 @@ export default { if (leng > 0) { //获取任务列表 let arr = res.data.data.stageList[0].taskList; + console.log('任务列表',arr) getTableData(arr); } let stagearr = res.data.data.stageList; - console.log(stagearr, 111111); + let arrlist = state.curLevel; + //console.log(stagearr, 111111); if (stagearr.length > 0) { getStageData(stagearr); + stagearr.map(value => { + console.log(value); + arrlist.push(); + }) } //给阶段id赋初始值 state.chooseStageId = leng > 0 ? stagearr[0].stageId : null; @@ -1638,6 +1684,12 @@ export default { getTask(); }); }; + const showChangeModal = () => { + state.visiblene = true; + } + const closeChangeModal = () => { + state.visiblene = false; + }; //移动任务到阶段 const moveTask = () => { let obj = { @@ -1917,6 +1969,8 @@ export default { closeCancel, showDelete, closeDelete, + showChangeModal, + closeChangeModal, changebgc, getTask, deleteLiveBroadcast, @@ -2095,6 +2149,107 @@ export default { } } } +.changeModal { + .ant-modal { + width: 549px !important; + height: 245px !important; + .ant-modal-content { + width: 549px !important; + height: 245px !important; + .ant-modal-body { + padding: 0 !important; + width: 549px !important; + height: 245px !important; + .con { + // background-color: #bfa; + width: 100%; + height: 100%; + + .header { + width: 100%; + display: flex; + height: 68px; + position: relative; + justify-content: center; + + background: linear-gradient( + rgba(78, 166, 255, 0.2) 0%, + rgba(78, 166, 255, 0) 100% + ); + .inhe { + width: 80%; + height: 100%; + display: flex; + justify-content: space-between; + align-items: center; + .mod { + left: 30px; + top: 27px; + position: absolute; + width: 18px; + height: 17px; + background-image: url(../../assets/images/leveladd/mod.png); + } + .tz { + color: #000000; + font-weight: 400; + font-size: 16px; + } + .mg { + width: 20px; + height: 20px; + background-image: url(../../assets/images/basicinfo/close22.png); + background-size: 100% 100%; + cursor: pointer; + } + } + } + .mid { + width: 100%; + display: flex; + height: 100%; + justify-content: center; + .inher { + width: 80%; + height: 100%; + .cur { + color: #6f6f6f; + font-size: 14px; + } + .select { + margin-top: 10px; + } + .btn { + width: 100%; + display: flex; + justify-content: center; + margin-top: 30px; + .sameb { + width: 100px; + height: 40px; + font-size: 14px; + + border-radius: 8px; + } + .btn1 { + color: #4ea6ff; + background: #ffffff; + border: 1px solid #4ea6ff; + } + .btn2 { + margin-left: 16px; + border: 0; + color: #ffffff; + background: #4ea6ff; + } + } + } + } + } + } + } + } +} .info { width: 78%; // background-color: lightcoral;