fuliqi
2024-11-28 0417817fd8c7b5b79efd721da77f70217cda0201
src/views/projectManage/plan/planInfo.vue
@@ -7,6 +7,7 @@
        <el-card shadow="hover">
          <el-row :gutter="20">
            <el-col :span="24" class="mb-4">
              <el-button type="primary" size="small" @click="handlePlanRecord" style="float: right; margin-bottom: 10px; margin-left: 10px">返回</el-button>
              <el-button type="primary" size="small" @click="handleAdd" style="float: right; margin-bottom: 10px">新增</el-button>
              <el-table :data="tableData" border stripe style="width: 100%; margin-bottom: 20px">
                <el-table-column prop="index" label="序号" width="50" align="center">
@@ -99,15 +100,13 @@
  methods: {
    // 页面加载
    search() {
      this.getPlanInfoData(this.planRecordData.id);
      this.getPlanInfoData(this.planInfoData.id);
    },
    // 获取传递过来的项目计划详情
    getPlanRecordData() {
      // 从查询参数中获取数据
      if (this.$route.query.data) {
        this.planRecordData = JSON.parse(this.$route.query.data)
      }
      this.planInfoData = this.$route.query.planInfoData
      this.planRecordData = this.$route.query.planRecordData
      this.planInfoData = this.$route.query.data
      this.search();
    },
    // 获取项目计划项
@@ -134,12 +133,12 @@
      // 遍历tableData,获得值不为空字符串的行
      const validList = this.tableData.filter(item => item.title !== '' || item.startTime !== '' || item.endTime !== '');
      this.addData = {
        projectPlanRecordId: this.planRecordData.id,
        projectPlanRecordId: this.planInfoData.id,
        actualInvest: this.actualInvest,
        addList: validList
      }
      addPlanInfo(this.addData).then(response => {
        this.handlePlanRecord(this.planInfoData)
        this.handlePlanRecord()
      })
    },
    // 重置当前行数据
@@ -167,11 +166,11 @@
      });
    },
    /** 返回项目计划记录 */
    handlePlanRecord(planInfoData) {
    handlePlanRecord() {
      this.$router.push({
        name: '/projectManage/planRecord',
        path: '/projectManage/planRecord',
        query: {
          data: JSON.stringify(planInfoData)
          data: this.planRecordData
        }
      })
    }