| | |
| | | <script src="../../../layuiadmin/PubCustom.js"></script> |
| | | <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> |
| | | <style type="text/css"> |
| | | .layui-form-item .layui-inline { |
| | | /*.layui-form-item .layui-inline { |
| | | margin-right: 0; |
| | | } |
| | | |
| | |
| | | margin-top: -10px; |
| | | margin-left: -15px; |
| | | margin-right: -15px; |
| | | } |
| | | }*/ |
| | | </style> |
| | | </head> |
| | | <body> |
| | |
| | | <div class="layui-form-item" style="padding-top: 10px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">åæ®ç¼å·</label> |
| | | <label class="layui-form-label">åæ®ç¼å·<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <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> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">æ¥æ</label> |
| | | <label class="layui-form-label">æ¥æ<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;"> |
| | | </div> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éå®é¨é¨</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly> |
| | | <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éå®å</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HEmpName" id="HEmpName" " class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HEmpName" id="HEmpName" " class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly> |
| | | <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | |
| | | </div> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éå®å¸å«</label> |
| | | <label class="layui-form-label">éå®å¸å«<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HCurName" id="HCurName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HCurName" id="HCurName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;"> |
| | | <input type="hidden" name="HCurID" id="HCurID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HCurList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">æ±ç</label> |
| | | <label class="layui-form-label">æ±ç<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0" readonly> |
| | | <input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0" style="background-color: #efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:900px;"> |
| | | <label class="layui-form-label">客æ·</label> |
| | | <label class="layui-form-label">客æ·<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline" style="width:700px;"> |
| | | <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float:left;width:465px;"> |
| | | <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float: left; width: 465px; background-color: #efefef4d;" readonly> |
| | | <input type="hidden" name="HCusID" id="HCusID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HCusList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | |
| | | </div> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">ç»ç®æ¹å¼</label> |
| | | <label class="layui-form-label">ç»ç®æ¹å¼<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HSSName" id="HSSName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HSSName" id="HSSName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly> |
| | | <input type="hidden" name="HSSID" id="HSSID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HSSList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">é宿¹å¼</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HSellSName" id="HSellSName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HSellSName" id="HSellSName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly> |
| | | <input type="hidden" name="HSellSID" id="HSellSID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HSellSList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éå®ä¸»ç®¡</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly> |
| | | <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">å
é¨è®¢åå·</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" autocomplete="off" readonly> |
| | | <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" style="background-color: #efefef4d;" autocomplete="off" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | case "HTaxRate": //æ°é |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | | temp = value + ""; |
| | | if (!ref.test(temp) || temp == 0) { |
| | | if (!ref.test(temp)) { |
| | | //æ¢å¤æ°æ®å°ç¼è¾å |
| | | obj.update({ |
| | | HTaxRate: oldText |
| | | }); |
| | | table.render(option); |
| | | |
| | | layer.msg("ç¨ç请è¾å
¥å¤§äº0çæ°å!"); |
| | | layer.msg("ç¨ç请è¾å
¥ä¸å°äº0çæ°å!"); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region æ ¹æ®è´¦å·è·åé¨é¨ãèåã主管 |
| | | function getCzyglByUser() { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Xs_SeOrderBill/getCzyglByUser", |
| | | async: false, |
| | | type: "GET", |
| | | data: { |
| | | "CurUserName": sessionStorage["HUserName"] |
| | | }, |
| | | success: function (result) { |
| | | if (result.code == 1) { // 说æéªè¯æåäºï¼ |
| | | var data = result.data[0]; |
| | | |
| | | $("#HEmpID").val(data.HEmpID); |
| | | $("#HEmpName").val(data.HEmpName); |
| | | $("#HDeptID").val(data.HDeptID); |
| | | $("#HDeptName").val(data.HDeptName); |
| | | $("#HManagerID").val(data.HManagerID); |
| | | $("#HManagerName").val(data.HManagerName); |
| | | |
| | | |
| | | } else { |
| | | layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("åçé误!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | //#region çæåæ®å· |
| | | function createBillNo() { |
| | | $.ajax({ |
| | |
| | | , height: 500 |
| | | , loading: false |
| | | , cols: [[ //å表 |
| | | { type: 'checkbox', totalRowText: 'å计è¡' } |
| | | , { type: 'numbers', title: 'åºå·', width: 100, totalRow: true } |
| | | , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true } |
| | | { type: 'checkbox', totalRowText: 'å计è¡', style: 'background-color:#efefef4d;' } |
| | | , { type: 'numbers', title: 'åºå·', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ', width: 150, edit: 'text', event: "HMaterID" }//f7 |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', width: 100, } |
| | | , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true } |
| | | , { field: '计éåä½', title: '计éåä½', width: 100 }//f7 |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, style: 'background-color:#efefef4d;' } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: '计éåä½', title: '计éåä½', width: 100, style: 'background-color:#efefef4d;' }//f7 |
| | | , { field: 'HQty', title: 'æ°é', width: 100, edit: 'text' } |
| | | , { field: 'HPrice', title: 'åä»·', width: 100, edit: 'text' } |
| | | , { field: 'HTaxRate', title: 'ç¨ç', width: 100, edit: 'text' } |
| | | , { field: 'HTaxPrice', title: 'å«ç¨åä»·', width: 100 } |
| | | , { field: 'HMoney', title: 'éé¢', width: 100 } |
| | | , { field: 'HlineTotal', title: 'ä»·ç¨å计', width: 100, } |
| | | , { field: 'HTaxPrice', title: 'å«ç¨åä»·', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HMoney', title: 'éé¢', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HlineTotal', title: 'ä»·ç¨å计', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HDate', title: 'äº¤è´§æ¥æ', event: "HDate", width: 120 } |
| | | , { field: 'HRemark', title: '夿³¨', width: 100, edit: 'text' } |
| | | |
| | |
| | | $("#HSSDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | |
| | | //éå®åãéå®é¨é¨ãéå®ä¸»ç®¡åå§å |
| | | getCzyglByUser(); |
| | | |
| | | //åå§åå¹¶å设置ï¼å表1 |
| | | set_InitGrid(); |
| | |
| | | return false; |
| | | } |
| | | |
| | | if ($("#HDeptID").val() == "0") { |
| | | layer.msg("éå®é¨é¨æªéæ©!"); |
| | | return false; |
| | | } |
| | | //if ($("#HDeptID").val() == "0") { |
| | | // layer.msg("éå®é¨é¨æªéæ©!"); |
| | | // return false; |
| | | //} |
| | | |
| | | if ($("#HEmpID").val() == "0") { |
| | | layer.msg("éå®åæªéæ©!"); |
| | | return false; |
| | | } |
| | | //if ($("#HEmpID").val() == "0") { |
| | | // layer.msg("éå®åæªéæ©!"); |
| | | // return false; |
| | | //} |
| | | |
| | | if ($("#HCurID").val() == "0") { |
| | | layer.msg("éå®å¸å«æªéæ©!"); |
| | |
| | | return false; |
| | | } |
| | | |
| | | if ($("#HSellSID").val() == "0") { |
| | | layer.msg("é宿¹å¼æªéæ©!"); |
| | | return false; |
| | | } |
| | | //if ($("#HSellSID").val() == "0") { |
| | | // layer.msg("é宿¹å¼æªéæ©!"); |
| | | // return false; |
| | | //} |
| | | |
| | | if ($("#HMangerID").val() == "0") { |
| | | layer.msg("éå®ä¸»ç®¡æªéæ©!"); |
| | | return false; |
| | | } |
| | | //if ($("#HMangerID").val() == "0") { |
| | | // layer.msg("éå®ä¸»ç®¡æªéæ©!"); |
| | | // return false; |
| | | //} |
| | | |
| | | |
| | | |
| | |
| | | |
| | | //ç¨çæ ¼å¼æ ¡éª |
| | | temp = option.data[i]["HTaxRate"] + ""; |
| | | if (temp == "0") { |
| | | layer.msg("第" + i + "è¡ï¼ç¨çä¸è½ä¸º0ï¼"); |
| | | return false; |
| | | } else if (!ref.test(temp)) { |
| | | layer.msg("第" + i + "è¡ï¼ç¨ç请è¾å
¥å¤§äº0çæ°åï¼"); |
| | | if (!ref.test(temp)) { |
| | | layer.msg("第" + i + "è¡ï¼ç¨ç请è¾å
¥ä¸å°äº0çæ°åï¼"); |
| | | return false; |
| | | } |
| | | |
| | |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["90%", "90%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: ['../../Baseset/åºç¡èµæ/Gy_MaterialList.html', 'yes'] |
| | | , content: ['../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/Gy_Material.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 != 1) { |
| | | return layer.msg("è¯·éæ©ä¸æ¡æ°æ®"); |
| | | } |
| | | //if (checkStatus.data.length != 1) { |
| | | // return layer.msg("è¯·éæ©ä¸æ¡æ°æ®"); |
| | | //} |
| | | |
| | | //æ´æ°è¡¨æ ¼ç¼åçæ°æ® |
| | | obj.update({ |
| | | "HMaterID": checkStatus.data[0].HItemID |
| | | , "ç©æä»£ç ": checkStatus.data[0].HNumber |
| | | , "ç©æåç§°": checkStatus.data[0].HName |
| | | , "è§æ ¼åå·": checkStatus.data[0].HModel |
| | | , "HUnitID": checkStatus.data[0].HUnitID |
| | | , "计éåä½": checkStatus.data[0].HUnitName |
| | | }) |
| | | var rowIndex = $(obj.tr).attr("data-index") * 1; |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | if (rowIndex + i >= option.data.length) { |
| | | var NewRow = { |
| | | "HMaterID": "0", "ç©æä»£ç ": "", "ç©æåç§°": "", "è§æ ¼åå·": "", "HUnitID": "0", "计éåä½": "", "HQty": "0", "HPrice": "0", "HTaxPrice": "0" |
| | | , "HMoney": "0", "HDiscountRate": "0", "HRelTaxPrice": "0", "HTaxRate": "0", "HTaxMoney": "0", "HlineTotal": "0", "HlineTotalBB": "0" |
| | | , "HDate": Format(new Date(), 'yyyy-MM-dd'), "HOutStockQty": "0", "HInvoiceQty": "0", "HRemark": "" |
| | | } |
| | | btnAddLine(NewRow); |
| | | } |
| | | |
| | | //è·åéä¸çç©æä¿¡æ¯ |
| | | var resultData = checkStatus.data[i]; |
| | | |
| | | //æ°å¼æ ¼å¼æ ¡éªå·¥å
· |
| | | var ref = /^\d+(\.\d+)?$/; //éè´æ°æ£åè¡¨è¾¾å¼ |
| | | var temp = ""; |
| | | //è·åéæ©ç©æååçç¨ç |
| | | var value = subHTaxRate; //éæ©ç©æåæ ¹æ®å®¢æ·å¾å°çç¨ç |
| | | var oldText = option.data[rowIndex + i].HTaxRate; //该记å½ä¸åæçç¨ç |
| | | |
| | | //ç¨çæ°æ®æ ¼å¼æ ¡éªï¼è¥æ ¹æ®å®¢æ·è·åçç¨çä¸åæ³ï¼å使ç¨è®°å½ä¸åæçç¨çï¼å¹¶æç¤º |
| | | temp = value + ""; |
| | | if (!ref.test(temp)) { |
| | | value = oldText; |
| | | layer.msg("è·åå°çç¨çä¸åæ³ï¼å·²èªå¨åæ´ä¸ºåæç¨ç!"); |
| | | } |
| | | |
| | | //æ°æ®æ ¡éªåæ ¼ï¼éç®è®°å½ |
| | | var HQty = option.data[rowIndex + i].HQty; //æ°é |
| | | var HPrice = option.data[rowIndex + i].HPrice; //åä»· |
| | | var HTaxRate = value * 0.01; //ç¨ç |
| | | /*var HDiscountRate = obj.data.HDiscountRate * 1; //ææ£ç*/ |
| | | var HTaxPrice = HPrice * (1 + HTaxRate); //å«ç¨åä»·=åä»·*(1+ç¨ç) |
| | | /*var HRelTaxPrice = HTaxPrice * HDiscountRate; //å®é
å«ç¨åä»·=å«ç¨åä»·*ææ£ç*/ |
| | | //ææ£é¢ = å«ç¨åä»· * (1 - ææ£ç) * æ°é |
| | | var HMoney = HQty * HPrice; //éé¢=æ°é*åä»· |
| | | var HTaxMoney = HMoney * HTaxRate; //ç¨é¢=éé¢*ç¨ç |
| | | var HlineTotal = HMoney + HTaxMoney; //ä»·ç¨å计=éé¢+ç¨é¢ |
| | | |
| | | |
| | | option.data[rowIndex + i].HMaterID = resultData.HMaterID; |
| | | option.data[rowIndex + i].ç©æä»£ç = resultData.ç©æä»£ç ; |
| | | option.data[rowIndex + i].ç©æåç§° = resultData.ç©æåç§°; |
| | | option.data[rowIndex + i].è§æ ¼åå· = resultData.è§æ ¼åå·; |
| | | option.data[rowIndex + i].HUnitID = resultData.HUnitID; |
| | | option.data[rowIndex + i].计éåä½ = resultData.计éåä½åç§°; |
| | | |
| | | option.data[rowIndex + i].HQty = HQty; |
| | | option.data[rowIndex + i].HPrice = HPrice; |
| | | option.data[rowIndex + i].HTaxRate = HTaxRate * 100; |
| | | option.data[rowIndex + i].HTaxPrice = HTaxPrice; |
| | | option.data[rowIndex + i].HMoney = HMoney; |
| | | option.data[rowIndex + i].HlineTotal = HlineTotal; |
| | | |
| | | |
| | | } |
| | | table.render(option); |
| | | |
| | | layer.close(index);//å
³éå¼¹çª |
| | | } |
| | | }) |
| | |
| | | |
| | | //以䏿¯layui模å |
| | | }); |
| | | //å表ç¨çï¼æ ¹æ®å®¢æ·å¸¦åº |
| | | var subHTaxRate = 0; |
| | | |
| | | // åºç¡èµæè¿åæ°æ® |
| | | function GetHEmpValue(obj) //è¿åä¸å¡å |
| | | { |
| | |
| | | $("#HSSID").val(data.HSSID); |
| | | $("#HSSName").val(data.HSSName); |
| | | |
| | | subHTaxRate = data.HTaxRate; |
| | | |
| | | } else { |
| | | layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |