杨乐
2022-02-15 4b58dd1c9b83a9569548a37a1147ecc1456ac917
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>生产任务单列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 15px;">
                <form class="layui-form" action="" lay-filter="component-form-group">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">过滤列</label>
                            <div class="layui-input-inline">
                                <input type="text" name="Value" id="Value" lay-verify="Value" autocomplete="off" placeholder="请输入过滤列" class="layui-input">
                            </div>
                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HQuery">快速查询</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <table class="layui-hide" id="mainTable"></table>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js" type="text/javascript"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script>
        //引用的单据及模块:首件检验单。
        layui.use(['table', 'form', 'layer'], function () {
            var table = layui.table
            , form = layui.form
            , layer = layui.layer;
 
            form.on('submit(HQuery)', function () {//选择单位
                //var sMainStr = JSON.stringify(table.cache['mainTable']);
                RoadQuery($('#Value').val());
            });
            //RoadQuery($('#Value').val());
            var ICMOBill = $('#Value').val();
            table.render({
                elem: '#mainTable'
                // , url: '/demo/table/user/'
                , url: GetWEBURL() + "/Web/GetSc_ICMOBillListView2"
                , where: { "ICMOBill": "", "OrganizationID": sessionStorage["OrganizationID"] } //扩展参数,可以传数据到后台
              , cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
              , cols: [[
                  { type: 'radio' }
                  , { field: 'hmainid', width: 150, title: 'hmainid', hide: true }
                  , { field: '日期', width: 150, title: '日期' }
                  , { field: '单据号', width: 150, title: '单据号' }
                  , { field: 'HDeptID', width: 150, title: 'HDeptID', hide: true }
                  , { field: '生产车间代码', width: 150, title: '生产车间代码' }
                  , { field: '生产车间', width: 150, title: '生产车间' }
                  , { field: 'HMaterID', width: 150, title: 'HMaterID', hide: true }
                  , { field: '产品代码', width: 150, title: '产品代码' }
                  , { field: '产品名称', width: 150, title: '产品名称' }
                  , { field: '规格型号', width: 150, title: '规格型号' }
                  , { field: 'hunitid', width: 150, title: 'hunitid', hide: true }
                  , { field: '计量单位代码', width: 150, title: '计量单位代码' }
                  , { field: '计量单位', width: 150, title: '计量单位' }
                  , { field: 'hempid', width: 150, title: 'hempid', hide: true }
                  , { field: '业务员代码', width: 150, title: '业务员代码' }
                  , { field: '业务员', width: 150, title: '业务员' }
                  , { field: 'hcusid', width: 150, title: 'hcusid', hide: true }
                  , { field: '客户代码', width: 150, title: '客户代码' }
                  , { field: '客户', width: 150, title: '客户' }
                  , { field: 'HCenterID', width: 150, title: 'HCenterID', hide: true }
                  , { field: '工作中心代码', width: 150, title: '工作中心代码' }
                  , { field: '工作中心', width: 150, title: '工作中心' }
                  , { field: 'hbomid', width: 150, title: 'hbomid', hide: true }
                  , { field: 'BOM单代码', width: 150, title: 'BOM单代码' }
                  , { field: 'BOM单', width: 150, title: 'BOM单' }
                  , { field: 'HRoutingInterID', width: 150, title: 'HRoutingInterID', hide: true }
                  , { field: '工艺路线代码', width: 150, title: '工艺路线代码' }
                  , { field: '工艺路线', width: 150, title: '工艺路线' }
                  , { field: '计划开工日期', width: 150, title: '计划开工日期' }
                  , { field: '计划完工日期', width: 150, title: '计划完工日期' }
                  , { field: '最迟开工日期', width: 150, title: '最迟开工日期' }
                  , { field: '最迟完工日期', width: 150, title: '最迟完工日期' }
                  , { field: '齐套数量', width: 150, title: '齐套数量' }
                  , { field: '计划生产数量', width: 150, title: '计划生产数量' }
                  , { field: '关联数量', width: 150, title: '关联数量' }
                  , { field: '未关联数量', width: 150, title: '未关联数量' }
                  , { field: '表头备注', width: 150, title: '表头备注' }
                  , { field: 'hsubid', width: 150, title: 'hsubid', hide: true }
                  , { field: '源单单号', width: 150, title: '源单单号' }
                  , { field: '源单主内码', width: 150, title: '源单主内码' }
                  , { field: '源单子内码', width: 150, title: '源单子内码' }
                  , { field: '制单人', width: 150, title: '制单人' }
                  , { field: '制单日期', width: 150, title: '制单日期' }
                  , { field: '审核人', width: 150, title: '审核人' }
                  , { field: '审核日期', width: 150, title: '审核日期' }
                  , { field: '修改人', width: 150, title: '修改人' }
                  , { field: '修改日期', width: 150, title: '修改日期' }
                  , { field: '关闭人', width: 150, title: '关闭人' }
                  , { field: '关闭日期', width: 150, title: '关闭日期' }
                  , { field: '作废人', width: 150, title: '作废人' }
                  , { field: '作废日期', width: 150, title: '作废日期' }
                  , { field: '单据类型', width: 150, title: '单据类型' }
              ]]
                , page: true,
                limit: 10,     //一页能够显示的最大数目
                limits: [10, 20, 40, 60, 80, 100], //控制多少行一页(默认五条一页)
                method: 'get',  //提交方式
                layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                response: {
                    statusCode: 1 //重新规定成功的状态码为 1,table 组件默认为 0
                },
                done: function (res) {   //返回数据执行回调函数
                    layer.close(layer.index);    //返回数据关闭loading                
                }
            });
 
            ///加载显示数据
            function RoadQuery(Where) {
                var index = layer.load();
                var Value = Where;
                if (Value == null) {
                    Value = '';
                }
                table.reload("mainTable", { //此处是上文提到的 初始化标识id
                    where: { "page": 1, "limit": 10, "ICMOBill": Value, "OrganizationID": sessionStorage["OrganizationID"] } //扩展参数,可以传数据到后台
                });
 
            };
        });
      
    </script>
 
</body>
</html>