| | |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnTLYS" id="btnTLYS">ææè¿ç®</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnICMOBill" id="btnICMOBill">ç产订åéå</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnReady" id="btnReady">åå¤</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnProPC" id="btnProPC">æäº§</button> |
| | | </div> |
| | | <div class="layui-collapse"> |
| | | <div class="layui-colla-item"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="test"></div> |
| | | <div id="HProgressBar"></div> |
| | | <table class="" id="mainTable" lay-filter="mainTable"></table> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | |
| | | } |
| | | }); |
| | | |
| | | for (var i = 0; i < table.cache["mainTable"].length; i++) { |
| | | if (table.cache["mainTable"][i]["ç产订åå·"] != obj.data["ç产订åå·"]) { |
| | | table.cache["mainTable"][i].LAY_CHECKED = false; |
| | | } |
| | | } |
| | | option.data = table.cache["mainTable"]; |
| | | table.render(option); |
| | | |
| | | |
| | | objData = obj; |
| | | }) |
| | |
| | | } else if (table.cache["mainTable"].length == 0) { |
| | | return layer.msg("æ æ°æ®,æ æ³ä¿å!"); |
| | | } else { |
| | | set_AddNew(data); |
| | | set_AddNew(); |
| | | } |
| | | }); |
| | | |
| | |
| | | get_btnReady(); |
| | | }) |
| | | |
| | | |
| | | //æäº§ |
| | | form.on('submit(btnProPC)', function (data) { |
| | | var HWorkShopID = $("#HWorkShopID").val();//çäº§è½¦é´ |
| | | if (HWorkShopID == 0) { |
| | | return layer.msg("ç产车é´ä¸è½ä¸ºç©º!"); |
| | | } else { |
| | | |
| | | layer.open({ |
| | | type: 1, // page å±ç±»å |
| | | area: ['500px', '300px'], |
| | | title: 'Hello layer', |
| | | shade: 0.6, // é®ç½©éæåº¦ |
| | | shadeClose: true, // ç¹å»é®ç½©åºåï¼å
³éå¼¹å± |
| | | maxmin: true, // å
许å
¨å±æå°å |
| | | anim: 0, // 0-6 çå¨ç»å½¢å¼ï¼-1 ä¸å¼å¯ |
| | | content: '<div style="padding: 32px;">ä¸ä¸ªæ®éç页é¢å±ï¼ä¼ å
¥äºèªå®ä¹ç HTML</div>' |
| | | }); |
| | | setTimeout(get_btnProPC(HWorkShopID), 3000); |
| | | layer.closeAll(); |
| | | } |
| | | |
| | | }) |
| | | |
| | | //è¡å
äºä»¶ |
| | | table.on('tool(mainTable)', function (obj) { |
| | |
| | | columns.push({ field: 'æåæ°é', title: 'æåæ°é', width: 150 });//0 |
| | | columns.push({ field: '订å坿æ°é', title: '订å坿æ°é', width: 150 }); |
| | | columns.push({ field: 'æªå
¥åºæ°é', title: 'æªå
¥åºæ°é', width: 150 });//0 |
| | | columns.push({ field: 'HICMOInterID', title: 'HICMOInterID', width: 150, hide:true }); |
| | | columns.push({ field: 'HGroupID', title: 'HGroupID', width: 150, hide:true }); |
| | | columns.push({ field: 'HGroupName', title: 'HGroupName', width: 150, hide:true }); |
| | | columns.push({ field: 'çäº§èµæºä»£ç ', title: 'çäº§èµæºä»£ç ', width: 150, hide:true }); |
| | | columns.push({ fixed: 'right', title: 'æä½', toolbar: '#barDemo' }); |
| | | |
| | | option = { |
| | |
| | | , cols: [columns] |
| | | , limit: Number.MAX_VALUE//é»è®¤æ¾ç¤ºå
¨é¨ |
| | | }; |
| | | |
| | | } |
| | | |
| | | //æ¥è¯¢å è½½æ°æ® |
| | |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | |
| | | data: { "sWhere": HinterID_S.toString(),"num":1 }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | for (var i = 0; i < 31; i++) { |
| | | option.cols[0][22 + i]["edit"] = "text"; |
| | | option.cols[0][22 + i]["style"] = ""; |
| | | var TableDate = option.cols[0][22 + i].field; |
| | | var date = new Date(TableDate).getDay(); |
| | | if (date == 6 || date == 0) { |
| | | option.cols[0][22 + i]["style"] = " background-color: #c3fec8"; |
| | | } |
| | | } |
| | | if (data1.data[0]["DayNum"] > 0) { |
| | | //è·å被éå®çåæ° |
| | | var tableNum = 0; |
| | |
| | | option.cols[0][22 + i]["style"] = " background-color: #e6e6e6"; |
| | | } |
| | | |
| | | } else { |
| | | for (var i = 0; i < 31; i++) { |
| | | option.cols[0][22 + i]["edit"] = "text"; |
| | | option.cols[0][22 + i]["style"] = ""; |
| | | } |
| | | } |
| | | //else { |
| | | // for (var i = 0; i < 31; i++) { |
| | | // option.cols[0][22 + i]["edit"] = "text"; |
| | | // option.cols[0][22 + i]["style"] = ""; |
| | | // } |
| | | //} |
| | | table.render(option); |
| | | layer.close(ajaxLoad); |
| | | //layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | |
| | | for (var i = 0; i < data.length; i++) { |
| | | HICOMNum.push(data[i]["HICMOInterID"] + ";" + data[i]["HICMOEntryID"]); |
| | | } |
| | | $('#test').html(` |
| | | $('#HProgressBar').html(` |
| | | <div class="layui-progress" lay-filter="demo-filter-progress"> |
| | | <div class="layui-progress-bar" lay-percent="40%"></div> |
| | | </div> |
| | |
| | | } |
| | | } |
| | | } |
| | | $('#test').html('') |
| | | $('#HProgressBar').html('') |
| | | |
| | | table.render(option); |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | //ä¸ç§» |
| | | function DownTable(data ,i) { |
| | | |
| | | |
| | | //æäº§ |
| | | function get_btnProPC(HWorkShopID) { |
| | | |
| | | var JDTLen = 0; |
| | | var lMainID = 0; |
| | | var sICMOBillNo = ""; |
| | | var dEndDate = ""; |
| | | var sProdTimes = 0; |
| | | var sPlanQty = 0; |
| | | var lHGroupID = 0; |
| | | var sGroupName = ""; |
| | | var lMaterID = 0; |
| | | var sMaterNumber = ""; |
| | | var sMaterName = ""; |
| | | var sMaterModel = ""; |
| | | var sWorkQty = 0; |
| | | var sYX = 0; |
| | | var iLeftQty = 0; |
| | | var sLeftProdTimes = 0; |
| | | var lSourceID = 0; |
| | | var iRow = 0; |
| | | var sSourceName = ""; |
| | | var sSourceNumber = ""; |
| | | var ds = []; |
| | | var dsSub = []; |
| | | var bFind = false; |
| | | var HPlanDay = 0; |
| | | 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++) { |
| | | HinterID_S.push(option.data[i]["hmainid"]); |
| | | } |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHinterIDList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": HinterID_S.toString(), "num": 1 }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | HPlanDay = data1.data[0].DayNum; |
| | | |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | //æ ¹æ®è½¦é´å 餿²¡æéå®çæ°æ® |
| | | 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', |
| | | 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 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | get_FastQuery(2); |
| | | |
| | | 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); |
| | | //} |
| | | } |
| | | } |
| | | } |
| | | table.render(option); |
| | | set_AddNew(); |
| | | } else { |
| | | layer.msg("æ°æ®æ¸
空失败!") |
| | | } |
| | | layer.close(ajaxLoad); |
| | | } |
| | | |
| | | //å°æ°æ®æç¨å°ç½æ ¼ |
| | | function SetInfoToGrid(grd, ds, dsPre, iRow, sLeftQty, sWorkQty, bAddFlag, HPlanDay) { |
| | | var b = false; |
| | | var oSub; |
| | | //循ç¯ç½æ ¼å |
| | | if (bAddFlag) { |
| | | for (var i = 0; i < ds.length; i++) { |
| | | //æ¾å°å¯¹åºçå |
| | | for (var j = 22; j < grd.cols[0].length; j++) { |
| | | if (sLeftQty > 0) { |
| | | if (ds[i]["æ¥æ"] == grd.cols[0][j].field) //è¡¨æ ¼çæ é¢ä¸ ä¿åäºæ¥æï¼ |
| | | { |
| | | //妿æ¶é´è¢« ä¸éä½éå ç¨ å è·³è¿ |
| | | b = false; |
| | | //if (dsPre != null && dsPre.Tables[0].Rows.Count > 0) { |
| | | // for (var m = 0; m < dsPre.Tables[0].Rows.Count; m++) |
| | | // { |
| | | // if (ds[i]["æ¥æ"] < DBUtility.ClsPub.isDate(dsPre.Tables[0].Rows[m]["æ¥æ"])) { |
| | | // b = true; |
| | | // } |
| | | // } |
| | | //} |
| | | if (b == false) { |
| | | if (dsPre != null && ds[i]["æ¥æ"] == dsPre[0]["æ¥æ"]) { |
| | | ////HUseTimes 为 ä¸éä½éå å©ä½å·¥æ¶ã |
| | | //if (ds[i]["æå¤§å©ä½å·¥æ¶"] > dsPre[0]["HUseTimes"]) { |
| | | // if (parseFloat(sLeftQty) > parseFloat(sWorkQty * dsPre[0]["HUseTimes"])) { |
| | | // grd.data[iRow][j] = parseFloat(sWorkQty * (dsPre[0]["HUseTimes"])); |
| | | // sLeftQty = sLeftQty - parseFloat(sWorkQty * (dsPre[0]["HUseTimes"])); |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre[0]["HUseTimes"]); |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | // else { |
| | | // grd.data[iRow][j]= sLeftQty; |
| | | // sLeftQty = 0; |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]); |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | //} |
| | | //else //ååä¸éè¦èèå çï¼ä¸é¢çè¿ä¸æ®µä¸éè¦ |
| | | //{ |
| | | // if (sLeftQty > sWorkQty * ds[i]["æå¤§å©ä½å·¥æ¶"]) { |
| | | // grd.data[iRow][j]= parseFloat(sWorkQty * ds[i]["æå¤§å©ä½å·¥æ¶"]); |
| | | // sLeftQty = sLeftQty - (parseFloat(sWorkQty * ds[i]["æå¤§å©ä½å·¥æ¶"])); |
| | | // sLeftQty = 0; |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | // else { |
| | | // grd.data[iRow][j]= sLeftQty; |
| | | // sLeftQty = 0; |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | //} |
| | | } |
| | | else { |
| | | if (sLeftQty > parseFloat(sWorkQty * ds[i]["æå¤§å©ä½å·¥æ¶"])) { |
| | | grd.data[iRow][grd.cols[0][j + HPlanDay].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]["æå¤§å©ä½å·¥æ¶"]; |
| | | break; |
| | | //oSub.HLeftTimes = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | //oClsGridValues.Add(oSub); |
| | | } |
| | | else { |
| | | grd.data[iRow][grd.cols[0][j + HPlanDay].field] = sLeftQty; |
| | | sLeftQty = 0; |
| | | //oSub = new ClsGridValues(); |
| | | //oSub.iRow = iRow; |
| | | //oSub.iCol = j; |
| | | option.data[iRow]["HLeftTimes"] = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | break; |
| | | //oSub.HLeftTimes = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | //oClsGridValues.Add(oSub); |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | else { |
| | | for (var i = 0; i < ds.length; i++) { |
| | | //æ¾å°å¯¹åºçå |
| | | for (var j = 22; j < grd.cols[0].length; j++) { |
| | | if (sLeftQty > 0) { |
| | | if (ds[i]["æ¥æ"] == grd.cols[0][j].field) { |
| | | //妿æ¶é´è¢« ä¸éä½éå ç¨ å è·³è¿ |
| | | b = false; |
| | | //if (dsPre != null && dsPre.Tables[0].Rows.Count > 0) { |
| | | // for (var m = 0; m < dsPre.Tables[0].Rows.Count; m++) |
| | | // { |
| | | // if (DBUtility.ClsPub.isDate(ds[i]["æ¥æ"]) < DBUtility.ClsPub.isDate(dsPre.Tables[0].Rows[m]["æ¥æ"])) { |
| | | // b = true; |
| | | // } |
| | | // } |
| | | //} |
| | | if (b == false) { |
| | | if (dsPre != null && s[i]["æ¥æ"] == dsPre[0]["æ¥æ"]) { |
| | | //if (ds[i]["å©ä½å·¥æ¶"] > (DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]))) { |
| | | // if (sLeftQty > parseFloat(sWorkQty * (DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"])))) { |
| | | // grd.data[iRow][j]= parseFloat(sWorkQty * (DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]))); |
| | | // sLeftQty = sLeftQty - parseFloat(sWorkQty * (DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]))); |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]); |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | // else { |
| | | // grd.data[iRow][j]= sLeftQty; |
| | | // sLeftQty = 0; |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]); |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | //} |
| | | //else { |
| | | // if (sLeftQty > sWorkQty * ds[i]["å©ä½å·¥æ¶"]) { |
| | | // grd.data[iRow][j]= parseFloat(sWorkQty * ds[i]["å©ä½å·¥æ¶"]); |
| | | // sLeftQty = sLeftQty - (parseFloat(sWorkQty * ds[i]["å©ä½å·¥æ¶"])); |
| | | // sLeftQty = 0; |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = ds[i]["å©ä½å·¥æ¶"]; |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | // else { |
| | | // grd.data[iRow][j]= sLeftQty; |
| | | // sLeftQty = 0; |
| | | // oSub = new ClsGridValues(); |
| | | // oSub.iRow = iRow; |
| | | // oSub.iCol = j; |
| | | // oSub.HLeftTimes = ds[i]["å©ä½å·¥æ¶"]; |
| | | // oClsGridValues.Add(oSub); |
| | | // } |
| | | //} |
| | | } |
| | | else { |
| | | if (sLeftQty > parseFloat(sWorkQty * ds[i]["å©ä½å·¥æ¶"])) { |
| | | grd.data[iRow][grd.cols[0][j + HPlanDay].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]["æå¤§å©ä½å·¥æ¶"]; |
| | | break; |
| | | //oSub.HLeftTimes = ds[i]["å©ä½å·¥æ¶"]; |
| | | //oClsGridValues.Add(oSub); |
| | | } |
| | | else { |
| | | grd.data[iRow][grd.cols[0][j + HPlanDay].field] = sLeftQty; |
| | | sLeftQty = 0; |
| | | //oSub = new ClsGridValues(); |
| | | //oSub.iRow = iRow; |
| | | //oSub.iCol = j; |
| | | option.data[iRow]["HLeftTimes"] = ds[i]["æå¤§å©ä½å·¥æ¶"]; |
| | | break; |
| | | //oSub.HLeftTimes = ds[i]["å©ä½å·¥æ¶"]; |
| | | //oClsGridValues.Add(oSub); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //æ¥è¯¢ç产订å |
| | |
| | | } |
| | | |
| | | //ä¿å |
| | | function set_AddNew(data) { |
| | | function set_AddNew() { |
| | | |
| | | //å é¤åè¡¨æ°æ® ä¼å ç¨æ°ç»çä½ç½®,éè¦éæ°æä¸ä¸é¡ºåº |
| | | var num = []; |
| | |
| | | } |
| | | //设置å
容åä½å¤§å° |
| | | if (data1.data[0].HFontSize != 0) { |
| | | option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; |
| | | option.cols[0][i + 1]["style"] += ";font-size:" + data1.data[0].HFontSize + "px;"; |
| | | } else { |
| | | option.cols[0][i + 1]["style"] = "font-size:100%"; |
| | | option.cols[0][i + 1]["style"] += ";font-size:100%"; |
| | | } |
| | | //设置å宽 |
| | | //if (data1.data[0].HColumnWidth != 0) { |