| | |
| | | <form class="layui-form" lay-filter="component-form-group" action=""> |
| | | <div class="layui-card-header"> |
| | | <div class="layui-btn-group"> |
| | | <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="set_AddNew" id="set_AddNew">æ°å¢</button> |
| | | <button type="button" id="set_SaveBill" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">ä¿å</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_CheckBill">å®¡æ ¸</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SelectMainBill">éæ´å</button> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">åæ®ç¼å·</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;"> |
| | | <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly> |
| | | <input type="hidden" name="HInterID" id="HInterID" value="0"> |
| | | </div> |
| | | </div> |
| | |
| | | <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float: left; width: 150px; "> |
| | | <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float: left; width: 150px; " readonly> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HMainSource" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | | </button> |
| | |
| | | |
| | | var allVal; |
| | | var HModName = "Cg_PayableBill"; |
| | | |
| | | var topScroll = 0;//è®°å½æ»å¨æ¡çä½ç½® |
| | | //è®°å½ç»ç»çå¼ |
| | | var HOrgIDBar = 0; |
| | | |
| | |
| | | Pub_Close(2); |
| | | } |
| | | }) |
| | | //#endregion |
| | | |
| | | //#region æ°å¢ |
| | | form.on('submit(set_AddNew)', function (data) { |
| | | const url = new URL(location.href); |
| | | location.href = url.origin + url.pathname; |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region å®¡æ ¸æé® |
| | |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty;//æ°é |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//éé¢ |
| | | rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//åä»· |
| | | //rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |
| | |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty; |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//éé¢ |
| | | rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |
| | |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty;//æ°é |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//éé¢ |
| | | rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |
| | |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty; |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//éé¢ |
| | | rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |
| | |
| | | , { field: 'HSeOrderBillNo', title: 'éå®è®¢åå·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 70 } |
| | | ]] |
| | | , done: function (res, curr, count) { |
| | | $(".layui-table-main").scrollTop(topScroll); |
| | | } |
| | | |
| | | } |
| | | optionEntry = { |
| | | elem: '#mainTableEntry' |
| | |
| | | if (option.cols[0][i]["field"] == "HQty") { |
| | | option.cols[0][i]["edit"] = false; |
| | | } |
| | | //if (option.cols[0][i]["field"] == "HMoney") { |
| | | // option.cols[0][i]["edit"] = false; |
| | | //} |
| | | |
| | | } |
| | | } |
| | |
| | | var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"]; //æ°é精度 |
| | | var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"]; //å价精度 |
| | | var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"]; //éé¢ç²¾åº¦ |
| | | topScroll = $('#mainTable').next('.layui-table-view').find('.layui-table-body').scrollTop();//è·åæ»å¨æ¡ä½ç½® |
| | | // åå
æ ¼ç¼è¾ä¹åçå¼ |
| | | var oldText = $(this).prev().text(); |
| | | var value = obj.value //å¾å°ä¿®æ¹åçå¼ |
| | |
| | | , HlineTotalBB: HlineTotalBB |
| | | , HMoneyBB: HMoneyBB |
| | | }); |
| | | //table.render(option); |
| | | table.render(option); |
| | | break; |
| | | case "HPrice": //åä»· |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | |
| | | , HlineTotalBB: HlineTotalBB |
| | | , HMoneyBB: HMoneyBB |
| | | }); |
| | | //table.render(option); |
| | | table.render(option); |
| | | break; |
| | | case "HTaxRate": //æ°é |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | |
| | | , HlineTotalBB: HlineTotalBB |
| | | , HMoneyBB: HMoneyBB |
| | | }); |
| | | //table.render(option); |
| | | table.render(option); |
| | | break; |
| | | case "HDiscountRate": //æ°é |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | |
| | | , HDiscountRate: HDiscountRate |
| | | , HRelTaxPrice: HRelTaxPrice |
| | | }); |
| | | //table.render(option); |
| | | table.render(option); |
| | | break; |
| | | case "HTaxPrice": //åä»· |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | |
| | | , HlineTotalBB: HlineTotalBB //æ´æ°HlineTotalBBåæ®µï¼å
¶å¼æ¥èªåéHlineTotalBB |
| | | , HMoneyBB: HMoneyBB |
| | | }); |
| | | //table.render(option); |
| | | table.render(option); |
| | | break; |
| | | case "HMoney": //éé¢ |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | | temp = value + ""; |
| | | if (!ref.test(temp) || temp == 0 ||obj.data.HQty == 0) { |
| | | if (!ref1.test(temp)) { |
| | | //æ¢å¤æ°æ®å°ç¼è¾å |
| | | obj.update({ |
| | | HMoney: oldText |
| | | }); |
| | | table.render(option); |
| | | layer.msg("é颿æ°é请è¾å
¥å¤§äº0çæ°å!"); |
| | | return; |
| | | } else if (temp * 1 == 0) { |
| | | //æ¢å¤æ°æ®å°ç¼è¾å |
| | | obj.update({ |
| | | HMoney: oldText |
| | |
| | | , HlineTotalBB: HlineTotalBB |
| | | , HMoneyBB: HMoneyBB |
| | | }); |
| | | //table.render(option); |
| | | table.render(option); |
| | | break; |
| | | default: |
| | | } |
| | |
| | | , "HInvoiceBillNo": data.å票ç¼å· |
| | | |
| | | , "HMaker": data.å¶å人 |
| | | , "HMakeDate": data.å¶åæ¥æ == null ? "" : Format(new Date(data.å¶åæ¥æ), "yyyy-MM-dd HH:mm:ss") |
| | | , "HMakeDate": data.å¶åæ¥æ == null ? "" : Format(new Date(data.å¶åæ¥æ), "yyyy-MM-dd hh:mm:ss") |
| | | , "HUpDater": data.ä¿®æ¹äºº |
| | | , "HUpDateDate": data.ä¿®æ¹æ¥æ == null ? "" : Format(new Date(data.ä¿®æ¹æ¥æ), "yyyy-MM-dd HH:mm:ss") |
| | | , "HUpDateDate": data.ä¿®æ¹æ¥æ == null ? "" : Format(new Date(data.ä¿®æ¹æ¥æ), "yyyy-MM-dd hh:mm:ss") |
| | | , "HChecker": data.å®¡æ ¸äºº |
| | | , "HCheckDate": data.å®¡æ ¸æ¥æ == null ? "" : Format(new Date(data.å®¡æ ¸æ¥æ), "yyyy-MM-dd HH:mm:ss") |
| | | , "HCheckDate": data.å®¡æ ¸æ¥æ == null ? "" : Format(new Date(data.å®¡æ ¸æ¥æ), "yyyy-MM-dd hh:mm:ss") |
| | | , "HCloseMan": data.å
³é人 |
| | | , "HCloseDate": data.å
³éæ¥æ == null ? "" : Format(new Date(data.å
³éæ¥æ), "yyyy-MM-dd HH:mm:ss") |
| | | , "HCloseDate": data.å
³éæ¥æ == null ? "" : Format(new Date(data.å
³éæ¥æ), "yyyy-MM-dd hh:mm:ss") |
| | | , "HDeleteMan": data.ä½åºäºº |
| | | , "HDeleteDate": data.ä½åºæ¥æ == null ? "" : Format(new Date(data.ä½åºæ¥æ), "yyyy-MM-dd HH:mm:ss") |
| | | , "HDeleteDate": data.ä½åºæ¥æ == null ? "" : Format(new Date(data.ä½åºæ¥æ), "yyyy-MM-dd hh:mm:ss") |
| | | }); |
| | | |
| | | if (data.HMainSourceBillType != "") { |
| | |
| | | $("#HUpDateDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); |
| | | } |
| | | var sMainStr = JSON.stringify(data.field); |
| | | debugger |
| | | //è·ååè¡¨æ°æ® |
| | | var num = []; |
| | | for (var i = 0; i < table.cache["mainTable"].length; i++) { |
| | |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty;//æ°é |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//éé¢ |
| | | rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |
| | |
| | | , "HEmpName": dataArray[0].ä¸å¡å |
| | | , "HSupID": dataArray[0].HSupID |
| | | , "HSupName": dataArray[0].ä¾åºå |
| | | //, "HCurID": dataArray[0].HCurID |
| | | //, "HCurName": dataArray[0].å¸å« |
| | | //, "HExRate": dataArray[0].æ±ç |
| | | , "HCurID": dataArray[0].HCurID |
| | | , "HCurName": dataArray[0].å¸å« |
| | | , "HExRate": dataArray[0].æ±ç |
| | | , "HSSID": "0" |
| | | , "HSSName": "" |
| | | , "HPSStyleID": dataArray[0].HPSStyleID |
| | |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty; |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HMoney += rowdataEntry[j].HMoney;//éé¢ |
| | | rowdataEntry[i].HPrice = rowdataEntry[i].HMoney / rowdataEntry[i].HQty;//åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |