库存回传新增flag

新增入库单明细,判断重复
出库页面修改 散料出库后回库按钮
This commit is contained in:
zgf 2023-11-27 12:56:54 +08:00
parent 0269655891
commit c27a357771
7 changed files with 155 additions and 104 deletions

View File

@ -247,7 +247,8 @@ namespace HHWMS.Web.Controllers
ERPSN = qr,
WMSSN = inv?.UniqueCode,
QTY = ((int?)inv?.Qty).ToString(),
TYPE = "2"
TYPE = "2",
FLAG = "1"
}
}
}

View File

@ -167,6 +167,16 @@ namespace HHWMS.Web.Controllers
{
return FFResult().Alert("新增明细中,存在重复的唯一码!");
}
// 判断唯一码是否已在库内
var reDetailList = _unitwork.Find<ReceiptDetail>(x => 1 == 1)
.Select(x => x.UniqueCode)
.ToList();
if (reDetailList.Intersect(detailList.Select(x => x.UniqueCode)).Count() > 0)
{
return FFResult().Alert("新增明细中,存在已添加的唯一码!");
}
// 判断唯一码是否已在库内
var invList = _unitwork.Find<Inventory>(x => 1 == 1)
.Select(x => x.UniqueCode)

View File

@ -80,7 +80,7 @@
<el-form-item style="float: right">
<el-button type="primary" @@click="onSubmit">绑定</el-button>
<el-button @@click="resetForm('form')">重置</el-button>
<el-button type="primary" @@click="back">回库</el-button>
<el-button type="success" @@click="back">回库</el-button>
</el-form-item>
</el-form>
</el-card>
@ -127,33 +127,45 @@
// 呼叫料箱
callBox() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {},
url: "/receipt/ReceiptSLIn/CallBox",
success: function (json) {
if (json.Code == 200) {
this.$confirm('确定要呼叫料盒出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
data: {},
url: "/receipt/ReceiptSLIn/CallBox",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "呼叫成功!",
});
// _this.resetForm('form');
} else {
_this.$message({
message: "呼叫失败!" + json.Msg,
type: "warning",
duration: "10000",
});
}
},
error: function (json) {
_this.$message({
message: "呼叫成功!",
});
// _this.resetForm('form');
} else {
_this.$message({
message: "呼叫失败!" + json.Msg,
type: "warning",
message: "呼叫失败!",
type: "error",
duration: "10000",
});
}
},
error: function (json) {
_this.$message({
message: "呼叫失败!",
type: "error",
duration: "10000",
});
},
},
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
// 扫描散料箱
scanBox(data) {
@ -312,7 +324,7 @@
back() {
var _this = this;
// 创建回库任务
if (_this.code == "") {
if (_this.form.code == "") {
_this.$message({
message: "箱号为空,不能创建回库任务!",
type: "error",
@ -320,32 +332,43 @@
});
return;
}
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: _this.form.code, isFull: _this.form.isFull },
url: "/receipt/ReceiptSLIn/BoxBack",
success: function (json) {
if (json.Code != 200) {
this.$confirm('确定执行回库动作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: _this.form.code, isFull: _this.form.isFull },
url: "/receipt/ReceiptSLIn/BoxBack",
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "回库任务创建失败!" + json.Msg,
type: "warning",
duration: "10000",
});
} else {
_this.$message({
message: "回库任务创建成功!"
});
_this.resetForm('form');
}
},
error: function (json) {
_this.$message({
message: "回库任务创建失败!" + json.Msg,
type: "warning",
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
} else {
_this.$message({
message: "回库任务创建成功!"
});
_this.resetForm('form');
}
},
error: function (json) {
_this.$message({
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
},
},
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
},

View File

@ -26,7 +26,7 @@
</el-row>
<el-row v-show="showTable">
<el-divider></el-divider>
<el-table :data="invTable" height="400" stripe border @@row-click="selectdata"
<el-table :data="invTable" height="200" stripe border @@row-click="selectdata"
style="width: 100%">
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
@ -62,15 +62,10 @@
<el-input v-model.number="form.qty" ref="qty" ></el-input>
</el-form-item>
</el-col>
<el-form-item style="float:right">
<el-button type="primary" @@click="onSubmit">拣货</el-button>
</el-form-item>
</el-row>
<el-row v-show="showBack">
<el-divider></el-divider>
<el-form-item style="float: right">
<el-button type="primary" @@click="back">回库</el-button>
<el-button v-show="showBack" type="success" @@click="back">回库</el-button>
</el-form-item>
</el-row>
</el-form>
@ -114,10 +109,6 @@
select(data) {
this.form.code = "";
this.form.type = data;
if (data == "slbox")
this.showBack = true;
else
this.showBack = fasle;
},
// 扫描料塔站台号
scanCode(data) {
@ -193,6 +184,9 @@
arr.splice(index, 1);
}
});
if (_this.invTable.length == 0 && _this.form.type == "slbox") {
_this.showBack = true;
}
_this.$refs['form'].resetFields();
} else {
_this.$message({
@ -223,32 +217,43 @@
});
return;
}
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: _this.form.code, isFull: _this.form.isFull },
url: "/shipment/ShipOut/BoxBack",
success: function (json) {
if (json.Code != 200) {
this.$confirm('确定执行回库动作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: _this.form.code, isFull: _this.form.isFull },
url: "/shipment/ShipOut/BoxBack",
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "回库任务创建失败!" + json.Msg,
type: "warning",
duration: "10000",
});
} else {
_this.$message({
message: "回库任务创建成功!"
});
_this.resetForm('form');
}
},
error: function (json) {
_this.$message({
message: "回库任务创建失败!" + json.Msg,
type: "warning",
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
} else {
_this.$message({
message: "回库任务创建成功!"
});
_this.resetForm('form');
}
},
error: function (json) {
_this.$message({
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
},
},
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
},

View File

@ -53,7 +53,8 @@ namespace HHWMS.Web
ERPSN = qr,
WMSSN = inv?.UniqueCode,
QTY = ((int?)inv?.Qty).ToString(),
TYPE = "2"
TYPE = "2",
FLAG = "1"
});
}
var str = JsonConvert.SerializeObject(bizData);

View File

@ -78,27 +78,37 @@ namespace MESTOWMSService
foreach(var item in data.OUTWMS.OUTITEM)
{
var materialqr = _unitwork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(item.SN));
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(materialqr.QRCode));
var detail = new ShipmentDetail
if (materialqr != null)
{
UniqueCode = item.SN,
MaterialCode = material?.MaterialCode,
MaterialName = material?.MaterialName,
MaterialSpec = material?.MaterialSpec,
MaterialType = material?.MaterialType,
MaterialUnit = material?.MaterialUnit,
Batch = material?.Batch,
DividedQty = 0,
Qty = material?.Qty,
CompanyCode = item?.FACTORY,
ManufactureDate = Convert.ToDateTime(item.MESDATE),
Status = ShipStatusEnum.新建,
CreateTime = DateTime.Now
};
shipment.ShipmentDetails.Add(detail);
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(materialqr.QRCode));
var detail = new ShipmentDetail
{
UniqueCode = item.SN,
MaterialCode = material?.MaterialCode,
MaterialName = material?.MaterialName,
MaterialSpec = material?.MaterialSpec,
MaterialType = material?.MaterialType,
MaterialUnit = material?.MaterialUnit,
Batch = material?.Batch,
DividedQty = 0,
Qty = material?.Qty,
CompanyCode = item?.FACTORY,
ManufactureDate = Convert.ToDateTime(item.MESDATE),
Status = ShipStatusEnum.新建,
CreateTime = DateTime.Now
};
shipment.ShipmentDetails.Add(detail);
}
else
{
return new Result { Status = "N", Message = $"物料不存在库内!" };
}
}
if(shipment.ShipmentDetails.Count > 0)
{
_unitwork.Add(shipment);
}
_unitwork.Add(shipment);
return new Result();
}
catch (Exception ex)

View File

@ -166,6 +166,7 @@ namespace HHWMS.Web
///
/// </summary>
public string WMSSN { get; set; }
public string FLAG { get; set; }
}
public class INITEMS