| | |
| | | |
| | | //åå§åè¡¨æ ¼ |
| | | function set_InitGrid() { |
| | | var HBeginDate = $("#HBeginDate").val();//ä¸è¾¾æ¥æ å¼å§æ¥æ |
| | | var HEndDate = $("#HEndDate").val();//ç»ææ¥æ |
| | | 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 + ")"; |
| | | } |
| | | 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; |
| | | } |
| | | 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; |
| | | } |
| | | //æ ¹æ®ç¨æ·è¿æ»¤ç¨æ·å
³è客æ·çè®°å½ |
| | | 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", |
| | | 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, titleData) > -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 |
| | | }); |
| | | } |
| | | }) |
| | | }; |
| | | } |
| | | |
| | | |
| | |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | 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, titleData) > -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 }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //è°æ´æ¥ææ ¼å¼ï¼æ¾ç¤º å¹´ææ¥ å æ¶ |
| | | for (var i = 0; i < data1.data.length; i++) { |
| | | if (data1.data[i].çäº§è®¢åæ¥æ!=null) { |
| | |
| | | } |
| | | |
| | | option.data = data1.data; |
| | | option.cols = [col]; |
| | | //var num = 0; |
| | | //for (let i = 0; i < data1.data.length; i++) { |
| | | // for (let j = i + 1; j < data1.data.length; j++) { |
| | |
| | | layer.close(wait); |
| | | } else { |
| | | $("#SumHMaterOutQty").val(""); |
| | | |
| | | option.data = []; |
| | | ins = table.render(option); |
| | | |
| | | layer.close(wait); |
| | | layer.alert(data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | $("#SumHMaterOutQty").val(""); |
| | | option.data = []; |
| | | ins = table.render(option); |
| | | |
| | | layer.close(wait); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |