From 2b02dbd3275136f571afe36626b851519015691e Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 19 八月 2025 16:28:49 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/order/out.js | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 107 insertions(+), 7 deletions(-)
diff --git a/src/main/webapp/static/js/order/out.js b/src/main/webapp/static/js/order/out.js
index ecb0789..14e31ec 100644
--- a/src/main/webapp/static/js/order/out.js
+++ b/src/main/webapp/static/js/order/out.js
@@ -42,6 +42,15 @@
,{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: 'unit', align: 'center',title: '鍗曚綅', hide: true}
// ,{field: 'barcode', align: 'center',title: '鍟嗗搧鏉$爜', hide: true}
@@ -158,8 +167,8 @@
limit: Number.MAX_VALUE,
cellMinWidth: 100,
cols: [[
- // {type: 'checkbox', merge: ['orderNo']},
{field: 'orderNo', title: '鍗曟嵁缂栧彿', merge: true, align: 'center'},
+ // {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},
@@ -209,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) {
// 鍑哄簱绔欏彇浜ら泦
@@ -275,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)
@@ -294,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();
@@ -321,6 +419,8 @@
+
+
/* 鍒犻櫎璁㈠崟 */
function doDelSensor(obj) {
layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
--
Gitblit v1.9.1