From 64dbf42de49ecc047f2fce08eba71e18401324d8 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期三, 28 二月 2024 16:27:27 +0800
Subject: [PATCH] 新增库存明细重量统计,完善出入库日志记录
---
src/main/webapp/static/js/order/order.js | 97 +++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 90 insertions(+), 7 deletions(-)
diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index 0d115ab..5af334f 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -47,8 +47,11 @@
{align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160},
{field: 'createTime$', title: '鍒涘缓鏃堕棿', minWidth: 200, width: 200},
{field: 'settle$', align: 'center', title: '鐘舵��', templet: '#settleTpl', minWidth: 160, width: 160},
+ {field: 'cstmrName', align: 'center',title: '瀹㈡埛鍚嶇О'},
+ {field: 'itemName', align: 'center',title: '璋冩嫧鍒�'},
{field: 'memo', align: 'center',title: '澶囨敞', hide: true},
- {align: 'center', title: '鎿嶄綔', toolbar: '#operate', width: 180}
+ {field: 'createBy$', align: 'center', title: '鎿嶄綔鍛�', minWidth: 160, width: 160},
+ {align: 'center', title: '鎿嶄綔', toolbar: '#operate', width: 260}
]],
request: {
pageName: 'curr',
@@ -122,6 +125,29 @@
}
})
}
+ function addPakOut(expTpe) {
+ $.ajax({
+ url: baseUrl+"/pakout/add/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: JSON.stringify({
+ docType: Number(20),
+ orderNo: expTpe,
+ }),
+ contentType:'application/json;charset=UTF-8',
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ layer.msg("鐢熸垚鎷h揣鍗曪細ok");
+ } else if (res.code === 403){
+ layer.msg("鐢熸垚鎷h揣鍗曞け璐ワ細403");
+ }else {
+ layer.msg("鐢熸垚鎷h揣鍗曞け璐ワ細鏈煡寮傚父");
+ }
+
+ }
+ })
+ }
+
// 宸ュ叿鏉$偣鍑讳簨浠�
table.on('tool(order)', function (obj) {
@@ -138,6 +164,8 @@
btnPrint(data.id, data.orderNo, 4);
} else if (layEvent === 'complete') {
doModify(data.id, data.orderNo, 4);
+ }else if (layEvent === 'manPrint') {
+ addPakOut(data.orderNo);
} else if (layEvent === 'look') {
var $a = $(obj.tr).find('a[lay-event="look"]');
var offset = $a.offset();
@@ -166,9 +194,10 @@
{type: 'numbers'},
{field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
{field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
+
{field: 'batch', title: '鎵瑰彿'},
{field: 'anfme', title: '鏁伴噺'},
- // {field: 'workQty', title: '浣滀笟鏁伴噺'},
+ {field: 'workQty', title: '浣滀笟鏁伴噺'},
{field: 'qty', title: '瀹屾垚鏁伴噺', style: 'font-weight: bold'},
// {field: 'unit', title: '鍗曚綅'},
// {
@@ -178,7 +207,7 @@
// },
// {field: 'inQty', title: '宸插叆搴撻噺'},
// {field: 'color', title: '棰滆壊'},
- {field: 'specs', title: '瑙勬牸'}
+ // {field: 'specs', title: '瑙勬牸'},
]],
request: {
pageName: 'curr',
@@ -202,6 +231,9 @@
});
}
});
+ }
+ else if (layEvent === 'printExcel'){
+ printExcel(data);
}
});
@@ -228,16 +260,22 @@
return false;
}
let nList = admin.util.deepClone(xxDataList);
+ console.log(nList);
for (let xi = 0; xi < nList.length; xi++) {
if (nList[xi].anfme <= 0){
- layer.msg('鏄庣粏淇敼鏁伴噺涓嶅悎娉�', {icon: 2});
+ layer.msg('鏄庣粏鏁伴噺涓嶅悎娉�', {icon: 2});
return false;
}
+ // if (nList[xi].batch == null || nList[xi].batch == ""){
+ // layer.msg('鎵规涓嶅悎娉�', {icon: 2});
+ // return false;
+ // }
if (nList[xi].anfme < nList[xi].workQty){
layer.msg('鏁伴噺涓嶈兘灏忎簬宸蹭綔涓氭暟閲�', {icon: 2});
return false;
}
}
+
layer.load(2);
$.ajax({
url: baseUrl+"/order/form/" + (isExpAdd?"add":"modify") + "/auth",
@@ -246,6 +284,11 @@
orderId: Number(data.field.id),
docType: Number(data.field.docType),
orderNo: data.field.orderNo,
+ cstmr: data.field.cstmr,
+ cstmrName: data.field.cstmrName,
+ tel: data.field.tel,
+ number: data.field.number,
+ itemName: data.field.itemName,
orderDetlList: nList
}),
contentType:'application/json;charset=UTF-8',
@@ -278,19 +321,43 @@
{type: 'numbers', title: '#'},
{field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
{field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 200},
- {field: 'batch', title: '鎵瑰彿', edit: true},
{field: 'specs', title: '瑙勬牸'},
+ {field: 'batch', title: '鎵规', edit: true},
{field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
+
+ // {field: 'payment', title: '璐х墿鐘舵��',align: 'center', templet: '#payment'},
{field: 'qty', title: '浣滀笟鏁伴噺', minWidth: 100, width: 100},
// {field: 'unit', title: '鍗曚綅', width: 80},
{field: 'memo', title: '澶囨敞' , edit: true},
{align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
]],
- done: function (res) {
+ done: function (res, curr, count) {
$(layero).find('.layui-table-view').css('margin', '0');
+ var options = this;
+
+ // 鑾峰彇褰撳墠琛屾暟鎹�
+ table.getRowData = function(elem){
+ var index = $(elem).closest('tr').data('index');
+ return table.cache[options.id][index] || {};
+ };
+
+ $('.select-primary').on('change', function(){
+ var value = this.value; // 鑾峰彇閫変腑椤� value
+ var data = table.getRowData(this);
+ console.log(value);
+ xxDataList.forEach(res => {
+ if (data.id === res.id){
+ console.log(res)
+ res.payment = value;
+ }
+ })
+
+
+ });
},
size: ''
};
+
if (!isExpAdd) {
$.ajax({
url: baseUrl+"/order/detl/all/auth?orderId=" + expTpe.id,
@@ -361,7 +428,7 @@
}
}
data[obj.field] = obj.value;
- insTbSSXM.reload({data: xxDataList});
+ insTbSSXM.reloadData({data: xxDataList,scrollPos: true});
});
$('#matAddBtnComment').click(function () {
@@ -443,7 +510,11 @@
}
});
+
+
}
+
+
// 鍒犻櫎鍗曟嵁
function doDel(orderId) {
@@ -522,4 +593,16 @@
,type: 'datetime'
,range: true
});
+
+ function printExcel(data){
+ layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+ layer.closeAll();
+ layer.load(1, {shade: [0.1,'#fff']});
+ location.href = baseUrl+"/order/printExport/auth?orderNo="+data.orderNo;
+ layer.closeAll('loading');
+ });
+ }
+
+
+
});
--
Gitblit v1.9.1