懒羊羊
2024-01-10 1b72fc0dd1d7004de54ab0886e0323cb1b96198d
批次上料
已修改3个文件
80 ■■■■ 文件已修改
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/om/productionOrderBatchInfo/controller/ProductionOrderBatchInfoController.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/pages/modular/kb/materialRegistration/materialRegistration.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/om/productionOrderBatchInfo/controller/ProductionOrderBatchInfoController.java
@@ -168,11 +168,31 @@
    @ResponseBody
    @RequestMapping("/updateOrderBatchInfo")
    public ResponseData updateOrderBatchInfo(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
        Long id = getCheckLocationCodeList(productionOrderBatchInfoParam).get(0).getId();
        ProductionOrderBatchInfo byId = productionOrderBatchInfoService.getById(id);
        List<ProductionOrderBatchInfo> checkLocationCodeList = getCheckLocationCodeList(productionOrderBatchInfoParam);
        ProductionOrderBatchInfo batchInfo = checkLocationCodeList.get(0);
        ProductionOrderBatchInfo byId = productionOrderBatchInfoService.getById(batchInfo.getId());
        byId.setSpareField1(productionOrderBatchInfoParam.getSpareField1());
        if(batchInfo.getState().equals("是")){
            if(!productionOrderBatchInfoParam.getLoadingCode().equals(batchInfo.getLoadingCode())){
                return  ResponseData.success("0");
            }else {
                Integer count1 = Integer.parseInt(productionOrderBatchInfoParam.getSpareField1())+Integer.parseInt(batchInfo.getSpareField1());
                byId.setSpareField1(count1.toString());
            }
        }
        byId.setState("是");
        byId.setLoadingCode(productionOrderBatchInfoParam.getLoadingCode());
        byId.setSpareField1(productionOrderBatchInfoParam.getSpareField1());
        productionOrderBatchInfoService.saveOrUpdate(byId);
        return ResponseData.success("1");
    }
    @ResponseBody
    @RequestMapping("/resetting")
    public ResponseData resetting(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
        ProductionOrderBatchInfo byId = productionOrderBatchInfoService.getById(productionOrderBatchInfoParam.getId());
        byId.setState("否");
        byId.setSpareField1("0");
        byId.setLoadingCode("");
        productionOrderBatchInfoService.saveOrUpdate(byId);
        return ResponseData.success();
    }
guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js
@@ -127,7 +127,7 @@
     */
    MaterialShortage.initColumn = function () {
        return [[
            {type: 'numbers'},
            {type: 'checkbox', fixed: 'left'},
            {field: 'id', hide: true, title: 'ID'},
            {field: 'workOrderNo', sort: true, title: '工单号', width: 150},
            // {field: 'loadingCode', sort: true, title: '上料工位', width: 105},
@@ -154,10 +154,36 @@
            url: Feng.ctxPath + '/productionOrderBatchInfo/boardList',
            // page: true,
            height: 345,
            toolbar: '#toolbarDemo',
            cellMinWidth: 80,
            where:queryData,
            cols: MaterialShortage.initColumn()
        });
    }
    // 工具栏事件
    table.on('toolbar(materialShortageTable)', function(obj){
        var id = obj.config.id;
        var checkStatus = table.checkStatus(id);
        switch(obj.event){
            case 'getCheckData':
                var data = checkStatus.data;
                console.log(data.length)
                console.log(data)
                if(data.length!==1){
                    Feng.error("请正确选择一条数据")
                    return
                }
                resetting(data[0].id)
                break;
        };
    });
    function resetting(data){
        var resetting = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/resetting?id=" + data);
        var resettingResult = resetting.start();
        initMaterialShortage()
        Feng.success("重置成功")
    }
    // 生产工单设置按钮点击事件
@@ -335,14 +361,18 @@
            Feng.error("请输入完整长度信息");
            return
        }
        var checkLocationCode = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/checkLocationCode?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val());
        var checkLocationCodeResult = checkLocationCode.start();
        if(checkLocationCodeResult.data === 0){
            Feng.error("条码信息异常")
            return
        }
        // var checkLocationCode = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/checkLocationCode?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val());
        // var checkLocationCodeResult = checkLocationCode.start();
        // if(checkLocationCodeResult.data === 0){
        //     Feng.error("条码信息异常")
        //     return
        // }
        var updateOrderBatchInfo = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/updateOrderBatchInfo?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()+ "&spareField1="+ number + "&loadingCode="+ batch);
        var updateOrderBatchInfoResult = updateOrderBatchInfo.start();
        if(updateOrderBatchInfoResult.data === "0"){
            Feng.error("批次不同无法录入");
            return;
        }
        Feng.success("录入成功")
        clean()
        initMaterialShortage()
guns-vip-main/src/main/webapp/pages/modular/kb/materialRegistration/materialRegistration.html
@@ -44,7 +44,7 @@
                            <div class="layui-inline layui-col-md8">
                                <label class="layui-form-label">扫描条码:</label>
                                <div class="layui-input-block">
                                    <input id="barCode" name="barCode" placeholder="物料编码+批次码(例子:101.021090-0120240110001)" type="text" class="layui-input" />
                                    <input id="barCode" name="barCode" placeholder="物料编码+批次码(例子:1239920000036620240110001)" type="text" class="layui-input" />
                                </div>
                            </div>
                            <div class="layui-inline">
@@ -100,7 +100,8 @@
    <div class="layui-col-sm8 layui-col-md8 layui-col-lg8">
        <div class="layui-card">
            <div class="layui-card-header" style="font-weight: bold"><i class="layui-icon layui-icon-rate-solid"></i> 上料信息</div>
            <div class="layui-card-header" style="font-weight: bold"><i class="layui-icon layui-icon-rate-solid"></i> 上料信息
            </div>
            <div class="layui-card-body" style="height: 345px">
<!--                <table class="layui-table" id="bomInfoTable" lay-filter="bomInfoTable"></table>-->
                <table class="layui-table" id="materialShortageTable" lay-filter="materialShortageTable"></table>
@@ -212,6 +213,11 @@
    <span style="color: red;">否</span>
    {{#  } }}
</script>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="getCheckData">重置</button>
    </div>
</script>
@}