懒羊羊
2023-10-17 92cffc135581ce2cf4aecac745ddb88e739c17de
guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
@@ -53,7 +53,8 @@
        url: Feng.ctxPath + '/formulaChildInfo/list',
        page: false,
        // height: "full-158",
        height: 460,
        // height: 460,
        height: 400,
        cellMinWidth: 100,
        where: queryData,
        cols: FormulaChildInfo.initColumn(),
@@ -132,12 +133,13 @@
        }
    });
    setInterval(function() {
        $('input[name="sex1"][value="nan1"]').prop('checked', true);
    }, 1000);
    setInterval(function() {
        radioElement.prop('checked', false);
    }, 2000);
    // //redio闪烁
    // setInterval(function() {
    //     $('input[name="sex1"][value="nan1"]').prop('checked', true);
    // }, 1000);
    // setInterval(function() {
    //     radioElement.prop('checked', false);
    // }, 2000);
    //Hash地址的定位
    var layid = location.hash.replace(/^#test=/, '');
@@ -147,4 +149,54 @@
        location.hash = 'test='+ $(this).attr('lay-id');
    });
    /**
     * 基础BOM管理
     */
    var ProductBomChildInfo = {
        tableId: "productBomChildInfoTable"
    };
    /**
     * 初始化表格的列
     */
    ProductBomChildInfo.initColumn = function () {
        return [[
            {field: 'id', hide: true, title: '主键id'},
            {field: 'opCode', sort: true, title: '工序编码'},
            {field: 'opName', sort: true, title: '工序名称'},
            {field: 'materialCode', sort: true, title: '物料编码'},
            {field: 'costQty', sort: true, title: '单耗'},
            {field: 'bomCode', sort: true, title: 'BOM编码'},
        ]];
    };
    var queryData = {};
    queryData['bomCode'] = "301002000021";
    // 渲染表格
    table.render({
        elem: '#' + ProductBomChildInfo.tableId,
        url: Feng.ctxPath + '/productBomChildInfo/list',
        page: true,
        height: 460,
        cellMinWidth: 100,
        where: queryData,
        cols: ProductBomChildInfo.initColumn()
    });
    $("#scanCode").keydown(function(event) {
        if (event.keyCode === 13) {
            // 执行您想要的代码
            var ajax = new $ax(Feng.ctxPath + "/kb/formulaView/addFormulaState?formulaCode="+msg.recipeCode);
            var result = ajax.start();
            table.reload("formulaChildInfoTable")
            return false; // 阻止默认行为
        }
    });
    $("#clear").click(function() {
        var ajax = new $ax(Feng.ctxPath + "/kb/formulaView/clear?formulaCode="+msg.recipeCode);
        var result = ajax.start();
        table.reload("formulaChildInfoTable")
    });
});