chen.lin
19 小时以前 a45b751080a50d94d3ed2d9f1d801e14a7046b6d
生成领料单-pda+后台2
3个文件已修改
110 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MaterialReceiveController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/index.html 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/materialReceiveOut.html 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MaterialReceiveController.java
@@ -304,9 +304,10 @@
    @RequestMapping(value = "/materialReceive/checkSyncStatus/auth")
    @ManagerAuth
    public R checkSyncStatus(@RequestParam String soCode, @RequestParam(required = false) String invCode) {
    public R checkSyncStatus(@RequestParam String soCode, @RequestParam(required = false) String invCode, @RequestParam(required = false) String fbillno) {
        EntityWrapper<MaterialReceive> wrapper = new EntityWrapper<>();
        wrapper.eq("so_code", soCode);
        wrapper.eq("fbillno", fbillno);
        if (!Cools.isEmpty(invCode)) {
            wrapper.eq("inv_code", invCode);
        }
src/main/webapp/views/pda/index.html
@@ -132,9 +132,14 @@
        <td>
            <div id="combLToP" onclick="nav(this.id)" class="nav-font-size">立库移库组托</div>
        </td>
<!--        <td>-->
<!--            <div id="locNormalOut" onclick="nav(this.id)" class="nav-font-size">平仓成品出库</div>-->
<!--        </td>-->
        <td>
            <div id="materialReceiveOut" onclick="nav(this.id)" class="nav-font-size">生成领料出库</div>
        </td>
    </tr>
    <tr>
        <td>
            <div id="materialWwOut" onclick="nav(this.id)" class="nav-font-size">委外加工出库</div>
        </td>
    </tr>
</table>
@@ -150,21 +155,21 @@
            headers: {'token': localStorage.getItem('token')},
            method: 'GET',
            success: function (res) {
                if (res.code === 200){
                if (res && res.code === 200){
                    console.log(res)
                    if (res.data.code === 'a') {
                    if (res.data && res.data.code === 'a') {
                        $("#combAgv").parent().hide();
                        $("#combProAgv").parent().hide();
                        $("#comb").parent().hide();
                        $("#combPro").parent().hide();
                        $("#locNormalIn").parent().hide();
                        $("#locNormalOut").parent().hide();
                    } else if (res.data.code === 'b') {
                    } else if (res.data && res.data.code === 'b') {
                        $("#locNormalIn1").parent().hide();
                        $("#locNormalOut1").parent().hide();
                        // $("#locNormalIn").parent().hide();
                        // $("#locNormalOut").parent().hide();
                    } else if (res.data.code === 'c') {
                    } else if (res.data && res.data.code === 'c') {
                        $("#combAgv").parent().hide();
                        $("#combProAgv").parent().hide();
                        $("#comb").parent().hide();
@@ -172,11 +177,17 @@
                        $("#locNormalIn1").parent().hide();
                        $("#locNormalOut1").parent().hide();
                    }
                } else if (res.code === 403){
                } else if (res && res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                } else if (res && res.msg) {
                    layer.msg(res.msg, {icon: 2});
                } else {
                    layer.msg("请求失败,请稍后重试", {icon: 2});
                }
            },
            error: function(xhr, status, error) {
                console.error("请求失败:", status, error);
                layer.msg("请求失败,请稍后重试", {icon: 2});
            }
        })
    });
src/main/webapp/views/pda/materialReceiveOut.html
@@ -79,6 +79,14 @@
               style="width: 175px"
               autocomplete="off">
    </div>
<!--    <div class="layui-input-inline">-->
<!--        <label class="layui-form-label">开工日期</label>-->
<!--        <input class="layui-input" id="fplancommitdate" placeholder="选择或输入日期"-->
<!--               style="width: 175px"-->
<!--               autocomplete="off"-->
<!--               onkeyup="findCode(this, 'fplancommitdate')"-->
<!--               onchange="findCode(this, 'fplancommitdate')">-->
<!--    </div>-->
</header>
<main>
@@ -165,11 +173,23 @@
    }
    var tableIns;
    layui.use(['table', 'form'], function () {
    layui.use(['table', 'form', 'laydate'], function () {
        var table = layui.table;
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var laydate = layui.laydate;
        // 初始化日期选择器(支持选择日期和手动输入)
        laydate.render({
            elem: '#fplancommitdate',
            type: 'date',
            format: 'yyyy-MM-dd',
            done: function(value, date, endDate) {
                // 日期选择后触发查询
                findCode(null, 'fplancommitdate');
            }
        });
        tableIns = table.render({
            id: 'materialReceiveOut',
@@ -178,16 +198,14 @@
            limit: 500,
            cellMinWidth: 50,
            cols: [[
                {field: 'invCode', align: 'center', title: '编码', event: 'detail', width: 80},
                {field: 'soCode', align: 'center', title: '生成单号', event: 'detail', width: 100},
                {field: 'fbillno', align: 'center', title: '任务单号', event: 'detail', width: 100},
                {field: 'invName', align: 'center', title: '名称', event: 'detail'},
                {field: 'invCode', align: 'center', title: '物料编码', event: 'detail', width: 80},
                {field: 'whName', align: 'center', title: '库区', event: 'detail', width: 50},
                {
                    field: 'remainQty',
                    align: 'center',
                    title: '数量',
                    event: 'detail',
                    style: 'color: blue',
                    event: 'modify',
                    style: 'cursor: pointer;color: blue',
                    width: 50,
@@ -200,6 +218,24 @@
                        return d.remainQty || 0;
                    }
                },
                // {
                //     field: 'fplancommitdate',
                //     align: 'center',
                //     title: '开工日期',
                //     event: 'detail',
                //     width: 100,
                //     templet: function(d) {
                //         if (d.fplancommitdate) {
                //             // 格式化日期显示(如果后端返回的是完整日期时间,只显示日期部分)
                //             var dateStr = d.fplancommitdate;
                //             if (dateStr.indexOf(' ') > 0) {
                //                 return dateStr.split(' ')[0];
                //             }
                //             return dateStr;
                //         }
                //         return '';
                //     }
                // },
                {type: 'checkbox', fixed: 'right', width: 30},
            ]],
            done: function (res, curr, count) {
@@ -236,12 +272,14 @@
    var soCodeBar;
    var fbillnoBar;
    var invCodeBar;
    var fplancommitdateBar;
    /* 扫码、输入生产单号、任务单号和物料编码 */
    /* 扫码、输入生产单号、任务单号、物料编码和开工日期 */
    function findCode(el, type) {
        soCodeBar = $('#soCode').val();
        fbillnoBar = $("#fbillno").val();
        invCodeBar = $("#invCode").val();
        fplancommitdateBar = $("#fplancommitdate").val();
        
        // 去除空格
        if (soCodeBar) {
@@ -253,6 +291,9 @@
        if (invCodeBar) {
            invCodeBar = invCodeBar.trim();
        }
        if (fplancommitdateBar) {
            fplancommitdateBar = fplancommitdateBar.trim();
        }
        
        switch (type) {
            case 'soCode':
@@ -261,8 +302,20 @@
                break;
            case 'invCode':
                break;
            case 'fplancommitdate':
                break;
            default:
                break;
        }
        // 如果生产单号和任务单号都为空,不执行查询
        if (!soCodeBar && !fbillnoBar) {
            // 清空表格数据
            tableIns.reload({
                data: [],
            });
            materialReceiveList = [];
            return;
        }
        // 构建查询参数
@@ -276,15 +329,8 @@
        if (invCodeBar) {
            params.invCode = invCodeBar;
        }
        // 如果所有查询条件都为空,不执行查询
        if (!soCodeBar && !fbillnoBar && !invCodeBar) {
            // 清空表格数据
            tableIns.reload({
                data: [],
            });
            materialReceiveList = [];
            return;
        if (fplancommitdateBar) {
            params.fplancommitdate = fplancommitdateBar;
        }
        // PDA出库查询,添加pdaQuery参数,后端会过滤掉已全部出库的物料
@@ -464,6 +510,7 @@
                $("#soCode").val("");
                $("#fbillno").val("");
                $("#invCode").val("");
                $("#fplancommitdate").val("");
                materialReceiveList = [];
                tableIns.reload({data: materialReceiveList});
                document.getElementById("soCode").focus();
@@ -480,6 +527,7 @@
        $("#soCode").val(null);
        $("#fbillno").val(null);
        $("#invCode").val(null);
        $("#fplancommitdate").val(null);
        materialReceiveList = [];
        tableIns.reload({data: materialReceiveList});
        layer.closeAll();