From fcee18b67c96548efd4db46c76ddbeb59445030d Mon Sep 17 00:00:00 2001
From: lty <1179749281@qq.com>
Date: Tue, 14 Feb 2023 11:29:55 +0800
Subject: [PATCH] update

---
 ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------
 1 file changed, 116 insertions(+), 61 deletions(-)

diff --git a/ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue b/ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
index 57d9409..06dda48 100644
--- a/ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
+++ b/ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
@@ -5,10 +5,20 @@
         <form id="container-form">
           <div class="select-list">
             <ul id="select_info">
+
               <li>
-                <select id="zoneCode" name="zoneCode" style="width: 100px">
-                  <option selected>A</option>
-                </select>
+              货主
+                <a-select
+                  show-search
+                  placeholder="请选择库位类型"
+                  option-filter-prop="children"
+                  v-model="zoneCode"
+                  style="width: 200px">
+                  <a-select-option selected="0" id="zoneCode" v-for="item in locationTypeList" :key="item.name" :value="item.code">{{
+                    item.name
+                    }}
+                  </a-select-option>
+                </a-select>
               </li>
               <li>
                 第
@@ -23,7 +33,7 @@
                 </select>
               </li>
               <li>
-                <a-button type="primary" @click="Search()" icon="search">查询</a-button>
+                  <a-button type="primary" @click="Search()" icon="search">查询</a-button>
               </li>
             </ul>
           </div>
@@ -81,15 +91,20 @@
           </div>
         </form>
       </div>
+
       <div class="col-sm-12 select-info">
         <div id="borderCol" style="overflow-y: scroll;white-space:nowrap">
+          <a-spin tip="等待加载中..." :spinning="spinning">
           <div class="location" id="location">
           </div>
+        </a-spin>
         </div>
       </div>
+
     </div>
   </div>
 </template>
+
  <script>
   var prefix = "/location/locationMonitor";
   var grid_row;
@@ -114,10 +129,7 @@
   var currentMaterialCode=0;
 
   import huahengUI from '../../../assets/css/huahengUI.css'
-
   import $ from '../../../assets/js/jquery-1.11.1.min'
-
-
   import grid_rest  from '@/assets/icon/空柜空闲.png'
   import grid_empty  from '@/assets/icon/空盘空闲.png'
   import grid_half  from '@/assets/icon/半盘空闲.png'
@@ -131,23 +143,48 @@
   import grid_half_lock  from '@/assets/icon/半盘锁定.png'
   import grid_all_lock  from '@/assets/icon/整盘锁定.png'
   import rel_empty  from '@/assets/icon/空.png'
+  import Vue from 'vue'
+  import {ACCESS_TOKEN} from "@/store/mutation-types"
+  import {getLocationTypeList} from '@/api/api'
+
+
+
 
 
 
   export default {
     name: "locationStatus",
-
+    zoneCode:"",
     data() {
-      return {}
+      return {
+        spinning:true,
+        zoneCode:'',
+        locationTypeList: [],
+        model:{},
+        locationContent:''
+      }
     },
-    mounted() {
-      let _this=this;
-      this.resetAjax("L");
 
-      //
-      // this.initEvent();
-      //
-      // //监听浏览器宽度的改变
+    // setup() {
+    //   const spinning = ref<boolean>(false);
+    //
+    //   const changeSpinning = () => {
+    //     spinning.value = !spinning.value;
+    //   };
+
+
+      created() {
+      let _this=this
+      _this.loadFrom()
+      window.gridMsg=_this.gridMsg
+      window.Mclose=_this.Mclose
+      window.lays=_this.lays
+      },
+
+
+
+    mounted() {
+      //监听浏览器宽度的改变
       // window.onresize = function(){
       //   _this.changeMargin();
       //   _this.border()
@@ -158,6 +195,17 @@
       // this.border()
     },
     methods: {
+      loadFrom() {
+        getLocationTypeList().then((res) => {
+          if (res.success) {
+            this.locationTypeList = res.result
+            this.zoneCode = this.locationTypeList[0].code;
+            let _this=this;
+            this.resetAjax("L");
+          }
+        })
+      },
+
 
 
       initEvent(){
@@ -218,7 +266,6 @@
 
       //tips信息
       lays(x){
-        alert(2)
         let $j=$(x);
         let row=$j.attr("data-i");
         let line=$j.attr("data-j");
@@ -248,8 +295,11 @@
                 }
               }
               let code=list_info[i].code===null?"无":list_info[i].code;
-              layer.tips("第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info + ""
-                ,$j,{tips:[1,"rgb(28,132,198)"],time:0,area:'auto',maxWidth: '1000'});
+
+
+              this.locationContent="第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info;
+              // Vue.prototype.$Jnotification.success({message: '系统提示', description: "第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info, duration: 4})
+
             }
           }
         }else {return ""}
@@ -258,8 +308,8 @@
 
       //关闭tips
       Mclose(x){
-        alert(1)
         //关闭
+        // Vue.prototype.$Jnotification.error({message: '系统提示', description: "鼠标拿走了", duration: 4})
       },
 
       //库位信息请求和状态显示
@@ -267,10 +317,10 @@
         let _this=this
         // let load=layer.msg('加载中', {icon: 16,shade: 0.4,time: false});
         $.ajax({
-          url:"http://127.0.0.1:8080/wms"+prefix+"/getLocationInfo",
+          url:window._CONFIG['domianURL']+prefix+"/getLocationInfo",
           type:"post",
           headers:{
-            "X-Access-Token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU4MjQ4NDgsIndhcmVob3VzZUNvZGUiOiJDUzAwMDEiLCJ1c2VybmFtZSI6InlvdWppZSJ9.iiwKWoVA9AOA_fITphsG-rJibOlUD8EgtN-tthRt_Lg"
+            "X-Access-Token":Vue.ls.get(ACCESS_TOKEN)
           },
           data:info,
           success:function (res) {
@@ -333,6 +383,7 @@
 
       //库位请求的结果显示
       resShow(res, index ,i) {
+        debugger
         // if (res.result[i].deleted === false) {
           var row=res.result[i].row;
           var jColumn=res.result[i].icolumn;
@@ -392,7 +443,6 @@
 
       //点击显示当前库位信息
       gridMsg(msg) {
-        debugger
         let $j=$(msg);
         let row=$j.attr("data-i");
         let line=$j.attr("data-j");
@@ -435,13 +485,13 @@
       resetAjax(type){
         var _this=this;
         $.ajax({
-          url:"http://127.0.0.1:8080/wms"+prefix+"/getAllLocation",
+          url:window._CONFIG['domianURL']+prefix+"/getAllLocation",
           type:"post",
           data:{
             type:type
           },
           headers:{
-            "X-Access-Token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU4MjQ4NDgsIndhcmVob3VzZUNvZGUiOiJDUzAwMDEiLCJ1c2VybmFtZSI6InlvdWppZSJ9.iiwKWoVA9AOA_fITphsG-rJibOlUD8EgtN-tthRt_Lg"
+            "X-Access-Token":Vue.ls.get(ACCESS_TOKEN)
           },
           success:function (res) {
             grid_row=res.result.maxRow;
@@ -455,7 +505,7 @@
               $(".location").append("<br>");
               for (let j = 1; j <= grid_line; j++) {
                 // $(".location").append("<img data-i='1' data-j="+j+" data-k="+ i +" class='grid'>");
-                 $(".location").append("<img data-i='1' data-j="+j+" data-k="+ i +" class='grid' @mouseove='lays(this)' @mouseout='Mclose(this)' @click='gridMsg(this)'>");
+                 $(".location").append("<img v-html data-i='1' data-j="+j+" data-k="+ i +" class='grid' onmouseove='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
                }
             }
             let num=$("#editable-select").val();
@@ -477,17 +527,31 @@
             }
 
             _this.changeMargin();
-            _this.Search();
+             _this.Search();
           }
         });
       },
 
 
+
+
       //搜索平面库位
       Search(){
+        this.spinning=true;
         let index=$("#editable-select").val();
         let num=$("#editable-num").val();
-        let zoneCode=$("#zoneCode").val();
+
+        let zoneCode="";
+
+        if ($("#zoneCode").val()==null)
+        {
+          zoneCode=this.locationTypeList[0].zoneCode;
+        }else
+        {
+          zoneCode=this.locationTypeList[$("#zoneCode").val()].zoneCode;
+        }
+
+
         $("#code").val("");
         $("#containerCode").val("");
         $("#material").children().remove();
@@ -498,24 +562,28 @@
           data={type:zoneCode, row:num};
           $("#location").children().remove();
           for (let i = grid_layer; i > 0; i--) {
-            $(".location").append("<br><span>第"+ i+"层</span>");
+            $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ i+"层</span>");
             for (let j = 1; j <= grid_line; j++) {
-              $(".location").append("<img data-i="+num+" data-j="+j+" data-k="+i+" class='grid' @mouseover='lays(this)' @mouseout='Mclose(this)' @click='gridMsg(this)'>");
+              $(".location").append("<img data-i="+num+" data-j="+j+" data-k="+i+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
             }
           }
+
+
           this.changeMargin();
           this.ajaxGrid(index,data);
         }
         else if (index === "line") {
-          debugger
           data={type:zoneCode, line:num};
           $("#location").children().remove();
           for (let k = grid_layer; k > 0; k--) {
-            $(".location").append("<br><span>第"+ k+"层</span>");
+            $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ k+"层</span>");
             for (let l = 1; l <= grid_row; l++) {
               $(".location").append("<img data-i="+l+" data-j="+num+" data-k="+k+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
             }
           }
+
+
+
           this.changeMargin();
           this.ajaxGrid(index,data);
         }
@@ -523,7 +591,7 @@
           data={type:zoneCode, layer:num};
           $("#location").children().remove();
           for (let m = 1; m <= grid_row; m++) {
-            $(".location").append("<br><span>第"+ m+"行</span>");
+            $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ m+"行</span>");
             for (let n = 1; n <= grid_line; n++) {
               $(".location").append("<img data-i="+m+" data-j="+n+" data-k="+num+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
             }
@@ -532,42 +600,34 @@
           this.ajaxGrid(index,data);
         }
 
+        },
 
-      },
 
 
-      searchLocation(){
-        if(!currentLocationCode){
-          $.modal.alertError("请选择库位")
-        }else {
-          localStorage.setItem("locationCode",currentLocationCode)
-          createMenuItem("路径" +"config/location","库位管理")
-        }
-      },
-
-
-      searchInventory() {
-        if(!currentLocationCode){
-          $.modal.alertError("请选择库位")
-          return
-        }
-        localStorage.setItem("locationCode",currentLocationCode)
-        createMenuItem("路径" +"inventory/inventoryHeader","库存查看")
-      },
 
       seachZone(){
+        let _this=this
+        let zoneCode="";
+        if ($("#zoneCode").val()==null)
+        {
+          zoneCode=this.locationTypeList[0].zoneCode;
+        }else
+        {
+          zoneCode=this.locationTypeList[$("#zoneCode").val()].zoneCode;
+        }
         $.ajax({
-          url:"http://127.0.0.1:8080/wms"+prefix+"/getStatus",
+          url:window._CONFIG['domianURL']+prefix+"/getStatus",
           data:{
-            zoneCode:$("#zoneCode").val()
+            zoneCode:zoneCode
           },
           headers:{
-            "X-Access-Token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU4MjQ4NDgsIndhcmVob3VzZUNvZGUiOiJDUzAwMDEiLCJ1c2VybmFtZSI6InlvdWppZSJ9.iiwKWoVA9AOA_fITphsG-rJibOlUD8EgtN-tthRt_Lg"
+            "X-Access-Token":Vue.ls.get(ACCESS_TOKEN)
           },
           success:function (response) {
             if (response.code==200){
               $("#zone").val("库位总数:"+response.result.location+", 空闲库位:"+response.result.emptyLocation+
                 ", 空托盘库位:"+response.result.haveContainLocation+", 有货库位:"+response.result.haveInventoryLocation)
+              _this.spinning=false;
             }else {
               alert(response.message)
             }
@@ -829,10 +889,5 @@
     background-size:cover;
     background-image: url("~@/assets/icon/空盘空闲.png");
   }
-  #location span{
-    display: inline-block;
-    text-align: right;
-    width: 50px;
-    margin-right: 10px;
-  }
+
 </style>
\ No newline at end of file
--
libgit2 0.22.2