luohairen
2024-11-29 acf78f6ef785df7f5fa15d1ee0fc62c0bbbe74f6
src/views/projectManage/plan/planRecord.vue
@@ -9,7 +9,7 @@
            <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="primary" size="small" style="float: right" @click="handleAddMonthPlan" v-show="!projectInfoData.managerFlag">新增</el-button>
              </div>
              <el-table :data="monthRecords" border stripe style="width: 100%; margin-bottom: 20px">
                <!-- 表头 -->
@@ -26,9 +26,14 @@
                <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="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>
                    <div v-show="projectInfoData.managerFlag">
                      <el-button type="primary" size="small" v-show="scope.row.reportStatus === 0" @click="handleCheckPlanInfo(scope.row)">查看</el-button>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
@@ -36,7 +41,7 @@
            <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="primary" size="small" style="float: right" @click="handleAddSeasonPlan" v-show="!projectInfoData.managerFlag">查看</el-button>
              </div>
              <el-table  :data="seasonRecords" border stripe style="width: 100%; margin-bottom: 20px">
                <!-- 表头 -->
@@ -53,9 +58,14 @@
                <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="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>
                    <div v-show="projectInfoData.managerFlag">
                      <el-button type="primary" size="small" v-show="scope.row.reportStatus === 0" @click="handleCheckPlanInfo(scope.row)">查看</el-button>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
@@ -63,7 +73,7 @@
            <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="primary" size="small" style="float: right" @click="handleAddYearPlan" v-show="!projectInfoData.managerFlag">新增</el-button>
              </div>
              <el-table  :data="yearRecords" border stripe style="width: 100%; margin-bottom: 20px">
                <!-- 表头 -->
@@ -80,9 +90,14 @@
                <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="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>
                    <div v-show="projectInfoData.managerFlag">
                      <el-button type="primary" size="small" v-show="scope.row.reportStatus === 0" @click="handleCheckPlanInfo(scope.row)">查看</el-button>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
@@ -98,7 +113,7 @@
import {addRecord, getPlanRecordList, deletePlanRecord} from "@/api/projectPlan/index";
export default {
  name: "planRecord",
  name: "PlanRecord",
  data() {
    return {
      // 接收传递过来的项目计划数据
@@ -115,12 +130,13 @@
    // 页面加载
    search() {
      this.getPlanRecordData(this.projectInfoData.id);
      console.log(this.projectInfoData);
    },
    // 获取传递过来的项目计划详情
    getProjectInfoData() {
      // 从查询参数中获取数据
      this.projectInfoData = this.$route.query.data
      this.getPlanRecordData(this.projectInfoData.id);
      this.search();
    },
    // 获取项目计划记录数据
    getPlanRecordData(id) {