From 2fefc3c07619a513fe82144ea1f8d75c068bcb9e Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 17 十一月 2023 16:07:49 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before

---
 src/views/basic/location/location-form.vue |   60 +++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/src/views/basic/location/location-form.vue b/src/views/basic/location/location-form.vue
index c2591bf..8871e84 100644
--- a/src/views/basic/location/location-form.vue
+++ b/src/views/basic/location/location-form.vue
@@ -135,11 +135,10 @@
       <el-row>
         <el-col :span="12">
           <el-form-item
-            v-if="permissions.basic_has_ifs"
             label="IFS搴撲綅"
             prop="ifsLocationDesc"
           >
-            <!--<el-select
+            <!-- <el-select
               v-model="dataForm.ifsLocation"
               filterable
               placeholder="璇烽�夋嫨IFS搴撲綅"
@@ -152,11 +151,11 @@
                 :key="index"
               >
               </el-option>
-            </el-select>-->
+            </el-select> -->
             <el-cascader
               v-model="dataForm.ifsLocationDesc"
               :props="locationProps"
-              style="width:100%"
+              style="width:100%" filterable
             ></el-cascader>
           </el-form-item>
         </el-col>
@@ -219,6 +218,7 @@
       warehouseOptions: [],
       factoryOptions: [],
       ifsLocationOptions: [],
+			locationTree: [],
       visible: false,
       dataForm: {
         id: 0,
@@ -262,34 +262,39 @@
       locationProps: {
         lazy: true,
         lazyLoad(node, resolve) {
-          console.log('node', node)
           const { level } = node
           if (level === 0) {
             getIfsLocationGroup().then((response) => {
               if (response.data.code === 0) {
                 const _data = response.data.data
-
-                const nodes = _data.map((item) => {
+                const nodes = JSON.parse(_data)["LIST_INFO"].map((item) => {
                   return {
-                    value: item.LOCATION_GROUP,
-                    label: item.LOCATION_GROUP,
+                    value: item.LOCATION_GROUP_DESC +'-'+ item.LOCATION_GROUP,
+                    label: item.LOCATION_GROUP_DESC +'-'+ item.LOCATION_GROUP,
                     leaf: false
                   }
                 })
+								var set = new Set()
+								nodes.forEach(a=>{
+									set.add(JSON.stringify(a))
+								})
+								var list = []
+								set.forEach(a=>{
+									list.push(JSON.parse(a))
+								})
                 // 閫氳繃璋冪敤resolve灏嗗瓙鑺傜偣鏁版嵁杩斿洖锛岄�氱煡缁勪欢鏁版嵁鍔犺浇瀹屾垚
-                resolve(nodes)
+                resolve(list)
               }
             })
           } else {
-            getIfsLocationByGroup({ locationGroup: node.value }).then(
+            getIfsLocationByGroup({ locationNo: node.value.split('-')[1] }).then(
               (response) => {
                 if (response.data.code === 0) {
                   const _data = response.data.data
-
-                  const nodes = _data.map((item) => {
+                  const nodes = JSON.parse(_data)["LIST_INFO"].map((item) => {
                     return {
                       value: item.LOCATION_NO,
-                      label: item.LOCATION_NO,
+                      label: item.LOCATION_DESC +' | '+ item.LOCATION_NO,
                       leaf: true
                     }
                   })
@@ -404,7 +409,32 @@
           this.isSubmit = false
         }
       })
-    }
+    },
+		getLocationTree(){
+			getIfsLocationGroup().then((res) => {
+			  if (res.data.code === 0) {
+					var strs = JSON.parse(res.data.data)['LIST_INFO']
+					var set3 = new Set()
+					var set2 = new Set()
+					var set = []
+					strs.forEach(a=>{
+						set2.add(a['LOCATION_GROUP_DESC'] + '-' + a['LOCATION_GROUP'])
+					})
+					strs.forEach(a=>{
+						set2.forEach(b=>{
+							if((a['LOCATION_GROUP_DESC'] + '-' + a['LOCATION_GROUP'])==b){
+								set3.add(a['LOCATION_DESC'] + '-' + a['LOCATION_NO'])
+							}
+							set.push({
+								value: b,
+								label: b,
+								children: []
+							})
+						})
+					})
+			  }
+			})
+		}
   }
 }
 </script>

--
Gitblit v1.9.3