From 6b218973dcf03a3601373ebe13fddd7a8896d68f Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期二, 25 二月 2025 12:51:01 +0800
Subject: [PATCH] 聚乳酸-出库作业,可以多牌号一起出,冻结状态从后台查
---
src/main/webapp/static/js/order/order.js | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 100 insertions(+), 20 deletions(-)
diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index 0bd403c..3b085f1 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -1,5 +1,8 @@
var insTbCount = 0;
var printMatCodeNos = [];
+var selectedData = [];
+var selectType = 'one';
+var queryWhere = {};
layui.config({
base: baseUrl + "/static/layui/lay/modules/"
}).use(['layer', 'form', 'table', 'util', 'admin', 'xmSelect', 'laydate'], function () {
@@ -41,12 +44,15 @@
page: true,
cellMinWidth: 100,
cols: [[
- {type: 'numbers'},
+ {type: 'checkbox'},
+ {type: 'numbers', title: '搴忓彿'},
{field: 'orderNo', title: '鍗曟嵁缂栧彿'},
{field: 'docType$', align: 'center', title: '绫诲瀷', minWidth: 160, width: 160},
{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},
{field: 'createBy$', align: 'center', title: '鎿嶄綔鍛�', minWidth: 160, width: 160},
{align: 'center', title: '鎿嶄綔', toolbar: '#operate', width: 260}
@@ -71,13 +77,87 @@
if (res.code === 403) {
top.location.href = baseUrl+"/";
}
+
+ var selectedOrderNos = selectedData.map(item => item.orderNo);
+ var indexArr = []
+
+ res.data.forEach(function (item,index) {
+ if (selectedOrderNos.includes(item.orderNo)) {
+ indexArr.push(index)
+ }
+ })
+ // 閲嶆柊娓叉煋
+ table.setRowChecked('order',{
+ index: indexArr
+ });
insTbCount = count;
+ }
+ });
+
+ table.on('checkbox(order)', function (obj) {
+ if (obj.type === 'all' && obj.checked) {
+ selectType = 'all'
+ } else if (obj.type === 'one' && obj.checked) {
+ selectType = 'one'
+ selectedData.push(obj.data); // 閫変腑鏃朵繚瀛樻暟鎹�
+ } else if (obj.type === 'one' && !obj.checked && obj.index !== undefined) {
+ selectType = 'one'
+ selectedData = selectedData.filter(item => item.orderNo !== obj.data.orderNo); // 鍙栨秷鏃剁Щ闄ゆ暟鎹�
+ } else if (obj.type === 'all' && !obj.checked && obj.index === undefined) {
+ selectType = 'one'
+ selectedData = [];
}
});
// 鎼滅储
form.on('submit(tbSearch)', function (data) {
insTb.reload({where: data.field, page: {curr: 1}});
+ queryWhere = data.field
+ });
+
+ // 瀵煎嚭
+ form.on('submit(exportAll)', function (data) {
+ layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function () {
+ layer.closeAll();
+ layer.load(1, {shade: [0.1, '#fff']});
+ var reqData = {};
+ reqData.type = selectType;
+ if (reqData.type === 'one') {
+ reqData.orderNoList = selectedData.map(item => item.orderNo);
+ } else {
+ if (Object.keys(queryWhere).length === 0) {
+ reqData.queryWhere = {
+ create_time: "",
+ cstmr_name: "",
+ doc_type: "",
+ oper_memb: "",
+ order_no: "",
+ settle: ""
+ }
+ } else {
+ reqData.queryWhere = queryWhere
+ }
+ }
+ $.ajax({
+ url: baseUrl + "/order/definedExcelExport/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: JSON.stringify(reqData),
+ contentType: 'application/json;charset=UTF-8',
+ method: 'POST',
+ xhrFields: {
+ responseType: 'blob' // 澶勭悊杩斿洖鐨勬枃浠舵祦
+ },
+ success: function (res) {
+ var link = document.createElement('a');
+ link.href = URL.createObjectURL(res); // 浣跨敤 Blob 瀵硅薄鐢熸垚涓存椂 URL
+ link.download = new Date().getTime() + '.xlsx'; // 璁剧疆涓嬭浇鐨勬枃浠跺悕
+ document.body.appendChild(link);
+ link.click(); // 瑙﹀彂涓嬭浇
+ document.body.removeChild(link);
+ }
+ });
+ layer.closeAll('loading');
+ });
});
// 娣诲姞
@@ -192,9 +272,8 @@
{type: 'numbers'},
{field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
{field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
- {field: 'owner$', title: '璐т富', width: 160},
- {field: 'payment$', title: '璐х墿鐗瑰緛', width: 160},
- // {field: 'batch', title: '鎵瑰彿'},
+
+ {field: 'batch', title: '鎵瑰彿'},
{field: 'anfme', title: '鏁伴噺'},
{field: 'workQty', title: '浣滀笟鏁伴噺'},
{field: 'qty', title: '瀹屾垚鏁伴噺', style: 'font-weight: bold'},
@@ -207,7 +286,6 @@
// {field: 'inQty', title: '宸插叆搴撻噺'},
// {field: 'color', title: '棰滆壊'},
// {field: 'specs', title: '瑙勬牸'},
- {field: 'weight', title: '閲嶉噺'}
]],
request: {
pageName: 'curr',
@@ -263,20 +341,19 @@
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;
}
}
- for (let xi = 0; xi < nList.length; xi++) {
- if (nList[xi].owner <= 0){
- layer.msg('璐т富缂栧彿璇锋煡鐪嬭揣涓绘。妗�', {icon: 2});
- return false;
- }
- }
+
layer.load(2);
$.ajax({
url: baseUrl+"/order/form/" + (isExpAdd?"add":"modify") + "/auth",
@@ -285,6 +362,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',
@@ -318,12 +400,11 @@
{field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
{field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 200},
{field: 'specs', title: '瑙勬牸'},
- {field: 'weight', title: '閲嶉噺', edit: true},
- {field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
- {field: 'owner', title: '璐т富缂栧彿', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
- {field: 'payment', title: '璐х墿鐘舵��', style: 'color: blue;font-weight: bold', templet: '#payment'},
+ {field: 'batch', title: '鎵规', edit: true},
+ {field: 'anfme', title: '鏁伴噺(淇敼)kg', 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: 'qty', title: '浣滀笟鏁伴噺kg', 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'}
@@ -425,7 +506,7 @@
}
}
data[obj.field] = obj.value;
- insTbSSXM.reloadData({data: xxDataList,scrollPos: true});
+ insTbSSXM.reloadData({data: xxDataList,scrollPos: true});
});
$('#matAddBtnComment').click(function () {
@@ -595,8 +676,7 @@
layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
layer.closeAll();
layer.load(1, {shade: [0.1,'#fff']});
- // location.href = "http://192.168.4.121:8082/stwms/orderCheck/printExport/auth?orderNo="+data.orderNo;
- location.href = "http://10.114.97.100:8080/stwms/order/printExport/auth?orderNo="+data.orderNo;
+ location.href = baseUrl+"/order/printExport/auth?orderNo="+data.orderNo;
layer.closeAll('loading');
});
}
--
Gitblit v1.9.1