| | |
| | | |
| | | <!-- 搜索栏 --> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin: 20px;"> |
| | | <legend>搜索栏</legend> |
| | | <legend data-i18n="search_bar">搜索栏</legend> |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <!-- <div class="layui-input-inline" style="margin-top: -10px">--> |
| | | <!-- <select id="crnNo" name="crnNo">--> |
| | | <!-- <option value="" style="display: none">请选择巷道</option>--> |
| | | <!-- <option value="1">1号</option>--> |
| | | <!-- <option value="2">2号</option>--> |
| | | <!-- <option value="3">3号</option>--> |
| | | <!-- <option value="4">4号</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="crnNo" class="layui-input" name="crnNo" type="text" data-i18n-placeholder="please_input" placeholder="请输入" autocomplete="off" style="display: none"> |
| | | <input id="crnNo$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" data-i18n-placeholder="crane_no" placeholder="堆垛机号" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basCrnpQueryBycrnNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basCrnpQueryBycrnNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" data-i18n-placeholder="location_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="物料描述" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="matnr" data-i18n-placeholder="product_code" placeholder="商品编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="specs" data-i18n-placeholder="spec" placeholder="规格" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="maktx" data-i18n-placeholder="material_desc" placeholder="物料描述" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | <input class="layui-input layui-laydate-range" id="modi_time" name="modi_time" type="text" data-i18n-placeholder="start_end_time" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search" data-i18n="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset" data-i18n="reset">重置</button> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="">提取</button> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="" data-i18n="extract">提取</button> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <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/i18n/i18n-helper.js"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | |
| | | </body> |
| | | <script> |
| | | |
| | | var locDetlTableIns; |
| | | function getCol() { |
| | | let cols = [ |
| | | {type: 'checkbox', merge: ['locNo']} |
| | | ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ,{field: 'locNo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('location_no') : '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'}) |
| | | var dCols = []; |
| | | if (typeof getDetlCols === 'function') { |
| | | dCols = getDetlCols(); |
| | | } else { |
| | | dCols = detlCols.slice(); |
| | | } |
| | | cols.push.apply(cols, dCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('modifier') : '修改人员', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('modify_time') : '修改时间'}) |
| | | return cols; |
| | | } |
| | | |
| | |
| | | var admin = layui.admin; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | var dateIns = layDate.render({ |
| | | elem: '#modi_time' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,lang: typeof I18n !== 'undefined' && I18n.getLanguage().toLowerCase() === 'zh-cn' ? 'cn' : 'en' |
| | | }); |
| | | |
| | | // 数据渲染 |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/stock/out/list/auth', |
| | | page: true, |
| | | limit: 20, |
| | | limits: [20, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | function initTable() { |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/stock/out/list/auth', |
| | | page: true, |
| | | limit: 20, |
| | | limits: [20, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | text: { |
| | | none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '暂无相关数据' |
| | | }, |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | if (typeof I18n !== 'undefined') { |
| | | I18n.updatePage(); |
| | | I18n.updateLayuiPagination(); |
| | | } |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // Initialize table when I18n is ready |
| | | if (typeof I18n !== 'undefined' && I18n.isReady()) { |
| | | initTable(); |
| | | } else { |
| | | $(document).on('i18n:ready', function() { |
| | | initTable(); |
| | | }); |
| | | } |
| | | |
| | | $(document).on('i18n:languageChanged', function() { |
| | | if (locDetlTableIns) { |
| | | locDetlTableIns.reload({ |
| | | cols: [getCol()] |
| | | }); |
| | | } else { |
| | | initTable(); |
| | | } |
| | | $('[data-i18n-placeholder]').each(function() { |
| | | var key = $(this).attr('data-i18n-placeholder'); |
| | | $(this).attr('placeholder', I18n.t(key)); |
| | | }); |
| | | // Reload date component |
| | | if (typeof dateIns !== 'undefined') { |
| | | // Completely remove and recreate the input element to force laydate reset |
| | | var $input = $('#modi_time'); |
| | | var parent = $input.parent(); |
| | | var inputHtml = $input.prop("outerHTML"); |
| | | $input.remove(); |
| | | parent.append(inputHtml); |
| | | $('#modi_time').removeAttr('lay-key'); // Ensure no key remains |
| | | |
| | | dateIns = layDate.render({ |
| | | elem: '#modi_time' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,lang: I18n.getLanguage().toLowerCase() === 'zh-cn' ? 'cn' : 'en' |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | switch(obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择数据", {icon: 2}); |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_select_data') : "请选择数据", {icon: 2}); |
| | | return; |
| | | } |
| | | let locNos = []; |
| | |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | |
| | | tableReload(); |
| | | }); |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | |
| | | }) |
| | | |
| | | function tableReload() { |
| | | if (!locDetlTableIns) return; |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | |
| | | } |
| | | |
| | | </script> |
| | | |
| | | </html> |
| | | |