luohairen
2024-11-28 46e29a50eccda9f92fb2feeb18fa8a0ea4092587
页面传参bug
5个文件已修改
108 ■■■■ 已修改文件
src/api/projectPlan/index.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManage/plan/planInfo.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManage/plan/planInfoCheck.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManage/plan/planRecord.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManage/progress/progressRecord.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/projectPlan/index.js
@@ -9,6 +9,14 @@
  })
}
// 获取主管标识
export function getManagerFlag(recordId) {
  return request({
    url: '/project/info/getManagerFlag/'+ recordId,
    method: 'get'
  })
}
// 查询计划记录列表
export function getPlanRecordList(id) {
  return request({
@@ -17,28 +25,11 @@
  })
}
// 查询项目计划记录详细
export function getRecord(id) {
  return request({
    url: '/plan/record/' + id,
    method: 'get'
  })
}
// 新增项目计划记录
export function addRecord(data) {
  return request({
    url: '/api/project-plan-record',
    method: 'post',
    data: data
  })
}
// 修改项目计划记录
export function updateRecord(data) {
  return request({
    url: '/plan/record',
    method: 'put',
    data: data
  })
}
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>
src/views/projectManage/plan/planInfoCheck.vue
@@ -144,7 +144,7 @@
      loading: true,
      // 接收传递过来的项目计划数据
      planRecordData: {},
      planInfoData: {},
      projectInfoData: {},
      // 计划项数据
      tableData: [
        {
@@ -179,7 +179,7 @@
    getPlanRecordData() {
      // 从查询参数中获取数据
      this.planRecordData = this.$route.query.data
      this.planInfoData = this.$route.query.planInfoData
      this.projectInfoData = this.$route.query.projectInfoData
      this.search();
    },
    // 获取项目计划项
@@ -231,7 +231,7 @@
      this.$router.push({
        path: '/projectManage/planRecord',
        query: {
          data: this.planRecordData
          data: this.projectInfoData
        }
      })
    }
src/views/projectManage/plan/planRecord.vue
@@ -1,8 +1,8 @@
<template>
  <div class="app-container">
    <el-container>
      <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-header v-show="projectInfoData && projectInfoData.projectName" class="header-title">项目名称:{{ projectInfoData.projectName }}</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">
@@ -102,7 +102,7 @@
  data() {
    return {
      // 接收传递过来的项目计划数据
      planRecordData: {},
      projectInfoData: {},
      // 月度计划数据
      monthRecords: [],
      // 季度计划数据
@@ -114,13 +114,13 @@
  methods: {
    // 页面加载
    search() {
      this.getPlanRecordData(this.planRecordData.id);
      this.getPlanRecordData(this.projectInfoData.id);
    },
    // 获取传递过来的项目计划详情
    getPlanInfoData() {
    getProjectInfoData() {
      // 从查询参数中获取数据
      this.planRecordData = this.$route.query.data
      this.getPlanRecordData(this.planRecordData.id);
      this.projectInfoData = this.$route.query.data
      this.getPlanRecordData(this.projectInfoData.id);
    },
    // 获取项目计划记录数据
    getPlanRecordData(id) {
@@ -136,13 +136,13 @@
    handleAddMonthPlan() {
      let planRecordData = {
        id: undefined,
        projectInfoId: this.planRecordData.id,
        projectInfoId: this.projectInfoData.id,
        planTimeFlag: 0
      }
      // 判断月度计划是否为空
      if (this.monthRecords.length === 0){
      if (this.monthRecords.length === 0) {
        planRecordData.id = 0;
      }else {
      } else {
        planRecordData.id = this.monthRecords[this.monthRecords.length - 1].id;
      }
      // 新增一行记录
@@ -154,13 +154,13 @@
    handleAddSeasonPlan() {
      let planRecordData = {
        id: undefined,
        projectInfoId: this.planRecordData.id,
        projectInfoId: this.projectInfoData.id,
        planTimeFlag: 1
      }
      // 判断季度计划是否为空
      if (this.seasonRecords.length === 0){
      if (this.seasonRecords.length === 0) {
        planRecordData.id = 0;
      }else {
      } else {
        planRecordData.id = this.seasonRecords[this.seasonRecords.length - 1].id;
      }
      // 新增一行记录
@@ -172,13 +172,13 @@
    handleAddYearPlan() {
      let planRecordData = {
        id: undefined,
        projectInfoId: this.planRecordData.id,
        projectInfoId: this.projectInfoData.id,
        planTimeFlag: 2
      }
      // 判断年度计划是否为空
      if (this.yearRecords.length === 0){
      if (this.yearRecords.length === 0) {
        planRecordData.id = 0;
      }else {
      } else {
        planRecordData.id = this.yearRecords[this.yearRecords.length - 1].id;
      }
      // 新增一行记录
@@ -192,7 +192,7 @@
        path: '/projectManage/planInfo',
        query: {
          data: row,
          planRecordData: this.planRecordData
          projectInfoData: this.projectInfoData
        }
      })
    },
@@ -204,17 +204,18 @@
    },
    // 查看项目计划项
    handleCheckPlanInfo(row) {
      console.log(this.projectInfoData);
      this.$router.push({
        path: '/projectManage/planInfoCheck',
        query: {
          data: row,
          planRecordData: this.planRecordData
          projectInfoData: this.projectInfoData
        }
      })
    }
  },
  created() {
    this.getPlanInfoData();
    this.getProjectInfoData();
  },
};
</script>
src/views/projectManage/progress/progressRecord.vue
@@ -1,8 +1,8 @@
<template>
  <div class="app-container">
    <el-container>
      <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-header v-show="projectInfoData && projectInfoData.projectName" class="header-title">项目名称:{{ projectInfoData.projectName }}</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">
@@ -189,7 +189,7 @@
  data() {
    return {
      // 接收传递过来的项目计划数据
      planRecordData: {},
      projectInfoData: {},
      monthProgress: [],
      seasonProgress: [],
      yearProgress: [],
@@ -215,15 +215,15 @@
  },
  methods: {
    search() {
      this.getPlanRecordData()
      this.getProjectProgressForm(this.planRecordData.id);
      this.getProjectInfoData()
      this.getProjectProgressForm(this.projectInfoData.id);
    },
    // 获取传递过来的项目计划详情
    getPlanRecordData() {
    getProjectInfoData() {
      // 从查询参数中获取数据
      if (this.$route.query.data) {
        this.planRecordData = JSON.parse(this.$route.query.data);
        this.getProgressInfoList(this.planRecordData.id);
        this.projectInfoData = JSON.parse(this.$route.query.data);
        this.getProgressInfoList(this.projectInfoData.id);
      }
    },
    getProjectProgressForm(id) {
@@ -269,7 +269,7 @@
    },
    // 保存
    handleSave() {
      this.projectProgressForm.projectReportId = this.planRecordData.id;
      this.projectProgressForm.projectReportId = this.projectInfoData.id;
      // 判断文件不为空
        saveProjectProgressFileLists(this.projectProgressForm).then(res => {
          this.$message.success('保存成功');