懒羊羊
2023-11-14 4ad58b3dbd72e7ca266318f24a203210da5b24d7
优化
已添加2个文件
已修改3个文件
160 ■■■■■ 文件已修改
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/zsx/pm/workOrder/controller/WorkOrderController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/pm/workOrder/bulletBox/bomListing.js 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/pm/workOrder/bulletBox/productListing.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/pm/workOrder/workOrder_add.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/pages/modular/pm/workOrder/bulletBox/bomListing.html 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/zsx/pm/workOrder/controller/WorkOrderController.java
@@ -74,6 +74,17 @@
    }
    /**
     * BOM列表页面
     *
     * @author ruimin
     * @Date 2023-08-26
     */
    @RequestMapping("/bomListing")
    public String bomListing() {
        return PREFIX + "/bulletBox/bomListing.html";
    }
    /**
     * æ–°å¢žæŽ¥å£
     *
     * @author ruimin
guns-vip-main/src/main/webapp/assets/modular/pm/workOrder/bulletBox/bomListing.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
layui.use(['table'], function () {
    var $ = layui.jquery;
    var table = layui.table;
    /**
     * ç‰©æ–™ä¿¡æ¯ç®¡ç†
     */
    var MaterialInfo = {
        tableId: "materialInfoTable"
    };
    var productCode = parent.productCode;
    $('#serch').click(function(){
        var queryData = {};
        queryData['productCode'] = productCode;
        queryData['bomCode'] = $("#bomCode").val();
        queryData['bomName'] = $("#bomName").val();
        table.reload(MaterialInfo.tableId, {
            where: queryData, page: {curr: 1}
        });
    });
    /**
     * ç¼ºæ–™æŠ¥è­¦åˆå§‹åŒ–表格的列
     */
    MaterialInfo.initColumn = function () {
        return [[
            {type: 'radio'},
            {field: 'id', hide: true, title: '主键id'},
            {field: 'bomCode', sort: true, title: 'BOM编码'},
            {field: 'bomName', sort: true, title: 'BOM名称'},
            {field: 'productCode', sort: true, title: '产品编码'},
            {field: 'productName', sort: true, title: '产品名称'},
        ]];
    };
    table =  $.extend(table, {config: {checkName: 'checked'}});
    var queryData = {};
    queryData['productCode'] = productCode;
    var tableResult = table.render({
        elem: '#' + MaterialInfo.tableId,
        url: Feng.ctxPath + '/productBomInfo/list',
        page: true,
        where:queryData,
        cellMinWidth: 80,
        cols: MaterialInfo.initColumn()
    });
    let Msg='';
    table.on('row(materialInfoTable)',function (data) {
        Msg = data.data;
    })
    $('#btnSubmit').click(function(){
        clearType();
        if (Msg !=='' ){
            // åˆ¤æ–­æ˜¯å¦ç‚¹å‡»çš„是确定
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            window.localStorage.setItem('message',JSON.stringify(Msg));
            parent.layer.close(index);
        }
        else {
            Feng.error("请选择一条数据!")
        }
    });
    $('#reset').click(function(){
        clearType();
        Msg = "";
        window.localStorage.clear();
    });
    function clearType(){
        parent.materialType="";
    }
});
guns-vip-main/src/main/webapp/assets/modular/pm/workOrder/bulletBox/productListing.js
@@ -31,7 +31,23 @@
            {field: 'id', hide: true, title: '主键id'},
            {field: 'materialCode', sort: true, title: '产品编号'},
            {field: 'materialName', sort: true, title: '产品名称'},
            {field: 'typeL', sort: true, title: '类型'},
            {
                field: 'typeL', align: "center", title: '类型', templet: function (d) {
                    console.log(d.typeL)
                    switch(d.typeL){
                        case "PRODUCE" :
                            return "产品";
                            break;
                        case "SEMIFINISHEDPRODUCTS" :
                            return "半成品";
                            break;
                        case "COMPONENTSANDPARTS" :
                            return "零部件";
                            break;
                        default :
                    }
                }
            },
        ]];
    };
guns-vip-main/src/main/webapp/assets/modular/pm/workOrder/workOrder_add.js
@@ -104,7 +104,7 @@
        layer.open({
            type: 2,
            area: ['1000px', '600px'],
            title: '物料信息',
            title: '产品信息',
            content: Feng.ctxPath + '/workOrder/productListing',
            success: function (layero, index) {
                window.materialType = 'PRODUCE';
@@ -117,6 +117,23 @@
        });
    });
    $('#bomCode').click(function () {
        layer.open({
            type: 2,
            area: ['1000px', '600px'],
            title: 'BOM信息',
            content: Feng.ctxPath + '/workOrder/bomListing',
            success: function (layero, index) {
                window.productCode = $('#productCode').val();
            },
            end: function () {
                let msg = JSON.parse(window.localStorage.getItem('message'));
                console.log(msg);
                $('#bomCode').val(msg.bomCode);
            }
        });
    });
    //表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/workOrder/addItem", function (data) {
guns-vip-main/src/main/webapp/pages/modular/pm/workOrder/bulletBox/bomListing.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
@layout("/common/_form.html",{js:["/assets/modular/pm/workOrder/bulletBox/bomListing.js"]}){
    <div class="layui-fluid" style="padding-bottom: 75px;">
        <div class="layui-card">
            <div class="layui-card-body">
                <div class="layui-form-item layui-row">
                    <input id= "id" name="id" type="hidden"/>
                    <input id= "materialType" name="materialType" type="hidden"/>
                    <div class="layui-inline layui-col-md4">
                        <label class="layui-form-label">BOM编号<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="bomCode" name="bomCode" placeholder="请输入产品编号" type="text" class="layui-input"/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md4">
                        <label class="layui-form-label">BOM名称<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="bomName" name="bomName" placeholder="请输入物料名称" type="text" class="layui-input"/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md-offset3">
                        <button class="layui-btn" id="serch">搜索</button>
                    </div>
                </div>
                <table class="layui-table" id="materialInfoTable" lay-filter="materialInfoTable"></table>
            </div>
        </div>
    </div>
<div class="form-group-bottom text-center">
    <button class="layui-btn" id="btnSubmit">&emsp;提交&emsp;</button>
    <button type="reset" id="reset" class="layui-btn layui-btn-primary" ew-event="closeDialog">&emsp;关闭&emsp;</button>
</div>
@}