|
|
@@ -234,6 +234,7 @@
|
|
|
data:{
|
|
|
group:[],//库区列表
|
|
|
ws:[],//仓库列表
|
|
|
+ locationMapping:{},//库位的信息映射
|
|
|
warehouseDetail:{},//当前操作的仓库
|
|
|
repository:{},//当前操作的库区
|
|
|
warehouses:[], //仓库描述
|
|
|
@@ -500,7 +501,8 @@
|
|
|
success : (res)=>{
|
|
|
switch (res.code){
|
|
|
case 200:
|
|
|
- this.locations = this._chunkArr(res.data,children.column);
|
|
|
+ this.locations = res.data[0];
|
|
|
+ this.locationMapping = res.data[1];
|
|
|
this.isLoadLocation = false;
|
|
|
setTimeout(()=>{
|
|
|
let parentDom = document.getElementById("detailInfo").firstChild.firstChild;
|
|
|
@@ -509,7 +511,7 @@
|
|
|
},10);
|
|
|
break;
|
|
|
default:
|
|
|
- alert("未知响应");
|
|
|
+ window.toast.error(res.message);
|
|
|
}
|
|
|
},
|
|
|
error : (err)=>{
|
|
|
@@ -519,20 +521,6 @@
|
|
|
timeout:3000,
|
|
|
})
|
|
|
},
|
|
|
- _chunkArr(arr, size){
|
|
|
- let result = [];
|
|
|
- let item = [];
|
|
|
- for (let i=0;i<arr.length;i++){
|
|
|
- if (i!==0 && i%size===0){
|
|
|
- result.push(item);
|
|
|
- item = [];
|
|
|
- }
|
|
|
- item.push(arr[i]);
|
|
|
- }
|
|
|
- if (item.length!==0)result.push(item);
|
|
|
- console.log(result);
|
|
|
- return result;
|
|
|
- },
|
|
|
showDetail(equipment){
|
|
|
if (!this.isNotEdit)return;
|
|
|
this.current = equipment;
|
|
|
@@ -675,7 +663,7 @@
|
|
|
success : (res)=>{
|
|
|
switch (res.code){
|
|
|
case 200:
|
|
|
- this.locations = this._chunkArr(res.data,Number(this.buildPool.column));
|
|
|
+ this.locations = res.data;
|
|
|
window.toast.success("构建成功!");
|
|
|
this.current.children[this.currentEqChildIndex].row = Number(this.buildPool.row);
|
|
|
this.current.children[this.currentEqChildIndex].column = Number(this.buildPool.column);
|
|
|
@@ -817,6 +805,26 @@
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
+ filters:{
|
|
|
+ qty(code){
|
|
|
+ let inv = vue.locationMapping[code];
|
|
|
+ if(!inv)return 0;
|
|
|
+ return inv.QTY;
|
|
|
+ },
|
|
|
+ qtyOver(code){
|
|
|
+ let inv = vue.locationMapping[code];
|
|
|
+ if(!inv)return 0;
|
|
|
+ return inv.QTYALLOCATED + inv.QTYMVIN + inv.QTYMVOUT + inv.QTYONHOLD + inv.QTYPA + inv.QTYRPIN + inv.QTYRPOUT;
|
|
|
+ },
|
|
|
+ childStyle(code){
|
|
|
+ let inv = vue.locationMapping[code];
|
|
|
+ if (!inv)return '';
|
|
|
+ let qty = inv.QTY;
|
|
|
+ let other = inv.QTYALLOCATED + inv.QTYMVIN + inv.QTYMVOUT + inv.QTYONHOLD + inv.QTYPA + inv.QTYRPIN + inv.QTYRPOUT;
|
|
|
+ return (qty>0 || other>0) ?
|
|
|
+ 'color: #fff;background-color: #38c172;border-color: #38c172;' : '';
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
</html>
|