From 603ec6242dd3a46bda3ea54082e06240b21c673e Mon Sep 17 00:00:00 2001 From: bklLiudl <673013083@qq.com> Date: 星期六, 19 十月 2024 19:07:37 +0800 Subject: [PATCH] 问题修改 --- HTML/views/ASNSetting/SelMaterials.html | 493 ++++++++++++++++++++++++++---------------------------- 1 files changed, 239 insertions(+), 254 deletions(-) diff --git a/HTML/views/ASNSetting/SelMaterials.html b/HTML/views/ASNSetting/SelMaterials.html index 8e0d04a..7b963c9 100644 --- a/HTML/views/ASNSetting/SelMaterials.html +++ b/HTML/views/ASNSetting/SelMaterials.html @@ -1,280 +1,265 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>閫夋嫨鐗╂枡淇℃伅</title> - <meta name="renderer" content="webkit"> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> - <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> - </head> - <body> - <div class="layui-fluid"> - <div class="layui-card"> - <div class="layui-form layui-card-header layuiadmin-card-header-auto"> - <div class="layui-form-item"> - <div class="layui-inline"> - <label class="layui-form-label">鍏抽敭瀛�</label> - <div class="layui-input-inline"> - <input type="text" id="Msg" name="Msg" placeholder="缂栫爜/鍚嶇О/瑙勬牸" autocomplete="off" class="layui-input"> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">鍗曟嵁绫诲瀷</label> - <div class="layui-input-inline"> - <select name="Type" id="Type" lay-filter="Type" disabled="disabled" - lay-search> - <option value="0">鎴愬搧鍏ュ簱</option> - <option value="1">閲囪喘鍏ュ簱</option> - <option value="2">涓棿鍝佸叆搴�</option> - <option value="3">閫�璐у叆搴�</option> - <option value="4">杞﹂棿浣欐枡閫�鍥炲叆搴�</option> - <option value="5">鍏跺畠鍏ュ簱</option> - <option value="6">浠e偍鍏ュ簱</option> - <option value="7">瀵勫瓨鍏ュ簱</option> - </select> - </div> - </div> - <div class="layui-inline"> - <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit 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" data-type="setParent">纭畾</button> +<head> + <meta charset="utf-8"> + <title>閫夋嫨鐗╂枡淇℃伅</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> +</head> + +<body> + + <div class="layui-fluid"> + <div class="layui-card"> + <div class="layui-form layui-card-header layuiadmin-card-header-auto"> + <div class="layui-form-item"> + <div class="layui-inline"> + <label class="layui-form-label">鍏抽敭瀛�</label> + <div class="layui-input-inline"> + <input type="text" id="Msg" name="Msg" placeholder="缂栫爜/鍚嶇О/瑙勬牸" autocomplete="off" + class="layui-input"> </div> </div> - </div> - <div class="layui-card-body"> - <table id="goods-list" lay-filter="goods-list"></table> + <div class="layui-inline"> + <label class="layui-form-label">鍗曟嵁绫诲瀷</label> + <div class="layui-input-inline"> + <select name="Type" id="Type" lay-filter="Type" disabled="disabled" lay-search> + <option value="0">鎴愬搧鍏ュ簱</option> + <option value="1">閲囪喘鍏ュ簱</option> + <option value="2">涓棿鍝佸叆搴�</option> + <option value="3">閫�璐у叆搴�</option> + <option value="4">杞﹂棿浣欐枡閫�鍥炲叆搴�</option> + <option value="5">鍏跺畠鍏ュ簱</option> + <option value="6">浠e偍鍏ュ簱</option> + <option value="7">瀵勫瓨鍏ュ簱</option> + </select> + </div> + </div> + <div class="layui-inline"> + <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit + 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" data-type="setParent">纭畾</button> + </div> </div> </div> + <div class="layui-card-body"> + <table id="goods-list" lay-filter="goods-list"></table> + </div> </div> + </div> - <script src="../../layuiadmin/layui/layui.js"></script> - <script src="../../js/jquery-3.5.1.min.js"></script> - <script src="../../js/jquery.cookie.js"></script> - <script src="../../js/public.js"></script> - - <script> - layui.config({ - base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� - }).extend({ - index: 'lib/index' //涓诲叆鍙fā鍧� - }).use(['index', 'table', 'laypage', 'layer'], function() { - var table = layui.table, - form = layui.form, - laypage = layui.laypage, - index1 = parent.layer.getFrameIndex(window.name), - layer = layui.layer; + <script src="../../layuiadmin/layui/layui.js"></script> + <script src="../../js/jquery-3.5.1.min.js"></script> + <script src="../../js/jquery.cookie.js"></script> + <script src="../../js/public.js"></script> + + <script> + layui.config({ + base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index' //涓诲叆鍙fā鍧� + }).use(['index', 'table', 'laypage', 'layer'], function () { + var table = layui.table, + form = layui.form, + laypage = layui.laypage, + index1 = parent.layer.getFrameIndex(window.name), + layer = layui.layer; - // 鑾峰彇涓婃父椤甸潰鐨勪紶鍊� - getQueryString('type'); - + // 鑾峰彇涓婃父椤甸潰鐨勪紶鍊� + getQueryString('type'); - function getQueryString(name) { - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); - var r = window.location.search.substr(1).match(reg); - if (r != null) - { - // $("#Type").empty(); - // if (unescape(r[2]) == 0) - // { - // $("#Type").append('<option value ="0" Selected >鏍囧噯鐗╂枡</option>'); - // $("#Type").append('<option value ="1">闈炴爣鐗╂枡</option>'); - // } - // if (unescape(r[2]) == 1) - // { - // $("#Type").append('<option value ="0">鏍囧噯鐗╂枡</option>'); - // $("#Type").append('<option value ="1" Selected >闈炴爣鐗╂枡</option>'); - // } + function getQueryString(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); + var r = window.location.search.substr(1).match(reg); - - $("#Type").val(unescape(r[2])); // "optionValue"涓洪渶瑕佽閫変腑鐨勯�夐」鐨剉alue灞炴�у�� - form.render('select'); - } + if (r != null) { + // $("#Type").empty(); + // if (unescape(r[2]) == 0) + // { + // $("#Type").append('<option value ="0" Selected >鏍囧噯鐗╂枡</option>'); + // $("#Type").append('<option value ="1">闈炴爣鐗╂枡</option>'); + // } + // if (unescape(r[2]) == 1) + // { + // $("#Type").append('<option value ="0">鏍囧噯鐗╂枡</option>'); + // $("#Type").append('<option value ="1" Selected >闈炴爣鐗╂枡</option>'); + // } - //return null; + + $("#Type").val(unescape(r[2])); // "optionValue"涓洪渶瑕佽閫変腑鐨勯�夐」鐨剉alue灞炴�у�� + form.render('select'); } + //return null; + } - refreshTable(); - var active = { - setParent: function(){ - var checkStatus = table.checkStatus('goods-list'); - var id = '#LAY-app-content-list',goods = $('#goods-list'); - if(checkStatus.data.length == 0) - { - parent.layer.msg('璇烽�夋嫨寰呭叆搴撶殑鐗╂枡锛�'); - return true; + refreshTable(); + + var active = { + setParent: function () { + var checkStatus = table.checkStatus('goods-list'); + var id = '#LAY-app-content-list', goods = $('#goods-list'); + if (checkStatus.data.length == 0) { + parent.layer.msg('璇烽�夋嫨寰呭叆搴撶殑鐗╂枡锛�'); + return true; } window.parent.success(checkStatus.data); - parent.layer.close(index1); - } - }; - $('.layui-inline .layui-btn').on('click', function(){ - var othis = $(this) - ,type = othis.data('type'); - active[type] && active[type].call(this); - }); - - - var tableIns; - function refreshTable() { - var param = { - SkuNo: $("#Msg").val(), - Type: $("#Type").val() - }; - - sendData(IP + "/BllAsn/GetMaterialsList", param, 'post', function(res) { - if (res.code == 0) { //鎴愬姛 - var list = res.data; - $.extend(infoOptions, { - data: list - }); - infoOptions.page = { - curr: 1 - } - tableIns = table.render(infoOptions); - } else { //涓嶆垚鍔� - layer.msg('鑾峰彇鐗╂枡淇℃伅澶辫触锛�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - } - }); - + parent.layer.close(index1); } - // 琛ㄥ崟闇�瑕佺殑鍙橀噺 - var infoOptions = { - elem: '#goods-list', - height: 'full-100', - id: 'goods-list', - page: true, - limit: pageCnt, - limits: pageLimits, - cellMinWidth: 80, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板 - cols: [ - [{ - field: 'SkuId', - title: 'Id', - type: 'checkbox', - width: 100, - sort: true, - fixed: 'left' - }, { - field: 'SkuNo', - title: '鐗╂枡缂栫爜', - width: 100, - fixed: 'left' - }, { - field: 'SkuName', - title: '鐗╂枡鍚嶇О', - width: 180, - },{ - field: 'Standard', - title: '瑙勬牸', - align: 'center', - width: 180 - }, { - field: 'Type', - title: '绫诲瀷', - width: 100, - templet: function (d) { - switch (d.Type) { - case "0" : return "鍘熸枡"; - case "1" : return "鍖呮潗"; - case "2" : return "鎴愬搧"; - case "3" : return "鑰楁潗"; - case "4" : return "鍗婃垚鍝�"; - default : return ""; - } - } - }, { - field: 'IsControlled', - title: '鏄惁鏍囧噯', - // JC08 title: '鏄惁鍙楁帶', - width: 100, - // JC09 - templet: function (d) { - switch (d.IsControlled) { - case "0" : return "鏍囧噯"; - case "1" : return "闈炴爣"; - default : return ""; - } - }, - // JC08 - // templet: function (d) { - // switch (d.IsBale) { - // case "0" : return "鍙楁帶"; - // case "1" : return "闈炲彈鎺�"; - // default : return ""; - // } - // } - },{ - field: 'IsInspect', - title: '鏄惁鍏嶆', - width: 100, - templet: function (d) { - switch (d.IsInspect) { - case "0" : return "鍚�"; - case "1" : return "鏄�"; - default : return ""; - } - }, - },{ - field: 'Origin', - title: '鏉ユ簮', - width: 120 - },{ - field: 'UnitName', - title: '璁¢噺鍗曚綅', - width: 100, - }, { - field: 'PackagName', - title: '鍖呰鍚嶇О', - width: 120 - }, { - field: 'Environment', - title: '瀛樺偍鐜', - width: 120, - templet: function (d) { - switch (d.Environment) { - case "0" : return "甯告俯"; - case "1" : return "浣庢俯"; - case "3" : return "骞茬嚗閫氶"; - default : return ""; - } - }, - }, { - field: 'Weight', - title: '鐞嗚閲嶉噺', - width: 100 - },{ - field: 'Price', - title: '鐞嗚鍗曚环', - width: 100 - }, { - field: 'Warranty', - title: '淇濊川鏈�(澶�)', - width: 100 - },{ - field: 'GoodsRemark', - title: '澶囨敞', - width: 160 - } - ] - ], - + }; + $('.layui-inline .layui-btn').on('click', function () { + var othis = $(this) + , type = othis.data('type'); + active[type] && active[type].call(this); + }); + + + var tableIns; + function refreshTable() { + var param = { + SkuNo: $("#Msg").val(), + Type: $("#Type").val() }; - //鐩戝惉鎼滅储 - form.on('submit(LAY-app-contlist-search)', function(data) { - refreshTable(); + sendData(IP + "/BllAsn/GetMaterialsList", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + var list = res.data; + $.extend(infoOptions, { + data: list + }); + infoOptions.page = { + curr: 1 + } + tableIns = table.render(infoOptions); + } else { //涓嶆垚鍔� + layer.msg('鑾峰彇鐗╂枡淇℃伅澶辫触锛�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } }); + + } + // 琛ㄥ崟闇�瑕佺殑鍙橀噺 + var infoOptions = { + elem: '#goods-list', + height: 'full-100', + id: 'goods-list', + page: true, + limit: pageCnt, + limits: pageLimits, + cellMinWidth: 80, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板 + cols: [ + [{ + field: 'SkuId', + title: 'Id', + type: 'checkbox', + width: 100, + sort: true, + fixed: 'left' + }, { + field: 'SkuNo', + title: '鐗╂枡缂栫爜', + width: 100, + fixed: 'left' + }, { + field: 'SkuName', + title: '鐗╂枡鍚嶇О', + width: 180, + }, { + field: 'Standard', + title: '瑙勬牸', + align: 'center', + width: 180 + }, { + field: 'Type', + title: '绫诲瀷', + width: 100, + templet: function (d) { + switch (d.Type) { + case "0": return "鍘熸枡"; + case "1": return "鍖呮潗"; + case "2": return "鎴愬搧"; + case "3": return "鑰楁潗"; + case "4": return "鍗婃垚鍝�"; + default: return ""; + } + } + }, + + { + field: 'IsControlled', + title: '鏄惁鏍囧噯', + // JC08 title: '鏄惁鍙楁帶', + width: 100, + // JC09 + templet: function (d) { + switch (d.IsControlled) { + case "0": return "鏍囧噯"; + case "1": return "闈炴爣"; + default: return ""; + } + }, + }, { + field: 'IsInspect', + title: '鏄惁鍏嶆', + width: 100, + templet: function (d) { + switch (d.IsInspect) { + case "0": return "鍚�"; + case "1": return "鏄�"; + default: return ""; + } + }, + }, { + field: 'Origin', + title: '鏉ユ簮', + width: 120 + }, { + field: 'UnitName', + title: '璁¢噺鍗曚綅', + width: 100, + }, { + field: 'PackagName', + title: '鍖呰鍚嶇О', + width: 120 + }, { + field: 'Environment', + title: '瀛樺偍鐜', + width: 120, + templet: function (d) { + switch (d.Environment) { + case "0": return "甯告俯"; + case "1": return "浣庢俯"; + case "3": return "骞茬嚗閫氶"; + default: return ""; + } + }, + }, { + field: 'GoodsRemark', + title: '澶囨敞', + width: 160 + } + ] + ], + + }; + + //鐩戝惉鎼滅储 + form.on('submit(LAY-app-contlist-search)', function (data) { + refreshTable(); }); - </script> - </body> -</html> + }); + </script> +</body> + +</html> \ No newline at end of file -- Gitblit v1.8.0