mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 13:56:45 +08:00
feat:增加单层项目、单层子项目、班级的编辑。
This commit is contained in:
12
package-lock.json
generated
12
package-lock.json
generated
@@ -4693,9 +4693,9 @@
|
||||
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
|
||||
},
|
||||
"node_modules/dayjs": {
|
||||
"version": "1.11.5",
|
||||
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz",
|
||||
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.6.tgz",
|
||||
"integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ=="
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
@@ -14972,9 +14972,9 @@
|
||||
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
|
||||
},
|
||||
"dayjs": {
|
||||
"version": "1.11.5",
|
||||
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz",
|
||||
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.6.tgz",
|
||||
"integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ=="
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.4",
|
||||
|
||||
@@ -1,40 +1,25 @@
|
||||
<template>
|
||||
<div class="openPages">
|
||||
<draggable
|
||||
v-model="openList"
|
||||
chosenClass="chosen"
|
||||
forceFallback="true"
|
||||
ghostClass="ghost"
|
||||
group="openPage"
|
||||
animation="500"
|
||||
@start="onStart"
|
||||
@end="onEnd"
|
||||
style="display: flex"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
<div style="position: relative">
|
||||
<router-link
|
||||
:to="element.href"
|
||||
class="openItems"
|
||||
:style="{ background: element.active ? '#f5f7fa' : '' }"
|
||||
>
|
||||
<div
|
||||
:style="{
|
||||
color: element.active
|
||||
? 'rgba(64, 158, 255, 1)'
|
||||
: 'rgba(135, 139, 146, 1)',
|
||||
}"
|
||||
>
|
||||
{{ element.pagename }}
|
||||
</div>
|
||||
</router-link>
|
||||
<div class="close" @click.stop="closePage(element)">
|
||||
<img src="../assets/images/openPages/close.png" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
</div>
|
||||
<div class="openPages">
|
||||
<draggable v-model="openList" chosenClass="chosen" forceFallback="true" ghostClass="ghost" group="openPage"
|
||||
animation="500" @start="onStart" @end="onEnd" style="display: flex">
|
||||
<template #item="{ element }">
|
||||
<div style="position: relative">
|
||||
<router-link :to="element.href" class="openItems" :style="{ background: element.active ? '#f5f7fa' : '' }">
|
||||
<div :style="{
|
||||
color: element.active
|
||||
? 'rgba(64, 158, 255, 1)'
|
||||
: 'rgba(135, 139, 146, 1)',
|
||||
}">
|
||||
{{ element.pagename }}
|
||||
</div>
|
||||
</router-link>
|
||||
<div class="close" @click.stop="closePage(element)">
|
||||
<img src="../assets/images/openPages/close.png" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs } from "vue";
|
||||
@@ -42,92 +27,96 @@ import { useStore } from "vuex";
|
||||
import { useRouter } from "vue-router";
|
||||
import draggable from "vuedraggable";
|
||||
export default {
|
||||
name: "OpenPages",
|
||||
components: {
|
||||
draggable,
|
||||
},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const $router = useRouter();
|
||||
const state = reactive({
|
||||
openList: store.state.openpages,
|
||||
});
|
||||
name: "OpenPages",
|
||||
components: {
|
||||
draggable,
|
||||
},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const $router = useRouter();
|
||||
const state = reactive({
|
||||
openList: store.state.openpages,
|
||||
});
|
||||
|
||||
const closePage = (value) => {
|
||||
console.log("点击关闭页面", value, state.openList);
|
||||
state.openList.map((item, key) => {
|
||||
if (item.href === value.href) {
|
||||
if (state.openList.length === 1) {
|
||||
if (state.openList[0].href !== "/learningpath") {
|
||||
state.openList.splice(key, 1);
|
||||
}
|
||||
$router.push({ path: "/learningpath" });
|
||||
} else {
|
||||
if (value.active) {
|
||||
if (key === state.openList.length - 1) {
|
||||
$router.push({ path: state.openList[key - 1].href });
|
||||
} else {
|
||||
$router.push({ path: state.openList[key + 1].href });
|
||||
}
|
||||
}
|
||||
state.openList.splice(key, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
store.commit("chengeOpenpages", state.openList);
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
closePage,
|
||||
};
|
||||
},
|
||||
const closePage = (value) => {
|
||||
console.log("点击关闭页面", value, state.openList);
|
||||
state.openList.map((item, key) => {
|
||||
if (item.href === value.href) {
|
||||
if (state.openList.length === 1) {
|
||||
if (state.openList[0].href !== "/learningpath") {
|
||||
state.openList.splice(key, 1);
|
||||
}
|
||||
$router.push({ path: "/learningpath" });
|
||||
} else {
|
||||
if (value.active) {
|
||||
if (key === state.openList.length - 1) {
|
||||
$router.push({ path: state.openList[key - 1].href });
|
||||
} else {
|
||||
$router.push({ path: state.openList[key + 1].href });
|
||||
}
|
||||
}
|
||||
state.openList.splice(key, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
store.commit("chengeOpenpages", state.openList);
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
closePage,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.openPages {
|
||||
width: 100%;
|
||||
// height: 50px;
|
||||
display: flex;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
box-shadow: 0px 8px 8px 0px rgba(118, 136, 166, 0.1);
|
||||
overflow-x: auto;
|
||||
.openItems {
|
||||
width: 272px;
|
||||
// min-width: 250px;
|
||||
height: 50px;
|
||||
border: 1px solid #edf2fa;
|
||||
border-left: 0px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.close {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 8px;
|
||||
width: 100%;
|
||||
// height: 50px;
|
||||
display: flex;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
box-shadow: 0px 8px 8px 0px rgba(118, 136, 166, 0.1);
|
||||
overflow-x: auto;
|
||||
|
||||
position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
top: 17px;
|
||||
right: 27px;
|
||||
}
|
||||
.close:hover {
|
||||
background: rgba(220, 220, 220, 1);
|
||||
}
|
||||
.openItems {
|
||||
width: 272px;
|
||||
// min-width: 250px;
|
||||
height: 50px;
|
||||
border: 1px solid #edf2fa;
|
||||
border-left: 0px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.chosen {
|
||||
// background-color: pink;
|
||||
}
|
||||
.ghost {
|
||||
// background-color: red;
|
||||
opacity: 0;
|
||||
}
|
||||
.close {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 8px;
|
||||
|
||||
position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
top: 17px;
|
||||
right: 27px;
|
||||
}
|
||||
|
||||
.close:hover {
|
||||
background: rgba(220, 220, 220, 1);
|
||||
}
|
||||
|
||||
.chosen {
|
||||
// background-color: pink;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
// background-color: red;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,9 @@
|
||||
<div class="projectAdd">
|
||||
<div class="header">
|
||||
<span class="title">创建/编辑单层项目</span>
|
||||
<router-link to="/projectmanage" class="goback">
|
||||
<div @click="backPage" style="cursor: pointer;" to="/projectmanage" class="goback">
|
||||
<span class="return"></span><span class="returntext">返回</span>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="main">
|
||||
@@ -72,8 +72,8 @@
|
||||
</div>
|
||||
|
||||
<div class="in">
|
||||
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']"
|
||||
style="width: 100%; height: 40px; border-radius: 5px" show-time @change="onRangeChange" />
|
||||
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']" v-model:value="rangevalue"
|
||||
style="width: 100%; height: 40px; border-radius: 5px" @change="onRangeChange" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
@@ -167,7 +167,7 @@
|
||||
">BOEU实施</span></a-radio>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name name2">
|
||||
<!-- <div class="name name2">
|
||||
<div class="namebox" style="margin-top: 8px">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<div class="inname">附件</div>
|
||||
@@ -177,24 +177,28 @@
|
||||
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
|
||||
<a-upload :disabled="fileList1.length > 5" :before-upload="beforeUpload1" v-model:file-list="fileList1"
|
||||
@remove="removeFile" name="file" action="/api/file/upload" :headers="headers" @change="handleChange1">
|
||||
<!-- <a-button> -->
|
||||
<!-- <upload-outlined></upload-outlined> -->
|
||||
<span v-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
|
||||
<span v-else class="filetext">上传附件</span>
|
||||
<!-- </a-button> -->
|
||||
</a-upload>
|
||||
</div>
|
||||
<div class="support">
|
||||
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="template">
|
||||
<div class="name">
|
||||
<div class="inname" style="width: 50px">模版</div>
|
||||
<div class="in select" style="margin-left: 2px">
|
||||
<a-select :getPopupContainer="
|
||||
<a-select v-if="isEdit" disabled="true" :getPopupContainer="
|
||||
(triggerNode) => {
|
||||
return triggerNode.parentNode || document.body;
|
||||
}
|
||||
" v-model:value="classifySelect5" placeholder="请选择模版" :size="size" style="width: 100%" :options="classifyList5"
|
||||
@change="classificationChange5">
|
||||
</a-select>
|
||||
<a-select v-else :getPopupContainer="
|
||||
(triggerNode) => {
|
||||
return triggerNode.parentNode || document.body;
|
||||
}
|
||||
@@ -208,7 +212,7 @@
|
||||
<div class="footer">
|
||||
<div class="btn">
|
||||
<a-button v-on:click="createProject" type="primary" class="btn1">确定</a-button>
|
||||
<a-button class="btn2">取消</a-button>
|
||||
<a-button @click="backPage" class="btn2">取消</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -216,13 +220,138 @@
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import dayjs from 'dayjs';
|
||||
import * as api from "../../api/index";
|
||||
import { storage } from '../../api/storage';
|
||||
import { toDate } from '../../api/method'
|
||||
|
||||
export default {
|
||||
name: "projectAdd",
|
||||
setup() {
|
||||
api.getProjectDetail({ projectId: 3 }).then(res => { console.log(res) }).catch(err => { console.log(err) })
|
||||
// 编辑页面跳转过来时候,自动填充表格
|
||||
const routers = useRoute();
|
||||
const isEdit = ref(false);
|
||||
let peojectID = "";
|
||||
|
||||
if (routers.query.projectId) {
|
||||
storage.set("projectAddId", routers.query.projectId);
|
||||
isEdit.value = true;
|
||||
peojectID = routers.query.projectId;
|
||||
// 需要编辑
|
||||
api.getProjectDetail({ projectId: routers.query.projectId }).then(res => {
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
let info = res.data.data.projectInfo;
|
||||
console.log(info)
|
||||
// projectName classifySelect imageUrl * classifySelect1 * remark checked classifySelect3 classifySelect4 changeChecked1 *
|
||||
projectName.value = info.name;
|
||||
state.classifySelect = classifyList.value[1]; // info.category
|
||||
imageUrl.value = info.picUrl;
|
||||
|
||||
let start = toDate(info.beginTime/1000,'YYYY/MM/DD');
|
||||
let end = toDate(info.endTime/1000,'YYYY/MM/DD');
|
||||
state.rangevalue = [
|
||||
dayjs(start, 'YYYY/MM/DD'),
|
||||
dayjs(end, 'YYYY/MM/DD'),
|
||||
];
|
||||
|
||||
let manageName = info.manager.split(",");
|
||||
let manageValue = info.managerId.split(",");
|
||||
let optionsManage = []
|
||||
for (let i = 0; i < manageName.length; i++) {
|
||||
let obj = {
|
||||
label: manageName[i],
|
||||
value: manageValue[i]
|
||||
}
|
||||
optionsManage.push(obj)
|
||||
}
|
||||
console.log(optionsManage)
|
||||
state.classifySelect1 = optionsManage;
|
||||
state.classifySelect2 = classifyList2.value[info.sourceBelongId - 1];
|
||||
remark.value = info.remark;
|
||||
state.checked = info.boeFlag ? info.boeFlag : false;
|
||||
state.classifySelect3 = classifyList3.value[info.level];
|
||||
state.classifySelect4 = classifyList4.value[info.systemId - 1];
|
||||
state.checked1 = info.boeFlag ? info.boeFlag : false;
|
||||
// fileList1.value = info.attach.split(",");
|
||||
|
||||
projectType = 1;
|
||||
picUrl = info.picUrl;
|
||||
beginTime = Number(info.beginTime/1000);
|
||||
endTime = Number(info.endTime/1000);
|
||||
manager = info.manager;
|
||||
managerId = info.managerId;
|
||||
sourceBelongIdC = Number(info.sourceBelongId);
|
||||
courseSyncFlag = info.courseSyncFlag;
|
||||
levels = info.level;
|
||||
systemid = info.systemId;
|
||||
boeFlag = info.boeFlag;
|
||||
}
|
||||
}).catch(err => { console.log(err) })
|
||||
} else {
|
||||
if (storage.get("projectAddId")) {
|
||||
isEdit.value = true;
|
||||
peojectID = storage.get("projectAddId");
|
||||
// 需要编辑
|
||||
api.getProjectDetail({ projectId: storage.get("projectAddId") }).then(res => {
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
let info = res.data.data.projectInfo;
|
||||
console.log("我是从本地存储获取的id", info)
|
||||
projectName.value = info.name;
|
||||
state.classifySelect = classifyList.value[1]; // info.category
|
||||
imageUrl.value = info.picUrl;
|
||||
|
||||
let start = toDate(info.beginTime/1000,'YYYY/MM/DD');
|
||||
let end = toDate(info.endTime/1000,'YYYY/MM/DD');
|
||||
state.rangevalue = [
|
||||
dayjs(start, 'YYYY/MM/DD'),
|
||||
dayjs(end, 'YYYY/MM/DD'),
|
||||
];
|
||||
|
||||
let manageName = info.manager.split(",");
|
||||
let manageValue = info.managerId.split(",");
|
||||
let optionsManage = []
|
||||
for (let i = 0; i < manageName.length; i++) {
|
||||
let obj = {
|
||||
label: manageName[i],
|
||||
value: manageValue[i]
|
||||
}
|
||||
optionsManage.push(obj)
|
||||
}
|
||||
console.log(optionsManage)
|
||||
state.classifySelect1 = optionsManage;
|
||||
state.classifySelect2 = classifyList2.value[info.sourceBelongId - 1];
|
||||
remark.value = info.remark;
|
||||
state.checked = info.boeFlag ? info.boeFlag : false;
|
||||
state.classifySelect3 = classifyList3.value[info.level];
|
||||
state.classifySelect4 = classifyList4.value[info.systemId - 1];
|
||||
state.checked1 = info.boeFlag ? info.boeFlag : false;
|
||||
|
||||
projectType = 1;
|
||||
picUrl = info.picUrl;
|
||||
beginTime = Number(info.beginTime/1000);
|
||||
endTime = Number(info.endTime/1000);
|
||||
manager = info.manager;
|
||||
managerId = info.managerId;
|
||||
sourceBelongIdC = Number(info.sourceBelongId);
|
||||
courseSyncFlag = info.courseSyncFlag;
|
||||
levels = info.level;
|
||||
systemid = info.systemId;
|
||||
boeFlag = info.boeFlag;
|
||||
}
|
||||
}).catch(err => { console.log(err) })
|
||||
}
|
||||
}
|
||||
|
||||
const backPage = () => {
|
||||
storage.remove("projectAddId");
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/projectmanage"
|
||||
});
|
||||
}, 400);
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
classifySelect: null,
|
||||
@@ -232,6 +361,11 @@ export default {
|
||||
valueE: null,
|
||||
valueE1: null,
|
||||
valueE2: null,
|
||||
classifySelect1: [],
|
||||
classifySelect2: [],
|
||||
classifySelect3: [],
|
||||
classifySelect4: [],
|
||||
rangevalue: []
|
||||
});
|
||||
|
||||
const projectName = ref("");
|
||||
@@ -347,6 +481,8 @@ export default {
|
||||
|
||||
let beginTime = "";
|
||||
let endTime = "";
|
||||
const dateFormatList = ['YYYY/MM/DD'];
|
||||
|
||||
const onRangeChange = (value, dateString) => {
|
||||
console.log("Selected Time: ", value);
|
||||
// 项目时间选择函数
|
||||
@@ -368,8 +504,8 @@ export default {
|
||||
|
||||
let manager = "";
|
||||
let managerId = "";
|
||||
const classificationChange1 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList1);
|
||||
const classificationChange1 = (key, options) => {
|
||||
console.log(`selected ${key}`, options);
|
||||
let mstr = "";
|
||||
let midstr = "";
|
||||
for (let i = 0; i < key.length; i++) {
|
||||
@@ -382,6 +518,14 @@ export default {
|
||||
}
|
||||
}
|
||||
console.log(mstr, midstr);
|
||||
state.classifySelect1 = options;
|
||||
let newoptions = [];
|
||||
for (let i = 0; i < state.classifySelect1.length; i++) {
|
||||
if (state.classifySelect1[i].value) {
|
||||
newoptions.push(state.classifySelect1[i])
|
||||
}
|
||||
}
|
||||
state.classifySelect1 = newoptions;
|
||||
manager = mstr;
|
||||
managerId = midstr;
|
||||
};
|
||||
@@ -393,8 +537,10 @@ export default {
|
||||
{ value: 3, label: "项目三" },
|
||||
]);
|
||||
|
||||
let sourceBelongIdC = '';
|
||||
const classificationChange2 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList2);
|
||||
sourceBelongIdC = key;
|
||||
};
|
||||
|
||||
// 项目级别
|
||||
@@ -404,8 +550,11 @@ export default {
|
||||
{ value: 3, label: "现地级" },
|
||||
{ value: 4, label: "部门级" },
|
||||
]);
|
||||
|
||||
let levels = "";
|
||||
const classificationChange3 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList3);
|
||||
levels = key;
|
||||
};
|
||||
|
||||
// 培训体系
|
||||
@@ -415,8 +564,11 @@ export default {
|
||||
{ value: 3, label: "现地级" },
|
||||
{ value: 4, label: "部门级" },
|
||||
]);
|
||||
|
||||
let systemid = "";
|
||||
const classificationChange4 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList4);
|
||||
systemid = key;
|
||||
};
|
||||
|
||||
// 模版
|
||||
@@ -479,66 +631,128 @@ export default {
|
||||
sourceBelongId: "请选择资源归属",
|
||||
level: "请填写项目级别",
|
||||
systemId: "请填写项目培训体系",
|
||||
boeFlag: "请选择是否BOE实施",
|
||||
attach: "请上传附件",
|
||||
boeFlag: "请选择是否BOE实施"
|
||||
};
|
||||
|
||||
const createProject = () => {
|
||||
let obj = {
|
||||
name: projectName["value"],
|
||||
category: projectType,
|
||||
picUrl: picUrl,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
manager: manager,
|
||||
managerId: managerId,
|
||||
sourceBelongId: 11,
|
||||
remark: remark["value"],
|
||||
courseSyncFlag: courseSyncFlag,
|
||||
level: 3,
|
||||
systemId: 4,
|
||||
boeFlag: boeFlag,
|
||||
attach: attach,
|
||||
type: 3,
|
||||
templateId: 10,
|
||||
parentId: 0,
|
||||
notice: "",
|
||||
noticeFlag: 0,
|
||||
status: 0,
|
||||
};
|
||||
console.log("提交的数据格式 %o", obj);
|
||||
for (let i in errorMsgs) {
|
||||
console.log(obj[i]);
|
||||
if (obj[i] === "" || obj[i] === undefined) {
|
||||
message.destroy();
|
||||
message.warning(errorMsgs[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log('我是否要编辑项目', isEdit.value)
|
||||
if (isEdit.value) {
|
||||
console.log('我要编辑项目', peojectID)
|
||||
let obj = {
|
||||
projectId: Number(peojectID),
|
||||
name: projectName["value"],
|
||||
category: projectType,
|
||||
picUrl: picUrl,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
manager: manager,
|
||||
managerId: managerId,
|
||||
sourceBelongId: sourceBelongIdC,
|
||||
remark: remark["value"],
|
||||
courseSyncFlag: courseSyncFlag,
|
||||
level: levels,
|
||||
systemId: systemid,
|
||||
boeFlag: boeFlag,
|
||||
attach: attach,
|
||||
type: 3,
|
||||
templateId: 0,
|
||||
parentId: 0,
|
||||
notice: "",
|
||||
noticeFlag: 0,
|
||||
status: 0,
|
||||
};
|
||||
|
||||
api
|
||||
.createProject(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
console.log(obj);
|
||||
|
||||
for (let i in errorMsgs) {
|
||||
console.log(obj[i]);
|
||||
if (obj[i] === "" || obj[i] === undefined) {
|
||||
message.destroy();
|
||||
message.success("创建成功");
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { id: res.data.data.projectId },
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
message.warning(errorMsgs[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
api
|
||||
.createProject(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
message.destroy();
|
||||
message.success("编辑成功");
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/projectmanage"
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
message.destroy();
|
||||
message.error("编辑失败,请检查当前网络状态。");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
message.destroy();
|
||||
message.error("编辑失败,请检查当前网络状态。");
|
||||
});
|
||||
|
||||
} else {
|
||||
let obj = {
|
||||
name: projectName["value"],
|
||||
category: projectType,
|
||||
picUrl: picUrl,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
manager: manager,
|
||||
managerId: managerId,
|
||||
sourceBelongId: sourceBelongIdC,
|
||||
remark: remark["value"],
|
||||
courseSyncFlag: courseSyncFlag,
|
||||
level: levels,
|
||||
systemId: systemid,
|
||||
boeFlag: boeFlag,
|
||||
attach: attach,
|
||||
type: 3,
|
||||
templateId: 10,
|
||||
parentId: 0,
|
||||
notice: "",
|
||||
noticeFlag: 0,
|
||||
status: 0,
|
||||
};
|
||||
console.log("提交的数据格式 %o", obj);
|
||||
for (let i in errorMsgs) {
|
||||
console.log(obj[i]);
|
||||
if (obj[i] === "" || obj[i] === undefined) {
|
||||
message.destroy();
|
||||
message.warning(errorMsgs[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
api
|
||||
.createProject(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
message.destroy();
|
||||
message.success("创建成功");
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { id: res.data.data.projectId },
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
message.destroy();
|
||||
message.error("创建失败,请检查当前网络状态。");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
message.destroy();
|
||||
message.error("创建失败,请检查当前网络状态。");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
message.destroy();
|
||||
message.error("创建失败,请检查当前网络状态。");
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -571,6 +785,10 @@ export default {
|
||||
uplodaFileCount,
|
||||
createProject,
|
||||
removeFile,
|
||||
|
||||
isEdit,
|
||||
backPage,
|
||||
dateFormatList,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -669,6 +669,7 @@ export default {
|
||||
currentEdProjectName: '',
|
||||
|
||||
currentEditChildrensProjectId: '',
|
||||
dcProjectID: ''
|
||||
|
||||
});
|
||||
// 数据接入 - start -
|
||||
@@ -796,7 +797,7 @@ export default {
|
||||
let edname = '';
|
||||
const edclassificationChangeName = (key) => {
|
||||
console.log(key)
|
||||
edname = key;
|
||||
edname = key.target.value;
|
||||
}
|
||||
|
||||
let edcategory = '';
|
||||
@@ -944,17 +945,32 @@ export default {
|
||||
// 编辑多层项目
|
||||
const editStoreyProject = () => {
|
||||
let obj = {
|
||||
projectId: 1,
|
||||
projectId: Number(state.dcProjectID),
|
||||
name: edname,
|
||||
category: edcategory,
|
||||
manager: edmanage,
|
||||
managerId: edmanageid,
|
||||
sourceBelongId: edsource
|
||||
manager: edmanage.toString(","),
|
||||
managerId: edmanageid.toString(","),
|
||||
sourceBelongId: edsource,
|
||||
type: 1,
|
||||
picUrl: 0
|
||||
}
|
||||
if (obj.name !== "" || obj.category !== "" || obj.manager !== "" || obj.sourceBelongId !== "") {
|
||||
alert("我需要编辑")
|
||||
console.log("我需要编辑")
|
||||
console.log(obj)
|
||||
state.eddoublepro = false;
|
||||
api.createProject(obj).then(res => {
|
||||
console.log(res)
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
state.eddoublepro = false;
|
||||
message.destroy();
|
||||
message.success("编辑成功");
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
state.eddoublepro = false;
|
||||
message.destroy();
|
||||
message.error("编辑失败,请检查当前网络状态。");
|
||||
})
|
||||
|
||||
} else {
|
||||
state.eddoublepro = false;
|
||||
}
|
||||
@@ -1236,7 +1252,7 @@ export default {
|
||||
"草稿" :
|
||||
value.record.status == 1 && Number(value.record.beginTime) < Math.ceil(new Date().getTime / 1000) ?
|
||||
"进行中" :
|
||||
value.record.status == 1 && Number(value.record.beginTime) > Math.ceil(new Date().getTime / 1000) ?
|
||||
value.record.status == 1 && Number(value.record.beginTime) > Math.ceil(new Date().getTime / 1000) && value.record.type !== 1 && value.record.type !== 2 ?
|
||||
"未开始" :
|
||||
value.record.status == 2 ?
|
||||
"未开始" : "已结束"
|
||||
@@ -1281,6 +1297,7 @@ export default {
|
||||
onClick={() => {
|
||||
state.eddoublepro = true;
|
||||
console.log("多层项目编辑")
|
||||
state.dcProjectID = value.record.projectId;
|
||||
edvalue1.value = value.record.name;
|
||||
{/* edvalue2.value = classifyList[value.record.category] */ }
|
||||
edvalue2.value = classifyList.value[0];
|
||||
@@ -1370,7 +1387,7 @@ export default {
|
||||
存为模版
|
||||
</div>
|
||||
</a-select-option> */}
|
||||
<a-select-option value="复制" label="复制">
|
||||
<a-select-option value="复制" label="复制">
|
||||
<div
|
||||
onClick={() => {
|
||||
showCopyModal();
|
||||
@@ -1443,13 +1460,13 @@ export default {
|
||||
</div>
|
||||
<span
|
||||
class="operation3"
|
||||
// onClick={() => {
|
||||
// showCopyModal();
|
||||
// }}
|
||||
// onClick={() => {
|
||||
// showCopyModal();
|
||||
// }}
|
||||
>
|
||||
</span>
|
||||
|
||||
<div class="tableSelect">
|
||||
<div class="tableSelect">
|
||||
<a-select
|
||||
style="width: 50px"
|
||||
value="更多"
|
||||
@@ -1471,7 +1488,7 @@ export default {
|
||||
存为模版
|
||||
</div>
|
||||
</a-select-option> */}
|
||||
<a-select-option value="复制" label="复制">
|
||||
<a-select-option value="复制" label="复制">
|
||||
<div
|
||||
onClick={() => {
|
||||
showCopyModal();
|
||||
@@ -1536,9 +1553,9 @@ export default {
|
||||
</div>
|
||||
<span
|
||||
class="operation3"
|
||||
// onClick={() => {
|
||||
// showCopyModal();
|
||||
// }}
|
||||
// onClick={() => {
|
||||
// showCopyModal();
|
||||
// }}
|
||||
>
|
||||
</span>
|
||||
<div class="tableSelect">
|
||||
@@ -1563,7 +1580,7 @@ export default {
|
||||
存为模版
|
||||
</div>
|
||||
</a-select-option> */}
|
||||
<a-select-option value="复制" label="复制">
|
||||
<a-select-option value="复制" label="复制">
|
||||
<div
|
||||
onClick={() => {
|
||||
showCopyModal();
|
||||
@@ -1582,7 +1599,7 @@ export default {
|
||||
</div>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div></div>
|
||||
@@ -1690,7 +1707,7 @@ export default {
|
||||
</a-select>
|
||||
</div>
|
||||
</div>
|
||||
) : value.record.status === 1 ? (
|
||||
) : value.record.status === 1 ? (
|
||||
<div class="operation">
|
||||
<span class="operation1">查看</span>
|
||||
<div class="tableSelect">
|
||||
@@ -1820,7 +1837,7 @@ export default {
|
||||
|
||||
>
|
||||
</span>
|
||||
<div class="tableSelect">
|
||||
<div class="tableSelect">
|
||||
<a-select
|
||||
style="width: 50px"
|
||||
value="更多"
|
||||
@@ -1871,12 +1888,12 @@ export default {
|
||||
if (value.record.isbj) {
|
||||
router.push({
|
||||
path: '/classadd',
|
||||
query: { projectId: value.record.projectId, name: value.record.paraentName }
|
||||
query: { projectId: value.record.projectId, name: value.record.paraentName, edit: 0 }
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/sonproject',
|
||||
query: { projectId: value.record.projectId, name: value.record.name }
|
||||
query: { projectId: value.record.projectId, name: value.record.paraentName, edit: 0 }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1993,7 +2010,7 @@ export default {
|
||||
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
) : value.record.status ===1|| value.record.status == 1 && Number(value.record.beginTime) > Math.ceil(new Date().getTime / 1000) ? (
|
||||
) : value.record.status === 1 || value.record.status == 1 && Number(value.record.beginTime) > Math.ceil(new Date().getTime / 1000) ? (
|
||||
<a-select
|
||||
style="width: 50px"
|
||||
value="更多"
|
||||
@@ -2002,14 +2019,14 @@ export default {
|
||||
>
|
||||
<a-select-option value="存为模版" label="存为模版">
|
||||
<a-select-option value="复制" label="复制">
|
||||
<div
|
||||
onClick={() => {
|
||||
showCopyModal();
|
||||
}}
|
||||
>
|
||||
复制
|
||||
</div>
|
||||
</a-select-option>
|
||||
<div
|
||||
onClick={() => {
|
||||
showCopyModal();
|
||||
}}
|
||||
>
|
||||
复制
|
||||
</div>
|
||||
</a-select-option>
|
||||
<div
|
||||
onClick={() => {
|
||||
showStartModal();
|
||||
@@ -2132,6 +2149,8 @@ export default {
|
||||
data2.isbj = "class";
|
||||
})
|
||||
console.log('lalallalaa', data)
|
||||
} else {
|
||||
data.paraentName = value.name;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<div class="projectAdd">
|
||||
<div class="header">
|
||||
<span class="title">创建/编辑单层子项目</span>
|
||||
<router-link to="/projectmanage" class="goback">
|
||||
<div @click="backPage" style="cursor: pointer;" to="/projectmanage" class="goback">
|
||||
<span class="return"></span><span class="returntext">返回</span>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="main">
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="inname">子项目名称</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-input v-model:value="projectName" placeholder="请输入子项目名称" show-count :maxlength="30" />
|
||||
<a-input v-model:value="projectName" placeholder="请输入项目名称" show-count :maxlength="30" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
@@ -83,8 +83,8 @@
|
||||
</div>
|
||||
|
||||
<div class="in">
|
||||
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']"
|
||||
style="width: 100%; height: 40px; border-radius: 5px" show-time @change="onRangeChange" />
|
||||
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']" v-model:value="rangevalue"
|
||||
style="width: 100%; height: 40px; border-radius: 5px" @change="onRangeChange" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
@@ -97,7 +97,7 @@
|
||||
(triggerNode) => {
|
||||
return triggerNode.parentNode || document.body;
|
||||
}
|
||||
" :value="classifySelect1" mode="multiple" placeholder="请选择子项目经理" style="width: 100%" :options="classifyList1"
|
||||
" :value="classifySelect1" mode="multiple" placeholder="请选择项目经理" style="width: 100%" :options="classifyList1"
|
||||
@change="classificationChange1" allowClear showSearch>
|
||||
</a-select>
|
||||
</div>
|
||||
@@ -178,7 +178,7 @@
|
||||
">BOEU实施</span></a-radio>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name name2">
|
||||
<!-- <div class="name name2">
|
||||
<div class="namebox" style="margin-top: 8px">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<div class="inname">附件</div>
|
||||
@@ -188,24 +188,28 @@
|
||||
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
|
||||
<a-upload :disabled="fileList1.length > 5" :before-upload="beforeUpload1" v-model:file-list="fileList1"
|
||||
@remove="removeFile" name="file" action="/api/file/upload" :headers="headers" @change="handleChange1">
|
||||
<!-- <a-button> -->
|
||||
<!-- <upload-outlined></upload-outlined> -->
|
||||
<span v-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
|
||||
<span v-else class="filetext">上传附件</span>
|
||||
<!-- </a-button> -->
|
||||
</a-upload>
|
||||
</div>
|
||||
<div class="support">
|
||||
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="template">
|
||||
<div class="name">
|
||||
<div class="inname" style="width: 50px">模版</div>
|
||||
<div class="in select" style="margin-left: 2px">
|
||||
<a-select :getPopupContainer="
|
||||
<a-select v-if="isEdit" disabled="true" :getPopupContainer="
|
||||
(triggerNode) => {
|
||||
return triggerNode.parentNode || document.body;
|
||||
}
|
||||
" v-model:value="classifySelect5" placeholder="请选择模版" :size="size" style="width: 100%" :options="classifyList5"
|
||||
@change="classificationChange5">
|
||||
</a-select>
|
||||
<a-select v-else :getPopupContainer="
|
||||
(triggerNode) => {
|
||||
return triggerNode.parentNode || document.body;
|
||||
}
|
||||
@@ -219,7 +223,7 @@
|
||||
<div class="footer">
|
||||
<div class="btn">
|
||||
<a-button v-on:click="createProject" type="primary" class="btn1">确定</a-button>
|
||||
<a-button class="btn2">取消</a-button>
|
||||
<a-button @click="backPage" class="btn2">取消</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -228,14 +232,20 @@
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import dayjs from 'dayjs';
|
||||
import * as api from "../../api/index";
|
||||
import { storage } from '../../api/storage';
|
||||
import { toDate } from '../../api/method'
|
||||
|
||||
export default {
|
||||
name: "sonProject",
|
||||
name: "projectAdd",
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
// 编辑页面跳转过来时候,自动填充表格
|
||||
const routers = useRoute();
|
||||
const router = useRouter();
|
||||
const isEdit = ref(false);
|
||||
let peojectID = "";
|
||||
let paraentID = "";
|
||||
|
||||
const state = reactive({
|
||||
classifySelect: null,
|
||||
classifySelectId: null,
|
||||
@@ -244,18 +254,93 @@ export default {
|
||||
valueE: null,
|
||||
valueE1: null,
|
||||
valueE2: null,
|
||||
|
||||
classifySelect1: [],
|
||||
classifySelect2: [],
|
||||
classifySelect3: [],
|
||||
classifySelect4: [],
|
||||
rangevalue: [],
|
||||
projectAscription: "",
|
||||
});
|
||||
|
||||
const projectName = ref("");
|
||||
if (routers.query.name == undefined) {
|
||||
router.push({
|
||||
path: "/projectmanage"
|
||||
});
|
||||
}
|
||||
|
||||
peojectID = routers.query.projectId;
|
||||
state.projectAscription = routers.query.name;
|
||||
|
||||
if (routers.query.name) {
|
||||
storage.set("editproject", routers.query)
|
||||
if (routers.query.edit !== undefined) {
|
||||
isEdit.value = true;
|
||||
// 需要编辑
|
||||
api.getProjectDetail({ projectId: routers.query.projectId }).then(res => {
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
let info = res.data.data.projectInfo;
|
||||
console.log(info)
|
||||
// projectName classifySelect imageUrl * classifySelect1 * remark checked classifySelect3 classifySelect4 changeChecked1 *
|
||||
projectName.value = info.name;
|
||||
state.classifySelect = classifyList.value[1]; // info.category
|
||||
imageUrl.value = info.picUrl;
|
||||
|
||||
let start = toDate(info.beginTime / 1000, 'YYYY/MM/DD');
|
||||
let end = toDate(info.endTime / 1000, 'YYYY/MM/DD');
|
||||
state.rangevalue = [
|
||||
dayjs(start, 'YYYY/MM/DD'),
|
||||
dayjs(end, 'YYYY/MM/DD'),
|
||||
];
|
||||
|
||||
let manageName = info.manager.split(",");
|
||||
let manageValue = info.managerId.split(",");
|
||||
let optionsManage = []
|
||||
for (let i = 0; i < manageName.length; i++) {
|
||||
let obj = {
|
||||
label: manageName[i],
|
||||
value: manageValue[i]
|
||||
}
|
||||
optionsManage.push(obj)
|
||||
}
|
||||
console.log(optionsManage)
|
||||
state.classifySelect1 = optionsManage;
|
||||
state.classifySelect2 = classifyList2.value[info.sourceBelongId - 1];
|
||||
remark.value = info.remark;
|
||||
state.checked = info.boeFlag ? info.boeFlag : false;
|
||||
state.classifySelect3 = classifyList3.value[info.level];
|
||||
state.classifySelect4 = classifyList4.value[info.systemId - 1];
|
||||
state.checked1 = info.boeFlag ? info.boeFlag : false;
|
||||
// fileList1.value = info.attach.split(",");
|
||||
|
||||
projectType = 1;
|
||||
picUrl = info.picUrl;
|
||||
beginTime = Number(info.beginTime / 1000);
|
||||
endTime = Number(info.endTime / 1000);
|
||||
manager = info.manager;
|
||||
managerId = info.managerId;
|
||||
sourceBelongIdC = Number(info.sourceBelongId);
|
||||
courseSyncFlag = info.courseSyncFlag;
|
||||
levels = info.level;
|
||||
systemid = info.systemId;
|
||||
boeFlag = info.boeFlag;
|
||||
paraentID = Number(info.parentId);
|
||||
}
|
||||
}).catch(err => { console.log(err) })
|
||||
} else {
|
||||
paraentID = Number(routers.query.projectId);
|
||||
}
|
||||
|
||||
|
||||
const backPage = () => {
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/projectmanage"
|
||||
});
|
||||
}, 400);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const projectName = ref("");
|
||||
|
||||
const classifyList = ref([
|
||||
{ value: 1, label: "管理者" },
|
||||
{ value: 2, label: "领军者" },
|
||||
@@ -367,6 +452,8 @@ export default {
|
||||
|
||||
let beginTime = "";
|
||||
let endTime = "";
|
||||
const dateFormatList = ['YYYY/MM/DD'];
|
||||
|
||||
const onRangeChange = (value, dateString) => {
|
||||
console.log("Selected Time: ", value);
|
||||
// 项目时间选择函数
|
||||
@@ -388,8 +475,8 @@ export default {
|
||||
|
||||
let manager = "";
|
||||
let managerId = "";
|
||||
const classificationChange1 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList1);
|
||||
const classificationChange1 = (key, options) => {
|
||||
console.log(`selected ${key}`, options);
|
||||
let mstr = "";
|
||||
let midstr = "";
|
||||
for (let i = 0; i < key.length; i++) {
|
||||
@@ -402,6 +489,14 @@ export default {
|
||||
}
|
||||
}
|
||||
console.log(mstr, midstr);
|
||||
state.classifySelect1 = options;
|
||||
let newoptions = [];
|
||||
for (let i = 0; i < state.classifySelect1.length; i++) {
|
||||
if (state.classifySelect1[i].value) {
|
||||
newoptions.push(state.classifySelect1[i])
|
||||
}
|
||||
}
|
||||
state.classifySelect1 = newoptions;
|
||||
manager = mstr;
|
||||
managerId = midstr;
|
||||
};
|
||||
@@ -413,8 +508,10 @@ export default {
|
||||
{ value: 3, label: "项目三" },
|
||||
]);
|
||||
|
||||
let sourceBelongIdC = '';
|
||||
const classificationChange2 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList2);
|
||||
sourceBelongIdC = key;
|
||||
};
|
||||
|
||||
// 项目级别
|
||||
@@ -424,8 +521,11 @@ export default {
|
||||
{ value: 3, label: "现地级" },
|
||||
{ value: 4, label: "部门级" },
|
||||
]);
|
||||
|
||||
let levels = "";
|
||||
const classificationChange3 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList3);
|
||||
levels = key;
|
||||
};
|
||||
|
||||
// 培训体系
|
||||
@@ -435,8 +535,11 @@ export default {
|
||||
{ value: 3, label: "现地级" },
|
||||
{ value: 4, label: "部门级" },
|
||||
]);
|
||||
|
||||
let systemid = "";
|
||||
const classificationChange4 = (key) => {
|
||||
console.log(`selected ${key}`, classifyList4);
|
||||
systemid = key;
|
||||
};
|
||||
|
||||
// 模版
|
||||
@@ -499,66 +602,128 @@ export default {
|
||||
sourceBelongId: "请选择资源归属",
|
||||
level: "请填写项目级别",
|
||||
systemId: "请填写项目培训体系",
|
||||
boeFlag: "请选择是否BOE实施",
|
||||
attach: "请上传附件",
|
||||
boeFlag: "请选择是否BOE实施"
|
||||
};
|
||||
|
||||
const createProject = () => {
|
||||
let obj = {
|
||||
name: projectName["value"],
|
||||
category: projectType,
|
||||
picUrl: picUrl,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
manager: manager,
|
||||
managerId: managerId,
|
||||
sourceBelongId: 11,
|
||||
remark: remark["value"],
|
||||
courseSyncFlag: courseSyncFlag,
|
||||
level: 3,
|
||||
systemId: 4,
|
||||
boeFlag: boeFlag,
|
||||
attach: attach,
|
||||
type: 3,
|
||||
templateId: 10,
|
||||
parentId: routers.query.projectId,
|
||||
notice: "",
|
||||
noticeFlag: 0,
|
||||
status: 0,
|
||||
};
|
||||
console.log("提交的数据格式 %o", obj);
|
||||
for (let i in errorMsgs) {
|
||||
console.log(obj[i]);
|
||||
if (obj[i] === "" || obj[i] === undefined) {
|
||||
message.destroy();
|
||||
message.warning(errorMsgs[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log('我是否要编辑项目', isEdit.value)
|
||||
if (isEdit.value) {
|
||||
console.log('我要编辑项目', peojectID)
|
||||
let obj = {
|
||||
projectId: Number(peojectID),
|
||||
name: projectName["value"],
|
||||
category: projectType,
|
||||
picUrl: picUrl,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
manager: manager,
|
||||
managerId: managerId,
|
||||
sourceBelongId: sourceBelongIdC,
|
||||
remark: remark["value"],
|
||||
courseSyncFlag: courseSyncFlag,
|
||||
level: levels,
|
||||
systemId: systemid,
|
||||
boeFlag: boeFlag,
|
||||
attach: attach,
|
||||
type: 3,
|
||||
templateId: 0,
|
||||
parentId: paraentID,
|
||||
notice: "",
|
||||
noticeFlag: 0,
|
||||
status: 0,
|
||||
};
|
||||
|
||||
api
|
||||
.createProject(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
console.log(obj);
|
||||
|
||||
for (let i in errorMsgs) {
|
||||
console.log(obj[i]);
|
||||
if (obj[i] === "" || obj[i] === undefined) {
|
||||
message.destroy();
|
||||
message.success("创建成功");
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { id: res.data.data.projectId },
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
message.warning(errorMsgs[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
api
|
||||
.createProject(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
message.destroy();
|
||||
message.success("编辑成功");
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/projectmanage"
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
message.destroy();
|
||||
message.error("编辑失败,请检查当前网络状态。");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
message.destroy();
|
||||
message.error("编辑失败,请检查当前网络状态。");
|
||||
});
|
||||
|
||||
} else {
|
||||
let obj = {
|
||||
name: projectName["value"],
|
||||
category: projectType,
|
||||
picUrl: picUrl,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
manager: manager,
|
||||
managerId: managerId,
|
||||
sourceBelongId: sourceBelongIdC,
|
||||
remark: remark["value"],
|
||||
courseSyncFlag: courseSyncFlag,
|
||||
level: levels,
|
||||
systemId: systemid,
|
||||
boeFlag: boeFlag,
|
||||
attach: attach,
|
||||
type: 3,
|
||||
templateId: 10,
|
||||
parentId: paraentID,
|
||||
notice: "",
|
||||
noticeFlag: 0,
|
||||
status: 0,
|
||||
};
|
||||
console.log("提交的数据格式 %o", obj);
|
||||
for (let i in errorMsgs) {
|
||||
console.log(obj[i]);
|
||||
if (obj[i] === "" || obj[i] === undefined) {
|
||||
message.destroy();
|
||||
message.warning(errorMsgs[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
api
|
||||
.createProject(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.status == 200 && res.data.code == 200) {
|
||||
message.destroy();
|
||||
message.success("创建成功");
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { id: res.data.data.projectId },
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
message.destroy();
|
||||
message.error("创建失败,请检查当前网络状态。");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
message.destroy();
|
||||
message.error("创建失败,请检查当前网络状态。");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
message.destroy();
|
||||
message.error("创建失败,请检查当前网络状态。");
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -591,6 +756,10 @@ export default {
|
||||
uplodaFileCount,
|
||||
createProject,
|
||||
removeFile,
|
||||
|
||||
isEdit,
|
||||
backPage,
|
||||
dateFormatList,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -889,3 +1058,4 @@ export default {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user