diff --git a/HHWMS.Web/Areas/Configs/Views/Print4/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/Print4/Index.cshtml
index 947fd2c..e153f21 100644
--- a/HHWMS.Web/Areas/Configs/Views/Print4/Index.cshtml
+++ b/HHWMS.Web/Areas/Configs/Views/Print4/Index.cshtml
@@ -1,57 +1,65 @@
-
+
+
+
+
+
+
+
+
+
+
+ 生成卷号
-
-
-
-
-
-
- 生成卷号
-
-
-
-
-
- @*
-
+
+
- *@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
创建入库单
@@ -59,8 +67,6 @@
打印
-
-
-
+
+
+
+
+
@@ -112,7 +122,7 @@
sn: '',
ph: ''
},
-
+ tk:false,
ckList: [
{
value: '1',
@@ -179,200 +189,267 @@
message: '取消输入'
});
});
- },
- // 拆解卷号
- splitJH() {
- var _this = this;
+ },
+ // 拆解卷号
+ splitJH() {
+ var _this = this;
- if (this.form.jh != "") {
+ if (this.form.jh != "") {
var list = this.form.jh.trim().split(/\s+/);
- var num = list.length;
- if (num > 0) {
- if (this.tableData.length > 0) {
- this.tableData = [];
- }
- while (num > 0) {
- if (list[list.length - num] != "") {
- this.tableData.push(JSON.parse(JSON.stringify({
- "Ware": this.ckList.filter(function (item) {
- return item.value == _this.form.ck;
- })[0].label,
- "CJ": this.form.cj,
- "JH": list[list.length - num],
- "Qty": "",
- "Len": "",
- "Lot": "",
- "Sn": "",
- "PH": "",
- "RQ": new Date().toLocaleDateString()
- })));
- }
- num--;
- }
- }
- }
- },
- // 拆解重量
- splitQty() {
- var _this = this;
- if (this.form.qty != "") {
- var list = this.form.qty.trim().split(/\s+/);
- if (list.length == this.tableData.length) {
- var nn = list.length - 1;
- while (nn >= 0) {
- _this.tableData[nn].Qty = list[nn];
- nn--;
+ var num = list.length;
+ if (num > 0) {
+ if (this.tableData.length > 0) {
+ this.tableData = [];
+ }
+ while (num > 0) {
+ if (list[list.length - num] != "") {
+ this.tableData.push(JSON.parse(JSON.stringify({
+ "Ware": this.ckList.filter(function (item) {
+ return item.value == _this.form.ck;
+ })[0].label,
+ "CJ": this.form.cj,
+ "JH": list[list.length - num],
+ "Qty": "",
+ "Len": "",
+ "Lot": "",
+ "Sn": "",
+ "PH": "",
+ "RQ": new Date().toLocaleDateString()
+ })));
+ }
+ num--;
+ }
}
- } else {
- layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
}
- }
- },
- // 拆解米数
- splitLen() {
- var _this = this;
- _this.tableData.forEach(function (item) {
- item.Len = _this.form.len;
- })
- // if (this.form.len != "") {
- // var list = this.form.len.trim().split(/\s+/);
- // if (list.length == this.tableData.length) {
- // var nn = list.length - 1;
- // while (nn >= 0) {
- // _this.tableData[nn].Len = list[nn];
- // nn--;
- // }
- // } else {
- // layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
- // }
- // }
- },
- // 拆解规格
- splitLot() {
- var _this = this;
- if (this.form.lot != "") {
- var list = this.form.lot.trim().split(/\s+/);
- if (list.length == this.tableData.length) {
- var nn = list.length - 1;
- while (nn >= 0) {
- _this.tableData[nn].Lot = list[nn];
- nn--;
+ },
+ // 拆解重量
+ splitQty() {
+ var _this = this;
+ if (this.form.qty != "") {
+ var list = this.form.qty.trim().split(/\s+/);
+ if (list.length == this.tableData.length) {
+ var nn = list.length - 1;
+ while (nn >= 0) {
+ _this.tableData[nn].Qty = list[nn];
+ nn--;
+ }
+ } else {
+ layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
}
- } else {
- layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
}
- }
- },
- // 拆解铁损
- splitSn() {
- var _this = this;
- _this.tableData.forEach(function (item) {
- item.Sn = _this.form.sn;
- })
- // if (this.form.sn != "") {
- // var list = this.form.sn.trim().split(/\s+/);
- // if (list.length == this.tableData.length) {
- // var nn = list.length - 1;
- // while (nn >= 0) {
- // _this.tableData[nn].Sn = list[nn];
- // nn--;
- // }
- // } else {
- // layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
- // }
- // }
- },
- // 拆解片厚
- splitPh() {
- var _this = this;
- _this.tableData.forEach(function (item) {
- item.PH = _this.form.ph;
- })
- // if (this.form.ph != "") {
- // var list = this.form.ph.trim().split(/\s+/);
- // if (list.length == this.tableData.length) {
- // var nn = list.length - 1;
- // while (nn >= 0) {
- // _this.tableData[nn].PH = list[nn];
- // nn--;
- // }
- // } else {
- // layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
- // }
- // }
- },
- splitCJ() {
- var _this = this;
- _this.tableData.forEach(function (item) {
- item.CJ = _this.form.cj;
- });
- },
- create() {
- var _this = this;
- if (_this.tableData.length == 0) {
- _this.$message({
- message: "当前无数据!!",
- type: "warning",
- duration: "500",
+ },
+ // 拆解米数
+ splitLen() {
+ var _this = this;
+ _this.tableData.forEach(function (item) {
+ item.Len = _this.form.len;
+ })
+ // if (this.form.len != "") {
+ // var list = this.form.len.trim().split(/\s+/);
+ // if (list.length == this.tableData.length) {
+ // var nn = list.length - 1;
+ // while (nn >= 0) {
+ // _this.tableData[nn].Len = list[nn];
+ // nn--;
+ // }
+ // } else {
+ // layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
+ // }
+ // }
+ },
+ // 拆解规格
+ splitLot() {
+ var _this = this;
+ if (this.form.lot != "") {
+ var list = this.form.lot.trim().split(/\s+/);
+ if (list.length == this.tableData.length) {
+ var nn = list.length - 1;
+ while (nn >= 0) {
+ _this.tableData[nn].Lot = list[nn];
+ nn--;
+ }
+ } else {
+ layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
+ }
+ }
+ },
+ // 拆解铁损
+ splitSn() {
+ var _this = this;
+ _this.tableData.forEach(function (item) {
+ item.Sn = _this.form.sn;
+ })
+ // if (this.form.sn != "") {
+ // var list = this.form.sn.trim().split(/\s+/);
+ // if (list.length == this.tableData.length) {
+ // var nn = list.length - 1;
+ // while (nn >= 0) {
+ // _this.tableData[nn].Sn = list[nn];
+ // nn--;
+ // }
+ // } else {
+ // layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
+ // }
+ // }
+ },
+ // 拆解片厚
+ splitPh() {
+ var _this = this;
+ _this.tableData.forEach(function (item) {
+ item.PH = _this.form.ph;
+ })
+ // if (this.form.ph != "") {
+ // var list = this.form.ph.trim().split(/\s+/);
+ // if (list.length == this.tableData.length) {
+ // var nn = list.length - 1;
+ // while (nn >= 0) {
+ // _this.tableData[nn].PH = list[nn];
+ // nn--;
+ // }
+ // } else {
+ // layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
+ // }
+ // }
+ },
+ splitCJ() {
+ var _this = this;
+ _this.tableData.forEach(function (item) {
+ item.CJ = _this.form.cj;
});
- return;
- }
+ },
+ create() {
+ var _this = this;
+ if (_this.tableData.length == 0) {
+ _this.$message({
+ message: "当前无数据!!",
+ type: "warning",
+ duration: "500",
+ });
+ return;
+ }
- // 调用后台方法,判断是否在物料表内
- $.ajax({
- type: "post",
- dataType: "json",
- data: { data: _this.tableData },
- url: "/xwms/ReceiptHeader2/CreateDetail4",
- success: function (json) {
- if (json.Code != 200) {
+ // 调用后台方法,判断是否在物料表内
+ $.ajax({
+ type: "post",
+ dataType: "json",
+ data: { data: _this.tableData },
+ url: "/xwms/ReceiptHeader2/CreateDetail4",
+ success: function (json) {
+ if (json.Code != 200) {
+ _this.$message({
+ message: "创建失败!" + json.Msg,
+ type: "warning",
+ duration: "10000",
+ });
+ return;
+ } else {
+ _this.$message({
+ message: "创建成功!"
+ });
+ }
+ },
+ error: function (json) {
_this.$message({
- message: "创建失败!" + json.Msg,
- type: "warning",
+ message: "创建失败!",
+ type: "error",
duration: "10000",
});
- return;
- } else {
- _this.$message({
- message: "创建成功!"
- });
- }
- },
- error: function (json) {
- _this.$message({
- message: "创建失败!",
- type: "error",
- duration: "10000",
- });
- },
- });
- },
-
- print() {
- var _this = this;
- _this.printData = [];
- _this.tableData.forEach(function (item) {
- _this.printData.push({
- ck: item.Ware,
- cj: item.CJ,
- lot: item.Lot,
- rq: item.RQ,
- qty: item.Qty,
- len: item.Len,
- jh: item.JH,
- sn: item.Sn,
- qrcode: item.JH,
- PH: item.PH
+ },
});
- });
+ },
+ scanJH() {
+ var _this = this;
+ if (_this.form.jh == "") {
+ _this.$message({
+ message: "当前无数据!!",
+ type: "warning",
+ duration: "500",
+ });
+ return;
+ }
- hiprint.init();
- var hiprintTemplate = new hiprint.PrintTemplate({
- template: this.template
- })
- hiprintTemplate.print(this.printData);
- },
- }
- });
+ // 调用后台方法,判断是否在物料表内
+ $.ajax({
+ type: "post",
+ dataType: "json",
+ data: { data: _this.form.jh },
+ url: "/xwms/ReceiptHeader2/ScanJh",
+ success: function (json) {
+ if (json.Code != 200) {
+ _this.$message({
+ message: "扫码失败!" + json.Msg,
+ type: "warning",
+ duration: "10000",
+ });
+ return;
+ } else {
+ _this.form.jh = "";
+ // UniqueCode = item.JH,
+ // MaterialSpec = item.Lot,
+ // MaterialType = item.Sn,
+ // Qty = item.Qty,
+ // Batch = item.PH,
+ // CreateTime = DateTime.Now,
+ let isExit = 0;
+ _this.tableData.forEach(function (item) {
+ if (item.JH == json.Data.UniqueCode) {
+ _this.$message({
+ message: "扫码失败!重复扫码",
+ type: "warning",
+ duration: "10000",
+ });
+ isExit = 1;
+ }
+ });
+ if (isExit == 0) {
+ _this.tableData.push({
+ "Ware": "立库",
+ "CJ":json.Data.SourceCode,
+ "Len":json.Data.Lot,
+ "JH": json.Data.UniqueCode,
+ "Lot": json.Data.MaterialSpec,
+ "Sn": json.Data.MaterialType,
+ "Qty": json.Data.Qty,
+ "PH": json.Data.Batch,
+ "RQ": json.Data.CreateTime.substring(0, 10)
+ })
+ }
+ }
+ },
+ error: function (json) {
+ _this.$message({
+ message: "扫码失败!",
+ type: "error",
+ duration: "10000",
+ });
+ },
+ });
+ },
+ print() {
+ var _this = this;
+ _this.printData = [];
+ _this.tableData.forEach(function (item) {
+ _this.printData.push({
+ ck: item.Ware,
+ cj: item.CJ,
+ lot: item.Lot,
+ rq: item.RQ,
+ qty: item.Qty,
+ len: item.Len,
+ jh: item.JH,
+ sn: item.Sn,
+ qrcode: item.JH,
+ PH: item.PH
+ });
+ });
+
+ hiprint.init();
+ var hiprintTemplate = new hiprint.PrintTemplate({
+ template: this.template
+ })
+ hiprintTemplate.print(this.printData);
+ },
+ }
+ });
diff --git a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs
index 60f4c76..4aa9eca 100644
--- a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs
+++ b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs
@@ -322,6 +322,7 @@ namespace HHWMS.Web.Controllers
detail.SourceLine = receipt.SourceLine;
detail.MaterialCode = receipt.MaterialCode;
detail.MaterialName = receipt.MaterialName;
+ detail.Coefficient = receipt.Coefficient;
detail.Lot = receipt.Lot;
detail.SupplierCode = receipt.SupplierCode;
detail.SupplierName = receipt.SupplierName;
diff --git a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs
index 27e48f6..d06518b 100644
--- a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs
+++ b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs
@@ -419,6 +419,8 @@ namespace HHWMS.Web.Controllers
MaterialType = item.Sn,
Qty = item.Qty,
Batch = item.PH,
+ Lot = item.Len,
+ SourceCode = item.CJ,
CreateTime = DateTime.Now,
});
}
@@ -456,6 +458,18 @@ namespace HHWMS.Web.Controllers
}
return JsonMore(str);
}
+
+ [Public]
+ [HttpPost]
+ [ActionDescription("Sys.ScanJh")]
+ public ActionResult ScanJh(string data) {
+ var material = _unitwork.FindSingle(x => x.UniqueCode == data);
+ if(material == null)
+ {
+ return JsonMore(null,500,$"卷号{data}未找到!");
+ }
+ return JsonMore(material);
+ }
}
public class receipt4
@@ -465,9 +479,10 @@ namespace HHWMS.Web.Controllers
///
public string JH { get; set; }
public decimal Qty { get; set; }
- public decimal Len { get; set; }
+ public string Len { get; set; }
public string Lot { get; set; }
public string Sn { get; set;}
+ public string CJ { get; set; }
///
/// 片厚
///
diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml
index 8cd66cf..3961b42 100644
--- a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml
+++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml
@@ -14,7 +14,7 @@
打印
- 拆分
+ 拆分
@@ -50,7 +50,8 @@
qty:'',
loading: false,
tableData: [],
- sumQty:0
+ sumQty:0,
+ disabledChaiButton:false
};
},
mounted: function () {
@@ -112,6 +113,7 @@
},
chaiBill() {
var _this = this;
+ var loadIndex = layer.load(0);
$.ajax({
type: "post",
dataType: "json",
@@ -120,13 +122,16 @@
},
url: "/xwms/ReceiptDetail2/ChaiDetail",
success: function (json) {
+ layer.close(loadIndex);
if (json.Code == 200) {
layer.msg("拆分数据成功");
+ _this.disabledChaiButton = true;
} else {
layer.alert(json.Msg, { icon: 5, shadeClose: true, title: "错误信息" });
}
},
error: function (json) {
+ layer.close(loadIndex);
layer.alert("失败", { icon: 5, shadeClose: true, title: "错误信息" });
}
});