From 4f2952d2f0c569c5be42a709932d2c4dac8c4a8d Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 26 十一月 2024 18:02:37 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/projectPlan/planInfoCheck.vue | 152 ++++++++++++++++++++++++++++++++++++++ src/views/projectPlan/planRecord.vue | 29 +++++- src/api/projectPlan/index.js | 4 src/router/index.js | 11 ++ 4 files changed, 186 insertions(+), 10 deletions(-) diff --git a/src/api/projectPlan/index.js b/src/api/projectPlan/index.js index 05105a6..7ff6872 100644 --- a/src/api/projectPlan/index.js +++ b/src/api/projectPlan/index.js @@ -44,9 +44,9 @@ } // 鍒犻櫎椤圭洰璁″垝璁板綍 -export function delRecord(id) { +export function deletePlanRecord(id) { return request({ - url: '/plan/record/' + id, + url: '/api/project-plan-record/' + id, method: 'delete' }) } diff --git a/src/router/index.js b/src/router/index.js index 8335f76..789c581 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -196,12 +196,19 @@ name: 'PlanRecord', meta: { title: '椤圭洰璁″垝璁板綍' } }, - /** 椤圭洰璁″垝椤� */ + /** 缂栬緫椤圭洰璁″垝椤� */ { path: '/projectPlan/planInfo', component: () => import('@/views/projectPlan/planInfo'), name: 'PlanInfo', - meta: { title: '椤圭洰璁″垝椤�' } + meta: { title: '缂栬緫椤圭洰璁″垝椤�' } + }, + /** 鏌ョ湅椤圭洰璁″垝椤� */ + { + path: '/projectPlan/planInfoCheck', + component: () => import('@/views/projectPlan/planInfoCheck'), + name: 'PlanInfoCheck', + meta: { title: '鏌ョ湅椤圭洰璁″垝椤�' } } ] }, diff --git a/src/views/projectPlan/planInfoCheck.vue b/src/views/projectPlan/planInfoCheck.vue new file mode 100644 index 0000000..4121112 --- /dev/null +++ b/src/views/projectPlan/planInfoCheck.vue @@ -0,0 +1,152 @@ +<template> + <div class="app-container"> + <el-container> + <el-header v-show="planRecordData && planRecordData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ planRecordData.projectName }} {{ planRecordData.planTimeFlag === 0 ? '(鏈堝害璁″垝)' : planRecordData.planTimeFlag === 1 ? '(瀛e害璁″垝)' : '(骞村害璁″垝)' }}</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"> + <el-col :span="24" class="mb-4"> + <el-table :data="tableData" border stripe style="width: 100%; margin-bottom: 20px"> + <el-table-column prop="index" label="搴忓彿" width="50" align="center"> + <template #default="scope"> + {{ scope.$index + 1 }} + </template> + </el-table-column> + <el-table-column prop="taskName" label="浜嬮」鍚嶇О" width="500" align="center"> + <template #default="scope"> + <el-input type="textarea" v-model="scope.row.title" placeholder="璇疯緭鍏�" rows="3" /> + </template> + </el-table-column> + <el-table-column prop="startTime" label="璁″垝寮�濮嬫椂闂�" width="160" align="center"> + <template #default="scope"> + <el-date-picker v-model="scope.row.startTime" type="date" placeholder="閫夋嫨鏃ユ湡" size="small" style="width: 130px" /> + </template> + </el-table-column> + <el-table-column prop="endTime" label="璁″垝瀹屾垚鏃堕棿" width="160" align="center"> + <template #default="scope"> + <el-date-picker v-model="scope.row.endTime" type="date" placeholder="閫夋嫨鏃ユ湡" size="small" style="width: 130px" /> + </template> + </el-table-column> + <el-table-column :label="planRecordData.planTimeFlag === 0 ? '鏈堝害' : planRecordData.planTimeFlag === 1 ? '瀛e害' : '骞村害' " width="100" align="center"> + <template #default="scope"> + <span>{{ planRecordData.planTime }}{{ planRecordData.planTimeFlag === 0 ? '鏈堝害' : planRecordData.planTimeFlag === 1 ? '瀛e害' : '骞村害' }}</span> + </template> + </el-table-column> + <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> + <el-button size="small" type="danger" @click="handleDelete(scope.$index)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + <div style="display: flex; align-items: center;"> + <h1 style="margin: 0;"> + 鎴鏈鍒掕繘搴﹀畬鎴愭姇璧勶紙涓囧厓锛夛細 + </h1> + <el-input + placeholder="璇疯緭鍏ユ姇璧勯噾棰�" + style="flex: 1" + v-model="actualInvest" + clearable + :type="number" + @input="handleInput"> + </el-input> + </div> + </el-col> + </el-row> + </el-card> + </el-main> + </el-container> + </div> +</template> + +<script> +import { getPlanInfoData, addPlanInfo, savePlanInfo } from "@/api/projectPlan/index"; + +export default { + name: "planInfoCheck", + data() { + return { + loading: true, + // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁 + planRecordData: {}, + planInfoData: {}, + tableData: [ + { + title: '', + startTime: '', + endTime: '' + }, + ], + // 鎶曡祫閲戦 + actualInvest: '', + // 鏂板鍙傛暟 + addData: { + projectPlanRecordId: '', + actualInvest: '', + addList:[] + } + } + }, + + methods: { + // 椤甸潰鍔犺浇 + search() { + this.getPlanInfoData(this.planRecordData.id); + }, + // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏 + getPlanRecordData() { + // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁 + if (this.$route.query.data) { + this.planRecordData = JSON.parse(this.$route.query.data) + } + this.planInfoData = this.$route.query.planInfoData + this.search(); + }, + // 鑾峰彇椤圭洰璁″垝椤� + getPlanInfoData(id) { + getPlanInfoData(id).then(response => { + this.actualInvest = response.data.actualInvest; + if (response.data.list.length === 0){ + this.tableData = [{ title: '', startTime: '', endTime: '' }]; + }else { + this.tableData = response.data.list; + } + }); + }, + // 鍒犻櫎涓�琛屾暟鎹� + handleDelete(index) { + this.tableData.splice(index, 1); + }, + // 閲嶇疆褰撳墠琛屾暟鎹� + handleReset(index) { + this.tableData[index].title = ''; + this.tableData[index].startTime = ''; + this.tableData[index].endTime = ''; + }, + /** 杩斿洖椤圭洰璁″垝璁板綍椤甸潰 */ + handlePlanRecord(planInfoData) { + this.$router.push({ + path: '/projectPlan/planRecord', + query: { + data: JSON.stringify(planInfoData) + } + }) + } + }, + created() { + this.getPlanRecordData(); + }, +}; +</script> + +<style scoped> +.header-title { + font-size: 24px; /* 鏍规嵁闇�瑕佽皟鏁村瓧浣撳ぇ灏� */ + text-align: center; /* 灞呬腑瀵归綈 */ + line-height: 64px; /* 濡傛灉闇�瑕佷笌 header 楂樺害瀵归綈 */ +} +</style> + diff --git a/src/views/projectPlan/planRecord.vue b/src/views/projectPlan/planRecord.vue index a3ddfbe..3f4c1da 100644 --- a/src/views/projectPlan/planRecord.vue +++ b/src/views/projectPlan/planRecord.vue @@ -25,7 +25,8 @@ <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">鍒犻櫎</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> </template> </el-table-column> </el-table> @@ -49,7 +50,8 @@ <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">鍒犻櫎</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> </template> </el-table-column> </el-table> @@ -73,7 +75,8 @@ <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">鍒犻櫎</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> </template> </el-table-column> </el-table> @@ -86,7 +89,7 @@ </template> <script> -import {addRecord, getPlanRecordList} from "@/api/projectPlan/index"; +import {addRecord, getPlanRecordList, deletePlanRecord} from "@/api/projectPlan/index"; export default { name: "planRecord", @@ -179,7 +182,7 @@ this.search(); }); }, - /** 鏌ョ湅椤圭洰璁″垝椤� */ + /** 淇敼椤圭洰璁″垝椤� */ handlePlanInfo(row) { this.$router.push({ path: '/projectPlan/planInfo', @@ -188,8 +191,22 @@ planInfoData: this.planInfoData } }) + }, + // 鍒犻櫎椤圭洰璁″垝璁板綍 + handleDeletePlanRecord(id) { + deletePlanRecord(id).then(res => { + this.search(); + }); + }, + // 鏌ョ湅椤圭洰璁″垝椤� + handleCheckPlanInfo(row) { + this.$router.push({ + path: '/projectPlan/planInfoCheck', + query: { + data: JSON.stringify(row), + } + }) } - }, created() { this.getPlanInfoData(); -- Gitblit v1.8.0