1
cwjbxqmz
2024-01-15 a9ae83b7277095faaee79b0cb3fcb975bd494357
WebTM/views/³µ¼ä¹ÜÀí/±¨±í·ÖÎö/sc_ICOMRKReport.html
@@ -151,6 +151,8 @@
            var HBeginDate_u = "";
            var HEndDate_u = "";
            var titleData = ["HCusID"];//不需要显示的字段 å¯æ‰©å±•
            //#endregion
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
@@ -258,12 +260,24 @@
            //加载网格
            function get_Display(sWhere) {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , cellMinWidth: 120
                    , limit: Number.MAX_VALUE // æ•°æ®è¡¨æ ¼é»˜è®¤å…¨éƒ¨æ˜¾ç¤º
                    , height: 'full-70'
                    , totalRow: true //开启合计
                    , cols: [[]]
                    , data: []
                };
                //动态列-缓存列表
                $.ajax({
                    url: GetWEBURL() + "/MaterOutEntryReport/sc_ICOMRKReport",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere },
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
@@ -276,12 +290,12 @@
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计'  });
                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
                            for (var i = 0; i < data.length; i++) {
                                if ($.inArray(data[i].name, "") > -1) {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else if (data[i].name == '实际数量(ç±³)' || data[i].name == '扣点数(克)' || data[i].name == '重量(千克)' ) {
                                else if (data[i].name == '实际数量(ç±³)' || data[i].name == '扣点数(克)' || data[i].name == '重量(千克)') {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true });
                                }
                                else {
@@ -295,17 +309,13 @@
                                    }
                                }
                            }
                            option = {
                                elem: '#mainTable'
                                , toolbar: '#toolbarDemo'
                                , cellMinWidth: 120
                                , limit: Number.MAX_VALUE // æ•°æ®è¡¨æ ¼é»˜è®¤å…¨éƒ¨æ˜¾ç¤º
                                , height: 'full-70'
                                , totalRow: true //开启合计
                                , cols: [col]
                                , data: data1.data
                            };
                            option.data = data1.data;
                            option.cols = [col];
                            table.render(option);
                        } else {
                            layer.alert(data1.count + data1.Message, { icon: 5 })
                        }
                    },
                    error: function (err) {
@@ -385,6 +395,9 @@
                }
                sWhere += com;
                //根据用户过滤用户关联客户的记录
                sWhere += getSWhereByHUser();
                get_Display(sWhere);
                //调用接口后清空sWhere缓存
                sWhere = "";
@@ -457,7 +470,7 @@
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = [];//不需要显示的字段 å¯æ‰©å±•
                            /*var titleData = [];//不需要显示的字段 å¯æ‰©å±•*/
                            dataCol = data1.data[0].HGridString.split(',');
@@ -537,6 +550,30 @@
                return vars;
            }
            //#region æ ¹æ®ç”¨æˆ·èŽ·å–ç”¨æˆ·å…³è”å®¢æˆ·çš„è¿‡æ»¤æ¡ä»¶
            function getSWhereByHUser() {
                var res = "";
                $.ajax({
                    type: "GET",
                    async: false,
                    url: GetWEBURL() + "/Xs_SeOrderBill/getCusIDListByUser", //方法所在页面和方法名
                    data: { "CurUserID": sessionStorage["Czybm"], "CurUserName": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            res = result.data;
                        } else {
                            res = result.data;
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function (err) {
                        res = " and 1 = 0";
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                return res;
            }
            //#endregion
            //#endregion
        });
    </script>