| | |
| | | if (HWorkShopID == 0) { |
| | | return layer.msg("ç产车é´ä¸è½ä¸ºç©º!"); |
| | | } else { |
| | | |
| | | layer.open({ |
| | | var index = layer.open({ |
| | | type: 1, // page å±ç±»å |
| | | area: ['500px', '300px'], |
| | | title: 'Hello layer', |
| | | area: ['20%', '20%'], |
| | | shade: 0.6, // é®ç½©éæåº¦ |
| | | shadeClose: true, // ç¹å»é®ç½©åºåï¼å
³éå¼¹å± |
| | | maxmin: true, // å
许å
¨å±æå°å |
| | | shadeClose: false, // ç¹å»é®ç½©åºåï¼ä¸å
³éå¼¹å± |
| | | maxmin: false, // ä¸å
许å
¨å±æå°å |
| | | anim: 0, // 0-6 çå¨ç»å½¢å¼ï¼-1 ä¸å¼å¯ |
| | | content: '<div style="padding: 32px;">ä¸ä¸ªæ®éç页é¢å±ï¼ä¼ å
¥äºèªå®ä¹ç HTML</div>' |
| | | content: '<div style="padding: 12px;">æ£å¨è¿ç®,请èå¿çå¾
!!!</div>' |
| | | }); |
| | | setTimeout(get_btnProPC(HWorkShopID), 3000); |
| | | layer.closeAll(); |
| | | setTimeout(function () { |
| | | get_btnProPC(HWorkShopID); |
| | | layer.close(index); |
| | | }, 1000) |
| | | } |
| | | |
| | | }) |
| | | |
| | | //è¡å
äºä»¶ |
| | |
| | | , cellMinWidth: 90 |
| | | , cols: [columns] |
| | | , limit: Number.MAX_VALUE//é»è®¤æ¾ç¤ºå
¨é¨ |
| | | , done: function (res, page, count) { |
| | | var that = this.elem.next(); |
| | | res.data.forEach(function (item, index) { |
| | | var NumCount = item.FBASEQTY;//è·åæ»åºåæ°é |
| | | for (var i = 0; i < Days; i++) { |
| | | var dateNowTime = Format(new Date($("#HBEGINDATE").val()).setDate(new Date($("#HBEGINDATE").val()).getDate() + i), 'yyyy-MM-dd'); |
| | | if (item[dateNowTime] != null) { |
| | | if (NumCount > parseFloat(item[dateNowTime])) { |
| | | NumCount -= parseFloat(item[dateNowTime]); |
| | | } else { |
| | | var num = 6;//峿¶åºå䏿¥ææ¨ç ä»å³æ¶åºåå¼å§ç® |
| | | tr = that.find(".layui-table-box tbody tr[data-index='" + index + "']"); |
| | | rq = tr.children()[num + 1 + i]; |
| | | rq.style.color = '#f66161';//ç¶ååè² |
| | | rq = tr.children()[num]; |
| | | rq.style.color = '#f66161';//ç¶ååè² |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | $('.layui-table-cell').css({ 'height': 'auto' }); |
| | | } |
| | | }; |
| | | } |
| | | |
| | |
| | | var data = table.cache["mainTable"]; |
| | | var HICOMNum = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | if (isNaN(data[i]["HICMOInterID"])) { |
| | | return layer.msg("请å
è¿è¡ä¿å!!") |
| | | } |
| | | HICOMNum.push(data[i]["HICMOInterID"] + ";" + data[i]["HICMOEntryID"]); |
| | | } |
| | | $('#HProgressBar').html(` |
| | |
| | | var HDelData = 0; |
| | | JDTLen = (100 / option.data.length).toFixed(2); |
| | | var HJDLen = 0; |
| | | var ajaxLoad = layer.load(); |
| | | |
| | | //妿éå®è®¡åï¼åä¸éè¦åæç¨ |
| | | //æ¥è¯¢æ¬è½¦é´æ¯å¦æéå®è®¡åçæ°æ® |
| | | var HinterID_S = []; |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | if (option.data[i]["å°æ¶äº§è½"] == "0") { |
| | | return layer.msg("请å
ç¹å»å夿é®,ç¡®ä¿å°æ¶äº§è½ä¸ä¸º0!!!") |
| | | } |
| | | HinterID_S.push(option.data[i]["hmainid"]); |
| | | } |
| | | $.ajax({ |
| | |
| | | //æ ¹æ®è½¦é´å 餿²¡æéå®çæ°æ® |
| | | var sql = "delete from Sc_WorkBillSortBillSub where HMasterDate>=convert(varchar(10) ,DATEADD(DAY," + HPlanDay + ",GETDATE()),20) and HInterID in(select HInterID from Sc_WorkBillSortBillMain where HWorkShopID=" + HWorkShopID + ")"; |
| | | $.ajax({ |
| | | url: GetWEBURL() +'/Gy_SOPBillList/UpDelSQL', |
| | | url: GetWEBURL() + '/Gy_SOPBillList/UpDelSQL', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | HDelData = 1; |
| | | |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | get_FastQuery(2); |
| | | get_HFData(0, 0); |
| | | |
| | | if (HDelData == 1) { |
| | | //æä»»å¡åä¼å
级 å¾ªç¯ |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | //æ¾å°æ¬ä»»å¡å å¯ç¨çäº§èµæº |
| | | lMainID = option.data[i]["HICMOInterID"]; |
| | | sICMOBillNo = option.data[i]["ç产订åå·"]; |
| | | dEndDate = Format(option.data[i]["æè¿å®å·¥æ¥æ"], 'yyyy/MM/dd'); |
| | | sProdTimes = option.data[i]["çäº§å¨æ"]; |
| | | sPlanQty = option.data[i]["è®¡åæ°é"]; |
| | | lHGroupID = option.data[i]["HGroupID"]; |
| | | sGroupName = option.data[i]["HGroupName"]; |
| | | lMaterID = option.data[i]["HMaterID"]; |
| | | sMaterNumber = option.data[i]["ç©æä»£ç "]; |
| | | sMaterName = option.data[i]["ç©æåç§°"]; |
| | | sMaterModel = option.data[i]["è§æ ¼åå·"]; |
| | | sWorkQty = option.data[i]["å°æ¶äº§è½"]; |
| | | sYX = option.data[i]["ä¼å
级"]; |
| | | //å©ä½éæ±å·¥æ¶ |
| | | iLeftQty = sPlanQty; |
| | | if (sWorkQty <= 0) { |
| | | sLeftProdTimes = 0; |
| | | } |
| | | else { |
| | | sLeftProdTimes = iLeftQty / sWorkQty; |
| | | } |
| | | //è¥æ¬ä»»å¡åå·²æå®æèµæºï¼ä¸æ¬¡æç¨æè
æå·¥æç¨ï¼ åä¸å寻æ¾èµæºï¼ç´æ¥æç¨ |
| | | if (option.data[i]["HSourceID"] != 0 && option.data[i]["çäº§èµæº"] != "") { |
| | | //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | lSourceID = option.data[i]["HSourceID"]; |
| | | sSourceName = option.data[i]["çäº§èµæº"]; |
| | | sSourceNumber = option.data[i]["çäº§èµæºä»£ç "]; |
| | | //æ¥è¯¢çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSource2 " + lMaterID + ",'" + dEndDate + "'," + sProdTimes + "," + lSourceID; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | ds = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | else //没æèµæºå èªå¨æ¾å°èµæº |
| | | { |
| | | //æ¥è¯¢çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSource2 " + lMaterID + ",'" + dEndDate + "'," + sProdTimes; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | ds = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (ds == null || ds.length == 0) //没æå¯ä»¥æçèµæº |
| | | { |
| | | //è·³å°ä¸ä¸å æ¬åçº¢è²æ¾ç¤º |
| | | $("tr[data-index='" + i + "']").attr({ "style": "background:red;color:black;" }); |
| | | continue; |
| | | } |
| | | else { |
| | | $("tr[data-index='" + i + "']").attr({ "style": "background:White;color:black;" }); |
| | | //å¼å§æå |
| | | bFind = false; |
| | | //è¶
交货æ ä»ç¶æç¨ |
| | | for (var j = 0; j < ds.length; j++) { |
| | | //å¤æèµæºå©ä½å·¥æ¶ï¼æ¯å¦å¤§äº çäº§å¨æ |
| | | if (parseFloat(ds[j]["å©ä½å·¥æ¶"]) > sLeftProdTimes) { |
| | | if (iLeftQty > 0) // ç产订åå©ä½æ°é |
| | | { |
| | | //卿¬èµæºä¸ç产 |
| | | //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | lSourceID = ds[j]["HitemID"]; |
| | | sSourceName = ds[j]["èµæºåç§°"]; |
| | | sSourceNumber = ds[j]["èµæºä»£ç "]; |
| | | option.data[i]["HSourceID"] = lSourceID; |
| | | option.data[i]["çäº§èµæº"] = sSourceName; |
| | | option.data[i]["çäº§èµæºä»£ç "] = sSourceNumber; |
| | | |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSourceTime " + lSourceID; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | dsSub = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | if (dsSub == null || dsSub.length == 0) { |
| | | continue;//å¦ææ²¡æå©ä½å æ§è¡ä¸ä¸ä¸ªç产订å |
| | | } |
| | | if (dsSub != null)//ä¸å çæç¨ |
| | | { |
| | | iRow = i + 1; |
| | | //å°æ°æ®æå°ç½æ ¼ä¸ |
| | | //grdMain.RowCount = grdMain.RowCount + 1; // grdmain æ°å¢ä¸è¡ |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOBillNoCol].Value = sICMOBillNo; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOInterIDCol].Value = lMainID; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecLeftQtyCol].Value = iLeftQty; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupIDCol].Value = lHGroupID; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupNameCol].Value = sGroupName; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterIDCol].Value = lMaterID; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNameCol].Value = sMaterName; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNumberCol].Value = sMaterNumber; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterModelCol].Value = sMaterModel; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanEndDateCol].Value = dEndDate; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanQtyCol].Value = sPlanQty; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceIDCol].Value = lSourceID; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNameCol].Value = sSourceName; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNumberCol].Value = sSourceNumber; |
| | | //grdMain.Rows[grdMain.RowCount - 1].Cells[HSecYXCol].Value = sYX; |
| | | //Sc_ICMOSortBillFun.SetInfoToGrid(grdMain, dsSub, null, grdMain.RowCount - 1, ref iLeftQty, sWorkQty, false, oClsGridValues); |
| | | SetInfoToGrid(option, dsSub, null, (iRow - 1), iLeftQty, sWorkQty, false, HPlanDay); |
| | | } |
| | | bFind = true; |
| | | } |
| | | } |
| | | } |
| | | if (!bFind) { |
| | | for (var j = 0; j < ds.length; j++) { |
| | | //å¤æèµæºæå¤§å©ä½å·¥æ¶ï¼æ¯å¦å¤§äº çäº§å¨æ |
| | | if (parseFloat(ds[j]["æå¤§å©ä½å·¥æ¶"]) > sLeftProdTimes) { |
| | | if (iLeftQty > 0) { |
| | | |
| | | //卿¬èµæºä¸ç产 |
| | | grdMain.RowCount = grdMain.RowCount + 1; |
| | | //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | lSourceID = ds[j]["HitemID"]; |
| | | sSourceName = ds[j]["èµæºåç§°"]; |
| | | sSourceNumber = ds[j]["èµæºä»£ç "]; |
| | | option.data[i]["HSourceID"] = lSourceID; |
| | | option.data[i]["çäº§èµæº"] = sSourceName; |
| | | option.data[i]["çäº§èµæºä»£ç "] = sSourceNumber; |
| | | |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSourceTime " + lSourceID; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | dsSub = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | if (dsSub == null || dsSub.length == 0) { |
| | | continue; |
| | | } |
| | | //if (dsSub != null)//å çæç¨ |
| | | //{ |
| | | // //å°æ°æ®æå°ç½æ ¼ä¸ |
| | | // grdMain.RowCount = grdMain.RowCount + 1; // grdmain æ°å¢ä¸è¡ |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOBillNoCol].Value = sICMOBillNo; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOInterIDCol].Value = lMainID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecLeftQtyCol].Value = iLeftQty; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupIDCol].Value = lHGroupID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupNameCol].Value = sGroupName; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterIDCol].Value = lMaterID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNameCol].Value = sMaterName; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNumberCol].Value = sMaterNumber; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterModelCol].Value = sMaterModel; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanEndDateCol].Value = dEndDate; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanQtyCol].Value = sPlanQty; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceIDCol].Value = lSourceID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNameCol].Value = sSourceName; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNumberCol].Value = sSourceNumber; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecYXCol].Value = sYX; |
| | | // Sc_ICMOSortBillFun.SetInfoToGrid(grdMain, dsSub, null, grdMain.RowCount - 1, ref iLeftQty, sWorkQty, true, oClsGridValues); |
| | | //} |
| | | } |
| | | bFind = true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!bFind) { |
| | | //å¦ææ²¡ææ¾å°åéèµæºåï¼ç´æ¥ææåä¸ä¸ªå©ä½æå¤§çèµæºã |
| | | //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | lSourceID = ds[ds.length - 1]["HitemID"]; |
| | | sSourceName = ds[ds.length - 1]["èµæºåç§°"]; |
| | | sSourceNumber = ds[ds.length - 1]["èµæºä»£ç "]; |
| | | option.data[i]["HSourceID"] = lSourceID; |
| | | option.data[i]["çäº§èµæº"] = sSourceName; |
| | | option.data[i]["çäº§èµæºä»£ç "] = sSourceNumber; |
| | | |
| | | //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSourceTime " + lSourceID; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | dsSub = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | if (dsSub == null || dsSub.length == 0) { |
| | | continue; |
| | | } |
| | | //if (dsSub != null)//å çæç¨ |
| | | //{ |
| | | // //å°æ°æ®æå°ç½æ ¼ä¸ |
| | | // grdMain.RowCount = grdMain.RowCount + 1; // grdmain æ°å¢ä¸è¡ |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOBillNoCol].Value = sICMOBillNo; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOInterIDCol].Value = lMainID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecLeftQtyCol].Value = iLeftQty; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupIDCol].Value = lHGroupID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupNameCol].Value = sGroupName; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterIDCol].Value = lMaterID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNameCol].Value = sMaterName; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNumberCol].Value = sMaterNumber; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterModelCol].Value = sMaterModel; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanEndDateCol].Value = dEndDate; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanQtyCol].Value = sPlanQty; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceIDCol].Value = lSourceID; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNameCol].Value = sSourceName; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNumberCol].Value = sSourceNumber; |
| | | // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecYXCol].Value = sYX; |
| | | // Sc_ICMOSortBillFun.SetInfoToGrid(grdMain, dsSub, null, grdMain.RowCount - 1, ref iLeftQty, sWorkQty, true, oClsGridValues); |
| | | //} |
| | | } |
| | | //åå§åè¡¨æ ¼æ°æ® |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | for (var j = (22 + HPlanDay); j < 53; j++) { |
| | | if (option.data[i][option.cols[0][j].field] != null) { |
| | | option.data[i][option.cols[0][j].field] = ""; |
| | | } |
| | | } |
| | | table.render(option); |
| | | set_AddNew(); |
| | | } else { |
| | | layer.msg("æ°æ®æ¸
空失败!") |
| | | } |
| | | layer.close(ajaxLoad); |
| | | |
| | | //get_FastQuery(2); |
| | | |
| | | //æä»»å¡åä¼å
级 å¾ªç¯ |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | //è·åéå®çæäº§æ°é |
| | | var SDSum = 0; |
| | | if (HPlanDay > 0) { |
| | | for (var j = 22; j < (22 + HPlanDay); j++) { |
| | | SDSum += TableData[i][option.cols[0][j].field]; |
| | | } |
| | | } |
| | | |
| | | //æ¾å°æ¬ä»»å¡å å¯ç¨çäº§èµæº |
| | | lMainID = option.data[i]["HICMOInterID"]; |
| | | sICMOBillNo = option.data[i]["ç产订åå·"]; |
| | | dEndDate = Format(option.data[i]["æè¿å®å·¥æ¥æ"], 'yyyy/MM/dd'); |
| | | sProdTimes = option.data[i]["çäº§å¨æ"]; |
| | | sPlanQty = option.data[i]["订å坿æ°é"]; |
| | | lHGroupID = option.data[i]["HGroupID"]; |
| | | sGroupName = option.data[i]["HGroupName"]; |
| | | lMaterID = option.data[i]["HMaterID"]; |
| | | sMaterNumber = option.data[i]["ç©æä»£ç "]; |
| | | sMaterName = option.data[i]["ç©æåç§°"]; |
| | | sMaterModel = option.data[i]["è§æ ¼åå·"]; |
| | | sWorkQty = option.data[i]["å°æ¶äº§è½"]; |
| | | sYX = option.data[i]["ä¼å
级"]; |
| | | if (SDSum > 0) { |
| | | sPlanQty = sPlanQty - SDSum; |
| | | } |
| | | //å©ä½éæ±å·¥æ¶ |
| | | iLeftQty = sPlanQty; |
| | | if (sWorkQty <= 0) { |
| | | sLeftProdTimes = 0; |
| | | } |
| | | else { |
| | | sLeftProdTimes = iLeftQty / sWorkQty; |
| | | } |
| | | //è¥æ¬ä»»å¡åå·²æå®æèµæºï¼ä¸æ¬¡æç¨æè
æå·¥æç¨ï¼ åä¸å寻æ¾èµæºï¼ç´æ¥æç¨ |
| | | if (option.data[i]["HSourceID"] != 0 && option.data[i]["çäº§èµæº"] != "") { |
| | | //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | lSourceID = option.data[i]["HSourceID"]; |
| | | sSourceName = option.data[i]["çäº§èµæº"]; |
| | | sSourceNumber = option.data[i]["çäº§èµæºä»£ç "]; |
| | | //æ¥è¯¢çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSource2 " + lMaterID + ",'" + dEndDate + "'," + sProdTimes + "," + lSourceID; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | ds = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | else //没æèµæºå èªå¨æ¾å°èµæº |
| | | { |
| | | //æ¥è¯¢çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSource " + lMaterID + ",'" + dEndDate + "'," + sProdTimes; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | ds = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (ds == null || ds.length == 0) //没æå¯ä»¥æçèµæº |
| | | { |
| | | get_HFData(1, i); |
| | | //è·³å°ä¸ä¸å æ¬åçº¢è²æ¾ç¤º |
| | | $("tr[data-index='" + i + "']").attr({ "style": "background:red;color:black;" }); |
| | | continue; |
| | | } |
| | | else { |
| | | $("tr[data-index='" + i + "']").attr({ "style": "background:White;color:black;" }); |
| | | //å¼å§æå |
| | | bFind = false; |
| | | //è¶
交货æ ä»ç¶æç¨ |
| | | for (var j = 0; j < ds.length; j++) { |
| | | //å¤æèµæºå©ä½å·¥æ¶ï¼æ¯å¦å¤§äº çäº§å¨æ |
| | | if (parseFloat(ds[j]["å©ä½å·¥æ¶"]) > sLeftProdTimes) { |
| | | if (iLeftQty > 0) // ç产订åå©ä½æ°é |
| | | { |
| | | //卿¬èµæºä¸ç产 |
| | | //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | lSourceID = ds[j]["HitemID"]; |
| | | sSourceName = ds[j]["èµæºåç§°"]; |
| | | sSourceNumber = ds[j]["èµæºä»£ç "]; |
| | | option.data[i]["HSourceID"] = lSourceID; |
| | | option.data[i]["çäº§èµæº"] = sSourceName; |
| | | option.data[i]["çäº§èµæºä»£ç "] = sSourceNumber; |
| | | |
| | | var sql = "exec h_p_Sc_ICMOGetWorkSourceTime " + lSourceID; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | dsSub = data1.data |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | if (dsSub == null || dsSub.length == 0) { |
| | | get_HFData(1, i); |
| | | continue;//å¦ææ²¡æå©ä½å æ§è¡ä¸ä¸ä¸ªç产订å |
| | | } |
| | | if (dsSub != null)//ä¸å çæç¨ |
| | | { |
| | | iRow = i + 1; |
| | | //å°æ°æ®æå°ç½æ ¼ä¸ |
| | | SetInfoToGrid(option, dsSub, null, (iRow - 1), iLeftQty, sWorkQty, false, HPlanDay); |
| | | |
| | | set_AddNew1(option.data[i]); |
| | | } |
| | | bFind = true; |
| | | } |
| | | } else { |
| | | get_HFData(1, i); |
| | | } |
| | | } |
| | | //if (!bFind) { |
| | | // for (var j = 0; j < ds.length; j++) { |
| | | // //å¤æèµæºæå¤§å©ä½å·¥æ¶ï¼æ¯å¦å¤§äº çäº§å¨æ |
| | | // if (parseFloat(ds[j]["æå¤§å©ä½å·¥æ¶"]) > sLeftProdTimes) { |
| | | // if (iLeftQty > 0) { |
| | | |
| | | // //卿¬èµæºä¸ç产 |
| | | // grdMain.RowCount = grdMain.RowCount + 1; |
| | | // //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | // lSourceID = ds[j]["HitemID"]; |
| | | // sSourceName = ds[j]["èµæºåç§°"]; |
| | | // sSourceNumber = ds[j]["èµæºä»£ç "]; |
| | | // option.data[i]["HSourceID"] = lSourceID; |
| | | // option.data[i]["çäº§èµæº"] = sSourceName; |
| | | // option.data[i]["çäº§èµæºä»£ç "] = sSourceNumber; |
| | | |
| | | // var sql = "exec h_p_Sc_ICMOGetWorkSourceTime " + lSourceID; |
| | | // $.ajax({ |
| | | // url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | // type: "GET", |
| | | // async: false, |
| | | // data: { "sWhere": sql }, |
| | | // success: function (data1) { |
| | | // if (data1.count == 1) { |
| | | // dsSub = data1.data |
| | | // } else { |
| | | // layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | // } |
| | | // }, error: function () { |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | // }); |
| | | |
| | | // if (dsSub == null || dsSub.length == 0) { |
| | | // continue; |
| | | // } |
| | | // //if (dsSub != null)//å çæç¨ |
| | | // //{ |
| | | // // //å°æ°æ®æå°ç½æ ¼ä¸ |
| | | // // grdMain.RowCount = grdMain.RowCount + 1; // grdmain æ°å¢ä¸è¡ |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOBillNoCol].Value = sICMOBillNo; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOInterIDCol].Value = lMainID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecLeftQtyCol].Value = iLeftQty; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupIDCol].Value = lHGroupID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupNameCol].Value = sGroupName; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterIDCol].Value = lMaterID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNameCol].Value = sMaterName; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNumberCol].Value = sMaterNumber; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterModelCol].Value = sMaterModel; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanEndDateCol].Value = dEndDate; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanQtyCol].Value = sPlanQty; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceIDCol].Value = lSourceID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNameCol].Value = sSourceName; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNumberCol].Value = sSourceNumber; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecYXCol].Value = sYX; |
| | | // // Sc_ICMOSortBillFun.SetInfoToGrid(grdMain, dsSub, null, grdMain.RowCount - 1, ref iLeftQty, sWorkQty, true, oClsGridValues); |
| | | // //} |
| | | // } |
| | | // bFind = true; |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | //if (!bFind) { |
| | | // //å¦ææ²¡ææ¾å°åéèµæºåï¼ç´æ¥ææåä¸ä¸ªå©ä½æå¤§çèµæºã |
| | | // //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | // lSourceID = ds[ds.length - 1]["HitemID"]; |
| | | // sSourceName = ds[ds.length - 1]["èµæºåç§°"]; |
| | | // sSourceNumber = ds[ds.length - 1]["èµæºä»£ç "]; |
| | | // option.data[i]["HSourceID"] = lSourceID; |
| | | // option.data[i]["çäº§èµæº"] = sSourceName; |
| | | // option.data[i]["çäº§èµæºä»£ç "] = sSourceNumber; |
| | | |
| | | // //è·å该çäº§èµæºçå©ä½å·¥æ¶è¿è¡æç¨ã |
| | | // var sql = "exec h_p_Sc_ICMOGetWorkSourceTime " + lSourceID; |
| | | // $.ajax({ |
| | | // url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList', |
| | | // type: "GET", |
| | | // async: false, |
| | | // data: { "sWhere": sql }, |
| | | // success: function (data1) { |
| | | // if (data1.count == 1) { |
| | | // dsSub = data1.data |
| | | // } else { |
| | | // layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | // } |
| | | // }, error: function () { |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | // }); |
| | | |
| | | // if (dsSub == null || dsSub.length == 0) { |
| | | // continue; |
| | | // } |
| | | // //if (dsSub != null)//å çæç¨ |
| | | // //{ |
| | | // // //å°æ°æ®æå°ç½æ ¼ä¸ |
| | | // // grdMain.RowCount = grdMain.RowCount + 1; // grdmain æ°å¢ä¸è¡ |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOBillNoCol].Value = sICMOBillNo; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecICMOInterIDCol].Value = lMainID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecLeftQtyCol].Value = iLeftQty; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupIDCol].Value = lHGroupID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecGroupNameCol].Value = sGroupName; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterIDCol].Value = lMaterID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNameCol].Value = sMaterName; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterNumberCol].Value = sMaterNumber; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecMaterModelCol].Value = sMaterModel; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanEndDateCol].Value = dEndDate; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecPlanQtyCol].Value = sPlanQty; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceIDCol].Value = lSourceID; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNameCol].Value = sSourceName; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecSourceNumberCol].Value = sSourceNumber; |
| | | // // grdMain.Rows[grdMain.RowCount - 1].Cells[HSecYXCol].Value = sYX; |
| | | // // Sc_ICMOSortBillFun.SetInfoToGrid(grdMain, dsSub, null, grdMain.RowCount - 1, ref iLeftQty, sWorkQty, true, oClsGridValues); |
| | | // //} |
| | | //} |
| | | } |
| | | } |
| | | table.render(option); |
| | | } |
| | | var TableData = []; |
| | | function get_HFData(num,nums) { |
| | | if (num == 0) { |
| | | TableData = option.data; |
| | | } else { |
| | | option.data[nums] = TableData[nums]; |
| | | } |
| | | } |
| | | |
| | | //å°æ°æ®æç¨å°ç½æ ¼ |
| | |
| | | else { |
| | | for (var i = 0; i < ds.length; i++) { |
| | | //æ¾å°å¯¹åºçå |
| | | for (var j = 22; j < grd.cols[0].length; j++) { |
| | | for (var j = 22; j < 53; j++) { |
| | | if (sLeftQty > 0) { |
| | | if (ds[i]["æ¥æ"] == grd.cols[0][j].field) { |
| | | //妿æ¶é´è¢« ä¸éä½éå ç¨ å è·³è¿ |
| | |
| | | } |
| | | else { |
| | | if (sLeftQty > parseFloat(sWorkQty * ds[i]["å©ä½å·¥æ¶"])) { |
| | | grd.data[iRow][grd.cols[0][j + HPlanDay].field] = parseFloat(sWorkQty * ds[i]["å©ä½å·¥æ¶"]); |
| | | grd.data[iRow][grd.cols[0][j].field] = parseFloat(sWorkQty * ds[i]["å©ä½å·¥æ¶"]); |
| | | sLeftQty = sLeftQty - (parseFloat(sWorkQty * ds[i]["å©ä½å·¥æ¶"])); |
| | | //oSub = new ClsGridValues(); |
| | | //oSub.iRow = iRow; |
| | | //oSub.iCol = j; |
| | | option.data[iRow]["HLeftTimes"] = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | //option.data[iRow]["HLeftTimes"] = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | //option.data[iRow]["HUseTimes"] = ds[i]["å©ä½å·¥æ¶"]; |
| | | break; |
| | | //oSub.HLeftTimes = ds[i]["å©ä½å·¥æ¶"]; |
| | | //oClsGridValues.Add(oSub); |
| | | } |
| | | else { |
| | | grd.data[iRow][grd.cols[0][j + HPlanDay].field] = sLeftQty; |
| | | grd.data[iRow][grd.cols[0][j].field] = sLeftQty; |
| | | //option.data[iRow]["HUseTimes"] = parseFloat(sLeftQty / sWorkQty); |
| | | sLeftQty = 0; |
| | | //oSub = new ClsGridValues(); |
| | | //oSub.iRow = iRow; |
| | | //oSub.iCol = j; |
| | | option.data[iRow]["HLeftTimes"] = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | //option.data[iRow]["HLeftTimes"] = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | break; |
| | | //oSub.HLeftTimes = ds[i]["å©ä½å·¥æ¶"]; |
| | | //oClsGridValues.Add(oSub); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | var num = []; |
| | | for (var i = 0; i < table.cache["mainTable"].length; i++) { |
| | | if (table.cache["mainTable"][i] != "") { |
| | | if (parseFloat(table.cache["mainTable"][i]["订å坿æ°é"]) < parseFloat(table.cache["mainTable"][i]["æ¥è®¡åæ°éæ»é"]) + parseFloat(table.cache["mainTable"][i]["仿¥ä¹åæ¥è®¡åæ°é"])) { |
| | | return layer.msg("第" + (i + 1) + "è¡æäº§æ°éè¶
åºè®¢åæ°é!"); |
| | | } |
| | | table.cache["mainTable"][i].LAY_TABLE_INDEX = i; |
| | | num.push(table.cache["mainTable"][i]) |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | function set_AddNew1(num) { |
| | | |
| | | //var sMainStr = JSON.stringify(data.field); |
| | | var sSubStr = "["+JSON.stringify(num)+"]"; |
| | | var sMainSub = sSubStr + ";" + sessionStorage["HUserName"]; |
| | | |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + "/JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBill_btnSave", |
| | | async: false, |
| | | data: { "sMainSub": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { |
| | | layer.msg("ä¿åæå"); |
| | | layer.close(index); |
| | | } |
| | | else { |
| | | layer.close(index); |
| | | layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | }, |
| | | error: function (err) { |
| | | layer.close(index); |
| | | layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //è¡å
å¿«æ·é® |
| | | function set_GridCellCheck(obj) { |
| | | $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { |