|
@@ -94,7 +94,16 @@
|
|
|
<div class="okrBody" v-if="okr.length > 0">
|
|
|
<div class="okrBox first">
|
|
|
<div class="okrBox-title">
|
|
|
- <p class="top-title">本周工作</p>
|
|
|
+ <!-- taskInfoListKey -->
|
|
|
+ <p class="top-title">
|
|
|
+ <el-radio-group v-model="taskInfoListKey" class="left-button" @change="changeWeek">
|
|
|
+ <!-- taskInfoWeeks -->
|
|
|
+ <el-radio-button v-for="(item, index) in taskInfoWeeks" :key="index" :label="item">{{'第'+item+'周'}}</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ <span class="right-time">
|
|
|
+ {{currentDate}}
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
<!-- :disabled="
|
|
|
time.year != time.currentYear ||
|
|
|
time.quarter != time.currentQuarter
|
|
@@ -103,14 +112,15 @@
|
|
|
type="text"
|
|
|
class="createTask"
|
|
|
@click="createTask(1)"
|
|
|
-
|
|
|
+ v-if="taskFourWeekKey >= currentMonth"
|
|
|
>
|
|
|
<i class="el-icon-plus"></i>新建任务
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="okrbox-list">
|
|
|
<ul>
|
|
|
- <li v-for="item in taskInfoList" :key="item.id">
|
|
|
+ <li v-for="item in taskInfoList[taskInfoListKey]" :key="item.id">
|
|
|
+
|
|
|
<el-popover
|
|
|
placement="top-start"
|
|
|
:title="'标题:' + item.taskTitle"
|
|
@@ -156,14 +166,30 @@
|
|
|
time.year == time.currentYear &&
|
|
|
time.quarter == time.currentQuarter
|
|
|
" -->
|
|
|
+ <div class="list-opt continuation-btn" style="display:flex;" v-if="item.status == 3">
|
|
|
+ <el-tag
|
|
|
+ type="success"
|
|
|
+ effect="dark">
|
|
|
+ 已完成
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <div class="list-opt continuation-btn" style="display:flex;" v-if="item.status == 2">
|
|
|
+ <el-tag
|
|
|
+ color="#a611e4"
|
|
|
+ effect="dark">
|
|
|
+ 延续
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div
|
|
|
class="list-opt"
|
|
|
-
|
|
|
+ v-if="taskFourWeekKey >= currentMonth"
|
|
|
>
|
|
|
<!-- <el-progress :percentage="30" ></el-progress> -->
|
|
|
<!-- <div style="width:30%">
|
|
|
<el-progress :percentage="50" color='#cc9966'></el-progress>
|
|
|
</div>-->
|
|
|
+
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
icon="el-icon-edit"
|
|
@@ -404,7 +430,12 @@
|
|
|
</div>
|
|
|
<div class="okrBox third">
|
|
|
<div class="okrBox-title">
|
|
|
- <p class="top-title">未来四周计划</p>
|
|
|
+ <p class="top-title">
|
|
|
+ <el-radio-group v-model="taskFourWeekKey" class="left-button" @change="changeMonth">
|
|
|
+ <!-- taskInfoWeeks -->
|
|
|
+ <el-radio-button v-for="(item, index) in taskInfoMonth" :key="index" :label="item">{{item+'月计划'}}</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </p>
|
|
|
<!-- :disabled="
|
|
|
time.year != time.currentYear ||
|
|
|
time.quarter != time.currentQuarter
|
|
@@ -413,14 +444,14 @@
|
|
|
type="text"
|
|
|
class="createTask"
|
|
|
@click="createTask(2)"
|
|
|
-
|
|
|
+ v-if="taskFourWeekKey >= currentMonth"
|
|
|
>
|
|
|
<i class="el-icon-plus"></i>新建任务
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="okrbox-list">
|
|
|
<ul>
|
|
|
- <li v-for="item in taskFourWeek" :key="item.id">
|
|
|
+ <li v-for="item in taskFourWeek[taskFourWeekKey]" :key="item.id">
|
|
|
<el-popover
|
|
|
placement="top-start"
|
|
|
:title="'标题:' + item.taskTitle"
|
|
@@ -461,8 +492,23 @@
|
|
|
</span>
|
|
|
</span>
|
|
|
</el-popover>
|
|
|
+ <div class="list-opt continuation-btn" style="display:flex;" v-if="item.status == 3">
|
|
|
+ <el-tag
|
|
|
+ type="success"
|
|
|
+ effect="dark">
|
|
|
+ 已完成
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <div class="list-opt continuation-btn" style="display:flex;" v-if="item.status == 2">
|
|
|
+ <el-tag
|
|
|
+ color="#a611e4"
|
|
|
+ effect="dark">
|
|
|
+ 延续
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="list-opt"
|
|
|
+ v-if="taskFourWeekKey >= currentMonth"
|
|
|
|
|
|
>
|
|
|
<!-- <el-progress :percentage="30" ></el-progress> -->
|
|
@@ -603,7 +649,7 @@
|
|
|
type="textarea"
|
|
|
placeholder="您可对KR做进一步详细描述"
|
|
|
v-model="item.krDesc"
|
|
|
- maxlength="100"
|
|
|
+ maxlength="1000"
|
|
|
show-word-limit
|
|
|
clearable
|
|
|
size="small"
|
|
@@ -748,7 +794,7 @@
|
|
|
type="textarea"
|
|
|
placeholder="您可对任务做进一步详细描述"
|
|
|
v-model="taskDesc"
|
|
|
- maxlength="100"
|
|
|
+ maxlength="1000"
|
|
|
show-word-limit
|
|
|
clearable
|
|
|
size="small"
|
|
@@ -811,6 +857,18 @@
|
|
|
>
|
|
|
</span>
|
|
|
</div>
|
|
|
+ <div v-if="taskTitle == '修改任务'" class="task-item">
|
|
|
+ <span class="item-name">当前状态:</span>
|
|
|
+ <el-radio-group
|
|
|
+ v-model="statusTask"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-radio :label="1" border>正常</el-radio>
|
|
|
+ <el-radio :label="2" border>延续</el-radio>
|
|
|
+ <el-radio :label="3" border>已完成</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+
|
|
|
+ </div>
|
|
|
<!-- 完成的进度 -->
|
|
|
<!-- <div class="task-item">
|
|
|
<span class="item-name" >设置进度:</span>
|
|
@@ -827,12 +885,14 @@
|
|
|
type="warning"
|
|
|
@click="taskOk"
|
|
|
v-if="taskTitle == '创建任务'"
|
|
|
+ :loading="taskVisibleLoading"
|
|
|
>创 建</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
@click="editTaskOk"
|
|
|
v-if="taskTitle == '修改任务'"
|
|
|
+ :loading="taskVisibleLoading"
|
|
|
>修 改</el-button
|
|
|
>
|
|
|
</span>
|
|
@@ -1072,7 +1132,7 @@
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="KRVisible = false">取 消</el-button>
|
|
|
<el-button type="warning" @click="KROk" v-if="KRTitle == '新建KR'"
|
|
|
- >创 建</el-button
|
|
|
+ :loading="KROKVisible">创 建</el-button
|
|
|
>
|
|
|
<el-button type="warning" @click="editKROk" v-if="KRTitle == '修改KR'"
|
|
|
>修 改</el-button
|
|
@@ -1228,6 +1288,8 @@ export default {
|
|
|
components: { Treeselect },
|
|
|
data() {
|
|
|
return {
|
|
|
+ KROKVisible:false,
|
|
|
+ taskVisibleLoading:false,
|
|
|
okLoading: false,
|
|
|
optionsPerson: [],
|
|
|
person: "",
|
|
@@ -1250,6 +1312,7 @@ export default {
|
|
|
KRTag: [],
|
|
|
remindValue: [], //@的人 任务
|
|
|
visiblePerson: [], //指定可见人 任务
|
|
|
+ statusTask: 1,
|
|
|
// SHOW_PARENT,
|
|
|
|
|
|
KRPower: "1", //kr的权限
|
|
@@ -1265,7 +1328,15 @@ export default {
|
|
|
okr: [],
|
|
|
okrList: [],
|
|
|
okrObject: {},
|
|
|
+ allTime: null,
|
|
|
taskInfoList: [],
|
|
|
+ taskInfoListKey:null,
|
|
|
+ taskFourWeekKey:null,
|
|
|
+ currentMonth:null,
|
|
|
+ currentWeek:null,
|
|
|
+ currentDate:null,
|
|
|
+ taskInfoWeeks:[],
|
|
|
+ taskInfoMonth:[],
|
|
|
taskFourWeek: [],
|
|
|
status: [],
|
|
|
time: {},
|
|
@@ -1744,6 +1815,7 @@ export default {
|
|
|
this.visiblePerson = [];
|
|
|
this.remindValue = [];
|
|
|
this.taskTag = [];
|
|
|
+ this.statusTask = 1
|
|
|
// this.taskProgress=0;
|
|
|
// console.log(val,this.currentTask)
|
|
|
},
|
|
@@ -1760,6 +1832,7 @@ export default {
|
|
|
this.remindValue.push(item.id);
|
|
|
});
|
|
|
}
|
|
|
+ this.taskVisibleLoading = true
|
|
|
postAction("/okr/okr/insertTaskInfo", {
|
|
|
taskInfo: {
|
|
|
taskTitle: this.taskName,
|
|
@@ -1769,9 +1842,13 @@ export default {
|
|
|
permission: this.taskPower,
|
|
|
publicIds: this.visiblePerson,
|
|
|
remindIds: this.remindValue,
|
|
|
+ status: this.statusTask,
|
|
|
+ week: this.taskInfoListKey,
|
|
|
+ year: this.yearValue
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
// console.log(res)
|
|
|
+ this.taskVisibleLoading = false
|
|
|
if (res.success) {
|
|
|
this.taskVisible = false;
|
|
|
this.getOkrPageList();
|
|
@@ -1818,6 +1895,7 @@ export default {
|
|
|
this.taskRange = val.priority;
|
|
|
this.taskId = val.id;
|
|
|
this.taskPower = val.permission + "";
|
|
|
+ this.statusTask = val.status
|
|
|
|
|
|
this.visiblePerson = val.publicIds;
|
|
|
// this.remindValue=val.remindIds
|
|
@@ -1851,6 +1929,7 @@ export default {
|
|
|
this.remindValue.push(item.id);
|
|
|
});
|
|
|
}
|
|
|
+ this.taskVisibleLoading = true
|
|
|
postAction("/okr/okr/updateTaskInfo", {
|
|
|
taskInfo: {
|
|
|
id: this.taskId,
|
|
@@ -1860,8 +1939,10 @@ export default {
|
|
|
permission: this.taskPower,
|
|
|
publicIds: this.visiblePerson,
|
|
|
remindIds: this.remindValue,
|
|
|
+ status: this.statusTask
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
+ this.taskVisibleLoading = false
|
|
|
// console.log(res)
|
|
|
if (res.success) {
|
|
|
this.$message({
|
|
@@ -2002,13 +2083,15 @@ export default {
|
|
|
KROk() {
|
|
|
this.checkKRName();
|
|
|
if (!this.KRNameOk) {
|
|
|
+ this.KROKVisible = true
|
|
|
if (this.KRPower == "3") {
|
|
|
this.KRremindValue = [];
|
|
|
this.KRTag.forEach((item) => {
|
|
|
this.KRremindValue.push(item.id);
|
|
|
});
|
|
|
}
|
|
|
- postAction("/okr/okr/insertOkrKrInfo ", {
|
|
|
+ console.log(this.taskInfoListKey)
|
|
|
+ postAction("/okr/okr/insertOkrKrInfo", {
|
|
|
krInfo: {
|
|
|
completion: this.KRProgress,
|
|
|
krInfo: this.KRName,
|
|
@@ -2017,8 +2100,11 @@ export default {
|
|
|
permission: this.KRPower,
|
|
|
publicIds: this.KRvisiblePerson,
|
|
|
remindIds: this.KRremindValue,
|
|
|
+ week: this.taskInfoListKey,
|
|
|
+ year: this.yearValue
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
+ this.KROKVisible = false
|
|
|
// console.log(res)
|
|
|
if (res.success) {
|
|
|
this.KRVisible = false;
|
|
@@ -2066,6 +2152,7 @@ export default {
|
|
|
this.KRremindValue.push(item.id);
|
|
|
});
|
|
|
}
|
|
|
+ this.KROKVisible = true
|
|
|
postAction("/okr/okr/updateKr", {
|
|
|
krInfo: {
|
|
|
completion: this.KRProgress,
|
|
@@ -2078,6 +2165,7 @@ export default {
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
// console.log(res)
|
|
|
+ this.KROKVisible = false
|
|
|
if (res.success) {
|
|
|
this.KRVisible = false;
|
|
|
this.getOkrPageList();
|
|
@@ -2086,6 +2174,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
yearChange(key) {
|
|
|
+ this.taskInfoListKey = this.taskInfoWeeks[0]
|
|
|
this.getOkrPageList();
|
|
|
},
|
|
|
cycleChange(key) {
|
|
@@ -2099,6 +2188,20 @@ export default {
|
|
|
this.getOkrPageList();
|
|
|
}
|
|
|
},
|
|
|
+ changeWeek(value){
|
|
|
+ var data = this.allTime.weeks[this.taskFourWeekKey].filter(item=>{
|
|
|
+ return item.week == value
|
|
|
+ })[0]
|
|
|
+ this.currentDate = data.startDate + '至' +data.endDate
|
|
|
+ },
|
|
|
+ changeMonth(value) {
|
|
|
+ console.log(value)
|
|
|
+ this.taskInfoWeeks = this.allTime.weeks[value].map(item=>{
|
|
|
+ return item.week
|
|
|
+ })
|
|
|
+ this.taskInfoListKey = this.taskInfoWeeks[0]
|
|
|
+ this.changeWeek(this.taskInfoListKey)
|
|
|
+ },
|
|
|
// 获取页面展示的list
|
|
|
getOkrPageList() {
|
|
|
this.loading = true;
|
|
@@ -2113,6 +2216,54 @@ export default {
|
|
|
this.okr = res.result.okr;
|
|
|
this.taskInfoList = res.result.taskInfoList;
|
|
|
this.taskFourWeek = res.result.taskFourWeekList;
|
|
|
+ this.allTime = res.result.time;
|
|
|
+ this.currentMonth = res.result.time.currentMonth
|
|
|
+ this.currentWeek = res.result.time.currentWeek;
|
|
|
+ this.taskInfoMonth = res.result.time.months
|
|
|
+ if(res.result.time.currentQuarter == res.result.time.quarter){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.taskInfoWeeks = res.result.time.weeks[res.result.time.currentMonth].map(item=>{
|
|
|
+ return item.week
|
|
|
+ })
|
|
|
+
|
|
|
+ if(this.taskInfoMonth.includes(this.taskFourWeekKey)){
|
|
|
+
|
|
|
+ this.taskInfoWeeks = res.result.time.weeks[this.taskFourWeekKey].map(item=>{
|
|
|
+ return item.week
|
|
|
+ })
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.taskInfoWeeks = res.result.time.weeks[res.result.time.currentMonth].map(item=>{
|
|
|
+ return item.week
|
|
|
+ })
|
|
|
+ this.taskFourWeekKey = res.result.time.currentMonth;
|
|
|
+ if(this.taskInfoWeeks.includes(this.taskInfoListKey)){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.taskInfoListKey = this.taskInfoWeeks[0]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.currentDate = res.result.time.currentDate
|
|
|
+ }else{
|
|
|
+ this.taskFourWeekKey = res.result.time.months[0];
|
|
|
+ this.taskInfoWeeks = res.result.time.weeks[this.taskFourWeekKey].map(item=>{
|
|
|
+ return item.week
|
|
|
+ })
|
|
|
+
|
|
|
+ this.taskInfoListKey = this.taskInfoWeeks[0]
|
|
|
+
|
|
|
+
|
|
|
+ var data = this.allTime.weeks[this.taskFourWeekKey].filter(item=>{
|
|
|
+ return item.week == this.taskInfoListKey
|
|
|
+ })[0]
|
|
|
+ this.currentDate = data.startDate + '至' +data.endDate
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
this.time = res.result.time;
|
|
|
res.result.status.forEach((item, index) => {
|
|
@@ -2268,13 +2419,35 @@ li {
|
|
|
// overflow: auto;
|
|
|
.okrBox-title {
|
|
|
text-align: left;
|
|
|
- max-height: 20%;
|
|
|
- .top-title {
|
|
|
- font-size: 20px;
|
|
|
- margin: 8px 0;
|
|
|
- padding: 0 20px;
|
|
|
- // text-align: left;
|
|
|
+ @media only screen and (min-width: 1315px) {
|
|
|
+ .top-title {
|
|
|
+ font-size: 16px;
|
|
|
+ margin: 8px 0;
|
|
|
+ padding: 0 20px;
|
|
|
+ // text-align: left;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ .right-time{
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
+ @media only screen and (max-width: 1314px) {
|
|
|
+ .top-title {
|
|
|
+ font-size: 16px;
|
|
|
+ margin: 8px 0;
|
|
|
+ padding: 0 20px;
|
|
|
+ // text-align: left;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+ .right-time{
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
.createTask {
|
|
|
font-size: 12px;
|
|
|
margin: 5px 0;
|
|
@@ -2282,6 +2455,7 @@ li {
|
|
|
text-align: left;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.okrbox-list {
|
|
|
width: 100%;
|
|
|
overflow: auto;
|
|
@@ -2356,6 +2530,13 @@ li {
|
|
|
li:hover .list-opt {
|
|
|
display: flex;
|
|
|
}
|
|
|
+ li:hover .continuation-btn {
|
|
|
+ right:78px
|
|
|
+ }
|
|
|
+ /deep/ .continuation-btn .el-tag--dark{
|
|
|
+ border: 0px;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
.status-list {
|
|
|
overflow: auto;
|
|
@@ -2497,6 +2678,9 @@ li {
|
|
|
li:hover .list-opt {
|
|
|
display: flex;
|
|
|
}
|
|
|
+ li:hover .continuation-btn {
|
|
|
+ right:78px
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|