From f56e004dac74ebcf6638e0b8dc162062f19dbe34 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期一, 06 一月 2025 15:50:02 +0800 Subject: [PATCH] #平库入库完成+库存明细+库存统计 --- src/main/webapp/views/node/node.html | 322 +++++------------------------------------------------ 1 files changed, 33 insertions(+), 289 deletions(-) diff --git a/src/main/webapp/views/node/node.html b/src/main/webapp/views/node/node.html index bc3b016..1c9e70a 100644 --- a/src/main/webapp/views/node/node.html +++ b/src/main/webapp/views/node/node.html @@ -34,21 +34,9 @@ <div class="layui-btn-container" style="width: 100%"> <button lay-event="add" class="layui-btn layui-btn-sm layui-btn-normal icon-btn"><i class="layui-icon"></i>娣诲姞</button> <button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon"></i>鍒犻櫎</button> - <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="printBatch">鎵归噺鎵撳嵃</button> - <!-- 鍟嗗搧/鐗╂枡 鏁版嵁涓績 --> - <div class="dropdown-menu" style="margin-left: 0"> - <button class="layui-btn layui-btn-sm icon-btn layui-btn-primary" style="margin-top: 2px"> 鏁版嵁鍚屾 <i class="layui-icon layui-icon-drop"></i></button> - <ul class="dropdown-menu-nav dark"> - <div class="dropdown-anchor"></div> - <li class="title">1st menu</li> - <li><a onclick="excelMouldDownload()" style="font-size: 12px"><i class="layui-icon layui-icon-template-1"></i>妯℃澘涓嬭浇</a></li> - <li><a onclick="importExcel()" style="font-size: 12px"><i class="layui-icon layui-icon-upload"></i>瀵煎叆 Excel</a></li> - <li style="display: none"><input id="importExcel" type="file" onchange="upload(this)" ></li> - <hr> - <li class="title">2nd menu</li> - <li><a onclick="exportExcel()" style="font-size: 12px"><i class="layui-icon layui-icon-export"></i>瀵煎嚭 Excel</a></li> - </ul> - </div> +<!-- <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="printBatch">鎵归噺鎵撳嵃</button>--> + <button class="layui-btn layui-btn-sm layui-btn-warm" id="btn-node-init" lay-event="nodeInit">搴撲綅鍒濆鍖�</button> + </div> </script> @@ -143,289 +131,45 @@ <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> +<script type="text/javascript" src="../../static/js/node/node.js" charset="utf-8"></script> -<script> - var insTb; - var admin; - layui.config({ - base: baseUrl + "/static/layui/lay/modules/" - }).extend({ - dropdown: 'dropdown/dropdown', - }).use(['form','treeTable', 'admin', 'xmSelect', 'dropdown', 'element'], function() { - var $ = layui.jquery; - var layer = layui.layer; - var form = layui.form; - admin = layui.admin; - var treeTable = layui.treeTable; - var xmSelect = layui.xmSelect; - var tbDataList = []; +<!-- 閲嶇疆搴撲綅寮圭獥 --> +<div id="resetLocDiv" style="margin: 20px 0 10px 30px; display: none"> + <div class="layui-form layui-form-pane"> - insTb = treeTable.render({ - elem: '#node', - url: baseUrl+'/node/list/tree/auth', - headers: {token: localStorage.getItem('token')}, - height: 'full-200', - toolbar: '#toolbar', - tree: { - iconIndex: 2, // 鎶樺彔鍥炬爣鏄剧ず鍦ㄧ鍑犲垪 - isPidData: true, // 鏄惁鏄痠d銆乸id褰㈠紡鏁版嵁 - idName: 'id', // id瀛楁鍚嶇О - pidName: 'parentId' // pid瀛楁鍚嶇О - }, - cols: [[ - {type: 'checkbox'} - ,{type: 'numbers'} - ,{field: 'name', align: 'left',title: '缂栧彿/鍚嶇О', minWidth: 150} - // ,{field: 'uuid', left: 'center',title: '缂栧彿/鍚嶇О', minWidth: 150} - ,{field: 'type$', align: 'center',title: '绫诲瀷', templet: '#typeTpl'} - // ,{field: 'leading', align: 'center',title: '璐熻矗浜�'} - // ,{field: 'img', align: 'center',title: '鍥剧墖', hide: true} - // ,{field: 'brief', align: 'center',title: '绠�瑕佹弿杩�'} - // ,{field: 'count', align: 'center',title: '鏁伴噺'} - // ,{field: 'sort', align: 'center',title: '鎺掑簭'} - ,{field: 'status$', align: 'center',title: '鐘舵��', hide: true} - ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'} - ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'} - ,{field: 'memo', align: 'center',title: '澶囨敞', hide: true} + <!-- 搴撲綅绫诲瀷 --> + <div class="layui-form-item"> + <label class="layui-form-label">搴撳尯</label> + <div class="layui-input-inline"> + <div id="mat" name="areaId"> + </div> + </div> + </div> - ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150} - ]], - done: function (data) { - console.log(data) - $('.ew-tree-table-box').css('height', '100%'); - insTb.expandAll(); - tbDataList = data; - } - }); + <!-- 鎺� --> + <div class="layui-form-item"> + <div class="layui-inline"> + <label class="layui-form-label">搴撲綅鏁伴噺</label> + <div class="layui-input-inline"> + <input type="number" name="startRow" autocomplete="off" class="layui-input" lay-verify="required|number"> + </div> - /* 琛ㄦ牸澶村伐鍏锋爮鐐瑰嚮浜嬩欢 */ - treeTable.on('toolbar(node)', function (obj) { - var checkRows = insTb.checkStatus(); - if (obj.event === 'add') { // 娣诲姞 - showEditModel(); - } else if (obj.event === 'del') { // 鍒犻櫎 - if (checkRows.length === 0) { - layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2}); - return; - } - var ids = checkRows.map(function (d) { - if (!d.LAY_INDETERMINATE) { - return d.id; - } else { - return null; - } - }); - doDel({ids: ids}); - } else if (obj.event === 'printBatch') { - if (checkRows.length === 0) { - layer.msg('璇烽�夋嫨瑕佹墦鍗扮殑鏁版嵁', {icon: 2}); - return; - } - var printContent = checkRows.map(function (d) { - if (!d.LAY_INDETERMINATE && d.type === 3) { - return d.name; - } else { - return null; - } - }); - printBatch(printContent, 1); - } - }); + </div> + </div> - /* 琛ㄦ牸鎿嶄綔鍒楃偣鍑讳簨浠� */ - treeTable.on('tool(node)', function (obj) { - if (obj.event === 'edit') { // 淇敼 - showEditModel(obj.data); - } else if (obj.event === 'del') { // 鍒犻櫎 - doDel(obj); - } - }); - /* 鏄剧ず琛ㄥ崟寮圭獥 */ - function showEditModel(mData) { - admin.open({ - type: 1, - area: '600px', - title: (mData ? '淇敼' : '娣诲姞') + '璐т綅', - content: $('#editDialog').html(), - success: function (layero, dIndex) { - // 鍥炴樉琛ㄥ崟鏁版嵁 - form.val('detail', mData); - // 琛ㄥ崟鎻愪氦浜嬩欢 - form.on('submit(editSubmit)', function (data) { - data.field.parentId = insXmSel.getValue('valueStr'); - var loadIndex = layer.load(2); - $.ajax({ - url: baseUrl+"/node/"+(mData?'update':'add')+"/auth", - headers: {'token': localStorage.getItem('token')}, - data: data.field, - method: 'POST', - success: function (res) { - layer.close(loadIndex); - if (res.code === 200){ - layer.close(dIndex); - layer.msg(res.msg, {icon: 1}); - insTb.refresh(); - } else if (res.code === 403){ - top.location.href = baseUrl+"/"; - }else { - layer.msg(res.msg, {icon: 2}); - } - } - }) - return false; - }); - // 娓叉煋涓嬫媺鏍� - var insXmSel = xmSelect.render({ - el: '#nodeParentSel', - height: '250px', - data: insTb.options.data, - initValue: mData ? [mData.parentId] : [], - model: {label: {type: 'text'}}, - prop: { - name: 'name', - value: 'id' - }, - radio: true, - clickClose: true, - tree: { - show: true, - indent: 15, - strict: false, - expandedKeys: true - } - }); - // 寮圭獥涓嶅嚭鐜版粴鍔ㄦ潯 - $(layero).children('.layui-layer-content').css('overflow', 'visible'); - layui.form.render('select'); - } - }); - } - /* 鍒犻櫎 */ - function doDel(obj) { - layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', { - skin: 'layui-layer-admin', - shade: .1 - }, function (i) { - layer.close(i); - var loadIndex = layer.load(2); - var ids; - if (obj.data) { - ids = []; - ids[0] = obj.data.id; - } else { - ids = obj.ids; - } - $.ajax({ - url: baseUrl+"/node/delete0/auth", - headers: {'token': localStorage.getItem('token')}, - data: {ids: ids}, - method: 'POST', - success: function (res) { - layer.close(loadIndex); - if (res.code === 200){ - layer.msg(res.msg, {icon: 1}); - insTb.refresh(); - } else if (res.code === 403){ - top.location.href = baseUrl+"/"; - } else { - layer.msg(res.msg, {icon: 2}); - } - } - }) - }); - } + <div id="prompt" style="text-indent: 10px;"> + <span class="not-null">鍒濆鍖栧簱浣嶅悗灏嗗垹闄ゅ簱瀛樻槑缁嗭紝璇疯皑鎱庢搷浣滐紒</span> + </div> + <!-- 鎸夐挳 --> + <div style="text-align: center; margin-top: 20px"> + <button class="layui-btn layui-btn-radius layui-btn-normal" id="initDo" lay-submit lay-filter="initDo">纭畾</button> + </div> + </div> +</div> - // 鎵归噺鎵撳嵃 - function printBatch(printMsgList, type) { - var data = []; - for (var i = 0; i<printMsgList.length; i ++) { - if (printMsgList[i] != null && printMsgList[i] !== '') { - var barcodeUrl; - if (type === 1) { - barcodeUrl = baseUrl+"/barcode/qrcode/auth?type="+type+"¶m="+printMsgList[i]+"&width="+200+"&height="+70; - } else { - barcodeUrl = baseUrl+"/barcode/qrcode/auth?type="+type+"¶m="+printMsgList[i]+"&width="+400+"&height="+180; - } - data.push({ - item: printMsgList[i], - barcodeUrl: barcodeUrl - }) - } - } - var tpl = $('#locPrintTpl').html(); - var template = Handlebars.compile(tpl); - var html = template({data: data}); - var box = $("#printBox"); - box.html(html); - box.show(); - box.print({mediaPrint:true}); - box.hide(); - } - }); - - // excel瀵煎叆妯℃澘涓嬭浇 - function excelMouldDownload(){ - layer.load(1, {shade: [0.1,'#fff']}); - location.href = baseUrl + "/node/excel/import/mould"; - layer.closeAll('loading'); - } - - // excel瀵煎叆 - function importExcel() { - $("#importExcel").trigger("click"); - } - function upload(obj){ - if(!obj.files) { - return; - } - var file = obj.files[0]; - admin.confirm('纭鍚屾 [' + file.name +'] 鏂囦欢鍚楋紵', function (index) { - layer.load(1, {shade: [0.1,'#fff']}); - var url = baseUrl + "/node/excel/import/auth"; - var form = new FormData(); - form.append("file", file); - xhr = new XMLHttpRequest(); - xhr.open("post", url, true); //post鏂瑰紡锛寀rl涓烘湇鍔″櫒璇锋眰鍦板潃锛宼rue 璇ュ弬鏁拌瀹氳姹傛槸鍚﹀紓姝ュ鐞嗐�� - xhr.setRequestHeader('token', localStorage.getItem('token')); - xhr.onload = uploadComplete; //璇锋眰瀹屾垚 - xhr.onerror = uploadFailed; //璇锋眰澶辫触 - xhr.onloadend = function () { // // 涓婁紶瀹屾垚閲嶇疆鏂囦欢娴� - layer.closeAll('loading'); - $("#importExcel").val(""); - }; - // xhr.upload.onprogress = progressFunction;//銆愪笂浼犺繘搴﹁皟鐢ㄦ柟娉曞疄鐜般�� - xhr.upload.onloadstart = function(){//涓婁紶寮�濮嬫墽琛屾柟娉� - ot = new Date().getTime(); //璁剧疆涓婁紶寮�濮嬫椂闂� - oloaded = 0;//璁剧疆涓婁紶寮�濮嬫椂锛屼互涓婁紶鐨勬枃浠跺ぇ灏忎负0 - }; - xhr.send(form); - }, function(index){ - $("#importExcel").val(""); - }); - } - function uploadComplete(evt) { - var res = JSON.parse(evt.target.responseText); - if(res.code === 200) { - layer.msg(res.msg, {icon: 1}); - insTb.refresh(); - } else { - layer.msg(res.msg, {icon: 2}); - } - } - function uploadFailed(evt) { - var res = JSON.parse(evt.target.responseText); - layer.msg(res.msg, {icon: 2}); - } - - // excel瀵煎嚭 - function exportExcel() { - - } - -</script> </body> </html> -- Gitblit v1.9.1