xiangpei
2025-02-19 eac6b7989a6cbb9d09b20a1c46f51bb68d9f5ae7
src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
@@ -71,7 +71,7 @@
        </el-col>
        <el-col :span="6">
          <el-form-item label="项目状态" label-width="100px" prop="projectstatus" style="width: 100%">
            <el-select v-model="projectForm.projectStatus" clearable placeholder="请选择" style="width: 100%">
            <el-select v-model="projectForm.projectStatus" clearable placeholder="请选择" @change="handleProjectStatusChange" style="width: 100%">
              <el-option v-for="item in dict.type.sys_project_status" :key="item.value" :label="item.label"
                         :value="item.value"/>
            </el-select>
@@ -269,6 +269,19 @@
            <span style="margin-left: 2px">元</span>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="建设性质" label-width="100px" prop="constructionNature" style="width: 100%; min-width: 260px">
            <el-select
              v-model="projectForm.constructionNature"
              clearable
              placeholder="请选择"
              style="width: 100%"
            >
              <el-option v-for="item in dict.type.construction_nature" :key="item.value" :label="item.label"
                         :value="item.value"/>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="0">
        <el-col :span="18">
@@ -324,7 +337,7 @@
export default {
  name: 'BasicInfo',
  dicts: ['sys_funding_type', 'sys_investment_type', 'sys_project_type', 'sys_project_status', 'sys_competent_department'
    , 'sys_administrative_divisions', 'sys_centralized_management', 'sys_approval_type', 'sys_key_categories', 'sys_annual_plan'],
    , 'sys_administrative_divisions', 'sys_centralized_management', 'sys_approval_type', 'sys_key_categories', 'sys_annual_plan', 'construction_nature'],
  components: {
    Map,
    TagList,
@@ -348,7 +361,7 @@
        projectName: '',
        projectCode: '',
        projectType: '',
        projectStatus: 'working',
        projectStatus: 'pendding',
        fundType: '',
        investType: '',
        importanceType: '',
@@ -373,6 +386,7 @@
        projectAddress: '',
        engineeringIdList: [],
        content: '',
        constructionNature: '',
        contact: '',
        projectOwnerUnit: null,
        planStartTime: '',
@@ -384,6 +398,7 @@
        yearInvestAmount: '',
        competentDepartmentList: [],
        managementCentralizationList: [],
        remark: ''
      },
      subclass: '',
      largeCategory: '',
@@ -437,6 +452,16 @@
    localStorage.setItem("projectForm", JSON.stringify(this.projectForm));
  },
  methods: {
    handleProjectStatusChange(value) {
      // 根据选中的 projectStatus 修改 anotherField 的值
      if (value === 'working' || value === 'stop') {
        this.projectForm.projectPhase = '实施阶段';
      } else if (value === 'finish') {
        this.projectForm.projectPhase = '竣工投用阶段';
      } else if (value === 'pendding') {
        this.projectForm.projectPhase = '储备规划阶段';
      }
    },
    getProjectInfo(id) {
      getProject(id).then(res => {
        this.projectForm = res.data;