From db42d47f5692ef64e5436c5a6d29dcb537b44596 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 26 一月 2026 16:36:13 +0800
Subject: [PATCH] 浪潮对接单点登录:mis调整
---
src/views/oaSystem/projectManagement/components/phaseGoalList.vue | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 165 insertions(+), 0 deletions(-)
diff --git a/src/views/oaSystem/projectManagement/components/phaseGoalList.vue b/src/views/oaSystem/projectManagement/components/phaseGoalList.vue
new file mode 100644
index 0000000..5054299
--- /dev/null
+++ b/src/views/oaSystem/projectManagement/components/phaseGoalList.vue
@@ -0,0 +1,165 @@
+
+<template>
+ <div class="phase-goal-list-container">
+ <el-table
+ v-loading="loading"
+ :data="phaseGoalList"
+ style="width: 100%"
+ >
+ <el-table-column prop="phaseName" label="鎵�灞為樁娈�" width="180" />
+ <el-table-column prop="taskName" label="鐩爣鍚嶇О" min-width="200" />
+ <el-table-column prop="targetValue" label="鐩爣鍊�" width="120" />
+ <el-table-column prop="currentValue" label="褰撳墠鍊�" width="120" />
+ <el-table-column prop="unit" label="鍗曚綅" width="80" />
+ <el-table-column prop="targetDate" label="鐩爣鏃ユ湡" width="120" />
+ <el-table-column prop="status" label="鐘舵��" width="100">
+ <template #default="scope">
+ <el-tag :type="getStatusType(scope.row.status)">{{ getStatusText(scope.row.status) }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="completionRate" label="瀹屾垚搴�" width="120">
+ <template #default="scope">
+ <el-progress :percentage="scope.row.completionRate" :stroke-width="6" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="150" fixed="right">
+ <template #default="scope">
+ <el-button type="text" size="small" @click="handleEdit(scope.row)">缂栬緫</el-button>
+ <el-button type="text" size="small" @click="handleDelete(scope.row)" danger>鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <!-- 鏃犻樁娈电洰鏍囨椂鐨勬彁绀� -->
+ <div v-if="!loading && phaseGoalList.length === 0" class="empty-tip">
+ <el-empty description="鏆傛棤闃舵鐩爣鏁版嵁" />
+ </div>
+ </div>
+</template>
+
+<script setup>
+import { ref, onMounted, watch } from 'vue';
+import { ElMessage, ElMessageBox } from 'element-plus';
+import { listProjectPhase, updateProjectTask, delProjectTask } from '@/api/oaSystem/projectManagement';
+
+const props = defineProps({
+ projectId: {
+ type: String,
+ required: true
+ }
+});
+
+const emit = defineEmits(['refresh']);
+
+const phaseGoalList = ref([]);
+const loading = ref(true);
+
+// 鑾峰彇闃舵鐩爣鍒楄〃
+const getPhaseGoalList = async () => {
+ loading.value = true;
+ try {
+ const { data } = await listProjectPhase(props.projectId);
+ // 鍋囪phase鏁版嵁涓寘鍚簡鐩爣淇℃伅
+ // 杩欓噷绠�鍖栧鐞嗭紝瀹為檯搴旇璋冪敤涓撻棬鐨勮幏鍙栭樁娈电洰鏍囩殑API
+ const phases = data.rows || data;
+ phaseGoalList.value = [];
+
+ phases.forEach(phase => {
+ if (phase.oaProjectPhaseTasks && phase.oaProjectPhaseTasks.length > 0) {
+ phase.oaProjectPhaseTasks.forEach(goal => {
+ phaseGoalList.value.push({
+ ...goal,
+ phaseName: phase.phaseName
+ });
+ });
+ }
+ });
+ } catch (error) {
+ ElMessage.error('鑾峰彇闃舵鐩爣鍒楄〃澶辫触');
+ console.error('鑾峰彇闃舵鐩爣鍒楄〃澶辫触:', error);
+ } finally {
+ loading.value = false;
+ }
+};
+
+// 缂栬緫闃舵鐩爣
+const handleEdit = (goal) => {
+ // 瑙﹀彂鐖剁粍浠剁殑缂栬緫浜嬩欢锛屼紶閫掔洰鏍囨暟鎹�
+ emit('editGoal', goal);
+};
+
+// 鍒犻櫎闃舵鐩爣
+const handleDelete = async (goal) => {
+ try {
+ await ElMessageBox.confirm(
+ `纭畾瑕佸垹闄ょ洰鏍囥��${goal.taskName}銆嶅悧锛焋,
+ '纭鍒犻櫎',
+ {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }
+ );
+
+ // 璋冪敤鍒犻櫎API
+ await delProjectTask(goal.taskId);
+ ElMessage.success('鍒犻櫎闃舵鐩爣鎴愬姛');
+
+ // 鍒锋柊鍒楄〃
+ getPhaseGoalList();
+ emit('refresh');
+ } catch (error) {
+ if (error !== 'cancel') {
+ ElMessage.error('鍒犻櫎闃舵鐩爣澶辫触');
+ console.error('鍒犻櫎闃舵鐩爣澶辫触:', error);
+ }
+ }
+};
+
+// 鑾峰彇鐘舵�佹爣绛剧被鍨�
+const getStatusType = (status) => {
+ const statusTypeMap = {
+ notStarted: 'info',
+ inProgress: 'primary',
+ completed: 'success',
+ delayed: 'danger'
+ };
+ return statusTypeMap[status] || 'default';
+};
+
+// 鑾峰彇鐘舵�佹枃鏈�
+const getStatusText = (status) => {
+ const statusTextMap = {
+ notStarted: '鏈紑濮�',
+ inProgress: '杩涜涓�',
+ completed: '宸插畬鎴�',
+ delayed: '宸插欢杩�'
+ };
+ return statusTextMap[status] || status;
+};
+
+// 鐩戝惉椤圭洰ID鍙樺寲
+watch(() => props.projectId, () => {
+ if (props.projectId) {
+ getPhaseGoalList();
+ }
+});
+
+// 鍒濆鍖�
+onMounted(() => {
+ if (props.projectId) {
+ getPhaseGoalList();
+ }
+});
+</script>
+
+<style scoped>
+.phase-goal-list-container {
+ padding: 10px 0;
+}
+
+.empty-tip {
+ margin-top: 40px;
+ text-align: center;
+}
+</style>
--
Gitblit v1.9.3