From b301170fd119b1519b2b2cc8dfabf0c3bb754440 Mon Sep 17 00:00:00 2001 From: 王佳豪 <g675230687@126.com> Date: 星期二, 09 三月 2021 08:55:52 +0800 Subject: [PATCH] 1.0.3 平仓库区功能 出库作业-查询通知单号功能优化 --- src/main/webapp/static/js/locNormal/locNormal.js | 43 +++++++++++++++++++++++++++++++++---------- 1 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/static/js/locNormal/locNormal.js b/src/main/webapp/static/js/locNormal/locNormal.js index 0fc0998..fd64c13 100644 --- a/src/main/webapp/static/js/locNormal/locNormal.js +++ b/src/main/webapp/static/js/locNormal/locNormal.js @@ -1,5 +1,6 @@ var pageCurr; var locNormalList = []; +var locArea = []; function getCol() { var cols = []; @@ -8,7 +9,8 @@ ) cols.push.apply(cols, locNormalCols); cols.push( - {field: 'state', align: 'center', title: '鍑哄叆搴撶姸鎬�', templet: '#locNormalState'} + {field: 'warehouse', align: 'center', title: '搴撳尯'} + , {field: 'state', align: 'center', title: '鍑哄叆搴撶姸鎬�', templet: '#locNormalState'} , {field: 'modiUser$', align: 'center', title: '淇敼浜哄憳', hide: true} , {field: 'modiTime$', align: 'center', title: '淇敼鏃堕棿', hide: true} , {field: 'appeTime$', align: 'center', title: '鍒涘缓鏃堕棿', hide: true} @@ -16,6 +18,19 @@ ); return cols; } + +// 鑾峰彇浠撳簱涓嬫媺 +$.ajax({ + url: baseUrl+"/locArea/queryAll/auth", + headers: {'token': localStorage.getItem('token')}, + // data: top.reObject(data), + method: 'POST', + success: function (res) { + if (res.data && res.data.length > 0) { + locArea = res.data; + } + }, +}); layui.use(['table', 'laydate', 'form', 'upload'], function () { var table = layui.table; @@ -34,14 +49,14 @@ , exts: 'xls|excel|xlsx' , auto: false , bindAction: '#uploadDo' - , before: function(obj){ + , before: function (obj) { layer.closeAll(); - layer.load(1, {shade: [0.1,'#fff']}); + layer.load(1, {shade: [0.1, '#fff']}); } - , choose: function(obj){ + , choose: function (obj) { $('#uploadDesc').hide(); $('#uploadDemoView').show(); - obj.preview(function(index, file, result){ + obj.preview(function (index, file, result) { $('#fileMame').html(file.name); }); } @@ -54,15 +69,14 @@ layer.msg(res.msg); tableReload(false); } - , error: function(index, upload){ + , error: function (index, upload) { layer.closeAll('loading'); } }); /* 瀵煎叆 */ table.on('toolbar(locNormal)', function (obj) { - debugger - switch(obj.event) { + switch (obj.event) { // 瀵煎叆 case 'intoData': layer.open({ @@ -70,7 +84,7 @@ title: '鏁版嵁瀵煎叆', shadeClose: true, content: $('#importDataDiv'), - success: function(layero, index){ + success: function (layero, index) { uploader.reload(); }, end: function () { @@ -101,11 +115,20 @@ pageSize: 'limit' }, parseData: function (res) { + // 瑙f瀽搴撳尯鍚嶇О + var records = res.data.records; + records.map(function (item) { + locArea.map(function (d) { + if (d.id == item.warehouse) { + item.warehouse = d.name; + } + }) + }); return { 'code': res.code, 'msg': res.msg, 'count': res.data.total, - 'data': res.data.records + 'data': res.data.records, } }, response: { -- Gitblit v1.9.1