Commit fcee18b67c96548efd4db46c76ddbeb59445030d
1 parent
bb6a4cb9
update
Showing
1 changed file
with
116 additions
and
61 deletions
ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
... | ... | @@ -5,10 +5,20 @@ |
5 | 5 | <form id="container-form"> |
6 | 6 | <div class="select-list"> |
7 | 7 | <ul id="select_info"> |
8 | + | |
8 | 9 | <li> |
9 | - <select id="zoneCode" name="zoneCode" style="width: 100px"> | |
10 | - <option selected>A</option> | |
11 | - </select> | |
10 | + 货主 | |
11 | + <a-select | |
12 | + show-search | |
13 | + placeholder="请选择库位类型" | |
14 | + option-filter-prop="children" | |
15 | + v-model="zoneCode" | |
16 | + style="width: 200px"> | |
17 | + <a-select-option selected="0" id="zoneCode" v-for="item in locationTypeList" :key="item.name" :value="item.code">{{ | |
18 | + item.name | |
19 | + }} | |
20 | + </a-select-option> | |
21 | + </a-select> | |
12 | 22 | </li> |
13 | 23 | <li> |
14 | 24 | 第 |
... | ... | @@ -23,7 +33,7 @@ |
23 | 33 | </select> |
24 | 34 | </li> |
25 | 35 | <li> |
26 | - <a-button type="primary" @click="Search()" icon="search">查询</a-button> | |
36 | + <a-button type="primary" @click="Search()" icon="search">查询</a-button> | |
27 | 37 | </li> |
28 | 38 | </ul> |
29 | 39 | </div> |
... | ... | @@ -81,15 +91,20 @@ |
81 | 91 | </div> |
82 | 92 | </form> |
83 | 93 | </div> |
94 | + | |
84 | 95 | <div class="col-sm-12 select-info"> |
85 | 96 | <div id="borderCol" style="overflow-y: scroll;white-space:nowrap"> |
97 | + <a-spin tip="等待加载中..." :spinning="spinning"> | |
86 | 98 | <div class="location" id="location"> |
87 | 99 | </div> |
100 | + </a-spin> | |
88 | 101 | </div> |
89 | 102 | </div> |
103 | + | |
90 | 104 | </div> |
91 | 105 | </div> |
92 | 106 | </template> |
107 | + | |
93 | 108 | <script> |
94 | 109 | var prefix = "/location/locationMonitor"; |
95 | 110 | var grid_row; |
... | ... | @@ -114,10 +129,7 @@ |
114 | 129 | var currentMaterialCode=0; |
115 | 130 | |
116 | 131 | import huahengUI from '../../../assets/css/huahengUI.css' |
117 | - | |
118 | 132 | import $ from '../../../assets/js/jquery-1.11.1.min' |
119 | - | |
120 | - | |
121 | 133 | import grid_rest from '@/assets/icon/空柜空闲.png' |
122 | 134 | import grid_empty from '@/assets/icon/空盘空闲.png' |
123 | 135 | import grid_half from '@/assets/icon/半盘空闲.png' |
... | ... | @@ -131,23 +143,48 @@ |
131 | 143 | import grid_half_lock from '@/assets/icon/半盘锁定.png' |
132 | 144 | import grid_all_lock from '@/assets/icon/整盘锁定.png' |
133 | 145 | import rel_empty from '@/assets/icon/空.png' |
146 | + import Vue from 'vue' | |
147 | + import {ACCESS_TOKEN} from "@/store/mutation-types" | |
148 | + import {getLocationTypeList} from '@/api/api' | |
149 | + | |
150 | + | |
151 | + | |
134 | 152 | |
135 | 153 | |
136 | 154 | |
137 | 155 | export default { |
138 | 156 | name: "locationStatus", |
139 | - | |
157 | + zoneCode:"", | |
140 | 158 | data() { |
141 | - return {} | |
159 | + return { | |
160 | + spinning:true, | |
161 | + zoneCode:'', | |
162 | + locationTypeList: [], | |
163 | + model:{}, | |
164 | + locationContent:'' | |
165 | + } | |
142 | 166 | }, |
143 | - mounted() { | |
144 | - let _this=this; | |
145 | - this.resetAjax("L"); | |
146 | 167 | |
147 | - // | |
148 | - // this.initEvent(); | |
149 | - // | |
150 | - // //监听浏览器宽度的改变 | |
168 | + // setup() { | |
169 | + // const spinning = ref<boolean>(false); | |
170 | + // | |
171 | + // const changeSpinning = () => { | |
172 | + // spinning.value = !spinning.value; | |
173 | + // }; | |
174 | + | |
175 | + | |
176 | + created() { | |
177 | + let _this=this | |
178 | + _this.loadFrom() | |
179 | + window.gridMsg=_this.gridMsg | |
180 | + window.Mclose=_this.Mclose | |
181 | + window.lays=_this.lays | |
182 | + }, | |
183 | + | |
184 | + | |
185 | + | |
186 | + mounted() { | |
187 | + //监听浏览器宽度的改变 | |
151 | 188 | // window.onresize = function(){ |
152 | 189 | // _this.changeMargin(); |
153 | 190 | // _this.border() |
... | ... | @@ -158,6 +195,17 @@ |
158 | 195 | // this.border() |
159 | 196 | }, |
160 | 197 | methods: { |
198 | + loadFrom() { | |
199 | + getLocationTypeList().then((res) => { | |
200 | + if (res.success) { | |
201 | + this.locationTypeList = res.result | |
202 | + this.zoneCode = this.locationTypeList[0].code; | |
203 | + let _this=this; | |
204 | + this.resetAjax("L"); | |
205 | + } | |
206 | + }) | |
207 | + }, | |
208 | + | |
161 | 209 | |
162 | 210 | |
163 | 211 | initEvent(){ |
... | ... | @@ -218,7 +266,6 @@ |
218 | 266 | |
219 | 267 | //tips信息 |
220 | 268 | lays(x){ |
221 | - alert(2) | |
222 | 269 | let $j=$(x); |
223 | 270 | let row=$j.attr("data-i"); |
224 | 271 | let line=$j.attr("data-j"); |
... | ... | @@ -248,8 +295,11 @@ |
248 | 295 | } |
249 | 296 | } |
250 | 297 | let code=list_info[i].code===null?"无":list_info[i].code; |
251 | - layer.tips("第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info + "" | |
252 | - ,$j,{tips:[1,"rgb(28,132,198)"],time:0,area:'auto',maxWidth: '1000'}); | |
298 | + | |
299 | + | |
300 | + this.locationContent="第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info; | |
301 | + // Vue.prototype.$Jnotification.success({message: '系统提示', description: "第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info, duration: 4}) | |
302 | + | |
253 | 303 | } |
254 | 304 | } |
255 | 305 | }else {return ""} |
... | ... | @@ -258,8 +308,8 @@ |
258 | 308 | |
259 | 309 | //关闭tips |
260 | 310 | Mclose(x){ |
261 | - alert(1) | |
262 | 311 | //关闭 |
312 | + // Vue.prototype.$Jnotification.error({message: '系统提示', description: "鼠标拿走了", duration: 4}) | |
263 | 313 | }, |
264 | 314 | |
265 | 315 | //库位信息请求和状态显示 |
... | ... | @@ -267,10 +317,10 @@ |
267 | 317 | let _this=this |
268 | 318 | // let load=layer.msg('加载中', {icon: 16,shade: 0.4,time: false}); |
269 | 319 | $.ajax({ |
270 | - url:"http://127.0.0.1:8080/wms"+prefix+"/getLocationInfo", | |
320 | + url:window._CONFIG['domianURL']+prefix+"/getLocationInfo", | |
271 | 321 | type:"post", |
272 | 322 | headers:{ |
273 | - "X-Access-Token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU4MjQ4NDgsIndhcmVob3VzZUNvZGUiOiJDUzAwMDEiLCJ1c2VybmFtZSI6InlvdWppZSJ9.iiwKWoVA9AOA_fITphsG-rJibOlUD8EgtN-tthRt_Lg" | |
323 | + "X-Access-Token":Vue.ls.get(ACCESS_TOKEN) | |
274 | 324 | }, |
275 | 325 | data:info, |
276 | 326 | success:function (res) { |
... | ... | @@ -333,6 +383,7 @@ |
333 | 383 | |
334 | 384 | //库位请求的结果显示 |
335 | 385 | resShow(res, index ,i) { |
386 | + debugger | |
336 | 387 | // if (res.result[i].deleted === false) { |
337 | 388 | var row=res.result[i].row; |
338 | 389 | var jColumn=res.result[i].icolumn; |
... | ... | @@ -392,7 +443,6 @@ |
392 | 443 | |
393 | 444 | //点击显示当前库位信息 |
394 | 445 | gridMsg(msg) { |
395 | - debugger | |
396 | 446 | let $j=$(msg); |
397 | 447 | let row=$j.attr("data-i"); |
398 | 448 | let line=$j.attr("data-j"); |
... | ... | @@ -435,13 +485,13 @@ |
435 | 485 | resetAjax(type){ |
436 | 486 | var _this=this; |
437 | 487 | $.ajax({ |
438 | - url:"http://127.0.0.1:8080/wms"+prefix+"/getAllLocation", | |
488 | + url:window._CONFIG['domianURL']+prefix+"/getAllLocation", | |
439 | 489 | type:"post", |
440 | 490 | data:{ |
441 | 491 | type:type |
442 | 492 | }, |
443 | 493 | headers:{ |
444 | - "X-Access-Token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU4MjQ4NDgsIndhcmVob3VzZUNvZGUiOiJDUzAwMDEiLCJ1c2VybmFtZSI6InlvdWppZSJ9.iiwKWoVA9AOA_fITphsG-rJibOlUD8EgtN-tthRt_Lg" | |
494 | + "X-Access-Token":Vue.ls.get(ACCESS_TOKEN) | |
445 | 495 | }, |
446 | 496 | success:function (res) { |
447 | 497 | grid_row=res.result.maxRow; |
... | ... | @@ -455,7 +505,7 @@ |
455 | 505 | $(".location").append("<br>"); |
456 | 506 | for (let j = 1; j <= grid_line; j++) { |
457 | 507 | // $(".location").append("<img data-i='1' data-j="+j+" data-k="+ i +" class='grid'>"); |
458 | - $(".location").append("<img data-i='1' data-j="+j+" data-k="+ i +" class='grid' @mouseove='lays(this)' @mouseout='Mclose(this)' @click='gridMsg(this)'>"); | |
508 | + $(".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)'>"); | |
459 | 509 | } |
460 | 510 | } |
461 | 511 | let num=$("#editable-select").val(); |
... | ... | @@ -477,17 +527,31 @@ |
477 | 527 | } |
478 | 528 | |
479 | 529 | _this.changeMargin(); |
480 | - _this.Search(); | |
530 | + _this.Search(); | |
481 | 531 | } |
482 | 532 | }); |
483 | 533 | }, |
484 | 534 | |
485 | 535 | |
536 | + | |
537 | + | |
486 | 538 | //搜索平面库位 |
487 | 539 | Search(){ |
540 | + this.spinning=true; | |
488 | 541 | let index=$("#editable-select").val(); |
489 | 542 | let num=$("#editable-num").val(); |
490 | - let zoneCode=$("#zoneCode").val(); | |
543 | + | |
544 | + let zoneCode=""; | |
545 | + | |
546 | + if ($("#zoneCode").val()==null) | |
547 | + { | |
548 | + zoneCode=this.locationTypeList[0].zoneCode; | |
549 | + }else | |
550 | + { | |
551 | + zoneCode=this.locationTypeList[$("#zoneCode").val()].zoneCode; | |
552 | + } | |
553 | + | |
554 | + | |
491 | 555 | $("#code").val(""); |
492 | 556 | $("#containerCode").val(""); |
493 | 557 | $("#material").children().remove(); |
... | ... | @@ -498,24 +562,28 @@ |
498 | 562 | data={type:zoneCode, row:num}; |
499 | 563 | $("#location").children().remove(); |
500 | 564 | for (let i = grid_layer; i > 0; i--) { |
501 | - $(".location").append("<br><span>第"+ i+"层</span>"); | |
565 | + $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ i+"层</span>"); | |
502 | 566 | for (let j = 1; j <= grid_line; j++) { |
503 | - $(".location").append("<img data-i="+num+" data-j="+j+" data-k="+i+" class='grid' @mouseover='lays(this)' @mouseout='Mclose(this)' @click='gridMsg(this)'>"); | |
567 | + $(".location").append("<img data-i="+num+" data-j="+j+" data-k="+i+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
504 | 568 | } |
505 | 569 | } |
570 | + | |
571 | + | |
506 | 572 | this.changeMargin(); |
507 | 573 | this.ajaxGrid(index,data); |
508 | 574 | } |
509 | 575 | else if (index === "line") { |
510 | - debugger | |
511 | 576 | data={type:zoneCode, line:num}; |
512 | 577 | $("#location").children().remove(); |
513 | 578 | for (let k = grid_layer; k > 0; k--) { |
514 | - $(".location").append("<br><span>第"+ k+"层</span>"); | |
579 | + $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ k+"层</span>"); | |
515 | 580 | for (let l = 1; l <= grid_row; l++) { |
516 | 581 | $(".location").append("<img data-i="+l+" data-j="+num+" data-k="+k+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); |
517 | 582 | } |
518 | 583 | } |
584 | + | |
585 | + | |
586 | + | |
519 | 587 | this.changeMargin(); |
520 | 588 | this.ajaxGrid(index,data); |
521 | 589 | } |
... | ... | @@ -523,7 +591,7 @@ |
523 | 591 | data={type:zoneCode, layer:num}; |
524 | 592 | $("#location").children().remove(); |
525 | 593 | for (let m = 1; m <= grid_row; m++) { |
526 | - $(".location").append("<br><span>第"+ m+"行</span>"); | |
594 | + $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ m+"行</span>"); | |
527 | 595 | for (let n = 1; n <= grid_line; n++) { |
528 | 596 | $(".location").append("<img data-i="+m+" data-j="+n+" data-k="+num+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); |
529 | 597 | } |
... | ... | @@ -532,42 +600,34 @@ |
532 | 600 | this.ajaxGrid(index,data); |
533 | 601 | } |
534 | 602 | |
603 | + }, | |
535 | 604 | |
536 | - }, | |
537 | 605 | |
538 | 606 | |
539 | - searchLocation(){ | |
540 | - if(!currentLocationCode){ | |
541 | - $.modal.alertError("请选择库位") | |
542 | - }else { | |
543 | - localStorage.setItem("locationCode",currentLocationCode) | |
544 | - createMenuItem("路径" +"config/location","库位管理") | |
545 | - } | |
546 | - }, | |
547 | - | |
548 | - | |
549 | - searchInventory() { | |
550 | - if(!currentLocationCode){ | |
551 | - $.modal.alertError("请选择库位") | |
552 | - return | |
553 | - } | |
554 | - localStorage.setItem("locationCode",currentLocationCode) | |
555 | - createMenuItem("路径" +"inventory/inventoryHeader","库存查看") | |
556 | - }, | |
557 | 607 | |
558 | 608 | seachZone(){ |
609 | + let _this=this | |
610 | + let zoneCode=""; | |
611 | + if ($("#zoneCode").val()==null) | |
612 | + { | |
613 | + zoneCode=this.locationTypeList[0].zoneCode; | |
614 | + }else | |
615 | + { | |
616 | + zoneCode=this.locationTypeList[$("#zoneCode").val()].zoneCode; | |
617 | + } | |
559 | 618 | $.ajax({ |
560 | - url:"http://127.0.0.1:8080/wms"+prefix+"/getStatus", | |
619 | + url:window._CONFIG['domianURL']+prefix+"/getStatus", | |
561 | 620 | data:{ |
562 | - zoneCode:$("#zoneCode").val() | |
621 | + zoneCode:zoneCode | |
563 | 622 | }, |
564 | 623 | headers:{ |
565 | - "X-Access-Token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU4MjQ4NDgsIndhcmVob3VzZUNvZGUiOiJDUzAwMDEiLCJ1c2VybmFtZSI6InlvdWppZSJ9.iiwKWoVA9AOA_fITphsG-rJibOlUD8EgtN-tthRt_Lg" | |
624 | + "X-Access-Token":Vue.ls.get(ACCESS_TOKEN) | |
566 | 625 | }, |
567 | 626 | success:function (response) { |
568 | 627 | if (response.code==200){ |
569 | 628 | $("#zone").val("库位总数:"+response.result.location+", 空闲库位:"+response.result.emptyLocation+ |
570 | 629 | ", 空托盘库位:"+response.result.haveContainLocation+", 有货库位:"+response.result.haveInventoryLocation) |
630 | + _this.spinning=false; | |
571 | 631 | }else { |
572 | 632 | alert(response.message) |
573 | 633 | } |
... | ... | @@ -829,10 +889,5 @@ |
829 | 889 | background-size:cover; |
830 | 890 | background-image: url("~@/assets/icon/空盘空闲.png"); |
831 | 891 | } |
832 | - #location span{ | |
833 | - display: inline-block; | |
834 | - text-align: right; | |
835 | - width: 50px; | |
836 | - margin-right: 10px; | |
837 | - } | |
892 | + | |
838 | 893 | </style> |
839 | 894 | \ No newline at end of file |
... | ... |