铁芯打印
入库单明细拆分,打印拆分 出库对账(仓库建使用)
This commit is contained in:
1 parent
d19f62e48b
commit
cec65caa32
11 files changed
+164
-51
No files matched your search
@@ -70,7 +70,66 @@
|
|||||||
lot:'',
|
lot:'',
|
||||||
num: 1,
|
num: 1,
|
||||||
clear: false,
|
clear: false,
|
||||||
template: { "panels": [{ "index": 0, "height": 50, "width": 80, "paperHeader": 43.5, "paperFooter": 141.73228346456693, "printElements": [{ "options": { "left": 96, "top": 19.5, "height": 87, "width": 120, "field": "qrcode", "testData": "12312312312", "textType": "qrcode" }, "printElementType": { "type": "text" } }, { "options": { "left": 16.5, "top": 24, "height": 25.5, "width": 69, "field": "px", "testData": "123123", "textAlign": "center", "textContentVerticalAlign": "middle" }, "printElementType": { "type": "text" } }, { "options": { "left": 16.5, "top": 67.5, "height": 24, "width": 67.5, "field": "lot", "testData": "1231231", "textAlign": "center", "textContentVerticalAlign": "middle" }, "printElementType": { "type": "text" } }], "paperNumberLeft": 196.5, "paperNumberTop": 118.5, "paperNumberDisabled": true }] }
|
template: {
|
||||||
|
"panels": [{
|
||||||
|
"index": 0,
|
||||||
|
"height": 50,
|
||||||
|
"width": 80,
|
||||||
|
"paperHeader": 43.5,
|
||||||
|
"paperFooter": 141.73228346456693,
|
||||||
|
"printElements": [{
|
||||||
|
"options": {
|
||||||
|
"left": 93,
|
||||||
|
"top": 39,
|
||||||
|
"height": 87,
|
||||||
|
"width": 120,
|
||||||
|
"field": "qrcode",
|
||||||
|
"testData": "12312312312",
|
||||||
|
"textType": "qrcode"
|
||||||
|
},
|
||||||
|
"printElementType": {
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"options": {
|
||||||
|
"left": 15,
|
||||||
|
"top": 46.5,
|
||||||
|
"height": 28.5,
|
||||||
|
"width": 72,
|
||||||
|
"field": "px",
|
||||||
|
"testData": "123123",
|
||||||
|
"textAlign": "center",
|
||||||
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei",
|
||||||
|
"fontSize": 8,
|
||||||
|
"fontWeight": "bold"
|
||||||
|
},
|
||||||
|
"printElementType": {
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"options": {
|
||||||
|
"left": 13.5,
|
||||||
|
"top": 9,
|
||||||
|
"height": 24,
|
||||||
|
"width": 198,
|
||||||
|
"field": "lot",
|
||||||
|
"testData": "1231231",
|
||||||
|
"textAlign": "center",
|
||||||
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei",
|
||||||
|
"fontSize": 8,
|
||||||
|
"fontWeight": "bold"
|
||||||
|
},
|
||||||
|
"printElementType": {
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"paperNumberLeft": 196.5,
|
||||||
|
"paperNumberTop": 118.5,
|
||||||
|
"paperNumberDisabled": true
|
||||||
|
}]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using HHWMS.Web;
|
|||||||
using HHWMS.Web.Models;
|
using HHWMS.Web.Models;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
namespace HHWMS.Web.Controllers
|
namespace HHWMS.Web.Controllers
|
||||||
{
|
{
|
||||||
@@ -268,6 +269,13 @@ namespace HHWMS.Web.Controllers
|
|||||||
return PartialView(vm);
|
return PartialView(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ActionDescription("Sys.Prints")]
|
||||||
|
[FixConnection(CsName = "hangyong")]
|
||||||
|
public ActionResult Prints(string ids)
|
||||||
|
{
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
[ActionDescription("Sys.SearchDetail")]
|
[ActionDescription("Sys.SearchDetail")]
|
||||||
[FixConnection(CsName = "hangyong")]
|
[FixConnection(CsName = "hangyong")]
|
||||||
public ActionResult SearchDetail(int id)
|
public ActionResult SearchDetail(int id)
|
||||||
@@ -301,10 +309,26 @@ namespace HHWMS.Web.Controllers
|
|||||||
var ll = new List<ReceiptDetail2>();
|
var ll = new List<ReceiptDetail2>();
|
||||||
foreach (var item in data.Skip(1))
|
foreach (var item in data.Skip(1))
|
||||||
{
|
{
|
||||||
var re = receipt;
|
var detail = new ReceiptDetail2();
|
||||||
re.ID = null;
|
detail.WarehouseId = receipt.WarehouseId;
|
||||||
re.Qty = item.Qty;
|
detail.ReceiptId = receipt.ReceiptId;
|
||||||
ll.Add(re);
|
detail.ReceiptCode = receipt.ReceiptCode;
|
||||||
|
detail.SourceCode = receipt.SourceCode;
|
||||||
|
detail.SourceLine = receipt.SourceLine;
|
||||||
|
detail.MaterialCode = receipt.MaterialCode;
|
||||||
|
detail.MaterialName = receipt.MaterialName;
|
||||||
|
detail.Lot = receipt.Lot;
|
||||||
|
detail.SupplierCode = receipt.SupplierCode;
|
||||||
|
detail.SupplierName = receipt.SupplierName;
|
||||||
|
detail.Qty = item.Qty;
|
||||||
|
detail.Unit = receipt.Unit;
|
||||||
|
detail.PurchasQty = receipt.PurchasQty;
|
||||||
|
detail.PurchasUnits = receipt.PurchasUnits;
|
||||||
|
detail.InventoryStatus = receipt.InventoryStatus;
|
||||||
|
detail.Batch = receipt.Batch;
|
||||||
|
detail.Status = 0;
|
||||||
|
detail.CreateTime = DateTime.Now;
|
||||||
|
ll.Add(detail);
|
||||||
}
|
}
|
||||||
_unit.BatchAdd(ll.ToArray());
|
_unit.BatchAdd(ll.ToArray());
|
||||||
tran.Commit();
|
tran.Commit();
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace HHWMS.Web.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return FFResult().CloseDialog().RefreshGrid();
|
return FFResult().CloseDialog().RefreshGrid(index:0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -479,29 +479,47 @@ namespace HHWMS.Web.Controllers
|
|||||||
{
|
{
|
||||||
return JsonMore(null, 500, "ERP无足够库存!");
|
return JsonMore(null, 500, "ERP无足够库存!");
|
||||||
}
|
}
|
||||||
if(ship.Qty <= item.QTYSTU_0)
|
var qty = ship.Qty;
|
||||||
|
int skipNum = 0;
|
||||||
|
|
||||||
|
while(qty > 0)
|
||||||
{
|
{
|
||||||
|
item = data.Skip(skipNum).Take(1).FirstOrDefault();
|
||||||
|
// 新建明细
|
||||||
|
var newShip = new ShipmentDetail2();
|
||||||
|
newShip.WarehouseId = ship.WarehouseId;
|
||||||
|
newShip.ShipmentId = ship.ShipmentId;
|
||||||
|
newShip.ShipmentCode = ship.ShipmentCode;
|
||||||
|
newShip.SourceCode = ship.SourceCode;
|
||||||
|
newShip.SourceLine = ship.SourceLine;
|
||||||
|
newShip.MaterialCode = ship.MaterialCode;
|
||||||
|
newShip.MaterialName = ship.MaterialName;
|
||||||
|
newShip.Lot = ship.Lot;
|
||||||
|
newShip.Unit = ship.Unit;
|
||||||
|
newShip.PurchasQty = ship.PurchasQty;
|
||||||
|
newShip.PurchasUnits = ship.PurchasUnits;
|
||||||
|
newShip.Status = 0;
|
||||||
|
newShip.CreateTime = DateTime.Now;
|
||||||
|
if (qty <= item.QTYSTU_0)
|
||||||
|
{
|
||||||
|
ship.Qty = qty;
|
||||||
ship.Batch = item.LOT_0;
|
ship.Batch = item.LOT_0;
|
||||||
ship.InventoryStatus = item.STA_0;
|
ship.InventoryStatus = item.STA_0;
|
||||||
_unitwork.Update(ship);
|
_unitwork.Update(ship);
|
||||||
|
|
||||||
|
qty = 0;
|
||||||
}
|
}
|
||||||
else if(ship.Qty > item.QTYSTU_0)
|
else if (qty > item.QTYSTU_0)
|
||||||
{
|
{
|
||||||
var newShip = ship;
|
newShip.Qty = item.QTYSTU_0;
|
||||||
newShip.ID = null;
|
newShip.Batch = item.LOT_0;
|
||||||
newShip.Qty = ship.Qty - item.QTYSTU_0;
|
newShip.InventoryStatus = item.STA_0;
|
||||||
_unitwork.Add(newShip);
|
_unitwork.Add(newShip);
|
||||||
|
|
||||||
ship.Qty = item.QTYSTU_0;
|
qty = qty - item.QTYSTU_0;
|
||||||
ship.Batch = item.LOT_0;
|
skipNum++;
|
||||||
ship.InventoryStatus = item.STA_0;
|
|
||||||
_unitwork.Update(ship);
|
|
||||||
|
|
||||||
data.Remove(item);
|
|
||||||
|
|
||||||
Check(newShip.ID.ToString(), data);
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
return JsonMore(null);
|
return JsonMore(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ public class XWMSMFMController : BaseController
|
|||||||
{
|
{
|
||||||
var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode;
|
var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode;
|
||||||
var _unitwork = new UnitWork(Wtm);
|
var _unitwork = new UnitWork(Wtm);
|
||||||
|
|
||||||
|
var codeList = data.AsEnumerable().Select(x => x.ITMREF_0).ToHashSet();
|
||||||
|
var matList = _unitwork.Find<Material2>(x => codeList.Contains(x.Code));
|
||||||
|
|
||||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||||
using (var tran = dc.BeginTransaction())
|
using (var tran = dc.BeginTransaction())
|
||||||
{
|
{
|
||||||
@@ -129,11 +133,12 @@ public class XWMSMFMController : BaseController
|
|||||||
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
||||||
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
||||||
detail.Qty = item.THISQTYSTU;
|
detail.Qty = item.THISQTYSTU;
|
||||||
detail.Unit = item.BOMSEQ_0.ToString();
|
detail.Unit = matList.FirstOrDefault(y => y.Code == item.ITMREF_0)?.MasterUnit ?? "";
|
||||||
//detail.PurchasQty = item.THISQTYUOM;
|
//detail.PurchasQty = item.THISQTYUOM;
|
||||||
//detail.PurchasUnits = item.UOM_0;
|
//detail.PurchasUnits = item.PurchasUnits;
|
||||||
//detail.InventoryStatus = item.STA_0;
|
//detail.InventoryStatus = item.STA_0;
|
||||||
//detail.Batch = _unitwork.GetSerialNumber("HYB", 5).Remove(3, 2);
|
//detail.Batch = _unitwork.GetSerialNumber("HYB", 5).Remove(3, 2);
|
||||||
|
detail.UserDef3 = item.BOMSEQ_0.ToString();
|
||||||
detail.Status = 0;
|
detail.Status = 0;
|
||||||
detail.CreateTime = DateTime.Now;
|
detail.CreateTime = DateTime.Now;
|
||||||
detailList.Add(detail);
|
detailList.Add(detail);
|
||||||
|
|||||||
@@ -120,10 +120,10 @@ public class XWMSSHIPController : BaseController
|
|||||||
var detailList = new List<ReceiptDetail2>();
|
var detailList = new List<ReceiptDetail2>();
|
||||||
foreach (var item in data)
|
foreach (var item in data)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(item.STATUS)){
|
//if (string.IsNullOrEmpty(item.STATUS)){
|
||||||
tran.Rollback();
|
// tran.Rollback();
|
||||||
return JsonMore(null, 500, $"状态不能为空!");
|
// return JsonMore(null, 500, $"状态不能为空!");
|
||||||
}
|
//}
|
||||||
var qr = _unitwork.FindSingle<MaterialQr2>(x =>
|
var qr = _unitwork.FindSingle<MaterialQr2>(x =>
|
||||||
x.Code == item.ITMREF_0
|
x.Code == item.ITMREF_0
|
||||||
&& x.Batch == item.LOT_0
|
&& x.Batch == item.LOT_0
|
||||||
|
|||||||
@@ -147,7 +147,8 @@
|
|||||||
"width": 220,
|
"width": 220,
|
||||||
"field": "lot",
|
"field": "lot",
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 8, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -192,7 +193,8 @@
|
|||||||
"width": 132,
|
"width": 132,
|
||||||
"field": "code",
|
"field": "code",
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -227,7 +229,8 @@
|
|||||||
"width": 132,
|
"width": 132,
|
||||||
"field": "qty",
|
"field": "qty",
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -250,7 +253,8 @@
|
|||||||
"width": 132,
|
"width": 132,
|
||||||
"field": "batch",
|
"field": "batch",
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
|
|||||||
@@ -42,9 +42,9 @@
|
|||||||
"height": 40,
|
"height": 40,
|
||||||
"width": 220,
|
"width": 220,
|
||||||
"field": "lot",
|
"field": "lot",
|
||||||
"testData": "123123124412412544534214354432255424213412341324123",
|
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 8, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -90,7 +90,8 @@
|
|||||||
"field": "code",
|
"field": "code",
|
||||||
"testData": "1324123412341234123",
|
"testData": "1324123412341234123",
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -127,7 +128,8 @@
|
|||||||
"field": "qty",
|
"field": "qty",
|
||||||
"testData": "5555",
|
"testData": "5555",
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -151,7 +153,8 @@
|
|||||||
"field": "batch",
|
"field": "batch",
|
||||||
"testData": "HYB2202030003",
|
"testData": "HYB2202030003",
|
||||||
"textAlign": "center",
|
"textAlign": "center",
|
||||||
"textContentVerticalAlign": "middle"
|
"textContentVerticalAlign": "middle",
|
||||||
|
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"printElementType": {
|
"printElementType": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
|
|||||||
@@ -82,11 +82,11 @@
|
|||||||
wmsQty = Number.parseFloat(item.WmsQty);
|
wmsQty = Number.parseFloat(item.WmsQty);
|
||||||
sumQty = sumQty + Number.parseFloat(item.QTYSTU_0);
|
sumQty = sumQty + Number.parseFloat(item.QTYSTU_0);
|
||||||
});
|
});
|
||||||
console.log(sumQty, wmsQty)
|
// console.log(sumQty, wmsQty)
|
||||||
if (sumQty > wmsQty) {
|
// if (sumQty > wmsQty) {
|
||||||
layer.alert("数量不满足,无法出库!!", { icon: 5, shadeClose: true, title: "错误信息" });
|
// layer.alert("数量不满足,无法出库!!", { icon: 5, shadeClose: true, title: "错误信息" });
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "post",
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// layer.closeAll();
|
// layer.closeAll();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
address: '',
|
address: 'HYB',
|
||||||
zjcode: '',
|
zjcode: '',
|
||||||
materialcode: '',
|
materialcode: '',
|
||||||
gdbill: '',
|
gdbill: '',
|
||||||
@@ -188,13 +188,13 @@
|
|||||||
cell.querySelector('.item__input').style.display = 'none'
|
cell.querySelector('.item__input').style.display = 'none'
|
||||||
cell.querySelector('.item__txt').style.display = 'block'
|
cell.querySelector('.item__txt').style.display = 'block'
|
||||||
}
|
}
|
||||||
if (property == "THISQTYSTU") {
|
// if (property == "THISQTYSTU") {
|
||||||
// 库存单位除以系数
|
// // 库存单位除以系数
|
||||||
row.THISQTYSTU = row.THISQTYSTU * row.RETEXTCOE_0
|
// row.THISQTYSTU = row.THISQTYSTU * row.RETEXTCOE_0
|
||||||
if (row.THISQTYSTU > row.RETQTY_0 - row.USEQTY_0) {
|
// if (row.THISQTYSTU > row.RETQTY_0 - row.USEQTY_0) {
|
||||||
row.THISQTYSTU = row.THISQTYSTU;
|
// row.THISQTYSTU = row.THISQTYSTU;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
//每页条数改变时触发 选择一页显示多少行
|
//每页条数改变时触发 选择一页显示多少行
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
@@ -238,7 +238,7 @@
|
|||||||
},
|
},
|
||||||
create() {
|
create() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
_this.$confirm('注意:您确认要对此单据进行创建采购退货吗?', '提示', {
|
_this.$confirm('注意:您确认要对此单据进行创建生产领料吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Key": "hangyong",
|
"Key": "hangyong",
|
||||||
"Value": "Server=127.0.0.1;Port=3306;Database=hangtongwms2;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
"Value": "Server=172.16.12.212;Port=3306;Database=hangyongwms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
||||||
"DbContext": "DataContext",
|
"DbContext": "DataContext",
|
||||||
"DBType": "mysql"
|
"DBType": "mysql"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user