mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-13 12: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=="
|
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
|
||||||
},
|
},
|
||||||
"node_modules/dayjs": {
|
"node_modules/dayjs": {
|
||||||
"version": "1.11.5",
|
"version": "1.11.6",
|
||||||
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz",
|
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.6.tgz",
|
||||||
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
|
"integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ=="
|
||||||
},
|
},
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "4.3.4",
|
"version": "4.3.4",
|
||||||
@@ -14972,9 +14972,9 @@
|
|||||||
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
|
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
|
||||||
},
|
},
|
||||||
"dayjs": {
|
"dayjs": {
|
||||||
"version": "1.11.5",
|
"version": "1.11.6",
|
||||||
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz",
|
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.6.tgz",
|
||||||
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
|
"integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ=="
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "4.3.4",
|
"version": "4.3.4",
|
||||||
|
|||||||
@@ -1,30 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="openPages">
|
<div class="openPages">
|
||||||
<draggable
|
<draggable v-model="openList" chosenClass="chosen" forceFallback="true" ghostClass="ghost" group="openPage"
|
||||||
v-model="openList"
|
animation="500" @start="onStart" @end="onEnd" style="display: flex">
|
||||||
chosenClass="chosen"
|
|
||||||
forceFallback="true"
|
|
||||||
ghostClass="ghost"
|
|
||||||
group="openPage"
|
|
||||||
animation="500"
|
|
||||||
@start="onStart"
|
|
||||||
@end="onEnd"
|
|
||||||
style="display: flex"
|
|
||||||
>
|
|
||||||
<template #item="{ element }">
|
<template #item="{ element }">
|
||||||
<div style="position: relative">
|
<div style="position: relative">
|
||||||
<router-link
|
<router-link :to="element.href" class="openItems" :style="{ background: element.active ? '#f5f7fa' : '' }">
|
||||||
:to="element.href"
|
<div :style="{
|
||||||
class="openItems"
|
|
||||||
:style="{ background: element.active ? '#f5f7fa' : '' }"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
:style="{
|
|
||||||
color: element.active
|
color: element.active
|
||||||
? 'rgba(64, 158, 255, 1)'
|
? 'rgba(64, 158, 255, 1)'
|
||||||
: 'rgba(135, 139, 146, 1)',
|
: 'rgba(135, 139, 146, 1)',
|
||||||
}"
|
}">
|
||||||
>
|
|
||||||
{{ element.pagename }}
|
{{ element.pagename }}
|
||||||
</div>
|
</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
@@ -91,6 +76,7 @@ export default {
|
|||||||
background-color: rgba(255, 255, 255, 1);
|
background-color: rgba(255, 255, 255, 1);
|
||||||
box-shadow: 0px 8px 8px 0px rgba(118, 136, 166, 0.1);
|
box-shadow: 0px 8px 8px 0px rgba(118, 136, 166, 0.1);
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|
||||||
.openItems {
|
.openItems {
|
||||||
width: 272px;
|
width: 272px;
|
||||||
// min-width: 250px;
|
// min-width: 250px;
|
||||||
@@ -106,6 +92,7 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close {
|
.close {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
@@ -118,6 +105,7 @@ export default {
|
|||||||
top: 17px;
|
top: 17px;
|
||||||
right: 27px;
|
right: 27px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close:hover {
|
.close:hover {
|
||||||
background: rgba(220, 220, 220, 1);
|
background: rgba(220, 220, 220, 1);
|
||||||
}
|
}
|
||||||
@@ -125,6 +113,7 @@ export default {
|
|||||||
.chosen {
|
.chosen {
|
||||||
// background-color: pink;
|
// background-color: pink;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ghost {
|
.ghost {
|
||||||
// background-color: red;
|
// background-color: red;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -3,18 +3,15 @@
|
|||||||
<div class="projectAdd">
|
<div class="projectAdd">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<span class="title">创建/编辑班级</span>
|
<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>
|
<span class="return"></span><span class="returntext">返回</span>
|
||||||
</router-link>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">项目归属</div>
|
<div class="inname">项目归属</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
@@ -25,58 +22,34 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">班级名称</div>
|
<div class="inname">班级名称</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<a-input v-model:value="projectName" placeholder="请输入项目名称" show-count :maxlength="30" />
|
||||||
v-model:value="projectName"
|
|
||||||
placeholder="请输入班级名称"
|
|
||||||
show-count
|
|
||||||
:maxlength="30"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">分类</div>
|
<div class="inname">分类</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in select">
|
<div class="in select">
|
||||||
<a-select
|
<a-select :getPopupContainer="
|
||||||
:getPopupContainer="
|
|
||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
"
|
" v-model:value="classifySelect" placeholder="四个养成" style="width: 100%" :options="classifyList"
|
||||||
v-model:value="classifySelect"
|
@change="classificationChange" allowClear showSearch>
|
||||||
placeholder="四个养成"
|
|
||||||
style="width: 100%"
|
|
||||||
:options="classifyList"
|
|
||||||
@change="classificationChange"
|
|
||||||
allowClear
|
|
||||||
showSearch
|
|
||||||
>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">封面图</div>
|
<div class="inname">封面图</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="box" style="
|
||||||
class="box"
|
|
||||||
style="
|
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border: 1px solid rgba(78, 166, 255, 1);
|
border: 1px solid rgba(78, 166, 255, 1);
|
||||||
@@ -84,29 +57,15 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
"
|
">
|
||||||
>
|
<a-upload v-model:file-list="fileList" name="file" list-type="picture-card" class="avatar-uploader"
|
||||||
<a-upload
|
:show-upload-list="false" action="/api/file/upload" :before-upload="beforeUpload" @change="handleChange">
|
||||||
v-model:file-list="fileList"
|
<img style="
|
||||||
name="file"
|
|
||||||
list-type="picture-card"
|
|
||||||
class="avatar-uploader"
|
|
||||||
:show-upload-list="false"
|
|
||||||
action="/api/file/upload"
|
|
||||||
:before-upload="beforeUpload"
|
|
||||||
@change="handleChange"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
style="
|
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
"
|
" v-if="imageUrl" :src="imageUrl" alt="avatar" />
|
||||||
v-if="imageUrl"
|
|
||||||
:src="imageUrl"
|
|
||||||
alt="avatar"
|
|
||||||
/>
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<!-- <loading-outlined v-if="loading"></loading-outlined> -->
|
<!-- <loading-outlined v-if="loading"></loading-outlined> -->
|
||||||
<!-- <plus-outlined v-else></plus-outlined> -->
|
<!-- <plus-outlined v-else></plus-outlined> -->
|
||||||
@@ -119,71 +78,43 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">子项目时间</div>
|
<div class="inname">子项目时间</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-range-picker
|
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']" v-model:value="rangevalue"
|
||||||
separator="至"
|
style="width: 100%; height: 40px; border-radius: 5px" @change="onRangeChange" />
|
||||||
:placeholder="[' 开始时间', ' 结束时间']"
|
|
||||||
style="width: 100%; height: 40px; border-radius: 5px"
|
|
||||||
show-time
|
|
||||||
@change="onRangeChange"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">子项目经理</div>
|
<div class="inname">子项目经理</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-select
|
<a-select :getPopupContainer="
|
||||||
:getPopupContainer="
|
|
||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
"
|
" :value="classifySelect1" mode="multiple" placeholder="请选择项目经理" style="width: 100%" :options="classifyList1"
|
||||||
:value="classifySelect1"
|
@change="classificationChange1" allowClear showSearch>
|
||||||
mode="multiple"
|
|
||||||
placeholder="请选择子项目经理"
|
|
||||||
style="width: 100%"
|
|
||||||
:options="classifyList1"
|
|
||||||
@change="classificationChange1"
|
|
||||||
allowClear
|
|
||||||
showSearch
|
|
||||||
>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">资源归属</div>
|
<div class="inname">资源归属</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="in select">
|
<div class="in select">
|
||||||
<a-select
|
<a-select :getPopupContainer="
|
||||||
:getPopupContainer="
|
|
||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
"
|
" v-model:value="classifySelect2" placeholder="自动带出 可修改" :options="classifyList2"
|
||||||
v-model:value="classifySelect2"
|
@change="classificationChange2" />
|
||||||
placeholder="自动带出 可修改"
|
|
||||||
:options="classifyList2"
|
|
||||||
@change="classificationChange2"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name name2">
|
<div class="name name2">
|
||||||
@@ -191,13 +122,7 @@
|
|||||||
<div class="inname" style="margin-top: 13px">项目说明</div>
|
<div class="inname" style="margin-top: 13px">项目说明</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-textarea
|
<a-textarea v-model:value="remark" style="height: 80px" placeholder="请输入说明" show-count :maxlength="200" />
|
||||||
v-model:value="remark"
|
|
||||||
style="height: 80px"
|
|
||||||
placeholder="请输入说明"
|
|
||||||
show-count
|
|
||||||
:maxlength="200"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name name2">
|
<div class="name name2">
|
||||||
@@ -205,140 +130,91 @@
|
|||||||
<div class="inname">同步学习记录</div>
|
<div class="inname">同步学习记录</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-radio @click="changeChecked" v-model:checked="checked"
|
<a-radio @click="changeChecked" v-model:checked="checked"><span style="
|
||||||
><span
|
|
||||||
style="
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: rgba(109, 117, 132, 1);
|
color: rgba(109, 117, 132, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
"
|
">同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)</span></a-radio>
|
||||||
>同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)</span
|
|
||||||
></a-radio
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">项目级别</div>
|
<div class="inname">项目级别</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in select">
|
<div class="in select">
|
||||||
<a-select
|
<a-select :getPopupContainer="
|
||||||
:getPopupContainer="
|
|
||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
"
|
" v-model:value="classifySelect3" :options="classifyList3" @change="classificationChange3"
|
||||||
v-model:value="classifySelect3"
|
placeholder="集团级/组织级/现地级/部门级" />
|
||||||
:options="classifyList3"
|
|
||||||
@change="classificationChange3"
|
|
||||||
placeholder="集团级/组织级/现地级/部门级"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">培训体系</div>
|
<div class="inname">培训体系</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in select">
|
<div class="in select">
|
||||||
<a-select
|
<a-select :getPopupContainer="
|
||||||
:getPopupContainer="
|
|
||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
"
|
" v-model:value="classifySelect4" :options="classifyList4" @change="classificationChange4"
|
||||||
v-model:value="classifySelect4"
|
placeholder="集团级/组织级/现地级/部门级" />
|
||||||
:options="classifyList4"
|
|
||||||
@change="classificationChange4"
|
|
||||||
placeholder="集团级/组织级/现地级/部门级"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">是否BOEU实施</div>
|
<div class="inname">是否BOEU实施</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-radio @click="changeChecked1" v-model:checked="checked1"
|
<a-radio @click="changeChecked1" v-model:checked="checked1"><span style="
|
||||||
><span
|
|
||||||
style="
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: rgba(109, 117, 132, 1);
|
color: rgba(109, 117, 132, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
"
|
">BOEU实施</span></a-radio>
|
||||||
>BOEU实施</span
|
|
||||||
></a-radio
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name name2">
|
<!-- <div class="name name2">
|
||||||
<div class="namebox" style="margin-top: 8px">
|
<div class="namebox" style="margin-top: 8px">
|
||||||
<img
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
class="nameimg"
|
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
|
||||||
/>
|
|
||||||
<div class="inname">附件</div>
|
<div class="inname">附件</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="filebox">
|
<div class="filebox">
|
||||||
<div>
|
<div>
|
||||||
<img
|
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
|
||||||
v-if="fileList1.length < 6"
|
<a-upload :disabled="fileList1.length > 5" :before-upload="beforeUpload1" v-model:file-list="fileList1"
|
||||||
class="fileimg"
|
@remove="removeFile" name="file" action="/api/file/upload" :headers="headers" @change="handleChange1">
|
||||||
src="../../assets/images/projectadd/enclosure.png"
|
<span v-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
|
||||||
/>
|
|
||||||
<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>
|
<span v-else class="filetext">上传附件</span>
|
||||||
<!-- </a-button> -->
|
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</div>
|
</div>
|
||||||
<div class="support">
|
<div class="support">
|
||||||
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="template">
|
<div class="template">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="inname" style="width: 50px">模版</div>
|
<div class="inname" style="width: 50px">模版</div>
|
||||||
<div class="in select" style="margin-left: 2px">
|
<div class="in select" style="margin-left: 2px">
|
||||||
<a-select
|
<a-select v-if="isEdit" disabled="true" :getPopupContainer="
|
||||||
:getPopupContainer="
|
|
||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
"
|
" v-model:value="classifySelect5" placeholder="请选择模版" :size="size" style="width: 100%" :options="classifyList5"
|
||||||
v-model:value="classifySelect5"
|
@change="classificationChange5">
|
||||||
placeholder="请选择模版"
|
</a-select>
|
||||||
:size="size"
|
<a-select v-else :getPopupContainer="
|
||||||
style="width: 100%"
|
(triggerNode) => {
|
||||||
:options="classifyList5"
|
return triggerNode.parentNode || document.body;
|
||||||
@change="classificationChange5"
|
}
|
||||||
>
|
" v-model:value="classifySelect5" placeholder="请选择模版" :size="size" style="width: 100%" :options="classifyList5"
|
||||||
|
@change="classificationChange5">
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -346,10 +222,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<a-button v-on:click="createProject" type="primary" class="btn1"
|
<a-button v-on:click="createProject" type="primary" class="btn1">确定</a-button>
|
||||||
>确定</a-button
|
<a-button @click="backPage" class="btn2">取消</a-button>
|
||||||
>
|
|
||||||
<a-button class="btn2">取消</a-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -358,13 +232,20 @@
|
|||||||
import { reactive, toRefs, ref } from "vue";
|
import { reactive, toRefs, ref } from "vue";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
import dayjs from 'dayjs';
|
||||||
import * as api from "../../api/index";
|
import * as api from "../../api/index";
|
||||||
|
import { toDate } from '../../api/method'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "classAdd",
|
name: "projectAdd",
|
||||||
setup() {
|
setup() {
|
||||||
const router = useRouter();
|
// 编辑页面跳转过来时候,自动填充表格
|
||||||
const routers = useRoute();
|
const routers = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const isEdit = ref(false);
|
||||||
|
let peojectID = "";
|
||||||
|
let paraentID = "";
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
classifySelect: null,
|
classifySelect: null,
|
||||||
classifySelectId: null,
|
classifySelectId: null,
|
||||||
@@ -373,14 +254,92 @@ export default {
|
|||||||
valueE: null,
|
valueE: null,
|
||||||
valueE1: null,
|
valueE1: null,
|
||||||
valueE2: null,
|
valueE2: null,
|
||||||
|
classifySelect1: [],
|
||||||
|
classifySelect2: [],
|
||||||
|
classifySelect3: [],
|
||||||
|
classifySelect4: [],
|
||||||
|
rangevalue: [],
|
||||||
projectAscription: "",
|
projectAscription: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const projectName = ref("");
|
if (routers.query.name==undefined) {
|
||||||
|
router.push({
|
||||||
|
path: "/projectmanage"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
peojectID = routers.query.projectId;
|
||||||
state.projectAscription = routers.query.name;
|
state.projectAscription = routers.query.name;
|
||||||
|
|
||||||
|
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([
|
const classifyList = ref([
|
||||||
{ value: 1, label: "管理者" },
|
{ value: 1, label: "管理者" },
|
||||||
{ value: 2, label: "领军者" },
|
{ value: 2, label: "领军者" },
|
||||||
@@ -492,6 +451,8 @@ export default {
|
|||||||
|
|
||||||
let beginTime = "";
|
let beginTime = "";
|
||||||
let endTime = "";
|
let endTime = "";
|
||||||
|
const dateFormatList = ['YYYY/MM/DD'];
|
||||||
|
|
||||||
const onRangeChange = (value, dateString) => {
|
const onRangeChange = (value, dateString) => {
|
||||||
console.log("Selected Time: ", value);
|
console.log("Selected Time: ", value);
|
||||||
// 项目时间选择函数
|
// 项目时间选择函数
|
||||||
@@ -513,8 +474,8 @@ export default {
|
|||||||
|
|
||||||
let manager = "";
|
let manager = "";
|
||||||
let managerId = "";
|
let managerId = "";
|
||||||
const classificationChange1 = (key) => {
|
const classificationChange1 = (key, options) => {
|
||||||
console.log(`selected ${key}`, classifyList1);
|
console.log(`selected ${key}`, options);
|
||||||
let mstr = "";
|
let mstr = "";
|
||||||
let midstr = "";
|
let midstr = "";
|
||||||
for (let i = 0; i < key.length; i++) {
|
for (let i = 0; i < key.length; i++) {
|
||||||
@@ -527,6 +488,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(mstr, midstr);
|
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;
|
manager = mstr;
|
||||||
managerId = midstr;
|
managerId = midstr;
|
||||||
};
|
};
|
||||||
@@ -538,8 +507,10 @@ export default {
|
|||||||
{ value: 3, label: "项目三" },
|
{ value: 3, label: "项目三" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let sourceBelongIdC = '';
|
||||||
const classificationChange2 = (key) => {
|
const classificationChange2 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList2);
|
console.log(`selected ${key}`, classifyList2);
|
||||||
|
sourceBelongIdC = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 项目级别
|
// 项目级别
|
||||||
@@ -549,8 +520,11 @@ export default {
|
|||||||
{ value: 3, label: "现地级" },
|
{ value: 3, label: "现地级" },
|
||||||
{ value: 4, label: "部门级" },
|
{ value: 4, label: "部门级" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let levels = "";
|
||||||
const classificationChange3 = (key) => {
|
const classificationChange3 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList3);
|
console.log(`selected ${key}`, classifyList3);
|
||||||
|
levels = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 培训体系
|
// 培训体系
|
||||||
@@ -560,8 +534,11 @@ export default {
|
|||||||
{ value: 3, label: "现地级" },
|
{ value: 3, label: "现地级" },
|
||||||
{ value: 4, label: "部门级" },
|
{ value: 4, label: "部门级" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let systemid = "";
|
||||||
const classificationChange4 = (key) => {
|
const classificationChange4 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList4);
|
console.log(`selected ${key}`, classifyList4);
|
||||||
|
systemid = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 模版
|
// 模版
|
||||||
@@ -624,11 +601,72 @@ export default {
|
|||||||
sourceBelongId: "请选择资源归属",
|
sourceBelongId: "请选择资源归属",
|
||||||
level: "请填写项目级别",
|
level: "请填写项目级别",
|
||||||
systemId: "请填写项目培训体系",
|
systemId: "请填写项目培训体系",
|
||||||
boeFlag: "请选择是否BOE实施",
|
boeFlag: "请选择是否BOE实施"
|
||||||
attach: "请上传附件",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const createProject = () => {
|
const createProject = () => {
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(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: "/projectmanage"
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
message.destroy();
|
||||||
|
message.error("编辑失败,请检查当前网络状态。");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
message.destroy();
|
||||||
|
message.error("编辑失败,请检查当前网络状态。");
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
let obj = {
|
let obj = {
|
||||||
name: projectName["value"],
|
name: projectName["value"],
|
||||||
category: projectType,
|
category: projectType,
|
||||||
@@ -637,16 +675,16 @@ export default {
|
|||||||
endTime: endTime,
|
endTime: endTime,
|
||||||
manager: manager,
|
manager: manager,
|
||||||
managerId: managerId,
|
managerId: managerId,
|
||||||
sourceBelongId: 11,
|
sourceBelongId: sourceBelongIdC,
|
||||||
remark: remark["value"],
|
remark: remark["value"],
|
||||||
courseSyncFlag: courseSyncFlag,
|
courseSyncFlag: courseSyncFlag,
|
||||||
level: 3,
|
level: levels,
|
||||||
systemId: 4,
|
systemId: systemid,
|
||||||
boeFlag: boeFlag,
|
boeFlag: boeFlag,
|
||||||
attach: attach,
|
attach: attach,
|
||||||
type: 3,
|
type: 3,
|
||||||
templateId: 10,
|
templateId: 10,
|
||||||
parentId: routers.query.projectId,
|
parentId: paraentID,
|
||||||
notice: "",
|
notice: "",
|
||||||
noticeFlag: 0,
|
noticeFlag: 0,
|
||||||
status: 0,
|
status: 0,
|
||||||
@@ -684,6 +722,7 @@ export default {
|
|||||||
message.destroy();
|
message.destroy();
|
||||||
message.error("创建失败,请检查当前网络状态。");
|
message.error("创建失败,请检查当前网络状态。");
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -716,6 +755,10 @@ export default {
|
|||||||
uplodaFileCount,
|
uplodaFileCount,
|
||||||
createProject,
|
createProject,
|
||||||
removeFile,
|
removeFile,
|
||||||
|
|
||||||
|
isEdit,
|
||||||
|
backPage,
|
||||||
|
dateFormatList,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -1014,3 +1057,5 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
<div class="projectAdd">
|
<div class="projectAdd">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<span class="title">创建/编辑单层项目</span>
|
<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>
|
<span class="return"></span><span class="returntext">返回</span>
|
||||||
</router-link>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
@@ -72,8 +72,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']"
|
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']" v-model:value="rangevalue"
|
||||||
style="width: 100%; height: 40px; border-radius: 5px" show-time @change="onRangeChange" />
|
style="width: 100%; height: 40px; border-radius: 5px" @change="onRangeChange" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -167,7 +167,7 @@
|
|||||||
">BOEU实施</span></a-radio>
|
">BOEU实施</span></a-radio>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name name2">
|
<!-- <div class="name name2">
|
||||||
<div class="namebox" style="margin-top: 8px">
|
<div class="namebox" style="margin-top: 8px">
|
||||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
<div class="inname">附件</div>
|
<div class="inname">附件</div>
|
||||||
@@ -177,24 +177,28 @@
|
|||||||
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
|
<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"
|
<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">
|
@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-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
|
||||||
<span v-else class="filetext">上传附件</span>
|
<span v-else class="filetext">上传附件</span>
|
||||||
<!-- </a-button> -->
|
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</div>
|
</div>
|
||||||
<div class="support">
|
<div class="support">
|
||||||
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="template">
|
<div class="template">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="inname" style="width: 50px">模版</div>
|
<div class="inname" style="width: 50px">模版</div>
|
||||||
<div class="in select" style="margin-left: 2px">
|
<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) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
@@ -208,7 +212,7 @@
|
|||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<a-button v-on:click="createProject" type="primary" class="btn1">确定</a-button>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -216,13 +220,138 @@
|
|||||||
<script>
|
<script>
|
||||||
import { reactive, toRefs, ref } from "vue";
|
import { reactive, toRefs, ref } from "vue";
|
||||||
import { message } from "ant-design-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 * as api from "../../api/index";
|
||||||
|
import { storage } from '../../api/storage';
|
||||||
|
import { toDate } from '../../api/method'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "projectAdd",
|
name: "projectAdd",
|
||||||
setup() {
|
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 router = useRouter();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
classifySelect: null,
|
classifySelect: null,
|
||||||
@@ -232,6 +361,11 @@ export default {
|
|||||||
valueE: null,
|
valueE: null,
|
||||||
valueE1: null,
|
valueE1: null,
|
||||||
valueE2: null,
|
valueE2: null,
|
||||||
|
classifySelect1: [],
|
||||||
|
classifySelect2: [],
|
||||||
|
classifySelect3: [],
|
||||||
|
classifySelect4: [],
|
||||||
|
rangevalue: []
|
||||||
});
|
});
|
||||||
|
|
||||||
const projectName = ref("");
|
const projectName = ref("");
|
||||||
@@ -347,6 +481,8 @@ export default {
|
|||||||
|
|
||||||
let beginTime = "";
|
let beginTime = "";
|
||||||
let endTime = "";
|
let endTime = "";
|
||||||
|
const dateFormatList = ['YYYY/MM/DD'];
|
||||||
|
|
||||||
const onRangeChange = (value, dateString) => {
|
const onRangeChange = (value, dateString) => {
|
||||||
console.log("Selected Time: ", value);
|
console.log("Selected Time: ", value);
|
||||||
// 项目时间选择函数
|
// 项目时间选择函数
|
||||||
@@ -368,8 +504,8 @@ export default {
|
|||||||
|
|
||||||
let manager = "";
|
let manager = "";
|
||||||
let managerId = "";
|
let managerId = "";
|
||||||
const classificationChange1 = (key) => {
|
const classificationChange1 = (key, options) => {
|
||||||
console.log(`selected ${key}`, classifyList1);
|
console.log(`selected ${key}`, options);
|
||||||
let mstr = "";
|
let mstr = "";
|
||||||
let midstr = "";
|
let midstr = "";
|
||||||
for (let i = 0; i < key.length; i++) {
|
for (let i = 0; i < key.length; i++) {
|
||||||
@@ -382,6 +518,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(mstr, midstr);
|
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;
|
manager = mstr;
|
||||||
managerId = midstr;
|
managerId = midstr;
|
||||||
};
|
};
|
||||||
@@ -393,8 +537,10 @@ export default {
|
|||||||
{ value: 3, label: "项目三" },
|
{ value: 3, label: "项目三" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let sourceBelongIdC = '';
|
||||||
const classificationChange2 = (key) => {
|
const classificationChange2 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList2);
|
console.log(`selected ${key}`, classifyList2);
|
||||||
|
sourceBelongIdC = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 项目级别
|
// 项目级别
|
||||||
@@ -404,8 +550,11 @@ export default {
|
|||||||
{ value: 3, label: "现地级" },
|
{ value: 3, label: "现地级" },
|
||||||
{ value: 4, label: "部门级" },
|
{ value: 4, label: "部门级" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let levels = "";
|
||||||
const classificationChange3 = (key) => {
|
const classificationChange3 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList3);
|
console.log(`selected ${key}`, classifyList3);
|
||||||
|
levels = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 培训体系
|
// 培训体系
|
||||||
@@ -415,8 +564,11 @@ export default {
|
|||||||
{ value: 3, label: "现地级" },
|
{ value: 3, label: "现地级" },
|
||||||
{ value: 4, label: "部门级" },
|
{ value: 4, label: "部门级" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let systemid = "";
|
||||||
const classificationChange4 = (key) => {
|
const classificationChange4 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList4);
|
console.log(`selected ${key}`, classifyList4);
|
||||||
|
systemid = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 模版
|
// 模版
|
||||||
@@ -479,11 +631,72 @@ export default {
|
|||||||
sourceBelongId: "请选择资源归属",
|
sourceBelongId: "请选择资源归属",
|
||||||
level: "请填写项目级别",
|
level: "请填写项目级别",
|
||||||
systemId: "请填写项目培训体系",
|
systemId: "请填写项目培训体系",
|
||||||
boeFlag: "请选择是否BOE实施",
|
boeFlag: "请选择是否BOE实施"
|
||||||
attach: "请上传附件",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const createProject = () => {
|
const createProject = () => {
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(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: "/projectmanage"
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
message.destroy();
|
||||||
|
message.error("编辑失败,请检查当前网络状态。");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
message.destroy();
|
||||||
|
message.error("编辑失败,请检查当前网络状态。");
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
let obj = {
|
let obj = {
|
||||||
name: projectName["value"],
|
name: projectName["value"],
|
||||||
category: projectType,
|
category: projectType,
|
||||||
@@ -492,11 +705,11 @@ export default {
|
|||||||
endTime: endTime,
|
endTime: endTime,
|
||||||
manager: manager,
|
manager: manager,
|
||||||
managerId: managerId,
|
managerId: managerId,
|
||||||
sourceBelongId: 11,
|
sourceBelongId: sourceBelongIdC,
|
||||||
remark: remark["value"],
|
remark: remark["value"],
|
||||||
courseSyncFlag: courseSyncFlag,
|
courseSyncFlag: courseSyncFlag,
|
||||||
level: 3,
|
level: levels,
|
||||||
systemId: 4,
|
systemId: systemid,
|
||||||
boeFlag: boeFlag,
|
boeFlag: boeFlag,
|
||||||
attach: attach,
|
attach: attach,
|
||||||
type: 3,
|
type: 3,
|
||||||
@@ -539,6 +752,7 @@ export default {
|
|||||||
message.destroy();
|
message.destroy();
|
||||||
message.error("创建失败,请检查当前网络状态。");
|
message.error("创建失败,请检查当前网络状态。");
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -571,6 +785,10 @@ export default {
|
|||||||
uplodaFileCount,
|
uplodaFileCount,
|
||||||
createProject,
|
createProject,
|
||||||
removeFile,
|
removeFile,
|
||||||
|
|
||||||
|
isEdit,
|
||||||
|
backPage,
|
||||||
|
dateFormatList,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -669,6 +669,7 @@ export default {
|
|||||||
currentEdProjectName: '',
|
currentEdProjectName: '',
|
||||||
|
|
||||||
currentEditChildrensProjectId: '',
|
currentEditChildrensProjectId: '',
|
||||||
|
dcProjectID: ''
|
||||||
|
|
||||||
});
|
});
|
||||||
// 数据接入 - start -
|
// 数据接入 - start -
|
||||||
@@ -796,7 +797,7 @@ export default {
|
|||||||
let edname = '';
|
let edname = '';
|
||||||
const edclassificationChangeName = (key) => {
|
const edclassificationChangeName = (key) => {
|
||||||
console.log(key)
|
console.log(key)
|
||||||
edname = key;
|
edname = key.target.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
let edcategory = '';
|
let edcategory = '';
|
||||||
@@ -944,17 +945,32 @@ export default {
|
|||||||
// 编辑多层项目
|
// 编辑多层项目
|
||||||
const editStoreyProject = () => {
|
const editStoreyProject = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
projectId: 1,
|
projectId: Number(state.dcProjectID),
|
||||||
name: edname,
|
name: edname,
|
||||||
category: edcategory,
|
category: edcategory,
|
||||||
manager: edmanage,
|
manager: edmanage.toString(","),
|
||||||
managerId: edmanageid,
|
managerId: edmanageid.toString(","),
|
||||||
sourceBelongId: edsource
|
sourceBelongId: edsource,
|
||||||
|
type: 1,
|
||||||
|
picUrl: 0
|
||||||
}
|
}
|
||||||
if (obj.name !== "" || obj.category !== "" || obj.manager !== "" || obj.sourceBelongId !== "") {
|
if (obj.name !== "" || obj.category !== "" || obj.manager !== "" || obj.sourceBelongId !== "") {
|
||||||
alert("我需要编辑")
|
console.log("我需要编辑")
|
||||||
console.log(obj)
|
console.log(obj)
|
||||||
|
api.createProject(obj).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.status == 200 && res.data.code == 200) {
|
||||||
state.eddoublepro = false;
|
state.eddoublepro = false;
|
||||||
|
message.destroy();
|
||||||
|
message.success("编辑成功");
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
state.eddoublepro = false;
|
||||||
|
message.destroy();
|
||||||
|
message.error("编辑失败,请检查当前网络状态。");
|
||||||
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
state.eddoublepro = false;
|
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.status == 1 && Number(value.record.beginTime) > Math.ceil(new Date().getTime / 1000) && value.record.type !== 1 && value.record.type !== 2 ?
|
||||||
"未开始" :
|
"未开始" :
|
||||||
value.record.status == 2 ?
|
value.record.status == 2 ?
|
||||||
"未开始" : "已结束"
|
"未开始" : "已结束"
|
||||||
@@ -1281,6 +1297,7 @@ export default {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
state.eddoublepro = true;
|
state.eddoublepro = true;
|
||||||
console.log("多层项目编辑")
|
console.log("多层项目编辑")
|
||||||
|
state.dcProjectID = value.record.projectId;
|
||||||
edvalue1.value = value.record.name;
|
edvalue1.value = value.record.name;
|
||||||
{/* edvalue2.value = classifyList[value.record.category] */ }
|
{/* edvalue2.value = classifyList[value.record.category] */ }
|
||||||
edvalue2.value = classifyList.value[0];
|
edvalue2.value = classifyList.value[0];
|
||||||
@@ -1871,12 +1888,12 @@ export default {
|
|||||||
if (value.record.isbj) {
|
if (value.record.isbj) {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/classadd',
|
path: '/classadd',
|
||||||
query: { projectId: value.record.projectId, name: value.record.paraentName }
|
query: { projectId: value.record.projectId, name: value.record.paraentName, edit: 0 }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/sonproject',
|
path: '/sonproject',
|
||||||
query: { projectId: value.record.projectId, name: value.record.name }
|
query: { projectId: value.record.projectId, name: value.record.paraentName, edit: 0 }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2132,6 +2149,8 @@ export default {
|
|||||||
data2.isbj = "class";
|
data2.isbj = "class";
|
||||||
})
|
})
|
||||||
console.log('lalallalaa', data)
|
console.log('lalallalaa', data)
|
||||||
|
} else {
|
||||||
|
data.paraentName = value.name;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
<div class="projectAdd">
|
<div class="projectAdd">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<span class="title">创建/编辑单层子项目</span>
|
<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>
|
<span class="return"></span><span class="returntext">返回</span>
|
||||||
</router-link>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<div class="inname">子项目名称</div>
|
<div class="inname">子项目名称</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<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>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']"
|
<a-range-picker separator="至" :placeholder="[' 开始时间', ' 结束时间']" v-model:value="rangevalue"
|
||||||
style="width: 100%; height: 40px; border-radius: 5px" show-time @change="onRangeChange" />
|
style="width: 100%; height: 40px; border-radius: 5px" @change="onRangeChange" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
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>
|
@change="classificationChange1" allowClear showSearch>
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
">BOEU实施</span></a-radio>
|
">BOEU实施</span></a-radio>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name name2">
|
<!-- <div class="name name2">
|
||||||
<div class="namebox" style="margin-top: 8px">
|
<div class="namebox" style="margin-top: 8px">
|
||||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||||
<div class="inname">附件</div>
|
<div class="inname">附件</div>
|
||||||
@@ -188,24 +188,28 @@
|
|||||||
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
|
<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"
|
<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">
|
@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-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
|
||||||
<span v-else class="filetext">上传附件</span>
|
<span v-else class="filetext">上传附件</span>
|
||||||
<!-- </a-button> -->
|
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</div>
|
</div>
|
||||||
<div class="support">
|
<div class="support">
|
||||||
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="template">
|
<div class="template">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="inname" style="width: 50px">模版</div>
|
<div class="inname" style="width: 50px">模版</div>
|
||||||
<div class="in select" style="margin-left: 2px">
|
<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) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
@@ -219,7 +223,7 @@
|
|||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<a-button v-on:click="createProject" type="primary" class="btn1">确定</a-button>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -228,14 +232,20 @@
|
|||||||
import { reactive, toRefs, ref } from "vue";
|
import { reactive, toRefs, ref } from "vue";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
import dayjs from 'dayjs';
|
||||||
import * as api from "../../api/index";
|
import * as api from "../../api/index";
|
||||||
import { storage } from '../../api/storage';
|
import { toDate } from '../../api/method'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "sonProject",
|
name: "projectAdd",
|
||||||
setup() {
|
setup() {
|
||||||
const router = useRouter();
|
// 编辑页面跳转过来时候,自动填充表格
|
||||||
const routers = useRoute();
|
const routers = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const isEdit = ref(false);
|
||||||
|
let peojectID = "";
|
||||||
|
let paraentID = "";
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
classifySelect: null,
|
classifySelect: null,
|
||||||
classifySelectId: null,
|
classifySelectId: null,
|
||||||
@@ -244,17 +254,92 @@ export default {
|
|||||||
valueE: null,
|
valueE: null,
|
||||||
valueE1: null,
|
valueE1: null,
|
||||||
valueE2: null,
|
valueE2: null,
|
||||||
|
classifySelect1: [],
|
||||||
|
classifySelect2: [],
|
||||||
|
classifySelect3: [],
|
||||||
|
classifySelect4: [],
|
||||||
|
rangevalue: [],
|
||||||
projectAscription: "",
|
projectAscription: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const projectName = ref("");
|
if (routers.query.name == undefined) {
|
||||||
|
router.push({
|
||||||
|
path: "/projectmanage"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
peojectID = routers.query.projectId;
|
||||||
state.projectAscription = routers.query.name;
|
state.projectAscription = routers.query.name;
|
||||||
|
|
||||||
if (routers.query.name) {
|
if (routers.query.edit !== undefined) {
|
||||||
storage.set("editproject", routers.query)
|
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([
|
const classifyList = ref([
|
||||||
{ value: 1, label: "管理者" },
|
{ value: 1, label: "管理者" },
|
||||||
@@ -367,6 +452,8 @@ export default {
|
|||||||
|
|
||||||
let beginTime = "";
|
let beginTime = "";
|
||||||
let endTime = "";
|
let endTime = "";
|
||||||
|
const dateFormatList = ['YYYY/MM/DD'];
|
||||||
|
|
||||||
const onRangeChange = (value, dateString) => {
|
const onRangeChange = (value, dateString) => {
|
||||||
console.log("Selected Time: ", value);
|
console.log("Selected Time: ", value);
|
||||||
// 项目时间选择函数
|
// 项目时间选择函数
|
||||||
@@ -388,8 +475,8 @@ export default {
|
|||||||
|
|
||||||
let manager = "";
|
let manager = "";
|
||||||
let managerId = "";
|
let managerId = "";
|
||||||
const classificationChange1 = (key) => {
|
const classificationChange1 = (key, options) => {
|
||||||
console.log(`selected ${key}`, classifyList1);
|
console.log(`selected ${key}`, options);
|
||||||
let mstr = "";
|
let mstr = "";
|
||||||
let midstr = "";
|
let midstr = "";
|
||||||
for (let i = 0; i < key.length; i++) {
|
for (let i = 0; i < key.length; i++) {
|
||||||
@@ -402,6 +489,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(mstr, midstr);
|
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;
|
manager = mstr;
|
||||||
managerId = midstr;
|
managerId = midstr;
|
||||||
};
|
};
|
||||||
@@ -413,8 +508,10 @@ export default {
|
|||||||
{ value: 3, label: "项目三" },
|
{ value: 3, label: "项目三" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let sourceBelongIdC = '';
|
||||||
const classificationChange2 = (key) => {
|
const classificationChange2 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList2);
|
console.log(`selected ${key}`, classifyList2);
|
||||||
|
sourceBelongIdC = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 项目级别
|
// 项目级别
|
||||||
@@ -424,8 +521,11 @@ export default {
|
|||||||
{ value: 3, label: "现地级" },
|
{ value: 3, label: "现地级" },
|
||||||
{ value: 4, label: "部门级" },
|
{ value: 4, label: "部门级" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let levels = "";
|
||||||
const classificationChange3 = (key) => {
|
const classificationChange3 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList3);
|
console.log(`selected ${key}`, classifyList3);
|
||||||
|
levels = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 培训体系
|
// 培训体系
|
||||||
@@ -435,8 +535,11 @@ export default {
|
|||||||
{ value: 3, label: "现地级" },
|
{ value: 3, label: "现地级" },
|
||||||
{ value: 4, label: "部门级" },
|
{ value: 4, label: "部门级" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let systemid = "";
|
||||||
const classificationChange4 = (key) => {
|
const classificationChange4 = (key) => {
|
||||||
console.log(`selected ${key}`, classifyList4);
|
console.log(`selected ${key}`, classifyList4);
|
||||||
|
systemid = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 模版
|
// 模版
|
||||||
@@ -499,11 +602,72 @@ export default {
|
|||||||
sourceBelongId: "请选择资源归属",
|
sourceBelongId: "请选择资源归属",
|
||||||
level: "请填写项目级别",
|
level: "请填写项目级别",
|
||||||
systemId: "请填写项目培训体系",
|
systemId: "请填写项目培训体系",
|
||||||
boeFlag: "请选择是否BOE实施",
|
boeFlag: "请选择是否BOE实施"
|
||||||
attach: "请上传附件",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const createProject = () => {
|
const createProject = () => {
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(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: "/projectmanage"
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
message.destroy();
|
||||||
|
message.error("编辑失败,请检查当前网络状态。");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
message.destroy();
|
||||||
|
message.error("编辑失败,请检查当前网络状态。");
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
let obj = {
|
let obj = {
|
||||||
name: projectName["value"],
|
name: projectName["value"],
|
||||||
category: projectType,
|
category: projectType,
|
||||||
@@ -512,16 +676,16 @@ export default {
|
|||||||
endTime: endTime,
|
endTime: endTime,
|
||||||
manager: manager,
|
manager: manager,
|
||||||
managerId: managerId,
|
managerId: managerId,
|
||||||
sourceBelongId: 11,
|
sourceBelongId: sourceBelongIdC,
|
||||||
remark: remark["value"],
|
remark: remark["value"],
|
||||||
courseSyncFlag: courseSyncFlag,
|
courseSyncFlag: courseSyncFlag,
|
||||||
level: 3,
|
level: levels,
|
||||||
systemId: 4,
|
systemId: systemid,
|
||||||
boeFlag: boeFlag,
|
boeFlag: boeFlag,
|
||||||
attach: attach,
|
attach: attach,
|
||||||
type: 3,
|
type: 3,
|
||||||
templateId: 10,
|
templateId: 10,
|
||||||
parentId: routers.query.projectId,
|
parentId: paraentID,
|
||||||
notice: "",
|
notice: "",
|
||||||
noticeFlag: 0,
|
noticeFlag: 0,
|
||||||
status: 0,
|
status: 0,
|
||||||
@@ -559,6 +723,7 @@ export default {
|
|||||||
message.destroy();
|
message.destroy();
|
||||||
message.error("创建失败,请检查当前网络状态。");
|
message.error("创建失败,请检查当前网络状态。");
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -591,6 +756,10 @@ export default {
|
|||||||
uplodaFileCount,
|
uplodaFileCount,
|
||||||
createProject,
|
createProject,
|
||||||
removeFile,
|
removeFile,
|
||||||
|
|
||||||
|
isEdit,
|
||||||
|
backPage,
|
||||||
|
dateFormatList,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -889,3 +1058,4 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user