|
@@ -50,7 +50,7 @@ table{
|
|
|
}
|
|
|
.el-textarea,.el-input{
|
|
|
display: inline-block;
|
|
|
- width: 300px;
|
|
|
+ width: 400px;
|
|
|
}
|
|
|
.text-label{
|
|
|
vertical-align: top;
|
|
@@ -65,7 +65,7 @@ table{
|
|
|
<template>
|
|
|
<div class="year">
|
|
|
<div class="tool-panel">
|
|
|
- <el-button type="primary" @click="visibleChange = true;" v-if="ableEdit">新增年度计划</el-button>
|
|
|
+ <el-button type="primary" @click="visibleChange = true;noEdit = false;plan = {};">新增年度计划</el-button>
|
|
|
</div>
|
|
|
<table>
|
|
|
<thead>
|
|
@@ -74,8 +74,8 @@ table{
|
|
|
<!-- <th>部门</th> -->
|
|
|
<!-- <th>参与成员</th> -->
|
|
|
<th>年份</th>
|
|
|
- <th>简要说明</th>
|
|
|
- <th style="width:150px" v-if="ableEdit">操作</th>
|
|
|
+ <th>内容</th>
|
|
|
+ <th style="width:120px">操作</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
@@ -85,39 +85,52 @@ table{
|
|
|
<!-- <td>{{item.member}}</td> -->
|
|
|
<td>{{item.year}}</td>
|
|
|
<td>{{item.content}}</td>
|
|
|
- <td v-if="ableEdit">
|
|
|
+ <td>
|
|
|
+ <a @click="changeData(item,true)">详情</a>
|
|
|
+
|
|
|
<a @click="changeData(item)">修改</a>
|
|
|
|
|
|
<a @click="visibleDelete = true;plan.id = item.id">删除</a>
|
|
|
|
|
|
- <a>完成</a>
|
|
|
+ <a @click="judgePlan(item)">评价</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<el-dialog
|
|
|
class="dialog-style"
|
|
|
- title="编辑"
|
|
|
+ :title="noEdit?'详情':'编辑'"
|
|
|
:visible.sync="visibleChange"
|
|
|
- width="500px">
|
|
|
+ width="600px">
|
|
|
<div>
|
|
|
<label>名称:</label>
|
|
|
- <el-input name="name" v-model="plan.name" placeholder="请输入名称" required="required"></el-input>
|
|
|
+ <el-input name="name" v-model="plan.name" placeholder="请输入名称" required="required" :disabled="noEdit"></el-input>
|
|
|
</div>
|
|
|
<div>
|
|
|
<label>年份:</label>
|
|
|
<el-date-picker
|
|
|
v-model="yearData"
|
|
|
type="year"
|
|
|
+ :disabled="noEdit"
|
|
|
placeholder="选择年">
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
<div>
|
|
|
<label class="text-label">内容:</label>
|
|
|
- <el-input v-model="plan.content" placeholder="请输入内容" required="required" type="textarea" :autosize="{ minRows: 5}"></el-input>
|
|
|
+ <el-input v-model="plan.content" placeholder="请输入内容" required="required" type="textarea" :autosize="{ minRows: 5}" :disabled="noEdit"></el-input>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="visibleChange = false;plan={}">取消</el-button>
|
|
|
+ <el-button type="primary" @click="visibleChange = false;plan={}" v-if="!noEdit">取消</el-button>
|
|
|
+ <el-button type="primary" @click="change" v-if="!noEdit">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :title="plan.name + ' 任务评价'"
|
|
|
+ :visible.sync="visibleJudge"
|
|
|
+ width="800px">
|
|
|
+ <Judge></Judge>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="visibleJudge = false;plan={}">取消</el-button>
|
|
|
<el-button type="primary" @click="change">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
@@ -136,8 +149,13 @@ table{
|
|
|
|
|
|
<script>
|
|
|
import { getPlanList,addPlan,updatePlan,deletePlan } from '@/api/year';
|
|
|
+import Judge from "@/components/MainPage/Judge/Judge";
|
|
|
+
|
|
|
export default {
|
|
|
name: 'Year',
|
|
|
+ components:{
|
|
|
+ Judge
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
params:{
|
|
@@ -146,25 +164,15 @@ export default {
|
|
|
planeList:[],
|
|
|
plan:{},
|
|
|
yearData:'',
|
|
|
+ noEdit: false,
|
|
|
visibleChange: false,
|
|
|
- visibleDelete: false
|
|
|
+ visibleDelete: false,
|
|
|
+ visibleJudge: false,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getPlanList();
|
|
|
},
|
|
|
- computed: {
|
|
|
- ableEdit() {
|
|
|
- // return this.$store.state.loginUser.id == this.$store.state.checkUser.id;
|
|
|
- return true;
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- // '$store.state.checkUser.id'(val){
|
|
|
- // this.params.userId = val;
|
|
|
- // this.getPlanList();
|
|
|
- // }
|
|
|
- },
|
|
|
methods: {
|
|
|
getPlanList(){
|
|
|
getPlanList().then((data) => {
|
|
@@ -179,8 +187,9 @@ export default {
|
|
|
this.getPlanList();
|
|
|
})
|
|
|
},
|
|
|
- changeData(item){
|
|
|
+ changeData(item,flag){
|
|
|
this.visibleChange = true;
|
|
|
+ this.noEdit = flag;
|
|
|
this.plan = JSON.parse(JSON.stringify( item ));
|
|
|
this.yearData = new Date(item.year,1,1);
|
|
|
},
|
|
@@ -190,6 +199,7 @@ export default {
|
|
|
updatePlan(this.plan).then((result) => {
|
|
|
alert(result.result?'更新成功':'更新失败');
|
|
|
this.visibleChange = false;
|
|
|
+ this.visibleJudge = false;
|
|
|
this.plan = {};
|
|
|
this.getPlanList();
|
|
|
this.$store.dispatch('setCurPlanSin');
|
|
@@ -205,6 +215,12 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ judgePlan(item){
|
|
|
+ this.visibleJudge = true;
|
|
|
+ this.plan = JSON.parse(JSON.stringify( item ));
|
|
|
+ this.changeSignal = !this.changeSignal;
|
|
|
+ this.yearData = new Date(item.year,1,1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|