| | |
| | | <div class="layui-card-header"> |
| | | <div class="layui-btn-group"> |
| | | <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SaveBill">ä¿å</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="btn-print">æå°</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">éåº</button> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <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 class="layui-input-block"> |
| | | <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="width:190px;"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">è系人</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HLinkMan" id="HLinkMan" autocomplete="off" value="" > |
| | | <input class="layui-input" name="HLinkMan" id="HLinkMan" autocomplete="off" value=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">客æ·ä½é¢</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HCusBalance" id="HCusBalance" autocomplete="off" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">ä¿¡ç¨é¢åº¦</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HCreditRating_Now" id="HCreditRating_Now" autocomplete="off" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">å¯ç¨é¢åº¦</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HAvailableBalance" id="HAvailableBalance" autocomplete="off" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row" style="margin-top:10px;"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ç»ç»<label style="color:red"> * </label></label> |
| | |
| | | <select name="HOrgID" id="HOrgID" lay-verify="HOrgID"> |
| | | <!--å¨ææ¸²æç»ç»--> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">客æ·ä½é¢</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="" id="" autocomplete="off" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">客æ·ä¿¡ç¨é¢åº¦</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HCreditRating_Now" id="HCreditRating_Now" autocomplete="off" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | //#endregion |
| | | |
| | | //#region å¤æå¹¶è®¾ç½®æä½ç±»åã页é¢åå§å |
| | | if (OperationType == null || OperationType == 1) { //æ°å¢ |
| | | if (OperationType == null || OperationType == 1) { //æ°å¢ |
| | | //æ°å¢é¡µé¢åå§å |
| | | Init_setAdd(); |
| | | } |
| | | else if (OperationType == 3) { //ç¼è¾ |
| | | else if (OperationType == 2) { //å¤å¶ |
| | | //å表åå§å |
| | | set_InitGrid(); |
| | | //å 载表ä½åè¡¨ä½æ°æ® |
| | | RoadBillMain(linterid); |
| | | |
| | | //çæå¹¶è®¾ç½®ä¸»è¡¨çå
ç ååæ®å· |
| | | createBillNo(); |
| | | |
| | | //ç¸å
³ææ¬æ¡ä¿¡æ¯åå§å |
| | | $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | $("#HSSDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | |
| | | } |
| | | else if (OperationType == 3) { //ç¼è¾ |
| | | $("#HInterID").val(linterid); |
| | | //å表åå§å |
| | | set_InitGrid(); |
| | |
| | | |
| | | //#region åå§åç»ç» |
| | | Organ(); |
| | | //#endregion |
| | | |
| | | //#region 页é¢åå§ååï¼æ ¹æ®å®¢æ·è·å客æ·ä½é¢ |
| | | getCustomerBalance( $("#HCusID").val() ); |
| | | //#endregion |
| | | |
| | | //#region å设置ï¼å表1 |
| | |
| | | if (AllowLoadData(data)) { |
| | | set_SaveBill(data); |
| | | } |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region å®¡æ ¸æé® |
| | | form.on('submit(set_CheckBill)', function (data) { |
| | | set_CheckBill(0); |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region æå°æé® |
| | | form.on('submit(btn-print)', function (data) { |
| | | get_PrintReport(); |
| | | }); |
| | | //#endregion |
| | | |
| | |
| | | }); |
| | | table.render(option); |
| | | break; |
| | | case "HTaxPrice": //æ°é |
| | | //æ°æ®æ ¼å¼æ ¡éª |
| | | temp = value + ""; |
| | | if (!ref.test(temp)) { |
| | | //æ¢å¤æ°æ®å°ç¼è¾å |
| | | obj.update({ |
| | | HTaxPrice: oldText |
| | | }); |
| | | table.render(option); |
| | | |
| | | layer.msg("å«ç¨åæ®è¯·è¾å
¥ä¸å°äº0çæ°å!"); |
| | | return; |
| | | } |
| | | //æ°æ®æ ¡éªåæ ¼ï¼éç®è®°å½ |
| | | var HQty = obj.data.HQty * 1; //æ°é |
| | | var HTaxRate = obj.data.HTaxRate * 0.01; //ç¨ç |
| | | var HTaxPrice = value * 1; //å«ç¨åä»·=åä»·*(1+ç¨ç) |
| | | var HPrice = HTaxPrice / (1 + HTaxRate); //åä»·=å«ç¨åæ®/(1+ç¨ç) |
| | | |
| | | /*var HDiscountRate = obj.data.HDiscountRate * 1; //ææ£ç*/ |
| | | |
| | | /*var HRelTaxPrice = HTaxPrice * HDiscountRate; //å®é
å«ç¨åä»·=å«ç¨åä»·*ææ£ç*/ |
| | | //ææ£é¢ = å«ç¨åä»· * (1 - ææ£ç) * æ°é |
| | | var HMoney = HQty * HPrice; //éé¢=æ°é*åä»· |
| | | var HTaxMoney = HMoney * HTaxRate; //ç¨é¢=éé¢*ç¨ç |
| | | var HlineTotal = HMoney + HTaxMoney; //ä»·ç¨å计=éé¢+ç¨é¢ |
| | | |
| | | |
| | | |
| | | //åæ¥æ´æ°è¡¨æ ¼åç¼å对åºçå¼ |
| | | obj.update({ |
| | | HQty: HQty |
| | | , HPrice: HPrice |
| | | , HTaxRate: HTaxRate * 100 |
| | | , HTaxPrice: HTaxPrice |
| | | , HMoney: HMoney |
| | | , HlineTotal: HlineTotal |
| | | }); |
| | | table.render(option); |
| | | break; |
| | | default: |
| | | } |
| | | }); |
| | |
| | | , { 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, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HTaxPrice', title: 'å«ç¨åä»·', width: 100, edit: 'text' } |
| | | , { 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 } |
| | |
| | | |
| | | //ç»ç»çå¼HOrgIDååï¼éæ°æ¸²æ |
| | | HOrgIDBar = data.HOrgID; |
| | | //è·åç¨ç(ç¨äºå表ç¨ççé»è®¤å¼) |
| | | getHTaxRateByCusID(data.HCusID); |
| | | |
| | | //å表 èµå¼ |
| | | var rowdata = []; |
| | |
| | | return layer.msg('è¯·éæ©æ°æ®'); |
| | | } |
| | | getCustomerByCusID(checkStatus.data[0].HItemID); |
| | | //æ ¹æ®å®¢æ·è·å客æ·ä½é¢ |
| | | getCustomerBalance(checkStatus.data[0].HItemID); |
| | | |
| | | layer.close(index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { } |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region åå®¡æ ¸/å®¡æ ¸æ°æ® |
| | | function set_CheckBill(num) { |
| | | var InterID = $("#HInterID").val(); |
| | | //é»è¾å®¡æ ¸æ¹æ³ |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Xs_SeOrderBill/AuditXs_SeOrderBill", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | | // å¾å°frameç´¢å¼ |
| | | var index = layer.getFrameIndex(window.name); |
| | | //å
³éå½åframe |
| | | layer.close(index); |
| | | }); |
| | | |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | |
| | | //#region æå° |
| | | function get_PrintReport() { |
| | | var InterID = $("#HInterID").val(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Xs_SeOrderBill/CheckSeOrderBill_IsExist", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | data: { "HInterID": InterID}, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['50%', '50%'] |
| | | , title: 'æå°æ¨¡çéæ©' |
| | | , shade: 0.6 //é®ç½©éæåº¦ |
| | | , maxmin: false //å
许å
¨å±æå°å |
| | | , anim: 0 //0-6çå¨ç»å½¢å¼ï¼-1ä¸å¼å¯ |
| | | , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + InterID + '&MyMsg=' + InterID + '&Type=Xs_SeOrderBill', 'yes'] |
| | | , resize: false |
| | | }) |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | //#endregion |
| | | |
| | | |
| | |
| | | { |
| | | //$("#HCusName").val(obj[0].HName); |
| | | //$("#HCusID").val(obj[0].HItemID); |
| | | //æ ¹æ®å®¢æ·è·åç¸å
³ä¿¡æ¯ |
| | | getCustomerByCusID(obj[0].HItemID); |
| | | //æ ¹æ®å®¢æ·è·å客æ·ä½é¢ |
| | | getCustomerBalance(obj[0].HItemID); |
| | | } |
| | | |
| | | function GetHManagerValue(obj) //è¿å主管 |
| | |
| | | $("#HDeptID").val(obj[0].HItemID); |
| | | } |
| | | |
| | | //#region æ ¹æ®å®¢æ·è·åå¸å«ãæ±çãç»ç®æ¹å¼ |
| | | function GetSettleStyleValue(obj) //è¿åç»ç®æ¹å¼ |
| | | { |
| | | $("#HSSName").val(obj[0].HName); |
| | | $("#HSSID").val(obj[0].HItemID); |
| | | } |
| | | |
| | | function GetSellStyleValue(obj) //è¿åé宿¹å¼ |
| | | { |
| | | $("#HSellSName").val(obj[0].HName); |
| | | $("#HSellSID").val(obj[0].HItemID); |
| | | } |
| | | |
| | | //#region æ ¹æ®å®¢æ·è·åå¸å«ãæ±çãç»ç®æ¹å¼ã客æ·ä¿¡ç¨é¢åº¦ãè系人ãèç³»çµè¯ |
| | | function getCustomerByCusID(HCusID) { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Xs_SeOrderBill/getCustomerByCusID", |
| | |
| | | $("#HSSID").val(data.HSSID); |
| | | $("#HSSName").val(data.HSSName); |
| | | $("#HCreditRating_Now").val(data.HCreditRating_Now); |
| | | $("#HLinkMan").val(data.HLinkMan); |
| | | $("#HLinkPhone").val(data.HLinkPhone); |
| | | |
| | | subHTaxRate = data.HTaxRate; |
| | | |
| | |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | //#region æ ¹æ®å®¢æ·è·å客æ·å¯¹åºç¨ç |
| | | function getHTaxRateByCusID(HCusID) { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Xs_SeOrderBill/getCustomerByCusID", |
| | | async: false, |
| | | type: "GET", |
| | | data: { |
| | | "HCusID": HCusID |
| | | }, |
| | | success: function (result) { |
| | | if (result.code == 1) { // 说æéªè¯æåäºï¼ |
| | | var data = result.data[0]; |
| | | subHTaxRate = data.HTaxRate; |
| | | |
| | | } else { |
| | | layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("åçé误!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | //#region æ ¹æ®å®¢æ·è·å客æ·ä½é¢ |
| | | function getCustomerBalance(HCusID) { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Xs_CusRatingChangeBill/getCustomerBalance", |
| | | async: false, |
| | | type: "GET", |
| | | data: { |
| | | "HCusID": HCusID |
| | | }, |
| | | success: function (result) { |
| | | if (result.code == 1) { // 说æéªè¯æåäºï¼ |
| | | var data = result.data[0]; |
| | | |
| | | $("#HCusBalance").val(data.HCusBalance == null ? 0 : data.HCusBalance); |
| | | $("#HCreditRating_Now").val(data.HCreditRating_Now == null ? 0 : data.HCreditRating_Now); |
| | | $("#HAvailableBalance").val(data.HAvailableBalance == null ? 0 : data.HAvailableBalance); |
| | | } else { |
| | | layer.alert(result.Message, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("åçé误!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | </script> |
| | | </body> |
| | | </html> |