采购入库单收料通知单,进行选单号,可以多选,保存前反写关联数量的存储过程
| | |
| | | <div class="layui-col-xs4 layui-inline"> |
| | | <label class="layui-form-label">éåå·</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="Box2" id="Box2" autocomplete="off"> |
| | | <input type="text" name="" id="" class="layui-input" value="" style="float:left;width:150px;"> |
| | | |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="XDHList" id="XDHList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | | </button> |
| | | </div> |
| | | <!--<label class="layui-form-label">éåå·</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="Box2" id="Box2" autocomplete="off"> |
| | | </div>--> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | var rowdata = [{ |
| | | "HMaterID": 0, "ç©æä»£ç ": "", "ç©æåç§°": "", "è§æ ¼åå·": "", "HUnitID": 0, "计éåä½": "", "HWHID": 0, "æ¶æä»åº": "", |
| | | "HSPID": 0, "æ¶æä»ä½": "", "HSecUnitID": 0, "è¾
å©åä½": "", "HQty": "0", "HRemark": "" |
| | | , "HPrice": "0", "HTaxPrice": "0", "HMoney": "0", "HDiscountRate": "0", "HTaxRate": "0", "HTaxMoney": "0" |
| | | , "HPrice": "0", "HTaxPrice": "0", "HMoney": "0", "HDiscountRate": "0", "HTaxRate": "0", "HTaxMoney": "0", |
| | | "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0 |
| | | }]; |
| | | |
| | | // åå§åç |
| | |
| | | //æ°å¢è¡è¡¨æ ¼æ°æ® |
| | | var NewRow = { |
| | | "HMaterID": 0, "ç©æä»£ç ": "", "ç©æåç§°": "", "è§æ ¼åå·": "", "HUnitID": 0, "计éåä½": "", "HWHID": 0, "æ¶æä»åº": "", |
| | | "HSPID": 0, "æ¶æä»ä½": "", "HSecUnitID": data.HSecUnitID, "è¾
å©åä½":data.è¾
å©åä½, "HQty": "0", "HRemark": "" |
| | | , "HPrice": "0", "HTaxPrice": "0", "HMoney": "0", "HDiscountRate": "0", "HTaxRate": "0", "HTaxMoney": "0" |
| | | "HSPID": 0, "æ¶æä»ä½": "", "HSecUnitID": data.HSecUnitID, "è¾
å©åä½": data.è¾
å©åä½, "HQty": "0", "HRemark": "" |
| | | , "HPrice": "0", "HTaxPrice": "0", "HMoney": "0", "HDiscountRate": "0", "HTaxRate": "0", "HTaxMoney": "0", |
| | | "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0, |
| | | }; |
| | | switch (obj.event) { |
| | | case 'btn-AddLine': |
| | |
| | | , HPrice: HPrice |
| | | , HMoney: HMoney |
| | | }); |
| | | /* table.render(option);*/ |
| | | /* table.render(option);*/ |
| | | break; |
| | | case "HPrice": //åä»· |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | |
| | | obj.update({ |
| | | HPrice: oldText |
| | | }); |
| | | /* table.render(option);*/ |
| | | /* table.render(option);*/ |
| | | |
| | | layer.msg("å价请è¾å
¥å¤§äº0çæ°å!"); |
| | | return; |
| | |
| | | |
| | | //æ°æ®æ ¡éªåæ ¼ï¼éç®è®°å½ |
| | | var HQty = obj.data.HQty * 1; //æ°é |
| | | var HPrice = value * 1; |
| | | var HPrice = value * 1; |
| | | var HMoney = HQty * HPrice; //éé¢=æ°é*åä»· |
| | | |
| | | |
| | |
| | | , cols: [[ //å表 |
| | | { type: 'checkbox', totalRowText: 'å计è¡' } |
| | | , { type: 'numbers', title: 'åºå·', width: 100, totalRow: true } |
| | | , { type: 'HSourceBillNo', title: 'æºåå·', width: 100, hide: true }//æºåå· |
| | | , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100, hide: true }//æºåç±»å |
| | | , { type: 'HSourceInterID', title: 'æºå主å
ç ', width: 100, hide: true }//æºå主å
ç |
| | | , { field: 'HSourceEntryID', title: 'æºååå
ç ', width: 100, hide: true }//æºååå
ç |
| | | , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ', width: 150, edit: 'text', event: "HMaterID" }//f7 |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, } |
| | |
| | | ]] |
| | | } |
| | | |
| | | option.data = rowdata; |
| | | option.data = []; |
| | | table.render(option); |
| | | } |
| | | |
| | |
| | | { |
| | | "HMaterID": data.HMaterID, "ç©æä»£ç ": data.ç©æä»£ç , "ç©æåç§°": data.ç©æåç§°, "è§æ ¼åå·": data.è§æ ¼åå·, "HUnitID": data.HUnitID, "计éåä½": data.计éåä½, "HWHID": data.HWHID, "æ¶æä»åº": data.æ¶æä»åº, |
| | | "HSPID": data.HSPID, "æ¶æä»ä½": data.ä»ä½åç§°, "HSecUnitID": data.HSecUnitID, "è¾
å©åä½": data.è¾
å©åä½, "HQty": data.æ°é, "HRemark": data.表ä½å¤æ³¨ |
| | | , "HPrice": data.åä»·, "HTaxPrice": data.å«ç¨åä»·, "HMoney": data.éé¢, "HDiscountRate": data.ææ£ç, "HTaxRate": data.ç¨ç, "HTaxMoney": data.ç¨é¢ |
| | | , "HPrice": data.åä»·, "HTaxPrice": data.å«ç¨åä»·, "HMoney": data.éé¢, "HDiscountRate": data.ææ£ç, "HTaxRate": data.ç¨ç, "HTaxMoney": data.ç¨é¢, |
| | | "HSourceBillNo": data.æºååå·, //æºåå· |
| | | "HSourceBillType": data.æºåç±»å, //æºåç±»å |
| | | "HSourceInterID": data.æºå主å
ç , //æºå主å
ç |
| | | "HSourceEntryID": data.æºååå
ç //æºååå
ç |
| | | } |
| | | ) |
| | | } |
| | |
| | | table.cache["mainTable"][i].LAY_TABLE_INDEX = i; |
| | | num.push(table.cache["mainTable"][i]) |
| | | } |
| | | } |
| | | |
| | | checkDuplicateData(num); |
| | | const duplicateRows = checkDuplicateData(num); |
| | | if (duplicateRows.length > 0) { |
| | | let message = 'è¡¨æ ¼ä¸åå¨é夿°æ®ï¼éå¤è¡æ°ä¸ºï¼'; |
| | | |
| | | for (let i = 0; i < duplicateRows.length; i++) { |
| | | const { row1, row2 } = duplicateRows[i]; |
| | | message += `第${row1}è¡ä¸ç¬¬${row2}è¡ç¸å`; |
| | | |
| | | if (i !== duplicateRows.length - 1) { |
| | | message += 'ï¼'; |
| | | } |
| | | } |
| | | |
| | | message += 'ï¼è¯·å é¤å
¶ä¸ä¸è¡'; |
| | | layer.alert(message); |
| | | } |
| | | |
| | | var sMainStr = JSON.stringify(data.field); |
| | |
| | | }) |
| | | } |
| | | |
| | | //表头信æ¯éæ©åæ®å¼¹çª |
| | | form.on('submit(XDHList)', function () { |
| | | |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2 |
| | | , skin: "layui-layer-rim" //å ä¸è¾¹æ¡ |
| | | , title: "éè´å
¥åºåå表" //æ é¢ |
| | | , closeBtn: 1 //çªä½å³ä¸è§å
³é ç æ ·å¼ |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["90%", "90%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: ["../../éè´ç®¡ç/éè´è®¢å/Cg_POOrderBillList.html", "yes"] |
| | | , btn: ["ç¡®å®", "åæ¶"] |
| | | , btn1: function (index, laero) { |
| | | //æé®ä¸ çåè° |
| | | var iframeWindow = window["layui-layer-iframe" + index];//è·åå¼¹æ¡é¡µé¢ |
| | | var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//è·åéä¸çæ°æ® |
| | | |
| | | if (checkStatus.data.length == 0) { |
| | | return layer.msg("请è³å°éæ©ä¸æ¡æ°æ®!"); |
| | | } |
| | | layer.alert("ä½ å·²éæ©" + checkStatus.data.length + "æ¡æ°æ®"); |
| | | //è·åæ¶æéç¥å代ç |
| | | var ProcessNumber = []; |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | ProcessNumber.push(checkStatus.data[i]); |
| | | } |
| | | |
| | | //è·åå½åä½ç½®æå¨è¡æ° |
| | | var NowNum = 0; |
| | | NowNum = option.data.length; |
| | | |
| | | var j = 0; |
| | | for (var i = 0; i < ProcessNumber.length; i++) { |
| | | option.data.push({ |
| | | "HMaterID": checkStatus.data[j].HMaterID, "ç©æä»£ç ": checkStatus.data[j].ç©æä»£ç , "ç©æåç§°": checkStatus.data[j].ç©æåç§°, "è§æ ¼åå·": checkStatus.data[j].è§æ ¼åå·, |
| | | "HUnitID": checkStatus.data[j].HUnitID, "计éåä½": checkStatus.data[j].计éåä½, |
| | | "HQty": checkStatus.data[j].æ°é, "HPrice": checkStatus.data[j].åä»·, |
| | | "HMoney": checkStatus.data[j].éé¢, "HTaxPrice": checkStatus.data[j].å«ç¨åä»·, "HTaxRate": checkStatus.data[j].ç¨ç, "HTaxMoney": checkStatus.data[j].ç¨é¢, |
| | | "HSourceBillNo": checkStatus.data[j].åæ®å·, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid, |
| | | }) |
| | | j++; |
| | | } |
| | | table.render(option); |
| | | layer.close(index);//å
³éå¼¹çª |
| | | } |
| | | |
| | | }); |
| | | }); |
| | | |
| | | //夿æéçä¸è¡¨æ ¼æ¯å¦æé夿°æ® |
| | | function checkDuplicateData(data) { |
| | | const duplicates = []; |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | const currentItem = data[i]; |
| | | let isDuplicate = false; |
| | | |
| | | for (let j = i + 1; j < data.length; j++) { |
| | | const compareItem = data[j]; |
| | | //主åid |
| | | if (currentItem.HSourceInterID === compareItem.HSourceInterID && currentItem.HSourceEntryID === compareItem.HSourceEntryID) { |
| | | isDuplicate = true; |
| | | duplicates.push({ row1: i + 1, row2: j + 1 }); // è®°å½é夿°æ®æå¨è¡æ° |
| | | } |
| | | } |
| | | if (isDuplicate && !duplicates.some(item => item.row1 === i + 1)) { |
| | | duplicates.push({ row1: i + 1, row2: -1 }); // è®°å½é夿°æ®æå¨è¡æ°ï¼-1 è¡¨ç¤ºæªæ¾å°ä¸å½åè¡éå¤çè¡ |
| | | } |
| | | } |
| | | return duplicates; |
| | | } |
| | | |
| | | |
| | | //#region æ ¹æ®ç©æIDè·åç©æè¯¦ç»ä¿¡æ¯ |
| | | function getMaterialByMaterID(HMaterID) { |
| | |
| | | //ç´æ¥æ§è¡å表çé å è½½æ°æ®å°ç½æ ¼ |
| | | get_FastQuery(1) |
| | | //æ¥è¯¢ |
| | | get_Display(sWhere); |
| | | //get_Display(sWhere); |
| | | //éèå¾éåæ®µ |
| | | DisPlay_HideColumn(); |
| | | |
| | |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | var InterID = data[0].hmainid.toString(); |
| | | var HInterID = data[0].hmainid.toString(); |
| | | var HsupId = data[0].hsubid; |
| | | var HQty = data[0].æ°é; |
| | | var HSourceInterID = data[0].æºå主å
ç ; |
| | | var HSourceEntryID = data[0].æºååå
ç ; |
| | | //é»è¾å 餿¹æ³ |
| | | layer.confirm("确认è¦å é¤åï¼å é¤åä¸è½æ¢å¤", { title: "å é¤ç¡®è®¤" }, function (index) { |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "Cg_POInStockBill/DeltetPOInStockBill", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | data: { "HInterID": InterID, "user": sessionStorage["HUserName"] }, |
| | | data: { "HInterID": HInterID, "HsupId": HsupId, "HQty": HQty, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "user": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | |
| | | if (HMangerID) { |
| | | sWhere += " and 主管 like '%" + HMangerID + "%'"; |
| | | } |
| | | sWhere += " and å
³é人 =''"; |
| | | get_Display(sWhere); |
| | | sWhere = "";//è°ç¨æ¥å£åæ¸
空sWhereç¼å |
| | | } |
| | |
| | | <div class="layui-col-xs4 layui-inline"> |
| | | <label class="layui-form-label">éåå·</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="Box2" id="Box2" autocomplete="off"> |
| | | <input type="text" name="" id="" class="layui-input" value="" style="float:left;width:150px;"> |
| | | |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="XDHList" id="XDHList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | | </button> |
| | | </div> |
| | | <!--<label class="layui-form-label">éåå·</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="Box2" id="Box2" autocomplete="off"> |
| | | </div>--> |
| | | </div> |
| | | <div class="layui-col-xs4 layui-inline"> |
| | | <label class="layui-form-label">è´è´£äºº</label> |
| | |
| | | <input type="text" class="layui-input" name="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-inline" > |
| | | <label class="layui-form-label" style="width: 85px;">å
³éæ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly> |
| | |
| | | "HMaterID": 0, "ç©æä»£ç ": "", "ç©æåç§°": "", "è§æ ¼åå·": "", "HAuxPropID": 0, "ç©æè¾
å©å±æ§": "", "HUnitID": 0, "计éåä½": "", "HQtyMust": "", "HQty": "", "HRemark": "", |
| | | "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "æ¶æä»åº": "", |
| | | "HSPID": 0, "ä»ä½åç§°": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0, |
| | | "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "" |
| | | "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "", |
| | | "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0, |
| | | }]; |
| | | // åå§åç |
| | | set_InitGrid(); |
| | |
| | | "HMaterID": 0, "ç©æä»£ç ": "", "ç©æåç§°": "", "è§æ ¼åå·": "", "HAuxPropID": 0, "ç©æè¾
å©å±æ§": "", "HUnitID": 0, "计éåä½": "", "HQtyMust": "", "HQty": "", "HRemark": "", |
| | | "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "æ¶æä»åº": "", |
| | | "HSPID": 0, "ä»ä½åç§°": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0, |
| | | "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "" |
| | | "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "", |
| | | "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0, |
| | | }; |
| | | switch (obj.event) { |
| | | case 'btn-AddLine': |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //å表 |
| | | |
| | | function set_InitGrid() { |
| | | option = { |
| | |
| | | , cols: [[ //å表 |
| | | { type: 'checkbox', totalRowText: 'å计è¡' } |
| | | , { type: 'numbers', title: 'åºå·', width: 100, totalRow: true } |
| | | , { type: 'HSourceBillNo', title: 'æºåå·', width: 100, hide: true }//æºåå· |
| | | , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100, hide: true }//æºåç±»å |
| | | , { type: 'HSourceInterID', title: 'æºå主å
ç ', width: 100, hide: true }//æºå主å
ç |
| | | , { field: 'HSourceEntryID', title: 'æºååå
ç ', width: 100, hide: true }//æºååå
ç |
| | | , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ', width: 150, edit: 'text', event: "HMaterID" }//f7 |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, } |
| | |
| | | ]] |
| | | } |
| | | |
| | | option.data = rowdata; |
| | | option.data = []; |
| | | table.render(option); |
| | | } |
| | | |
| | |
| | | , "HManagerID": data.HManagerID |
| | | , "HManagerName": data.è´è´£äºº |
| | | , "HExRate": data.æ±ç |
| | | , "Box2": "" |
| | | //, "Box2": "" |
| | | , "HRemark": data.è¡¨å¤´å¤æ³¨ |
| | | , "HMaker": data.å¶å人 |
| | | , "HChecker": data.å®¡æ ¸äºº |
| | |
| | | { |
| | | "HMaterID": subdata[i].HMaterID, "ç©æä»£ç ": subdata[i].ç©æä»£ç , "ç©æåç§°": subdata[i].ç©æåç§°, "è§æ ¼åå·": subdata[i].è§æ ¼åå·, "HAuxPropID": subdata[i].HAuxPropID, "ç©æè¾
å©å±æ§": subdata[i].ç©æè¾
å©å±æ§, "HUnitID": subdata[i].HUnitID, "计éåä½": subdata[i].计éåä½, |
| | | "HQtyMust": subdata[i].åºæ¶æ°é, "HQty": subdata[i].宿¶æ°é, "HRemark": subdata[i].表ä½å¤æ³¨, "HPrice": subdata[i].åä»·, "HMoney": subdata[i].éé¢, "HOrderPrice": subdata[i].éè´éé¢, "HWHID": subdata[i].HWHID, "æ¶æä»åº": subdata[i].æ¶æä»åº, "HSPID": subdata[i].HSPID, "ä»ä½åç§°": subdata[i].ä»ä½åç§°, |
| | | "HBatchNo": subdata[i].æ¹æ¬¡ |
| | | "HBatchNo": subdata[i].æ¹æ¬¡, |
| | | "HSourceBillNo": subdata[i].æºååå·, //æºåå· |
| | | "HSourceBillType": subdata[i].æºåç±»å, //æºåç±»å |
| | | "HSourceInterID": subdata[i].æºå主å
ç , //æºå主å
ç |
| | | "HSourceEntryID": subdata[i].æºååå
ç //æºååå
ç |
| | | } |
| | | ) |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | var num = []; |
| | | for (var i = 0; i < table.cache["mainTable"].length; i++) { |
| | | if (table.cache["mainTable"][i] != "") { |
| | |
| | | num.push(table.cache["mainTable"][i]) |
| | | } |
| | | } |
| | | |
| | | checkDuplicateData(num); |
| | | const duplicateRows = checkDuplicateData(num); |
| | | if (duplicateRows.length > 0) { |
| | | let message = 'è¡¨æ ¼ä¸åå¨é夿°æ®ï¼éå¤è¡æ°ä¸ºï¼'; |
| | | |
| | | for (let i = 0; i < duplicateRows.length; i++) { |
| | | const { row1, row2 } = duplicateRows[i]; |
| | | message += `第${row1}è¡ä¸ç¬¬${row2}è¡ç¸å`; |
| | | |
| | | if (i !== duplicateRows.length - 1) { |
| | | message += 'ï¼'; |
| | | } |
| | | } |
| | | |
| | | message += 'ï¼è¯·å é¤å
¶ä¸ä¸è¡'; |
| | | layer.alert(message); |
| | | } |
| | | |
| | | |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var sSubStr = JSON.stringify(num); |
| | |
| | | "HMaterID": 0, "ç©æä»£ç ": "", "ç©æåç§°": "", "è§æ ¼åå·": "", "HAuxPropID": 0, "ç©æè¾
å©å±æ§": "", "HUnitID": 0, "计éåä½": "", "HQtyMust": "", "HQty": "", "HRemark": "", |
| | | "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "æ¶æä»åº": "", |
| | | "HSPID": 0, "ä»ä½åç§°": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0, |
| | | "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "" |
| | | "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "", |
| | | "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0, |
| | | }; |
| | | |
| | | table.cache["mainTable"].push(NewRow); |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | //è¡å
äºä»¶ |
| | | table.on('tool(mainTable)', function (obj) { |
| | | set_GridDelete(obj); //è¡å
å é¤ |
| | | set_GridCellCheck(obj); //è¡å
å¿«æ·é®çé |
| | | |
| | | }); |
| | | //表头信æ¯éæ©åæ®å¼¹çª |
| | | form.on('submit(XDHList)', function () { |
| | | |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2 |
| | | , skin: "layui-layer-rim" //å ä¸è¾¹æ¡ |
| | | , title: "æ¶æéç¥åå表" //æ é¢ |
| | | , closeBtn: 1 //çªä½å³ä¸è§å
³é ç æ ·å¼ |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["90%", "90%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: ["../../éè´ç®¡ç/æ¶æéç¥å/Cg_POInStockBillList.html", "yes"] |
| | | , btn: ["ç¡®å®", "åæ¶"] |
| | | , btn1: function (index, laero) { |
| | | //æé®ä¸ çåè° |
| | | var iframeWindow = window["layui-layer-iframe" + index];//è·åå¼¹æ¡é¡µé¢ |
| | | var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//è·åéä¸çæ°æ® |
| | | |
| | | if (checkStatus.data.length == 0) { |
| | | return layer.msg("请è³å°éæ©ä¸æ¡æ°æ®!"); |
| | | } |
| | | layer.alert("ä½ å·²éæ©" + checkStatus.data.length + "æ¡æ°æ®"); |
| | | //è·åæ¶æéç¥å代ç |
| | | var ProcessNumber = []; |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | ProcessNumber.push(checkStatus.data[i]); |
| | | } |
| | | |
| | | //è·åå½åä½ç½®æå¨è¡æ° |
| | | var NowNum = 0; |
| | | NowNum = option.data.length; |
| | | |
| | | |
| | | var j = 0; |
| | | for (var i = 0; i < ProcessNumber.length; i++) { |
| | | option.data.push({ |
| | | "HMaterID": checkStatus.data[j].HMaterID, "ç©æä»£ç ": checkStatus.data[j].ç©æä»£ç , "ç©æåç§°": checkStatus.data[j].ç©æåç§°, "è§æ ¼åå·": checkStatus.data[j].è§æ ¼åå·, |
| | | "HAuxPropID": 0, "ç©æè¾
å©å±æ§": "", "HUnitID": checkStatus.data[j].HUnitID, "计éåä½": checkStatus.data[j].计éåä½, "HQtyMust": "", "HQty": checkStatus.data[j].æ°é, "HRemark": "", |
| | | "HPrice": checkStatus.data[j].åä»·, "HMoney": checkStatus.data[j].éé¢, "HOrderPrice": "0", "HWHID": checkStatus.data[j].HWHID, "æ¶æä»åº": checkStatus.data[j].æ¶æä»åº, |
| | | "HSPID": checkStatus.data[j].HSPID, "ä»ä½åç§°": checkStatus.data[j].ä»ä½åç§°, "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0, |
| | | "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "", |
| | | "HSourceBillNo": checkStatus.data[j].åæ®å·, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid, |
| | | }) |
| | | j++; |
| | | } |
| | | table.render(option); |
| | | layer.close(index);//å
³éå¼¹çª |
| | | } |
| | | |
| | | }); |
| | | }); |
| | | //夿æéçä¸è¡¨æ ¼æ¯å¦æé夿°æ® |
| | | function checkDuplicateData(data) { |
| | | const duplicates = []; |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | const currentItem = data[i]; |
| | | let isDuplicate = false; |
| | | |
| | | for (let j = i + 1; j < data.length; j++) { |
| | | const compareItem = data[j]; |
| | | |
| | | if (currentItem.HSourceInterID === compareItem.HSourceInterID && currentItem.HSourceEntryID === compareItem.HSourceEntryID) { |
| | | isDuplicate = true; |
| | | duplicates.push({ row1: i + 1, row2: j + 1 }); // è®°å½é夿°æ®æå¨è¡æ° |
| | | } |
| | | } |
| | | if (isDuplicate && !duplicates.some(item => item.row1 === i + 1)) { |
| | | duplicates.push({ row1: i + 1, row2: -1 }); // è®°å½é夿°æ®æå¨è¡æ°ï¼-1 è¡¨ç¤ºæªæ¾å°ä¸å½åè¡éå¤çè¡ |
| | | } |
| | | } |
| | | return duplicates; |
| | | } |
| | | //è¡å
å é¤ |
| | | function set_GridDelete(obj) { |
| | | var data = obj.data; |
| | |
| | | layer.msg('è¯·éæ©ä¸è¡æ°æ®å®¡æ ¸ï¼'); |
| | | } |
| | | } |
| | | //#endregion |
| | | //#endregionz |
| | | |
| | | //#region æ¡ç æç» |
| | | function get_BarCodeDetail() { |
| | |
| | | //if (HOrgID) { |
| | | // sWhere += " and HUSEORGID = '" + HOrgID + "'"; |
| | | //} |
| | | sWhere += " and å
³é人 =''"; |
| | | get_Display(sWhere); |
| | | sWhere = "";//è°ç¨æ¥å£åæ¸
空sWhereç¼å |
| | | } |
| | |
| | | get_Display(sWhere); |
| | | } |
| | | //#endregion |
| | | |
| | | //å é¤ |
| | | function set_DeleteBill() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | var InterID = data[0].hmainid.toString(); |
| | | var Hmainid = data[0].hmainid.toString(); |
| | | var HsupId = data[0].hsubid; |
| | | var HQty = data[0].宿¶æ°é; |
| | | var HSourceInterID = data[0].æºå主å
ç ; |
| | | var HSourceEntryID = data[0].æºååå
ç ; |
| | | //é»è¾å 餿¹æ³ |
| | | layer.confirm("确认è¦å é¤åï¼å é¤åä¸è½æ¢å¤", { title: "å é¤ç¡®è®¤" }, function (index) { |
| | | var wait = layer.load(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Kf_POStockInBill/DeltetKf_POStockInBill", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | data: { "HInterID": InterID }, |
| | | data: { "Hmainid": Hmainid, "HsupId": HsupId, "HQty": HQty, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "user": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () { |