mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
fix:修改项目编辑的BOEU是否实施
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
<template>
|
||||
<div class="projectAdd">
|
||||
<div class="header">
|
||||
<span class="title">{{ projectInfo.parentId ? '编辑' : '创建' }}项目</span>
|
||||
<span class="title"
|
||||
>{{ projectInfo.parentId ? "编辑" : "创建" }}项目</span
|
||||
>
|
||||
<div
|
||||
@click="backPage"
|
||||
style="cursor: pointer"
|
||||
@@ -78,9 +80,11 @@
|
||||
"
|
||||
v-for="(src, index) in projectPic"
|
||||
:key="index"
|
||||
@click="()=>{
|
||||
projectInfo.picUrl = src
|
||||
}"
|
||||
@click="
|
||||
() => {
|
||||
projectInfo.picUrl = src;
|
||||
}
|
||||
"
|
||||
>
|
||||
<img
|
||||
style="
|
||||
@@ -124,8 +128,11 @@
|
||||
<div class="inname">项目经理</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<ProjectManager v-model:value="projectInfo.managerId" v-model:name="projectInfo.manager"
|
||||
mode="multiple"></ProjectManager>
|
||||
<ProjectManager
|
||||
v-model:value="projectInfo.managerId"
|
||||
v-model:name="projectInfo.manager"
|
||||
mode="multiple"
|
||||
></ProjectManager>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
@@ -138,7 +145,10 @@
|
||||
</div>
|
||||
|
||||
<div class="in select">
|
||||
<OrgClass v-model:value="projectInfo.sourceBelongId" v-model:name="projectInfo.sourceBelongName"></OrgClass>
|
||||
<OrgClass
|
||||
v-model:value="projectInfo.sourceBelongId"
|
||||
v-model:name="projectInfo.sourceBelongName"
|
||||
></OrgClass>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name name2">
|
||||
@@ -173,7 +183,8 @@
|
||||
font-size: 14px;
|
||||
"
|
||||
>同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)</span
|
||||
></a-switch>
|
||||
></a-switch
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
@@ -206,15 +217,26 @@
|
||||
<!-- class="nameimg"-->
|
||||
<!-- src="../../assets/images/basicinfo/asterisk.png"-->
|
||||
<!-- />-->
|
||||
<img
|
||||
class="nameimg"
|
||||
src="../../assets/images/basicinfo/asterisk.png"
|
||||
/>
|
||||
<div class="inname">是否BOEU实施</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-switch
|
||||
<!-- <a-switch
|
||||
v-model:checked="projectInfo.boeFlag"
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
:disabled="viewDetail ? true : false"
|
||||
></a-switch>
|
||||
></a-switch> -->
|
||||
<a-radio-group
|
||||
v-model:value="projectInfo.boeFlag"
|
||||
:disabled="viewDetail ? true : false"
|
||||
>
|
||||
<a-radio :style="radioStyle" :value="1">是</a-radio>
|
||||
<a-radio :style="radioStyle" :value="0">否</a-radio>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -249,8 +271,7 @@
|
||||
<div class="btn">
|
||||
<a-button v-on:click="createProject" type="primary" class="btn1"
|
||||
>确定
|
||||
</a-button
|
||||
>
|
||||
</a-button>
|
||||
<a-button @click="backPage" class="btn2">取消</a-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -276,7 +297,7 @@ export default {
|
||||
ProjectLevel,
|
||||
ProjectClass,
|
||||
TrainClass,
|
||||
OrgClass
|
||||
OrgClass,
|
||||
},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
@@ -295,37 +316,44 @@ export default {
|
||||
pageSize: 10,
|
||||
keyWord: "",
|
||||
},
|
||||
classifyList5: []
|
||||
classifyList5: [],
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
state.projectPic = store.state.projectPic.map(e => e.dictValue)
|
||||
state.viewDetail = routers.query.viewDetail
|
||||
getProjectInfo()
|
||||
getTemplate()
|
||||
})
|
||||
state.projectPic = store.state.projectPic.map((e) => e.dictValue);
|
||||
state.viewDetail = routers.query.viewDetail;
|
||||
getProjectInfo();
|
||||
getTemplate();
|
||||
});
|
||||
|
||||
watch(routers.query, () => {
|
||||
state.projectInfo.projectId = routers.query.projectId
|
||||
state.projectInfo.parentName = routers.query.parentName
|
||||
state.projectInfo.parentId = routers.query.parentId
|
||||
})
|
||||
|
||||
state.projectInfo.projectId = routers.query.projectId;
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
});
|
||||
|
||||
function getProjectInfo() {
|
||||
if (!routers.query.projectId) {
|
||||
state.projectInfo = {parentName: routers.query.parentName, parentId: routers.query.parentId}
|
||||
return
|
||||
state.projectInfo = {
|
||||
parentName: routers.query.parentName,
|
||||
parentId: routers.query.parentId,
|
||||
};
|
||||
return;
|
||||
}
|
||||
api.getProjectDetail({projectId: routers.query.projectId}).then(res => {
|
||||
state.projectInfo = res.data.data.projectInfo
|
||||
state.projectInfo.rangeTime = [state.projectInfo.beginTime, state.projectInfo.endTime]
|
||||
state.projectInfo.parentName = routers.query.parentName
|
||||
})
|
||||
api
|
||||
.getProjectDetail({ projectId: routers.query.projectId })
|
||||
.then((res) => {
|
||||
state.projectInfo = res.data.data.projectInfo;
|
||||
state.projectInfo.rangeTime = [
|
||||
state.projectInfo.beginTime,
|
||||
state.projectInfo.endTime,
|
||||
];
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
});
|
||||
}
|
||||
|
||||
const backPage = () => {
|
||||
router.back()
|
||||
router.back();
|
||||
};
|
||||
|
||||
//选择分类
|
||||
@@ -334,25 +362,24 @@ export default {
|
||||
state.projectType = value; //分类选择的id
|
||||
};
|
||||
|
||||
|
||||
const classificationChange5 = (key, option) => {
|
||||
state.projectInfo = option
|
||||
state.projectInfo.type = 3
|
||||
state.projectInfo.rangeTime = [option.beginTime, option.endTime]
|
||||
state.projectInfo.parentName = routers.query.parentName
|
||||
state.projectInfo.parentId = routers.query.parentId
|
||||
state.projectInfo = option;
|
||||
state.projectInfo.type = 3;
|
||||
state.projectInfo.rangeTime = [option.beginTime, option.endTime];
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
};
|
||||
//获取模版列表
|
||||
const getTemplate = () => {
|
||||
let obj = {
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
status: 1
|
||||
status: 1,
|
||||
};
|
||||
api.getTemplate(obj).then((res) => {
|
||||
state.totalPages = Number(res.data.data.pages);
|
||||
state.classifyList5 = res.data.data.rows
|
||||
})
|
||||
state.classifyList5 = res.data.data.rows;
|
||||
});
|
||||
};
|
||||
|
||||
//模版滚动加载模板信息
|
||||
@@ -378,18 +405,19 @@ export default {
|
||||
sourceBelongId: "请选择资源归属",
|
||||
level: "请填写项目级别",
|
||||
systemId: "请填写项目培训体系",
|
||||
boeFlag: "请选择是否BOEU实施",
|
||||
};
|
||||
|
||||
function timeChange(e) {
|
||||
if (e && e.length === 2) {
|
||||
state.projectInfo.beginTime = e[0]
|
||||
state.projectInfo.endTime = e[1]
|
||||
state.projectInfo.beginTime = e[0];
|
||||
state.projectInfo.endTime = e[1];
|
||||
}
|
||||
}
|
||||
|
||||
function validate(obj, errorMsgs) {
|
||||
for (let i in errorMsgs) {
|
||||
if (!obj[i]) {
|
||||
if (!obj[i] && obj[i] !== 0) {
|
||||
message.destroy();
|
||||
message.warning(errorMsgs[i]);
|
||||
return false;
|
||||
@@ -403,13 +431,12 @@ export default {
|
||||
if (!validate(state.projectInfo, errorMsgs)) {
|
||||
return;
|
||||
}
|
||||
state.projectInfo.type = 3
|
||||
state.projectInfo.type = 3;
|
||||
api.createProject(state.projectInfo).then(() => {
|
||||
message.destroy();
|
||||
message.success("编辑成功");
|
||||
router.back()
|
||||
}
|
||||
)
|
||||
router.back();
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -419,7 +446,7 @@ export default {
|
||||
classificationChange5,
|
||||
createProject,
|
||||
backPage,
|
||||
templateScroll
|
||||
templateScroll,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -523,7 +550,6 @@ export default {
|
||||
position: relative;
|
||||
margin-left: 14px;
|
||||
|
||||
|
||||
.box1 {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
|
||||
Reference in New Issue
Block a user