|  |  |  | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R add(@RequestBody InventoryCheckOrder inventoryCheckOrder) { | 
|---|
|  |  |  | String orderNo = inventoryCheckOrder.getOrderNo(); | 
|---|
|  |  |  | long time = new Date().getTime(); | 
|---|
|  |  |  | if (Cools.isEmpty(orderNo)) { | 
|---|
|  |  |  | return R.parse("单据编号不能为空:" + orderNo); | 
|---|
|  |  |  | switch (inventoryCheckOrder.getArea()){ | 
|---|
|  |  |  | case "堆垛机": | 
|---|
|  |  |  | orderNo = "DDJ"+time; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "四向库": | 
|---|
|  |  |  | orderNo = "SXK"+time; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "CTU": | 
|---|
|  |  |  | orderNo = "CTU"+time; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | inventoryCheckOrder.setOrderNo(orderNo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int count = inventoryCheckOrderService.selectCount(new EntityWrapper<InventoryCheckOrder>().eq("order_no", orderNo)); | 
|---|
|  |  |  | 
|---|
|  |  |  | // {type: 'numbers', title: '#'}, | 
|---|
|  |  |  | {field: 'createTime$', title: '日期'}, | 
|---|
|  |  |  | {field: 'orderNo', title: '单据编号', align: 'center'}, | 
|---|
|  |  |  | {field: 'status', title: '状态', align: 'center'} | 
|---|
|  |  |  | {field: 'status$', title: '状态', align: 'center'} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | done: function (res, curr, count) { | 
|---|
|  |  |  | $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click'); | 
|---|
|  |  |  | 
|---|
|  |  |  | $('#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> | 
|---|
|  |  |  | <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;">库区:</label> | 
|---|
|  |  |  | <div class="layui-input-block" style="margin-left: 110px;"> | 
|---|
|  |  |  | 
|---|
|  |  |  | var billNumber = $('#billNumber').val(); | 
|---|
|  |  |  | var warehouseArea = $('#warehouseArea').val(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 表单验证 | 
|---|
|  |  |  | if (!billNumber) { | 
|---|
|  |  |  | layer.msg('请输入单据编号'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 发送 Ajax 请求到后端 | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 表格2工具条点击事件 */ | 
|---|
|  |  |  | 
|---|
|  |  |  | <button class="layui-btn icon-btn" lay-filter="originTbReset" lay-submit> | 
|---|
|  |  |  | <i class="layui-icon"></i>重置 | 
|---|
|  |  |  | </button> | 
|---|
|  |  |  | <button id="showFormBtn" class="layui-btn icon-btn btn-add"><i class="layui-icon"></i>添加</button> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </form> | 
|---|
|  |  |  | 
|---|
|  |  |  | <!--    </div>--> | 
|---|
|  |  |  | <!--    <button class="layui-btn layui-btn-sm layui-btn-danger btn-pakoutPreview" id="btn-pakoutPreview" lay-event="submitERP"><i class="layui-icon"></i>提交ERP</button>--> | 
|---|
|  |  |  | <button id="submitERP" class="layui-btn icon-btn btn-add" lay-event="submitERP"><i class="layui-icon"></i>提交ERP</button> | 
|---|
|  |  |  | <button id="showFormBtn" class="layui-btn icon-btn"  lay-submit> | 
|---|
|  |  |  | <i class="layui-icon"></i>添加单据 | 
|---|
|  |  |  | </button> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 行工具栏 --> | 
|---|