zgq
2020-11-18 9d1a29d000bd76e63dd450028f7727e19b39ea99
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!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, maximum-scale=1">
    <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" style="padding: 1px">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="component-form-group">
                    <div class="layui-tab" lay-filter="tab-POStockInBillList">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" class="layui-this">缓存列表</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item  layui-show">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="dj-table" lay-filter="dj-table"></table>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="yd-table" lay-filter="yd-table"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" style="margin-bottom: 20px;">
                            <div class="layui-row">
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRefresh">刷新</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <!--<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdAdd">新增</button>-->
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script src="../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../layuiadmin/Scripts/webConfig.js"></script>
    <script>
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
            , element = layui.element;
            var sBillType = '3711';
            var sMaker = sessionStorage["HMaker"];
 
            //进入页面显示的缓存列表
            table.render({
                elem: '#dj-table'
                , url: GetWEBURL1() + '/Web/DisBillEntryList_Mate_Webs_Json'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, sWhere: sMaker }
                , cols: [[
                      { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 90 }
                    , { field: 'HBillNo', title: '单据号', sort: true, width: 150 }
                    , { field: 'HMaker', title: '制单人', width: 125 }
                    , { field: 'HMakeDate', title: '制单日期', width: 120 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                    , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            });
 
            //删除按钮
            form.on('submit(cmdDelete)', function () {//删除
                var checkStatus = table.checkStatus('dj-table')
                , data = checkStatus.data;
                if(data.length == 0){
                    layer.msg("请先选择数据!", { icon: 5 });
                    return;
                } else {
                    var sInterID = data[0].HInterID;
                }
                layer.confirm('您确定要删除吗?', { icon: 3, title: '提示' }, function (index) {
                    $.ajax({
                        type: "Get",
                        url: GetWEBURL() + "/Web/Delete_Json",
                        async: true,
                        data: { "sHInterID": sInterID },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                table.reload('dj-table', {
                                    url: GetWEBURL1() + '/Web/DisBillEntryList_Mate_Webs_Json'
                                    , where: { HBillType: sBillType, sWhere: '' }
                                });
                            }
                            else {
                                layer.msg(data.Message, { icon: 2 });
                            }
                        },
                        error: function (err) {
                            layer.msg('错误' + err, {
                                icon: 5,
                                time: 20000
                            }, function () {
                                //do something
                            });
                        }
                    });
                    layer.close(index);
                });
            });
 
            //刷新按钮
            form.on('submit(cmdRefresh)', function () {
                table.reload('dj-table', {
                    url: GetWEBURL1() + '/Web/DisBillEntryList_Mate_Webs_Json'
                    , where: { HBillType: sBillType, sWhere: sMaker }
                });
            });
 
            //退出按钮
            form.on('submit(cmdCancel)', function () {
                parent.location.href = "../index.html"
                //window.close();//关闭当前页
            });
 
            //以上是layui模块
        });
    </script>
 
</body>
</html>