From 756fa60cebfb82ba824e87d080d44fc9ec34ecc8 Mon Sep 17 00:00:00 2001 From: Administrator <335182714> Date: 星期二, 02 九月 2025 14:01:09 +0800 Subject: [PATCH] 订单出库显示明细是否完成修复 --- src/main/webapp/static/js/order/out.js | 160 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 136 insertions(+), 24 deletions(-) diff --git a/src/main/webapp/static/js/order/out.js b/src/main/webapp/static/js/order/out.js index c26bfbc..4ca3a98 100644 --- a/src/main/webapp/static/js/order/out.js +++ b/src/main/webapp/static/js/order/out.js @@ -32,17 +32,28 @@ {type: 'checkbox'} ,{type: 'numbers', title: '#'} ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl', width: 160} - ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栫爜', width: 160} - ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', width: 200} - ,{field: 'batch', align: 'center',title: '绠卞彿'} - ,{field: 'specs', align: 'center',title: '瑙勬牸'} + // ,{field: 'matnr', align: 'center',title: '瑙勬牸', width: 160} + // ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', width: 200} + // ,{field: 'batch', align: 'center',title: '绠卞彿'} + // ,{field: 'specs', align: 'center',title: '鎺ュご'} // ,{field: 'anfme', align: 'center',title: '鏁伴噺'} - // ,{field: 'qty', align: 'center',title: '浣滀笟鏁伴噺', style: 'font-weight: bold'} + ,{field: 'brand', align: 'center',title: '鍖呰缁勫彿'} + ,{field: 'supp', align: 'center',title: '瀹㈡埛鍚嶇О', hide: false} + ,{field: 'memo', align: 'center',title: '澶囨敞', hide: false} + ,{field: 'qty', align: 'center',title: '浣滀笟鏁伴噺', style: 'font-weight: bold'} ,{field: 'enableQty', align: 'center',title: '寰呭嚭鏁伴噺', style: 'font-weight: bold'} + ,{field: 'finishStatus', align: 'center', title: '鏄惁瀹屾垚', templet: function(d){ + if (d.qty !== 0 && d.enableQty === 0) { + return '<span style="color:green;font-weight:bold;">瀹屾垚</span>'; + } else { + return '<span style="color:red;">鏈畬鎴�</span>'; + } + }} + + // ,{field: 'name', align: 'center',title: '鍚嶇О'} - // ,{field: 'model', align: 'center',title: '鍨嬪彿'} - ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true} - ,{field: 'barcode', align: 'center',title: '鍟嗗搧鏉$爜', hide: true} + // ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true} + // ,{field: 'barcode', align: 'center',title: '鍟嗗搧鏉$爜', hide: true} // ,{field: 'supplier', align: 'center',title: '渚涘簲鍟�'} // ,{field: 'unitPrice', align: 'center',title: '鍗曚环'} // ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�'} @@ -156,18 +167,28 @@ limit: Number.MAX_VALUE, cellMinWidth: 100, cols: [[ - // {type: 'checkbox', merge: ['orderNo']}, {field: 'orderNo', title: '鍗曟嵁缂栧彿', merge: true, align: 'center'}, - {field: 'title', title: '鍟嗗搧', merge: true, align: 'center', width: 350}, - {field: 'batch', title: '绠卞彿', align: 'center'}, - {field: 'model', title: '鎵规', align: 'center'}, - {field: 'specs', title: '瑙勬牸', align: 'center'}, - {field: 'brand', title: '鏈ㄧ绫诲瀷', align: 'center'}, - {field: 'zpallet', title: '鎵樼洏鐮�', align: 'center'}, - {field: 'anfme', title: '鏈ㄧ涓摐绠旀暟閲�', align: 'center', width: 90, style: 'font-weight: bold'}, - {field: 'count', title: '鏈ㄧ涓摐绠旀暟閲�', align: 'center', width: 90, style: 'font-weight: bold'}, + // {type: 'checkbox', merge: ['brand'],width: 100}, + // {field: 'title', title: '鍟嗗搧', merge: true, align: 'center', width: 350}, + {field: 'unit', title: '绠卞彿', align: 'center',hide:false}, + {field: 'model', title: '鍗峰彿', align: 'center', hide: false}, + { + field: 'threeCode', + align: 'center', + title: '鍚堟牸鍚�', + hide: false, + templet: function(d) { + return d.threeCode ? d.threeCode : '寰呭垽'; + } + }, + // {field: 'specs', title: '鎺ュご', align: 'center'}, + {field: 'brand', align: 'center',title: '鍖呰缁勫彿', merge: true, hide: false}, + // {field: 'brand$', align: 'center',title: '鏈ㄧ绫诲瀷', hide: false}, + // {field: 'zpallet', title: '鎵樼洏鐮�', align: 'center'}, + // {field: 'anfme', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'}, + // {field: 'count', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'}, {field: 'locNo', title: '璐т綅', align: 'center', width: 100, templet: '#locNoTpl'}, - // {field: 'staNos', align: 'center', title: '鍑哄簱绔�', merge: ['locNo'], templet: '#tbBasicTbStaNos'}, + {field: 'staNos', align: 'center', title: '鍑哄簱绔�', merge: ['locNo'], templet: '#tbBasicTbStaNos'}, // {type: 'checkbox', merge: ['locNo']}, ]], done: function (res) { @@ -197,6 +218,52 @@ } modifySta(stoPreTabData); }); + form.on('submit(checkModifySta)', function () { + if (!tableCache || tableCache.length === 0) { + layer.msg("娌℃湁鍙鐞嗙殑鏁版嵁", {icon: 7}); + return false; + } + + let updatedRows = []; + + for (let i = 0; i < tableCache.length; i++) { + let row = tableCache[i]; + let locNo = row.locNo; + if (!locNo || locNo.length < 2) continue; + + let rowPrefix = parseInt(locNo.substring(0, 2), 10); + let newStaNo; + + if (rowPrefix >= 17 && rowPrefix <= 24) { + newStaNo = 3092; + } else if (rowPrefix >= 9 && rowPrefix <= 16) { + newStaNo = 3102; + } else if (rowPrefix >= 1 && rowPrefix <= 8) { + newStaNo = 3095; + } + + if (newStaNo) { + row.staNo = newStaNo; + updatedRows.push({index: i, staNo: newStaNo}); + } + } + + // 閲嶈浇琛ㄦ牸鏁版嵁 + stoPreTabIdx.reload({data: tableCache}); + + // 鏇存柊涓嬫媺妗嗛鑹插拰鍊� + updatedRows.forEach(item => { + $('div[lay-id=stoPreTab] tr[data-index="' + item.index + '"] .order-sta-select').val(item.staNo); + }); + layui.form.render('select'); + updatedRows.forEach(item => { + $('div[lay-id=stoPreTab] tr[data-index="' + item.index + '"] .layui-select-title input').css("color", "blue"); + }); + + layer.msg("鍑哄簱绔欑偣鍧囧垎宸插畬鎴�", {icon: 1}); + return false; + }); + // 鎵归噺淇敼鍑哄簱绔� - 绔欑偣閫夋嫨 function modifySta(stoPreTabData) { // 鍑哄簱绔欏彇浜ら泦 @@ -263,10 +330,53 @@ } } - ,yes: function(index, layero){ - //鎸夐挳銆愮珛鍗冲嚭搴撱�戠殑鍥炶皟 - pakout(tableCache, index); + ,yes: function(layerIndex, layero){ + // 绔嬪嵆鍑哄簱鎸夐挳鐐瑰嚮 鈫� 鍏堣姹備笅鎷夊垪琛� + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl + "/getMesOrder/auth", // 浣犳彁渚涚殑鎺ュ彛 + headers: {'token': localStorage.getItem('token')}, + method: 'POST', + success: function(res){ + layer.close(loadIndex); + if(res.code === 200){ + // 寮瑰嚭浜屾纭妗� + layer.open({ + type: 1, + title: '璇烽�夋嫨缁勮揣鍗曞彿', + area: ['400px','200px'], + content: $('#staBatchSelectDialog').html(), + success: function(layero2, index2){ + // 娓叉煋涓嬫媺妗� + let select = $(layero2).find('#batchSelectStaBox'); + select.empty().append(`<option value="">璇烽�夋嫨缁勮揣鍗曞彿</option>`); + res.data.forEach(item => { + select.append(`<option value="${item}">${item}</option>`); + }); + // 娉ㄦ剰杩欓噷 select 瑕佸姞 lay-search 灞炴�� + select.attr("lay-search", ""); + layui.form.render('select'); + + + + // 纭鎸夐挳 + form.on('submit(staBatchSelectConfirm)', function(obj){ + let selectedValue = obj.field.batchSta; + console.log(selectedValue) + layer.close(index2); + // 璋冪敤鍘熸潵鐨勫嚭搴撳嚱鏁帮紝鍚屾椂浼犱笅鎷夊�� + pakout(tableCache, layerIndex, selectedValue); + return false; + }); + } + }); + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }); } + ,btn2: function(index, layero){ //鎸夐挳銆愮◢鍚庡鐞嗐�戠殑鍥炶皟 layer.close(index) @@ -282,14 +392,14 @@ }) } - function pakout(tableCache, layerIndex) { - // let loadIndex = layer.load(2); + function pakout(tableCache, layerIndex, optionValue) { + // 鍙互鎶� optionValue 浼犵粰鎺ュ彛 notice.msg('姝e湪鐢熸垚鍑哄簱浠诲姟......', {icon: 4}); $.ajax({ url: baseUrl + "/out/pakout/auth", headers: {'token': localStorage.getItem('token')}, contentType: 'application/json;charset=UTF-8', - data: JSON.stringify(tableCache), + data: JSON.stringify({tableCache,optionValue}), method: 'POST', success: function (res) { notice.destroy(); @@ -309,6 +419,8 @@ + + /* 鍒犻櫎璁㈠崟 */ function doDelSensor(obj) { layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', { -- Gitblit v1.9.1