fuliqi
2024-11-28 0417817fd8c7b5b79efd721da77f70217cda0201
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">项目代码:{{ 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">项目代码:{{ planRecordData.projectCode }}</h4>
      <el-main>
        <el-card shadow="hover">
          <el-row :gutter="20">
@@ -11,11 +11,11 @@
                <span style="font-size: 20px; font-weight: bold;">月度计划</span>
                <el-button type="primary" size="small" style="float: right" @click="handleAddMonthPlan">新增</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="项目代码" 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="项目代码" align="center" />
                <el-table-column label="计划期" align="center">
                  <template slot-scope="scope">
                    <span>
@@ -23,7 +23,7 @@
                    </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>
@@ -38,11 +38,11 @@
                <span style="font-size: 20px; font-weight: bold;">季度计划</span>
                <el-button type="primary" size="small" style="float: right" @click="handleAddSeasonPlan">新增</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="项目代码" 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="项目代码" align="center" />
                <el-table-column label="计划期" align="center">
                  <template slot-scope="scope">
                    <span>
@@ -50,7 +50,7 @@
                    </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>
@@ -65,11 +65,11 @@
                <span style="font-size: 20px; font-weight: bold;">年度计划</span>
                <el-button type="primary" size="small" style="float: right" @click="handleAddYearPlan">新增</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="项目代码" 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="项目代码" align="center" />
                <el-table-column label="计划期" align="center">
                  <template slot-scope="scope">
                    <span>
@@ -77,7 +77,7 @@
                    </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>
@@ -102,7 +102,7 @@
  data() {
    return {
      // 接收传递过来的项目计划数据
      planInfoData: {},
      planRecordData: {},
      // 月度计划数据
      monthRecords: [],
      // 季度计划数据
@@ -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
      }
      // 判断季度计划是否为空
@@ -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
        }
      })
    }