库存回传新增flag

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

No files matched your search

@@ -247,7 +247,8 @@ namespace HHWMS.Web.Controllers
ERPSN = qr,
WMSSN = inv?.UniqueCode,
QTY = ((int?)inv?.Qty).ToString(),
TYPE = "2"
TYPE = "2",
FLAG = "1"
}
}
}
@@ -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)
@@ -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,6 +127,11 @@
// 呼叫料箱
callBox() {
var _this = this;
this.$confirm('确定要呼叫料盒出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
@@ -154,6 +159,13 @@
});
},
});
}).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,6 +332,11 @@
});
return;
}
this.$confirm('确定执行回库动作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
@@ -347,6 +364,12 @@
});
},
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
},
});
@@ -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,6 +217,11 @@
});
return;
}
this.$confirm('确定执行回库动作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
@@ -250,6 +249,12 @@
});
},
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
},
});
@@ -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);
@@ -78,6 +78,8 @@ namespace MESTOWMSService
foreach(var item in data.OUTWMS.OUTITEM)
{
var materialqr = _unitwork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(item.SN));
if (materialqr != null)
{
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(materialqr.QRCode));
var detail = new ShipmentDetail
@@ -98,7 +100,15 @@ namespace MESTOWMSService
};
shipment.ShipmentDetails.Add(detail);
}
else
{
return new Result { Status = "N", Message = $"物料不存在库内!" };
}
}
if(shipment.ShipmentDetails.Count > 0)
{
_unitwork.Add(shipment);
}
return new Result();
}
catch (Exception ex)
@@ -166,6 +166,7 @@ namespace HHWMS.Web
///
/// </summary>
public string WMSSN { get; set; }
public string FLAG { get; set; }
}
public class INITEMS