| | |
| | | return false; |
| | | }); |
| | | |
| | | // 显示弹框 |
| | | $('#showFormBtn').on('click', function () { |
| | | // 弹框内容 |
| | | var content = ` |
| | | <form class="layui-form" id="billForm" style="padding: 20px;"> |
| | | <div class="layui-form-item" style="margin-bottom: 20px;"> |
| | | <label class="layui-form-label" style="width: 80px; font-size: 14px; text-align: left">单据编号:</label> |
| | | <div class="layui-input-block" style="margin-left: 110px;"> |
| | | <input type="text" id="billNumber" class="layui-input" placeholder="请输入单据编号" style="height: 38px; font-size: 14px; padding: 0 15px; width: 100%;" required> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="margin-bottom: 20px;"> |
| | | <label class="layui-form-label" style="width: 80px; font-size: 14px;">库区:</label> |
| | | <div class="layui-input-block" style="margin-left: 110px;"> |
| | | <select id="warehouseArea" class="layui-input" style="width: 100%;"> |
| | | <option value="堆垛机" selected>堆垛机</option> |
| | | <option value="四向库">四向库</option> |
| | | <option value="CTU">CTU</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="text-align: right;"> |
| | | <button type="button" class="layui-btn" id="saveBtn" style="display: inline-block; padding: 0px 20px; font-size: 16px; background-color: #5FB878; border-color: #5FB878; text-align: center;">保存</button> |
| | | </div> |
| | | </form> |
| | | `; |
| | | |
| | | // 弹框 |
| | | layer.open({ |
| | | type: 1, // 使用 HTML 内容 |
| | | title: '添加盘点单', |
| | | content: content, |
| | | area: ['400px', '280px'], // 弹框大小 |
| | | shadeClose: true, // 点击遮罩关闭 |
| | | offset: '100px', |
| | | success: function (layero, index) { |
| | | form.render(); |
| | | // 点击保存按钮事件 |
| | | $('#saveBtn').on('click', function () { |
| | | var billNumber = $('#billNumber').val(); |
| | | var warehouseArea = $('#warehouseArea').val(); |
| | | |
| | | // 表单验证 |
| | | if (!billNumber) { |
| | | layer.msg('请输入单据编号'); |
| | | return; |
| | | } |
| | | |
| | | console.log(111) |
| | | console.log(billNumber) |
| | | // 发送 Ajax 请求到后端 |
| | | $.ajax({ |
| | | url: baseUrl+"/inventoryCheckOrder/add/auth", // 替换为你的后端接口地址 |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | data: JSON.stringify({ orderNo: billNumber,area: warehouseArea }), |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.msg('请求失败'); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | /* 表格2头工具栏点击事件 */ |
| | | table.on('toolbar(orderDetlTable)', function (obj) { |
| | | |