From 7cf2e143941e1548cc468992ada42106a27805a1 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期二, 09 十二月 2025 19:22:40 +0800
Subject: [PATCH] Merge branch 'jsxswms' of http://47.97.1.152:5880/r/zy-asrs into jsxswms
---
src/main/webapp/static/js/checkOrder/checkOrder.js | 160 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 107 insertions(+), 53 deletions(-)
diff --git a/src/main/webapp/static/js/checkOrder/checkOrder.js b/src/main/webapp/static/js/checkOrder/checkOrder.js
index d752f36..6ef09e5 100644
--- a/src/main/webapp/static/js/checkOrder/checkOrder.js
+++ b/src/main/webapp/static/js/checkOrder/checkOrder.js
@@ -96,6 +96,10 @@
showEditModel(data);
}else if (layEvent === 'createTask') {
pakoutPreview(data.id);
+ }else if (layEvent === 'createAdjust') {
+ createAdjust(data.id);
+ }else if (layEvent === 'export') {
+ export1(data.id);
}else if (layEvent === 'del') {
doDel(data.id);
} else if (layEvent === 'complete') {
@@ -105,24 +109,22 @@
var offset = $a.offset();
var top = offset.top;
var left = offset.left;
- layer.open({
+ admin.open({
type: 1,
- title: false,
- area: '1000px',
- offset: [top + 'px', (left - 700 + $a.outerWidth()) + 'px'],
- shade: .01,
- shadeClose: true,
- fixed: false,
- content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
- success: function (layero) {
+ title: '鍗曟嵁鏄庣粏',
+ height: '450px',
+ content: $('#orderItem').html(),
+ area: '78%',
+ success: function (layero, dIndex) {
table.render({
- elem: '#lookSSXMTable',
- headers: {token: localStorage.getItem('token')},
- url: baseUrl+'/checkOrderDetl/list/auth',
+ elem: '#itemTable',
+ headers: { token: localStorage.getItem('token') },
+ url: baseUrl + '/checkOrderDetl/list/auth',
where: {
order_id: data.id
},
page: true,
+ height: '450px;',
cellMinWidth: 100,
cols: [[
{type: 'numbers'},
@@ -134,14 +136,6 @@
{field: 'anfme', title: '鏁伴噺'},
{field: 'workQty', title: '鐩樼偣鏁伴噺'},
{field: 'diffQty', title: '宸紓鏁伴噺', style: 'font-weight: bold'},
- // {field: 'unit', title: '鍗曚綅'},
- // {
- // field: 'createTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
- // return util.toDateString(d.createTime);
- // }, width: 180
- // },
- // {field: 'inQty', title: '宸插叆搴撻噺'},
- // {field: 'color', title: '棰滆壊'},
{field: 'specs', title: '瑙勬牸'},
{field: 'status$', title: '鐘舵��'}
]],
@@ -160,10 +154,7 @@
response: {
statusCode: 200
},
- done: (res) => {
- if(res.code == 403){
- window.top.location.href = baseUrl+"/";
- }
+ done: function () {
$(layero).find('.layui-table-view').css('margin', '0');
},
size: ''
@@ -330,10 +321,17 @@
var isDuplicate = false;
for (var j = 0; j < xxDataList.length; j++) {
if (xxDataList[j].locNo === data[i].locNo && xxDataList[j].matnr === data[i].matnr && xxDataList[j].batch === data[i].batch) {
- isDuplicate = true;
- duplicateCount++;
- break;
+ if (xxDataList[j].diffQty !== 0){
+ isDuplicate = true;
+ duplicateCount++;
+ break;
+ }
+
}
+ }
+ if (data[j].diffQty !== 0){
+ isDuplicate = true;
+ duplicateCount++;
}
// 濡傛灉涓嶉噸澶嶏紝鍒欐坊鍔犲埌鍒楄〃
if (!isDuplicate) {
@@ -344,7 +342,7 @@
insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
// 鎻愮ず娣诲姞缁撴灉
if (duplicateCount > 0) {
- layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹紝' + duplicateCount + ' 鏉¢噸澶嶆暟鎹凡蹇界暐', {icon: 1});
+ layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹紝' + duplicateCount + ' 鏉℃暟鎹凡蹇界暐', {icon: 1});
} else if (addedCount > 0) {
layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹�', {icon: 1});
}
@@ -419,6 +417,39 @@
layer.load(2);
$.ajax({
url: baseUrl+"/checkOrder/complete/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ orderId: orderId
+ },
+ method: 'POST',
+ success: function (res) {
+ layer.closeAll('loading');
+ if (res.code === 200){
+ if (insTbCount === 0) {
+ insTb.reload({page: {curr: 1}});
+ } else {
+ $(".layui-laypage-btn")[0].click();
+ }
+ layer.msg(res.msg, {icon: 1});
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ });
+ }
+
+ function createAdjust(orderId) {
+ layer.confirm('纭畾瑕佺敓鎴愯皟鏁村崟鍚楋紵', {
+ shade: .1,
+ skin: 'layui-layer-admin'
+ }, function (i) {
+ layer.close(i);
+ layer.load(2);
+ $.ajax({
+ url: baseUrl+"/adjustOrder/create/test",
headers: {'token': localStorage.getItem('token')},
data: {
orderId: orderId
@@ -601,6 +632,54 @@
})
}
+ function export1(id) {
+ notice.msg('姝e湪瀵煎嚭鏂囦欢......', {icon: 4});
+ $.ajax({
+ url: baseUrl + "/checkOrder/export/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ orderId: id
+ },
+ method: 'POST',
+ xhrFields: {
+ responseType: 'blob'
+ },
+ success: function (data, status, xhr) {
+ notice.destroy();
+ // 浠庡搷搴斿ご鑾峰彇鏂囦欢鍚�
+ var disposition = xhr.getResponseHeader('Content-Disposition');
+ var filename = '鐩樼偣宸紓鍗�.xlsx';
+ if (disposition && disposition.indexOf('filename') !== -1) {
+ var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
+ var matches = filenameRegex.exec(disposition);
+ if (matches != null && matches[1]) {
+ filename = decodeURIComponent(matches[1].replace(/['"]/g, ''));
+ }
+ }
+
+ // 鍒涘缓涓嬭浇閾炬帴
+ var blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
+ var link = document.createElement('a');
+ link.href = window.URL.createObjectURL(blob);
+ link.download = filename;
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(link.href);
+
+ layer.msg('瀵煎嚭鎴愬姛', {icon: 1});
+ },
+ error: function (xhr, status, error) {
+ notice.destroy();
+ if (xhr.status === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
+ layer.msg('瀵煎嚭澶辫触锛�' + error, {icon: 2});
+ }
+ }
+ });
+ }
+
function pakout(tableCache, layerIndex) {
// let loadIndex = layer.load(2);
notice.msg('姝e湪鐢熸垚鐩樼偣鍑哄簱浠诲姟......', {icon: 4});
@@ -616,7 +695,6 @@
layer.close(layerIndex);
layer.msg(res.msg, {icon: 1});
insTb.reload({where: null});
- insTb2.reload({where: null, page: {curr: 1}});
} else if (res.code === 403) {
top.location.href = baseUrl + "/";
} else {
@@ -624,30 +702,6 @@
}
}
});
- }
-
-
- function createTask(orderId) {
- let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
- $.ajax({
- url: baseUrl+"/checkOrder/createTask/auth",
- headers: {'token': localStorage.getItem('token')},
- data: {
- orderId: orderId
- },
- method: 'POST',
- success: function (res) {
- layer.close(loadIndex);
- if (res.code === 200){
- layer.msg(res.msg, {icon: 1});
- insTb.reload({page: {curr: 1}});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
- layer.msg(res.msg, {icon: 2});
- }
- }
- })
}
layDate.render({
--
Gitblit v1.9.1