wtt
2025-08-05 ebef191888d9d2c2a2e7a7f677189164e4eef0b3
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html>
<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">
    <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 src="../../../layuiadmin/PubCustom.js"></script>
 
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <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-collapse">
                            <h1 style="text-align: center; padding: 30px 0;"><b>工资运算</b></h1>
                            <div class="layui-colla-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HEndDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">班组<label style="color:red"> * </label></label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="HGroupName" id="HGroupName" readonly class="layui-input" value="" style="background-color: #efefef4d; float: left; width: 150px;">
                                        <input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="0" style="float:left;width:150px;">
                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="HGroupList" style="width:40px;">
                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                        </button>
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btn_Calculate" id="btn_Calculate" style="padding:0 30px">开始工资运算</button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btn_Cancel" id="btn_Cancel" style="padding:0 20px">退出</button>
                            </div>
                            <div class="layui-colla-item" style="height:600px;margin-top:20px;">
                                <font size="5" color="blue" id="HRemark"></font>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            //#region 公共变量
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            var HModName = "Pay_SalaryCalculate_New";
            var HMaker = sessionStorage["HUserName"]
            var HStockOrgID = sessionStorage["OrganizationID"]  //组织ID
            //#endregion
 
            //判断是否登录 未登录则跳到登录页
            if (sessionStorage.login != "login") {
                layer.confirm("登录失效,请重新登录!", {
                    icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
                }, function () { window.location.href = "../../user/login.html"; });
            }
 
            //#region 初始化界面
 
            set_ClearBill();
 
            function set_ClearBill() {
                //获取开始日期、结束日期
                $("#HBeginDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                $("#HEndDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
            }
            //#endregion
 
 
            //#region 选择班组按钮
            form.on('submit(HGroupList)', function () {
                get_checkGroup();
            });
 
            function get_checkGroup() {
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim"   //加上边框
                    , title: "班组列表"         //标题
                    , closeBtn: 1               //窗体右上角关闭 的 样式
                    , shift: 2                  //弹出动画
                    , area: ["90%", "90%"]      //窗体大小
                    , maxmin: true              //设置最大最小按钮是否显示
                    , content: ['../../基础资料/工资基础资料/Gy_Group.html?Type=HGroup', 'yes']
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //按钮一  的回调
                        var iframeWindow = window["layui-layer-iframe" + index];                //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");    //获取选中的数据
 
                        if (checkStatus.data.length != 1) {
                            return layer.msg("请选择一条数据");
                        }
                        $("#HGroupName").val(checkStatus.data[0].班组名称);
                        $("#HGroupID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //关闭弹窗  它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () {
                    }
                })
            }
            //#endregion
 
 
            //#region 开始工资运算
            form.on('submit(btn_Calculate)', function (data) {
                set_Calculate(data);
            });
 
            function set_Calculate(data) {
                var HBeginDate = $("#HBeginDate").val();
                var HEndDate = $("#HEndDate").val();
                var HGroupID = $("#HGroupID").val();
                var HSourceBillType = "3791";   //工序出站汇报单
                if (HBeginDate == "" || HEndDate == "") {
                    layer.msg("请先选择开始日期和结束日期!", { icon: 2, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                var index = layer.load();
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + '/Pay_SalaryCulateController/GetSalaryCalculate_Json',
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HBeginDate": HBeginDate, "HEndDate": HEndDate, "HGroupID": HGroupID, "HSourceBillType": HSourceBillType, "HMaker": HMaker, "HStockOrgID": HStockOrgID },
                    success: function (data) {
                        if (data.count == 1) {
                            $("#HRemark").html(data.Message);
                            layer.close(index);
                        } else {
                            layer.msg(data.Message, { icon: 2, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            layer.close(index);
                        }
                    },
                    complete: function (XHR, TS) { XHR = null },//回收资源
                    error: function (err) {
                        layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        layer.close(index);
                    }
                });
            }
            //#endregion
 
 
            //#region 退出
            form.on('submit(btn_Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    Pub_Close(2);
                });
            })
            //#endregion
 
        });
 
        //以上为layui模块
        //此处方法涉及到被外部页面parent.方法名调用的必须放在Layui方法外部
 
        //双击返回基础资料数据    表头
        function GetHGroupValue(obj)  //返回班组
        {
            $("#HGroupName").val(obj[0].班组名称);
            $("#HGroupID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>