|
@@ -5,7 +5,7 @@
|
|
|
.dialog-style{
|
|
|
div{
|
|
|
text-align: center;
|
|
|
- margin: 5px;
|
|
|
+ margin: 5px 0;
|
|
|
label,/deep/ .el-input,/deep/ .el-textarea{
|
|
|
display: inline-block;
|
|
|
vertical-align: middle;
|
|
@@ -14,7 +14,10 @@
|
|
|
width: 200px;
|
|
|
}
|
|
|
/deep/ .el-textarea{
|
|
|
- width: 600px;
|
|
|
+ width: 460px;
|
|
|
+ }
|
|
|
+ .el-select /deep/ .el-input{
|
|
|
+ width: 70px;
|
|
|
}
|
|
|
}
|
|
|
.add-bt{
|
|
@@ -24,9 +27,12 @@
|
|
|
}
|
|
|
.del-bt{
|
|
|
cursor: pointer;
|
|
|
- font-size: 15px;
|
|
|
+ font-size: 18px;
|
|
|
}
|
|
|
}
|
|
|
+.hide{
|
|
|
+ opacity: 0;
|
|
|
+}
|
|
|
</style>
|
|
|
<template>
|
|
|
<div>
|
|
@@ -37,7 +43,7 @@
|
|
|
<div class="day-cell" @click="chooseDay(data)">
|
|
|
<p>{{getDayNum(data.day)}}</p>
|
|
|
<div v-if="new Date(data.day).getMonth() == searchMonth.getMonth()">
|
|
|
- <p v-for="item in planList[getDayNum(data.day)]" :key="item.id">
|
|
|
+ <p v-for="item in planList[getDayNum(data.day)]" :key="item.id" :style="{'color':colorSet[item.status]}">
|
|
|
{{item.name}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -56,7 +62,18 @@
|
|
|
<label>内容:</label>
|
|
|
<el-input type="textarea" autosize placeholder="" v-model="item.content" :disabled="!ableEdit"></el-input>
|
|
|
|
|
|
- <i class="el-icon-remove-outline del-bt" @click="deletePlan(item,index)" v-if="ableEdit"></i>
|
|
|
+ <label :class="{'hide':!item.id}">状态:</label>
|
|
|
+ <el-select v-model="item.status" placeholder="请选择" size="mini" :class="{'hide':!item.id}" :disabled="item.id == null || !ableEdit">
|
|
|
+ <el-option :label="'准备'" :value="0"></el-option>
|
|
|
+ <el-option :label="'执行'" :value="1"></el-option>
|
|
|
+ <el-option :label="'暂搁'" :value="2"></el-option>
|
|
|
+ <el-option :label="'完成'" :value="3"></el-option>
|
|
|
+ <el-option :label="'中止'" :value="4"></el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-button @click="judgePlan(item)" type="text" :class="{'hide':!item.id}" :disabled="item.id == null">评价</el-button>
|
|
|
+
|
|
|
+ <i class="el-icon-remove-outline del-bt" @click="visibleDelete = true;plan = item;deleteIndex = index" v-if="ableEdit"></i>
|
|
|
</div>
|
|
|
<i class="el-icon-circle-plus-outline add-bt" @click="addDayPlan()" v-if="ableEdit"></i>
|
|
|
<span slot="footer" class="dialog-footer" v-if="ableEdit">
|
|
@@ -64,17 +81,49 @@
|
|
|
<el-button type="primary" @click="editTask">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :title="plan.name + ' 任务评价'"
|
|
|
+ :visible.sync="visibleJudge"
|
|
|
+ width="800px">
|
|
|
+ <div v-html="plan.evaluation" v-show="noEdit"></div>
|
|
|
+ <Judge :planJudge="plan.evaluation" :changeSignal="changeSignal" @setEvaluation="setEvaluation" v-show="!noEdit"></Judge>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="noEdit = false;" v-if="noEdit">编辑</el-button>
|
|
|
+ <el-button type="primary" @click="visibleJudge = false;plan={}" v-if="!noEdit">取消</el-button>
|
|
|
+ <el-button type="primary" @click="editTask" v-if="!noEdit">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="提示"
|
|
|
+ :visible.sync="visibleDelete"
|
|
|
+ width="200px">
|
|
|
+ <p class="center-text">确认删除?</p>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="visibleDelete = false;plan={}">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="deletePlan">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { getMonthPlan,addPlan,updatePlan,deletePlan } from '@/api/month';
|
|
|
+import Judge from "@/components/MainPage/Judge/Judge";
|
|
|
+
|
|
|
export default {
|
|
|
name: 'Month',
|
|
|
components: {
|
|
|
+ Judge
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ colorSet:{
|
|
|
+ 0:'gray',
|
|
|
+ 1:'blue',
|
|
|
+ 2:'red',
|
|
|
+ 3:'green',
|
|
|
+ 4:'yellow',
|
|
|
+ },
|
|
|
searchMonth: new Date(),
|
|
|
params:{
|
|
|
startTime: '',
|
|
@@ -82,7 +131,13 @@ export default {
|
|
|
},
|
|
|
visibleChange: false,
|
|
|
planList: {},
|
|
|
- dayPlan: []
|
|
|
+ dayPlan: [],
|
|
|
+ visibleDelete: false,
|
|
|
+ plan:{},
|
|
|
+ deleteIndex: '',
|
|
|
+ noEdit: false,
|
|
|
+ visibleJudge: false,
|
|
|
+ changeSignal: false
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -159,26 +214,37 @@ export default {
|
|
|
"startTime": this.searchMonth.getTime(),
|
|
|
})
|
|
|
},
|
|
|
- deletePlan(item,index){
|
|
|
- if(item.id){
|
|
|
+ deletePlan(){
|
|
|
+ if(this.plan.id){
|
|
|
let temp = {
|
|
|
- id:item.id
|
|
|
+ id: this.plan.id
|
|
|
}
|
|
|
deletePlan(temp).then((data) => {
|
|
|
if(!data.result){
|
|
|
this.$message(data.message);
|
|
|
}
|
|
|
else{
|
|
|
- this.dayPlan.splice(index,1);
|
|
|
+ this.dayPlan.splice(this.deleteIndex,1);
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
else{
|
|
|
- this.dayPlan.splice(index,1);
|
|
|
+ this.dayPlan.splice(this.deleteIndex,1);
|
|
|
}
|
|
|
+ this.visibleDelete = false;
|
|
|
+ this.plan={};
|
|
|
},
|
|
|
getDayNum(day){
|
|
|
return ~~day.split('-')[2];
|
|
|
+ },
|
|
|
+ setEvaluation(val){
|
|
|
+ this.plan.evaluation = val;
|
|
|
+ },
|
|
|
+ judgePlan(item){
|
|
|
+ this.visibleJudge = true;
|
|
|
+ this.noEdit = true;
|
|
|
+ this.plan = JSON.parse(JSON.stringify( item ));
|
|
|
+ this.changeSignal = !this.changeSignal;
|
|
|
}
|
|
|
}
|
|
|
}
|