|
@@ -61,6 +61,9 @@ table{
|
|
|
.center-text{
|
|
|
text-align: center;
|
|
|
}
|
|
|
+.el-icon-edit{
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
</style>
|
|
|
<template>
|
|
|
<div class="quarter">
|
|
@@ -71,16 +74,15 @@ table{
|
|
|
placeholder="选择年"
|
|
|
@change="getPlanList">
|
|
|
</el-date-picker>
|
|
|
- <el-button type="primary" @click="visibleChange = true;noEdit = false;plan = {};">新增季度计划</el-button>
|
|
|
+ <el-button type="primary" @click="addPlan">新增季度计划</el-button>
|
|
|
</div>
|
|
|
<table>
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>计划名</th>
|
|
|
- <!-- <th style="min-width:50px">部门</th> -->
|
|
|
- <!-- <th>参与成员</th> -->
|
|
|
<th>年份</th>
|
|
|
<th style="width:50px">季度</th>
|
|
|
+ <th style="min-width:50px">部门</th>
|
|
|
<th>内容</th>
|
|
|
<th style="width:140px;text-align: center;">操作</th>
|
|
|
</tr>
|
|
@@ -88,10 +90,9 @@ table{
|
|
|
<tbody>
|
|
|
<tr v-for="(item,index) in planeList" :key="index">
|
|
|
<td>{{item.name}}</td>
|
|
|
- <!-- <td>{{item.depart}}</td> -->
|
|
|
- <!-- <td>{{item.member}}</td> -->
|
|
|
<td>{{item.year}}</td>
|
|
|
<td>{{item.quarter}}</td>
|
|
|
+ <td>{{item.departmentName}}</td>
|
|
|
<td>{{item.content}}</td>
|
|
|
<td>
|
|
|
<a @click="changeData(item,true)">详情</a>
|
|
@@ -136,13 +137,18 @@ table{
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
+ <div>
|
|
|
+ <label>部门:</label>
|
|
|
+ <el-input v-model="currentDepart.name" required="required" disabled style="width:380px"></el-input>
|
|
|
+ <i class="el-icon-edit" @click="departChange = !noEdit?true:false"></i>
|
|
|
+ </div>
|
|
|
<div>
|
|
|
<label class="text-label">内容:</label>
|
|
|
<el-input v-model="plan.content" placeholder="请输入内容" required="required" :disabled="noEdit" type="textarea" :autosize="{ minRows: 5}"></el-input>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="visibleChange = false;plan={}" v-if="!noEdit">取消</el-button>
|
|
|
- <el-button type="primary" @click="change" v-if="!noEdit">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="save" v-if="!noEdit">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
@@ -154,9 +160,22 @@ table{
|
|
|
<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="change" v-if="!noEdit">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="save(2)" v-if="!noEdit">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ class="dialog-style"
|
|
|
+ title="切换部门"
|
|
|
+ :modal="false"
|
|
|
+ :visible.sync="departChange"
|
|
|
+ width="500px">
|
|
|
+ <p>选择:{{currentDepart.name}}</p>
|
|
|
+ <UserTree :showUser="false" @chooseUser="chooseDepart"></UserTree>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="departChange = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="changeCheckDepart">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog
|
|
|
title="提示"
|
|
|
:visible.sync="visibleDelete"
|
|
@@ -178,14 +197,16 @@ table{
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getPlanList,addPlan,updatePlan,deletePlan } from '@/api/quarter';
|
|
|
+import { getPlanList,addPlan,updatePlan,deletePlan,evaluate } from '@/api/quarter';
|
|
|
import ChildPlan from "@/components/MainPage/Quarter/ChildPlan";
|
|
|
+import UserTree from "@/components/MainPage/Department/UserTree";
|
|
|
import Judge from "@/components/MainPage/Judge/Judge";
|
|
|
|
|
|
export default {
|
|
|
name: 'Quarter',
|
|
|
components: {
|
|
|
ChildPlan,
|
|
|
+ UserTree,
|
|
|
Judge
|
|
|
},
|
|
|
data () {
|
|
@@ -200,7 +221,11 @@ export default {
|
|
|
params:{
|
|
|
year: ''
|
|
|
},
|
|
|
+ currentDepart: {
|
|
|
+ name:''
|
|
|
+ },
|
|
|
visibleChange: false,
|
|
|
+ departChange: false,
|
|
|
visibleDelete: false,
|
|
|
noEdit: false,
|
|
|
childPlanFlag: false,
|
|
@@ -219,6 +244,16 @@ export default {
|
|
|
this.planeList = data.data;
|
|
|
})
|
|
|
},
|
|
|
+ addPlan(){
|
|
|
+ this.visibleChange = true;
|
|
|
+ this.noEdit = false;
|
|
|
+ this.plan = {
|
|
|
+ content: '',
|
|
|
+ departmentId: '',
|
|
|
+ name: '',
|
|
|
+ };
|
|
|
+ this.currentDepart.name = '';
|
|
|
+ },
|
|
|
deletePlan(){
|
|
|
deletePlan(this.plan).then((result) => {
|
|
|
this.$message(result?'删除成功':'删除失败');
|
|
@@ -232,17 +267,33 @@ export default {
|
|
|
this.noEdit = flag;
|
|
|
this.plan = JSON.parse(JSON.stringify( item ));
|
|
|
this.yearData = new Date(item.year,1,1);
|
|
|
+ this.currentDepart = {
|
|
|
+ id: this.plan.departmentId,
|
|
|
+ name: this.plan.departmentName,
|
|
|
+ };
|
|
|
},
|
|
|
- change(){
|
|
|
+ save(type){
|
|
|
this.plan.year = this.yearData.getFullYear();
|
|
|
if(this.plan.id){
|
|
|
- updatePlan(this.plan).then((result) => {
|
|
|
- this.$message(result.result?'更新成功':'更新失败');
|
|
|
- this.visibleChange = false;
|
|
|
- this.visibleJudge = false;
|
|
|
- this.plan = {};
|
|
|
- this.getPlanList();
|
|
|
- })
|
|
|
+ if(type == 2){
|
|
|
+ evaluate({
|
|
|
+ id: this.plan.id,
|
|
|
+ evaluation: this.plan.evaluation
|
|
|
+ }).then((result) => {
|
|
|
+ this.$message(result.result?'更新成功':'更新失败');
|
|
|
+ this.visibleJudge = false;
|
|
|
+ this.plan = {};
|
|
|
+ this.getPlanList();
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ updatePlan(this.plan).then((result) => {
|
|
|
+ this.$message(result.result?'更新成功':'更新失败');
|
|
|
+ this.visibleChange = false;
|
|
|
+ this.visibleJudge = false;
|
|
|
+ this.plan = {};
|
|
|
+ this.getPlanList();
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
else{
|
|
|
addPlan(this.plan).then((result) => {
|
|
@@ -253,10 +304,17 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ chooseDepart(val){
|
|
|
+ this.currentDepart = val;
|
|
|
+ },
|
|
|
openChildPlan(item){
|
|
|
this.childPlanFlag = true;
|
|
|
this.plan = item;
|
|
|
},
|
|
|
+ changeCheckDepart(){
|
|
|
+ this.plan.departmentId = this.currentDepart.id;
|
|
|
+ this.departChange = false;
|
|
|
+ },
|
|
|
setEvaluation(val){
|
|
|
this.plan.evaluation = val;
|
|
|
},
|