From 3b8c0eb278404db65edd818936c5d1820fdbed96 Mon Sep 17 00:00:00 2001 From: luohairen <3399054449@qq.com> Date: 星期四, 28 十一月 2024 00:07:57 +0800 Subject: [PATCH] 修改项目计划bug --- src/views/projectManage/plan/planInfo.vue | 19 ++++----- src/views/projectManage/progress/progressRecord.vue | 16 ++++++-- src/views/projectManage/plan/index.vue | 2 src/views/projectManage/plan/planInfoCheck.vue | 15 +++---- src/api/projectManage/progress/index.js | 9 ++++ src/views/projectManage/plan/planRecord.vue | 29 +++++++------- 6 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/api/projectManage/progress/index.js b/src/api/projectManage/progress/index.js index 6e1b5e7..e5c2eda 100644 --- a/src/api/projectManage/progress/index.js +++ b/src/api/projectManage/progress/index.js @@ -41,5 +41,14 @@ }) } +// 鎻愪氦涓婃姤鍐呭 +export function recordSubmit(data) { + return request({ + url: '/api/project-plan-progress-report', + method: 'post', + data: data + }) +} + diff --git a/src/views/projectManage/plan/index.vue b/src/views/projectManage/plan/index.vue index 7d2d5f5..676cbd7 100644 --- a/src/views/projectManage/plan/index.vue +++ b/src/views/projectManage/plan/index.vue @@ -331,7 +331,7 @@ this.$router.push({ path: '/projectManage/planRecord', query: { - data: JSON.stringify(row) + data: row } }) } diff --git a/src/views/projectManage/plan/planInfo.vue b/src/views/projectManage/plan/planInfo.vue index 3fd438b..9608965 100644 --- a/src/views/projectManage/plan/planInfo.vue +++ b/src/views/projectManage/plan/planInfo.vue @@ -7,6 +7,7 @@ <el-card shadow="hover"> <el-row :gutter="20"> <el-col :span="24" class="mb-4"> + <el-button type="primary" size="small" @click="handlePlanRecord" style="float: right; margin-bottom: 10px; margin-left: 10px">杩斿洖</el-button> <el-button type="primary" size="small" @click="handleAdd" style="float: right; margin-bottom: 10px">鏂板</el-button> <el-table :data="tableData" border stripe style="width: 100%; margin-bottom: 20px"> <el-table-column prop="index" label="搴忓彿" width="50" align="center"> @@ -99,15 +100,13 @@ methods: { // 椤甸潰鍔犺浇 search() { - this.getPlanInfoData(this.planRecordData.id); + this.getPlanInfoData(this.planInfoData.id); }, // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏 getPlanRecordData() { // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁 - if (this.$route.query.data) { - this.planRecordData = JSON.parse(this.$route.query.data) - } - this.planInfoData = this.$route.query.planInfoData + this.planRecordData = this.$route.query.planRecordData + this.planInfoData = this.$route.query.data this.search(); }, // 鑾峰彇椤圭洰璁″垝椤� @@ -134,12 +133,12 @@ // 閬嶅巻tableData锛岃幏寰楀�间笉涓虹┖瀛楃涓茬殑琛� const validList = this.tableData.filter(item => item.title !== '' || item.startTime !== '' || item.endTime !== ''); this.addData = { - projectPlanRecordId: this.planRecordData.id, + projectPlanRecordId: this.planInfoData.id, actualInvest: this.actualInvest, addList: validList } addPlanInfo(this.addData).then(response => { - this.handlePlanRecord(this.planInfoData) + this.handlePlanRecord() }) }, // 閲嶇疆褰撳墠琛屾暟鎹� @@ -167,11 +166,11 @@ }); }, /** 杩斿洖椤圭洰璁″垝璁板綍 */ - handlePlanRecord(planInfoData) { + handlePlanRecord() { this.$router.push({ - name: '/projectManage/planRecord', + path: '/projectManage/planRecord', query: { - data: JSON.stringify(planInfoData) + data: this.planRecordData } }) } diff --git a/src/views/projectManage/plan/planInfoCheck.vue b/src/views/projectManage/plan/planInfoCheck.vue index 30c2174..ae85cde 100644 --- a/src/views/projectManage/plan/planInfoCheck.vue +++ b/src/views/projectManage/plan/planInfoCheck.vue @@ -7,6 +7,7 @@ <el-card shadow="hover"> <el-row :gutter="20"> <el-col :span="24" class="mb-4"> + <el-button type="primary" size="small" @click="handlePlanRecord" style="float: right; margin-bottom: 10px;">杩斿洖</el-button> <!--椤圭洰璁″垝椤�--> <el-table :data="tableData" border stripe style="width: 100%; margin-bottom: 20px"> <el-table-column prop="index" label="搴忓彿" width="50" align="center"> @@ -176,9 +177,7 @@ // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏 getPlanRecordData() { // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁 - if (this.$route.query.data) { - this.planRecordData = JSON.parse(this.$route.query.data) - } + this.planRecordData = this.$route.query.data this.planInfoData = this.$route.query.planInfoData this.search(); }, @@ -226,15 +225,15 @@ this.tableData[index].startTime = ''; this.tableData[index].endTime = ''; }, - /** 杩斿洖椤圭洰璁″垝璁板綍椤甸潰 */ - handlePlanRecord(planInfoData) { + /** 杩斿洖椤圭洰璁″垝璁板綍 */ + handlePlanRecord() { this.$router.push({ - name: '/projectManage/planRecord', + path: '/projectManage/planRecord', query: { - data: JSON.stringify(planInfoData) + data: this.planRecordData } }) - }, + } }, created() { this.getPlanRecordData(); diff --git a/src/views/projectManage/plan/planRecord.vue b/src/views/projectManage/plan/planRecord.vue index 19f0123..f2022b1 100644 --- a/src/views/projectManage/plan/planRecord.vue +++ b/src/views/projectManage/plan/planRecord.vue @@ -1,8 +1,8 @@ <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="planRecordData && planRecordData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ planRecordData.projectName }}</el-header> + <h4 v-show="planRecordData && planRecordData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ planRecordData.projectCode }}</h4> <el-main> <el-card shadow="hover"> <el-row :gutter="20"> @@ -102,7 +102,7 @@ data() { return { // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁 - planInfoData: {}, + planRecordData: {}, // 鏈堝害璁″垝鏁版嵁 monthRecords: [], // 瀛e害璁″垝鏁版嵁 @@ -114,15 +114,13 @@ methods: { // 椤甸潰鍔犺浇 search() { - this.getPlanRecordData(this.planInfoData.id); + this.getPlanRecordData(this.planRecordData.id); }, // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏 getPlanInfoData() { // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁 - if (this.$route.query.data) { - this.planInfoData = JSON.parse(this.$route.query.data); - this.getPlanRecordData(this.planInfoData.id); - } + this.planRecordData = this.$route.query.data + this.getPlanRecordData(this.planRecordData.id); }, // 鑾峰彇椤圭洰璁″垝璁板綍鏁版嵁 getPlanRecordData(id) { @@ -138,7 +136,7 @@ handleAddMonthPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planInfoData.id, + projectInfoId: this.planRecordData.id, planTimeFlag: 0 } // 鍒ゆ柇鏈堝害璁″垝鏄惁涓虹┖ @@ -156,7 +154,7 @@ handleAddSeasonPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planInfoData.id, + projectInfoId: this.planRecordData.id, planTimeFlag: 1 } // 鍒ゆ柇瀛e害璁″垝鏄惁涓虹┖ @@ -174,7 +172,7 @@ handleAddYearPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planInfoData.id, + projectInfoId: this.planRecordData.id, planTimeFlag: 2 } // 鍒ゆ柇骞村害璁″垝鏄惁涓虹┖ @@ -191,10 +189,10 @@ /** 淇敼椤圭洰璁″垝椤� */ handlePlanInfo(row) { this.$router.push({ - name: 'PlanInfo', + path: '/projectManage/planInfo', query: { - data: JSON.stringify(row), - planInfoData: this.planInfoData + data: row, + planRecordData: this.planRecordData } }) }, @@ -209,7 +207,8 @@ this.$router.push({ path: '/projectManage/planInfoCheck', query: { - data: JSON.stringify(row), + data: row, + planRecordData: this.planRecordData } }) } diff --git a/src/views/projectManage/progress/progressRecord.vue b/src/views/projectManage/progress/progressRecord.vue index 422b813..a5445ca 100644 --- a/src/views/projectManage/progress/progressRecord.vue +++ b/src/views/projectManage/progress/progressRecord.vue @@ -161,7 +161,7 @@ <el-input v-model="progressReportData.actualInvest" type="number" /> </el-form-item> <el-form-item label="涓婄骇瀹℃牳锛�" :label-width="formLabelWidth"> - <el-input :value="progressReportData.departmentExamine === 0 ? '鍚屾剰' : '椹冲洖'" disabled /> + <el-input :value="progressReportData.departmentExamine === 0 ? '鍚屾剰' : progressReportData.departmentExamine === 1 ? '椹冲洖' : '鏈鏍�'" disabled /> </el-form-item> <el-form-item label="涓婄骇鎵瑰锛�" :label-width="formLabelWidth"> <el-input v-model="progressReportData.departmentApproval" disabled /> @@ -170,7 +170,7 @@ <el-input type="textarea" v-model="progressReportData.departmentApprovalReply" placeholder="璇疯緭鍏�" rows="3" /> </el-form-item> <el-form-item label="涓荤閮ㄩ棬瀹℃牳锛�" :label-width="formLabelWidth"> - <el-input :value="progressReportData.manageExamine === 0 ? '鍚屾剰' : '椹冲洖'" disabled /> + <el-input :value="progressReportData.manageExamine === 0 ? '鍚屾剰' : progressReportData.manageExamine === 1 ? '椹冲洖' : '鏈鏍�'" disabled /> </el-form-item> <el-form-item label="涓荤閮ㄩ棬瀹℃牳鎵瑰锛�" :label-width="formLabelWidth"> <el-input v-model="progressReportData.manageApproval" disabled /> @@ -180,7 +180,7 @@ </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="dialogFormVisible = false">涓� 鎶�</el-button> + <el-button type="primary" @click="handleRecordSubmit">涓� 鎶�</el-button> <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button> </div> </el-dialog> @@ -191,7 +191,7 @@ </template> <script> -import { getProgressInfoList, getProgressReport } from "@/api/projectManage/progress/index"; +import { getProgressInfoList, getProgressReport, recordSubmit } from "@/api/projectManage/progress/index"; export default { name: "progressRecord", @@ -235,6 +235,14 @@ this.dialogFormVisible = true; getProgressReport(row.id).then(res => { this.progressReportData = res.data; + console.log(this.progressReportData) + }) + }, + // 涓婃姤鎻愪氦 + handleRecordSubmit() { + recordSubmit(this.progressReportData).then(res => { + this.dialogFormVisible = false; + this.$message.success('涓婃姤鎴愬姛'); }) } }, -- Gitblit v1.8.0