| | |
| | | |
| | | //åå§åè¡¨æ ¼ |
| | | function set_InitGrid() { |
| | | var HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(8, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//ä¸è¾¾æ¥æ å¼å§æ¥æ |
| | | var HEndDate = Format(new Date(new Date()).setHours(8, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//ç»ææ¥æ |
| | | var HMaterNumber = $("#HMaterNumber").val();//ç©æä»£ç |
| | | var HBillNo = $("#HBillNo").val(); //åæ®å· |
| | | var HProductName = $("#HProductName").val();//产ååç§° |
| | | var HProductModel = $("#HProductModel").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(); |
| | | //æ¼æ¥ä»»ä¸åæ®µè¿æ»¤æ¥è¯¢æ¡ä»¶ |
| | | var com = ""; |
| | | if (ColName != 0 && Comparator != 0) { |
| | | 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; |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , cellMinWidth: 120 |
| | | , limit: Number.MAX_VALUE // æ°æ®è¡¨æ ¼é»è®¤å
¨é¨æ¾ç¤º |
| | | , totalRow: true |
| | | , height: 'full-70' |
| | | , cols: [[ |
| | | { type: 'checkbox', fixed: 'left', totalRowText: 'å计' } |
| | | , { field: 'æ¥æ', title: 'æ¥æ', width: 160 } |
| | | , { field: 'åæ®å·', title: 'åæ®å·', width: 160 } |
| | | , { field: '产å代ç ', title: '产å代ç ', width: 160 } |
| | | , { field: '产ååç§°', title: '产ååç§°', width: 160 } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', width: 160 } |
| | | , { field: 'ä¸å¡å', title: 'ä¸å¡å', width: 160 } |
| | | , { field: '客æ·', title: '客æ·', width: 160 } |
| | | , { field: 'ç产任å¡åæ°é', title: 'ç产任å¡åæ°é', totalRow: true, width: 200 } |
| | | , { field: 'ç½å¯åå¸', title: 'ç½å¯åå¸', width: 160, totalRow: true } |
| | | , { field: 'æ¯å¦ä¸æ¨çææµè½¬å¡', title: 'æ¯å¦ä¸æ¨çææµè½¬å¡', width: 160 } |
| | | ]] |
| | | , done: function (res) { |
| | | } |
| | | com = " and (" + ColName + " " + com + ")"; |
| | | } |
| | | |
| | | var com1 = ""; |
| | | if (ColName1 != 0 && Comparator1 != 0) { |
| | | |
| | | 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; |
| | | } |
| | | com1 = " and (" + ColName1 + " " + com1 + ")"; |
| | | } |
| | | |
| | | var com2 = ""; |
| | | if (ColName2 != 0 && Comparator2 != 0) { |
| | | |
| | | 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 = "" + Comparator2 + "''" + ColContent2 + "''"; |
| | | break; |
| | | } |
| | | com2 = " and (" + ColName2 + " " + com2 + ")"; |
| | | } |
| | | com = com + com1 + com2; |
| | | |
| | | //æ ¹æ®ç¨æ·è¿æ»¤ç¨æ·å
³è客æ·çè®°å½ |
| | | var OtherSearch = getSWhereByHUser(); |
| | | |
| | | sWhere = { |
| | | HBeginDate: HBeginDate |
| | | , HEndDate: HEndDate |
| | | , HMaterNumber: HMaterNumber |
| | | , HBillNo: HBillNo |
| | | , HProductName: HProductName |
| | | , HProductModel: HProductModel |
| | | , RandomSearch: com |
| | | , OtherSearch: (OtherSearch == null || OtherSearch == "undefine") ? " and 1=1 " : OtherSearch |
| | | } |
| | | sWhere = JSON.stringify(sWhere); |
| | | |
| | | //卿å-ç¼åå表 |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/ProdProcessSumReport/ProdProcessSumReport_DyeColor_third", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | //async: false, |
| | | success: function (data1) { |
| | | |
| | | if (data1.count == 1) { |
| | | var totalArray = ["ç产æ°é", "ç½å¯åå¸"]; |
| | | var data = []; |
| | | var col = []; |
| | | //ç»ç©ºçæ°ç»èµå¼ |
| | | for (var key in data1.list) { |
| | | data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); |
| | | } |
| | | |
| | | //å¨å表左边添å å¾éæ¡ |
| | | col.push({ type: 'checkbox', fixed: 'left' }); |
| | | for (var i = 0; i < data.length; i++) { |
| | | if ($.inArray(data[i].name, "") > -1) { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //éèidå |
| | | } |
| | | else if ($.inArray(data[i].name, totalArray) > -1) { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 }); |
| | | } |
| | | else if (data[i].ColName == 'ç½å¯åå¸') { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true }); |
| | | } |
| | | else { |
| | | switch (data[i].Type) { |
| | | //int |
| | | case 'DateTime': |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true }); |
| | | break; |
| | | default: |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true }); |
| | | } |
| | | } |
| | | } |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , cellMinWidth: 120 |
| | | , limit: Number.MAX_VALUE // æ°æ®è¡¨æ ¼é»è®¤å
¨é¨æ¾ç¤º |
| | | , totalRow: true |
| | | , height: 'full-70' |
| | | , cols: [col] |
| | | , data: data1.data |
| | | }; |
| | | ins = table.render(option); |
| | | } else { |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , cellMinWidth: 120 |
| | | , limit: Number.MAX_VALUE // æ°æ®è¡¨æ ¼é»è®¤å
¨é¨æ¾ç¤º |
| | | , totalRow: true |
| | | , height: 'full-70' |
| | | , cols: [[ |
| | | { type: 'checkbox', fixed: 'left', totalRowText: 'å计' } |
| | | , { field: 'æ¥æ', title: 'æ¥æ', width: 160 } |
| | | , { field: 'åæ®å·', title: 'åæ®å·', width: 160 } |
| | | , { field: '产å代ç ', title: '产å代ç ', width: 160 } |
| | | , { field: '产ååç§°', title: '产ååç§°', width: 160 } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', width: 160 } |
| | | , { field: 'ä¸å¡å', title: 'ä¸å¡å', width: 160 } |
| | | , { field: '客æ·', title: '客æ·', width: 160 } |
| | | , { field: 'ç产任å¡åæ°é', title: 'ç产任å¡åæ°é', totalRow: true, width: 200 } |
| | | , { field: 'ç½å¯åå¸', title: 'ç½å¯åå¸', width: 160, totalRow: true } |
| | | , { field: 'æ¯å¦ä¸æ¨çææµè½¬å¡', title: 'æ¯å¦ä¸æ¨çææµè½¬å¡', width: 160 } |
| | | ]] |
| | | , done: function (res) { |
| | | } |
| | | }; |
| | | ins = table.render(option); |
| | | } |
| | | }, |
| | | error: function (err) { |
| | | layer.msg('é误' + err, { |
| | | icon: 5, |
| | | time: 20000 |
| | | }, function () { |
| | | //do something |
| | | }); |
| | | } |
| | | }) |
| | | }; |
| | | } |
| | | |
| | | //åææ¾ç¤ºä¸ææ¡ |