库存回传新增flag

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

No files matched your search

@@ -247,7 +247,8 @@ namespace HHWMS.Web.Controllers
ERPSN = qr, ERPSN = qr,
WMSSN = inv?.UniqueCode, WMSSN = inv?.UniqueCode,
QTY = ((int?)inv?.Qty).ToString(), QTY = ((int?)inv?.Qty).ToString(),
TYPE = "2" TYPE = "2",
FLAG = "1"
} }
} }
} }
@@ -167,6 +167,16 @@ namespace HHWMS.Web.Controllers
{ {
return FFResult().Alert("新增明细中,存在重复的唯一码!"); 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) var invList = _unitwork.Find<Inventory>(x => 1 == 1)
.Select(x => x.UniqueCode) .Select(x => x.UniqueCode)
@@ -80,7 +80,7 @@
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button type="primary" @@click="onSubmit">绑定</el-button> <el-button type="primary" @@click="onSubmit">绑定</el-button>
<el-button @@click="resetForm('form')">重置</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-item>
</el-form> </el-form>
</el-card> </el-card>
@@ -127,33 +127,45 @@
// 呼叫料箱 // 呼叫料箱
callBox() { callBox() {
var _this = this; var _this = this;
$.ajax({ this.$confirm('确定要呼叫料盒出库?', '提示', {
type: "post", confirmButtonText: '确定',
dataType: "json", cancelButtonText: '取消',
data: {}, type: 'warning'
url: "/receipt/ReceiptSLIn/CallBox", }).then(() => {
success: function (json) { $.ajax({
if (json.Code == 200) { 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({ _this.$message({
message: "呼叫成功!", message: "呼叫失败!",
}); type: "error",
// _this.resetForm('form');
} else {
_this.$message({
message: "呼叫失败!" + json.Msg,
type: "warning",
duration: "10000", duration: "10000",
}); });
} },
}, });
error: function (json) { }).catch(() => {
_this.$message({ this.$message({
message: "呼叫失败!", type: 'info',
type: "error", message: '已取消'
duration: "10000", });
});
},
}); });
}, },
// 扫描散料箱 // 扫描散料箱
scanBox(data) { scanBox(data) {
@@ -312,7 +324,7 @@
back() { back() {
var _this = this; var _this = this;
// 创建回库任务 // 创建回库任务
if (_this.code == "") { if (_this.form.code == "") {
_this.$message({ _this.$message({
message: "箱号为空,不能创建回库任务!", message: "箱号为空,不能创建回库任务!",
type: "error", type: "error",
@@ -320,32 +332,43 @@
}); });
return; return;
} }
$.ajax({ this.$confirm('确定执行回库动作?', '提示', {
type: "post", confirmButtonText: '确定',
dataType: "json", cancelButtonText: '取消',
data: { boxCode: _this.form.code, isFull: _this.form.isFull }, type: 'warning'
url: "/receipt/ReceiptSLIn/BoxBack", }).then(() => {
success: function (json) { $.ajax({
if (json.Code != 200) { 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({ _this.$message({
message: "回库任务创建失败!" + json.Msg, message: "回库任务创建失败!",
type: "warning", type: "error",
duration: "10000", duration: "10000",
}); });
} else { },
_this.$message({ });
message: "回库任务创建成功!" }).catch(() => {
}); this.$message({
_this.resetForm('form'); type: 'info',
} message: '已取消'
}, });
error: function (json) {
_this.$message({
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
},
}); });
} }
}, },
@@ -26,7 +26,7 @@
</el-row> </el-row>
<el-row v-show="showTable"> <el-row v-show="showTable">
<el-divider></el-divider> <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%"> style="width: 100%">
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column> <el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
<el-table-column label="编码" align="center" prop="MaterialCode"></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-input v-model.number="form.qty" ref="qty" ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-form-item style="float:right"> <el-form-item style="float:right">
<el-button type="primary" @@click="onSubmit">拣货</el-button> <el-button type="primary" @@click="onSubmit">拣货</el-button>
</el-form-item> <el-button v-show="showBack" type="success" @@click="back">回库</el-button>
</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-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
@@ -114,10 +109,6 @@
select(data) { select(data) {
this.form.code = ""; this.form.code = "";
this.form.type = data; this.form.type = data;
if (data == "slbox")
this.showBack = true;
else
this.showBack = fasle;
}, },
// 扫描料塔站台号 // 扫描料塔站台号
scanCode(data) { scanCode(data) {
@@ -193,6 +184,9 @@
arr.splice(index, 1); arr.splice(index, 1);
} }
}); });
if (_this.invTable.length == 0 && _this.form.type == "slbox") {
_this.showBack = true;
}
_this.$refs['form'].resetFields(); _this.$refs['form'].resetFields();
} else { } else {
_this.$message({ _this.$message({
@@ -223,32 +217,43 @@
}); });
return; return;
} }
$.ajax({ this.$confirm('确定执行回库动作?', '提示', {
type: "post", confirmButtonText: '确定',
dataType: "json", cancelButtonText: '取消',
data: { boxCode: _this.form.code, isFull: _this.form.isFull }, type: 'warning'
url: "/shipment/ShipOut/BoxBack", }).then(() => {
success: function (json) { $.ajax({
if (json.Code != 200) { 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({ _this.$message({
message: "回库任务创建失败!" + json.Msg, message: "回库任务创建失败!",
type: "warning", type: "error",
duration: "10000", duration: "10000",
}); });
} else { },
_this.$message({ });
message: "回库任务创建成功!" }).catch(() => {
}); this.$message({
_this.resetForm('form'); type: 'info',
} message: '已取消'
}, });
error: function (json) {
_this.$message({
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
},
}); });
} }
}, },
@@ -53,7 +53,8 @@ namespace HHWMS.Web
ERPSN = qr, ERPSN = qr,
WMSSN = inv?.UniqueCode, WMSSN = inv?.UniqueCode,
QTY = ((int?)inv?.Qty).ToString(), QTY = ((int?)inv?.Qty).ToString(),
TYPE = "2" TYPE = "2",
FLAG = "1"
}); });
} }
var str = JsonConvert.SerializeObject(bizData); var str = JsonConvert.SerializeObject(bizData);
+29 -19
View File
@@ -78,27 +78,37 @@ namespace MESTOWMSService
foreach(var item in data.OUTWMS.OUTITEM) foreach(var item in data.OUTWMS.OUTITEM)
{ {
var materialqr = _unitwork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(item.SN)); var materialqr = _unitwork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(item.SN));
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(materialqr.QRCode)); if (materialqr != null)
var detail = new ShipmentDetail
{ {
UniqueCode = item.SN, var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(materialqr.QRCode));
MaterialCode = material?.MaterialCode,
MaterialName = material?.MaterialName, var detail = new ShipmentDetail
MaterialSpec = material?.MaterialSpec, {
MaterialType = material?.MaterialType, UniqueCode = item.SN,
MaterialUnit = material?.MaterialUnit, MaterialCode = material?.MaterialCode,
Batch = material?.Batch, MaterialName = material?.MaterialName,
DividedQty = 0, MaterialSpec = material?.MaterialSpec,
Qty = material?.Qty, MaterialType = material?.MaterialType,
CompanyCode = item?.FACTORY, MaterialUnit = material?.MaterialUnit,
ManufactureDate = Convert.ToDateTime(item.MESDATE), Batch = material?.Batch,
Status = ShipStatusEnum.新建, DividedQty = 0,
CreateTime = DateTime.Now Qty = material?.Qty,
}; CompanyCode = item?.FACTORY,
shipment.ShipmentDetails.Add(detail); 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(); return new Result();
} }
catch (Exception ex) catch (Exception ex)
@@ -166,6 +166,7 @@ namespace HHWMS.Web
/// ///
/// </summary> /// </summary>
public string WMSSN { get; set; } public string WMSSN { get; set; }
public string FLAG { get; set; }
} }
public class INITEMS public class INITEMS