懒羊羊
2023-11-14 8286c62256f23bc2367a6729c0f46f84215e380b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
 
layui.use(['table','form', 'admin', 'ax','laydate','upload','formSelects'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;
    var table = layui.table;
 
    /**
     * bom信息管理
     */
    var MaterialShortage = {
        tableId: "materialShortageTable2"
    };
    var materialType = parent.materialType;
    console.log(materialType);
 
    var test;
 
 
    console.log(queryData);
 
    $('#serch').click(function(){
        var queryData = {};
        queryData['materialType'] = materialType;
        queryData['materialName'] = $("#materialName").val();
        queryData['materialCode'] = $("#materialCode").val();
        table.reload(MaterialShortage.tableId, {
            where: queryData, page: {curr: 1}
        });
    });
    /**
     * 缺料报警初始化表格的列
     */
    MaterialShortage.initColumn = function () {
        return [[
            {type: 'radio'},
            {field: 'id', hide: true, title: '主键id'},
            {field: 'materialCode', sort: true, title: '产品编号', width: 125},
            {field: 'materialName', sort: true, title: '产品名称', width: 270},
            {field: 'drawingNo', sort: true, title: '图号', width: 165},
            {field: 'materialSpecs', sort: true, title: '规格', width: 215},
            {field: 'unit', sort: true, title: '单位'},
            {field: 'materialScience', sort: true, title: '材料'},
            {field: 'materialType', sort: true, title: '物料类型'},
            {field: 'materialAttribute', sort: true, title: '属性'},
        ]];
    };
 
    table =  $.extend(table, {config: {checkName: 'checked'}});
    var queryData = {};
    queryData['materialType'] = materialType;
    var tableResult = table.render({
        elem: '#' + MaterialShortage.tableId,
        url: Feng.ctxPath + '/materialInfo/list',
        page: true,
        where:queryData,
        cellMinWidth: 80,
        cols: MaterialShortage.initColumn()
    });
    let Msg='';
    table.on('row(materialShortageTable2)',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();
    });
 
    function clearType(){
        parent.materialType="";
    }
 
    window.onunload = function () {
        console.log("11111111111")
    }
 
 
 
 
});