fuliqi
2024-11-29 d2eaa00bbee1fb2d081a8767d888efe77186cb7e
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 class="header-title">项目名称:{{ planInfoData.projectName }} ({{planInfoData.planTime}} {{ planInfoData.planTimeFlag === 0 ? '月度计划' : planInfoData.planTimeFlag === 1 ? '季度计划' : '年度计划' }})</el-header>
      <h4 style="text-align: center">项目代码:{{ planInfoData.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="planInfoData.planTimeFlag === 0 ? '月度' : planInfoData.planTimeFlag === 1 ? '季度' : '年度' " width="100" align="center">
                  <template #default="scope">
                    <span>{{ planRecordData.planTime }}{{ planRecordData.planTimeFlag === 0 ? '月度' : planRecordData.planTimeFlag === 1 ? '季度' : '年度' }}</span>
                    <span>{{ planInfoData.planTime }}{{ planInfoData.planTimeFlag === 0 ? '月度' : planInfoData.planTimeFlag === 1 ? '季度' : '年度' }}</span>
                  </template>
                </el-table-column>
                <el-table-column fixed="right" label="操作" align="center">
@@ -72,12 +72,12 @@
import { getPlanInfoData, addPlanInfo, savePlanInfo } from "@/api/projectPlan/index";
export default {
  name: "planInfo",
  name: "PlanInfo",
  data() {
    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>