Răsfoiți Sursa

Merge branch 'master' into redesign‌-260706

# Conflicts:
#	mallApp/src/static/iconfont/iconfont.css
shish 16 ore în urmă
părinte
comite
8c48404a52

+ 28 - 10
ghsApp/src/admin/home/components/OrderItem.vue

@@ -6,7 +6,7 @@
 
         <image class="avatar" mode="aspectFit" :src="item.customAvatarUrl"></image>
         <view class="tit"> {{ item.customName || '' }}</view>
-        <view class="other-refund" v-if="item.refund == 2">有售后</view>
+        <view class="other-refund" v-if="item.refund == 2">有退款</view>
         <view class="other-status" v-if="item.debt == 1">挂账</view>
         <text class="other-book" v-if="item.book == 1">预订单</text>
         <text class="other-presell" v-if="item.presell == 1">预售单</text>
@@ -67,6 +67,8 @@
                 : ''
             }}</text>
           </view>
+          <!-- 客户片区:放配送方式行右侧,避免与价格挤在一起 -->
+          <view v-if="item.customDistName" class="dist-name">{{ item.customDistName }}</view>
         </view>
         <view class="order-info_box">
           <view>开单:</view>
@@ -78,11 +80,11 @@
           <view v-if="item.smallNum > 0">{{ `${item.bigNum}/${item.smallNum}` }}</view>
           <view v-else>{{ item.bigNum }}</view>
           <view class="price">
-            <text v-if="item.customDistName" class="price-dist-name">{{ item.customDistName }}</text>
-            <view v-if="item.orderPrice == item.actPrice">¥{{ item.orderPrice ? parseFloat(item.orderPrice) : 0 }}</view>
+            <!-- 列表展示价 = actPrice - 封账后退款(nextDayTkPrice),与详情「最终金额」对齐 -->
+            <view v-if="Number(item.orderPrice) == displayActPrice">¥{{ displayActPrice }}</view>
             <view v-else>
               <text class="price-original">¥{{ item.orderPrice ? parseFloat(item.orderPrice) : 0 }}</text>
-              <text class="price-discount">¥{{ item.actPrice ? parseFloat(item.actPrice) : 0 }}</text>
+              <text class="price-discount">¥{{ displayActPrice }}</text>
             </view>
             <i class="iconfont iconxiangyou"></i>
           </view>
@@ -380,6 +382,18 @@ export default {
       this.currentStatus = this.item.status;
     }
   },
+  computed: {
+    /**
+     * 列表展示价:actPrice - 封账后退款(nextDayTkPrice)
+     * 封账后退款不改 actPrice,这里扣减后与详情「最终金额」一致
+     */
+    displayActPrice() {
+      const act = Number(this.item.actPrice) || 0
+      const next = Number(this.item.nextDayTkPrice) || 0
+      const pay = act - next
+      return parseFloat((pay > 0 ? pay : 0).toFixed(2))
+    }
+  },
   methods: {
     modifyAddress(item) {
       this.closeExpressPop()
@@ -861,6 +875,16 @@ export default {
   font-size: 28upx;
 }
 
+/* 片区名:方式行右侧,与账单日期同布局 */
+.dist-name {
+  flex: 1;
+  color: #999999;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 26upx;
+}
+
 .price-original {
   text-decoration: line-through;
   color: #847676;
@@ -1130,12 +1154,6 @@ export default {
       display: flex;
       align-items: center;
       justify-content: flex-end;
-      .price-dist-name {
-        margin-right: 60upx;
-        font-size: 28upx;
-        color: #999999;
-        flex-shrink: 0;
-      }
       & .iconxiangyou {
         color: #999999;
         font-size: 25upx;

+ 5 - 0
ghsApp/src/pagesArrears/details.vue

@@ -276,8 +276,13 @@ export default {
 	.top-view {
 		padding: 30upx;
 		position:fixed;
+		top: 0;
+		left: 0;
 		width:100%;
+		/* 固定顶栏需高于列表,避免订单项滚上来盖住头像/时间筛选 */
+		z-index: 100;
 		background-color: #fff;
+		box-sizing: border-box;
 		.top-row {
 			display: flex;
 			justify-content: space-between;

+ 37 - 2
ghsApp/src/pagesGys/search.vue

@@ -10,7 +10,11 @@
 					<view style="margin-bottom:28upx;" @click="addData(item)">
 						<view>编号 {{item.orderSn}}</view>
 						<view>时间 {{item.entryTime.substr(2,14)}}</view>
-						<view>金额 ¥{{item.actPrice}}</view>
+						<!-- 搜索结果:优先展示剩余待结(对齐 details 结账口径) -->
+						<view>剩余待结 ¥{{ searchRemainPrice(item) }}</view>
+						<view v-if="searchHasPartialClear(item)" style="color:#999;text-decoration:line-through;font-size:28upx;">
+							原挂账 ¥{{ searchDisplayDebtPrice(item) }}
+						</view>
 					</view>
 				</block>
 			</block>
@@ -72,6 +76,10 @@
 </view>
 </template>
 <script>
+/**
+ * 供货商按编号搜索结账页
+ * 合计/列表金额与 details 一致:优先 remainDebtPrice(剩余待结)
+ */
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import DetailsItem from "./searchItem";
 import ModalModule from "@/components/plugin/modal";
@@ -102,11 +110,17 @@ export default {
 			let num = 0
 			return num
 		},
+		/** 结账合计用剩余待结;无字段时回落 actPrice/realPrice(对齐 details.vue) */
 		selectTotalAmount() {
 			let amount = 0;
 			if (this.getOrderList) {
 				for (const item of this.getOrderList) {
-					amount=amount+Number(item.realPrice)
+					const remain = Number(item.remainDebtPrice)
+					if (remain > 0) {
+						amount = amount + remain
+					} else {
+						amount = amount + Number(item.actPrice || item.realPrice || 0)
+					}
 				}
 			}
 			let newAmount = amount.toFixed(2);
@@ -115,6 +129,27 @@ export default {
 		}
 	},
 	methods: {
+		/** 搜索结果:剩余待结金额 */
+		searchRemainPrice(item) {
+			const remain = Number(item && item.remainDebtPrice)
+			if (remain > 0) {
+				return parseFloat(remain)
+			}
+			return parseFloat(Number((item && (item.actPrice || item.realPrice)) || 0))
+		},
+		/** 搜索结果:原挂账金额 */
+		searchDisplayDebtPrice(item) {
+			const debt = Number(item && item.debtPrice)
+			if (debt > 0) {
+				return parseFloat(debt)
+			}
+			return this.searchRemainPrice(item)
+		},
+		/** 搜索结果:是否部分结清 */
+		searchHasPartialClear(item) {
+			return this.searchDisplayDebtPrice(item) > this.searchRemainPrice(item)
+		},
+
 		confirmClear(val) {
 			if(val.index == 0){
 				this.showClearModel = false

+ 73 - 5
ghsApp/src/pagesGys/searchItem.vue

@@ -1,3 +1,8 @@
+<!--
+  供货商按编号搜索结账:已选订单行
+  用途:展示单号/入库时间/实付与剩余待结;支持删除与查看明细
+  对齐 detailsItem:部分结清时划掉原挂账、标红「剩余待结」
+-->
 <template>
 	<view class="details-item">
 		<view class="details-main">
@@ -13,25 +18,56 @@
 			</view>
 			<view class="item-row">
 				<view class="price" style="color:#3385FF;">
-					<text>¥{{ parseFloat(info.realPrice) }}</text>
-					<text v-if="Number(info.tkPrice)>0" style="margin-left:30upx;color:red;">
+					<!-- 部分结清:原挂账划掉,下方另显剩余待结 -->
+					<text :class="[hasPartialClear ? 'price-del' : '']">¥{{ parseFloat(displayDebtPrice) }}</text>
+					<text v-if="Number(info.tkPrice)>0" style="margin-left:30upx;color:red;text-decoration:none;">
 					已退¥{{info.tkPrice?parseFloat(info.tkPrice):0}}
 					</text>
 				</view>
-				<view class="price" style="border:1upx solid #8a7676;border-radius:10upx;font-weight:normal;color:#8a7676;font-size:32upx;width:150upx;height:80upx;justify-content:center;" @click.stop="delOrder(info)">删除</view>
-
-				<view class="price" style="border:1upx solid #67a0f7;border-radius:10upx;font-weight:normal;color:#3385FF;font-size:32upx;width:180upx;height:80upx;justify-content:center;" @click.stop="goToDetai(info)">查看明细</view>
+				<view class="price action-del" @click.stop="delOrder(info)">删除</view>
+				<view class="price action-detail" @click.stop="goToDetai(info)">查看明细</view>
+			</view>
+			<view class="item-row" v-if="Number(info.nextDayTkPrice)>0">
+				<view class="refund-tip refund-tip-next">隔天售后 ¥{{parseFloat(info.nextDayTkPrice)}}</view>
+			</view>
+			<view class="item-row" v-if="hasPartialClear">
+				<view class="price" style="color:red;">剩余待结 ¥{{ parseFloat(remainDebtPrice) }}</view>
 			</view>
 		</view>
 	</view>
 </template>
 <script>
+/**
+ * 搜索结账已选行:金额口径与 detailsItem 一致(优先 remainDebtPrice)
+ */
 export default {
 	props: {
 		info: {
 			required: true
 		}
 	},
+	computed: {
+		/** 剩余待结:有 remainDebtPrice 用剩余,否则回落 actPrice/realPrice */
+		remainDebtPrice() {
+			const remain = Number(this.info.remainDebtPrice)
+			if (remain > 0) {
+				return remain
+			}
+			return Number(this.info.actPrice || this.info.realPrice || 0)
+		},
+		/** 展示挂账原额:有 debtPrice 用原挂账,否则等同剩余 */
+		displayDebtPrice() {
+			const debt = Number(this.info.debtPrice)
+			if (debt > 0) {
+				return debt
+			}
+			return this.remainDebtPrice
+		},
+		/** 原挂账大于剩余 → 已部分结清 */
+		hasPartialClear() {
+			return this.displayDebtPrice > this.remainDebtPrice
+		}
+	},
 	methods: {
 		goToDetai(item){
 			this.$util.pageTo({url: "/pagesPurchase/info?orderSn="+item.orderSn})
@@ -103,6 +139,38 @@ export default {
 				color: #999999;
 			}
 		}
+		.price-del {
+			text-decoration: line-through;
+			color: #999 !important;
+			font-weight: 600;
+		}
+		.refund-tip {
+			font-size: 26upx;
+			font-weight: normal;
+		}
+		.refund-tip-next {
+			color: #e67e22;
+		}
+		.action-del {
+			border: 1upx solid #8a7676;
+			border-radius: 10upx;
+			font-weight: normal;
+			color: #8a7676;
+			font-size: 32upx;
+			width: 150upx;
+			height: 80upx;
+			justify-content: center;
+		}
+		.action-detail {
+			border: 1upx solid #67a0f7;
+			border-radius: 10upx;
+			font-weight: normal;
+			color: #3385FF;
+			font-size: 32upx;
+			width: 180upx;
+			height: 80upx;
+			justify-content: center;
+		}
 	}
 }
 </style>

+ 39 - 3
ghsApp/src/pagesOrder/detail.vue

@@ -244,7 +244,7 @@
 					<view>累计退款:</view>
 					<view style="color:red;font-weight:bold;font-size:30upx;">{{ totalTkPrice }}</view>
 					<view class="price" v-if="detailInfo.refundLog==1">
-						<button @click="pageTo({url: '/pagesOrder/refundList',query: {orderSn: detailInfo.orderSn}})" style="color:red;border: 1upx solid red;" class="admin-button-com">售后记录</button>
+						<button @click="pageTo({url: '/pagesOrder/refundList',query: {orderSn: detailInfo.orderSn}})" style="color:red;border: 1upx solid red;" class="admin-button-com">退款记录</button>
 					</view>
 				</view>
 			</view>
@@ -265,10 +265,10 @@
 
 				<!-- 待付款/已取消不可售后;其余直接进售后页(未完成由后端提交时自动确认送达/完成) -->
 				<view class="flex" style="color: #3385ff;" v-if="detailInfo.status != 1 && detailInfo.status != 5">
-					<button class="admin-button-com bule middle" @click.stop="goRefund()">发起售后</button>
+					<button class="admin-button-com bule middle" @click.stop="goRefund()">发起退款</button>
 				</view>
 				<view v-else class="flex">
-					<button disabled="true" class="admin-button-com bule active middle" style="border:1rpx solid #ccc;">发起售后</button>
+					<button disabled="true" class="admin-button-com bule active middle" style="border:1rpx solid #ccc;">发起退款</button>
 				</view>
 			</view>
 			<view class="module-com content-box">
@@ -404,6 +404,15 @@
 						<div class="tui-title" style="color:#3385FF;">实际金额</div>
 						<div class="detail-price_box" style="font-size: 34upx;color:#3385FF;">¥{{ parseFloat(detailInfo.realPrice)}}</div>
 					</tui-list-cell>
+					<!-- 封账后退款:不改 realPrice,单独展示;最终金额 = 实际金额 - 封账后退款 -->
+					<tui-list-cell v-if="Number(detailInfo.nextDayTkPrice) > 0" class="line-cell" :hover="false">
+						<div class="tui-title">封账后退款</div>
+						<div class="detail-price_box" style="font-size: 28upx;">-¥{{ parseFloat(detailInfo.nextDayTkPrice) }}</div>
+					</tui-list-cell>
+					<tui-list-cell v-if="Number(detailInfo.nextDayTkPrice) > 0" class="line-cell" :hover="false">
+						<div class="tui-title" style="color:#3385FF;">最终金额</div>
+						<div class="detail-price_box" style="font-size: 34upx;color:#3385FF;">¥{{ finalPriceAfterSealRefund }}</div>
+					</tui-list-cell>
 
 				<block v-if="detailInfo.staffFinance==1">
 					<tui-list-cell class="line-cell" :hover="false" @click="toggleFinanceInfo">
@@ -457,6 +466,23 @@
 						<div class="tui-title">实际金额</div>
 						<div class="detail-price_box" style="font-size: 32upx;">¥{{ parseFloat(detailInfo.realPrice)}}</div>
 					</tui-list-cell>
+					<!-- 封账后退款 / 最终金额:与上方价格明细口径一致 -->
+					<tui-list-cell
+						v-if="(detailInfo.status==3 || detailInfo.status==4) && Number(detailInfo.nextDayTkPrice) > 0"
+						class="line-cell"
+						:hover="false"
+					>
+						<div class="tui-title">封账后退款</div>
+						<div class="detail-price_box" style="font-size: 28upx;">-¥{{ parseFloat(detailInfo.nextDayTkPrice) }}</div>
+					</tui-list-cell>
+					<tui-list-cell
+						v-if="(detailInfo.status==3 || detailInfo.status==4) && Number(detailInfo.nextDayTkPrice) > 0"
+						class="line-cell"
+						:hover="false"
+					>
+						<div class="tui-title">最终金额</div>
+						<div class="detail-price_box" style="font-size: 32upx;">¥{{ finalPriceAfterSealRefund }}</div>
+					</tui-list-cell>
 				</div>
 			</view>
 
@@ -801,6 +827,16 @@ export default {
 			const next = Number(this.detailInfo.nextDayTkPrice) || 0
 			return parseFloat((day + next).toFixed(2))
 		},
+		/**
+		 * 最终金额:实际金额 realPrice - 封账后退款 nextDayTkPrice
+		 * 封账后退款不改实付字段,用差值给店员看净额
+		 */
+		finalPriceAfterSealRefund() {
+			const real = Number(this.detailInfo.realPrice) || 0
+			const seal = Number(this.detailInfo.nextDayTkPrice) || 0
+			const final = real - seal
+			return parseFloat((final > 0 ? final : 0).toFixed(2))
+		},
 	},
 	onShareAppMessage(res) {
 		const purchaseId = this.detailInfo.purchaseId || 0

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

@@ -75,8 +75,8 @@
 			</view>
 
 			<view class="refund-row" v-if="Number(info.sameDay) === 0">
-				<view class="refund-label">售后类型</view>
-				<view class="refund-value" style="color: #3385ff;">{{ isFreeRefund ? '无原单退款' : '隔天售后' }}</view>
+				<view class="refund-label">退款类型</view>
+				<view class="refund-value" style="color: #e67e22;">{{ Number(info.sameDay) === 0 ? '封账后退款' : '当天退款' }}</view>
 			</view>
 			<view class="refund-row">
 				<view class="refund-label">原单付款</view>

+ 1 - 1
ghsApp/src/pagesOrder/refundList.vue

@@ -11,7 +11,7 @@
               <text>类型:{{item.book == 1 ? '预订单多退少补' :'普通'}}</text>
               <!-- sameDay=0 隔天售后,否则当天售后 -->
               <text :style="Number(item.sameDay) === 0 ? 'color:#e67e22;font-weight:bold;' : ''">
-                时间:{{ Number(item.sameDay) === 0 ? '隔天售后' : '当天售后' }}
+                退款:{{ Number(item.sameDay) === 0 ? '封账后退款' : '当天退款' }}
               </text>
               <text v-if="!$util.isEmpty(item.remark)">备注:{{item.remark}}</text>