|
|
@@ -323,16 +323,6 @@
|
|
|
clientCoords:{}, //坐标系记录
|
|
|
scale:100, //缩放值
|
|
|
equipments:[ //备选设备池
|
|
|
- {id:1,w:1.2,h:2.4,grid:2,layer:4,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
|
|
|
- {id:2,w:1.2,h:2.4,grid:2,layer:5,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
|
|
|
- {id:3,w:1.2,h:3.3,grid:3,layer:1,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
|
|
|
- {id:4,w:1.2,h:3.3,grid:3,layer:2,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
|
|
|
- {id:5,w:1.2,h:1.2,grid:1,layer:4,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
|
|
|
- {id:6,w:1.2,h:2.4,grid:2,layer:1,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
|
|
|
- {id:7,w:1.2,h:1.2,grid:1,layer:5,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
|
|
|
- {id:8,w:1.2,h:3.3,grid:3,layer:4,color:"RGB(146,208,80)",describe:"4层高位货架,可设十二个标准托盘位"},
|
|
|
- {id:9,w:1.2,h:2.4,grid:2,layer:2,color:"RGB(228,243,211)",describe:"叉车通道,可设四个标准托盘位"},
|
|
|
- {id:10,w:1,h:2,grid:1,layer:4,color:"RGB(211,160,160)",describe:"小型货架"},
|
|
|
],
|
|
|
currentEq:{ //选中的设备
|
|
|
el:null,
|
|
|
@@ -365,11 +355,13 @@
|
|
|
isShowRatio:undefined,//是否展示库位现存比例
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.initPage();
|
|
|
- let content = document.getElementById("canvasApp");
|
|
|
- content.onmousemove = (event)=>{
|
|
|
- this.client = {x:event.clientX,y:event.clientY};
|
|
|
- }
|
|
|
+ this._loadEquipmentCategory().then(()=>{
|
|
|
+ this.initPage();
|
|
|
+ let content = document.getElementById("canvasApp");
|
|
|
+ content.onmousemove = (event)=>{
|
|
|
+ this.client = {x:event.clientX,y:event.clientY};
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
computed:{
|
|
|
flipLayer(){
|
|
|
@@ -422,6 +414,54 @@
|
|
|
};
|
|
|
},
|
|
|
methods:{
|
|
|
+ // 加载设备种类
|
|
|
+ _loadEquipmentCategory() {
|
|
|
+ return new Promise((resolve, reject)=>{
|
|
|
+ $.ajax({
|
|
|
+ url : this.baseUrl+"api/equipment/category",
|
|
|
+ type : "GET",
|
|
|
+ success : (res,status)=>{
|
|
|
+ if(res.code != 200 || !res.data) {
|
|
|
+ window.tempTip.show(res.message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * {id:1,w:1.2,h:2.4,grid:2,layer:4,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
|
|
|
+ {id:2,w:1.2,h:2.4,grid:2,layer:5,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
|
|
|
+ {id:3,w:1.2,h:3.3,grid:3,layer:1,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
|
|
|
+ {id:4,w:1.2,h:3.3,grid:3,layer:2,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
|
|
|
+ {id:5,w:1.2,h:1.2,grid:1,layer:4,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
|
|
|
+ {id:6,w:1.2,h:2.4,grid:2,layer:1,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
|
|
|
+ {id:7,w:1.2,h:1.2,grid:1,layer:5,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
|
|
|
+ {id:8,w:1.2,h:3.3,grid:3,layer:4,color:"RGB(146,208,80)",describe:"4层高位货架,可设十二个标准托盘位"},
|
|
|
+ {id:9,w:1.2,h:2.4,grid:2,layer:2,color:"RGB(228,243,211)",describe:"叉车通道,可设四个标准托盘位"},
|
|
|
+ {id:10,w:1,h:2,grid:1,layer:4,color:"RGB(211,160,160)",describe:"小型货架"},
|
|
|
+ * */
|
|
|
+ let equipments = [];
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ res.data.forEach(category => {
|
|
|
+ let info = JSON.parse(category.info);
|
|
|
+ equipments.push({
|
|
|
+ "id":category.id,
|
|
|
+ "w":category.depth,
|
|
|
+ "h":category.width,
|
|
|
+ "grid":info.grid,
|
|
|
+ "layer":category.layer,
|
|
|
+ "color":info.color,
|
|
|
+ "describe":category.name,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.equipments = equipments;
|
|
|
+ resolve();
|
|
|
+ },
|
|
|
+ error : (err,status)=>{
|
|
|
+ window.tempTip.show("设备种类加载失败");
|
|
|
+ },
|
|
|
+ timeout:3000,
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
//仓库切换
|
|
|
selectedWarehouse(warehouse){
|
|
|
this.isLoad = false;
|
|
|
@@ -447,8 +487,6 @@
|
|
|
eqId:eq.id,
|
|
|
exist:eq.exist,
|
|
|
code:eq.code,
|
|
|
- width:eq.width,
|
|
|
- depth:eq.depth,
|
|
|
repository:eq.repositoryId,
|
|
|
x:coords.x,
|
|
|
y:coords.y,
|
|
|
@@ -1111,11 +1149,10 @@
|
|
|
_checkEquipmentData(equipment){
|
|
|
let error = {};
|
|
|
if (!equipment.code)error.code = "设备编号未填写";
|
|
|
- if (!equipment.width)error.width = "设备宽度未填写";
|
|
|
- if (!equipment.depth)error.depth = "设备深度未填写";
|
|
|
if (equipment.layer !== equipment.children.length)error.children = "设备绑定错误";
|
|
|
for (let i=0;i<equipment.layer;i++){
|
|
|
if (!equipment.children[i].height)error["children["+i+"].height"] = "设备高度不得为空"
|
|
|
+ if (!equipment.children[i].area)error["children["+i+"].height"] = "设备折算面积不得为空"
|
|
|
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"] = "库位行数不得为空"
|
|
|
}
|