mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
feat:讨论和活动添加到任务列表,添加阶段
This commit is contained in:
8
src/api/indexStage.js
Normal file
8
src/api/indexStage.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import http from "./config";
|
||||
|
||||
//添加阶段
|
||||
export const editStage = (obj) => http.post('/admin/project/editStage', obj, {
|
||||
headers: {
|
||||
'token': '123'
|
||||
}
|
||||
});
|
||||
@@ -224,6 +224,7 @@
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import * as api from "../../api/indexActivity";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
import { message } from "ant-design-vue";
|
||||
import { toDate } from "../../api/method.js";
|
||||
const rowSelection = ref({
|
||||
@@ -333,7 +334,6 @@ export default {
|
||||
api
|
||||
.createActivity(obj)
|
||||
.then((res) => {
|
||||
setTimeout(() => {
|
||||
console.log("创建成功", res);
|
||||
message.success("创建成功");
|
||||
state.radioV1 = "";
|
||||
@@ -347,7 +347,26 @@ export default {
|
||||
state.textV2 = "";
|
||||
state.time = "";
|
||||
ctx.emit("update:addactiveVisible", false);
|
||||
}, 1000);
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: obj.activityDuration,
|
||||
flag: true,
|
||||
name: obj.activityName,
|
||||
projectId: 28,
|
||||
projectTaskId: 0,
|
||||
stageId: 3,
|
||||
type: 9,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
//重新获取任务列表
|
||||
// apiTask.getTask({ projectId: 28 });
|
||||
// router.push("/taskadd");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败",err);
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
:visible="adddiscussVisible"
|
||||
class="drawerStyle addrefDrawer"
|
||||
width="80%"
|
||||
title="添加讨论"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">添加讨论</div>
|
||||
<div class="headerTitle" v-if="add">添加讨论</div>
|
||||
<div class="headerTitle" v-else>编辑讨论</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -72,6 +72,7 @@
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import * as api from "../../api/indexDiscuss";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
import { message } from "ant-design-vue";
|
||||
const rowSelection = ref({
|
||||
checkStrictly: false,
|
||||
@@ -105,6 +106,7 @@ export default {
|
||||
inputV2: "",
|
||||
textV1: "",
|
||||
checkedC1: "",
|
||||
add: true,
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:adddiscussVisible", false);
|
||||
@@ -137,14 +139,32 @@ export default {
|
||||
api
|
||||
.createDiscuss(obj)
|
||||
.then((res) => {
|
||||
setTimeout(() => {
|
||||
console.log("创建成功", res);
|
||||
state.inputV1 = "";
|
||||
state.textV1 = "";
|
||||
message.success("创建成功");
|
||||
ctx.emit("update:adddiscussVisible", false);
|
||||
}, 1000);
|
||||
|
||||
//console.log("discussName",obj.discussName);
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.discussName,
|
||||
projectId: 28,
|
||||
projectTaskId: 0,
|
||||
stageId: 3,
|
||||
type: 8,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
//重新获取任务列表
|
||||
// apiTask.getTask({ projectId: 28 });
|
||||
// router.push("/taskadd");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败", err);
|
||||
|
||||
@@ -361,11 +361,15 @@
|
||||
<div class="modalMain" style="width: 100%">
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<div><img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/></div>
|
||||
<div class="inname">阶段名称:</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-input
|
||||
v-model:value="valueE"
|
||||
v-model:value="valuesname"
|
||||
show-count
|
||||
:maxlength="20"
|
||||
placeholder="请输入阶段名称"
|
||||
@@ -378,7 +382,7 @@
|
||||
</div>
|
||||
<div class="intext" style="margin-left: 14px">
|
||||
<a-textarea
|
||||
v-model:value="value"
|
||||
v-model:value="valuesnotice"
|
||||
style="height: 88px"
|
||||
show-count
|
||||
:maxlength="100"
|
||||
@@ -409,7 +413,7 @@
|
||||
取消
|
||||
</button>
|
||||
<button
|
||||
@click="closeModal"
|
||||
@click="editStage"
|
||||
style="
|
||||
cursor: pointer;
|
||||
margin-left: 16px;
|
||||
@@ -544,6 +548,7 @@ import * as apidiscuss from "../../api/indexDiscuss";
|
||||
import * as apiactivity from "../../api/indexActivity";
|
||||
import * as apieval from "../../api/indexEval";
|
||||
import * as apiinvist from "../../api/indexInvist";
|
||||
import * as apistage from "../../api/indexStage";
|
||||
const drawercolumns = [
|
||||
{
|
||||
title: "项目名称",
|
||||
@@ -853,6 +858,8 @@ export default {
|
||||
addvotevisible: false,
|
||||
stage: false,
|
||||
selectedRowKeys: [],
|
||||
valuesname: "",
|
||||
valuesnotice: "",
|
||||
confirmModal: false, //确认添加阶段弹窗
|
||||
cC: false,
|
||||
cancelModal: false, //确认取消阶段弹窗
|
||||
@@ -876,6 +883,28 @@ export default {
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("visible", bool);
|
||||
};
|
||||
//添加阶段
|
||||
const editStage = () => {
|
||||
if(!state.valuesname){
|
||||
message.destroy();
|
||||
return message.warning("请输入阶段名称");
|
||||
}
|
||||
let obj = {
|
||||
name: state.valuesname,
|
||||
projectId: 28,
|
||||
remark: state.valuesnotice,
|
||||
};
|
||||
apistage
|
||||
.editStage(obj)
|
||||
.then((res) => {
|
||||
console.log("添加阶段成功",res);
|
||||
message.default();
|
||||
message.success("添加阶段成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("添加阶段失败",err);
|
||||
})
|
||||
}
|
||||
// 把数据放到state里
|
||||
const getTableData = (tableData) => {
|
||||
let data = tableData;
|
||||
@@ -1519,6 +1548,7 @@ export default {
|
||||
editInvistPath,
|
||||
getTableData,
|
||||
deleteTask,
|
||||
editStage,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user