| | |
| | | <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">项目代码:{{ 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">项目代码:{{ 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" border stripe style="width: 100%; margin-bottom: 20px"> |
| | | <!-- 表头 --> |
| | |
| | | <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> |
| | |
| | | <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="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" border stripe style="width: 100%; margin-bottom: 20px"> |
| | | <!-- 表头 --> |
| | |
| | | <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> |
| | |
| | | <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" border stripe style="width: 100%; margin-bottom: 20px"> |
| | | <!-- 表头 --> |
| | |
| | | <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> |
| | |
| | | import {addRecord, getPlanRecordList, deletePlanRecord} from "@/api/projectPlan/index"; |
| | | |
| | | export default { |
| | | name: "planRecord", |
| | | // name: "PlanRecord", |
| | | data() { |
| | | return { |
| | | // 接收传递过来的项目计划数据 |
| | | planInfoData: {}, |
| | | projectInfoData: {}, |
| | | // 月度计划数据 |
| | | monthRecords: [], |
| | | // 季度计划数据 |
| | |
| | | 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) { |
| | |
| | | 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; |
| | | } |
| | | // 新增一行记录 |
| | |
| | | handleAddSeasonPlan() { |
| | | let planRecordData = { |
| | | id: undefined, |
| | | projectInfoId: this.planInfoData.id, |
| | | projectInfoId: this.projectInfoData.id, |
| | | planTimeFlag: 1 |
| | | } |
| | | // 判断季度计划是否为空 |
| | | if (this.seasonRecords.length === 0){ |
| | | if (this.seasonRecords.length === 0) { |
| | | planRecordData.id = 0; |
| | | }else { |
| | | } else { |
| | | planRecordData.id = this.seasonRecords[this.seasonRecords.length - 1].id; |
| | | } |
| | | // 新增一行记录 |
| | |
| | | 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; |
| | | } |
| | | // 新增一行记录 |
| | |
| | | }, |
| | | /** 修改项目计划项 */ |
| | | 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) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | // 查看项目计划项 |
| | | 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> |