铁芯打印
入库单明细拆分,打印拆分 出库对账(仓库建使用)
This commit is contained in:
1 parent
d19f62e48b
commit
cec65caa32
11 files changed
+170
-57
No files matched your search
@@ -70,7 +70,66 @@
|
||||
lot:'',
|
||||
num: 1,
|
||||
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() {
|
||||
|
||||
@@ -8,6 +8,7 @@ using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -268,6 +269,13 @@ namespace HHWMS.Web.Controllers
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Prints")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult Prints(string ids)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.SearchDetail")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult SearchDetail(int id)
|
||||
@@ -301,10 +309,26 @@ namespace HHWMS.Web.Controllers
|
||||
var ll = new List<ReceiptDetail2>();
|
||||
foreach (var item in data.Skip(1))
|
||||
{
|
||||
var re = receipt;
|
||||
re.ID = null;
|
||||
re.Qty = item.Qty;
|
||||
ll.Add(re);
|
||||
var detail = new ReceiptDetail2();
|
||||
detail.WarehouseId = receipt.WarehouseId;
|
||||
detail.ReceiptId = receipt.ReceiptId;
|
||||
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());
|
||||
tran.Commit();
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid();
|
||||
return FFResult().CloseDialog().RefreshGrid(index:0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,29 +479,47 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
return JsonMore(null, 500, "ERP无足够库存!");
|
||||
}
|
||||
if(ship.Qty <= item.QTYSTU_0)
|
||||
var qty = ship.Qty;
|
||||
int skipNum = 0;
|
||||
|
||||
while(qty > 0)
|
||||
{
|
||||
ship.Batch = item.LOT_0;
|
||||
ship.InventoryStatus = item.STA_0;
|
||||
_unitwork.Update(ship);
|
||||
}
|
||||
else if(ship.Qty > item.QTYSTU_0)
|
||||
{
|
||||
var newShip = ship;
|
||||
newShip.ID = null;
|
||||
newShip.Qty = ship.Qty - item.QTYSTU_0;
|
||||
_unitwork.Add(newShip);
|
||||
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.InventoryStatus = item.STA_0;
|
||||
_unitwork.Update(ship);
|
||||
|
||||
ship.Qty = item.QTYSTU_0;
|
||||
ship.Batch = item.LOT_0;
|
||||
ship.InventoryStatus = item.STA_0;
|
||||
_unitwork.Update(ship);
|
||||
qty = 0;
|
||||
}
|
||||
else if (qty > item.QTYSTU_0)
|
||||
{
|
||||
newShip.Qty = item.QTYSTU_0;
|
||||
newShip.Batch = item.LOT_0;
|
||||
newShip.InventoryStatus = item.STA_0;
|
||||
_unitwork.Add(newShip);
|
||||
|
||||
data.Remove(item);
|
||||
|
||||
Check(newShip.ID.ToString(), data);
|
||||
}
|
||||
|
||||
qty = qty - item.QTYSTU_0;
|
||||
skipNum++;
|
||||
}
|
||||
};
|
||||
return JsonMore(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,10 @@ public class XWMSMFMController : BaseController
|
||||
{
|
||||
var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode;
|
||||
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");
|
||||
using (var tran = dc.BeginTransaction())
|
||||
{
|
||||
@@ -129,11 +133,12 @@ public class XWMSMFMController : BaseController
|
||||
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
||||
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
||||
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.PurchasUnits = item.UOM_0;
|
||||
//detail.PurchasUnits = item.PurchasUnits;
|
||||
//detail.InventoryStatus = item.STA_0;
|
||||
//detail.Batch = _unitwork.GetSerialNumber("HYB", 5).Remove(3, 2);
|
||||
detail.UserDef3 = item.BOMSEQ_0.ToString();
|
||||
detail.Status = 0;
|
||||
detail.CreateTime = DateTime.Now;
|
||||
detailList.Add(detail);
|
||||
|
||||
@@ -120,10 +120,10 @@ public class XWMSSHIPController : BaseController
|
||||
var detailList = new List<ReceiptDetail2>();
|
||||
foreach (var item in data)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.STATUS)){
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, $"状态不能为空!");
|
||||
}
|
||||
//if (string.IsNullOrEmpty(item.STATUS)){
|
||||
// tran.Rollback();
|
||||
// return JsonMore(null, 500, $"状态不能为空!");
|
||||
//}
|
||||
var qr = _unitwork.FindSingle<MaterialQr2>(x =>
|
||||
x.Code == item.ITMREF_0
|
||||
&& x.Batch == item.LOT_0
|
||||
|
||||
@@ -147,7 +147,8 @@
|
||||
"width": 220,
|
||||
"field": "lot",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 8, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
@@ -192,7 +193,8 @@
|
||||
"width": 132,
|
||||
"field": "code",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
@@ -227,7 +229,8 @@
|
||||
"width": 132,
|
||||
"field": "qty",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
@@ -250,7 +253,8 @@
|
||||
"width": 132,
|
||||
"field": "batch",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
"height": 40,
|
||||
"width": 220,
|
||||
"field": "lot",
|
||||
"testData": "123123124412412544534214354432255424213412341324123",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 8, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
@@ -90,7 +90,8 @@
|
||||
"field": "code",
|
||||
"testData": "1324123412341234123",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
@@ -127,7 +128,8 @@
|
||||
"field": "qty",
|
||||
"testData": "5555",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
@@ -151,7 +153,8 @@
|
||||
"field": "batch",
|
||||
"testData": "HYB2202030003",
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle"
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
|
||||
@@ -82,11 +82,11 @@
|
||||
wmsQty = Number.parseFloat(item.WmsQty);
|
||||
sumQty = sumQty + Number.parseFloat(item.QTYSTU_0);
|
||||
});
|
||||
console.log(sumQty, wmsQty)
|
||||
if (sumQty > wmsQty) {
|
||||
layer.alert("数量不满足,无法出库!!", { icon: 5, shadeClose: true, title: "错误信息" });
|
||||
}
|
||||
else {
|
||||
// console.log(sumQty, wmsQty)
|
||||
// if (sumQty > wmsQty) {
|
||||
// layer.alert("数量不满足,无法出库!!", { icon: 5, shadeClose: true, title: "错误信息" });
|
||||
// }
|
||||
// else {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -110,7 +110,7 @@
|
||||
}
|
||||
});
|
||||
// layer.closeAll();
|
||||
}
|
||||
// }
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
address: '',
|
||||
address: 'HYB',
|
||||
zjcode: '',
|
||||
materialcode: '',
|
||||
gdbill: '',
|
||||
@@ -188,13 +188,13 @@
|
||||
cell.querySelector('.item__input').style.display = 'none'
|
||||
cell.querySelector('.item__txt').style.display = 'block'
|
||||
}
|
||||
if (property == "THISQTYSTU") {
|
||||
// 库存单位除以系数
|
||||
row.THISQTYSTU = row.THISQTYSTU * row.RETEXTCOE_0
|
||||
if (row.THISQTYSTU > row.RETQTY_0 - row.USEQTY_0) {
|
||||
row.THISQTYSTU = row.THISQTYSTU;
|
||||
}
|
||||
}
|
||||
// if (property == "THISQTYSTU") {
|
||||
// // 库存单位除以系数
|
||||
// row.THISQTYSTU = row.THISQTYSTU * row.RETEXTCOE_0
|
||||
// if (row.THISQTYSTU > row.RETQTY_0 - row.USEQTY_0) {
|
||||
// row.THISQTYSTU = row.THISQTYSTU;
|
||||
// }
|
||||
// }
|
||||
},
|
||||
//每页条数改变时触发 选择一页显示多少行
|
||||
handleSizeChange(val) {
|
||||
@@ -238,7 +238,7 @@
|
||||
},
|
||||
create() {
|
||||
var _this = this;
|
||||
_this.$confirm('注意:您确认要对此单据进行创建采购退货吗?', '提示', {
|
||||
_this.$confirm('注意:您确认要对此单据进行创建生产领料吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"DBType": "mysql"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user