工资结算单(其它):数据检验增加重复校验和数量非空校验,增加列设置,子表可编辑与不可编辑做颜色区分,子表单元格内容根据列宽进行隐藏,取消分页,增加合计行
2个文件已修改
196 ■■■■ 已修改文件
WebTM/Properties/PublishProfiles/JFTM.pubxml.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/工资管理/工资结算单(其他)/Pay_OtherBalBillEdit.html 194 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -2739,7 +2739,7 @@
      <publishTime>10/19/2021 09:27:19</publishTime>
    </File>
    <File Include="views/工资管理/工资结算单%28其他%29/Pay_OtherBalBillEdit.html">
      <publishTime>04/11/2023 16:34:43</publishTime>
      <publishTime>08/10/2023 14:20:41</publishTime>
    </File>
    <File Include="views/工资管理/工资结算单%28其他%29/Pay_OtherBalBillList.html">
      <publishTime>07/20/2023 10:38:15</publishTime>
WebTM/views/¹¤×ʹÜÀí/¹¤×ʽáËãµ¥(ÆäËû)/Pay_OtherBalBillEdit.html
@@ -15,7 +15,7 @@
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
    <!--<style type="text/css">
        .layui-form-item .layui-inline {
            margin-right: 0;
        }
@@ -34,7 +34,7 @@
            margin-left: -15px;
            margin-right: -15px;
        }
    </style>
    </style>-->
</head>
<body>
@@ -60,7 +60,7 @@
                                <div class="layui-form-item" style="padding-top: 10px;">
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">单据号</label>
                                            <label class="layui-form-label">单据号<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" value="0">
@@ -68,7 +68,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">日期</label>
                                            <label class="layui-form-label">日期<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                            </div>
@@ -82,7 +82,7 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">班组</label>
                                            <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="float:left;width:150px;">
                                                <input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="" style="float:left;width:150px;">
@@ -92,7 +92,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">部门</label>
                                            <label class="layui-form-label">部门<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HDeptName" id="HDeptName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="" style="float:left;width:150px;">
@@ -102,7 +102,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">职员</label>
                                            <label class="layui-form-label">职员<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HEmpName" id="HEmpName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="" style="float:left;width:150px;">
@@ -136,7 +136,7 @@
            </div>-->
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">工资类型</label>
                                            <label class="layui-form-label">工资类型<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HPayTypeName" id="HPayTypeName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HPayType" id="HPayType" class="layui-input" value="" style="float:left;width:150px;">
@@ -224,10 +224,9 @@
                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                            </div>
                        </script>
                        <script type="text/html" id="xuhao">
@@ -257,6 +256,10 @@
                , laydate = layui.laydate
                , element = layui.element;
            //模块名
            var HModName = "Pay_OtherBalBill";
            var params = get_UrlVars();
            if (typeof (params[params[0]]) == "undefined") {
                var OperationType = 1;//操作类型
@@ -278,25 +281,25 @@
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 500
                , totalRow: true
                //,url: '/demo/table/user/' //数据接口
                , page: true //开启分页
                , cols: [[ //表头
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: 'HEmpID', title: 'HEmpID', edit: 'text', width: 100, hide: true }
                    , { templet: '#xuhao', title: '序号', fixed: 'left', event: "qwe", width: 100, style: 'background-color: #f9f9f9;' }
                    , { field: 'HEmpID', title: 'HEmpID', edit: 'text', width: 100, hide: true, style: 'background-color: #f9f9f9;' }
                    , { field: 'HEmpNumber', title: '职员代码', edit: 'text', event: 'HEmpCheck', width: 200 }
                    , { field: 'HEmpName', title: '职员名称', width: 100 }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HEmpName', title: '职员名称', width: 100, style: 'background-color: #f9f9f9;' }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true, style: 'background-color: #f9f9f9;' }
                    , { field: 'HMaterCode', title: '物料代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 300 }
                    , { field: 'HMaterSpec', title: '规格型号', width: 200 }
                    , { field: 'HProcID', title: 'HProcID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterName', title: '物料名称', width: 300, style: 'background-color: #f9f9f9;' }
                    , { field: 'HMaterSpec', title: '规格型号', width: 200, style: 'background-color: #f9f9f9;' }
                    , { field: 'HProcID', title: 'HProcID', edit: 'text', width: 100, hide: true, style: 'background-color: #f9f9f9;' }
                    , { field: 'HProcNumber', title: '工序代码', edit: 'text', event: "HProcNumber", width: 100 }
                    , { field: 'HProcName', title: '工序名称', width: 100 }
                    , { field: 'HProcName', title: '工序名称', width: 100, style: 'background-color: #f9f9f9;' }
                    , { field: 'HTimes', title: '工时', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '数量', edit: 'text', width: 100 }
                    , { field: 'HPrice', title: '工价', edit: 'text', width: 100 }
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100 }
                    , { field: 'HPrice', title: '工价', width: 100, style: 'background-color: #f9f9f9;' }
                    , { field: 'HMoney', title: '金额', width: 100, totalRow: true, style: 'background-color: #f9f9f9;' }
                    , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                    , { field: 'HMainSourceInterID ', title: '源单主内码', edit: 'text', width: 100, hide: true }
                    , { field: 'HMainSourceEntryID', title: '源单子内码', edit: 'text', width: 100, hide: true }
@@ -349,7 +352,8 @@
                });
            }
            //列设置
            DisPlay_HideColumn();
            //头工具栏事件
            var rowid = 0;
@@ -388,6 +392,10 @@
                            table.render(option);//将数据渲染到表格上
                            //layer.alert(copyrow);
                        }
                        break;
                    //列设置
                    case 'set_HideColumn':
                        get_HideColumn();
                        break;
                }
            });
@@ -490,6 +498,7 @@
                                                } else {
                                                    obj.update({
                                                        HPrice: result.data[0].单价
                                                        ,HMoney: obj.data.HQty * result.data[0].单价
                                                    });
                                                }
                                            }
@@ -547,6 +556,7 @@
                                                } else {
                                                    obj.update({
                                                        HPrice: result.data[0].单价
                                                        , HMoney: obj.data.HQty * result.data[0].单价
                                                    });
                                                }
                                            }
@@ -916,6 +926,124 @@
                }
            });
            //#region éšè—åˆ—设置
            function get_HideColumn() {
                var colName = "";
                var contentUrl = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
                var urlStr = window.document.location.pathname;//获取文件路径
                var urlLen = urlStr.split('/');
                for (var i = 0; i < urlLen.length - 4; i++) {
                    contentUrl += "../";
                }
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
                contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: [contentUrl, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //#endregion
            //#region æ˜¾ç¤ºåˆ—数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    async: false,
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["HMaterID", "HProcID", "HEmpID", "源单主内码", "源单子内码", "源单单号", "源单类型", "关闭时间"];//不需要显示的字段 å¯æ‰©å±•
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                var dataCols = dataCol[i].split('|');
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] += "font-size:" + data1.data[0].HFontSize + "px;";
                                } else {
                                    option.cols[0][i + 1]["style"] += "font-size:100%";
                                }
                                //设置列宽
                                //if (data1.data[0].HColumnWidth != 0) {
                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
                                //} else {
                                //    option.cols[0][i + 1]["width"] = "";
                                //}
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //字体所在位置(å·¦ å±…中 å³)
                                switch (dataCols[2]) {
                                    case "L":
                                        option.cols[0][i + 1]["align"] = "left";
                                        break;
                                    case "M":
                                        option.cols[0][i + 1]["align"] = "center";
                                        break;
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                            }
                            //取消冻结列
                            for (var i = 1; i < option.cols[0].length - 1; i++) {
                                if (option.cols[0][i]["fixed"] != null) {
                                    option.cols[0][i]["fixed"] = null;
                                }
                                else {
                                    break;
                                }
                            }
                            //冻结列
                            if (data1.data[0].HFixCols != 0) {
                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                        data1.data[0].HFixCols += 1;
                                    }
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            table.render(option);
                        } else {
                            table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
        //#endregion
        });
@@ -953,7 +1081,7 @@
                sSubStr = JSON.parse(sSubStr);
                for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                    if (sSubStr[i].HMaterID == "") {
                        layer.msg("明细记录第" + (i + 1) + "行,器具信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        layer.msg("明细记录第" + (i + 1) + "行,物料信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return Result = false;
                    }
                    if (sSubStr[i].HProcID == "") {
@@ -964,13 +1092,33 @@
                        layer.msg("明细记录第" + (i + 1) + "行,职员信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return Result = false;
                    }
                    if (sSubStr[i].HQty + "" == "0") {
                        layer.msg("明细记录第" + (i + 1) + "行,数量为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return Result = false;
                    }
                }
                //#region å­è¡¨å…³é”®å­—段重复检验
                var num = [];
                var temp;
                for (var i = 0; i < sSubStr.length; i++) {
                    temp = sSubStr[i].HMaterID + "|" + sSubStr[i].HProcID + "|" + sSubStr[i].HEmpID;
                    if ($.inArray(temp, num) != -1) {
                        layer.msg("明细记录第" + (i + 1) + "行,物料、工序、职员重复!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    num.push(temp);
                }
                //#endregion
            }
            else {
                return Result;
            }
            return Result;
        }
    </script>
</body>
</html>