From 6ae0fcef149ddbe614746023a58a3885b3ac4bde Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期二, 25 三月 2025 11:31:04 +0800 Subject: [PATCH] Merge branch 'dev' --- src/views/projectManage/plan/planRecord.vue | 192 +++++++++++++++++++++++++++++++++++------------ 1 files changed, 141 insertions(+), 51 deletions(-) diff --git a/src/views/projectManage/plan/planRecord.vue b/src/views/projectManage/plan/planRecord.vue index cdbe15a..cf6401e 100644 --- a/src/views/projectManage/plan/planRecord.vue +++ b/src/views/projectManage/plan/planRecord.vue @@ -1,21 +1,27 @@ <template> <div class="app-container"> <el-container> - <el-header v-show="planInfoData && planInfoData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ planInfoData.projectName }}</el-header> - <h4 v-show="planInfoData && planInfoData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ planInfoData.projectCode }}</h4> + <el-header v-show="projectInfoData && projectInfoData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ projectInfoData.projectName }}</el-header> + <h4 v-show="projectInfoData && projectInfoData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ projectInfoData.projectCode }}</h4> <el-main> <el-card shadow="hover"> <el-row :gutter="20"> <el-col :span="24" class="mb-4"> <div style="margin-bottom: 10px"> <span style="font-size: 20px; font-weight: bold;">鏈堝害璁″垝</span> - <el-button type="primary" size="small" style="float: right" @click="handleAddMonthPlan">鏂板</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-plus" + style="float: right" + @click="handleAddMonthPlan" + v-show="!projectInfoData.managerFlag">鏂板</el-button> </div> - <el-table :data="monthRecords" style="width: 100%"> + <el-table :data="monthRecords" border stripe style="width: 100%; margin-bottom: 20px"> <!-- 琛ㄥご --> - <el-table-column prop="id" label="搴忓彿" align="center"></el-table-column> - <el-table-column prop="projectName" label="椤圭洰鍚嶇О" align="center"></el-table-column> - <el-table-column prop="projectCode" label="椤圭洰浠g爜" align="center"></el-table-column> + <el-table-column prop="id" label="搴忓彿" align="center" width="50"/> + <el-table-column prop="projectName" label="椤圭洰鍚嶇О" align="center" /> + <el-table-column prop="projectCode" label="椤圭洰浠g爜" align="center" /> <el-table-column label="璁″垝鏈�" align="center"> <template slot-scope="scope"> <span> @@ -23,12 +29,32 @@ </span> </template> </el-table-column> - <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center"></el-table-column> + <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center" /> <el-table-column fixed="right" label="鎿嶄綔" align="center"> <template slot-scope="scope"> - <el-button type="primary" size="small" :disabled="scope.row.reportStatus === 0" @click="handlePlanInfo(scope.row)">缂栬緫涓婃姤</el-button> - <el-button type="danger" size="small" v-show="scope.row.reportStatus === 1" @click="handleDeletePlanRecord(scope.row.id)">鍒犻櫎</el-button> - <el-button type="danger" size="small" v-show="scope.row.reportStatus === 0" @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + <div v-show="!projectInfoData.managerFlag"> + <el-button + type="text" + size="medium" + icon="el-icon-edit" + :disabled="scope.row.reportStatus === 0" + @click="handlePlanInfo(scope.row)">缂栬緫涓婃姤</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-delete" + v-show="scope.row.reportStatus === 1" + @click="handleDeletePlanRecord(scope.row.id)">鍒犻櫎</el-button> + <el-button type="text" size="medium" v-show="scope.row.reportStatus === 0" @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + </div> + <div v-show="projectInfoData.managerFlag"> + <el-button + type="text" + size="medium" + icon="el-icon-view" + v-show="scope.row.reportStatus === 0" + @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + </div> </template> </el-table-column> </el-table> @@ -36,13 +62,19 @@ <el-col :span="24" class="mb-4" style="margin-top: 20px"> <div style="margin-bottom: 10px"> <span style="font-size: 20px; font-weight: bold;">瀛e害璁″垝</span> - <el-button type="primary" size="small" style="float: right" @click="handleAddSeasonPlan">鏂板</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-plus" + style="float: right" + @click="handleAddSeasonPlan" + v-show="!projectInfoData.managerFlag">鏂板</el-button> </div> - <el-table :data="seasonRecords" style="width: 100%"> + <el-table :data="seasonRecords" border stripe style="width: 100%; margin-bottom: 20px"> <!-- 琛ㄥご --> - <el-table-column prop="id" label="搴忓彿" align="center"></el-table-column> - <el-table-column prop="projectName" label="椤圭洰鍚嶇О" align="center"></el-table-column> - <el-table-column prop="projectCode" label="椤圭洰浠g爜" align="center"></el-table-column> + <el-table-column prop="id" label="搴忓彿" align="center" width="50" /> + <el-table-column prop="projectName" label="椤圭洰鍚嶇О" align="center" /> + <el-table-column prop="projectCode" label="椤圭洰浠g爜" align="center" /> <el-table-column label="璁″垝鏈�" align="center"> <template slot-scope="scope"> <span> @@ -50,12 +82,37 @@ </span> </template> </el-table-column> - <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center"></el-table-column> + <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center" /> <el-table-column fixed="right" label="鎿嶄綔" align="center"> <template slot-scope="scope"> - <el-button type="primary" size="small" :disabled="scope.row.reportStatus === 0" @click="handlePlanInfo(scope.row)">缂栬緫涓婃姤</el-button> - <el-button type="danger" size="small" v-show="scope.row.reportStatus === 1" @click="handleDeletePlanRecord(scope.row.id)">鍒犻櫎</el-button> - <el-button type="danger" size="small" v-show="scope.row.reportStatus === 0" @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + <div v-show="!projectInfoData.managerFlag"> + <el-button + type="text" + size="medium" + icon="el-icon-edit" + :disabled="scope.row.reportStatus === 0" + @click="handlePlanInfo(scope.row)">缂栬緫涓婃姤</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-delete" + v-show="scope.row.reportStatus === 1" + @click="handleDeletePlanRecord(scope.row.id)">鍒犻櫎</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-view" + v-show="scope.row.reportStatus === 0" + @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + </div> + <div v-show="projectInfoData.managerFlag"> + <el-button + type="text" + size="medium" + icon="el-icon-view" + v-show="scope.row.reportStatus === 0" + @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + </div> </template> </el-table-column> </el-table> @@ -63,13 +120,19 @@ <el-col :span="24" class="mb-4" style="margin-top: 20px"> <div style="margin-bottom: 10px"> <span style="font-size: 20px; font-weight: bold;">骞村害璁″垝</span> - <el-button type="primary" size="small" style="float: right" @click="handleAddYearPlan">鏂板</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-plus" + style="float: right" + @click="handleAddYearPlan" + v-show="!projectInfoData.managerFlag">鏂板</el-button> </div> - <el-table :data="yearRecords" style="width: 100%"> + <el-table :data="yearRecords" border stripe style="width: 100%; margin-bottom: 20px"> <!-- 琛ㄥご --> - <el-table-column prop="id" label="搴忓彿" align="center"></el-table-column> - <el-table-column prop="projectName" label="椤圭洰鍚嶇О" align="center"></el-table-column> - <el-table-column prop="projectCode" label="椤圭洰浠g爜" align="center"></el-table-column> + <el-table-column prop="id" label="搴忓彿" align="center" width="50" /> + <el-table-column prop="projectName" label="椤圭洰鍚嶇О" align="center" /> + <el-table-column prop="projectCode" label="椤圭洰浠g爜" align="center" /> <el-table-column label="璁″垝鏈�" align="center"> <template slot-scope="scope"> <span> @@ -77,12 +140,37 @@ </span> </template> </el-table-column> - <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center"></el-table-column> + <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center" /> <el-table-column fixed="right" label="鎿嶄綔" align="center"> <template slot-scope="scope"> - <el-button type="primary" size="small" :disabled="scope.row.reportStatus === 0" @click="handlePlanInfo(scope.row)">缂栬緫涓婃姤</el-button> - <el-button type="danger" size="small" v-show="scope.row.reportStatus === 1" @click="handleDeletePlanRecord(scope.row.id)">鍒犻櫎</el-button> - <el-button type="danger" size="small" v-show="scope.row.reportStatus === 0" @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + <div v-show="!projectInfoData.managerFlag"> + <el-button + type="text" + size="medium" + icon="el-icon-edit" + :disabled="scope.row.reportStatus === 0" + @click="handlePlanInfo(scope.row)">缂栬緫涓婃姤</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-delete" + v-show="scope.row.reportStatus === 1" + @click="handleDeletePlanRecord(scope.row.id)">鍒犻櫎</el-button> + <el-button + type="text" + size="medium" + icon="el-icon-view" + v-show="scope.row.reportStatus === 0" + @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + </div> + <div v-show="projectInfoData.managerFlag"> + <el-button + type="text" + size="medium" + icon="el-icon-view" + v-show="scope.row.reportStatus === 0" + @click="handleCheckPlanInfo(scope.row)">鏌ョ湅</el-button> + </div> </template> </el-table-column> </el-table> @@ -98,11 +186,11 @@ import {addRecord, getPlanRecordList, deletePlanRecord} from "@/api/projectPlan/index"; export default { - name: "planRecord", + // name: "PlanRecord", data() { return { // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁 - planInfoData: {}, + projectInfoData: {}, // 鏈堝害璁″垝鏁版嵁 monthRecords: [], // 瀛e害璁″垝鏁版嵁 @@ -111,18 +199,20 @@ yearRecords: [], } }, + created() { + this.getProjectInfoData(); + }, methods: { // 椤甸潰鍔犺浇 search() { - this.getPlanRecordData(this.planInfoData.id); + this.getPlanRecordData(this.projectInfoData.id); }, // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏 - getPlanInfoData() { + getProjectInfoData() { // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁 - if (this.$route.query.data) { - this.planInfoData = JSON.parse(this.$route.query.data); - this.getPlanRecordData(this.planInfoData.id); - } + this.projectInfoData = JSON.parse(this.$route.query.data); + // 鑾峰彇椤圭洰璁″垝璁板綍鏁版嵁 + this.search(); }, // 鑾峰彇椤圭洰璁″垝璁板綍鏁版嵁 getPlanRecordData(id) { @@ -138,13 +228,13 @@ handleAddMonthPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planInfoData.id, + projectInfoId: this.projectInfoData.id, planTimeFlag: 0 } // 鍒ゆ柇鏈堝害璁″垝鏄惁涓虹┖ - if (this.monthRecords.length === 0){ + if (this.monthRecords.length === 0) { planRecordData.id = 0; - }else { + } else { planRecordData.id = this.monthRecords[this.monthRecords.length - 1].id; } // 鏂板涓�琛岃褰� @@ -156,13 +246,13 @@ handleAddSeasonPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planInfoData.id, + projectInfoId: this.projectInfoData.id, planTimeFlag: 1 } // 鍒ゆ柇瀛e害璁″垝鏄惁涓虹┖ - if (this.seasonRecords.length === 0){ + if (this.seasonRecords.length === 0) { planRecordData.id = 0; - }else { + } else { planRecordData.id = this.seasonRecords[this.seasonRecords.length - 1].id; } // 鏂板涓�琛岃褰� @@ -174,13 +264,13 @@ handleAddYearPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planInfoData.id, + projectInfoId: this.projectInfoData.id, planTimeFlag: 2 } // 鍒ゆ柇骞村害璁″垝鏄惁涓虹┖ - if (this.yearRecords.length === 0){ + if (this.yearRecords.length === 0) { planRecordData.id = 0; - }else { + } else { planRecordData.id = this.yearRecords[this.yearRecords.length - 1].id; } // 鏂板涓�琛岃褰� @@ -190,11 +280,12 @@ }, /** 淇敼椤圭洰璁″垝椤� */ handlePlanInfo(row) { + row.managerFlag = this.projectInfoData.managerFlag; this.$router.push({ - name: 'PlanInfo', + path: '/projectManage/planInfo', query: { data: JSON.stringify(row), - planInfoData: this.planInfoData + projectInfoData: JSON.stringify(this.projectInfoData) } }) }, @@ -206,16 +297,15 @@ }, // 鏌ョ湅椤圭洰璁″垝椤� handleCheckPlanInfo(row) { + row.managerFlag = this.projectInfoData.managerFlag; this.$router.push({ path: '/projectManage/planInfoCheck', query: { data: JSON.stringify(row), + projectInfoData: JSON.stringify(this.projectInfoData) } }) } - }, - created() { - this.getPlanInfoData(); }, }; </script> -- Gitblit v1.8.0