zhijiezhao 3 jaren geleden
bovenliggende
commit
1c29ddb5db

+ 17 - 3
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp

@@ -410,7 +410,6 @@
         <img id="close-btn1" src="/static/images/close-btn.png" alt="close-btn">
     </div>
 </div>
-</body>
 <script>
     (function () {
         $('.tips-cancel-btn, #close-btn1').on('click',function() {
@@ -438,7 +437,6 @@
             var refundInfo = thisEle.next("input[name='refundInfo']");
             refundInfo.val(refundInfo.attr('data-shoporderid') + '_' + thisEle.val());
         });
-
         function showTips(title,text) {
             $('.tips-popup h4').text(title);
             $('.tips-popup p').text(text);
@@ -462,7 +460,23 @@
                 showTips('确认提示','确定操作已退付款?');
             }
         })
-
+        $('.pay-table').each(function(){
+            var thisEle = $(this),
+                totalComissionVal = 0,
+                resVal = '';
+            totalComissionEle = thisEle.find('.payCm'),
+                comissionEle = thisEle.find('.payCm-t'),
+                thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',',''),
+                freightVal = thisEle.find('.freight').text().replace(',',''),
+                clubFreight = Number(thisEle.find('.clubFreight').text().replace(',','')),
+                discountFee = Number(thisEle.find('.discountFee').text().replace(',',''));
+            totalComissionEle.each(function(){
+                totalComissionVal += Number($(this).text().replace(',',''));
+            })
+            resVal = (totalComissionVal + clubFreight - discountFee - thirdPartyVal - freightVal).toFixed(2);
+            comissionEle.text(resVal);
+        })
     })()
 </script>
+</body>
 </html>

+ 37 - 21
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopForm.jsp

@@ -472,9 +472,6 @@
 			}
 		})
 		$('.refund-cfm-btn').on('click',function() {
-			/*var totalRefundAmount = $('#totalRefundAmount').text(),
-                refundCheckbox = $('.refund-checkbox:checked'),
-                inputTotalAmount = 0;*/
 			var isNullFlag = false;
 			$('.refund').each(function (index, ele) {
 				var _thisVal = $(this).val();
@@ -485,34 +482,53 @@
 				}
 			});
 
-			/* if(refundCheckbox.length < 1) {
-                 $('.tips-cfm-btn').addClass('tips-cfm-directly');
-                 $('.tips-cancel-btn').hide();
-                 showTips('信息提示','请勾选接收退款方式');
-                 return false;
-             }*/
 			if(isNullFlag){
 				$('.tips-cfm-btn').addClass('tips-cfm-directly');
 				$('.tips-cancel-btn').hide();
 				showTips('信息提示','退款金额不能为空');
 				return false;
 			}
-			/*refundCheckbox.each(function(){
-                var wrapper = $(this).closest('.refund-wrapper'),
-                    thisAmount = wrapper.find('.refund-amount');
-                inputTotalAmount += Number(thisAmount.val());
-                console.log('===',inputTotalAmount);
-            })
-            if(inputTotalAmount !== Number(totalRefundAmount)) {
-                $('.tips-cfm-btn').addClass('tips-cfm-directly');
-                showTips('确认提示','各退款方式的金额之和不等于退款总金额,请重新计算后再提交申请。');
-                $('.tips-cancel-btn').hide();
-                return false;
-            }*/
 			$('.tips-cfm-btn').removeClass('tips-cfm-directly');
 			$('.tips-cancel-btn').show();
 			showTips('确认提示','确定操作已退付款?');
 		})
+
+		var payTableEle = $('.pay-table'),
+				payProductEle = $('.pay-product-item');
+		payTableEle.each(function (i,l) {
+			var productLength = $(this).find('.pay-product-item').length;
+			// 商品列表合并单元格
+			$(this).find('.mergeRows').attr('rowspan',productLength);
+		});
+
+		$('.tips-cancel-btn, #close-btn1').on('click',function() {
+			$('.tips-popup').hide();
+		})
+		$('.tips-cfm-directly').on('click',function() {
+			if($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
+				$('.tips-popup').hide();
+			}
+		})
+		$('.pay-table').each(function(){
+			var thisEle = $(this),
+					totalComissionVal = 0,
+					resVal = '';
+			totalComissionEle = thisEle.find('.payCm'),
+					comissionEle = thisEle.find('.payCm-t'),
+					thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',',''),
+					freightVal = thisEle.find('.freight').text().replace(',',''),
+					clubFreight = Number(thisEle.find('.clubFreight').text().replace(',','')),
+					discountFee = Number(thisEle.find('.discountFee').text().replace(',',''));
+			totalComissionEle.each(function(){
+				totalComissionVal += Number($(this).text().replace(',',''));
+			})
+			resVal = (totalComissionVal + clubFreight - discountFee - thirdPartyVal - freightVal).toFixed(2);
+			comissionEle.text(resVal);
+		})
+
+		$('.export').on('click',function() {
+			window.print();
+		})
 	})()
 </script>
 </body>