cmSettlementForm.jsp 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>付款单表管理</title>
  6. <meta name="decorator" content="default"/>
  7. <style>
  8. .red {
  9. color: red;
  10. font-style: normal;
  11. }
  12. .nowrap {
  13. white-space: nowrap;
  14. }
  15. .table th {
  16. text-align: center
  17. }
  18. .table td {
  19. text-align: center
  20. }
  21. .payment-form h4 {
  22. width: 96%;
  23. margin-left: 2%;
  24. padding-bottom: 20px;
  25. text-align: center;
  26. border-bottom: 1px solid #eee
  27. }
  28. .required {
  29. color: red
  30. }
  31. .payment-form label {
  32. width: 100px;
  33. text-align: right;
  34. vertical-align: middle;
  35. font-weight: 600
  36. }
  37. .payment-form-top {
  38. padding: 10px 0
  39. }
  40. .payment-form-top > div, .payment-form-bottom > div {
  41. width: 94%;
  42. margin-left: 3%;
  43. height: 50px;
  44. line-height: 50px;
  45. border-bottom: 1px solid #eee;
  46. white-space: nowrap
  47. }
  48. .payment-form-top input {
  49. vertical-align: baseline
  50. }
  51. .payment-form-top > div:last-child span {
  52. margin-left: 15px
  53. }
  54. .payment-form-top > div:last-child span:nth-of-type(1) {
  55. margin-left: 0
  56. }
  57. .pay-list-item {
  58. margin-bottom: 30px
  59. }
  60. .pay-table {
  61. width: 96%;
  62. margin-left: 2%;
  63. margin-bottom: 10px
  64. }
  65. .pay-table th {
  66. background: #f9f9f9
  67. }
  68. .pay-table tr:first-child th {
  69. background: #eee !important
  70. }
  71. .pay-table td {
  72. background: #fff !important
  73. }
  74. .need-to-pay {
  75. width: 90px
  76. }
  77. .payment-form-bottom label {
  78. width: 140px
  79. }
  80. .used-amount {
  81. width: 80px;
  82. margin-top: 6px
  83. }
  84. .process-details span {
  85. width: 140px;
  86. margin-left: 50px;
  87. font-weight: 600
  88. }
  89. .process-for-label {
  90. margin-left: 0 !important
  91. }
  92. .process-details div {
  93. display: inline-block
  94. }
  95. .payment-btn {
  96. width: 96%;
  97. margin-left: 2%;
  98. text-align: center;
  99. height: 60px;
  100. line-height: 60px;
  101. margin-top: 30px
  102. }
  103. .payment-btn button {
  104. width: 100px;
  105. height: 35px;
  106. -webkit-border-radius: 5px;
  107. -moz-border-radius: 5px;
  108. border-radius: 5px;
  109. border: none;
  110. border: 1px solid #ddd
  111. }
  112. .apply-btn {
  113. background: #3daae9;
  114. color: #fff
  115. }
  116. .cfm-btn:active, .return-btn:active {
  117. background: #ddd;
  118. color: #fff
  119. }
  120. .mask {
  121. width: 100%;
  122. height: 100%;
  123. position: fixed;
  124. top: 0;
  125. background: rgba(0, 0, 0, 0.7);
  126. display: none
  127. }
  128. .tips-popup-content {
  129. width: 40%;
  130. height: auto;
  131. padding-bottom: 30px;
  132. background: #fff;
  133. -webkit-border-radius: 5px;
  134. -moz-border-radius: 5px;
  135. border-radius: 5px;
  136. position: absolute;
  137. top: 50%;
  138. left: 50%;
  139. transform: translate(-50%, -50%)
  140. }
  141. .tips-popup-content div {
  142. width: 100%;
  143. text-align: center
  144. }
  145. .tips-popup-content {
  146. width: 30%
  147. }
  148. .tips-popup-content p {
  149. text-align: center;
  150. padding: 80px;
  151. font-size: 20px
  152. }
  153. .tips-popup-content h4 {
  154. padding-left: 10px;
  155. height: 40px;
  156. line-height: 40px;
  157. border-bottom: 1px solid #eee;
  158. margin-bottom: 20px
  159. }
  160. .tips-cfm-btn, .tips-cancel-btn {
  161. width: 100px;
  162. height: 40px;
  163. margin: auto;
  164. -webkit-border-radius: 5px;
  165. -moz-border-radius: 5px;
  166. border-radius: 5px;
  167. background: #3daae9;
  168. color: #fff;
  169. border: none
  170. }
  171. .return-btn, .tips-cancel-btn {
  172. background: #fff;
  173. color: #555;
  174. margin-left: 50px
  175. }
  176. .tips-cancel-btn {
  177. border: 1px solid #ddd;
  178. margin-left: 20px;
  179. display: none
  180. }
  181. #close-btn1 {
  182. top: 8px;
  183. right: 10px;
  184. width: 18px;
  185. position: absolute;
  186. cursor: pointer
  187. }
  188. td.supplier-fee {
  189. text-align: left;
  190. }
  191. td.supplier-fee .wipeBtn {
  192. width: auto;
  193. white-space: nowrap;
  194. height: 30px;
  195. line-height: 30px;
  196. display: none;
  197. }
  198. .inputForm { /*max-width:1200px;*/
  199. width: 100%;
  200. }
  201. .inputForm table {
  202. width: 100%;
  203. line-height: 18px;
  204. margin-bottom: 50px;
  205. }
  206. .inputForm th, .inputForm td {
  207. font-weight: normal;
  208. text-align: left;
  209. padding: 8px 5px;
  210. border-bottom: 1px solid rgb(238, 238, 238);
  211. }
  212. .inputForm th {
  213. width: 15%;
  214. text-align: right;
  215. white-space: nowrap;
  216. font-weight: bold;
  217. }
  218. .inputForm td input[type="text"] {
  219. width: 320px;
  220. height: 16px;
  221. line-height: 16px;
  222. }
  223. .inputForm td input.short {
  224. width: 110px;
  225. }
  226. .inputForm td b.line {
  227. margin: 0 15px 0 20px;
  228. font-weight: normal
  229. }
  230. .wipeVisible {
  231. display: none;
  232. }
  233. .wipeRemarks {
  234. margin: 0;
  235. }
  236. .controls {
  237. font-size: 0
  238. }
  239. .select2-choice {
  240. width: 100px
  241. }
  242. .upload-content {
  243. position: relative;
  244. }
  245. .upload-content * {
  246. margin: 0;
  247. padding: 0;
  248. }
  249. .upload-content .conList {
  250. display: inline-block;
  251. margin-right: 5px;
  252. width: 90px;
  253. height: 90px;
  254. background: #e6e6e6;
  255. border-radius: 5px;
  256. position: relative;
  257. overflow: hidden
  258. }
  259. .upload-content .conList li {
  260. position: relative;
  261. padding: 18px 0
  262. }
  263. .upload-content .conList li img {
  264. width: 100%;
  265. margin: 0 !important;
  266. padding: 0 !important
  267. }
  268. .upload-content img.cancel-upload {
  269. position: absolute;
  270. top: 0;
  271. right: 0;
  272. cursor: pointer;
  273. z-index: 100
  274. }
  275. .upload-content .conList .btn {
  276. position: absolute;
  277. width: 100%;
  278. height: 100%;
  279. top: 0;
  280. left: 0;
  281. background: #e6e6e6
  282. }
  283. .upload-content .conList .btn div {
  284. padding-top: 20px
  285. }
  286. .upload-content .conList .btn div span {
  287. font-size: 35px
  288. }
  289. .hide-pic {
  290. display: none !important
  291. }
  292. .upload-tips {
  293. margin: 10px 0
  294. }
  295. .mask {
  296. z-index: 9999;
  297. }
  298. .weishaIcon {
  299. background: darkorange;
  300. color: white;
  301. margin: 0 0px;
  302. padding: 0 3px;
  303. font-style: normal;
  304. font-size: 12px;
  305. display: inline-block;
  306. border-radius: 2px
  307. }
  308. .clubFreight {
  309. display: none
  310. }
  311. .discountFee {
  312. display: none
  313. }
  314. </style>
  315. </head>
  316. <body>
  317. <ul class="nav nav-tabs">
  318. <li><a href="${ctx}/shopOrder/settlement">子订单手动结算</a></li>
  319. <li class="active"><a>申请结算</a></li>
  320. </ul>
  321. <br/>
  322. <form action="${ctx}/order/cmPayShop/apply" id="form" method="post">
  323. <div class="payment-form">
  324. <h4>付款单</h4>
  325. <div class="payment-form-content">
  326. <c:forEach items="${cmPayShop.shopOrders}" var="s">
  327. <table class="table table-striped table-bordered table-condensed pay-table">
  328. <tr>
  329. <th>订单编号(ID)</th>
  330. <th colspan="3">客户</th>
  331. <th colspan="2">下单时间</th>
  332. <th>订单金额</th>
  333. <th colspan="3">所有子订单</th>
  334. <th>订单总佣金</th>
  335. <th>机构运费</th>
  336. <th>收款状态</th>
  337. <th colspan="3">收款金额</th>
  338. <th>经理折扣</th>
  339. <th>优惠券</th>
  340. <tr/>
  341. <tr>
  342. <td> ${s.orderNo}(${s.orderID})</td>
  343. <td colspan="3"> ${s.buyer}</td>
  344. <td colspan="2"> ${s.orderTime}</td>
  345. <td>${s.payTotalFee}</td>
  346. <td colspan="3">
  347. <c:forEach items="${s.shopOrderNos}" var="cs">
  348. ${cs}<br/>
  349. </c:forEach>
  350. </td>
  351. <td>${s.income}</td>
  352. <td>
  353. <label class="clubFreight" style="display: none">
  354. <c:choose>
  355. <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
  356. <fmt:formatNumber value="${s.freight}"/>
  357. </c:when>
  358. <c:otherwise>
  359. <fmt:formatNumber value="0"/>
  360. </c:otherwise>
  361. </c:choose>
  362. </label>
  363. <c:if test="${s.freight == 0}">
  364. 包邮
  365. </c:if>
  366. <c:if test="${s.freight == -1}">
  367. 到付
  368. </c:if>
  369. <c:if test="${s.freight == -2}">
  370. 仪器到付-产品包邮
  371. </c:if>
  372. <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
  373. <fmt:formatNumber value="${s.freight}" type="currency"/>
  374. <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
  375. </c:if>
  376. <c:if test="${s.userBeans gt 0}">
  377. (采美豆抵用${s.userBeans})
  378. </c:if>
  379. </td>
  380. <td>
  381. <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
  382. style="text-decoration: underline">
  383. <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
  384. <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
  385. <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
  386. </td>
  387. <td colspan="3">
  388. <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
  389. style="text-decoration: underline">${s.receiptTotalFee}</a>
  390. </td>
  391. <td>
  392. <label class="discountFee">
  393. <c:choose>
  394. <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
  395. <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
  396. </c:when>
  397. <c:otherwise>
  398. 0
  399. </c:otherwise>
  400. </c:choose>
  401. </label>
  402. <c:if test="${s.discountTotalFee gt 0}">
  403. <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
  404. <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
  405. type="currency"/>
  406. </c:if>
  407. <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
  408. ¥0.00
  409. </c:if>
  410. <c:if test="${s.returnedPurchaseTotalFee gt 0}">
  411. <span style="color: red">
  412. (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
  413. <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
  414. <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
  415. </c:if>
  416. <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
  417. <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
  418. </c:if>)
  419. </span>
  420. </c:if>
  421. </c:if>
  422. <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
  423. </td>
  424. <td class="couponAmount">${s.couponAmount} </td>
  425. <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
  426. <tr/>
  427. <tr>
  428. <th>子订单编号(ID)</th>
  429. <th colspan="3"> 供应商</th>
  430. <th colspan="3">子订单佣金</th>
  431. <th colspan="3">商品费</th>
  432. <th>应付税费</th>
  433. <th>供应商运费</th>
  434. <th>结算状态</th>
  435. <th colspan="3">付供应商</th>
  436. <th>付第三方</th>
  437. <th>成本类型</th>
  438. </tr>
  439. <tr>
  440. <td>${s.shopOrderNo}(${s.shopOrderID})<input type="hidden" id="shopOrderId-hidden" name="shopOrderId"
  441. value="${s.shopOrderID}"></td>
  442. <td colspan="3">${s.shopName}</td>
  443. <td colspan="3" class="payCm-t"></td>
  444. <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
  445. <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
  446. <td class="taxes">
  447. <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
  448. </td>
  449. <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
  450. pattern="#,##0.00"/></td>
  451. <td>
  452. <c:if test="${s.settleStatus == 1}"><font
  453. color="red">待结算</font></c:if>
  454. <c:if test="${s.settleStatus == 2}"><font color="#ff8c00">部分结算</font></c:if>
  455. <c:if test="${s.settleStatus == 3 || empty s.settleStatus}"><font color="green">已结算</font></c:if>
  456. </td>
  457. <td colspan="3" class="supplier-fee">
  458. <div><span class="nowrap">
  459. <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
  460. 应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
  461. </c:if>
  462. <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
  463. <font color="black">${s.shouldPayShopAmount+s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
  464. </c:if>
  465. <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
  466. <font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
  467. </c:if>
  468. ,</span>
  469. <span class="nowrap">已付:${s.payedShopAmount},</span></div>
  470. <div><span class="nowrap">待付:<input type="number"
  471. value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>"
  472. class="need-to-pay" data-type="${s.differenceType}"
  473. data-difference="${s.differencePrice}"
  474. data-pay="${s.shouldPayShopAmount}"
  475. data-payed="${s.payedShopAmount}"></span></div>
  476. <input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
  477. value="${s.shopOrderID}_${s.waitPayShop}_0">
  478. </td>
  479. <td class="third-party-fee">${s.shopOtherFee}</td>
  480. <td>
  481. <c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if>
  482. <c:if test="${s.costType == '2'}">比例成本</c:if>
  483. </td>
  484. </tr>
  485. <tr>
  486. <th>商品名</th>
  487. <th>规格</th>
  488. <th>数量<%--(赠品)--%></th>
  489. <th>退货</th>
  490. <th colspan="3">单价</th>
  491. <th colspan="3">机构税率 / 单税费 / 总税费</th>
  492. <th>总价</th>
  493. <th>佣金(单)</th>
  494. <th>佣金(总)</th>
  495. <th colspan="3">供应商税率 / 单税费 / 总税费</th>
  496. <th>成本(单)</th>
  497. <th>成本(总)</th>
  498. </tr>
  499. <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
  500. <tr class="pay-product-item">
  501. <input type="hidden" class="p-copId" value="${p.orderProductID}">
  502. <td style="width:300px;" class="p-name">
  503. <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
  504. <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
  505. ${p.name}
  506. </td>
  507. <td style="width:80px;">${p.unit}</td>
  508. <td class="p-num" data-num="${p.num + p.presentNum}">
  509. ${p.num}
  510. <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
  511. </td>
  512. <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
  513. <td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
  514. type="number" pattern="#,##0.00"/>
  515. <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
  516. <label style="color: red">
  517. (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
  518. </label>
  519. </c:if>
  520. </td>
  521. <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
  522. <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
  523. <td><c:choose>
  524. <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
  525. ---
  526. </c:when>
  527. <c:otherwise>
  528. <fmt:formatNumber
  529. value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
  530. type="number" pattern="#,##0.00"/>
  531. </c:otherwise>
  532. </c:choose></td>
  533. <td><fmt:formatNumber
  534. value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
  535. type="number" pattern="#,##0.00"/></td>
  536. <td><fmt:formatNumber
  537. value="${(empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"
  538. pattern="#,##0.00"/></td>
  539. <td class="payCm"><fmt:formatNumber
  540. value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
  541. pattern="#,##0.00"/></td>
  542. <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
  543. <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
  544. <td class="p-taxes-t"><c:choose>
  545. <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
  546. ---
  547. </c:when>
  548. <c:otherwise>
  549. <fmt:formatNumber
  550. value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
  551. type="number" pattern="#,##0.00"/>
  552. </c:otherwise>
  553. </c:choose></td>
  554. <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
  555. pattern="#,##0.00"/></td>
  556. <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
  557. type="number" pattern="#,##0.00"/></td>
  558. </tr>
  559. </c:forEach>
  560. </table>
  561. </c:forEach>
  562. </div>
  563. <div class="inputForm">
  564. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  565. <tr>
  566. <th><span
  567. style="font-weight:bold;font-size:18px">${cmPayShop.paymentType eq 2 ? "结算供应商总金额":"结算供应商总金额"}:</span>
  568. </th>
  569. <td colspan="3">
  570. <span id="totalAmount" style="font-weight: bold;font-size:18px"><fmt:formatNumber
  571. value="${cmPayShop.totalAmount}" pattern="#,##0.00"/></span>
  572. <input type="hidden" id="totalAmount-hidden" name="totalAmount"
  573. value="${cmPayShop.totalAmount}">
  574. </td>
  575. </tr>
  576. <tr>
  577. <td colspan="4" style="text-align:center;">
  578. <button class="apply-btn btn btn-primary" type="button">确定</button>
  579. <button class="return-btn btn" type="button" onclick="history.go(-1)">返回</button>
  580. </td>
  581. </tr>
  582. </table>
  583. </div>
  584. </div>
  585. </form>
  586. <script>
  587. (function () {
  588. var payTableEle = $('.pay-table'),
  589. listenClickNumStatus = true,
  590. payProductEle = $('.pay-product-item');
  591. payTableEle.each(function (i, l) {
  592. var productLength = $(this).find('.pay-product-item').length;
  593. // 商品列表合并单元格
  594. /*$(this).find('.mergeRows').attr('rowspan',productLength);*/
  595. });
  596. $(window).on("load", function () {
  597. $('.need-to-pay').each(function (index, ele) {
  598. var thisEle = $(this),
  599. wrapper = thisEle.parents(".supplier-fee"),
  600. shouldPay = thisEle.attr('data-pay') * 1,
  601. differencePrice = thisEle.attr('data-difference') * 1,
  602. differenceType = thisEle.attr('data-type'),
  603. alreadyPaid = thisEle.attr('data-payed') * 1;
  604. if (thisEle.val().length > 8) {
  605. thisEle.val(thisEle.val().slice(0, 8));
  606. }
  607. if (differenceType == 2) {
  608. differencePrice = -differencePrice;
  609. }
  610. if ((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
  611. thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
  612. }
  613. var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
  614. if (wipe > 0) {
  615. wrapper.find('.wipeBtn').show();
  616. } else {
  617. wrapper.find('.wipeBtn').hide();
  618. wrapper.find('.wipeFee').prop("checked", false);
  619. }
  620. wrapper.find('.wipeFee').val(wipe);
  621. wrapper.find('.wipeText').text('¥' + wipe.toFixed(2));
  622. });
  623. });
  624. $('.tips-cancel-btn, #close-btn1').on('click', function () {
  625. $('.tips-popup').hide();
  626. });
  627. $('.tips-cfm-directly').on('click', function () {
  628. if ($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
  629. $('.tips-popup').hide();
  630. } else {
  631. if (listenClickNumStatus) {
  632. $('#form').submit();
  633. listenClickNumStatus = false;
  634. }
  635. }
  636. })
  637. function showTips(title, text) {
  638. $('.tips-popup h4').text(title);
  639. $('.tips-popup p').text(text);
  640. $('.tips-popup').show();
  641. }
  642. $('body').on('keyup', '#wipeRemarks', function () {
  643. $('#remarkLen').text($(this).val().length);
  644. });
  645. $('body').on('change', '.wipeBtn input', function () {
  646. var wrapper = $(this).parents(".supplier-fee");
  647. wrapper.find('.need-to-pay').trigger("input");
  648. wrapper.find('.need-to-pay').trigger("propertychange");
  649. });
  650. // 待付<=应付-已付
  651. $('body').on('input propertychange', '.need-to-pay', function () {
  652. var thisEle = $(this),
  653. wrapper = thisEle.parents(".supplier-fee"),
  654. shouldPay = thisEle.attr('data-pay') * 1,
  655. differencePrice = thisEle.attr('data-difference') * 1,
  656. differenceType = thisEle.attr('data-type'),
  657. alreadyPaid = thisEle.attr('data-payed') * 1;
  658. if (thisEle.val().length > 8) {
  659. thisEle.val(thisEle.val().slice(0, 8));
  660. }
  661. if (differenceType == 2) {
  662. differencePrice = -differencePrice;
  663. }
  664. if ((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
  665. thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
  666. }
  667. var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
  668. if (wipe > 0) {
  669. wrapper.find('.wipeBtn').show();
  670. } else {
  671. wrapper.find('.wipeBtn').hide();
  672. wrapper.find('.wipeFee').prop("checked", false);
  673. }
  674. wrapper.find('.wipeFee').val(wipe);
  675. wrapper.find('.wipeText').text('¥' + wipe.toFixed(2));
  676. var totalAmount = 0, wipeTotalFee = 0;
  677. $('.need-to-pay').each(function (index, ele) {
  678. totalAmount += Number($(this).val());
  679. });
  680. $('.wipeFee:checked').each(function (index, ele) {
  681. wipeTotalFee += Number($(this).val());
  682. });
  683. totalAmount = totalAmount.toFixed(2);
  684. wipeTotalFee = wipeTotalFee.toFixed(2);
  685. if (Number(wipeTotalFee) > 0) {
  686. $('.wipeVisible').show();
  687. $('#wipePayment').val(wipeTotalFee);
  688. $('.wipeTotalFee').text('¥' + wipeTotalFee);
  689. } else {
  690. $('.wipeVisible').hide();
  691. $('#wipePayment').val(0);
  692. $('.wipeTotalFee').text('¥0.00');
  693. }
  694. $('#totalAmount').text(totalAmount);
  695. $('#totalAmount-hidden').val(totalAmount);
  696. $('#transferPayFee').text(totalAmount);
  697. $('#transferPayFee-hidden').val(totalAmount);
  698. $('#ableRebateAmount').text($('#ableRebateAmount-hidden').val());
  699. $('#remainingBalance').text($('#ableRebateAmount-hidden').val());
  700. $('.used-amount').val(0);
  701. var payInfo = wrapper.find('.payInfo');
  702. var checkedWipe = wrapper.find('.wipeFee:checked').length > 0 ? wrapper.find('.wipeFee:checked').val() : 0;
  703. payInfo.val(payInfo.attr('data-shoporderid') + '_' + thisEle.val() + '_' + checkedWipe);
  704. });
  705. // 使用余额<总余额
  706. $('body').on('input propertychange', '.used-amount', function () {
  707. var thisEle = $(this),
  708. thisVal = Number(thisEle.val()),
  709. //totalAmount = Number($('#totalAmount').text()),
  710. totalAmount = ${cmPayShop.totalAmount},
  711. rebateAmount = Number($('#rebateAmount-hidden').val()),
  712. ableRebateAmount = Number($('#ableRebateAmount-hidden').val());
  713. if ((thisVal > ableRebateAmount) || thisVal < 0 || thisVal > totalAmount) {
  714. thisEle.val(0);
  715. $('#transferPayFee').text(totalAmount);
  716. $('#transferPayFee-hidden').val(totalAmount);
  717. $('#ableRebateAmount').text($('#ableRebateAmount-hidden').val());
  718. $('#remainingBalance').text(rebateAmount);
  719. } else {
  720. $('#transferPayFee').text((totalAmount - thisVal).toFixed(2));
  721. $('#transferPayFee-hidden').val((totalAmount - thisVal).toFixed(2));
  722. $('#ableRebateAmount').text((ableRebateAmount - thisVal).toFixed(2));
  723. $('#remainingBalance').text((rebateAmount - thisVal).toFixed(2));
  724. }
  725. });
  726. $('.pay-table').each(function () {
  727. debugger
  728. var thisEle = $(this),
  729. totalComissionVal = 0,
  730. resVal = '';
  731. totalComissionEle = thisEle.find('.payCm'),//单个商品总佣金
  732. comissionEle = thisEle.find('.payCm-t'),//子订单佣金
  733. thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),//付第三方
  734. freightVal = thisEle.find('.freight').text().replace(',', ''),//供应商运费
  735. clubFreight = Number(thisEle.find('.clubFreight').text().replace(',', '')),//机构运费
  736. discountFee = Number(thisEle.find('.discountFee').text().replace(',', '')),//经理折扣
  737. eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',', ''));//分摊优惠
  738. totalComissionEle.each(function () {
  739. totalComissionVal += Number($(this).text().replace(',', ''));
  740. })
  741. // 子订单佣金=单个商品总佣金+机构运费-付第三方-供应商运费-子订单分摊优惠
  742. resVal = (totalComissionVal - thirdPartyVal - eachDiscount).toFixed(2);
  743. comissionEle.text(resVal);
  744. })
  745. $('.apply-btn').on('click', function () {
  746. var settleAmount = $('#totalAmount-hidden').val();
  747. var shopOrderId = $('#shopOrderId-hidden').val();
  748. console.log("settleAmount---------->"+settleAmount);
  749. console.log("shopOrderId---------->"+shopOrderId);
  750. window.location.href = '${ctx}/order/cmPayShop/settlement?settleAmount=' + settleAmount+'&shopOrderId='+ shopOrderId;
  751. })
  752. })();
  753. </script>
  754. </body>
  755. </html>