懒羊羊
2023-08-30 71e81ed1d12e4d69f53c8ad9e066650ad4186293
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
/**
 * 详情对话框
 */
var KanbanConfInfoDlg = {
    data: {
        id: "",
        pageCode: "",
        ipAddress: "",
        macAddress: "",
        workshopCode: "",
        workshopName: "",
        lineCode: "",
        lineName: "",
        locationCode: "",
        locationName: "",
        warehouseCode: "",
        warehouseName: ""
    }
};
 
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;
    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
 
    var lineCodes = parent.lineCode;
 
    /**
     * bom信息管理
     */
    var MaterialShortage = {
        tableId: "materialShortageTable2"
    };
 
    $(document).ready(function() {
        console.log(lineCodes);
    });
 
 
        $('#serch').click(function(){
        var queryData = {};
        queryData['workOrderNo'] = $("#workOrderCode").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: 'workOrderNo', sort: true, title: '生产工单号',minWidth:140},
            {field: 'materialCode', sort: true, title: '产品编号',minWidth:140},
            {field: 'materialName', sort: true, title: '产品名称',minWidth:280},
            {field: 'planQty', sort: true, title: '计划数',minWidth:120},
            {field: 'createTime', sort: true, title: '创建时间',minWidth:160},
            {field: 'actualQty', sort: true, title: '完成数量',align:'center',minWidth:120},
        ]];
    };
 
    table =  $.extend(table, {config: {checkName: 'checked'}});
    var tableResult = table.render({
        elem: '#' + MaterialShortage.tableId,
        url: Feng.ctxPath + '/productionOrdeInfo/list?orderStatus=3',
        page: true,
        cellMinWidth: 80,
        cols: MaterialShortage.initColumn()
    });
    let Msg='';
    table.on('row(materialShortageTable2)',function (data) {
        Msg = data.data;
    })
    $('#btnSubmit').click(function(){
        if (Msg !='' ){
            // 判断是否点击的是确定
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            window.localStorage.setItem('message',JSON.stringify(Msg));
            parent.layer.close(index);
        }
        else {
            Feng.error("请选择一条数据!")
        }
    });
 
 
});