From 35da5fc48ba4431d0aa2dd310049a92cf50a7320 Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期三, 04 十二月 2024 09:32:08 +0800
Subject: [PATCH] 分角色展示项目计划,实现不同角色的功能
---
src/views/projectManage/plan/planInfo.vue | 3
src/api/projectPlan/index.js | 15 ++++-
src/views/projectManage/plan/planInfoCheck.vue | 131 ++++++++++++++++++++++++++++++++++---------
3 files changed, 115 insertions(+), 34 deletions(-)
diff --git a/src/api/projectPlan/index.js b/src/api/projectPlan/index.js
index 6594ee2..9391710 100644
--- a/src/api/projectPlan/index.js
+++ b/src/api/projectPlan/index.js
@@ -59,10 +59,19 @@
})
}
-// 淇濆瓨璁″垝椤�
-export function savePlanInfo(data) {
+// 鐢ㄦ埛閲嶆柊涓婃姤璁″垝椤�
+export function resubmitPlanInfo(data) {
return request({
- url: '/api/project-plan-info/savePlanInfo',
+ url: '/api/project-plan-info/resubmitPlanInfo',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇濆瓨璁″垝椤�
+export function savePlanInfo(data, planRecordId) {
+ return request({
+ url: '/api/project-plan-info/savePlanInfo/' + planRecordId,
method: 'post',
data: data
})
diff --git a/src/views/projectManage/plan/planInfo.vue b/src/views/projectManage/plan/planInfo.vue
index 47f9ae0..54012b5 100644
--- a/src/views/projectManage/plan/planInfo.vue
+++ b/src/views/projectManage/plan/planInfo.vue
@@ -166,8 +166,7 @@
// 淇濆瓨褰撳墠琛屾暟鎹�
handleSave(index) {
this.tableData[index].projectPlanRecordId = this.projectInfoData.id;
- savePlanInfo(this.tableData[index]).then(response => {
- this.search();
+ savePlanInfo(this.tableData[index], this.planInfoData.id).then(response => {
this.$message.success('淇濆瓨鎴愬姛');
});
},
diff --git a/src/views/projectManage/plan/planInfoCheck.vue b/src/views/projectManage/plan/planInfoCheck.vue
index 60dc8fd..04cd7f1 100644
--- a/src/views/projectManage/plan/planInfoCheck.vue
+++ b/src/views/projectManage/plan/planInfoCheck.vue
@@ -31,15 +31,27 @@
</template>
</el-table-column>
<el-table-column :label="planInfoData.planTimeFlag === 0 ? '鏈堝害' : planInfoData.planTimeFlag === 1 ? '瀛e害' : '骞村害' " align="center">
+ {{ planInfoData.planTime }}{{ planInfoData.planTimeFlag === 0 ? '鏈堝害' : planInfoData.planTimeFlag === 1 ? '瀛e害' : '骞村害' }}
+ </el-table-column>
+ <el-table-column prop="planStatus" label="鐘舵��" width="100" align="center">
<template #default="scope">
- <span>{{ planInfoData.planTime }}{{ planInfoData.planTimeFlag === 0 ? '鏈堝害' : planInfoData.planTimeFlag === 1 ? '瀛e害' : '骞村害' }}</span>
+ {{ scope.row.planStatus === 1 ? '宸查┏鍥�' : scope.row.planStatus === 2 ? '宸查�氳繃' : '鏈鏍�' }}
</template>
</el-table-column>
<div v-if="!projectInfoData.managerFlag">
<el-table-column fixed="right" label="鎿嶄綔" align="center">
<template #default="scope">
- <el-button size="small" @click="handleDelay(scope.$index)">寤舵湡</el-button>
- <el-button size="small" type="danger" @click="handleReset(scope.$index)">閲嶇疆</el-button>
+ <!-- 鐘舵�佷负鏈鏍� -->
+ <div v-if="scope.row.planStatus === 0"></div>
+ <!-- 鐘舵�佷负宸查┏鍥� -->
+ <div v-if="scope.row.planStatus === 1">
+ <el-button size="small" @click="handleResubmit(scope.row)">閲嶆柊涓婃姤</el-button>
+ <el-button size="small" type="danger" @click="handleReset(scope.$index)">閲嶇疆</el-button>
+ </div>
+ <!-- 鐘舵�佷负宸查�氳繃 -->
+ <div v-if="scope.row.planStatus === 2">
+ <el-button size="small" @click="handleDelay(scope.$index)">寤舵湡</el-button>
+ </div>
</template>
</el-table-column>
</div>
@@ -71,52 +83,105 @@
</el-table-column>
<el-table-column prop="title" label="浜嬮」鍚嶇О" width="200" align="center" />
<el-table-column prop="departmentExamine" label="涓婄骇瀹℃牳" width="130" align="center">
- <template #default="scope" v-if="!projectInfoData.managerFlag">
- {{ scope.row.departmentExamine === 0 ? '鍚屾剰' : scope.row.departmentExamine === 1 ? '椹冲洖' : '鏈鏍�' }}
- </template>
- <template v-if="projectInfoData.managerFlag" #default="scope">
- <el-select v-model="scope.row.departmentExamine" placeholder="璇烽�夋嫨" size="small" clearable>
- <el-option label="鍚屾剰" :value="0"></el-option>
- <el-option label="椹冲洖" :value="1"></el-option>
- </el-select>
+ <template #default="scope">
+ <div v-if="projectInfoData.managerFlag">
+ <el-select
+ v-model="scope.row.departmentExamine"
+ :disabled="scope.row.planStatus === 2 || scope.row.planStatus === 1"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ clearable>
+ <el-option label="鍚屾剰" :value="0"></el-option>
+ <el-option label="椹冲洖" :value="1"></el-option>
+ </el-select>
+ </div>
+ <div v-if="!projectInfoData.managerFlag">
+ {{ scope.row.departmentExamine === 0 ? '鍚屾剰' : scope.row.departmentExamine === 1 ? '椹冲洖' : '鏈鏍�' }}
+ </div>
</template>
</el-table-column>
<el-table-column prop="departmentApproval" label="鎵瑰鍐呭" width="160" align="center">
<template v-if="projectInfoData.managerFlag" #default="scope">
- <el-input type="textarea" v-model="scope.row.departmentApproval" placeholder="璇疯緭鍏�" rows="3" />
+ <el-input
+ type="textarea"
+ v-model="scope.row.departmentApproval"
+ :readonly="scope.row.planStatus === 2 || scope.row.planStatus === 1"
+ placeholder="璇疯緭鍏�"
+ rows="3" />
</template>
</el-table-column>
<el-table-column prop="departmentApprovalReply" label="鎵瑰鍥炲" width="160" align="center">
<template #default="scope" v-if="!projectInfoData.managerFlag">
- <el-input type="textarea" v-model="scope.row.departmentApprovalReply" placeholder="璇疯緭鍏�" rows="3" />
+ <el-input
+ type="textarea"
+ v-model="scope.row.departmentApprovalReply"
+ :readonly="scope.row.planStatus === 0"
+ placeholder="璇疯緭鍏�"
+ rows="3" />
</template>
</el-table-column>
<el-table-column prop="manageExamine" label="涓荤閮ㄩ棬瀹℃牳" width="130" align="center" >
- <template #default="scope" v-if="!projectInfoData.managerFlag">
- {{ scope.row.manageExamine === 0 ? '鍚屾剰' : scope.row.manageExamine === 1 ? '椹冲洖' : '鏈鏍�' }}
- </template>
- <template v-if="projectInfoData.managerFlag" #default="scope">
- <el-select v-model="scope.row.manageExamine" placeholder="璇烽�夋嫨" size="small" clearable>
- <el-option label="鍚屾剰" :value="0"></el-option>
- <el-option label="椹冲洖" :value="1"></el-option>
- </el-select>
+ <template #default="scope">
+ <div v-if="!projectInfoData.managerFlag">
+ {{ scope.row.manageExamine === 0 ? '鍚屾剰' : scope.row.manageExamine === 1 ? '椹冲洖' : '鏈鏍�' }}
+ </div>
+ <div v-if="projectInfoData.managerFlag">
+ <el-select
+ v-model="scope.row.manageExamine"
+ :disabled="scope.row.planStatus === 2 || scope.row.planStatus === 1"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ clearable>
+ <el-option label="鍚屾剰" :value="0"></el-option>
+ <el-option label="椹冲洖" :value="1"></el-option>
+ </el-select>
+ </div>
</template>
</el-table-column>
<el-table-column prop="manageApproval" label="鎵瑰鍐呭" width="160" align="center">
<template v-if="projectInfoData.managerFlag" #default="scope">
- <el-input type="textarea" v-model="scope.row.manageApproval" placeholder="璇疯緭鍏�" rows="3" />
+ <el-input
+ type="textarea"
+ v-model="scope.row.manageApproval"
+ :readonly="scope.row.planStatus === 2 || scope.row.planStatus === 1"
+ placeholder="璇疯緭鍏�"
+ rows="3" />
</template>
</el-table-column>
<el-table-column prop="manageApprovalReply" label="鎵瑰鍥炲" width="160" align="center">
<template #default="scope" v-if="!projectInfoData.managerFlag">
- <el-input type="textarea" v-model="scope.row.manageApprovalReply" placeholder="璇疯緭鍏�" rows="3" />
+ <el-input
+ type="textarea"
+ v-model="scope.row.manageApprovalReply"
+ :readonly="scope.row.planStatus === 0"
+ placeholder="璇疯緭鍏�"
+ rows="3" />
+ </template>
+ </el-table-column>
+ <el-table-column prop="planStatus" label="鐘舵��" width="200" align="center" >
+ <template #default="scope">
+ {{ scope.row.planStatus === 1 ? '宸查┏鍥�' : scope.row.planStatus === 2 ? '宸查�氳繃' : '鏈鏍�' }}
</template>
</el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" align="center" width="200">
<template #default="scope">
- <el-button v-show="!projectInfoData.managerFlag" size="small" @click="handleReply(scope.$index)">鍥炲</el-button>
- <el-button v-show="!projectInfoData.managerFlag" size="small" type="danger" @click="handleReset(scope.$index)">閲嶇疆</el-button>
- <el-button v-show="projectInfoData.managerFlag" size="small" @click="handleSave(scope.$index)">淇濆瓨</el-button>
+ <div v-if="!projectInfoData.managerFlag">
+ <el-button
+ size="small"
+ @click="handleReply(scope.$index)"
+ :disabled="scope.row.planStatus === 0">鍥炲</el-button>
+ <el-button
+ size="small"
+ type="danger"
+ @click="handleReset(scope.$index)"
+ :disabled="scope.row.planStatus === 0">閲嶇疆</el-button>
+ </div>
+ <div v-if="projectInfoData.managerFlag">
+ <el-button
+ size="small"
+ @click="handleExamine(scope.$index)"
+ v-if="scope.row.planStatus === 0">瀹℃牳</el-button>
+ </div>
</template>
</el-table-column>
</el-table>
@@ -158,7 +223,7 @@
</template>
<script>
-import { getPlanInfoData, delayPlanInfo, getDepartmentApproval, getPlanLog, replyExamine, saveExamine } from "@/api/projectPlan/index";
+import { getPlanInfoData, delayPlanInfo, getDepartmentApproval, getPlanLog, replyExamine, saveExamine, resubmitPlanInfo } from "@/api/projectPlan/index";
export default {
name: "planInfoCheck",
@@ -216,6 +281,13 @@
}
});
},
+ // 鐢ㄦ埛閲嶆柊涓婃姤璁″垝椤�
+ handleResubmit(data) {
+ resubmitPlanInfo(data).then(response => {
+ this.$message.success('閲嶆柊涓婃姤鎴愬姛');
+ this.search()
+ });
+ },
// 寤舵湡
handleDelay(index) {
delayPlanInfo(this.tableData[index]).then(response => {
@@ -237,9 +309,10 @@
});
},
// 淇濆瓨瀹℃壒
- handleSave(index) {
+ handleExamine(index) {
saveExamine(this.departmentApprovalData[index]).then(response => {
- this.$message.success('淇濆瓨鎴愬姛');
+ this.$message.success('瀹℃壒鎴愬姛');
+ this.search()
});
},
// 鑾峰彇璁″垝鏃ュ織
--
Gitblit v1.8.0