From fb8a9fbc15b917ff3d36eb30e28633a413ff0a42 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 04 八月 2025 10:17:38 +0800
Subject: [PATCH] 页面过滤条件:开始时间和结束时间(根据检验信息中的创建时间进行过滤)、站台(检验信息中的检验工序)、料号(PNL布局信息名称)、批次(lot号) 2.柱状图:x轴lot号,y轴良品率。根据开始时间和结束时间、站台、料号 过滤检验信息并去重(一个PNL里的PCS不能有重复记录),然后根据料号、批次分组合计得到该料号每个批次的不良PCS的数量合计。然后获取该料号每个批次中PNL条码的数量(PNL条码不能重复)并乘PNL布局信息中子表的记录数(该料号中的PCS数量)得到每个批次的PCS总数。对每个批次进行((PCS总数-不良PCS数量)/PCS总数 *100)得到每个批次的良品率。 3.饼状图:根据开始时间和结束时间、站台、料号 过滤检验信息并去重(一个PNL里的PCS不能有重复记录),然后根据检验信息中的不良原因分组统计各个原因的数量。在饼状图显示 4.表格:根据开始时间和结束时间、站台、料号 过滤检验信息,表头包含(站台、料号、PNL条码、PCS号、正反面、不良原因),并针对表头字段进行去重

---
 WebTM/views/基础资料/基础资料/Gy_MatePrice.html       |  333 +++++++++++++++++++++++--
 WebTM/views/基础资料/公用基础资料/Gy_BarCodeReport.html |  377 +++++++++++++++++-----------
 WebTM/views/基础资料/基础资料/Gy_MatePriceEdit.html   |   13 
 3 files changed, 540 insertions(+), 183 deletions(-)

diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BarCodeReport.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BarCodeReport.html"
index 1da7e06..d91c6af 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BarCodeReport.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BarCodeReport.html"
@@ -219,7 +219,11 @@
                 , util = layui.util
             //鏌ヨ鏉′欢
             var sWhere = "";
+            var sWhere_1 = "";
+            var sWhere_2 = "";
             var option = [];
+            var option_BadReason = [];
+            var option_LotNoList = [];
             var HModName = "Sc_BarCodeReport";
             var ins;                        //鐢ㄤ簬瀵煎嚭excel
             //#endregion
@@ -252,11 +256,8 @@
             });
 
             //鏌ヨ鎸夐挳
-            form.on('submit(btnSearch)', function (data) {
-                
+            form.on('submit(btnSearch)', function (data) {  
                         get_FastQuery();
-                    
-                
             });
 
             //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
@@ -279,8 +280,9 @@
                 initSelects();
                 set_InitGrid();
                 //鍔犺浇鏁版嵁鍒扮綉鏍�
+                
                 get_FastQuery();
-                set_Graphics();
+               // set_Graphics();
 
             }
             //鍒濆鍖栬〃鏍�
@@ -376,17 +378,11 @@
                     }
                 })
             }
-           //#endregion
-            //鍔犺浇缃戞牸
-            function get_Display(sWhere) {
-                if ($("#Station").val() != null && $("#Station").val() != 0) {
-                    sWhere = sWhere;
-                }
-                else
-                sWhere = "";
-                var wait = layer.load();//閬僵
+            //#endregion
+            function get_BadReasonCount(sWhere) {
+
                 $.ajax({
-                    url: GetWEBURL() + '/Gy_BarCodeReportController/list',
+                    url: GetWEBURL() + '/Gy_BarCodeReportController/GetBadReason_proc',
                     type: "GET",
                     async: false,
                     data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
@@ -394,6 +390,72 @@
                         var col = [];
                         if (data1.count == 1) {
                             var data = [];
+                            //缁欑┖鐨勬暟缁勮祴鍊�
+                            for (var key in data1.data[1].list) {
+                                data.push({ "name": data1.data[1].list[key].ColmCols, "Type": data1.data[1].list[key].ColmType });
+                            }
+  /*                          option_BadReason.cols = [col];*/
+                            option_BadReason.data = data1.data[1];
+
+                            /*ins = table.render(option_BadReason);*/
+                            
+                        } else {
+                            
+                            layer.alert(data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            
+            }
+
+            function get_LotNoCount(sWhere) {
+
+                $.ajax({
+                    url: GetWEBURL() + '/Gy_BarCodeReportController/GetBadReasonTotal_proc',
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (data1) {
+                        var col = [];
+                        if (data1.count == 1) {
+                            var data = [];
+                            //缁欑┖鐨勬暟缁勮祴鍊�
+                            for (var key in data1.list) {
+                                data.push({ "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+                            }
+                            /*                          option_BadReason.cols = [col];*/
+                            option_LotNoList.data = data1.data;
+
+                            /*ins = table.render(option_BadReason);*/
+
+                        } else {
+
+                            layer.alert(data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+
+            }
+            //鍔犺浇缃戞牸
+            function get_Display(sWhere) {
+
+                var wait = layer.load();//閬僵
+                $.ajax({
+                    url: GetWEBURL() + '/Gy_BarCodeReportController/GetBadReason_proc',
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (data1) {
+                        var col = [];
+                        if (data1.count == 1) {
+                            var data = [];
+                            data_1 = data1.data[0];
                             //缁欑┖鐨勬暟缁勮祴鍊�
                             for (var key in data1.list) {
                                 data.push({ "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
@@ -417,7 +479,7 @@
                             }
 
                             option.cols = [col];
-                            option.data = data1.data;
+                            option.data = data_1;
 
                             ins = table.render(option);
                             layer.close(wait);
@@ -433,23 +495,12 @@
             }
             //#region 閲嶇疆杩囨护鏉′欢鏂规硶
             function set_ClearQuery() {
-                $("#Station").val("");
-                $("#MaterialNo").val("");
+                $("#Station").val("0");
+                $("#MaterialNo").val("0");
+                $("#LotNo").val("");
                 $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                 $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
-                
-                $("#ColContent").val("");
-                $("#ColName").val("0");
-                $("#Comparator").val("0");
-                $("#ColContent1").val("");
-                $("#ColName1").val("0");
-                $("#Comparator1").val("0");
-                $("#ColContent2").val("");
-                $("#ColName2").val("0");
-                $("#Comparator2").val("0");
                 form.render('select');
-                
-                sWhere = "";
                 get_FastQuery();
             }
             //#endregion
@@ -459,96 +510,29 @@
                 var HEndDate = $("#HEndDate").val();//鎴鏃ユ湡
                 var Station = $("#Station").val();//绔欏彴鍙�
                 var MaterialNo = $("#MaterialNo").val();//鏂欏彿
-                //var LotNo = $("#LotNo").val();//鎵规鍙�
-                var ColName = $("#ColName").val();//澶嶉�夋
-                var Comparator = $("#Comparator").val()
-                var ColContent = $("#ColContent").val();
-
-                var ColName1 = $("#ColName1").val();//澶嶉�夋
-                var Comparator1 = $("#Comparator1").val()
-                var ColContent1 = $("#ColContent1").val();
-                var ColName2 = $("#ColName2").val();//澶嶉�夋
-                var Comparator2 = $("#Comparator2").val()
-                var ColContent2 = $("#ColContent2").val();
-                if (ColName != 0 && Comparator != 0) {
-                    var com = "";
-                    switch (Comparator) {
-                        case "7":
-                            com = "like'%" + ColContent + "%'";
-                            break;
-                        case "8":
-                            com = "like'%" + ColContent + "'";
-                            break;
-                        case "9":
-                            com = "like'" + ColContent + "%'";
-                            break;
-                        case "10":
-                            com = "not like'%" + ColContent + "%'";
-                            break;
-                        default:
-                            com = "" + Comparator + "'" + ColContent + "'";
-                            break;
-                    }
-                    sWhere += " and " + ColName + " " + com;
+                var LotNo = $("#LotNo").val();//鎵规鍙�
+                sWhere_1 = {
+                    HBeginDate: HBeginDate
+                    , HEndDate: HEndDate
+                    , Station: Station
+                    , MaterialNo: MaterialNo
+                    , LotNo: LotNo
                 }
-                if (ColName1 != 0 && Comparator1 != 0) {
-                    var com1 = "";
-                    switch (Comparator1) {
-                        case "7":
-                            com1 = "like'%" + ColContent1 + "%'";
-                            break;
-                        case "8":
-                            com1 = "like'%" + ColContent1 + "'";
-                            break;
-                        case "9":
-                            com1 = "like'" + ColContent1 + "%'";
-                            break;
-                        case "10":
-                            com1 = "not like'%" + ColContent1 + "%'";
-                            break;
-                        default:
-                            com1 = "" + Comparator1 + "'" + ColContent1 + "'";
-                            break;
-                    }
-                    sWhere += " and " + ColName1 + " " + com1;
+                sWhere_2 = {
+                    HBeginDate: HBeginDate
+                    , HEndDate: HEndDate
+                    , MaterialNo: MaterialNo
+                    , LotNo: LotNo
                 }
-                if (ColName2 != 0 && Comparator2 != 0) {
-                    var com2 = "";
-                    switch (Comparator2) {
-                        case "7":
-                            com2 = "like'%" + ColContent2 + "%'";
-                            break;
-                        case "8":
-                            com2 = "like'%" + ColContent2 + "'";
-                            break;
-                        case "9":
-                            com2 = "like'" + ColContent2 + "%'";
-                            break;
-                        case "10":
-                            com2 = "not like'%" + ColContent2 + "%'";
-                            break;
-                        default:
-                            com2 = "" + Comparator + "'" + ColContent + "'";
-                            break;
-                    }
-                    sWhere += " and " + ColName2 + " " + com2;
-                }
-                if (Station) {
-                    sWhere += " and a.HCheckProc like '%" + Station + "%'";
-                }
-                if (MaterialNo) {
-                    sWhere += " and b.HLayOutName like '%" + MaterialNo + "%'";
-                }
-                //if (LotNo) {
-                //    sWhere += " and 鎵规鍙� like '%" + LotNo + "%'";
-                //}
-                //if (HBeginDate != "" && HEndDate != "") {
-                //    sWhere += "and 鍒涘缓鏃堕棿 between '" + HBeginDate + " 00:00:00' and '" + HEndDate + " 23:59:59'";
-                //}
-
-                get_Display(sWhere);
+                get_Display(JSON.stringify(sWhere_1));
+                get_BadReasonCount(JSON.stringify(sWhere_1));
+                get_LotNoCount(JSON.stringify(sWhere_2));
+                
                 //璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
                 sWhere = "";
+                sWhere_1 = "";
+                sWhere_2 = "";
+                set_Graphics();
             }
             //闅愯棌鍒楄缃�
             function get_HideColumn() {
@@ -654,24 +638,39 @@
             }
             //#region 銆愬浘褰€��
             function set_Graphics() {
+
+
                 //#region 銆愰ゼ鍥俱��
                 var chartDom = document.getElementById('PieChart');
                 var myChart = echarts.init(chartDom);
                 var option_BT;
-                var HQty2 = option.data.length > 5 ? 5 : option.data.length;//楗肩姸鍥炬牴鎹悎璁¢檷搴忔帓搴忔樉绀哄墠n鏉℃暟鎹�
-                var BadReasonCount = 0;
-                for (let i = 0; i < HQty2; i++) {
-                    if (option.data[i][3] != null)
-                        BadReasonCount++;
-                }
+                //浠呭鏈笟鍔℃彁渚涚殑绠楁硶
+                // 浣跨敤瀵硅薄杩涜鍒嗙粍缁熻
+                var reasonMap = {};
+
+                // 閬嶅巻鏁版嵁锛屾寜涓嶈壇鍘熷洜鍒嗙粍姹傚拰
+                option_BadReason.data.forEach(item => {
+                    var reason = item.涓嶈壇鍘熷洜;
+                    if (!reasonMap[reason]) {
+                        reasonMap[reason] = 0;
+                    }
+                    reasonMap[reason] += item.涓嶈壇鍘熷洜鏁伴噺;
+                });
+
+                // 杞崲涓洪ゼ鍥鹃渶瑕佺殑鏍煎紡
                 var option_BT_XData = [];
-                for (let i = 0; i < HQty2; i++) {
-                    option_BT_XData.push({ value: BadReasonCount, name: option.data[i].妫�楠屽伐搴� });
-                }
+                Object.keys(reasonMap).forEach(reason => {
+                    option_BT_XData.push({
+                        value: reasonMap[reason],
+                        name: reason
+                    });
+                });
+                                       
+                    
                 //$("#MaterialNo").val()
                 option_BT = {
                     title: {
-                        text:   '鏂欏彿'+ '涓嬬殑' + '涓嶈壇鍘熷洜鍒嗗竷鍥�',
+                        text: '涓嶈壇鍘熷洜鍒嗗竷鍥�',
                         left: 'center'
                     },
                     tooltip: {
@@ -699,7 +698,9 @@
 
                 option_BT && myChart.setOption(option_BT);
                 //#endregion
+                
 
+                //鏌辩姸鍥剧粦瀹氭暟鎹�
                 //#region 銆愭煴鐘跺浘銆�
                 var app = {};
                 var chartDom = document.getElementById('histogram');
@@ -790,29 +791,61 @@
                 //#endregion
 
                 //鏌辩姸鍥剧粦瀹氭暟鎹�
-                var stations = [];//妯酱lotNO
-                var qualifiedRate = [];//绾佃酱鍚堟牸鐜�
-                var PNLCount = [];
-                var PNLPara = [];
-                var HQty1 = option.data.length > 5 ? 5 : option.data.length;//鏌辩姸鍥炬牴鎹悎璁¢檷搴忔帓搴忔樉绀哄墠n鏉℃暟鎹�
-                for (let i = 0; i < HQty1; i++) {
-                    PNLPara[i] = option.data[i].PNL鏉$爜缂栧彿;
-                    for (let j = 0; j < HQty1; j++) {
-                        
-                        if (PNLPara[i] == option.data[j].PNL鏉$爜缂栧彿) {
-                            PNLCount[i]++;
-                        }
-                        
+                var HXTitle = [];//X杞存爣棰樺悕绉�
+                var HSourceIssueCount = [];
+                var HSourceIssueCount1 = [];
+                var HSourceIssueCount2 = [];
+                var ZZTColor = [];
+                //姣忎釜鎵规鐨凱CS鎬绘暟count_option_LotNoList
+                var count_option_LotNoList = 0;
+                var AllCount = 0;
+                var BadReasonCount=0 ;
+                
+                
+                var ZZTColor2 = ['#00FFFF', '#FC2C83', '#FCED2C', '#93FC2C', '#FC2CF0', '#FC892C', '#2C81FC', '#2CC9FC', '#2CFCA7', '#DED3F2', '#F2D8D3', '#F2D3E0', '#D8E052', '#7EE052', '#52E0D8', '#5F52E0', '#E06F52', '#52E09B', '#E052DE', '#E05F52', '#52B2E0', '#E0C452', '#52CEE0', '#648690', '#E5D1D6', '#D8E5D1', '#E5D1E5', '#D8E5D1', '#7C6262', '#76627C', '#81A583', '#81A595'];
+                //缁熻涓嶅悓鎵规鍙蜂笅鐨勬�绘暟鐩�
+                for (let i = 0; i < option_LotNoList.data.length; i++) {
+                    //缁熻璇ユ壒娆′笅鐨凱NL鍙峰拰鎬绘暟
+                    AllCount++;
+                    count_option_LotNoList += option_LotNoList.data[i].鎬昏;
+                }
+                    for (let i = 0; i < option_BadReason.data.length; i++) {
+                        BadReasonCount += option_BadReason.data[i].涓嶈壇鍘熷洜鏁伴噺;
                     }
                     
-                }
-                for (let i = 0; i < HQty1; i++) {
+                for (let i = 0; i < option_LotNoList.data.length; i++) {
+                    HXTitle.push(option_LotNoList.data[i].HBatchNo);
+                    
+                        HSourceIssueCount.push(BadReasonCount);
+                        HSourceIssueCount1.push(count_option_LotNoList);
+                    HSourceIssueCount2.push(((BadReasonCount) / (AllCount * count_option_LotNoList))*100+'%');
+                        ZZTColor.push({
+                            x: 1,
+                            y: 0,
+                            x2: 0,
+                            y2: 0,
+                            type: "linear",
+                            colorStops: [
+                                { offset: 0, color: "red" },
+                                { offset: 1, color: "blue" },
+                                { offset: 2, color: "green" }
+                            ]
+                        });
+                    
 
-                    stations.push(option.data[i].妫�楠屽伐搴�);
-                    //姝ゅ3鏆傛椂浠h〃psc鏁伴噺锛�1鏆傛椂浠h〃涓嶈壇psc鏁伴噺
-                    qualifiedRate.push((PNLCount[i] * 3 - 1) / (PNLCount[i] * 3));
+
                 }
                 option_ZZT = {
+                    title: {
+                        text: '鎵规鍙�',
+                        left: 'left',
+                        textStyle: {
+                            color: 'black',
+                            fontSize: 18,
+                            fontWeight: 'normal'
+                        },
+                        padding: [5, 0, 0, 65]
+                    },
                     tooltip: {
                         trigger: 'axis',
                         axisPointer: {
@@ -820,9 +853,7 @@
                         }
                     },
                     legend: {
-                        
-                        data: PNLPara
-                        
+                        data: ['涓嶈壇鏁扮洰', '鎬绘暟','涓嶈壇鐜�'] 
                     },
                     toolbox: {
                         show: true,
@@ -841,7 +872,7 @@
                         {
                             type: 'category',
                             axisTick: { show: true },
-                            data: stations
+                            data: HXTitle
                         }
                     ],
                     yAxis: [
@@ -851,6 +882,43 @@
                     ],
                     series: [
                         {
+                            name: '涓嶈壇鏁扮洰',
+                            type: 'bar',
+                            barGap: 0,
+                            label: labelOption,
+                            emphasis: {
+                                focus: 'series'
+                            },
+                            data: HSourceIssueCount,
+                            itemStyle: {
+                                color: function (params) {
+                                    // 鍔ㄦ�佺敓鎴愭笎鍙樿壊鎴栬�呮牴鎹潯浠惰繑鍥為璁剧殑娓愬彉鑹�
+                                    const gradientColors = ZZTColor2;
+
+                                    return gradientColors[params.dataIndex];
+                                }
+                            }
+
+                        },
+                        {
+                            name: '鎬绘暟',
+                            type: 'bar',
+                            barGap: 0,
+                            label: labelOption,
+                            emphasis: {
+                                focus: 'series'
+                            },
+                            data: HSourceIssueCount1,
+                            itemStyle: {
+                                color: function (params) {
+                                    // 鍔ㄦ�佺敓鎴愭笎鍙樿壊鎴栬�呮牴鎹潯浠惰繑鍥為璁剧殑娓愬彉鑹�
+                                    const gradientColors = ZZTColor2;
+
+                                    return gradientColors[params.dataIndex];
+                                }
+                            }
+                        },
+                        {
                             name: '涓嶈壇鐜�',
                             type: 'bar',
                             barGap: 0,
@@ -858,8 +926,17 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: qualifiedRate
-                        },
+                            data: HSourceIssueCount2,
+                            itemStyle: {
+                                color: function (params) {
+                                    // 鍔ㄦ�佺敓鎴愭笎鍙樿壊鎴栬�呮牴鎹潯浠惰繑鍥為璁剧殑娓愬彉鑹�
+                                    const gradientColors = ZZTColor2;
+
+                                    return gradientColors[params.dataIndex];
+                                }
+                            }
+                        }
+
 
                     ]
                 };
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePrice.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePrice.html"
index e7bf0f5..b91d691 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePrice.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePrice.html"
@@ -140,6 +140,7 @@
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Close"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
                             </div>
                         </script>
+                            </div>
                     </form>
                 </div>
             </div>
@@ -170,7 +171,7 @@
             var sWhere = "";
             var option = [];
             var Organization = sessionStorage["Organization"];
-            var HModName = "Gy_MatePrice";
+            var HModName = "Gy_MaterPrice";
             //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
             var titleData = ["HItemID", "HUSEORGID", "HCREATEORGID", "鐖剁骇ID", "HMaterID", "HUnitID", "HRelationID"];
 
@@ -238,10 +239,6 @@
                     case 'btn-Close':
                         parent.layui.admin.events.closeThisTabs();
                         break;
-                    //鍒楄缃�
-                    case 'set_HideColumn':
-                        get_HideColumn();
-                        break;
                 };
             });
             //#endregion
@@ -277,8 +274,8 @@
                 DisPlay_HideColumn_GetPageSize(HModName, sessionStorage["HUserName"], option);
                 //鏌ヨ
                 get_FastQuery();
-                //鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
-                //get_DefaultModule(get_FastQuery);
+                get_DefaultModule(get_FastQuery);
+
             }
             //#endregion
 
@@ -303,6 +300,12 @@
                 $("#ColContent").val("");
                 $("#ColName").val("0");
                 $("#Comparator").val("0");
+                $("#ColContent1").val("");
+                $("#ColName1").val("0");
+                $("#Comparator1").val("0");
+                $("#ColContent2").val("");
+                $("#ColName2").val("0");
+                $("#Comparator2").val("0");
                 form.render('select');
                 sWhere = "";
             }
@@ -331,28 +334,58 @@
                                     col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
                                 }
                                 else {
-                                    switch (data[i].Type) {
-                                        //int
-                                        case 'DateTime':
-                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
-                                            break;
-                                        default:
-                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                    if (data[i].name === "鏄惁绂佺敤") {
+                                        col.push({
+                                            field: data[i].id,
+                                            title: data[i].name,
+                                            align: 'center',
+                                            templet: function (d) {
+                                                return d.鏄惁绂佺敤 === 1 ? 'Y' : '';
+                                            }
+                                        });
+                                    }
+                                    else {
+                                        switch (data[i].Type) {
+                                            //int
+                                            case 'DateTime':
+                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
+                                                break;
+                                            case 'long':
+                                            case 'Int32':
+                                            case 'Int64':
+                                            case 'double':
+                                            case 'Decimal':
+                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
+                                                break;
+                                            default:
+                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                        }
                                     }
                                 }
                             }
-
-                            option.cols = [col];
-                            option.data = data1.data;
-
-                            //鍒楄缃�
-                            DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option);
-                            table.render(option)
-                            layer.close(ajaxLoad);
-                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
-                                ColFilter();
+                            //鍔ㄦ�佹樉绀哄垪鍚�
+                            option = {
+                                elem: '#mainTable'
+                                , toolbar: '#toolbarDemo'
+                                , cols: [col]
+                                , data: data1.data
+                                , height: 'full-80'
+                                , page: true
+                                , limits: [50, 500, 5000, 50000]
+                                , limit: 50
+                                , cellMinWidth: 90
                             }
-                            //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
+
+                            //鍒锋柊琛ㄦ牸鏁版嵁
+                            DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, titleData)
+                            ins = table.render(option);
+                            layer.close(ajaxLoad);
+
+                            if ($("#ColName option").length < 1) {
+                                ColFilter();
+                                get_DefaultModule();//鍔犺浇鏂规
+                            }
+
                         } else {
                             layer.close(ajaxLoad);
                             layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -368,7 +401,7 @@
             //#region 蹇�熻繃婊�
             function get_FastQuery() {
                 var HNumber = $("#HNumber").val();
-                var HName = $("#HName").val();
+                var HName = $("#HName").val();             
                 var ColName = $("#ColName").val();//澶嶉�夋
                 var Comparator = $("#Comparator").val()
                 var ColContent = $("#ColContent").val();
@@ -621,9 +654,9 @@
                         success: function (result) {
                             if (result.count == 1) {
                                 layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
-                                    // 寰楀埌frame绱㈠紩
+                                    //// 寰楀埌frame绱㈠紩
                                     var index = layer.getFrameIndex(window.name);
-                                    //鍏抽棴褰撳墠frame
+                                    ////鍏抽棴褰撳墠frame
                                     layer.close(index);
                                     //淇敼涓哄姛鍚庡埛鏂扮晫闈�
                                     $("#btnSearch").trigger('click');
@@ -675,6 +708,250 @@
                 form.render('select');
             }
             //#endregion
+            //#region 銆愯繃婊ゆ柟妗堛��
+
+            //鑾峰彇褰撳墠鐢ㄦ埛鐨勯粯璁よ繃婊ゆ柟妗�
+            function get_DefaultModule() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
+                    type: "GET",
+                    data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": 0, "Type": "Default" },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            //褰撳墠鐢ㄦ埛璁剧疆鏈夐粯璁ょ殑杩囨护鏂规
+                            var data = data1.data;
+                            //褰撳墠閫夋嫨鐨勮繃婊ゆ柟妗�
+                            HInterID_Choose = data[0].hmainid;
+                            //杩囨护鏂规鍐呯爜
+                            HInterID = data[0].hmainid
+                            //杩囨护鏂规鍚嶇О
+                            HDefaultFilter = data[0].鏂规鍚嶇О
+                            //杩囨护鏂规鐨勫娉紙鏂规淇℃伅鎻忚堪锛�
+                            var HRemark = data[0].澶囨敞
+                            //鏄剧ず鍑哄綋鍓嶇殑榛樿杩囨护鏂规
+                            document.getElementById("HFilterScheme_Now").style.display = "block";
+                            document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + HRemark + ")" + '</span>';
+                            //鎶婅繃婊ゆ潯浠跺�煎洖鍐欏埌椤甸潰涓�
+                            for (let i = 0; i < data.length; i++) {
+                                $("#" + data[i].杩囨护瀛楁ID).val(data[i].杩囨护鍊�);
+                                if (data[i].杩囨护鏍囩绫诲瀷 == 'SELECT') {
+                                    $("#" + data[i].杩囨护瀛楁ID).find("option[value='" + data[i].杩囨护鍊� + "']").attr("selected", true);
+                                }
+                            }
+                            //鏌ヨ
+                            get_FastQuery();
+                            form.render("select");
+                        } else {
+                            //褰撳墠鐢ㄦ埛娌℃湁璁剧疆榛樿鐨勮繃婊ゆ柟妗�
+                            //闅愯棌鏄剧ず杩囨护鏂规鐨勬爣绛句俊鎭�
+                            document.getElementById("HFilterScheme_Now").style.display = "none";
+                            //鎵ц鏌ヨ鏂规硶
+                            form.render("select");
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+
+            //淇濆瓨鏂规
+            function set_SaveScheme() {
+                var index = layer.open()
+                //鍒ゆ柇鐢ㄦ埛鏄惁鐐瑰嚮浜嗗彸涓婅鐨勨�滃弶鍙封�濆叧闂脊绐楅〉闈�
+                var HIsClose_Manual = false;
+                //鑾峰彇鏈〉鎵�鏈夎繃婊ゆ潯浠跺璞�(class涓寘鍚�"ForFilteringSchemes"鐨勫厓绱�)
+                var Filter = document.getElementsByClassName(HClassTag);
+
+                var HFilterIdList = "";//杩囨护鏉′欢
+                var HFilterIdLists = "";//鎷兼帴澶氫釜杩囨护鏉′欢
+                var HValue = "";//杩囨护鍊�
+                var HElement_type = "";//杩囨护鏍囩绫诲瀷
+
+                for (var i = 0; i < Filter.length; i++) {
+                    HFilterIdList = Filter[i].id; //杩囨护鏉′欢ID
+                    HFilterIdLists += Filter[i].id + ","; //杩囨护鏉′欢ID(鎷兼帴)
+                    HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�                    
+                    HElement_type += document.getElementById(HFilterIdList).tagName + ",";//閫氳繃鏍囩id鑾峰彇鏍囩绫诲瀷
+                }
+
+                //鍘婚櫎鏈熬閫楀彿
+                HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
+                HValue = HValue.substring(0, HValue.length - 1);
+                HElement_type = HElement_type.substring(0, HElement_type.length - 1);
+
+                //褰撳墠椤甸潰涓婃病鏈夐�夋嫨杩囨护鏂规锛岃繘鍏ユ柊澧炴柟娉�
+                if (HDefaultFilter == "") {
+                    layer.open({
+                        type: 2
+                        , area: ['40%', '80%']
+                        , title: '杩囨护鏂规'
+                        , shift: 0//寮瑰嚭鍔ㄧ敾
+                        , content: '../../绯荤粺绠$悊/杩囨护鏂规璁剧疆/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
+                        , cancel: function () {
+                            // 鍙充笂瑙掑叧闂簨浠剁殑閫昏緫
+                            HIsClose_Manual = true;
+                        }
+                        , end: function () {
+                            if (HIsClose_Manual != true) {
+                                get_FastQuery();
+                                //鏄剧ず褰撳墠鐨勮繃婊ゆ柟妗�
+                                document.getElementById("HFilterScheme_Now").style.display = "block";
+                                document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
+                            }
+                        }
+                    })
+                    layer.close(index)
+                } else {
+                    //褰撳墠椤甸潰宸叉湁杩囨护鏂规锛岀敤鎴烽�夋嫨 鏂板鎴栬�呯紪杈�
+                    layer.confirm('褰撳墠宸查�夋嫨杩囨护鏂规锛屾槸鍚︿慨鏀癸紵璇烽�夋嫨瀵瑰簲鎿嶄綔', {
+                        title: "鎿嶄綔鎻愮ず",
+                        icon: 0,
+                        btn: ['鏂板鏂规', '淇濆瓨淇敼褰撳墠鏂规', '鍙栨秷']
+                    }, function (index, layero) {
+                        //鏂板
+                        layer.open({
+                            type: 2
+                            , area: ['40%', '80%']
+                            , title: '杩囨护鏂规'
+                            , shift: 0//寮瑰嚭鍔ㄧ敾
+                            , content: '../../绯荤粺绠$悊/杩囨护鏂规璁剧疆/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
+                            , end: function () {
+                                get_FastQuery()
+                                //鏄剧ず褰撳墠鐨勮繃婊ゆ柟妗�
+                                document.getElementById("HFilterScheme_Now").style.display = "block";
+                                document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
+                            }
+                        })
+                        layer.close(index)
+                    }, function (index) {
+                        //缂栬緫
+                        var Filter_Edit = document.getElementsByClassName(HClassTag); //鑾峰彇鏈〉鎵�鏈夎繃婊ゆ潯浠跺璞�(class涓寘鍚�"ForFilteringSchemes"鐨勫厓绱�)
+                        HFilterIdList = "";
+                        HFilterIdLists = "";
+                        HValue = "";
+                        HElement_type = "";
+                        for (var i = 0; i < Filter_Edit.length; i++) {
+                            HFilterIdList = Filter_Edit[i].id; //杩囨护鏉′欢ID
+                            HFilterIdLists += Filter_Edit[i].id + ","; //杩囨护鏉′欢ID(鎷兼帴)
+                            HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�
+                            HElement_type += document.getElementById(HFilterIdList).tagName + ",";//閫氳繃鏍囩id鑾峰彇鏍囩绫诲瀷
+                        }
+                        //鍘婚櫎鏈熬閫楀彿
+                        HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
+                        HValue = HValue.substring(0, HValue.length - 1);
+                        HElement_type = HElement_type.substring(0, HElement_type.length - 1);
+
+                        var sMainSub = HInterID_Choose + ';' + HFilterIdLists + ';' + HValue + ';' + HElement_type + ';' + sessionStorage["Czybm"] + ';' + 3;
+
+                        //淇敼
+                        $.ajax({
+                            type: "POST",
+                            url: GetWEBURL() + "/Xt_FastICScheme/save", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                            async: true,
+                            data: { "oMain": sMainSub },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 });
+                                }
+                                else {
+
+                                }
+                                layer.closeAll("loading");
+                            },
+                            error: function (err) {
+
+
+                            }
+                        });
+                        layer.close(index)
+                    }, function (index) {
+                        //鍙栨秷
+                        layer.alert('鍙栨秷')
+                        layer.close(index)
+                    });
+                }
+
+            }
+
+            //璇诲彇鏂规
+            function set_ReadScheme() {
+                var HIsClose_Manual = false;
+                var Filter = document.getElementsByClassName(HClassTag); //鑾峰彇鏈〉鎵�鏈夎繃婊ゆ潯浠跺璞�(class涓寘鍚�"ForFilteringSchemes"鐨勫厓绱�)
+
+                var HFilterIdList = "";
+                var HFilterIdLists = "";
+                var HValue = "";
+                var HElement_type = "";
+                for (var i = 0; i < Filter.length; i++) {
+                    HFilterIdList = Filter[i].id; //杩囨护鏉′欢ID
+                    HFilterIdLists += Filter[i].id + ","; //杩囨护鏉′欢ID(鎷兼帴)
+                    HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�
+                    HElement_type += document.getElementById(HFilterIdList).tagName + ",";//閫氳繃鏍囩id鑾峰彇鏍囩绫诲瀷
+                }
+                //鍘婚櫎鏈熬閫楀彿
+                HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
+                HValue = HValue.substring(0, HValue.length - 1);
+                HElement_type = HElement_type.substring(0, HElement_type.length - 1);
+
+                layer.open({
+                    type: 2
+                    , area: ['80%', '80%']
+                    , title: '杩囨护鏂规鍒楄〃'
+                    , shift: 0//寮瑰嚭鍔ㄧ敾
+                    , content: '../../绯荤粺绠$悊/杩囨护鏂规璁剧疆/Xt_FastICSchemeList.html?HType=Select&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type + '&HModuleName=' + HModuleName
+                    , cancel: function () {
+                        // 鍙充笂瑙掑叧闂簨浠剁殑閫昏緫
+                        HIsClose_Manual = true;
+                    }
+                    , end: function () {
+                        if (HIsClose_Manual != true) {
+                            get_FastQuery()
+                            form.render("select");
+                        }
+                    }
+                })
+            }
+
+            //#endregion  
+            //#region 銆愯繃婊ゆ柟妗堣繑鍥炴暟鎹��
+            function HFilterScheme(obj)  //杩斿洖杩囨护鏂规
+            {
+                var HInterID = obj[0].hmainid;
+                HInterID_Choose = obj[0].hmainid;
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
+                    type: "GET",
+                    data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": HInterID, "Type": "Select" },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            var data = data1.data;
+                            //璧嬪�艰繃婊ゆ柟妗堝悕绉�
+                            HDefaultFilter = data[0].鏂规鍚嶇О
+                            var HRemark = data[0].澶囨敞
+                            //鏄剧ず褰撳墠鐨勮繃婊ゆ柟妗�
+                            document.getElementById("HFilterScheme_Now").style.display = "block";
+                            document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + HRemark + ")" + '</span>';
+                            HInterID = data[0].hmainid
+                            //鏍规嵁閫夋嫨鐨勮繃婊ゆ柟妗堝洖濉暟鎹埌鍒楄〃杩囨护鏉′欢
+                            for (let i = 0; i < data.length; i++) {
+                                $("#" + data[i].杩囨护瀛楁ID).val(data[i].杩囨护鍊�);
+                                if (data[i].杩囨护鏍囩绫诲瀷 == 'SELECT') {
+                                    $("#" + data[i].杩囨护瀛楁ID).find("option[value='" + data[i].杩囨护鍊� + "']").attr("selected", true);
+                                }
+                            }
+
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+        //#endregion
         });
             //#endregion
     </script>
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceEdit.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceEdit.html"
index 8be2e0f..825ae4b 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceEdit.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceEdit.html"
@@ -132,8 +132,8 @@
                                                 <div class="layui-col-xs4 layui-inline">
                                                     <label class="layui-form-label">绂佺敤鏍囧織</label>
                                                     <div class="layui-input-inline">
-                                                        <input type="checkbox" name="HStopflag" id="HStopflag" disabled
-                                                               lay-skin="primary" lay-filter="HStopflag" value="0" title="鏄惁绂佺敤">
+                                                        <input type="checkbox" name="checkboxHStopflag" id="checkboxHStopflag" lay-skin="primary" lay-filter="checkboxHStopflag" value="true" title="鏄惁绂佺敤">
+                                                        <input type="hidden" value="false" name="HStopflag" id="HStopflag">
                                                         <!--<input type="hidden" value="false" name="HStopflag" id="HStopflag">-->
                                                     </div>
                                                 </div>
@@ -451,7 +451,7 @@
             Organ1();
         }
         //鏄惁绂佺敤鎸夐挳
-        form.on('checkbox(HStopflag)', function (data) {
+        form.on('checkbox(checkboxHStopflag)', function (data) {
             $("#HStopflag").val(data.elem.checked);
         });
         //淇濆瓨HMaker
@@ -511,8 +511,11 @@
                 success: function (d) {
                     var IsHStopflag = d.data[0].鏄惁绂佺敤;
                     //绂佺敤鏍囪
-                    if (IsHStopflag=== 1) {
-                        $("#HStopflag").attr("checked", true);
+                    //if (IsHStopflag=== 1) {
+                    //    $("#HStopflag").attr("checked", true);
+                    //}
+                    if (IsHStopflag) {
+                        $("input[name='checkboxHStopflag'][value='" + IsHStopflag + "']").attr("checked", true);
                     }
                     //涓昏〃
                     form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��

--
Gitblit v1.9.1