|
|
@@ -420,7 +420,7 @@
|
|
|
_loadEquipmentCategory() {
|
|
|
return new Promise((resolve, reject)=>{
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/equipment/category",
|
|
|
+ url : this.baseUrl+"api/base/equipment/category",
|
|
|
type : "GET",
|
|
|
success : (res,status)=>{
|
|
|
if(res.code != 200 || !res.data) {
|
|
|
@@ -474,7 +474,7 @@
|
|
|
this.container = {width:warehouse.length*this.ratio,height:warehouse.width*this.ratio};
|
|
|
localStorage.setItem("equipment:warehouse", warehouse.id);
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/warehouse/detail/getCoordsInfo",
|
|
|
+ url : this.baseUrl+"api/base/warehouse/detail/getCoordsInfo",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
data : {id:warehouse.id},
|
|
|
@@ -484,7 +484,7 @@
|
|
|
let equipmentElements = [];
|
|
|
res.data[1].forEach(eq=>{
|
|
|
let coords = JSON.parse(eq.info);
|
|
|
- let selfInfo = this.equipments[coords.id-1];
|
|
|
+ let selfInfo = this.getCategory(coords.id);
|
|
|
equipmentElements.push(Object.assign({
|
|
|
eqId:eq.id,
|
|
|
exist:eq.exist,
|
|
|
@@ -508,12 +508,20 @@
|
|
|
})
|
|
|
},200);
|
|
|
},
|
|
|
+ getCategory(id) {
|
|
|
+ for (let i = 0; i < this.equipments.length; i++) {
|
|
|
+ if(Number(id) === Number(this.equipments[i].id)) {
|
|
|
+ return this.equipments[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {}
|
|
|
+ },
|
|
|
/**
|
|
|
* 初始页加载
|
|
|
*/
|
|
|
initPage(){
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/warehouse/detail",
|
|
|
+ url : this.baseUrl+"api/base/warehouse/detail",
|
|
|
type : "GET",
|
|
|
success : (res,status)=>{
|
|
|
this.warehouses = res.data;
|
|
|
@@ -563,7 +571,7 @@
|
|
|
return;
|
|
|
}
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/location/getAttr",
|
|
|
+ url : this.baseUrl+"api/base/location/getAttr",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
success : (res,status)=>{
|
|
|
@@ -821,7 +829,7 @@
|
|
|
}
|
|
|
});
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/warehouse/saveScene",
|
|
|
+ url : this.baseUrl+"api/base/warehouse/saveScene",
|
|
|
type : "POST",
|
|
|
headers:{'Content-Type':'application/json;charset=utf8'},
|
|
|
data:JSON.stringify({id:this.selected,warehouse:JSON.stringify(elements),equipment:equipments,delEquipments:delEquipments}),
|
|
|
@@ -1040,7 +1048,7 @@
|
|
|
item.column = Number(item.column);
|
|
|
});
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/location/get",
|
|
|
+ url : this.baseUrl+"api/base/location/get",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
data : {id:children.id},
|
|
|
@@ -1077,7 +1085,7 @@
|
|
|
return;
|
|
|
}
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/equipment/getChildren",
|
|
|
+ url : this.baseUrl+"api/base/equipment/getChildren",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
data : {id:equipment.eqId},
|
|
|
@@ -1115,7 +1123,7 @@
|
|
|
let params = this._formatEquipmentData(equipment);
|
|
|
params.warehouseDetailId = this.selected;
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/equipment/saveOrUpdate",
|
|
|
+ url : this.baseUrl+"api/base/equipment/saveOrUpdate",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
headers:{'Content-Type':'application/json;charset=utf8'},
|
|
|
@@ -1160,9 +1168,8 @@
|
|
|
if (!equipment.code)error.code = "设备编号未填写";
|
|
|
if (equipment.layer !== equipment.children.length)error.children = "设备绑定错误";
|
|
|
for (let i=0;i<equipment.layer;i++){
|
|
|
- console.log(equipment.children[i])
|
|
|
if (!equipment.children[i].height)error["children["+i+"].height"] = "设备高度不得为空"
|
|
|
- if (!equipment.children[i].area)error["children["+i+"].area"] = "设备折算面积不得为空"
|
|
|
+ //if (!equipment.children[i].area)error["children["+i+"].area"] = "设备折算面积不得为空"
|
|
|
if (!equipment.children[i].column && equipment.children[i].column!=0)error["children["+i+"].column"] = "库位列数不得为空"
|
|
|
if (!equipment.children[i].row && equipment.children[i].row!=0)error["children["+i+"].row"] = "库位行数不得为空"
|
|
|
}
|
|
|
@@ -1183,7 +1190,7 @@
|
|
|
if (this.isLoadLocation)return;
|
|
|
this.isLoadLocation = true;
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/location/removeLocationBind",
|
|
|
+ url : this.baseUrl+"api/base/location/removeLocationBind",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
data : {id:this.current.children[this.currentEqChildIndex].id},
|
|
|
@@ -1228,7 +1235,7 @@
|
|
|
}
|
|
|
});
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/location/locationBatchBound",
|
|
|
+ url : this.baseUrl+"api/base/location/locationBatchBound",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
data : JSON.stringify(request),
|
|
|
@@ -1272,7 +1279,7 @@
|
|
|
let code = this.current.code+'-'+(this.currentEqChildIndex+1);
|
|
|
this.isLoadLocation = true;
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/location/locationBind",
|
|
|
+ url : this.baseUrl+"api/base/location/locationBind",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
headers:{'Content-Type':'application/json;charset=utf8'},
|
|
|
@@ -1311,7 +1318,7 @@
|
|
|
return;
|
|
|
}
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/warehouse/getList",
|
|
|
+ url : this.baseUrl+"api/base/warehouse/getList",
|
|
|
type : "get",
|
|
|
dataType : "JSON",
|
|
|
success : (res)=>{
|
|
|
@@ -1339,7 +1346,7 @@
|
|
|
},
|
|
|
addWarehouseDetail(){
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/warehouse/detail",
|
|
|
+ url : this.baseUrl+"api/base/warehouse/detail",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
headers:{'Content-Type':'application/json;charset=utf8'},
|
|
|
@@ -1364,7 +1371,7 @@
|
|
|
},
|
|
|
openRepository(){
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/repository/group",
|
|
|
+ url : this.baseUrl+"api/base/repository/group",
|
|
|
type : "get",
|
|
|
dataType : "JSON",
|
|
|
data:{id:this.selected},
|
|
|
@@ -1394,7 +1401,7 @@
|
|
|
addRepository(){
|
|
|
this.repository.warehouseDetailId = this.selected;
|
|
|
$.ajax({
|
|
|
- url : this.baseUrl+"api/repository/addRepository",
|
|
|
+ url : this.baseUrl+"api/base/repository/addRepository",
|
|
|
type : "post",
|
|
|
dataType : "JSON",
|
|
|
headers:{'Content-Type':'application/json;charset=utf8'},
|