| | |
| | | } |
| | | |
| | | var matCols = [ |
| | | {field: 'matNo', align: 'center',title: '物料编码'} |
| | | ,{field: 'barcode', align: 'center',title: '条形码', hide: true} |
| | | ,{field: 'matName', align: 'center',title: '物料名称', width: 500} |
| | | ,{field: 'str2', align: 'center',title: '物料类别'} |
| | | ,{field: 'str3', align: 'center',title: '规格型号'} |
| | | ,{field: 'str1', align: 'center',title: '基本单位', hide: true} |
| | | ,{field: 'str4', align: 'center',title: '状态', hide: true} |
| | | ,{field: 'str5', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'str6', align: 'center',title: '通知单号', hide: true} |
| | | ,{field: 'str7', align: 'center',title: '默认仓库', hide: true} |
| | | // ,{field: 'str8', align: 'center',title: '品牌'} |
| | | // ,{field: 'str9', align: 'center',title: '采购员'} |
| | | // ,{field: 'str10', align: 'center',title: '产地'} |
| | | // ,{field: 'str11', align: 'center',title: '序列号管理'} |
| | | // ,{field: 'str12', align: 'center',title: '批次管理'} |
| | | // ,{field: 'str13', align: 'center',title: '保质期单位'} |
| | | // ,{field: 'str14', align: 'center',title: '保质期管理'} |
| | | // ,{field: 'str15', align: 'center',title: '保质期'} |
| | | // ,{field: 'str16', align: 'center',title: '可销售'} |
| | | ,{field: 'str17', align: 'center',title: '可采购', hide: true} |
| | | ,{field: 'str18', align: 'center',title: '可为子件', hide: true} |
| | | // ,{field: 'str19', align: 'center',title: '可为组件'} |
| | | // ,{field: 'str20', align: 'center',title: '辅助属性管理'} |
| | | ,{field: 'str21', align: 'center',title: '成本计算方法', hide: true} |
| | | ,{field: 'str22', align: 'center',title: '采购单位', hide: true} |
| | | ,{field: 'str23', align: 'center',title: '销售单位', hide: true} |
| | | // ,{field: 'num1', align: 'center',title: '预警天数'} |
| | | // ,{field: 'num2', align: 'center',title: '最低库存数量'} |
| | | // ,{field: 'num3', align: 'center',title: '最高库存数量'} |
| | | // ,{field: 'num4', align: 'center',title: '安全库存'} |
| | | // ,{field: 'num5', align: 'center',title: '税率'} |
| | | {field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} |
| | | ,{field: 'name', align: 'center',title: '名称', hide: true} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: true} |
| | | ,{field: 'model', align: 'center',title: '型号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'barcode', align: 'center',title: '货物条码', hide: true} |
| | | // ,{field: 'docId', align: 'center',title: '单据类型', hide: true} |
| | | // ,{field: 'docNum', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'custName', align: 'center',title: '客户名称', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'count', align: 'center',title: '数量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '重量', hide: true} |
| | | ] |
| | | |
| | | var detlCols = [ |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | |
| | | function right(){ |
| | | top.layui.admin.popupRight({ |
| | | id: 'LAY_adminPopupLayerTest' |
| | | , area: '750px' |
| | | , type: 2 |
| | | ,content:'custOrder/matQuery.html' |
| | | ,success: function(){ |
| | | // $('#'+ this.id).html('<div style="padding: 20px;">放入内容</div>'); |
| | | //admin.view(this.id).render('system/xxx') |
| | | } |
| | | }); |
| | | } |
| | | |
| | | layui.config({ |
| | | base: '../../layuiadmin/' //静态资源所在路径 |
| | | }).extend({ |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['table', 'laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
New file |
| | |
| | | |
| | | var matData = []; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130, style:'color: blue;font-weight: bold'} |
| | | ]; |
| | | arrRemove(matCols, 'field', 'anfme'); |
| | | cols.push.apply(cols, matCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:65}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | data: [], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | done: function(res, curr, count) { |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateMatData(obj.data.locNo, obj.data.matnr, Number(obj.value)); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | var data = matData; |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | if (data.length === 0){ |
| | | layer.msg('请先添加物料'); |
| | | } else { |
| | | var locDetls = []; |
| | | data.forEach(function(elem) { |
| | | locDetls.push({nodeId: elem.nodeId, matnr: elem.matnr, count: elem.count}); |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl+"/work/pakout/init", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(locDetls), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | matData = []; |
| | | tableIns.reload({data: matData,done:function (res) { |
| | | limit(); |
| | | }}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = matData.length - 1; i >= 0; i--) { |
| | | if (matData[i].matnr === data.matnr) { |
| | | matData.splice(i, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData,done:function (res) { |
| | | limit(); |
| | | }}); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | function updateMatData(locNo, matnr, count) { |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count > 0) { |
| | | for (var i=0;i<matData.length;i++){ |
| | | if (matData[i]["matnr"] === matnr){ |
| | | // if (count > locDetlData[i]["anfme"]) { |
| | | // layer.msg("不能超过原数量"); |
| | | // } else { |
| | | matData[i]["count"] = count; |
| | | // } |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData,done:function (res) { |
| | | limit(); |
| | | }}); |
| | | } |
| | | |
| | | }) |
| | | |
| | | // 提取物料 |
| | | var matDetlLayerIdx; |
| | | function getMatDetl() { |
| | | matDetlLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: '提取出库物料', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'matQueryBox.html', |
| | | success: function(layero, index){ |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (data[i].matnr === matData[j].matnr) { |
| | | pass = true; |
| | | break; |
| | | } |
| | | } |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = 0; |
| | | } |
| | | |
| | | } |
| | | matData.push.apply(matData, data); |
| | | tableIns.reload({data: matData}); |
| | | layer.close(matDetlLayerIdx); |
| | | } |
| | |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" onclick="right()">无js右侧弹出</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>--> |
| | | <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <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, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | padding-bottom: 20px; |
| | | } |
| | | |
| | | #staNoSpan { |
| | | text-align: center; |
| | | display: inline-block; |
| | | width: 100px; |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-form-select { |
| | | display: inline-block; |
| | | width: 150px; |
| | | height: 30px; |
| | | } |
| | | .layui-btn-container .layui-form-select.layui-form-selected { |
| | | display: inline-block; |
| | | width: 150px; |
| | | } |
| | | .layui-btn-container .layui-select-title input { |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-anim.layui-anim-upbit dd { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | #btn-outbound { |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | /*----------------------------------*/ |
| | | .function-area { |
| | | padding: 20px 50px; |
| | | } |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 1px 1px 1px; |
| | | width: 100px; |
| | | height: 50px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 2px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | letter-spacing: 3px; |
| | | } |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 功能区 --> |
| | | <div class="function-area"> |
| | | <button id="mat-query" class="function-btn" onclick="getMatDetl()">+ 物料</button> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <!-- 表格 --> |
| | | <div style="padding-bottom: 5px; margin-bottom: 45px"> |
| | | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-form"> |
| | | <div class="layui-btn-container"> |
| | | <!-- 2.启动出库 --> |
| | | <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">启动出库</button> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | | </script> |
| | | |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </div> |
| | | |
| | | <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/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/ioWorks/matQuery.js" charset="utf-8"></script> |
| | | |
| | | </body> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <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, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | body { |
| | | padding: 0 20px; |
| | | } |
| | | .layui-table-box { |
| | | border-right: 1px solid #9F9F9F; |
| | | border-left: 1px solid #9F9F9F; |
| | | } |
| | | |
| | | #search-box { |
| | | padding: 30px 0 20px 0; |
| | | } |
| | | #search-box .layui-inline:first-child { |
| | | margin-left: 30px; |
| | | } |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-left: 10px; |
| | | display: inline-block; |
| | | } |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin: 20px;"> |
| | | <legend>搜索栏</legend> |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" 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"> |
| | | </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> |
| | | </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> |
| | | </div> |
| | | </script> |
| | | |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="stockOut" lay-filter="stockOut"></table> |
| | | </div> |
| | | |
| | | <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/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | |
| | | </body> |
| | | <script> |
| | | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push({field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | // 数据渲染 |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/mat/list/auth', |
| | | page: true, |
| | | limit: 8, |
| | | 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 |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(stockOut)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择数据"); |
| | | return; |
| | | } |
| | | parent.addTableData(data); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(); |
| | | }); |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | }) |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | locDetlTableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | </script> |
| | | </html> |
| | | |
| | |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-col-xs6 layui-col-sm3"> |
| | | <div class="console-app-group" lay-href="pakout/pakout.html?resourceId=30435" lay-text="拣货工作档"> |
| | | <div class="console-app-group" lay-href="pakout/pakout.html?resourceId=30435" lay-text="拣货单管理"> |
| | | <i class="console-app-icon layui-icon layui-icon-form" style="color: #b37feb;font-size: 30px;"></i> |
| | | <div class="console-app-name">拣货单</div> |
| | | </div> |
| | |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | $('.layui-form-checkbox').css("pointer-events", "none"); |
| | | $('td[data-field="0').css("cursor", "pointer") |
| | | // $('.layui-form-checkbox').css("pointer-events", "none"); |
| | | // $('td[data-field="0').css("cursor", "pointer") |
| | | } |
| | | }); |
| | | } |
| | |
| | | <span name="wrkSts" |
| | | {{# if( d.wrkSts === 1){ }} |
| | | class="layui-badge layui-badge-blue" |
| | | {{# }else if(d.wrkSts === 2){ }} |
| | | {{# } else if(d.wrkSts === 2){ }} |
| | | class="layui-badge layui-badge-red" |
| | | {{# }else if(d.wrkSts === 3){ }} |
| | | {{# } else if(d.wrkSts === 3){ }} |
| | | class="layui-badge layui-badge-green" |
| | | {{# } }} |
| | | >{{d.wrkSts$}}</span> |