From 6cf7ea7aa09553b9fe148f94ec6158dbb2b2c9bc Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 08 四月 2025 18:22:19 +0800
Subject: [PATCH] v-show

---
 src/views/projectEngineering/projectLibrary/component/legalPerson.vue |   89 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 76 insertions(+), 13 deletions(-)

diff --git a/src/views/projectEngineering/projectLibrary/component/legalPerson.vue b/src/views/projectEngineering/projectLibrary/component/legalPerson.vue
index e45c2c6..72aa0c8 100644
--- a/src/views/projectEngineering/projectLibrary/component/legalPerson.vue
+++ b/src/views/projectEngineering/projectLibrary/component/legalPerson.vue
@@ -2,17 +2,37 @@
   <div class="basic-info">
     <el-form ref="demoFormRef" :disabled="disabled" :model="legalPersonForm" class="dialog_form">
       <el-row :gutter="20">
-        <el-col :span="6">
-          <el-form-item label="椤圭洰鎬绘姇棰�" label-width="120px" prop="investmentType" style="width: 100%">
-            <el-input v-model="legalPersonForm.totalInvestment" class="item" clearable maxlength="255"
-                      placeholder="璇疯緭鍏�"/>
+<!--        <el-col :span="6">-->
+<!--          <el-form-item label="椤圭洰鎬绘姇棰�" label-width="120px" prop="investmentType" style="width: 100%">-->
+<!--            <el-input v-model="legalPersonForm.totalInvestment" class="item" clearable maxlength="255" style="width: 90%"-->
+<!--                      placeholder="璇疯緭鍏�"/>-->
+<!--            <span class="money">涓囧厓</span>-->
+<!--          </el-form-item>-->
+<!--        </el-col>-->
+        <el-col :span="12">
+          <el-form-item label="椤圭洰鍗曚綅" label-width="120px" prop="investmentType"
+                        >
+            <el-select
+              v-model="legalPersonForm.projectUnit"
+              filterable
+              placeholder="璇烽�夋嫨鎴栬緭鍏�"
+              style="width: 100%;"
+              @change="handleSelectChange"
+              remote
+              :remote-method="handleBlur"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.id"
+                :label="item.projectUnit"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="6">
-          <el-form-item label="椤圭洰鍗曚綅" label-width="120px" prop="investmentType" style="width: 100%">
-            <el-input v-model="legalPersonForm.projectUnit" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/>
-          </el-form-item>
-        </el-col>
+
+
         <el-col :span="6">
           <el-form-item label="椤圭洰鍗曚綅绫诲瀷" label-width="120px" prop="projectType" style="width: 100%">
             <el-select
@@ -162,7 +182,8 @@
 import {
   addProjectUnitRegistrationInfo,
   editProjectUnitRegistrationInfo,
-  getProjectUnitRegistrationInfoById
+  getProjectUnitRegistrationInfoById,
+  getUnitRegistrationInfoByName
 } from "@/api/projectEngineering/projectUnitRegistrationInfo";
 
 export default {
@@ -177,11 +198,15 @@
   },
   data() {
     return {
+      //椤圭洰鍗曚綅閫夋嫨妗�
+      selectProjectUnit:'',
       projectForm: {},
+      //鍗曚綅娉曚汉淇℃伅
+      options:[],
       legalPersonForm: {
         // id: '',
         // totalInvestment: '',
-        // projectUnit: '',
+        projectUnit: '',
         // projectUnitType: '',
         // registrationType: '',
         // holdingSituation: '',
@@ -221,11 +246,34 @@
     }
 
     this.legalPersonForm.projectId = this.projectForm.id;
+
   },
   beforeDestroy() {
     if(Object.keys(this.legalPersonForm).length !==0)  localStorage.setItem("legalPersonForm", JSON.stringify(this.legalPersonForm));
   },
   methods: {
+
+    handleSelectChange(row) {
+      if (this.options !== null) {
+        this.options.forEach(item => {
+          if (item.id === row) {
+            this.legalPersonForm = item;
+            this.legalPersonForm.id = null;
+          }
+        })
+      }
+
+    },
+    //椤圭洰鍗曚綅杈撳叆鏃惰Е鍙�
+    handleBlur(query){
+
+      this.legalPersonForm.projectUnit = query;
+      if (this.legalPersonForm.projectUnit !== null && this.legalPersonForm.projectUnit !== '' && this.legalPersonForm.projectUnit !== undefined){
+        getUnitRegistrationInfoByName(this.legalPersonForm).then(res =>{
+          this.options = res.data;
+        })
+      }
+    },
     getProjectUnitRegistrationInfo() {
       getProjectUnitRegistrationInfoById(this.$route.query.projectId).then(res => {
         this.legalPersonForm = res.data;
@@ -254,12 +302,23 @@
     },
   },
   watch: {
+    'legalPersonForm.projectUnit':{
+      deep:true,
+      handler(newVal) {
+        if (newVal === null || newVal === ''){
+          this.options = null;
+        }
+      }
+    },
     legalPersonForm: {
       deep: true,
       handler(newVal) {
         this.$emit('legalPersonForm', newVal)
       }
-    }
+    },
+
+
+
   }
 }
 </script>
@@ -277,7 +336,11 @@
     width: 100%;
   }
 }
-
+.money {
+  font-size: 12px;
+  margin-left: 2px;
+  color: #909399;
+}
 .map-btn {
   width: 32px;
   height: 32px;

--
Gitblit v1.8.0