Răsfoiți Sursa

打包费 运费

shish 2 ani în urmă
părinte
comite
58f6108e89

+ 10 - 2
ghsApp/src/pagesOrder/detail.vue

@@ -287,7 +287,11 @@
 					</tui-list-cell>
 					<tui-list-cell v-if="detailInfo.tkPrice > 0" class="line-cell" :hover="false">
 						<div class="tui-title">退款金额</div>
-						<div class="detail-price_box" style="font-size: 28upx">-¥{{ parseFloat(detailInfo.tkPrice) }}</div>
+						<div class="detail-price_box" style="font-size: 28upx">
+							<text v-if="Number(detailInfo.refundSendCost)>0">(含运费{{detailInfo.refundSendCost?parseFloat(detailInfo.refundSendCost):0}}元)</text>
+							<text v-if="Number(detailInfo.refundPackCost)>0">(含打包费{{detailInfo.refundPackCost?parseFloat(detailInfo.refundPackCost):0}}元)</text>
+							-¥{{ parseFloat(detailInfo.tkPrice) }}
+						</div>
 					</tui-list-cell>
 					<tui-list-cell v-if="detailInfo.orderReachDiscountPrice > 0" class="line-cell" :hover="false">
 						<div class="tui-title">整单优惠</div>
@@ -330,7 +334,11 @@
 					</tui-list-cell>
 					<tui-list-cell v-if="detailInfo.tkPrice > 0" class="line-cell" :hover="false">
 						<div class="tui-title">退款金额</div>
-						<div class="detail-price_box" style="font-size: 28upx">-¥{{ parseFloat(detailInfo.tkPrice) }}</div>
+						<div class="detail-price_box" style="font-size: 28upx">
+							<text v-if="Number(detailInfo.refundSendCost)>0">(含运费{{detailInfo.refundSendCost?parseFloat(detailInfo.refundSendCost):0}}元)</text>
+							<text v-if="Number(detailInfo.refundPackCost)>0">(含打包费{{detailInfo.refundPackCost?parseFloat(detailInfo.refundPackCost):0}}元)</text>
+							-¥{{ parseFloat(detailInfo.tkPrice) }}
+						</div>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false" 
 					v-if="detailInfo.status==3 || detailInfo.status== 4">

+ 57 - 10
ghsApp/src/pagesOrder/refund.vue

@@ -28,6 +28,34 @@
 			</view>
 			</view>
 		</view>
+		<view class="refund-item-list" v-if="Number(orderInfo.packCost)>0||Number(orderInfo.sendCost)>0">
+			<view class="refund-label"><text></text>其他可退:</view>
+			<view>
+				<view class="list" v-if="Number(orderInfo.packCost)>0">
+					<view class="flex list-title" >
+						<text class="product-name">打包费</text>
+						<text class="product-num">{{ orderInfo.packCost?parseFloat(orderInfo.packCost):0 }}元</text>
+
+					</view>
+					<view class="flex list-val" style="font-size:26upx;font-weight:bold;">
+						<input type="digit" placeholder="金额" v-model="orderInfo.refundPackCostAmount" placeholder-style="color:#CCCCCC" />
+						<text style="margin-left:10upx;">元</text>
+						<text style="color:green;margin-left:20upx;">可退{{parseFloat((Number(orderInfo.packCost)-Number(orderInfo.refundPackCost)).toFixed(2))}}元</text>
+					</view>
+				</view>
+				<view class="list" v-if="Number(orderInfo.sendCost)>0">
+					<view class="flex list-title" >
+						<text class="product-name">运费</text>
+						<text class="product-num">{{ orderInfo.sendCost?parseFloat(orderInfo.sendCost):0 }}元</text>
+					</view>
+					<view class="flex list-val" style="font-size:26upx;font-weight:bold;">
+						<input type="digit" placeholder="金额" v-model="orderInfo.refundSendCostAmount" placeholder-style="color:#CCCCCC" />
+						<text style="margin-left:10upx;">元</text>
+						<text style="color:green;margin-left:20upx;">可退{{parseFloat((Number(orderInfo.sendCost)-Number(orderInfo.refundSendCost)).toFixed(2))}}元</text>
+					</view>
+				</view>
+			</view>
+		</view>
 		<view class="flex refund-item">
 			<view class="refund-label">退款原因:</view>
 			<view class="flex list">
@@ -39,10 +67,9 @@
 				</view>多开错开</view></view>
 		</view>
 		<view class="flex refund-item">
-			<view class="refund-label">{{orderInfo.book==0?'订单金额':'预付金额'}}:</view>
+			<view class="refund-label">订单金额:</view>
 			<view class="list">
-				<block v-if="orderInfo.book == 0">¥{{orderInfo.orderPrice ? parseFloat(orderInfo.orderPrice):0}}</block>
-				<block v-else>¥{{orderInfo.bookPrice ? parseFloat(orderInfo.bookPrice):0}}</block>
+				<block>¥{{orderInfo.orderPrice ? parseFloat(orderInfo.orderPrice):0}}</block>
 				<text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</text>
 			</view>
 		</view>
@@ -124,6 +151,12 @@ export default {
 					}
 				}
 			}
+			if(Number(this.orderInfo.refundSendCostAmount)>0){
+				price = Number(this.orderInfo.refundSendCostAmount) + Number(price)
+			}
+			if(Number(this.orderInfo.refundPackCostAmount)>0){
+				price = Number(this.orderInfo.refundPackCostAmount) + Number(price)
+			}
 			price = parseFloat(price.toFixed(2))
 			this.refundMoney = price
 			return price
@@ -167,6 +200,20 @@ export default {
 				uni.showToast({title:'请选择商品',icon:'none'})
 				return;
 			}
+			if(Number(this.orderInfo.refundPackCostAmount)>0){
+				let couldRefundPackCost = parseFloat((Number(this.orderInfo.packCost)-Number(this.orderInfo.refundPackCost)).toFixed(2))
+				if(Number(this.orderInfo.refundPackCostAmount)>Number(couldRefundPackCost)){
+					uni.showToast({title:'打包费超出可退金额',icon:'none'})
+					return false
+				}
+			}
+			if(Number(this.orderInfo.refundSendCostAmount)>0){
+				let couldRefundSendCost = parseFloat((Number(this.orderInfo.sendCost)-Number(this.orderInfo.refundSendCost)).toFixed(2))
+				if(Number(this.orderInfo.refundSendCostAmount)>Number(couldRefundSendCost)){
+					uni.showToast({title:'运费超出可退金额',icon:'none'})
+					return false
+				}
+			}
 			let refundParams = {
 				id:this.option.id,
 				product:JSON.stringify(product),
@@ -174,7 +221,9 @@ export default {
 				remark:this.remark,
 				refundType:this.refundType,
 				getOriginalItem:1,
-				cause:this.cause
+				cause:this.cause,
+				refundSendCost:this.orderInfo.refundSendCostAmount,
+				refundPackCost:this.orderInfo.refundPackCostAmount
 			};
 			that.$util.confirmModal({content:'确认退款?'},() => {
 				uni.showLoading({title: "提交中",mask:true})
@@ -199,13 +248,11 @@ export default {
 		async init() {
 			//getOriginalItem 取原有的花材结构(小菊的花材结构有变化)
 			const res = await getDetail({ id: this.option.id,getOriginalItem:1 })
-			this.orderInfo = res.data
+			this.orderInfo = {...res.data,refundPackCostAmount:'',refundSendCostAmount:''}
 			
-			if(this.orderInfo.book == 0){
-				this.couldRefundPrice = Number(res.data.orderPrice) - Number(res.data.tkPrice)
-			}else{
-				this.couldRefundPrice = Number(res.data.bookPrice) - Number(res.data.tkPrice)
-			}
+
+			this.couldRefundPrice = Number(res.data.orderPrice) - Number(res.data.tkPrice)
+
 			this.couldRefundPrice = this.couldRefundPrice.toFixed(2)
 			this.couldRefundPrice = parseFloat(this.couldRefundPrice)
 

+ 2 - 0
ghsApp/src/pagesOrder/refundDetail.vue

@@ -28,6 +28,8 @@
 			<view class="refund-label"><text></text>退款金额:</view>
 			<view class="list" style="font-size:28upx;">
 				¥{{refundPrice}}
+				<text style="margin-left:8upx;font-size:24upx;" v-if="Number(info.refundPackCost)>0">含打包费{{ info.refundPackCost?parseFloat(info.refundPackCost):0 }}元</text>
+				<text style="margin-left:8upx;font-size:24upx;" v-if="Number(info.refundSendCost)>0">含运费费{{ info.refundSendCost?parseFloat(info.refundSendCost):0 }}元</text>
 				<text style="margin-left:80upx;color:#3385FF;" @click="changeAmount()" v-if="info.status == 0">修改</text>
 			</view>
 		</view>