From 29b916fcff826d7cf5f6fc560ea7e950f9804cf9 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 04 十一月 2025 08:18:59 +0800
Subject: [PATCH] 出库作业自动分配和手动分配过滤掉车间线边库存
---
HTML/views/StatisticalReport/BoxInfor.html | 375 ++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 350 insertions(+), 25 deletions(-)
diff --git a/HTML/views/StatisticalReport/BoxInfor.html b/HTML/views/StatisticalReport/BoxInfor.html
index 4eb09eb..507105e 100644
--- a/HTML/views/StatisticalReport/BoxInfor.html
+++ b/HTML/views/StatisticalReport/BoxInfor.html
@@ -16,6 +16,14 @@
margin-bottom: 1px;
margin-right: 1px;
}
+
+ .hideCls {
+ display: none;
+ }
+
+ .showCls {
+ display: block;
+ }
</style>
<script>
// 杩欓噷鏄渶瑕佸湪椤甸潰娓叉煋涔嬪墠鎵ц鐨勪唬鐮�
@@ -153,6 +161,30 @@
<input type="text" autocomplete="off" id="EndTime" class="layui-input" placeholder="缁撴潫鏃堕棿">
</div>
</div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 60px;">鎵�灞炰粨搴�</label>
+ <div class="layui-input-inline">
+ <select name="WareHouseNo" id="WareHouseNo" lay-filter="getWareHouseNo" lay-search>
+ <option value=""></option>
+ </select>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 60px;">鎵�灞炲尯鍩�</label>
+ <div class="layui-input-inline">
+ <select name="AreaNo" id="AreaNo" lay-filter="getAreaNo" lay-search>
+ <option value=""></option>
+ </select>
+ </div>
+ </div>
+ <!-- 缁存姢澶囨敞寮规 -->
+ <div class="layui-inline" id="divEditDemo" style="display: none; padding-top: 10px;">
+ <label class="layui-form-label">澶囨敞</label>
+ <div class="layui-input-inline" style="width: 300px;height: 100%;">
+ <textarea placeholder="璇疯緭鍏ュ唴瀹�" id="NoticeDemo" name="NoticeDemo"
+ class="layui-textarea"></textarea>
+ </div>
+ </div>
<div class="layui-inline sousuo">
<button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
@@ -201,6 +233,17 @@
</button>
</div>
<!-- #endregion -->
+ <script type="text/html" id="toolbarDemo1">
+ {{# function GetBtn1(d){
+ var html = '';
+
+ html += `<a class="layui-btn layui-btn-normal layui-btn-xs editDemoClass" lay-event="editDemo">
+ <i class="layui-icon layui-icon-edit"></i>澶囨敞</a>`;
+ return html;
+ }
+ }}
+ {{ GetBtn1(d) }}
+ </script>
<!-- #region 鑷畾涔夎〃澶� -->
<script type="text/html" id="templetProductionTime">
@@ -300,15 +343,70 @@
<button class="layui-btn layui-btn-normal layui-btn-xs approvalBtnupt" id="approvalBtnupt" lay-event="edit">
<i class="layui-icon layui-icon-edit"></i>璇︽儏
</button>
+
+ <button class="layui-btn layui-btn-normal layui-btn-xs printBtnupt" id="printBtnupt" lay-event="print">
+ <i class="layui-icon layui-icon-print"></i>琛ユ墦
+ </button>
</script>
+
</div>
</div>
+
+ <div class="layui-form hideCls" lay-filter="layuiadmin-app-form-list" id="print"
+ style="width: 100%;height:100%;">
+ <div style="display: flex;align-items: center;justify-content: center; height: 260px;">
+ <table border="0" id="table"
+ style="width: 90%; height:240px;border-collapse: collapse;table-layout: fixed;border:none">
+ <tr>
+ <td class="font-size12">
+ 鐗╂枡缂栧彿锛�
+ <table id="SkuNoP" class="font-size12"></table>
+ </td>
+ </tr>
+ <tr>
+ <td class="font-size12">
+ 鐗╂枡鍚嶇О锛�
+ <table id="SkuNameP" class="font-size12"></table>
+ </td>
+ </tr>
+ <tr>
+ <td class="font-size12">
+ 鎵规鍙凤細
+ <table id="LotNoP" class="font-size12"></table>
+ </td>
+ </tr>
+ <tr>
+ <td class="font-size12">
+ 鐢熶骇鏃ユ湡锛�
+ <table id="ProductionTimeP" class="font-size12"></table>
+ </td>
+ </tr>
+ <tr>
+ <td class="font-size12">
+ 鏈夋晥鏈燂細
+ <table id="ExpirationTimeP" class="font-size12"></table>
+ </td>
+ </tr>
+
+ <tr>
+ <td style="padding: 5px 0px;">
+ <img id="imgBar" style=" height: 60px;" />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <div style="page-break-after: always;"></div>
+ </div>
+ <div class="layui-form hideCls" lay-filter="layuiadmin-app-form-list" id="print2"
+ style="width: 100%;height:100%;"></div>
</div>
<script src="../../layuiadmin/layui/layui.js"></script>
<script src="../../js/public.js"></script>
<script src="../../js/jquery-3.5.1.min.js"></script>
<script src="../../js/jquery.cookie.js"></script>
+ <script src="../../js/jquery.print.js"></script>
<script>
var uid = $.cookie('userId');
layui.config({
@@ -360,7 +458,7 @@
function addZero(s) {
return s < 10 ? ('0' + s) : s;
};
-
+
var $ = layui.$;
var yemianid = 0;
refreshTable("", "", "", "", "", "", "", "", "", "", "", "", "", "");
@@ -370,38 +468,40 @@
//#region 鑷畾涔夎〃澶�
var TotalColsArr = [[
{ field: '', title: '搴忓彿', type: 'numbers', align: 'center', fixed: 'left', "disabled": true },
- { field: 'WareHouseName', title: '鎵�灞炰粨搴�', align: 'center' , width: 120,},
+ { field: 'WareHouseName', title: '鎵�灞炰粨搴�', align: 'center', width: 120, },
{ field: 'RoadwayName', title: '鎵�灞炲贩閬�', align: 'center', width: 120, },
{ field: 'AreaName', title: '鎵�灞炲尯鍩�', align: 'center', width: 120, },
{ field: 'LocatNo', title: '鍌ㄤ綅鍦板潃', align: 'center', width: 100, },
- { field: 'PalletNo', title: '鎵樼洏鍙�', align: 'center' , width: 100,},
- { field: 'SkuNo', title: '鐗╂枡缂栫爜', align: 'center' , width: 120,},
- { field: 'SkuName', title: '鐗╂枡鍚嶇О', align: 'center', width: 120,},
- { field: 'LotNo', title: '鎵规鍙�', align: 'center' , width: 100,},
+ { field: 'PalletNo', title: '鎵樼洏鍙�', align: 'center', width: 100, },
+ { field: 'SkuNo', title: '鐗╂枡缂栫爜', align: 'center', width: 120, },
+ { field: 'SkuName', title: '鐗╂枡鍚嶇О', align: 'center', width: 120, },
+ { field: 'LotNo', title: '鎵规鍙�', align: 'center', width: 100, },
//{ field: 'LotText', title: '鎵规鎻忚堪', align: 'center' },
- { field: 'SupplierLot', title: '渚涜揣鎵规', align: 'center' , width: 120,},
- { field: 'Qty', title: '鏁伴噺', align: 'center' ,width: 90,},
- { field: 'LockQty', title: '閿佸畾鏁伴噺', align: 'center',width: 90, },
- { field: 'FrozenQty', title: '鍐荤粨鏁伴噺', align: 'center',width: 90, },
-
+ { field: 'SupplierLot', title: '渚涜揣鎵规', align: 'center', width: 120, },
+ { field: 'Qty', title: '鏁伴噺', align: 'center', width: 90, },
+ { field: 'LockQty', title: '閿佸畾鏁伴噺', align: 'center', width: 90, },
+ { field: 'FrozenQty', title: '鍐荤粨鏁伴噺', align: 'center', width: 90, },
+
{ field: 'Status', title: '搴撳瓨鐘舵��', align: 'center', templet: '#buttonTpl', width: 90, },
- { field: 'InspectStatus', templet: '#InspectStatus1', title: '璐ㄦ鐘舵��', align: 'center' ,width: 100,},
- { field: 'InspectMark', title: '鎶芥鏍囪', align: 'center', templet: '#InspectMarkStatus' ,width: 100,},
- { field: 'BitPalletMark', title: '闆舵墭鏍囪', align: 'center', templet: '#BitPalletMarkStatus',width: 100,},
-
+ { field: 'InspectStatus', templet: '#InspectStatus1', title: '璐ㄦ鐘舵��', align: 'center', width: 100, },
+ { field: 'InspectMark', title: '鎶芥鏍囪', align: 'center', templet: '#InspectMarkStatus', width: 100, },
+ { field: 'BitPalletMark', title: '闆舵墭鏍囪', align: 'center', templet: '#BitPalletMarkStatus', width: 100, },
+
{ field: 'ProductionTime', title: '鐢熶骇鏃ユ湡', align: 'center', templet: '#templetProductionTime' },
- { field: 'OwnerNo', title: '璐т富缂栫爜', align: 'center' , width: 100,},
- { field: 'OwnerName', title: '璐т富鍚嶇О', align: 'center' , width: 100,},
- { field: 'SupplierNo', title: '渚涘簲鍟嗙紪鐮�', align: 'center' , width: 100,},
- { field: 'SupplierName', title: '渚涘簲鍟嗗悕绉�', align: 'center' , width: 100,},
-
-
+ { field: 'ExpirationTime', title: '杩囨湡鏃ユ湡', align: 'center', templet: '#templetExpirationTime' },
+ { field: 'OwnerNo', title: '璐т富缂栫爜', align: 'center', width: 100, },
+ { field: 'OwnerName', title: '璐т富鍚嶇О', align: 'center', width: 100, },
+ { field: 'SupplierNo', title: '渚涘簲鍟嗙紪鐮�', align: 'center', width: 100, },
+ { field: 'SupplierName', title: '渚涘簲鍟嗗悕绉�', align: 'center', width: 100, },
+ { field: 'Demo', title: '澶囨敞', align: 'center', width: 100, },
+ { field: 'caozuo', title: '鎿嶄綔', fixed: 'right', width: 280, align: 'center', toolbar: '#toolbarDemo1', "disabled": true }
+
]];
var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜
//#endregion
//鑾峰彇鎵樼洏鏄庣粏
function refreshTable(SkuNo, SkuName, PalletNo, LotNo, BoxNo, Status, InspectMark, BitPalletMark,
- BitBoxMark, InspectStatus, OwnerNo, OwnerName, StartTime, EndTime) {
+ BitBoxMark, InspectStatus, OwnerNo, OwnerName, StartTime, EndTime, WareHouseNo, AreaNo) {
//#region 鑷畾涔夎〃澶�
var colsJson
var param1 = {
@@ -427,6 +527,7 @@
even: true,
cellMinWidth: 80, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板
done: function () {
+ setRight();
//鑷畾涔夊垪瀹�
SetTableColW('LAY-app-content-list', 'Statistical/GetBindList', TotalColsSysArr);
},
@@ -448,6 +549,8 @@
OwnerName: OwnerName, //璐т富鍚嶇О
StartTime: StartTime, //寮�濮嬫椂闂�
EndTime: EndTime, //缁撴潫鏃堕棿
+ WareHouseNo: WareHouseNo,
+ AreaNo: AreaNo,
};
sendData(IP + "/Statistical/GetBindList", param, 'get', function (res) {
console.log(res)
@@ -470,6 +573,28 @@
});
});
//#endregion
+ }
+ function setRight() {
+ $(function () {
+ $(".editDemoClass").hide();//澶囨敞
+
+ });
+ sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) {
+ if (res.code == 0) { //鎴愬姛
+ for (var k = 0; k < res.data.length; k++) {
+ if (res.data[k].MenuName == "缁存姢鎵樼洏鏄庣粏澶囨敞") {
+ $(function () {
+ $(".editDemoClass").show();
+ });
+ }
+ }
+ } else { //涓嶆垚鍔�
+ layer.msg('鑾峰彇鏉冮檺淇℃伅澶辫触', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () { });
+ }
+ });
}
// 琛ㄥ崟闇�瑕佺殑鍙橀噺
@@ -498,7 +623,8 @@
]];
var DetailColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜
//#endregion
- function refreshTable2(Id, SkuNo, SkuName, LotNo, PalletNo, BoxNo, Status, InspectMark, BitBoxMark, InspectStatus, StartTime, EndTime) {
+ function refreshTable2(Id, SkuNo, SkuName, LotNo, PalletNo, BoxNo, Status, InspectMark, BitBoxMark, InspectStatus,
+ StartTime, EndTime, WareHouseNo, AreaNo) {
//#region 鑷畾涔夎〃澶�
var colsJson2
var param1 = {
@@ -543,6 +669,8 @@
InspectStatu: InspectStatus,
StartTime: StartTime,
EndTime: EndTime,
+ WareHouseNo: WareHouseNo,
+ AreaNo: AreaNo,
}
sendData(IP + "/Statistical/GetBoxInfo", param, 'get', function (res) {
if (res.code == 0) //鎴愬姛
@@ -569,7 +697,49 @@
}
//var url = IP + "/Statistical/GetInventoryList1";
+ table.on('tool(LAY-app-content-list)', function (obj) {
+ var data = obj.data;
+ switch (obj.event) {
+ case "editDemo":
+ $('#NoticeDemo').val(data.Demo);
+ layer.open({
+ type: 1,
+ title: '缁存姢澶囨敞',
+ content: $('#divEditDemo'),
+ maxmin: false,
+ area: ['420px', '260px'],
+ btn: ['纭畾', '鍙栨秷'],
+ yes: function (index, layero) {
+ var demo = $('#NoticeDemo').val();
+ var param = {
+ id: data.Id,
+ demo: demo,
+ };
+ sendData(IP + "/Statistical/EditStockDetailDemo", param, 'get', function (res) {
+ if (res.code == 0) { //鎴愬姛
+ refreshTable();
+ layer.msg(res.msg, {
+ icon: 1,
+ time: 1500 //1绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ });
+ } else { //涓嶆垚鍔�
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 3000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ refreshTable();
+ });
+ }
+ layer.close(index);
+ });
+ }
+ });
+ break;
+ default: break;
+ }
+ });
//鎺ュ彈鍏ㄥ眬鍙橀噺
@@ -593,14 +763,18 @@
var StartTime = $("#StartTime").val();
var EndTime = $("#EndTime").val();
+ var WareHouseNo = $("#WareHouseNo").val();
+ var AreaNo = $("#AreaNo").val();
if (yemianid == 0) {
console.log("鎬诲崟");
- refreshTable(SkuNo, SkuName, PalletNo, LotNo, BoxNo, Status, InspectMark, BitPalletMark, BitBoxMark, InspectStatus, OwnerNo, OwnerName, StartTime, EndTime);
+ refreshTable(SkuNo, SkuName, PalletNo, LotNo, BoxNo, Status, InspectMark, BitPalletMark, BitBoxMark,
+ InspectStatus, OwnerNo, OwnerName, StartTime, EndTime, WareHouseNo, AreaNo);
} else if (yemianid == 1) {
quanid = '';
console.log("鏄庣粏");
- refreshTable2(quanid, SkuNo, SkuName, LotNo, PalletNo, BoxNo, Status, InspectMark, BitBoxMark, InspectStatus, StartTime, EndTime);
+ refreshTable2(quanid, SkuNo, SkuName, LotNo, PalletNo, BoxNo, Status, InspectMark, BitBoxMark,
+ InspectStatus, StartTime, EndTime, WareHouseNo, AreaNo);
}
});
@@ -675,6 +849,111 @@
}
+ }
+ });
+ }
+ //琛ユ墦
+ if (obj.event === 'print') {
+ var param1 = {
+ BoxNo: data.BoxNo,
+ };
+
+ synData(IP + "/Statistical/GetBuDaLabelList", param1, 'post', function (res) {
+ if (res.code == 0) { //鎴愬姛
+ var labels = "";
+ for (var z = 0; z < res.data.length; z++) {
+ var idd = "";
+ if (z - 1 >= 0) {
+ idd = (z - 1).toString();
+ }
+ $("#SkuNoP").attr("id", "SkuNoP" + z.toString());
+ $("#SkuNoP" + z.toString()).html(res.data[z].SkuNo);
+
+ $("#SkuNameP").attr("id", "SkuNameP" + z.toString());
+ $("#SkuNameP" + z.toString()).html(res.data[z].SkuName);
+
+
+ $("#PackageStandardP").attr("id", "PackageStandardP" + z.toString());
+ $("#PackageStandardP" + z.toString()).html(res.data[z].PackageStandard);
+
+ $("#StandardP").attr("id", "StandardP" + z.toString());
+ $("#StandardP" + z.toString()).html(res.data[z].Standard);
+
+ $("#QtyP").attr("id", "QtyP" + z.toString());
+ $("#QtyP" + z.toString()).html(res.data[z].Qty);
+
+ $("#SupplierLotP").attr("id", "SupplierLotP" + z.toString());
+ $("#SupplierLotP" + z.toString()).html(res.data[z].SupplierLot);
+
+ $("#LotNoP").attr("id", "LotNoP" + z.toString());
+ $("#LotNoP" + z.toString()).html(res.data[z].LotNo);
+
+ $("#SupplierLotP").attr("id", "SupplierLotP" + z.toString());
+ $("#SupplierLotP" + z.toString()).html(res.data[z].SupplierLot);
+
+ $("#ExpirationTimeP").attr("id", "ExpirationTimeP" + z.toString());
+ $("#ExpirationTimeP" + z.toString()).html(formatDate2(res.data[z].ExpirationTime));
+
+
+ $("#ProductionTimeP").attr("id", "ProductionTimeP" + z.toString());
+ $("#ProductionTimeP" + z.toString()).html(formatDate2(res.data[z].ProductionTime));
+
+ $("#imgBar").attr("id", "imgBar" + z.toString());
+ $("#imgBar" + z.toString()).attr("src", res.data[z].ImgStr);
+
+
+ // console.log("#SkuNo"+z.toString());
+ labels += $("#print").html();
+ //console.log(labels);
+ $("#SkuNoP" + z.toString()).attr("id", "SkuNoP");
+ $("#SkuNoP").html("");
+
+ $("#SkuNameP" + z.toString()).attr("id", "SkuNameP");
+ $("#SkuNameP").html("");
+
+ $("#PackageStandardP" + z.toString()).attr("id", "PackageStandardP");
+ $("#PackageStandardP").html("");
+
+ $("#QtyP" + z.toString()).attr("id", "QtyP");
+ $("#QtyP").html("");
+
+ $("#StandardP" + z.toString()).attr("id", "StandardP");
+ $("#StandardP").html("");
+
+ $("#LotNoP" + z.toString()).attr("id", "LotNoP");
+ $("#LotNoP").html("");
+
+ $("#SupplierLotP" + z.toString()).attr("id", "SupplierLotP");
+ $("#SupplierLotP").html("");
+
+ $("#StoreTimeP" + z.toString()).attr("id", "StoreTimeP");
+ $("#StoreTimeP").html("");
+
+ $("#ExpirationTimeP" + z.toString()).attr("id", "ExpirationTimeP");
+ $("#ExpirationTimeP").html("");
+
+ $("#imgBar" + z.toString()).attr("id", "imgBar");
+ $("#imgBar").attr("src", "");
+ }
+ // console.log(labels);
+ document.getElementById('print2').innerHTML = "";
+ document.getElementById('print2').innerHTML = labels;
+ $("#print2").removeClass("hideCls");
+ //$("#button").hide();
+ $("#print2").print();
+ //$("#button").show();
+ $("#print2").addClass("hideCls");
+
+ // $("#LabelStream").val("");
+ // $("#EndBoxCode").val("");
+ // $("#LabelStream2").val("");
+ // $("#EndBoxCode2").val("");
+
+ } else { //涓嶆垚鍔�
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () { });
}
});
}
@@ -760,6 +1039,52 @@
});
+
+ //鑾峰彇浠撳簱涓嬫媺妗嗕俊鎭�
+ sendData(IP + "/Sys/GetWarehouseDic", {}, 'get', function (res) {
+ if (res.code == 0) { //鎴愬姛
+ for (var i = 0; i < res.data.length; i++) {
+ $("#WareHouseNo").append('<option value =' + res.data[i].WareHouseNo + '>' + res.data[i].WareHouseNo + '-' +
+ res.data[i].WareHouseName + '</option>');
+ }
+ form.render('select');
+ } else { //涓嶆垚鍔�
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () { });
+ }
+ });
+
+ getAR("");
+ form.on('select(getWareHouseNo)', function (data) {
+ console.log(data);
+ getAR(data.value);
+ });
+ function getAR(val) {
+ //鑾峰彇 鍖哄煙涓嬫媺妗�
+ sendData(IP + "/Sys/GetStorageAreaByHouseNo?wareHouseNo=" + val, {}, 'get', function (res) {
+ $("#AreaNo").empty();
+ $("#AreaNo").append('<option value =""></option>');
+ if (res.code == 0) { //鎴愬姛
+ for (var i = 0; i < res.data.length; i++) {
+ $("#AreaNo").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i].AreaNo + '-' +
+ res.data[i].AreaName + '</option>');
+ }
+ form.render('select');
+ } else { //涓嶆垚鍔�
+ layer.msg('鑾峰彇鍖哄煙淇℃伅澶辫触', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ //鍥炶皟
+ form.render('select');
+ });
+ }
+ });
+
+ };
+
//#region 鑷畾涔夎〃澶�
//鑷畾涔夎〃澶�
active = {
--
Gitblit v1.8.0