因现场需要将货架拉走进行物料的绑定 所以不限制货架绑定工位的情况下可以进行物料的绑定
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
|
||||
<view class="uni-input-wrapper" style="flex: 60;">
|
||||
<input id="inputMatCode" class="uni-input" style="font-size: 50rpx; padding: 10rpx;"
|
||||
:placeholder="placeholderText" v-model="matCodeCondition" ></input>
|
||||
:placeholder="placeholderText" v-model="matCodeCondition"></input>
|
||||
</view>
|
||||
|
||||
<view style="flex: 3;">
|
||||
@ -30,6 +30,9 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="diy-flex-column" style="margin-top: 20rpx;">
|
||||
<view class="diy-flex-inforow" style="flex: 1;">
|
||||
<view style="flex: 5;"></view>
|
||||
@ -50,6 +53,7 @@
|
||||
<button class="mini-btn" type="warn" size="mini" @click="callEmptyShelf">呼叫货架</button>
|
||||
</view>
|
||||
</view>
|
||||
<view style="border-bottom: 1rpx solid #e0e0e0; /* 分隔线的颜色和粗细 */"></view>
|
||||
|
||||
<view class="diy-flex-inforow" style="flex: 1;">
|
||||
<view style="flex: 5;"></view>
|
||||
@ -126,7 +130,8 @@
|
||||
<view style="flex: 35;">物料数量:</view>
|
||||
|
||||
<view class="uni-input-wrapper" style="flex: 50;">
|
||||
<input class="uni-input" type="number" style="font-size: 40rpx; " placeholder="请输入物料数量" v-model="matQty"></input>
|
||||
<input class="uni-input" type="number" style="font-size: 40rpx; " placeholder="请输入物料数量"
|
||||
v-model="matQty"></input>
|
||||
</view>
|
||||
|
||||
<view style="flex: 40;">
|
||||
@ -135,6 +140,7 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view style="border-bottom: 1rpx solid #e0e0e0; /* 分隔线的颜色和粗细 */"></view>
|
||||
|
||||
<view style="flex: 1;">
|
||||
<view style="flex: 40;text-align: center;">
|
||||
@ -199,7 +205,7 @@
|
||||
shelfCode: '',
|
||||
matCode: '',
|
||||
matName: '',
|
||||
matBatch:'',
|
||||
matBatch: '',
|
||||
matSpec: '',
|
||||
matQty: 0, //默认数量值
|
||||
|
||||
@ -278,22 +284,25 @@
|
||||
this.locationCode = res.data.data.locationCode;
|
||||
this.shelfId = res.data.data.shelfId;
|
||||
this.shelfCode = res.data.data.shelfCode;
|
||||
|
||||
this.shelfTypeOptions = res.data.data.shelfTypes;
|
||||
this.selectedShelfTypeIndex = getConfig("bindSelectedShelfTypeIndex", 0);
|
||||
var typeIndex = getConfig("bindSelectedShelfTypeIndex", 0);
|
||||
if (typeIndex + 1 < this.shelfTypeOptions.length) {
|
||||
this.selectedShelfTypeIndex = typeIndex;
|
||||
}
|
||||
|
||||
this.shelfAreaOptions = res.data.data.locationArea;
|
||||
|
||||
var index = getConfig("bindSelectedShelfAreaIndex", 0);
|
||||
if (index + 1 < this.shelfAreaOptions.length) {
|
||||
this.selectedShelfAreaIndex = index;
|
||||
}
|
||||
|
||||
if (this.shelfId == null) {
|
||||
this.shelfCode = '(工位无货架,请呼叫!)';
|
||||
this.isNeedScanLocationCode = false;
|
||||
this.isNeedCallShelfCode = true;
|
||||
this.placeholderText = '请呼叫货架';
|
||||
} else if (this.shelfId != null && this.shelfCode != null && this
|
||||
// if (this.shelfId == null) {
|
||||
// this.shelfCode = '(工位无货架,请呼叫!)';
|
||||
// this.isNeedScanLocationCode = false;
|
||||
// this.isNeedCallShelfCode = true;
|
||||
// this.placeholderText = '请呼叫货架';
|
||||
// } else
|
||||
if (this.shelfId != null && this.shelfCode != null && this
|
||||
.shelfCode.includes('运输中')) {
|
||||
this.placeholderText = '请等待货架运输';
|
||||
|
||||
@ -552,7 +561,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.shelfId == null) {
|
||||
if (this.shelfId == null || this.shelfId == 0) {
|
||||
uni.showToast({
|
||||
title: '当前工位无货架!无法送货架!',
|
||||
icon: 'none',
|
||||
|
@ -818,10 +818,10 @@ if (uni.restoreGlobal) {
|
||||
this.userName = getConfig("userName", "admin");
|
||||
const self = this;
|
||||
recive(function(res) {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:228", "Success:" + res.data);
|
||||
formatAppLog("log", "at pages/bind/bind.vue:234", "Success:" + res.data);
|
||||
self.analysisScanCode(res.data);
|
||||
}, function(err) {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:231", "Error:", JSON.stringify(err));
|
||||
formatAppLog("log", "at pages/bind/bind.vue:237", "Error:", JSON.stringify(err));
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
@ -829,11 +829,11 @@ if (uni.restoreGlobal) {
|
||||
cameraScanCode() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:239", "扫码结果:", res.result);
|
||||
formatAppLog("log", "at pages/bind/bind.vue:245", "扫码结果:", res.result);
|
||||
this.analysisScanCode(res.result);
|
||||
},
|
||||
fail: (err) => {
|
||||
formatAppLog("error", "at pages/bind/bind.vue:243", "扫码失败:", err);
|
||||
formatAppLog("error", "at pages/bind/bind.vue:249", "扫码失败:", err);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -869,18 +869,16 @@ if (uni.restoreGlobal) {
|
||||
this.shelfId = res.data.data.shelfId;
|
||||
this.shelfCode = res.data.data.shelfCode;
|
||||
this.shelfTypeOptions = res.data.data.shelfTypes;
|
||||
this.selectedShelfTypeIndex = getConfig("bindSelectedShelfTypeIndex", 0);
|
||||
var typeIndex = getConfig("bindSelectedShelfTypeIndex", 0);
|
||||
if (typeIndex + 1 < this.shelfTypeOptions.length) {
|
||||
this.selectedShelfTypeIndex = typeIndex;
|
||||
}
|
||||
this.shelfAreaOptions = res.data.data.locationArea;
|
||||
var index = getConfig("bindSelectedShelfAreaIndex", 0);
|
||||
if (index + 1 < this.shelfAreaOptions.length) {
|
||||
this.selectedShelfAreaIndex = index;
|
||||
}
|
||||
if (this.shelfId == null) {
|
||||
this.shelfCode = "(工位无货架,请呼叫!)";
|
||||
this.isNeedScanLocationCode = false;
|
||||
this.isNeedCallShelfCode = true;
|
||||
this.placeholderText = "请呼叫货架";
|
||||
} else if (this.shelfId != null && this.shelfCode != null && this.shelfCode.includes("运输中")) {
|
||||
if (this.shelfId != null && this.shelfCode != null && this.shelfCode.includes("运输中")) {
|
||||
this.placeholderText = "请等待货架运输";
|
||||
} else {
|
||||
this.isNeedScanLocationCode = false;
|
||||
@ -926,12 +924,12 @@ if (uni.restoreGlobal) {
|
||||
}
|
||||
},
|
||||
complete: (event) => {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:349", "请求完成", event);
|
||||
formatAppLog("log", "at pages/bind/bind.vue:358", "请求完成", event);
|
||||
}
|
||||
});
|
||||
},
|
||||
bindSelectedMat: function(item) {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:355", "用户选择了项目:", item);
|
||||
formatAppLog("log", "at pages/bind/bind.vue:364", "用户选择了项目:", item);
|
||||
this.matCode = item.matCode;
|
||||
this.matName = item.matName;
|
||||
this.matSpec = item.matSpec;
|
||||
@ -996,7 +994,7 @@ if (uni.restoreGlobal) {
|
||||
});
|
||||
},
|
||||
complete: (event) => {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:424", "请求完成", event);
|
||||
formatAppLog("log", "at pages/bind/bind.vue:433", "请求完成", event);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -1101,7 +1099,7 @@ if (uni.restoreGlobal) {
|
||||
});
|
||||
},
|
||||
complete: (event) => {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:538", "请求完成", event);
|
||||
formatAppLog("log", "at pages/bind/bind.vue:547", "请求完成", event);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -1115,7 +1113,7 @@ if (uni.restoreGlobal) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.shelfId == null) {
|
||||
if (this.shelfId == null || this.shelfId == 0) {
|
||||
uni.showToast({
|
||||
title: "当前工位无货架!无法送货架!",
|
||||
icon: "none",
|
||||
@ -1192,7 +1190,7 @@ if (uni.restoreGlobal) {
|
||||
});
|
||||
},
|
||||
complete: (event) => {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:640", "请求完成", event);
|
||||
formatAppLog("log", "at pages/bind/bind.vue:649", "请求完成", event);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -1220,7 +1218,7 @@ if (uni.restoreGlobal) {
|
||||
this.matQty = 0;
|
||||
},
|
||||
handlePopupClose() {
|
||||
formatAppLog("log", "at pages/bind/bind.vue:672", "弹出层已关闭");
|
||||
formatAppLog("log", "at pages/bind/bind.vue:681", "弹出层已关闭");
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1318,6 +1316,7 @@ if (uni.restoreGlobal) {
|
||||
}, "呼叫货架")
|
||||
])
|
||||
]),
|
||||
vue.createElementVNode("view", { style: { "border-bottom": "1rpx solid #e0e0e0" } }),
|
||||
vue.createElementVNode("view", {
|
||||
class: "diy-flex-inforow",
|
||||
style: { "flex": "1" }
|
||||
@ -1452,6 +1451,7 @@ if (uni.restoreGlobal) {
|
||||
}, "绑定")
|
||||
])
|
||||
]),
|
||||
vue.createElementVNode("view", { style: { "border-bottom": "1rpx solid #e0e0e0" } }),
|
||||
vue.createElementVNode("view", { style: { "flex": "1" } }, [
|
||||
vue.createElementVNode("view", { style: { "flex": "40", "text-align": "center" } }, [
|
||||
vue.createElementVNode("view", { class: "picker-container" }, [
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.Manager;
|
||||
using WCS.BLL.Services.IService;
|
||||
@ -40,7 +41,8 @@ namespace WCS.WebApi.Controllers
|
||||
}
|
||||
|
||||
//判断参数
|
||||
if (string.IsNullOrEmpty(request.LocationCode) && string.IsNullOrEmpty(request.ShelfCode))
|
||||
//if (string.IsNullOrEmpty(request.LocationCode) && string.IsNullOrEmpty(request.ShelfCode))
|
||||
if (string.IsNullOrEmpty(request.ShelfCode))
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
@ -52,12 +54,11 @@ namespace WCS.WebApi.Controllers
|
||||
|
||||
//获取是否存在当前工位
|
||||
//扫的工位码
|
||||
LocationInfo? location;
|
||||
LocationInfo? location = null;
|
||||
ShelfInfo? shelf;
|
||||
|
||||
if (!string.IsNullOrEmpty(request.LocationCode))
|
||||
{
|
||||
//TO DO 在哪些物料区域才能进行物料绑定
|
||||
location = await DbHelp.db.Queryable<LocationInfo>()
|
||||
.Where(t => t.LocationCode == request.LocationCode)
|
||||
.Where(t => t.IsEnable == true)
|
||||
@ -109,29 +110,29 @@ namespace WCS.WebApi.Controllers
|
||||
};
|
||||
}
|
||||
|
||||
if (shelf.CurrentLocationId == 0 || string.IsNullOrEmpty(shelf.CurrentLocaiotnCode))
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"货架[{request.ShelfCode}]未绑定工位!请尝试将货架与位置绑定后进行操作!",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
//if (shelf.CurrentLocationId == 0 || string.IsNullOrEmpty(shelf.CurrentLocaiotnCode))
|
||||
//{
|
||||
// return new ResponseCommon()
|
||||
// {
|
||||
// Code = 201,
|
||||
// Message = $"货架[{request.ShelfCode}]未绑定工位!请尝试将货架与位置绑定后进行操作!",
|
||||
// Data = null,
|
||||
// };
|
||||
//}
|
||||
|
||||
location = await DbHelp.db.Queryable<LocationInfo>()
|
||||
.Where(t => t.LocationCode == shelf.CurrentLocaiotnCode)
|
||||
.Where(t => t.IsEnable == true)
|
||||
.FirstAsync();
|
||||
if (location == null)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"工位[{shelf.CurrentLocaiotnCode}]不存在或已被禁用!\r\n请联系系统管理人员维护工位信息!",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
//if (location == null)
|
||||
//{
|
||||
// return new ResponseCommon()
|
||||
// {
|
||||
// Code = 201,
|
||||
// Message = $"工位[{shelf.CurrentLocaiotnCode}]不存在或已被禁用!\r\n请联系系统管理人员维护工位信息!",
|
||||
// Data = null,
|
||||
// };
|
||||
//}
|
||||
}
|
||||
|
||||
if (shelf != null && shelf.TransStatus == TransStatusEnum.运输中)
|
||||
@ -141,6 +142,10 @@ namespace WCS.WebApi.Controllers
|
||||
|
||||
//允许放置的货架类型
|
||||
var shelfTypes = new List<ShelfTypeModel>();
|
||||
|
||||
|
||||
if (location != null)
|
||||
{
|
||||
shelfTypes.Add(new ShelfTypeModel()
|
||||
{
|
||||
Id = 0,
|
||||
@ -153,9 +158,23 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
shelfTypes.Add(new ShelfTypeModel() { Id = t.Id, ShelfTypeName = t.ShelfTypeName });
|
||||
});
|
||||
//货架送回的区域
|
||||
}
|
||||
else
|
||||
{
|
||||
shelfTypes.Add(new ShelfTypeModel()
|
||||
{
|
||||
Id = 0,
|
||||
ShelfTypeName = "请先获取工位码"
|
||||
});
|
||||
}
|
||||
|
||||
var locationAreas = new List<LocationAreaInfoModel>();
|
||||
locationAreas.Add(new LocationAreaInfoModel {
|
||||
if (location != null)
|
||||
{
|
||||
//货架送回的区域
|
||||
|
||||
locationAreas.Add(new LocationAreaInfoModel
|
||||
{
|
||||
Id = 0,
|
||||
LocationAreaName = "请选择"
|
||||
});
|
||||
@ -166,6 +185,11 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
locationAreas.Add(new LocationAreaInfoModel() { Id = t.Id, LocationAreaName = t.LocationAreaName });
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
locationAreas.Add(new LocationAreaInfoModel() { Id = 0, LocationAreaName = "请先获取工位码" });
|
||||
}
|
||||
|
||||
return new ResponseBase<GetShelfInfoByLocationReturnData>()
|
||||
{
|
||||
@ -173,8 +197,8 @@ namespace WCS.WebApi.Controllers
|
||||
Message = $"success",
|
||||
Data = new GetShelfInfoByLocationReturnData()
|
||||
{
|
||||
LocationId = location.Id,
|
||||
LocationCode = location.LocationCode,
|
||||
LocationId = location == null ? 0 : location.Id,
|
||||
LocationCode = location?.LocationCode,
|
||||
ShelfId = shelf?.Id,
|
||||
ShelfCode = shelf?.ShelfCode,
|
||||
ShelfTypes = shelfTypes,
|
||||
@ -235,15 +259,15 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
#region 参数校验
|
||||
//判断参数
|
||||
if (request.LocationId == 0 || string.IsNullOrEmpty(request.LocationCode))
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "工位或工位编码为空!",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
//if (request.LocationId == 0 || string.IsNullOrEmpty(request.LocationCode))
|
||||
//{
|
||||
// return new ResponseCommon()
|
||||
// {
|
||||
// Code = 201,
|
||||
// Message = "工位或工位编码为空!",
|
||||
// Data = null,
|
||||
// };
|
||||
//}
|
||||
|
||||
if (request.ShelfId == 0 || string.IsNullOrEmpty(request.ShelfCode))
|
||||
{
|
||||
@ -289,36 +313,36 @@ namespace WCS.WebApi.Controllers
|
||||
|
||||
#region 数据校验
|
||||
//判断参数
|
||||
if (string.IsNullOrEmpty(request.LocationCode))
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "工位编码为空!",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
//if (string.IsNullOrEmpty(request.LocationCode))
|
||||
//{
|
||||
// return new ResponseCommon()
|
||||
// {
|
||||
// Code = 201,
|
||||
// Message = "工位编码为空!",
|
||||
// Data = null,
|
||||
// };
|
||||
//}
|
||||
|
||||
//获取是否存在当前工位
|
||||
var location = await DbHelp.db.Queryable<LocationInfo>()
|
||||
.Where(t => t.Id == request.LocationId)
|
||||
.Where(t => t.IsEnable == true)
|
||||
.FirstAsync();
|
||||
if (location == null)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"工位[{request.LocationCode}]不存在或已被禁用!\r\n请联系系统管理人员维护工位信息!",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
////获取是否存在当前工位
|
||||
//var location = await DbHelp.db.Queryable<LocationInfo>()
|
||||
// .Where(t => t.Id == request.LocationId)
|
||||
// .Where(t => t.IsEnable == true)
|
||||
// .FirstAsync();
|
||||
//if (location == null)
|
||||
//{
|
||||
// return new ResponseCommon()
|
||||
// {
|
||||
// Code = 201,
|
||||
// Message = $"工位[{request.LocationCode}]不存在或已被禁用!\r\n请联系系统管理人员维护工位信息!",
|
||||
// Data = null,
|
||||
// };
|
||||
//}
|
||||
|
||||
//获取当前工位的货架
|
||||
var shelf = await DbHelp.db.Queryable<ShelfInfo>()
|
||||
.Where(t => t.Id == request.ShelfId)
|
||||
.Where(t => t.CurrentLocationId == location.Id && t.TransStatus == TransStatusEnum.静止
|
||||
|| t.DestinationLocationId == location.Id && t.TransStatus == TransStatusEnum.运输中)//解决产线人员 呼叫后货架未到的时候绑定的问题
|
||||
//.Where(t => t.CurrentLocationId == location.Id && t.TransStatus == TransStatusEnum.静止
|
||||
// || t.DestinationLocationId == location.Id && t.TransStatus == TransStatusEnum.运输中)
|
||||
.Where(t => t.IsEnable == true)
|
||||
.FirstAsync();
|
||||
if (shelf == null)
|
||||
@ -326,7 +350,7 @@ namespace WCS.WebApi.Controllers
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 205,
|
||||
Message = $"货架[{request.ShelfCode}],已不在工位上!\r\n请进行【货架呼叫】!",
|
||||
Message = $"货架[{request.ShelfCode}]已被禁用!",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user