From eaa41fed2f107ce160e899bbc2900bb19124d736 Mon Sep 17 00:00:00 2001 From: Demo <Demo@DESKTOP-CPA90BF> Date: 星期六, 03 二月 2024 17:18:48 +0800 Subject: [PATCH] 补打标签功能开发 --- HTML/views/ASNSetting/LabelBox.html | 315 +++++++++------------------------------------------- 1 files changed, 54 insertions(+), 261 deletions(-) diff --git a/HTML/views/ASNSetting/LabelBox.html b/HTML/views/ASNSetting/LabelBox.html index 5800979..79afd1a 100644 --- a/HTML/views/ASNSetting/LabelBox.html +++ b/HTML/views/ASNSetting/LabelBox.html @@ -120,13 +120,13 @@ lay-filter="LAY-app-contlist-search"> <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>鎼滅储 </button> + <button class="layui-btn layui-btn-sm layuiadmin-btn-list buDaLabelClass" style="margin-left: 5px;" lay-event="BuDaLabel" id="BuDaLabel"> + <i class="layui-icon layui-icon-print layuiadmin-button-btn"></i>琛ユ墦鏍囩 + </button> </div> </div> </div> - <div class="layui-card-body"> - <!-- <button type="button" class="layui-btn layui-btn-sm" id="daoru1"> - 瀵煎叆 - </button> --> + <div class="layui-card-body"> <div class="position-relative"> <table id="Box-list" lay-filter="Box-list"></table> @@ -277,68 +277,54 @@ // 椤甸潰鍔犺浇缁戝畾Table bindTable(); - - // 娣诲姞瀵煎叆鎸夐挳鍗曟満浜嬩欢 - table.on('toolbar(Box-list)', function (obj) { - switch (obj.event) { - case 'add': // 娣诲姞绠辨敮鍏崇郴 - // layer.open({ - // type: 2, - // title: '鑷畾涔夊垪', - // content: '../SystemSettings/HeaderSetting.html', - // maxmin: false, - // resize: false, - // area: ['970px', '650px'] - // }); - layer.open({ - type: 2, - title: '鎵撳嵃', - content: 'LabelPrint.html?', - maxmin: true, - area: ['600px', '670px'], - btn: ['鍙栨秷'] - }); - break; - - default: break; - } - }); + //鐢熸垚 + $('#BuDaLabel').on('click', function () { + layer.open({ + type: 2, + title: '鎵撳嵃', + content: 'LabelBoxBuDa.html', + maxmin: true, + area: ['430px', '390px'], + // btn: ['鍙栨秷'] + }); + }); + - // 鍒犻櫎绠辨敮淇℃伅 - table.on('tool(Box-list)', function (obj) { - var data = obj.data; - switch (obj.event) { - case "del": - layer.confirm('纭畾鍒犻櫎绠辨敮鏄庣粏鍚楋紵', function (index) { - // 浠g爜鍖哄煙 - var param = { - Id: data.Id, - Status: "0", - }; - console.log(param); - sendData(IP + "/BllAsn/DelBllBoxInfo", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - bindTable(); - doing = true - }); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { doing = true }); - } - }); - }); + // // 鍒犻櫎绠辨敮淇℃伅 + // table.on('tool(Box-list)', function (obj) { + // var data = obj.data; + // switch (obj.event) { + // case "del": + // layer.confirm('纭畾鍒犻櫎绠辨敮鏄庣粏鍚楋紵', function (index) { + // // 浠g爜鍖哄煙 + // var param = { + // Id: data.Id, + // Status: "0", + // }; + // console.log(param); + // sendData(IP + "/BllAsn/DelBllBoxInfo", param, 'post', function (res) { + // if (res.code == 0) { //鎴愬姛 + // layer.msg(res.msg, { + // icon: 1, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function () { + // bindTable(); + // doing = true + // }); + // } else { //涓嶆垚鍔� + // layer.msg(res.msg, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function () { doing = true }); + // } + // }); + // }); - break; - default: break; - } - }); + // break; + // default: break; + // } + // }); //#region 浜嬩欢鏂规硶 // 鏌ヨ褰曞叆鐨勭鏀叧绯� @@ -426,39 +412,6 @@ }, cols: colsJson }); - - //缁戝畾瀵煎叆 - upload.render({ - elem: '#daoru' //缁戝畾鍏冪礌 - , url: '' //涓婁紶鎺ュ彛 - , auto: false //鏄惁閫夊畬鏂囦欢鍚庤嚜鍔ㄤ笂浼犮�傚鏋滆瀹� false锛岄偅涔堥渶瑕佽缃� bindAction 鍙傛暟鏉ユ寚鍚戜竴涓叾瀹冩寜閽彁浜や笂浼� - , exts: 'slx|excel|xlsx' //鍏佽涓婁紶鐨勬枃浠跺悗缂� - , accept: 'file' //鎸囧畾鍏佽涓婁紶鏃舵牎楠岀殑鏂囦欢绫诲瀷 - //, bindAction: '#daoru' //鎸囧悜涓�涓寜閽Е鍙戜笂浼� - , choose: function (obj) {// 閫夋嫨鏂囦欢鍥炶皟 - console.log(obj); - var files = obj.pushFile(); //灏嗘瘡娆¢�夋嫨鐨勬枃浠惰拷鍔犲埌鏂囦欢闃熷垪 - var fileArr = Object.values(files);// 娉ㄦ剰杩欓噷鐨勬暟鎹渶瑕佹槸鏁扮粍锛屾墍浠ラ渶瑕佽浆鎹竴涓� - console.log(fileArr) - // 鐢ㄥ畬灏辨竻鐞嗘帀锛岄伩鍏嶅娆¢�変腑鐩稿悓鏂囦欢鏃跺嚭鐜伴棶棰� - for (var index in files) { - console.log(index); - if (files.hasOwnProperty(index)) { - delete files[index]; - } - } - console.log("abs"); - uploadExcel(fileArr); // 濡傛灉鍙渶瑕佹渶鏂伴�夋嫨鐨勬枃浠讹紝鍙互杩欐牱鍐欙細 uploadExcel([files.pop()]) - } - , done: function (res) { - console.log(res); - //涓婁紶瀹屾瘯鍥炶皟 - } - , error: function (res) { - console.log(res); - //璇锋眰寮傚父鍥炶皟 - } - }); }); //#endregion } @@ -466,28 +419,16 @@ // 鏉冮檺璁剧疆 function setRight() { $(function () { - $(".addClass").hide(); - $(".DaoRuClass").hide(); - $(".delClass").hide(); + $(".buDaLabelClass").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 == "娣诲姞绠辨敮褰曞叆") { + if (res.data[k].MenuName == "琛ユ墦鏍囩") { $(function () { - $(".addClass").show(); + $(".buDaLabelClass").show(); }); - } - if (res.data[k].MenuName == "瀵煎叆绠辨敮褰曞叆") { - $(function () { - $(".DaoRuClass").show(); - }); - } - if (res.data[k].MenuName == "鍒犻櫎绠辨敮褰曞叆") { - $(function () { - $(".delClass").show(); - }); - } + } } } else { //涓嶆垚鍔� layer.msg('鑾峰彇鏉冮檺淇℃伅澶辫触', { @@ -498,155 +439,7 @@ }); } - // 鑾峰彇绠辨敮淇℃伅 - function getBoxInforVlues() { - var msg = ""; - if ($("#BoxNo").val() == "") { - layer.msg("璇疯緭鍏ョ鐮侊紒", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return msg; - } - if ($("#BoxNo3").val() == "") { - layer.msg("璇疯緭鍏ユ敮鐮侊紒", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return msg; - } - if ($("#SkuNo").val() == "") { - layer.msg("璇疯緭鍏ョ墿鏂欑紪鐮侊紒", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return msg; - } - if ($("#LotNo").val() == "") { - layer.msg("璇疯緭鍏ユ壒娆″彿锛�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return msg; - } - if ($("#Qty").val() == "") { - layer.msg("璇疯緭鍏ュ疄闄呮暟閲忥紒", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return msg; - } - - var param = { - BoxNo: $("#BoxNo").val(), - BoxNo3: $("#BoxNo3").val(), - SkuNo: $("#SkuNo").val(), - LotNo: $("#LotNo").val(), - LotText: $("#LotText").val(), - Qty: parseInt($("#Qty").val()), - ProductionTime: $("#ProductionTime").val(), - InspectMark: $("#InspectMark").val(), - BitBoxMark: $("#BitBoxMark").val(), - Origin: "褰曞叆", - }; - - return param; - } - - // 瀵煎叆绠辨敮鍏崇郴 - function uploadExcel(files) { - console.log("123"); - var list = []; - try { - var excel = layui.excel; - excel.importExcel(files, { - // 璇诲彇鏁版嵁鐨勫悓鏃舵⒊鐞嗘暟鎹� - fields: { - 'BoxNo': 'A', //绠卞彿 - 'BoxNo2': 'B', //鐩掑彿 - 'BoxNo3': 'C', //鏀彿 - 'Qty': 'D', //鏁伴噺 - 'SkuNo': 'E', //鐗╂枡鍙� - 'LotNo': 'F', //鎵规 - 'LotText': 'G', //鎵规鎻忚堪 - 'ProductionTime': 'H', //鐢熶骇鏃ユ湡 - 'InspectMark': 'I', //妫�楠屾爣璁� - 'BitBoxMark': 'J', //闆剁鏍囪 - } - }, - function (data) { - console.log(data); - // var arr = new Array(); - //excel绗竴琛屼笉璇诲彇銆佽缃负鏍囬 - for (i = 1; i < data[0].Sheet1.length; i++) { - - var Qty = 0; - if (isIntNum(data[0].Sheet1[i].Qty)) { - Qty = parseInt(data[0].Sheet1[i].Qty); - } - - var InspectMark = "0"; - var BitBoxMark = "0"; - if (data[0].Sheet1[i].InspectMark == "鏄�") { - InspectMark = "1"; - } - if (data[0].Sheet1[i].BitBoxMark == "鏄�") { - BitBoxMark = "1"; - } - var tt = { - BoxNo: data[0].Sheet1[i].BoxNo, - BoxNo2: data[0].Sheet1[i].BoxNo2, - BoxNo3: data[0].Sheet1[i].BoxNo3, - Qty: Qty, - SkuNo: data[0].Sheet1[i].SkuNo, - LotNo: data[0].Sheet1[i].LotNo, - LotText: data[0].Sheet1[i].LotText, - ProductionTime: data[0].Sheet1[i].ProductionTime, - InspectMark: InspectMark, - BitBoxMark: BitBoxMark, - }; - list.push(tt); - console.log(data[0].Sheet1[i].ProductionTime); - } - console.log(list); - var param = { - "OperType": "Add", - "ListBoxInfo": list, - } - console.log(param) - layer.load();//鎵撳紑loading - sendData(IP + "/BllAsn/ImportBllBoxInfo", param, 'post', function (res) { - layer.closeAll(); //鍏抽棴loading - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - bindTable(); - doing = true - }); - } else { //涓嶆垚鍔� - if (res.msg == undefined) { - layer.msg("鍚庡彴姝e湪瀵煎叆涓紝璇风◢鍚庢煡鐪嬬粨鏋�", { - icon: 2, - time: 3000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { bindTable(); doing = true }); - } else { - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { bindTable(); doing = true }); - } - } - }); - }); - } catch (e) { - layer.alert(e.message); - } - - } - //#endregion - + //#region 鑷畾涔夎〃澶� //鑷畾涔夎〃澶� active = { -- Gitblit v1.8.0