| | |
| | | }); |
| | | //æ¥è¯¢æé® |
| | | form.on('submit(btnSearch)', function (data) { |
| | | var ajaxLoad1 = layer.load(); |
| | | get_FastQuery(); |
| | | layer.close(ajaxLoad1); |
| | | }); |
| | | |
| | | //è¡çå¬äºä»¶-åå» |
| | |
| | | |
| | | //åå§åè¡¨æ ¼ |
| | | function set_InitGrid() { |
| | | var HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(8, 0, 0, 0), "yyyy-MM-dd") + " 00:00:00";//ä¸è¾¾æ¥æ å¼å§æ¥æ |
| | | var HEndDate = Format(new Date(new Date()).setHours(8, 0, 0, 0), "yyyy-MM-dd") + " 00: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 sProcessNo = $("#sProcessNo").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; |
| | | } |
| | | com = com + com1 + com2; |
| | | sWhere = { |
| | | HBeginDate: HBeginDate |
| | | , HEndDate: HEndDate |
| | | , HMaterNumber: HMaterNumber |
| | | , HBillNo: HBillNo |
| | | , HProductName: HProductName |
| | | , HProductModel: HProductModel |
| | | , RandomSearch: com |
| | | } |
| | | sWhere = JSON.stringify(sWhere); |
| | | |
| | | //卿å-ç¼åå表 |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/ProdProcessEntryReport/ProdProcessEntryReport_DyeColor", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sWhere, "sProcessNo": '', "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 |
| | | }); |
| | | } |
| | | }) |
| | | }; |
| | | } |
| | | |
| | | //åææ¾ç¤ºä¸ææ¡ |
| | |
| | | |
| | | //å è½½ç½æ ¼ |
| | | function get_Display(sWhere,sProcessNo) { |
| | | var wait = layer.load();//é®ç½© |
| | | var ajaxLoad = layer.load(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/ProdProcessEntryReport/ProdProcessEntryReport_DyeColor', |
| | | async: false, |
| | |
| | | var sumCompare = sumHMaterOutQty - sumDyeColorOut; |
| | | $("#SumCompare").val(sumCompare); |
| | | |
| | | layer.close(wait); |
| | | layer.close(ajaxLoad); |
| | | } else { |
| | | $("#SumHMaterOutQty").val(""); |
| | | layer.close(wait); |
| | | layer.close(ajaxLoad); |
| | | layer.alert(data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | $("#SumHMaterOutQty").val(""); |
| | | layer.close(wait); |
| | | layer.close(ajaxLoad); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | |
| | | |
| | | //æ¾ç¤ºåæ°æ® |
| | | function DisPlay_HideColumn() { |
| | | var ajaxLoad = layer.load(); |
| | | ColFilter(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }) |
| | | layer.close(ajaxLoad); |
| | | } |
| | | |
| | | |
| | | |
| | | //#endregion |
| | | }); |