shish před 12 hodinami
rodič
revize
5ab72389af
2 změnil soubory, kde provedl 110 přidání a 7 odebrání
  1. 37 2
      ghsApp/src/pagesGys/search.vue
  2. 73 5
      ghsApp/src/pagesGys/searchItem.vue

+ 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>