luohairen
2024-11-28 46e29a50eccda9f92fb2feeb18fa8a0ea4092587
src/views/projectManage/plan/planInfo.vue
@@ -1,8 +1,8 @@
<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 ? '(季度计划)' : '(年度计划)' }}</el-header>
      <h4 v-show="planRecordData && planRecordData.projectCode" style="text-align: center">项目代码:{{ planRecordData.projectCode }}</h4>
      <el-header v-show="projectInfoData && projectInfoData.projectName" class="header-title">项目名称:{{ projectInfoData.projectName }} {{ projectInfoData.planTimeFlag === 0 ? '(月度计划)' : projectInfoData.planTimeFlag === 1 ? '(季度计划)' : '(年度计划)' }}</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">
@@ -30,9 +30,9 @@
                    <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 ? '季度' : '年度' " width="100" align="center">
                <el-table-column :label="projectInfoData.planTimeFlag === 0 ? '月度' : projectInfoData.planTimeFlag === 1 ? '季度' : '年度' " width="100" align="center">
                  <template #default="scope">
                    <span>{{ planRecordData.planTime }}{{ planRecordData.planTimeFlag === 0 ? '月度' : planRecordData.planTimeFlag === 1 ? '季度' : '年度' }}</span>
                    <span>{{ projectInfoData.planTime }}{{ projectInfoData.planTimeFlag === 0 ? '月度' : projectInfoData.planTimeFlag === 1 ? '季度' : '年度' }}</span>
                  </template>
                </el-table-column>
                <el-table-column fixed="right" label="操作" align="center">
@@ -77,7 +77,7 @@
    return {
      loading: true,
      // 接收传递过来的项目计划数据
      planRecordData: {},
      projectInfoData: {},
      planInfoData: {},
      tableData: [
        {
@@ -103,9 +103,9 @@
      this.getPlanInfoData(this.planInfoData.id);
    },
    // 获取传递过来的项目计划详情
    getPlanRecordData() {
    getProjectInfoData() {
      // 从查询参数中获取数据
      this.planRecordData = this.$route.query.planRecordData
      this.projectInfoData = this.$route.query.projectInfoData
      this.planInfoData = this.$route.query.data
      this.search();
    },
@@ -159,7 +159,7 @@
    },
    // 保存当前行数据
    handleSave(index) {
      this.tableData[index].projectPlanRecordId = this.planRecordData.id;
      this.tableData[index].projectPlanRecordId = this.projectInfoData.id;
      savePlanInfo(this.tableData[index]).then(response => {
        this.search();
        this.$message.success('保存成功');
@@ -170,13 +170,13 @@
      this.$router.push({
        path: '/projectManage/planRecord',
        query: {
          data: this.planRecordData
          data: this.projectInfoData
        }
      })
    }
  },
  created() {
    this.getPlanRecordData();
    this.getProjectInfoData();
  },
};
</script>