Просмотр исходного кода

采购售后返充 和 销挂账

shish 8 часов назад
Родитель
Сommit
851d2072dd
2 измененных файлов с 97 добавлено и 24 удалено
  1. 53 12
      ghsApp/src/pagesGys/details.vue
  2. 44 12
      ghsApp/src/pagesGys/detailsItem.vue

+ 53 - 12
ghsApp/src/pagesGys/details.vue

@@ -63,10 +63,17 @@
 						<view class="flex">合计金额:{{selectTotalAmount}}</view>
 						<view class="flex">实付金额:<input @focus="modifyPrice = null" v-model="modifyPrice" type="digit"/></view>
 						<view class="flex">优惠金额:{{(selectTotalAmount - modifyPrice).toFixed(2)}}</view>
-						<view class="flex">支付方式:
-							<picker mode="selector" :value="payWay" :range="payWayList" range-key="name" @change="changePayWayFn" class="tui-input" >
-							<div style="border:1upx solid #CCCCCC;width:300upx;height:70upx;line-height:70upx;">{{ payWayData.name }}</div>
-							</picker>
+						<view class="pay-way-row">
+							<view class="pay-way-label">支付方式:</view>
+							<view class="pay-way-btns">
+								<button
+									v-for="item in payWayList"
+									:key="item.id"
+									class="admin-button-com middle pay-way-btn"
+									:class="payWay === item.id ? 'blue' : 'default'"
+									@click="selectPayWay(item)"
+								>{{ item.name }}</button>
+							</view>
 						</view>
 					</view>
 				</view>
@@ -101,7 +108,6 @@ export default {
 			searchTime:'',
 			startTime:'',
 			endTime:'',
-			payWayData:{name:"线下微信",id:0},
 			payWayList:[{name:"线下微信",id:0},{name:"现金",id:4},{name:"线下支付宝",id:1},{name:"银行卡",id:5}],
 			payWay:0,
 			confirm:-1
@@ -138,7 +144,13 @@ export default {
 			if (this.detailsList) {
 				for (const item of this.detailsList) {
 					if (item.checked) {
-						amount=amount+Number(item.realPrice);
+						// 结账合计用剩余待结;无字段时回落 actPrice/realPrice
+						const remain = Number(item.remainDebtPrice)
+						if (remain > 0) {
+							amount = amount + remain
+						} else {
+							amount = amount + Number(item.actPrice || item.realPrice || 0)
+						}
 					}
 				}
 			}
@@ -168,10 +180,12 @@ export default {
 		init(){
 
 		},
-		changePayWayFn(e) {
-			let info = this.payWayList[e.detail.value]
-			this.payWay = info.id
-			this.payWayData = info
+		/** 结账弹窗:点选支付方式(替代原生 picker) */
+		selectPayWay(item) {
+			if (!item) {
+				return
+			}
+			this.payWay = item.id
 		},
 		selectDateFn(val){
 			this.searchTime = val.searchTime
@@ -426,9 +440,10 @@ export default {
 		.num_bx {
 			margin-top:30upx;
 			margin-bottom:50upx;
-			margin-left:80upx;
+			margin-left:40upx;
+			margin-right:40upx;
 			view{
-				height: 80upx;
+				min-height: 80upx;
 				font-size: 28upx;
 			}
 			input {
@@ -440,6 +455,32 @@ export default {
 				font-size: 35upx;
 				width:300upx;
 			}
+			.pay-way-row {
+				display: flex;
+				align-items: flex-start;
+				min-height: auto;
+				margin-top: 10upx;
+				.pay-way-label {
+					flex-shrink: 0;
+					line-height: 70upx;
+					min-height: auto;
+				}
+				.pay-way-btns {
+					flex: 1;
+					display: flex;
+					flex-wrap: wrap;
+					align-items: center;
+					min-height: auto;
+				}
+				.pay-way-btn {
+					margin: 0 12upx 12upx 0;
+					padding: 0 20upx;
+					min-width: 140upx;
+					height: 64upx;
+					line-height: 64upx;
+					font-size: 26upx;
+				}
+			}
 		}
 	}
 }

+ 44 - 12
ghsApp/src/pagesGys/detailsItem.vue

@@ -20,16 +20,24 @@
 				<view class="mark" style="color:red;font-weight:bold;">{{ info.remark }}</view>
 			</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;">已退¥{{info.tkPrice?parseFloat(info.tkPrice):0}}</text>
+					<text :class="[hasPartialClear ? 'price-del' : '']">¥{{ parseFloat(displayDebtPrice) }}</text>
+					<text v-if="Number(info.tkPrice)>0" style="margin-left:30upx;color:red;font-weight: normal;">当天已退¥{{info.tkPrice?parseFloat(info.tkPrice):0}}</text>
+					<text v-if="Number(info.nextDayTkPrice)>0" style="margin-left:20upx;color:#e67e22;font-weight: normal;">隔天已退¥{{parseFloat(info.nextDayTkPrice)}}</text>
 				</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>
+			<view class="item-row" v-if="hasPartialClear">
+				<view class="price" style="color:red;">已清 ¥{{ hasPayDebt }},剩余待结 ¥{{ parseFloat(remainDebtPrice) }}</view>
+			</view>
 		</view>
 	</view>
 </template>
 <script>
+/**
+ * 供货商采购挂账明细行:支持已清/剩余待结展示(对齐 pagesArrears/detailsItem)
+ */
 export default {
 	props: {
 		info: {
@@ -44,6 +52,32 @@ export default {
 			default: false
 		}
 	},
+	computed: {
+		remainDebtPrice() {
+			const remain = Number(this.info.remainDebtPrice)
+			if (remain > 0) {
+				return remain
+			}
+			return Number(this.info.actPrice || this.info.realPrice || 0)
+		},
+		displayDebtPrice() {
+			const debt = Number(this.info.debtPrice)
+			if (debt > 0) {
+				return debt
+			}
+			return this.remainDebtPrice
+		},
+		hasPayDebt() {
+			if (this.info.hasPayDebt != null && Number(this.info.hasPayDebt) > 0) {
+				return parseFloat(Number(this.info.hasPayDebt).toFixed(2))
+			}
+			const diff = this.displayDebtPrice - this.remainDebtPrice
+			return diff > 0 ? parseFloat(diff.toFixed(2)) : 0
+		},
+		hasPartialClear() {
+			return this.displayDebtPrice > this.remainDebtPrice
+		}
+	},
 	methods: {
 		goToDetai(item){
 			this.$util.pageTo({
@@ -101,22 +135,20 @@ export default {
 		display: flex;
 		align-items: center;
 		justify-content: space-between;
-
 		.mark {
-			font-size: 28upx;
-			font-weight: 400;
-			color: #666666;
+			font-size: 26upx;
+			color: #666;
 		}
 		.price {
+			font-size: 32upx;
+			font-weight: 600;
 			display: flex;
 			align-items: center;
-			font-size: 28upx;
+		}
+		.price-del {
+			text-decoration: line-through;
+			color: #999 !important;
 			font-weight: 600;
-			color: #333333;
-			.iconfont {
-				font-size: 28upx;
-				color: #999999;
-			}
 		}
 	}
 }