diff --git a/src/views/projectcenter/ProjectAdd.vue b/src/views/projectcenter/ProjectAdd.vue index 244e292e..03f99f15 100644 --- a/src/views/projectcenter/ProjectAdd.vue +++ b/src/views/projectcenter/ProjectAdd.vue @@ -3,14 +3,15 @@
{{ projectInfo.projectId ? "编辑" : "创建" + >{{ + projectInfo.projectId ? "编辑" : "创建" }}{{ ptojectType == "3" ? "班级" : "项目" }}
返回
@@ -20,8 +21,8 @@
项目归属
@@ -34,8 +35,8 @@
{{ ptojectType == 3 ? "班级名称" : "项目名称" }} @@ -43,27 +44,27 @@
封面图
avatar
@@ -91,81 +92,81 @@
项目时间
项目经理
资源归属
项目级别
@@ -176,8 +177,8 @@
培训分类
@@ -188,15 +189,15 @@
是否BOEU实施
@@ -211,7 +212,7 @@
@@ -266,20 +267,15 @@
模版
(triggerNode.parentNode || document.body)" + placeholder="请选择模版" + style="width: 100%" + :options="classifyList5" + @change="classificationChange5" + @popupScroll="templateScroll" + :fieldNames="{ label: 'name', - value: 'projectTemplateId', + value: 'id', }" > @@ -291,12 +287,12 @@
取消 确定 + :loading="loading" + v-on:click="createProject" + type="primary" + class="btn1" + style="margin-left: 20px" + >确定
@@ -383,10 +379,10 @@ export default { state.projectInfo.parentId = routers.query.parentId; state.projectInfo.projectId = routers.query.projectId; (state.projectInfo.projectId || state.projectInfo.parentId) && - api + api .getProjectDetail({ projectId: - state.projectInfo.projectId || state.projectInfo.parentId, + state.projectInfo.projectId || state.projectInfo.parentId, }) .then((res) => { state.projectInfo = { @@ -394,8 +390,8 @@ export default { ...state.projectInfo, }; !routers.query.projectId && - !!routers.query.parentId && - (state.projectInfo.name = ""); + !!routers.query.parentId && + (state.projectInfo.name = ""); state.projectInfo.rangeTime = [ state.projectInfo.beginTime, state.projectInfo.endTime, @@ -422,8 +418,8 @@ export default { if (res.rows && res.rows.length > 0) { let i = res.rows.length; state.auditDescription = res.rows[i - 1].description - ? res.rows[i - 1].description - : "-"; + ? res.rows[i - 1].description + : "-"; } } }); @@ -437,14 +433,15 @@ export default { //选择分类 const classificationChange = (value) => { - console.log(`selected ${value}`); state.projectType = value; //分类选择的id }; const classificationChange5 = (key, option) => { state.projectInfo = option; + state.projectInfo.projectTemplateId = option.id + state.projectInfo.id = '' state.projectInfo.type = 3; - state.projectInfo.rangeTime = [option.beginTime, option.endTime]; + state.projectInfo.rangeTime = [dayjs(option.beginTime, "YYYY-MM-DD HH:mm"), dayjs(option.endTime, "YYYY-MM-DD HH:mm")]; state.projectInfo.parentName = routers.query.parentName; state.projectInfo.parentId = routers.query.parentId; }; @@ -508,6 +505,7 @@ export default { state.loading = true; console.log("保存", state.projectInfo); if (!validate(state.projectInfo, errorMsgs)) { + state.loading = false; return; } /** @@ -525,6 +523,7 @@ export default { }); if (offName) { message.destroy(); + state.loading = false; return message.warning("项目名称重复,请重新填写"); } state.projectInfo.type = 3; @@ -535,7 +534,7 @@ export default { message.success(state.projectInfo.projectId ? "编辑成功" : "创建成功"); router.push({ path: "/taskpage", - query: { projectId: res.data.data }, + query: {projectId: res.data.data}, }); }); }; @@ -549,10 +548,10 @@ export default { const clickOk = (e) => { state.clickNum = state.clickNum + 1 - if(state.clickNum==2) { + if (state.clickNum == 2) { state.clickNum = 0 state.changeCondition = false; - }else{ + } else { state.changeCondition = true; } console.log(e) @@ -560,18 +559,16 @@ export default { const panelOpen = (e) => { console.log(e) - if(!e){ + if (!e) { state.clickNum = 0 state.changeCondition = false; } } const disabledDate1 = (current) => { - // return current && current < dayjs().startOf("day"); - console.log(state.projectInfo.rangeTime1) - if(state.changeCondition){ - return current && current < moment(state.projectInfo.rangeTime[0]).endOf("YYYY-MM-DD HH:mm:ss"); - }else{ + if (state.changeCondition) { + return current && current < moment(state.projectInfo.rangeTime[0]).endOf("YYYY-MM-DD HH:mm:ss"); + } else { return current && current > moment(state.projectInfo.rangeTime1[0]).endOf("YYYY-MM-DD HH:mm:ss") } }; @@ -603,6 +600,7 @@ export default { .ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after { border-color: #fff !important; } + .ant-checkbox-disabled .ant-checkbox-inner { background-color: #1890ff !important; }