| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> |
| | | <title>平仓入库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">单号</label> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <input id="billNo" class="layui-input" autocomplete="off" oninput="find(this)"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库区</label> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <select id="uuid"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<div style="margin: 5px 5px">--> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">单号</label> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <input id="billNo" class="layui-input" autocomplete="off" oninput="find(this)"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库区</label> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <select id="uuid"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<div style="margin: 5px 5px">--> |
| | | <!--<button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i--> |
| | | <!-- class="layui-icon">+</i>提取--> |
| | | <!--</button>--> |
| | | <!--</div>--> |
| | | </header> |
| | | <!-- 主体 --> |
| | | <main> |
| | | <div class="layui-btn-group demoTable"> |
| | | <div class="layui-inline"> |
| | | <input class="layui-input" name="id" id="demoReload" autocomplete="off" placeholder="生产单号"> |
| | | <!--</div>--> |
| | | </header> |
| | | <!-- 主体 --> |
| | | <main> |
| | | <div class="layui-btn-group demoTable"> |
| | | <div class="layui-inline"> |
| | | <input class="layui-input" name="id" id="demoReload" autocomplete="off" placeholder="生产单号"> |
| | | </div> |
| | | <button class="layui-btn" data-type="reload">搜索</button> |
| | | <button class="layui-btn" data-type="getCheckData">提取</button> |
| | | </div> |
| | | <button class="layui-btn" data-type="reload">搜索</button> |
| | | <button class="layui-btn" data-type="getCheckData">提取</button> |
| | | </div> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" |
| | | style="margin-left: 20px">入库 |
| | | </button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" |
| | | </button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" |
| | | style="margin-left: 20px">返回 |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | |
| | | <!-- 修改数量弹窗 --> |
| | | <div id="modify" style="display: none; text-align: center;padding-top: 10px"> |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <table style="display: none"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">物料</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="matNo" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!-- 修改数量弹窗 --> |
| | | <div id="modify" style="display: none; text-align: center;padding-top: 10px"> |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <table style="display: none"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">物料</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="matNo" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td style="vertical-align: top"> |
| | | <span style="width: 35px; margin-right: 5px">名称</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <textarea rows="2" style="resize: none; width: 165px" id="matName" type="text" |
| | | disabled="disabled" readonly="readonly"></textarea> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">单号</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="mnemonic" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td style="vertical-align: top"> |
| | | <span style="width: 35px; margin-right: 5px">名称</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <textarea rows="2" style="resize: none; width: 165px" id="matName" type="text" disabled="disabled" |
| | | readonly="readonly"></textarea> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <div class="form-item" style="margin-top: 5px"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">单号</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="mnemonic" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <button id="remove" onclick="remove()">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | <div class="form-item" style="margin-top: 5px"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="remove" onclick="remove()">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | |
| | | </body> |
| | | <script> |
| | |
| | | var form = layui.form; |
| | | |
| | | var $$ = layui.$, active = { |
| | | getCheckData: function(){ //获取选中数据 |
| | | getCheckData: function () { //获取选中数据 |
| | | var checkStatus = table.checkStatus('chooseData') |
| | | ,data = checkStatus.data; |
| | | , data = checkStatus.data; |
| | | matData = data |
| | | tableIns.reload({data: matData}); |
| | | tableIns.reload({ data: matData }); |
| | | }, |
| | | reload: function () { |
| | | findMata(); |
| | | } |
| | | }; |
| | | $$('.demoTable .layui-btn').on('click', function(){ |
| | | $$('.demoTable .layui-btn').on('click', function () { |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'matNo', align: 'center', title: '物料编码', event: 'modify'}, |
| | | {field: 'mnemonic', align: 'center', title: '生产单号', event: 'modify'}, |
| | | {field: 'count', align: 'center', title: '数量', style: 'color: blue', width: 50, event: 'modify'}, |
| | | {field: 'matName', align: 'center', title: '物料名称', event: 'modify'}, |
| | | { type: 'checkbox' }, |
| | | { field: 'matNo', align: 'center', title: '物料编码', event: 'modify' }, |
| | | { field: 'mnemonic', align: 'center', title: '生产单号', event: 'modify' }, |
| | | { field: 'count', align: 'center', title: '数量', style: 'color: blue', width: 50, event: 'modify' }, |
| | | { field: 'matName', align: 'center', title: '物料名称', event: 'modify' }, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth?areaType=" + (areaType ? areaType : ""), |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | |
| | | } |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | tableIns.reload({ data: matData }); |
| | | layer.close(countLayer); |
| | | tips("修改成功"); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | tableIns.reload({ data: matData }); |
| | | layer.close(countLayer); |
| | | tips("移除成功"); |
| | | } |
| | |
| | | matData.push(data); |
| | | } |
| | | tips("提取成功"); |
| | | tableIns.reload({data: matData}); |
| | | tableIns.reload({ data: matData }); |
| | | } |
| | | |
| | | // 组托 - 防抖锁 |
| | | var isCombLocked = false; |
| | | |
| | | // 组托 |
| | | function comb() { |
| | | // 防抖检查 |
| | | if (isCombLocked) { |
| | | tips("操作中,请稍候...", true); |
| | | return; |
| | | } |
| | | isCombLocked = true; |
| | | |
| | | let barcode = $('#uuid').val(); |
| | | console.log('barcode', barcode); |
| | | if (isEmpty(barcode)) { |
| | | tips("请选择库区", true); |
| | | document.getElementById("uuid").focus(); |
| | | isCombLocked = false; |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | | tips("请提取物料", true); |
| | | isCombLocked = false; |
| | | return; |
| | | } |
| | | |
| | |
| | | if (areaType == 1) { |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/in/source", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | // 延迟解锁防抖 |
| | | setTimeout(function () { isCombLocked = false; }, 500); |
| | | }, |
| | | error: function () { |
| | | tips("请求失败", true); |
| | | isCombLocked = false; |
| | | } |
| | | }); |
| | | } else { |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/in", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | // 延迟解锁防抖 |
| | | setTimeout(function () { isCombLocked = false; }, 500); |
| | | }, |
| | | error: function () { |
| | | tips("请求失败", true); |
| | | isCombLocked = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | } |
| | | // 赋值前清空表格 |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | tableIns.reload({ data: matData }); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/bill/query/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: { |
| | | billNo: billNo, |
| | | mnemonic: '', |
| | |
| | | var mnemonic = $('#demoReload').val(); |
| | | // 赋值前清空表格 |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | tableIns.reload({ data: matData }); |
| | | console.log(billNo) |
| | | console.log(mnemonic) |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/bill/query/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: { |
| | | billNo: billNo, |
| | | mnemonic: mnemonic, |
| | |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | layer.msg(msg, { icon: warn ? 2 : 1 }) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | |
| | | // 重置 |
| | | function reset() { |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | tableIns.reload({ data: matData }); |
| | | layer.closeAll(); |
| | | $("#billNo").val(""); |
| | | $("#uuid").val(""); |
| | |
| | | layui.form.render('select'); |
| | | } |
| | | </script> |
| | | |
| | | </html> |