Selaa lähdekoodia

commit -m 收款工具

zhengjinyi 3 vuotta sitten
vanhempi
commit
d8364c5d3e

+ 2 - 7
components/cm-module/orderDetails/list-button.vue

@@ -33,7 +33,7 @@ export default {
 		return {
 			receipt:{},
 			btnState: this.initStatus(),
-			mapStateArr: [{ label: 'isConfirm', val: [1], status: true }],
+			mapStateArr: [{ label: 'isConfirm', val: [1,4,5], status: true }],
 			souStateArr:[
 				{ 
 					type:1,
@@ -101,13 +101,8 @@ export default {
 	methods: {
 		initData(resVal,dataVal) {
 			/**
-			 * @分享按钮统一显示
 			 * @按钮根据状态显示
-			 * @(4、5、7、12、22、23、32)显示[查看物流]按钮,其他隐藏
-			 * @(6)显示[删除订单],其他隐藏
-			 * @(0、111)显示[取消订单],其他隐藏
-			 * @(21,31)只显示分享
-			 * @(13,33)显示[确认收货]和[查看物流]
+			 * @收款状态:1待确认、4审核未通过、5收款撤销【线上支付成功为审核通过】
 			 */
 			this.receipt = dataVal
 			this.btnState = this.initStatus()

+ 3 - 3
components/cm-module/receipt/receipt-details.vue

@@ -1,7 +1,7 @@
 <template name="information">
 	<view class="information-template">
 		<!-- 订单信息 -->
-		<view class="list-title" @click.stop="orderDetail(order.orderId)">
+		<view class="list-title clearfix" @click.stop="orderDetail(order.orderId)">
 			<view class="list-title-t">
 				<view class="list-title-tip">
 					<text class="badges">{{ order.orderType | formatOrderType }}</text>
@@ -158,10 +158,10 @@ export default {
 		}
 		.list-title-b {
 			width: 100%;
-			height: 40rpx;
+			height: 44rpx;
 			float: left;
 			font-size: $font-size-24;
-			line-height: 40rpx;
+			line-height: 44rpx;
 			color: #666666;
 			text-align: left;
 			.text {

+ 6 - 3
components/cm-module/receipt/receipt-orderDetails.vue

@@ -34,7 +34,7 @@
 							备注:<text>{{ receiptInfo.reviewReason }}</text>
 						</view>
 					</view>
-					<view class="list-title clearfix" v-for="(order, index) in receiptInfo.orderList" :key="index" @click.stop="orderDetail(order.orderId)">
+					<view class="list-title item clearfix" v-for="(order, index) in receiptInfo.orderList" :key="index" @click.stop="orderDetail(order.orderId)">
 						<view class="list-title-t">
 							<view class="list-title-tip">
 								<text class="badges">{{ order.orderType | formatOrderType }}</text>
@@ -196,7 +196,10 @@ export default {
 	.list-title {
 		width: 100%;
 		height: auto;
-		padding: 10rpx 0;
+		padding: 12rpx 0;
+		&.item{
+			border-bottom: 1px solid #E1E1E1;
+		}
 		.list-title-t {
 			width: 100%;
 			height: 50rpx;
@@ -247,7 +250,7 @@ export default {
 			height: 44rpx;
 			float: left;
 			font-size: $font-size-24;
-			line-height: 40rpx;
+			line-height: 44rpx;
 			color: #666666;
 			text-align: left;
 			.text {

+ 108 - 70
components/cm-module/receipt/receipt-refund.vue

@@ -1,70 +1,44 @@
 <template name="information">
 	<view class="information-template">
 		 <!-- 订单信息 -->
-		<view class="list-title" @click.stop="orderDetail(order.id)">
+		<view class="list-title" @click.stop="orderDetail(order.mainOrder.orderId)">
 			<view class="list-title-t">
 				<view class="list-title-tip">
-					<text class="badges">{{ order.orderType | formatOrderType }}</text>
+					<text class="badges">{{ order.mainOrder.orderType | formatOrderType }}</text>
 				</view>
-				<view class="list-title-num">{{ order.statusName }}</view>
-			</view>
-			<view class="list-title-b">
-				客户名称:<text class="text">{{ order.userName }}</text>
+				<view class="list-title-tag" v-if="order.mainOrder.organizeId == 3">
+					<text class="badges">维沙</text>
+				</view>
+				<view class="list-title-num">{{ order.mainOrder.status | stateExpFormat }}</view>
 			</view>
-			<view class="list-title-b">
-				订单编号:<text class="text">{{ order.orderNo }} ( {{ order.orderId }} )</text>
+			<view class="list-title-a">
+				<view class="list-title-a-text">
+					子订单编号:<text class="text">{{ order.shopOrderNo }} ( {{ order.shopOrderId }} )</text>
+				</view>
+				<view class="list-title-a-text">
+					供应商名称:<text class="text">{{ order.shopName }}</text>
+				</view>
+				<view class="list-title-a-text">
+					订单金额:<text class="text">¥{{ order.needPayAmount | NumFormat }}</text>
+				</view>
 			</view>
 			<view class="list-title-b">
-				下单日期:<text class="text">{{ order.orderTime }}</text>
+				客户名称:<text class="text">{{ order.mainOrder.userName ? order.mainOrder.userName : '无' }}</text>
 			</view>
 			<view class="list-title-b">
-				<view class="list-title-b-item ">
-					订单金额:<text class="text">¥{{ order.payTotalFee | NumFormat }}</text>
-				</view>
-				<view class="list-title-b-item ">
-					余额抵扣:<text class="text">¥{{ order.balancePayFee | NumFormat }}</text>
-				</view>
+				订单编号:<text class="text">{{ order.mainOrder.orderNo }} ( {{ order.mainOrder.orderId }} )</text>
 			</view>
 			<view class="list-title-b">
-				<view class="list-title-b-item ">
-					应收金额:<text class="text">¥{{ order.payableAmount | NumFormat }}</text>
-				</view>
-				<view class="list-title-b-item ">
-					已收金额:<text class="text">¥{{ order.paidAmount | NumFormat }}</text>
-				</view>
+				下单日期:<text class="text">{{ order.mainOrder.orderTime }}</text>
 			</view>
 			<view class="list-title-b">
 				<view class="list-title-b-item ">
-					剩余应收:<text class="text">¥{{ order.surplusAmount | NumFormat }}</text>
+					订单金额:<text class="text">¥{{ order.mainOrder.payTotalFee | NumFormat }}</text>
 				</view>
 				<view class="list-title-b-item ">
-					待审金额:<text class="text">¥{{ order.receiptAmount | NumFormat }}</text>
+					已收金额:<text class="text">¥{{ order.mainOrder.paidAmount | NumFormat }}</text>
 				</view>
 			</view>
-			<view class="list-title-b">
-				经理折扣:
-				<text class="text" v-if="order.discountFee - order.returnedPurchaseFee > 0">
-					¥{{ order.discountFee - order.returnedPurchaseFee }}
-					<text>
-						(原¥{{ order.discountFee }} 折扣取消¥{{
-							order.discountFee - order.returnedPurchaseFee > 0
-								? order.returnedPurchaseFee
-								: order.discountFee
-						}})
-					</text>
-				</text>
-				<text v-else>¥0.00(原¥0.00折扣取消¥0.00)</text>
-			</view>
-			<view class="list-title-b" v-if="order.returnedPurchaseFee > 0">
-				退货退款:
-				<text class="text">
-					(原¥{{ order.returnedPurchaseFee }} 折扣取消¥{{
-						j.discountFee - j.returnedPurchaseFee > 0
-							? order.returnedPurchaseFee
-							: order.discountFee
-					}})
-				</text>
-			</view>
 		</view>
 	</view>
 </template>
@@ -85,29 +59,6 @@
 		created(){
 			this.initData(this.orderInfo)
 		},
-		filters: {
-			formatOrderType(value) {
-				switch (value) {
-					case 0:
-						return '协销订单'
-						break
-					case 1:
-						return '自主订单'
-						break
-					case 2:
-						return '客服订单'
-						break
-				}
-			},
-			NumFormat(value) {
-				//处理金额
-				if (value) {
-					return Number(value).toFixed(2)
-				} else {
-					return '0.00'
-				}
-			}
-		},
 		watch:{
 			orderInfo:{
 				handler:function(val){
@@ -129,5 +80,92 @@
 </script>
 
 <style lang="scss">
+	.list-title {
+		width: 100%;
+		height: auto;
+		.list-title-t {
+			width: 100%;
+			height: 50rpx;
+			float: left;
+			font-size: $font-size-28;
+			padding-bottom: 10rpx;
 	
+			.list-title-tip {
+				float: left;
+				.badges {
+					display: block;
+					float: left;
+					padding: 0 15rpx;
+					height: 40rpx;
+					line-height: 40rpx;
+					border-radius: 20rpx;
+					background: rgba(248, 204, 148, 0.5);
+					font-size: $font-size-24;
+					text-align: center;
+					color: #666666;
+				}
+			}
+			.list-title-tag {
+				float: left;
+				margin-left: 20rpx;
+				.badges {
+					display: block;
+					float: left;
+					padding: 0 15rpx;
+					height: 40rpx;
+					line-height: 40rpx;
+					border-radius: 20rpx;
+					background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
+					font-size: $font-size-24;
+					text-align: center;
+					color: #666666;
+				}
+			}
+			.list-title-num {
+				float: left;
+				text-align: left;
+				color: #e15616;
+				line-height: 40rpx;
+				margin-left: 20rpx;
+			}
+		}
+		.list-title-a {
+			width: 100%;
+			height: auto;
+			float: left;
+			padding: 5rpx 8rpx;
+			border-radius: 4rpx;
+			background-color: rgba(247, 247, 247, 1);
+			margin: 10rpx 0;
+			.text{
+				color: #999999;
+			}
+			.list-title-a-text {
+				width: 100%;
+				height: 50rpx;
+				float: left;
+				font-size: $font-size-24;
+				line-height: 50rpx;
+				color: #666666;
+				text-align: left;
+			}
+		}
+		.list-title-b {
+			width: 100%;
+			height: 50rpx;
+			float: left;
+			font-size: $font-size-24;
+			line-height: 50rpx;
+			color: #666666;
+			text-align: left;
+			.text{
+				color: #999999;
+			}
+			.list-title-b-item {
+				width: 50%;
+				height: 100%;
+				float: left;
+			}
+		}
+	}
 </style>

+ 7 - 8
pages/collection/list.vue

@@ -139,8 +139,9 @@
 		<tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel1" :custom="true" fadeIn >
 			<view class="tui-modal-custom">
 				<view class="tui-prompt-title">非订单款项</view>
-				<view class="tui-prompt-textarea" :class="modal1 ? 'show' : 'none'">
+				<view class="tui-prompt-textarea" >
 					<textarea
+						:class="modal1 ? 'show' : 'none'"
 						class="textarea"
 						placeholder="请填写说明(必填)"
 						v-model="noOrderReason"
@@ -541,9 +542,7 @@
 						this.pullUpOn = true
 						this.currents = index
 						this.listQuery.receiptType = type
-						if(index == 1){
-							this.listQuery.receiptStatus = 0
-						}
+						this.listQuery.receiptStatus = 0
 						this.getOrderDatainit()
 						this.tabCurrents = 0
 						break
@@ -578,7 +577,7 @@
 			setTimeout(() => {
 				this.listQuery.pageNum = 1
 				this.currents = 0
-				// this.getOrderDatainit(this.currents)
+				this.getOrderDatainit()
 				uni.stopPullDownRefresh()
 			}, 200)
 		},
@@ -1082,13 +1081,13 @@
 		border-radius: 8rpx;
 		padding:15rpx 20rpx;
 		margin-top: 10rpx;
-		&.none{
-			display: none;
-		}
 		.textarea {
 			width: 100%;
 			height: 100%;
 			font-size: $font-size-26;
+			&.none{
+				display: none;
+			}
 		}
 	}
 	.tui-prompt-flex{

+ 1 - 3
pages/collection/nosms.vue

@@ -330,9 +330,7 @@
 			}, 200)
 		},
 		onShow() {
-			if (this.hasLogin) {
-				this.GetDataInfo()
-			}
+			
 		}
 	}
 </script>

+ 1 - 2
pages/collection/sms.vue

@@ -238,8 +238,7 @@ export default {
 			paymentTypeText: '普通款项', // 款项类型显示文案
 			banksTypeText: '', // 款项类型显示文案
 			params: {
-				smsContent:
-					'【中信银行】您尾号0897的中信卡于02月22日14:42,二代支付存入人民币10000.00元,当前余额为人民币100000.67元。', // 收款短信
+				smsContent:'', // 收款短信
 				payType: null, //付款类型
 				receiptType: 1, // 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
 				receiptAmount: '', //收款金额

+ 70 - 43
pages/login/login-share.vue

@@ -26,9 +26,8 @@ export default {
 			receiptType:1// 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
 		} 
 	},
-	onLoad(options) {
+	onLoad(option) {
 		this.receiptId = option.id
-		this.receiptType = option.receiptType
 	},
 	methods: {
 		...mapMutations(['login', 'logout']),
@@ -45,65 +44,93 @@ export default {
 				this.login(response.data)
 				this.$store.commit('updateStatus',response.data)
 				setTimeout(()=>{
-					this.navigateLink(response.data)
-				},500)
+					this.getOrderReceiptDetailType(this.receiptId,response.data)
+				},1000)
 			}).catch(error =>{
 				this.logout()
 				this.skeletonShow = false
 				this.$store.commit('updateStatus',error.data)
+				this.$api.navigateTo('/pages/login/login-account')
 			})
 		},
 		navigateLink(data){// 根据用户权限跳转对应页面
-			/**
-			 * 用户类型(userType) 1协销人员,2客服,3财务,4超级管理员
-			 * 1. 协销人员跳转到收款列表页面
-			 * 2. 客服跳转到收款列表页面
-			 * 3. 财务人员跳转到款项识别页面
-			 * 4. 超级管理员跳转到款项识别页面
-			 * */
+			
 			 switch(data.userType){
 				 case 1:// 协销
-					this.receiptTypeJump()
+					this.getOrderReceiptDetailType(this.receiptId,data)
 					break
 				 case 2:// 客服
-					this.receiptTypeJump()
+					this.getOrderReceiptDetailType(this.receiptId,data)
 					break
 				 case 3:// 财务
-					this.receiptTypeJump()
+					this.getOrderReceiptDetailType(this.receiptId,data)
 					break
 				 case 4:// 超级管理员
-					this.receiptTypeJump()
+					this.getOrderReceiptDetailType(this.receiptId,data)
 					break
 			 }
 		},
-		receiptTypeJump(){//跳转URL 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
-			switch(this.receiptType){
-				case 1:// 订单款
-					this.$api.navigateTo(`/pages/relation/ordinary/index?id=${this.receiptId}`)
-					break
-				case 2:// 非订单款
-					this.$api.navigateTo(`/pages/relation/nonorder/detail?id=${this.receiptId}`)
-					break
-				case 3:// 返佣款
-					this.$api.navigateTo(`/pages/relation/return/index?id=${this.receiptId}`)
-					break
-				case 4:// 订单款或者非订单款
-					this.$api.navigateTo(`/pages/relation/ordinary/index?id=${this.receiptId}`)
-					break
-				case 5:// 供应商退款管理权限
-					this.$api.navigateTo(`/pages/relation/refund/index?id=${this.receiptId}`)
-					break
-			}
-		},
-		permissionNav(data){
-			/**
-			 * 用户权限(permission) 1录入收款权限,2收款确认权限,3收款审核权限 4返佣管理权限 5供应商退款管理权限
-			 * 1. 
-			 * 2. 
-			 * 3. 
-			 * 4.
-			 * 5.
-			 * */
+		getOrderReceiptDetailType(id) {
+			// 收款详情查询跳转URL 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
+			this.OrderService.orderReceiptDetailType({ id: id })
+				.then(response => {
+					/**
+					 * 用户类型(userType) 1协销人员,2客服,3财务,4超级管理员
+					 * 1. 协销人员跳转到收款列表页面
+					 * 2. 客服跳转到收款列表页面
+					 * 3. 财务人员跳转到款项识别页面
+					 * 4. 超级管理员跳转到款项识别页面
+					 * */
+					// switch(data.userType){
+					// 	 case 1:// 协销
+					// 		this.getOrderReceiptDetailType(this.receiptId,data)
+					// 		break
+					// 	 case 2:// 客服
+					// 		this.getOrderReceiptDetailType(this.receiptId,data)
+					// 		break
+					// 	 case 3:// 财务
+					// 		this.getOrderReceiptDetailType(this.receiptId,data)
+					// 		break
+					// 	 case 4:// 超级管理员
+					// 		this.getOrderReceiptDetailType(this.receiptId,data)
+					// 		break
+					// }
+					const receipt = response.data
+					switch(receipt.receiptType){
+						case 1:// 1:订单 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
+							if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 订单待确认
+								console.log('订单待确认')
+								this.$api.navigateTo(`/pages/relation/ordinary/index?id=${receipt.id}`)
+							}else if(receipt.receiptStatus == 2){// 待审核
+								console.log('待审核')
+								this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?id=${receipt.id}`)
+							}else if(receipt.receiptStatus == 3){// 审核通过
+								console.log('审核通过')
+								this.$api.navigateTo(`/pages/relation/ordinary/detail?id=${receipt.id}`)
+							}
+							break
+						case 2:// 2:非订单 
+							this.$api.navigateTo(`/pages/relation/nonorder/detail?id=${receipt.id}`)
+							break
+						case 3:// 3:返佣 
+							if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 返佣待确认
+								this.$api.navigateTo(`/pages/relation/return/index?id=${receipt.id}`)
+							}else if(receipt.receiptStatus == 2){
+								this.$api.navigateTo(`/pages/relation/return/detail?id=${receipt.id}`)
+							}
+							break
+						case 5:// 4:供应商退款
+							if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 返佣待确认
+								this.$api.navigateTo(`/pages/relation/refund/index?id=${receipt.id}`)
+							}else if(receipt.receiptStatus == 2){
+								this.$api.navigateTo(`/pages/relation/refund/detail?id=${receipt.id}`)
+							}
+							break
+					}
+				})
+				.catch(err => {
+					console.log('=======>分享查询收款详情异常<=======')
+				})
 		}
 	},
 	onShow() {

+ 1 - 1
pages/relation/nonorder/detail.vue

@@ -9,7 +9,7 @@
 			<view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
 			<view class="header-sit">
 				<text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
-				<text class="header-sit-text">审核详情</text>
+				<text class="header-sit-text">非订单款项详情</text>
 			</view>
 		</view>
 		<view

+ 11 - 7
pages/relation/order/detail.vue

@@ -20,7 +20,7 @@
 			}"
 		>
 		</view>
-		<view class="distinguish-section" :style="{ top: CustomBar - 14 + 'px', left: 0 + 'px' }">
+		<view class="distinguish-section" :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
 			<view class="distinguish-section-conten">
 				<view class="section-top">
 					<view class="section-badges">
@@ -39,7 +39,7 @@
 				<view class="section-mid">
 					<view class="list-title">
 						<view class="list-title-b">
-							客户名称:<text class="text">{{ order.userName }}</text>
+							客户名称:<text class="text">{{ order.userName ? order.userName : '无' }}</text>
 						</view>
 						<view class="list-title-b">
 							订单编号:<text class="text">{{ order.orderNo }} ( {{ order.orderId }} )</text>
@@ -73,7 +73,7 @@
 							退货退款: 
 							<text class="text">
 								(原¥{{ order.returnedPurchaseFee }} 折扣取消¥{{
-									j.discountFee - j.returnedPurchaseFee > 0
+									order.discountFee - order.returnedPurchaseFee > 0
 										? order.returnedPurchaseFee
 										: order.discountFee
 								}})
@@ -95,11 +95,14 @@
 								待审金额:<text class="text">¥{{ order.unCheckAmount | NumFormat }}</text>
 							</view>
 						</view>
+						<view class="list-title-b" v-if="order.discountFee - order.returnedPurchaseFee > 0">
+							<text class="text">说明:因退货,经理折扣收回,用于抵扣退款。</text>
+						</view>
 					</view>
 				</view>
-				<view class="section-mid supper">
+				<view class="section-mid supper clearfix">
 					<view v-for="(shop, index) in order.shopOrderList" :key="index">
-						<view class="list-title supper">
+						<view class="list-title supper clearfix">
 							<view class="list-title-b">
 								子订单号(标识):<text class="text">{{ shop.orderNo }} ( {{ shop.shopOrderId }} )</text>
 							</view>
@@ -110,7 +113,7 @@
 								订单金额:<text class="text">¥{{ shop.needPayAmount | NumFormat }}</text>
 							</view>
 						</view>
-						<view class="list-goods">
+						<view class="list-goods clearfix">
 							<view
 								class="list-goods-item"
 								v-for="(product, pIndex) in shop.orderProductList"
@@ -423,6 +426,7 @@ page {
 				.list-goods-item {
 					width: 100%;
 					height: 180rpx;
+					float: left;
 					margin-bottom: 20rpx;
 					.list-goods-image {
 						width: 180rpx;
@@ -493,7 +497,7 @@ page {
 			height: auto;
 			&.supper {
 				background-color: #f7f7f7;
-				padding: 0 10rpx;
+				padding:10rpx;
 			}
 			.list-title-b {
 				width: 100%;

+ 42 - 3
pages/relation/ordinary/detail.vue

@@ -20,7 +20,14 @@
 			}"
 		>
 		</view>
-		<view class="distinguish-section" :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="7"
+		></tui-skeleton>
+		<view class="distinguish-section" v-else :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
 			<view class="distinguish-section-conten">
 				<view class="section-top">
 					<view class="title">
@@ -56,6 +63,9 @@
 				<view class="section-mid">
 					<view class="tui-order-item" v-for="(order, orderIndex) in receiptInfo.orderList" :key="orderIndex">
 						<receipt-details :orderInfo="order"></receipt-details>
+						<view class="list-detail" @click="orderDetail(order.orderId)">
+							<text class="iconfont icon-xiayibu"></text>
+						</view>
 					</view>
 				</view>
 				<view class="section-title">状态</view>
@@ -110,6 +120,7 @@ export default {
 			scrollH: 0, //滚动总高度
 			opcity: 1,
 			isCmcustomClass: 'left',
+			skeletonShow:true,
 			nvabarData: {
 				//顶部自定义导航
 				showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
@@ -156,17 +167,23 @@ export default {
 			this.OrderService.orderReceiptDetail({ id: id })
 				.then(response => {
 					this.receiptInfo = response.data
-					this.skeletonShow = false
+					setTimeout(()=>{
+						this.skeletonShow = false
+					},1000)
 				})
 				.catch(err => {
 					this.$util.msg(err.msg, 2000)
 				})
 		},
+		orderDetail(orderId) {
+			//订单详情跳转
+			this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
+		},
 		toNoSms(url) {
 			this.$api.navigateTo(url)
 		},
 		formatColor(state) {
-			//设置邀请码状态亚瑟
+			//设置颜色
 			let stateColor = '',
 				stateColorObject = {
 					1: '#FEAC20',
@@ -414,6 +431,28 @@ page {
 		text-align: left;
 	}
 }
+.tui-order-item {
+	display: flex;
+	flex-direction: column;
+	width: 100%;
+	background: #fff;
+	margin-bottom: 24rpx;
+	border-radius: 8rpx;
+	position: relative;
+	.list-detail {
+		width: 70rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		text-align: right;
+		position: absolute;
+		right: 0;
+		bottom: 0;
+		.iconfont {
+			font-size: $font-size-32;
+			color: #999999;
+		}
+	}
+}
 .distinguish-button {
 	width: 100%;
 	position: fixed;

+ 65 - 16
pages/relation/ordinary/examine-detail.vue

@@ -13,7 +13,14 @@
 		<view class="tui-header-box"
 			:style="{ height: CustomBar + 30 + 'px', backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)' }">
 		</view>
-		<view class="distinguish-section" :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="7"
+		></tui-skeleton>
+		<view class="distinguish-section" v-else :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
 			<view class="distinguish-section-conten">
 				<view class="section-top">
 					<view class="title">
@@ -64,6 +71,9 @@
 				<view class="section-mid">
 					<view class="tui-order-item" v-for="(order, orderIndex) in receiptInfo.orderList" :key="orderIndex">
 						<receipt-details :orderInfo="order"></receipt-details>
+						<view class="list-detail" @click="orderDetail(order.orderId)">
+							<text class="iconfont icon-xiayibu"></text>
+						</view>
 					</view>
 				</view>
 				<view class="section-title">状态</view>
@@ -84,21 +94,22 @@
 			<view class="button confirm" @click="confirmDistinguish(1)">通过</view>
 		</view>
 		<!-- 审核通过弹窗 -->
-		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333"
+		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel(0)" :content="contentModalText" color="#333"
 			:size="32" shape="circle" :maskClosable="false"></tui-modal>
 		<!--不通过审核备注弹窗  -->
-		<tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel1" :custom="true" fadeIn >
+		<tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel(1)" :custom="true" fadeIn >
 			<view class="tui-modal-custom">
 				<view class="tui-prompt-title">确认不通过</view>
 				<view class="tui-prompt-textarea">
 					<textarea
+						:class="modal1 ? 'show' : 'none'"
 						class="textarea"
-						placeholder="请填写不通过说明(必填)"
+						placeholder="请输入不通过说明(必填)"
 						v-model="noReviewReason"
 					/>
 				</view>
 				<view class="tui-prompt-flex">
-					<view class="btn btn-cancel" @click="hideMobel1">取消</view>
+					<view class="btn btn-cancel" @click="hideMobel(1)">取消</view>
 					<view class="btn btn-confirm" @click="handleClick1">确定</view>
 				</view>
 			</view>
@@ -126,6 +137,7 @@
 				scrollH: 0, //滚动总高度
 				opcity: 1,
 				isCmcustomClass: 'left',
+				skeletonShow:true,
 				nvabarData: {
 					//顶部自定义导航
 					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
@@ -184,7 +196,9 @@
 				this.OrderService.orderReceiptDetail({ id : id})
 					.then(response => {
 						this.receiptInfo = response.data
-						this.skeletonShow = false
+						setTimeout(()=>{
+							this.skeletonShow = false
+						},1000)
 					})
 					.catch(err => {
 						this.$util.msg(err.msg, 2000)
@@ -195,11 +209,13 @@
 				this.OrderService.orderReceiptAudit(params)
 				.then(response => {
 					this.$util.msg('操作成功~', 2000, true, 'success')
-					if(this.params.receiptStatus == 3){//通过审核跳转
-						this.$api.navigateTo(`/pages/relation/ordinary/detail?id=${this.params.id}`)
-					}else{//不通过审核跳转
-						this.$api.navigateTo(`/pages/relation/ordinary/index?id=${this.params.id}`)
-					}
+					setTimeout(()=>{
+						if(this.params.receiptStatus == 3){//通过审核跳转
+							this.$api.navigateTo(`/pages/relation/ordinary/detail?id=${this.params.id}`)
+						}else{//不通过审核跳转
+							this.$api.navigateTo(`/pages/relation/ordinary/index?id=${this.params.id}`)
+						}
+					},2000)
 				})
 				.catch(error => {
 					this.$util.msg(error.msg, 2000)
@@ -237,17 +253,25 @@
 				this.orderReceiptAudit(this.params)
 				this.modal1 = false
 			},
-			hideMobel() {
-				this.modal = false
+			hideMobel(type) {
+				switch(type){
+					case 0:
+						this.modal = false
+						break
+					case 1:
+						this.modal1 = false
+						break
+				}
 			},
-			hideMobel1() {
-				this.modal1 = false
+			orderDetail(orderId) {
+				//订单详情跳转
+				this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
 			},
 			toNoSms(url) {
 				this.$api.navigateTo(url)
 			},
 			formatColor(state) {
-				//设置邀请码状态亚瑟
+				//设置颜色
 				let stateColor = '',
 					stateColorObject = {
 						1: '#FEAC20',
@@ -512,6 +536,28 @@
 			text-align: left;
 		}
 	}
+	.tui-order-item {
+		display: flex;
+		flex-direction: column;
+		width: 100%;
+		background: #fff;
+		margin-bottom: 24rpx;
+		border-radius: 8rpx;
+		position: relative;
+		.list-detail {
+			width: 70rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: right;
+			position: absolute;
+			right: 0;
+			bottom: 0;
+			.iconfont {
+				font-size: $font-size-32;
+				color: #999999;
+			}
+		}
+	}
 	.distinguish-button {
 		width: 100%;
 		position: fixed;
@@ -555,6 +601,9 @@
 			width: 100%;
 			height: 100%;
 			font-size: $font-size-26;
+			&.none{
+				display: none;
+			}
 		}
 	}
 	.tui-prompt-flex{

+ 180 - 297
pages/relation/ordinary/index.vue

@@ -23,8 +23,17 @@
 				<view v-if="!isShowHeader">
 					<view class="tui-header-top">
 						<view class="title"> 收款信息 </view>
-						<view class="tui-header-button" v-if="receiptInfo.orderList.length>0">
-							<view class="button btn-confirm" @click.stop="showReceiptModel"> 查看关联信息 </view>
+						<view class="tui-header-button">
+							<view
+								class="button btn-error"
+								@click.stop="showReceiptModel"
+								v-if="receiptInfo.orderList.length > 0"
+							>
+								查看关联信息
+							</view>
+							<view class="button btn-confirm" @click="toNoSms('/pages/collection/list')">
+								<text class="iconfont icon-wodedingdan"></text>收款列表
+							</view>
 						</view>
 					</view>
 					<view class="tui-header-item">
@@ -72,7 +81,7 @@
 						v-if="currents == 3"
 						class="input"
 						type="text"
-						v-model="refundListQuery.shopName"
+						v-model="refundListQuery.keyword"
 						confirm-type="search"
 						@confirm="subMitSearch(2)"
 						placeholder="搜索关键词(供应商名称)"
@@ -138,7 +147,7 @@
 											:class="order.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
 										></text>
 									</view>
-									<view class="list-detail" @click="orderDetail(order.id)">
+									<view class="list-detail" @click="orderDetail(order.orderId)">
 										<text class="iconfont icon-xiayibu"></text>
 									</view>
 								</template>
@@ -147,12 +156,10 @@
 									<view class="list-checked" @click="checkedRefundOrder(order, orderIndex)">
 										<text
 											class="iconfont"
-											:class="
-												checkedRefundIndex == orderIndex ? 'icon-yixuanze' : 'icon-weixuanze'
-											"
+											:class="order.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
 										></text>
 									</view>
-									<view class="list-detail" @click="orderDetail(order.id)">
+									<view class="list-detail" @click="orderDetail(order.orderId)">
 										<text class="iconfont icon-xiayibu"></text>
 									</view>
 								</template>
@@ -166,7 +173,8 @@
 				</view>
 			</view>
 			<view class="distinguish-button" :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }">
-				<view class="button" @click="confirmDistinguish">确认</view>
+				<view class="button" @click="confirmDistinguishRefund" v-if="currents == 3">确认关联退款子订单</view>
+				<view class="button" @click="confirmDistinguish" v-else>确认</view>
 			</view>
 		</view>
 		<!-- 弹窗 -->
@@ -181,21 +189,25 @@
 			:maskClosable="false"
 		></tui-modal>
 		<!-- 关联提示弹窗 -->
-		<receipt-modal 
+		<receipt-modal
 			v-if="modal1"
-			:show="modal1" 
+			:show="modal1"
 			:amount="receiptInfo.receiptAmount"
-			:totalOrder="totalOrder" 
-			:modelTpye="modelTpye" 
-			@cancel="hideMobel(1)" 
-			@click="handleClick1">
+			:totalOrder="totalOrder"
+			:modelTpye="modelTpye"
+			@cancel="hideMobel(1)"
+			@click="handleClick1"
+		>
 		</receipt-modal>
-		<receipt-orderDetails 
-			v-if="modal2"
-			:receipt="receiptInfo"
-			@cancel="hideMobel(2)"
-			>
-		</receipt-orderDetails>
+		<!-- 关联信息 -->
+		<receipt-orderDetails v-if="modal2" :receipt="receiptInfo" @cancel="hideMobel(2)"> </receipt-orderDetails>
+		<!-- 供应商退款子订单关联弹窗 -->
+		<tui-modal :show="modal3" :padding="'40rpx 30rpx'" @cancel="hideMobel(3)" :custom="true" fadeIn>
+			<view class="tui-modal-custom">
+				<view class="tui-prompt-text"> {{ contentModalText }} </view>
+				<view class="tui-prompt-flex"> <view class="btn btn-confirm" @click="hideMobel(3)">知道了</view> </view>
+			</view>
+		</tui-modal>
 	</view>
 </template>
 <script>
@@ -218,7 +230,7 @@ const defaultListQuery = {
 const defaultRefundListQuery = {
 	id: 0, //收款Id
 	confirmedType: 0, // 0待确认,2已确认
-	shopName: '', //供应商名称
+	keyword: '', //供应商名称
 	pageNum: 1, // 页码
 	pageSize: 10 // 条数
 }
@@ -247,11 +259,11 @@ export default {
 				{
 					name: '小程序订单',
 					type: 3
-				},
-				{
-					name: '退款子订单',
-					type: 4
 				}
+				// 	{
+				// 		name: '退款子订单',
+				// 		type: 4
+				// 	}
 			],
 			listReturnType: [
 				{
@@ -280,6 +292,7 @@ export default {
 			modal: false,
 			modal1: false,
 			modal2: false,
+			modal3: false,
 			hanldOrder: '', //储存监听订单信息
 			OperationType: '', //操作类型
 			isCmcustomClass: 'left',
@@ -289,22 +302,26 @@ export default {
 			scrollH: 0, //滚动总高度
 			opcity: 1,
 			checkedOrderList: [],
-			checkedIds:[],
-			checkedRefundIndex: 0,
-			confirmParams:{
-				confirmType:4,
-				id:0,
-				orderIds:'',
+			checkedIds: [],
+			checkedRefundIndex: '',
+			confirmParams: {
+				confirmType: 4,
+				id: 0,
+				orderIds: ''
+			},
+			confirmRefundParams: {
+				shopOrderId: 0,
+				id: 0
 			},
 			skeletonShow: true,
-			modelTpye:1,// 收款弹窗类型
+			modelTpye: 1, // 收款弹窗类型
 			totalOrder: {
-				orderNums:1,
+				orderNums: 1,
 				payTotalFee: 0, // 订单金额
 				balancePayFee: 0, // 余额抵扣
 				payableAmount: 0, // 应收金额
-				paidAmount: 0 ,//  已收金额
-				surplusAmount:0 // 剩余应收
+				paidAmount: 0, //  已收金额
+				surplusAmount: 0 // 剩余应收
 			} // 统计都选相同的订单数据
 		}
 	},
@@ -319,7 +336,7 @@ export default {
 				this.scrollH = res.windowWidth * 0.6
 			}
 		})
-		this.listQuery.id = this.refundListQuery.id = this.confirmParams.id = option.id
+		this.listQuery.id = this.confirmParams.id = this.confirmRefundParams.id = option.id
 		this.getOrderReceiptDetail(this.listQuery.id)
 	},
 	computed: {
@@ -499,67 +516,9 @@ export default {
 			//用户操作订单
 			let index = e.index
 			if (index == 1) {
-				switch (this.OperationType) {
-					case 'delete': //删除订单
-						this.handOrderDetele(this.hanldOrder)
-						break
-					case 'cancel': //取消订单
-						this.modal = true
-						this.handCenceConfirm(this.hanldOrder)
-						break
-					case 'refund': //退款
-						this.modal = true
-						this.handRefundConfirm(this.hanldOrder)
-						break
-					case 'returned': //退货
-						this.modal = true
-						this.handReturnedConfirm(this.hanldOrder)
-						break
-					case 'confirm': //确认收货
-						this.handOrderConfirm(this.hanldOrder)
-						break
-					case 'cancelRefund': //确认收货
-						this.handCancelRefundConfirm(this.hanldOrder)
-						break
-				}
 			}
 			this.modal = false
 		},
-		handleClick1(data){
-			switch(data){
-				case 1: // 小额抹平确认
-					console.log('小额抹平确认')
-					this.confirmParams.confirmType = data
-					this.confirmParams.orderIds = this.checkedIds.join(',')
-					this.orderReceiptConfirm()
-					this.modal1 = false
-					break
-				case 3: // 大额退款余额
-					console.log('大额退款余额')
-					this.confirmParams.confirmType = data
-					this.confirmParams.orderIds = this.checkedIds.join(',')
-					this.orderReceiptConfirm()
-					this.modal1 = false
-					break
-				case 4: // 确认关联
-					console.log('确认关联')
-					this.confirmParams.confirmType = data
-					this.confirmParams.orderIds = this.checkedIds.join(',')
-					this.orderReceiptConfirm()
-					this.modal1 = false
-					break
-			}
-		},
-		orderReceiptConfirm(){
-			//确认关联或抹平或退款余额
-			this.OrderService.orderReceiptConfirm(this.confirmParams)
-				.then(response => {
-					this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?id=${this.confirmParams.id}`)
-				})
-				.catch(error => {
-					this.$util.msg(error.msg, 2000)
-				})
-		},
 		confirmDistinguish() {
 			// 点击确认
 			const list = []
@@ -569,21 +528,16 @@ export default {
 				}
 			})
 			if (this.checkedOrderList.length == 0) {
-				this.$util.msg('请选择需要关联的订单!', 2000)
+				this.$util.msg('请选择订单!', 2000)
 				return
 			}
-			if(this.currents === 1){// 订金订单每次只能关联一个订单
+			if (this.currents === 1) {
+				// 订金订单每次只能关联一个订单
 				if (this.checkedOrderList.length > 1) {
 					this.$util.msg('订金订单每次只能关联一个订单!', 2000)
 					return
 				}
 			}
-			if(this.currents === 3){// 退款子订单每次只能关联一个子订单
-				if (this.checkedOrderList.length > 1) {
-					this.$util.msg('只能选择一个子订单!', 2000)
-					return
-				}
-			}
 			if (list.length > 1) {
 				this.$util.msg('请选择相同机构的订单!', 2000)
 				return
@@ -608,30 +562,90 @@ export default {
 			this.totalOrder.payableAmount = Number(payableAmount.toFixed(2))
 			this.totalOrder.paidAmount = Number(paidAmount.toFixed(2))
 			this.totalOrder.orderNums = this.checkedOrderList.length
-			
-			if(this.currents === 1){// 收款金额必须等于订金订单金额才能关联
+			if (this.currents === 1) {
+				// 收款金额必须等于订金订单金额才能关联
 				if (this.receiptInfo.receiptAmount != this.totalOrder.payTotalFee) {
 					this.$util.msg('收款金额必须等于订金订单金额才能关联!', 2000)
 					return
 				}
 			}
 			console.log('totalOrder', this.totalOrder)
-			 //处理收款状态的几种类型
-			if(this.receiptInfo.receiptAmount == this.totalOrder.payableAmount || (this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) > 10){
+			//处理收款状态的几种类型
+			if (
+				this.receiptInfo.receiptAmount == this.totalOrder.payableAmount ||
+				this.totalOrder.payableAmount - this.receiptInfo.receiptAmount > 10
+			) {
 				//收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10
 				this.modelTpye = 1
-				console.log('收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10',this.modelTpye)
-			}else if(this.receiptInfo.receiptAmount > this.totalOrder.payableAmount){
+				console.log('收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10', this.modelTpye)
+			} else if (this.receiptInfo.receiptAmount > this.totalOrder.payableAmount) {
 				//收款金额大于订单应收金额(可退款到余额)
 				this.modelTpye = 2
-				console.log('收款金额大于订单应收金额(可退款到余额)',this.modelTpye)
-			}else if((this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) <= 10){
+				console.log('收款金额大于订单应收金额(可退款到余额)', this.modelTpye)
+			} else if (this.totalOrder.payableAmount - this.receiptInfo.receiptAmount <= 10) {
 				//订单应收总金额减去收款金额小于等于10元时,才能抹平确认
 				this.modelTpye = 3
-				console.log('订单应收总金额减去收款金额小于等于10元时,才能抹平确认)',this.modelTpye)
+				console.log('订单应收总金额减去收款金额小于等于10元时,才能抹平确认)', this.modelTpye)
 			}
 			this.modal1 = true
 		},
+		confirmDistinguishRefund() {
+			//确认关联供应商退款子订单
+			if (this.confirmRefundParams.shopOrderId == 0) {
+				this.$util.msg('请选择订单!', 2000)
+				return
+			}
+			this.orderReceiptConfirmRefund(this.confirmRefundParams)
+		},
+		handleClick1(data) {
+			switch (data) {
+				case 1: // 小额抹平确认
+					console.log('小额抹平确认')
+					this.confirmParams.confirmType = data
+					this.confirmParams.orderIds = this.checkedIds.join(',')
+					this.orderReceiptConfirm()
+					this.modal1 = false
+					break
+				case 3: // 大额退款余额
+					console.log('大额退款余额')
+					this.confirmParams.confirmType = data
+					this.confirmParams.orderIds = this.checkedIds.join(',')
+					this.orderReceiptConfirm()
+					this.modal1 = false
+					break
+				case 4: // 确认关联
+					console.log('确认关联')
+					this.confirmParams.confirmType = data
+					this.confirmParams.orderIds = this.checkedIds.join(',')
+					this.orderReceiptConfirm()
+					this.modal1 = false
+					break
+			}
+		},
+		orderReceiptConfirmRefund(params) {
+			//确认关联退款子订单
+			this.OrderService.orderReceiptConfirmRefund(params)
+				.then(response => {
+					this.$util.msg('关联成功~', 2000, true, 'success')
+					setTimeout(() => {
+						this.$api.navigateTo(`/pages/relation/refund/detail?id=${this.confirmRefundParams.id}`)
+					}, 2000)
+				})
+				.catch(error => {
+					this.modal3 = true
+					this.contentModalText = error.msg
+				})
+		},
+		orderReceiptConfirm() {
+			//确认关联订单或抹平或退款余额
+			this.OrderService.orderReceiptConfirm(this.confirmParams)
+				.then(response => {
+					this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?id=${this.confirmParams.id}`)
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
 		checkedOrder(order) {
 			// 勾选关联订单
 			order.isChecked = !order.isChecked
@@ -645,10 +659,18 @@ export default {
 			// 勾选退款子订单
 			this.checkedOrderList = []
 			this.checkedRefundIndex = index
-			this.checkedOrderList.push(order)
+			this.orderList.forEach((el, index) => {
+				if (this.checkedRefundIndex == index) {
+					el.isChecked = true
+					this.confirmRefundParams.shopOrderId = el.shopOrderId
+				} else {
+					el.isChecked = false
+				}
+			})
+			console.log('shopOrderId', this.confirmRefundParams.shopOrderId)
 		},
 		hideMobel(type) {
-			switch(type){
+			switch (type) {
 				case 0:
 					this.modal = false
 					break
@@ -658,6 +680,9 @@ export default {
 				case 2:
 					this.modal2 = false
 					break
+				case 3:
+					this.modal3 = false
+					break
 			}
 		},
 		formatColor(state) {
@@ -729,7 +754,11 @@ export default {
 					}
 			}
 		},
-		showReceiptModel(){//
+		toNoSms(url) {
+			this.$api.navigateTo(url)
+		},
+		showReceiptModel() {
+			//
 			this.modal2 = true
 		}
 	},
@@ -868,22 +897,21 @@ page {
 			box-sizing: border-box;
 			height: 100%;
 			line-height: 66rpx;
-			padding: 5rpx 0;
 			.button {
 				float: left;
 				box-sizing: border-box;
 				padding: 0 24rpx;
 				height: 100%;
-				line-height: 56rpx;
+				line-height: 66rpx;
 				border-radius: 8rpx;
 				text-align: center;
 				color: #ffffff;
 				margin-left: 10rpx;
 				&.btn-confirm {
-					background: #f0ad4e
+					background: $color-system;
 				}
 				&.btn-error {
-					background: #ff5000;
+					background: #f0ad4e;
 				}
 			}
 		}
@@ -957,7 +985,7 @@ page {
 			top: 0;
 			color: #dd524d;
 			z-index: 99;
-			.list-icon-image{
+			.list-icon-image {
 				width: 120rpx;
 				height: 120rpx;
 				display: block;
@@ -1036,6 +1064,7 @@ page {
 			padding-left: 70rpx;
 			background: #f7f7f7;
 			border-radius: 8rpx;
+			font-size: $font-size-26;
 		}
 		.icon-sousuo {
 			width: 80rpx;
@@ -1044,7 +1073,7 @@ page {
 			line-height: 70rpx;
 			text-align: center;
 			color: #999999;
-			font-size: $font-size-40;
+			font-size: $font-size-38;
 			position: absolute;
 			left: 0;
 			top: 0;
@@ -1112,55 +1141,7 @@ page {
 		justify-content: space-between;
 		color: #fff;
 	}
-
-	.tui-btm-item {
-		flex: 1;
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.tui-btm-num {
-		font-size: 32rpx;
-		font-weight: 600;
-		position: relative;
-	}
-
-	.tui-btm-text {
-		font-size: 24rpx;
-		opacity: 0.85;
-		padding-top: 4rpx;
-	}
-}
-
-.uni-badge--small {
-	-webkit-transform: scale(0.8);
-	-ms-transform: scale(0.8);
-	transform: scale(0.8);
-	-webkit-transform-origin: center center;
-	-ms-transform-origin: center center;
-	transform-origin: center center;
 }
-
-.uni-badge {
-	font-family: 'Helvetica Neue', Helvetica, sans-serif;
-	-webkit-box-sizing: border-box;
-	box-sizing: border-box;
-	font-size: 12px;
-	line-height: 1;
-	display: inline-block;
-	padding: 3px 6px;
-	color: #333;
-	border-radius: 100px;
-	background-color: #f1f1f1;
-}
-
-.uni-badge-error {
-	color: #fff;
-	background-color: #dd524d;
-}
-
 .tui-order-list {
 	margin-top: 24rpx;
 	width: 100%;
@@ -1197,145 +1178,47 @@ page {
 		}
 	}
 	.list-detail {
-		width: 80rpx;
-		height: 290rpx;
-		line-height: 290rpx;
+		width: 70rpx;
+		height: 80rpx;
+		line-height: 80rpx;
 		text-align: center;
 		position: absolute;
 		right: 0;
-		top: 80rpx;
+		bottom: 0;
 		.iconfont {
-			font-size: $font-size-30;
+			font-size: $font-size-32;
 			color: #999999;
 		}
 	}
 }
-.d-container {
-	width: 580rpx;
-	padding: 80rpx 0;
-
-	.drawer-main {
-		width: 100%;
-		height: auto;
-		box-sizing: border-box;
-		float: left;
-
-		.drawer-main-name {
-			width: 100%;
-			height: 80rpx;
-			line-height: 80rpx;
-			text-align: left;
-			font-size: $font-size-26;
-			color: #333333;
-			box-sizing: border-box;
-			padding: 0 20rpx;
-			font-weight: bold;
-		}
-
-		.drawer-main-time {
-			width: 100%;
-			height: 56rpx;
-			box-sizing: border-box;
-
-			.line {
-				color: #999999;
-				float: left;
-				line-height: 56rpx;
-			}
-
-			.drawer-main-time-input {
-				width: 228rpx;
-				height: 56rpx;
-				background: #f7f7f7;
-				border-radius: 28rpx;
-				box-sizing: border-box;
-				padding: 0 20rpx;
-				line-height: 56rpx;
-				float: left;
-				margin: 0 20rpx;
-				position: relative;
-				box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
-
-				.input-text {
-					display: block;
-					height: 56rpx;
-					font-size: 26rpx;
-					color: #666666;
-				}
-
-				.icon-riqi {
-					color: $color-system;
-					display: block;
-					width: 40rpx;
-					height: 56rpx;
-					position: absolute;
-					right: 10rpx;
-					top: 0;
-					line-height: 56rpx;
-				}
-			}
+.tui-prompt-flex {
+	width: 100%;
+	height: 70rpx;
+	display: flex;
+	margin-top: 20rpx;
+	.btn {
+		flex: 1;
+		line-height: 70rpx;
+		font-size: $font-size-26;
+		text-align: center;
+		color: #ffffff;
+		border-radius: 33rpx;
+		margin: 0 24rpx;
+		&.btn-cancel {
+			background: #f7f7f7;
+			color: #999999;
 		}
-
-		.drawer-main-textarea {
-			width: 100%;
-			height: 160rpx;
-			box-sizing: border-box;
-			padding: 0 20rpx;
-			background: #ffffff;
-			border-radius: 8rpx;
-
-			.textarea {
-				width: 100%;
-				height: 100%;
-				background: #f7f7f7;
-				box-sizing: border-box;
-				padding: 20rpx 20rpx;
-				font-size: $font-size-24;
-				border-radius: 8rpx;
-				box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
-			}
+		&.btn-confirm {
+			background: $color-system;
 		}
 	}
-
-	.drawer-input {
-		width: 100%;
-		float: left;
-		box-sizing: border-box;
-		padding: 24rpx 10rpx 0 10rpx;
-		border: 1px solid rgba(0, 0, 0, 0.2);
-		border-radius: 4rpx;
-		position: relative;
-		background-color: #ffffff;
-
-		&.btn {
-			border: none;
-			display: flex;
-			position: fixed;
-			left: 0;
-			bottom: 0;
-		}
-
-		.drawer-btn {
-			width: 210rpx;
-			height: 84rpx;
-			border-radius: 42rpx;
-			background: $btn-confirm;
-			line-height: 84rpx;
-			text-align: center;
-			font-size: $font-size-26;
-			color: #ffffff;
-			flex: 1;
-			margin: 0 10rpx;
-
-			&.comfrim {
-				background: $btn-confirm;
-			}
-
-			&.clear {
-				background: #f7f7f7;
-				color: #999999;
-			}
-		}
+}
+.tui-prompt-text {
+	line-height: 44rpx;
+	font-size: $font-size-26;
+	color: #333333;
+	.text {
+		color: $color-system;
 	}
 }
 </style>

+ 148 - 266
pages/relation/refund/detail.vue

@@ -7,18 +7,25 @@
 			<view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
 			<view class="header-sit">
 				<text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
-				<text class="header-sit-text">返佣详情</text>
+				<text class="header-sit-text">供应商退款详情</text>
 			</view>
 		</view>
 		<view class="tui-header-box"
 			:style="{ height: CustomBar + 30 + 'px', backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)' }">
 		</view>
-		<view class="distinguish-section" :style="{ top: CustomBar - 14 + 'px', left: 0 + 'px' }">
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="7"
+		></tui-skeleton>
+		<view class="distinguish-section" :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
 			<view class="distinguish-section-conten">
 				<view class="section-top">
 					<view class="title">
 						<view class="list-title-tip">
-							<text class="badges">{{ payment.sourceType | formatSourceType }}</text>
+							<text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}</text>
 						</view>
 						<view class="title-text">收款信息</view>
 					</view>
@@ -30,69 +37,76 @@
 				<view class="section-top-item">
 					<view class="list-title-b">
 						<view class="list-title-b-item ">
-							收款金额:<text class="text">¥{{ payment.receiptAmount | NumFormat }} </text>
+							收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }}</text>
 						</view>
-						<view class="list-title-b-item "> 
-							收款类型:<text class="text">{{ payment.receiptType }} </text>
+						<view class="list-title-b-item ">
+							收款类型:<text class="text">{{ receiptInfo.payTypeText }}</text>
 						</view>
 					</view>
 					<view class="list-title-b">
-						收款时间:<text class="text">{{ payment.receiptDate }}</text>
+						款时间:<text class="text">{{ receiptInfo.receiptDate }}</text>
+					</view>
+					<view class="list-title-b">收款短信:</view>
+					<view class="list-title-b sms">
+						<text class="text">{{ receiptInfo.smsContent ? receiptInfo.smsContent : '无' }}</text>
 					</view>
-					<template v-if="payment.smsContent">
-						<view class="list-title-b">收款短信:</view>
-						<view class="list-title-b sms">
-							<text class="text">{{ payment.smsContent }}</text>
-						</view>
-					</template>
-					<view class="list-icon">无人确认</view>
 				</view>
 				<view class="section-title">关联订单</view>
 				<view class="section-mid">
-					<view class="list-title">
-						<view class="list-title-t">
-							<view class="list-title-tip">
-								<text class="badges">{{ payment.order.orderType | formatOrderType }}</text>
+					<view
+						class="tui-order-item"
+						v-for="(order, index) in orderList"
+						:key="index"
+					>
+						<view class="list-title" @click.stop="orderDetail(order.mainOrder.orderId)">
+							<view class="list-title-t">
+								<view class="list-title-tip">
+									<text class="badges">{{ order.mainOrder.orderType | formatOrderType }}</text>
+								</view>
+								<view class="list-title-tag" v-if="order.mainOrder.organizeId == 3">
+									<text class="badges">维沙</text>
+								</view>
+								<view class="list-title-num">{{ order.mainOrder.status | stateExpFormat }}</view>
 							</view>
-							<view class="list-title-num">{{
-								payment.order.state | StateExpFormat
-							}}</view>
-						</view>
-						<view class="list-title-a">
-							<view class="list-title-a-text">
-								子订单编号:<text class="text">{{ payment.order.number }} ( {{ payment.order.orderId}} )</text>
+							<view class="list-title-a">
+								<view class="list-title-a-text">
+									子订单编号:<text class="text">{{ order.shopOrderNo }} ( {{ order.shopOrderId }} )</text>
+								</view>
+								<view class="list-title-a-text">
+									供应商名称:<text class="text">{{ order.shopName }}</text>
+								</view>
+								<view class="list-title-a-text">
+									订单金额:<text class="text">¥{{ order.needPayAmount | NumFormat }}</text>
+								</view>
 							</view>
-							<view class="list-title-a-text">
-								供应商名称:<text class="text">{{ payment.order.userName }}</text>
+							<view class="list-title-b">
+								客户名称:<text class="text">{{ order.mainOrder.userName ? order.mainOrder.userName : '无' }}</text>
 							</view>
-							<view class="list-title-a-text">
-								订单金额:<text class="text">¥{{ payment.order.receiptAmount | NumFormat }}</text>
+							<view class="list-title-b">
+								订单编号:<text class="text">{{ order.mainOrder.orderNo }} ( {{ order.mainOrder.orderId }} )</text>
 							</view>
-						</view>
-						<view class="list-title-b">
-							订单编号:<text class="text">{{ payment.order.number }} ( {{ payment.order.orderId }} )</text>
-						</view>
-						<view class="list-title-b">
-							下单日期:<text class="text">{{ payment.order.creatTime }}</text>
-						</view>
-						<view class="list-title-b">
-							客户名称:<text class="text">{{ payment.order.userName }}</text>
-						</view>
-						<view class="list-title-b">
-							<view class="list-title-b-item ">
-								订单金额:<text class="text">¥{{ payment.order.receiptAmount | NumFormat }}</text>
+							<view class="list-title-b">
+								下单日期:<text class="text">{{ order.mainOrder.orderTime }}</text>
 							</view>
-							<view class="list-title-b-item ">
-								已收金额:<text class="text">¥{{ payment.order.receiptAmount | NumFormat }}</text>
+							<view class="list-title-b">
+								<view class="list-title-b-item ">
+									订单金额:<text class="text">¥{{ order.mainOrder.payTotalFee | NumFormat }}</text>
+								</view>
+								<view class="list-title-b-item ">
+									已收金额:<text class="text">¥{{ order.mainOrder.paidAmount | NumFormat }}</text>
+								</view>
 							</view>
 						</view>
+						<view class="list-detail" @click.stop="orderDetail(order.mainOrder.orderId)">
+							<text class="iconfont icon-xiayibu"></text>
+						</view>
 					</view>
 				</view>
 				<view class="section-title">状态</view>
 				<view class="section-mid">
 					<view class="list-title">
 						<view class="list-title-b">进度:<text
-								:style="{ color: formatColor(payment.confirmType) }">{{ payment.confirmType | formatStateType }}</text>
+								:style="{ color: formatColor(receiptInfo.receiptStatus) }">{{ receiptInfo.receiptStatus | formatStateType }}</text>
 						</view>
 					</view>
 				</view>
@@ -116,6 +130,20 @@
 		data() {
 			return {
 				isIphoneX: this.$store.state.isIphoneX,
+				CustomBar: this.CustomBar, // 顶部导航栏高度
+				height: 64, //header高度
+				top: 0, //标题图标距离顶部距离
+				scrollH: 0, //滚动总高度
+				opcity: 1,
+				isCmcustomClass: 'left',
+				skeletonShow:true,
+				orderList:[],
+				listQuery:{
+					pageNum: 1, //页数
+					pageSize: 10, //条数
+					id: 0,
+					shopName: '',
+				},
 				nvabarData: {
 					//顶部自定义导航
 					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
@@ -127,66 +155,11 @@
 					bgColor: '#D33020',
 					textColor: '#ffffff'
 				},
-				payment: {
-					id: 6090,
-					receiptAmount: 5000, //收款金额
-					associateAmount: 5000, //关联金额
-					receiptType: '广发银行0115',
-					receiptDate: '2022-02-15 10:58:25', // 收款时间
-					reviewDate: '2022-02-15 10:58:25', // 审核时间
-					smsContent: '【中信银行】您尾号0897的中信卡于05月29日14:42,二代支付存入人民币99.00元,当前余额为人民币13871.67元。',
-					confirmType: 1,
-					userName: '采美网络信息有限公司',
-					sourceType: 4,
-					state: 11,
-					isChecked: false,
-					order: {
-						orderId: 18751,
-						number: 'W164488903271223',
-						receiptAmount: 5000, //收款金额
-						associateAmount: 5000, //关联金额
-						orderType: 1, // 订单类型
-						creatTime: '2022-02-15 10:58:25', // 下单日期
-						userName: '采美网络信息有限公司',
-						state: 33, //订单状态
-					}
-				},
-				modalButton: [{
-						text: '取消',
-						type: 'gray',
-						plain: true //是否空心
-					},
-					{
-						text: '确认',
-						customStyle: {
-							color: '#fff',
-							bgColor: '#4688fa'
-						},
-						plain: false
-					}
-				],
-				params: {
-					type: 1,
-					banksType: 1,
-					amount: '',
-					chargeValue: '',
-					remarks: '',
-					time: this.$api.getNowFormatDate()
-				},
-				infoData: {},
-				isCmcustomClass: 'left',
-				CustomBar: this.CustomBar, // 顶部导航栏高度
-				height: 64, //header高度
-				top: 0, //标题图标距离顶部距离
-				scrollH: 0, //滚动总高度
-				opcity: 1,
-				isCheckedCharge: false,
-				contentModalTitle: '',
-				contentModalText: '', //操作文字提示语句
-				modal: false,
+				receiptInfo: {},
+				receiptId: 0
 			}
 		},
-		onLoad() {
+		onLoad(option) {
 			let obj = {}
 			// #ifdef MP-WEIXIN
 			obj = wx.getMenuButtonBoundingClientRect()
@@ -205,174 +178,56 @@
 					this.scrollH = res.windowWidth * 0.6
 				}
 			})
-		},
-		filters: {
-			formatSourceType(value) {
-				switch (value) {
-					case 1:
-						return '订单'
-						break
-					case 2:
-						return '非订单'
-						break
-					case 3:
-						return '返佣'
-						break
-					case 4:
-						return '订单款或者非订单款'
-						break
-					case 5:
-						return '供应商退款'
-						break
-				}
-			},
-			formatOrderType(value) {
-				switch (value) {
-					case 1:
-						return '自主订单'
-						break
-					case 2:
-						return '协销订单'
-						break
-					case 3:
-						return '客服订单'
-						break
-				}
-			},
-			formatStateType(value) {
-				switch (value) {
-					case 0:
-						return '待确认'
-						break
-					case 1:
-						return '已确认'
-						break
-					case 2:
-						return '待审核'
-						break
-					case 3:
-						return '审核通过'
-						break
-				}
-			},
-			StateExpFormat(state) {
-				//订单状态文字和颜色
-				var HtmlStateText = '',
-					stateTextObject = {
-						0: '待确认',
-						4: '交易完成',
-						5: '订单完成',
-						6: '已关闭',
-						7: '交易全退',
-						77: '交易全退',
-						11: '待付款待发货',
-						12: '待付款部分发货',
-						13: '待付款已发货',
-						21: '部分付款待发货',
-						22: '部分付款部分发货',
-						23: '部分付款已发货',
-						31: '已付款待发货',
-						32: '已付款部分发货',
-						33: '已收款',
-						111: '待付款待发货'
-					}
-				Object.keys(stateTextObject).forEach(function(key) {
-					if (key == state) {
-						HtmlStateText = stateTextObject[key]
-					}
-				})
-				return HtmlStateText
-			},
-			NumFormat: function(text) {
-				//处理金额
-				return Number(text).toFixed(2)
-			}
+			this.receiptId = this.listQuery.id = option.id
+			this.getOrderReceiptDetail(this.receiptId)
+			this.getOrderReceiptRebateOrders()
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo'])
+			...mapState(['hasLogin'])
 		},
 		methods: {
-			bindPickerChange(type, e) {
-				// 选择选项
-				switch (type) {
-					case 1:
-						this.paymentTypeText = this.paymentActions[e.target.value].name
-						this.params.type = this.paymentActions[e.target.value].value
-						console.log('款项类型', this.paymentTypeText)
-						console.log('款项类型', this.params.type)
-						break
-					case 2:
-						this.banksTypeText = this.banksActions[e.target.value].name
-						this.params.banksType = this.banksActions[e.target.value].value
-						console.log('收款类型', this.params.banksType)
-						break
-				}
-			},
-			showTuiDateTime() {
-				this.$refs.dateTime.show()
-			},
-			confirmDistinguish() {
-				if (this.params.amount == '') {
-					this.$util.msg('请输入收款金额', 2000)
-					return
-				}
-				if (this.isCheckedCharge) {
-					if (this.params.chargeValue == '') {
-						this.$util.msg('请输入手续费', 2000)
-						return
-					}
-				}
-				if (this.params.remarks == '') {
-					this.$util.msg('请填写收款备注', 2000)
-					return
-				}
-				if (this.params.type == 1) {
-					this.contentModalTitle = '确定收款吗?'
-					this.contentModalText = '确认前请仔细检查各项数据是否正确,确认收款后将不能进行修改。' //操作文字提示语句
-				} else if (this.params.type == 2) {
-					this.contentModalTitle = ''
-					this.contentModalText = '确定返佣收款吗?' //操作文字提示语句
-				} else if (this.params.type == 3) {
-					this.contentModalTitle = ''
-					this.contentModalText = '确定供应商退款吗?' //操作文字提示语句
-				}
-				this.modal = true
-				console.log('收款')
-			},
-			handleClick(e) {
-				// 确认收款
-				if (e.index == 1) {
-					this.$api.navigateTo('/pages/collection/detail')
-				}
-				this.modal = false
+			getOrderReceiptDetail(id) {
+				// 收款详情
+				this.OrderService.orderReceiptRefundDetail({ id: id })
+					.then(response => {
+						this.receiptInfo = response.data
+					})
+					.catch(err => {
+						this.$util.msg(err.msg, 2000)
+					})
 			},
-			hideMobel() {
-				this.modal = false
+			getOrderReceiptRebateOrders() {// 收款详情-订单列表
+				this.OrderService.orderReceiptRebateOrders(this.listQuery)
+					.then(response => {
+						let data = response.data
+						if (data.list && data.list.length > 0) {
+							this.orderList = data.list
+						}	
+						setTimeout(()=>{
+							this.skeletonShow = false
+						},1000)
+					})
+					.catch(err => {
+						this.$util.msg(err.msg, 2000)
+					})
 			},
-			checkedCharge() {
-				// 勾选手续费
-				this.isCheckedCharge = !this.isCheckedCharge
-			},
-			changeNumber(e) {
-				// 校验输入为数字
-				if (!this.$api.isNumber(e.detail.value)) {
-					this.params.amount = ''
-				} else {
-					this.params.amount = e.detail.value
-				}
+			orderDetail(orderId) {
+				//订单详情跳转
+				this.isModalLayer = true
+				this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
 			},
 			toNoSms(url) {
 				this.$api.navigateTo(url)
 			},
 			formatColor(state) {
-				//设置邀请码状态亚瑟
+				//设置颜色
 				let stateColor = '',
 					stateColorObject = {
 						1: '#FEAC20',
 						2: '#4cd964',
 						3: '#34CC8C',
-						4: '#007aff',
-						5: '#F94B4B'
+						4: '#F94B4B',
+						5: '#007aff'
 					}
 				Object.keys(stateColorObject).forEach(function(key) {
 					if (key == state) {
@@ -614,30 +469,44 @@
 					font-size: $font-size-28;
 					padding-bottom: 10rpx;
 
-					.list-title-num {
+					.list-title-tip {
 						float: left;
-						text-align: left;
-						color: #e15616;
-						margin-left: 30rpx;
-						line-height: 40rpx;
+						.badges {
+							display: block;
+							float: left;
+							padding: 0 15rpx;
+							height: 40rpx;
+							line-height: 40rpx;
+							border-radius: 20rpx;
+							background: rgba(248, 204, 148, 0.5);
+							font-size: $font-size-24;
+							text-align: center;
+							color: #666666;
+						}
 					}
-
-					.list-title-tip {
+					.list-title-tag {
 						float: left;
-
+						margin-left: 20rpx;
 						.badges {
 							display: block;
 							float: left;
 							padding: 0 15rpx;
 							height: 40rpx;
 							line-height: 40rpx;
-							border-radius: 4rpx;
-							background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
+							border-radius: 20rpx;
+							background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
 							font-size: $font-size-24;
 							text-align: center;
-							color: #ffffff;
+							color: #666666;
 						}
 					}
+					.list-title-num {
+						float: left;
+						text-align: left;
+						color: #e15616;
+						line-height: 40rpx;
+						margin-left: 20rpx;
+					}
 				}
 				.list-title-a {
 					width: 100%;
@@ -678,6 +547,19 @@
 					}
 				}
 			}
+			.list-detail {
+				width: 70rpx;
+				height: 80rpx;
+				line-height: 80rpx;
+				text-align: center;
+				position: absolute;
+				right: 0;
+				bottom: 0;
+				.iconfont {
+					font-size: $font-size-32;
+					color: #999999;
+				}
+			}
 		}
 		.section-tips{
 			width: 100%;

+ 132 - 191
pages/relation/refund/index.vue

@@ -99,53 +99,55 @@
 						<view v-else class="tui-order-content">
 							<view
 								class="tui-order-item"
-								v-for="(payment, payIndex) in orderList"
-								:key="payIndex"
-								@click.stop="orderDetail(payment.id)"
+								v-for="(order, index) in orderList"
+								:key="index"
 							>
-								<view class="list-title">
+								<view class="list-title" @click.stop="orderDetail(order.mainOrder.orderId)">
 									<view class="list-title-t">
 										<view class="list-title-tip">
-											<text class="badges">{{ payment.orderType | formatOrderType }}</text>
+											<text class="badges">{{ order.mainOrder.orderType | formatOrderType }}</text>
 										</view>
-										<view class="list-title-num">{{ payment.confirmType | stateExpFormat }}</view>
+										<view class="list-title-tag" v-if="order.mainOrder.organizeId == 3">
+											<text class="badges">维沙</text>
+										</view>
+										<view class="list-title-num">{{ order.mainOrder.status | stateExpFormat }}</view>
 									</view>
 									<view class="list-title-a">
 										<view class="list-title-a-text">
-											子订单编号:<text class="text">{{ payment.number }} ( {{ payment.id }} )</text>
+											子订单编号:<text class="text">{{ order.shopOrderNo }} ( {{ order.shopOrderId }} )</text>
 										</view>
 										<view class="list-title-a-text">
-											供应商名称:<text class="text">{{ payment.userName }}</text>
+											供应商名称:<text class="text">{{ order.shopName }}</text>
 										</view>
 										<view class="list-title-a-text">
-											订单金额:<text class="text">¥{{ payment.receiptAmount | NumFormat }}</text>
+											订单金额:<text class="text">¥{{ order.needPayAmount | NumFormat }}</text>
 										</view>
 									</view>
 									<view class="list-title-b">
-										客户名称:<text class="text">{{ payment.userName }}</text>
+										客户名称:<text class="text">{{ order.mainOrder.userName ? order.mainOrder.userName : '无' }}</text>
 									</view>
 									<view class="list-title-b">
-										订单编号:<text class="text">{{ payment.number }} ( {{ payment.id }} )</text>
+										订单编号:<text class="text">{{ order.mainOrder.orderNo }} ( {{ order.mainOrder.orderId }} )</text>
 									</view>
 									<view class="list-title-b">
-										下单日期:<text class="text">{{ payment.receiptDate }}</text>
+										下单日期:<text class="text">{{ order.mainOrder.orderTime }}</text>
 									</view>
 									<view class="list-title-b">
 										<view class="list-title-b-item ">
-											订单金额:<text class="text">¥{{ payment.receiptAmount | NumFormat }}</text>
+											订单金额:<text class="text">¥{{ order.mainOrder.payTotalFee | NumFormat }}</text>
 										</view>
 										<view class="list-title-b-item ">
-											已收金额:<text class="text">¥{{ payment.receiptAmount | NumFormat }}</text>
+											已收金额:<text class="text">¥{{ order.mainOrder.paidAmount | NumFormat }}</text>
 										</view>
 									</view>
 								</view>
-								<view class="list-checked" @click="checkedOrder(payment)">
+								<view class="list-checked" @click="checkedOrder(order,index)">
 									<text
 										class="iconfont"
-										:class="payment.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
+										:class="order.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
 									></text>
 								</view>
-								<view class="list-detail" @click="handelDetail(payment)">
+								<view class="list-detail" @click.stop="orderDetail(order.mainOrder.orderId)">
 									<text class="iconfont icon-xiayibu"></text>
 								</view>
 							</view>
@@ -162,16 +164,16 @@
 			</view>
 		</view>	
 		<!-- 弹窗 -->
-		<tui-modal
-			:show="modal"
-			@click="handleClick"
-			@cancel="hideMobel"
-			:content="contentModalText"
-			color="#333"
-			:size="32"
-			shape="circle"
-			:maskClosable="false"
-		></tui-modal>
+		<tui-modal :show="modal" :padding="'40rpx 30rpx'" @cancel="hideMobel" :custom="true" fadeIn >
+			<view class="tui-modal-custom">
+				<view class="tui-prompt-text">
+					{{ contentModalText }}
+				</view>
+				<view class="tui-prompt-flex">
+					<view class="btn btn-confirm" @click="hideMobel">知道了</view>
+				</view>
+			</view>
+		</tui-modal>	
 	</view>
 </template>
 <script>
@@ -208,8 +210,6 @@ export default {
 			nomoreText: '上拉显示更多',
 			contentModalText: '', //操作文字提示语句
 			modal: false,
-			modal1: false,
-			hanldOrder: '', //储存监听订单信息
 			OperationType: '', //操作类型
 			isCmcustomClass: 'left',
 			isShowHeader: false,
@@ -220,21 +220,12 @@ export default {
 			checkedOrderList: [],
 			checkedIds:[],
 			checkedRefundIndex: 0,
-			confirmParams:{
-				confirmType:4,
+			confirmRefundParams:{
+				shopOrderId:0,
 				id:0,
-				orderIds:'',
 			},
 			skeletonShow: true,
 			modelTpye:1,// 收款弹窗类型
-			totalOrder: {
-				orderNums:1,
-				payTotalFee: 0, // 订单金额
-				balancePayFee: 0, // 余额抵扣
-				payableAmount: 0, // 应收金额
-				paidAmount: 0 ,//  已收金额
-				surplusAmount:0 // 剩余应收
-			} // 统计都选相同的订单数据
 		}
 	},
 	onLoad(option) {
@@ -247,8 +238,8 @@ export default {
 				this.scrollH = res.windowWidth * 0.6
 			}
 		})
-		this.listQuery.id = this.confirmParams.id = option.id
-		this.getOrderReceiptDetail(this.listQuery.id)
+		this.confirmRefundParams.id = option.id
+		this.getOrderReceiptDetail(this.confirmRefundParams.id)
 	},
 	computed: {
 		...mapState(['hasLogin']),
@@ -256,7 +247,7 @@ export default {
 	methods: {
 		getOrderReceiptDetail(id) {
 			// 收款详情
-			this.OrderService.orderReceiptDetail({ id: id })
+			this.OrderService.orderReceiptRefundDetail({ id: id })
 				.then(response => {
 					this.receiptInfo = response.data
 					this.getOrderReceiptRefundOrders()
@@ -265,11 +256,6 @@ export default {
 					this.$util.msg(err.msg, 2000)
 				})
 		},
-		subMitSearch() {
-			// 确认搜索
-			this.listQuery.pageNum = 1
-			this.getOrderReceiptRefundOrders()
-		},
 		getOrderReceiptRefundOrders() {
 			// 收款详情-订单列表
 			this.OrderService.orderReceiptRefundOrders(this.listQuery)
@@ -338,106 +324,58 @@ export default {
 					this.$util.msg(error.msg, 2000)
 				})
 		},
+		subMitSearch() {
+			// 确认搜索
+			this.listQuery.pageNum = 1
+			this.getOrderReceiptRefundOrders()
+		},
 		confirmDistinguish() {
 			// 点击确认
-			const list = []
-			this.checkedOrderList.forEach(el => {
-				if (list.indexOf(el.userId) == -1) {
-					list.push(el.userId)
-				}
-			})
-			if (this.checkedOrderList.length == 0) {
-				this.$util.msg('请选择需要关联的订单!', 2000)
+			if (this.confirmRefundParams.shopOrderId == 0) {
+				this.$util.msg('请选择订单!', 2000)
 				return
 			}
-			if(this.currents === 1){// 订金订单每次只能关联一个订单
-				if (this.checkedOrderList.length > 1) {
-					this.$util.msg('订金订单每次只能关联一个订单!', 2000)
-					return
-				}
-			}
-			if(this.currents === 3){// 退款子订单每次只能关联一个子订单
-				if (this.checkedOrderList.length > 1) {
-					this.$util.msg('只能选择一个子订单!', 2000)
-					return
+			this.orderReceiptConfirm(this.confirmRefundParams)
+		},
+		checkedOrder(order,index) {
+			// 勾选关联订单
+			this.checkedIndex = index
+			this.orderList.forEach((el, index) => {
+				if (this.checkedIndex == index) {
+					el.isChecked = true
+					this.confirmRefundParams.shopOrderId = el.shopOrderId
+				} else {
+					el.isChecked = false
 				}
-			}
-			if (list.length > 1) {
-				this.$util.msg('请选择相同机构的订单!', 2000)
-				return
-			}
-			let payTotalFee = 0 //订单金额
-			let balancePayFee = 0 //余额抵扣
-			let payableAmount = 0 //应收金额
-			let paidAmount = 0 //已收金额
-			let surplusAmount = 0 //剩余应收
-			this.checkedOrderList.forEach(el => {
-				payTotalFee += el.payTotalFee
-				balancePayFee += el.balancePayFee
-				payableAmount += el.payableAmount
-				paidAmount += el.paidAmount
-				surplusAmount += el.surplusAmount
-				this.checkedIds.push(el.orderId)
 			})
-			// 赋值
-			this.totalOrder.payTotalFee = Number(payTotalFee.toFixed(2))
-			this.totalOrder.surplusAmount = Number(surplusAmount.toFixed(2))
-			this.totalOrder.balancePayFee = Number(balancePayFee.toFixed(2))
-			this.totalOrder.payableAmount = Number(payableAmount.toFixed(2))
-			this.totalOrder.paidAmount = Number(paidAmount.toFixed(2))
-			this.totalOrder.orderNums = this.checkedOrderList.length
-			
-			if(this.currents === 1){// 收款金额必须等于订金订单金额才能关联
-				if (this.receiptInfo.receiptAmount != this.totalOrder.payTotalFee) {
-					this.$util.msg('收款金额必须等于订金订单金额才能关联!', 2000)
-					return
-				}
-			}
-			console.log('totalOrder', this.totalOrder)
-			 //处理收款状态的几种类型
-			if(this.receiptInfo.receiptAmount == this.totalOrder.payableAmount || (this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) > 10){
-				//收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10
-				this.modelTpye = 1
-				console.log('收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10',this.modelTpye)
-			}else if(this.receiptInfo.receiptAmount > this.totalOrder.payableAmount){
-				//收款金额大于订单应收金额(可退款到余额)
-				this.modelTpye = 2
-				console.log('收款金额大于订单应收金额(可退款到余额)',this.modelTpye)
-			}else if((this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) <= 10){
-				//订单应收总金额减去收款金额小于等于10元时,才能抹平确认
-				this.modelTpye = 3
-				console.log('订单应收总金额减去收款金额小于等于10元时,才能抹平确认)',this.modelTpye)
-			}
-			this.modal1 = true
+			console.log('shopOrderId',this.confirmRefundParams.shopOrderId)
 		},
-		checkedOrder(order) {
-			// 勾选关联订单
-			order.isChecked = !order.isChecked
-			if (order.isChecked) {
-				this.checkedOrderList.push(order)
-			} else {
-				this.checkedOrderList.splice(this.checkedOrderList.indexOf(order), 1)
-			}
+		orderReceiptConfirm(params){
+			//确认关联退款子订单
+			this.OrderService.orderReceiptConfirmRefund(params)
+				.then(response => {
+					this.$util.msg('关联成功~', 2000, true, 'success')
+					setTimeout(()=>{
+						this.$api.navigateTo(`/pages/relation/refund/detail?id=${this.confirmRefundParams.id}`)
+					},2000)
+				})
+				.catch(error => {
+					this.modal = true
+					this.contentModalText = error.msg
+				})
 		},
-		handleClick(e) {
-			//用户操作订单
-			let index = e.index
-			if (index == 1) {
-				
-			}
-		},	
 		hideMobel() {
 			this.modal = false
 		},
 		formatColor(state) {
-			//设置邀请码状态亚瑟
+			//设置颜色
 			let stateColor = '',
 				stateColorObject = {
 					1: '#FEAC20',
 					2: '#4cd964',
 					3: '#34CC8C',
-					4: '#007aff',
-					5: '#F94B4B'
+					4: '#F94B4B',
+					5: '#007aff'
 				}
 			Object.keys(stateColorObject).forEach(function(key) {
 				if (key == state) {
@@ -446,6 +384,10 @@ export default {
 			})
 			return stateColor
 		},
+		orderDetail(id) {
+			//订单详情跳转
+			this.$api.navigateTo(`/pages/relation/order/detail?orderId=${id}`)
+		},
 		toNoSms(url) {
 			this.$api.navigateTo(url)
 		}
@@ -690,6 +632,7 @@ page {
 			padding-left: 70rpx;
 			background: #f7f7f7;
 			border-radius: 8rpx;
+			font-size: $font-size-26;
 		}
 		.icon-sousuo {
 			width: 80rpx;
@@ -698,7 +641,7 @@ page {
 			line-height: 70rpx;
 			text-align: center;
 			color: #999999;
-			font-size: $font-size-40;
+			font-size: $font-size-38;
 			position: absolute;
 			left: 0;
 			top: 0;
@@ -766,55 +709,7 @@ page {
 		justify-content: space-between;
 		color: #fff;
 	}
-
-	.tui-btm-item {
-		flex: 1;
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.tui-btm-num {
-		font-size: 32rpx;
-		font-weight: 600;
-		position: relative;
-	}
-
-	.tui-btm-text {
-		font-size: 24rpx;
-		opacity: 0.85;
-		padding-top: 4rpx;
-	}
 }
-
-.uni-badge--small {
-	-webkit-transform: scale(0.8);
-	-ms-transform: scale(0.8);
-	transform: scale(0.8);
-	-webkit-transform-origin: center center;
-	-ms-transform-origin: center center;
-	transform-origin: center center;
-}
-
-.uni-badge {
-	font-family: 'Helvetica Neue', Helvetica, sans-serif;
-	-webkit-box-sizing: border-box;
-	box-sizing: border-box;
-	font-size: 12px;
-	line-height: 1;
-	display: inline-block;
-	padding: 3px 6px;
-	color: #333;
-	border-radius: 100px;
-	background-color: #f1f1f1;
-}
-
-.uni-badge-error {
-	color: #fff;
-	background-color: #dd524d;
-}
-
 .tui-order-list {
 	margin-top: 24rpx;
 	width: 100%;
@@ -851,15 +746,15 @@ page {
 		}
 	}
 	.list-detail {
-		width: 80rpx;
-		height: 280rpx;
-		line-height: 280rpx;
+		width: 70rpx;
+		height: 80rpx;
+		line-height: 80rpx;
 		text-align: center;
 		position: absolute;
 		right: 0;
-		top: 80rpx;
+		bottom: 0;
 		.iconfont {
-			font-size: $font-size-30;
+			font-size: $font-size-32;
 			color: #999999;
 		}
 	}
@@ -868,7 +763,6 @@ page {
 .list-title {
 	width: 100%;
 	height: auto;
-
 	.list-title-t {
 		width: 100%;
 		height: 50rpx;
@@ -883,11 +777,27 @@ page {
 				padding: 0 15rpx;
 				height: 40rpx;
 				line-height: 40rpx;
-				border-radius: 4rpx;
-				background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
+				border-radius: 20rpx;
+				background: rgba(248, 204, 148, 0.5);
 				font-size: $font-size-24;
 				text-align: center;
-				color: #ffffff;
+				color: #666666;
+			}
+		}
+		.list-title-tag {
+			float: left;
+			margin-left: 20rpx;
+			.badges {
+				display: block;
+				float: left;
+				padding: 0 15rpx;
+				height: 40rpx;
+				line-height: 40rpx;
+				border-radius: 20rpx;
+				background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
+				font-size: $font-size-24;
+				text-align: center;
+				color: #666666;
 			}
 		}
 		.list-title-num {
@@ -911,10 +821,10 @@ page {
 		}
 		.list-title-a-text {
 			width: 100%;
-			height: 40rpx;
+			height: 44rpx;
 			float: left;
 			font-size: $font-size-24;
-			line-height: 40rpx;
+			line-height: 44rpx;
 			color: #666666;
 			text-align: left;
 		}
@@ -940,4 +850,35 @@ page {
 		}
 	}
 }
+.tui-prompt-flex{
+	width: 100%;
+	height: 70rpx;
+	display: flex;
+	margin-top: 20rpx;
+	.btn{
+		flex: 1;
+		line-height: 70rpx;
+		font-size: $font-size-26;
+		text-align: center;
+		color: #FFFFFF;
+		border-radius: 33rpx;
+		margin: 0 24rpx;
+		&.btn-cancel{
+			background: #F7F7F7;
+			color: #999999;
+		}
+		&.btn-confirm{
+			background: $color-system;
+		}
+	}
+	
+}
+.tui-prompt-text{
+	line-height: 44rpx;
+	font-size: $font-size-26;
+	color: #333333;
+	.text{
+		color: $color-system;
+	}
+}
 </style>

+ 198 - 315
pages/relation/return/detail.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="container mine clearfix">
 		<!-- <cu-custom :navbar-data='nvabarData'  @navigateBack="hanldNavigateBack"></cu-custom> -->
+		
 		<view class="tui-header-box first"
 			:style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 10 + 'px' : CustomBar + 30 + 'px' }"
 			:class="isCmcustomClass">
@@ -9,16 +10,23 @@
 				<text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
 				<text class="header-sit-text">返佣详情</text>
 			</view>
-		</view>
+		</view>	
 		<view class="tui-header-box"
 			:style="{ height: CustomBar + 30 + 'px', backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)' }">
 		</view>
-		<view class="distinguish-section" :style="{ top: CustomBar - 14 + 'px', left: 0 + 'px' }">
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="7"
+		></tui-skeleton>
+		<view class="distinguish-section" v-else :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
 			<view class="distinguish-section-conten">
 				<view class="section-top">
 					<view class="title">
 						<view class="list-title-tip">
-							<text class="badges">{{ payment.sourceType | formatSourceType }}款</text>
+							<text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}款</text>
 						</view>
 						<view class="title-text">收款信息</view>
 					</view>
@@ -29,80 +37,82 @@
 				</view>
 				<view class="section-top-item">
 					<view class="list-title-b">
-						<view class="list-title-b-item "> 
-							收款金额:<text class="text">¥{{ payment.receiptAmount | NumFormat }} </text>
+						<view class="list-title-b-item ">
+							收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }}</text>
 						</view>
-						<view class="list-title-b-item "> 
-							收款类型:<text class="text">{{ payment.receiptType }} </text>
+						<view class="list-title-b-item ">
+							收款类型:<text class="text">{{ receiptInfo.payTypeText }}</text>
 						</view>
 					</view>
 					<view class="list-title-b">
-						收款时间:<text class="text">{{ payment.receiptDate }}</text>
+						款时间:<text class="text">{{ receiptInfo.receiptDate }}</text>
+					</view>
+					<view class="list-title-b">收款短信:</view>
+					<view class="list-title-b sms">
+						<text class="text">{{ receiptInfo.smsContent ? receiptInfo.smsContent : '无' }}</text>
 					</view>
-					<template v-if="payment.smsContent">
-						<view class="list-title-b">收款短信:</view>
-						<view class="list-title-b sms">
-							<text class="text">{{ payment.smsContent }}</text>
-						</view>
-					</template>
-					<view class="list-icon">无人确认</view>
 				</view>
 				<view class="section-title">关联订单</view>
 				<view class="section-mid">
-					<view class="list-title">
-						<view class="list-title-t">
-							<view class="list-title-tip">
-								<text class="badges">{{ payment.order.orderType | formatOrderType }}</text>
+					<view
+						class="tui-order-item"
+						v-for="(order, index) in orderList"
+						:key="index"
+					>
+						<view class="list-title" @click.stop="orderDetail(order.mainOrder.orderId)">
+							<view class="list-title-t">
+								<view class="list-title-tip">
+									<text class="badges">{{ order.mainOrder.orderType | formatOrderType }}</text>
+								</view>
+								<view class="list-title-tag" v-if="order.mainOrder.organizeId == 3">
+									<text class="badges">维沙</text>
+								</view>
+								<view class="list-title-num">{{ order.mainOrder.status | stateExpFormat }}</view>
 							</view>
-							<view class="list-title-num">{{
-								payment.order.state | StateExpFormat
-							}}</view>
-						</view>
-						<view class="list-title-a">
-							<view class="list-title-a-text">
-								子订单编号:<text class="text">{{ payment.order.number }} ( {{ payment.order.orderId}} )</text>
+							<view class="list-title-a">
+								<view class="list-title-a-text">
+									子订单编号:<text class="text">{{ order.shopOrderNo }} ( {{ order.shopOrderId }} )</text>
+								</view>
+								<view class="list-title-a-text">
+									供应商名称:<text class="text">{{ order.shopName }}</text>
+								</view>
+								<view class="list-title-a-text">
+									订单金额:<text class="text">¥{{ order.needPayAmount | NumFormat }}</text>
+								</view>
 							</view>
-							<view class="list-title-a-text">
-								供应商名称:<text class="text">{{ payment.order.userName }}</text>
+							<view class="list-title-b">
+								客户名称:<text class="text">{{ order.mainOrder.userName ? order.mainOrder.userName : '无' }}</text>
 							</view>
-							<view class="list-title-a-text">
-								订单金额:<text class="text">¥{{ payment.order.receiptAmount | NumFormat }}</text>
+							<view class="list-title-b">
+								订单编号:<text class="text">{{ order.mainOrder.orderNo }} ( {{ order.mainOrder.orderId }} )</text>
 							</view>
-						</view>
-						<view class="list-title-b">
-							订单编号:<text class="text">{{ payment.order.number }} ( {{ payment.order.orderId }} )</text>
-						</view>
-						<view class="list-title-b">
-							下单日期:<text class="text">{{ payment.order.creatTime }}</text>
-						</view>
-						<view class="list-title-b">
-							客户名称:<text class="text">{{ payment.order.userName }}</text>
-						</view>
-						<view class="list-title-b">
-							<view class="list-title-b-item ">
-								订单金额:<text class="text">¥{{ payment.order.receiptAmount | NumFormat }}</text>
+							<view class="list-title-b">
+								下单日期:<text class="text">{{ order.mainOrder.orderTime }}</text>
 							</view>
-							<view class="list-title-b-item ">
-								已收金额:<text class="text">¥{{ payment.order.receiptAmount | NumFormat }}</text>
+							<view class="list-title-b">
+								<view class="list-title-b-item ">
+									订单金额:<text class="text">¥{{ order.mainOrder.payTotalFee | NumFormat }}</text>
+								</view>
+								<view class="list-title-b-item ">
+									已收金额:<text class="text">¥{{ order.mainOrder.paidAmount | NumFormat }}</text>
+								</view>
 							</view>
 						</view>
+						<view class="list-detail" @click.stop="orderDetail(order.mainOrder.orderId)">
+							<text class="iconfont icon-xiayibu"></text>
+						</view>
 					</view>
 				</view>
 				<view class="section-title">状态</view>
 				<view class="section-mid">
 					<view class="list-title">
 						<view class="list-title-b">进度:<text
-								:style="{ color: formatColor(payment.confirmType) }">{{ payment.confirmType | formatStateType }}</text>
+								:style="{ color: formatColor(receiptInfo.receiptStatus) }">{{ receiptInfo.receiptStatus | formatStateType }}</text>
 						</view>
 					</view>
 				</view>
 			</view>
 		</view>
-		<!-- 弹窗提示 -->
-		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :title="contentModalTitle"
-			:content="contentModalText" :button="modalButton" color="#333" :size="32" shape="circle"
-			:maskClosable="false">
-		</tui-modal>
 	</view>
 </template>
 <script>
@@ -116,6 +126,20 @@
 		data() {
 			return {
 				isIphoneX: this.$store.state.isIphoneX,
+				CustomBar: this.CustomBar, // 顶部导航栏高度
+				height: 64, //header高度
+				top: 0, //标题图标距离顶部距离
+				scrollH: 0, //滚动总高度
+				opcity: 1,
+				isCmcustomClass: 'left',
+				skeletonShow:true,
+				orderList:[],
+				listQuery:{
+					pageNum: 1, //页数
+					pageSize: 10, //条数
+					id: 0,
+					shopName: '',
+				},
 				nvabarData: {
 					//顶部自定义导航
 					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
@@ -127,66 +151,11 @@
 					bgColor: '#D33020',
 					textColor: '#ffffff'
 				},
-				payment: {
-					id: 6090,
-					receiptAmount: 5000, //收款金额
-					associateAmount: 5000, //关联金额
-					receiptType: '广发银行0115',
-					receiptDate: '2022-02-15 10:58:25', // 收款时间
-					reviewDate: '2022-02-15 10:58:25', // 审核时间
-					smsContent: '【中信银行】您尾号0897的中信卡于05月29日14:42,二代支付存入人民币99.00元,当前余额为人民币13871.67元。',
-					confirmType: 1,
-					userName: '采美网络信息有限公司',
-					sourceType: 3,
-					state: 11,
-					isChecked: false,
-					order: {
-						orderId: 18751,
-						number: 'W164488903271223',
-						receiptAmount: 5000, //收款金额
-						associateAmount: 5000, //关联金额
-						orderType: 2, // 订单类型
-						creatTime: '2022-02-15 10:58:25', // 下单日期
-						userName: '采美网络信息有限公司',
-						state: 33, //订单状态
-					}
-				},
-				modalButton: [{
-						text: '取消',
-						type: 'gray',
-						plain: true //是否空心
-					},
-					{
-						text: '确认',
-						customStyle: {
-							color: '#fff',
-							bgColor: '#4688fa'
-						},
-						plain: false
-					}
-				],
-				params: {
-					type: 1,
-					banksType: 1,
-					amount: '',
-					chargeValue: '',
-					remarks: '',
-					time: this.$api.getNowFormatDate()
-				},
-				infoData: {},
-				isCmcustomClass: 'left',
-				CustomBar: this.CustomBar, // 顶部导航栏高度
-				height: 64, //header高度
-				top: 0, //标题图标距离顶部距离
-				scrollH: 0, //滚动总高度
-				opcity: 1,
-				isCheckedCharge: false,
-				contentModalTitle: '',
-				contentModalText: '', //操作文字提示语句
-				modal: false,
+				receiptInfo: {},
+				receiptId: 0
 			}
 		},
-		onLoad() {
+		onLoad(option) {
 			let obj = {}
 			// #ifdef MP-WEIXIN
 			obj = wx.getMenuButtonBoundingClientRect()
@@ -205,174 +174,55 @@
 					this.scrollH = res.windowWidth * 0.6
 				}
 			})
-		},
-		filters: {
-			formatSourceType(value) {
-				switch (value) {
-					case 1:
-						return '订单'
-						break
-					case 2:
-						return '非订单'
-						break
-					case 3:
-						return '返佣'
-						break
-					case 4:
-						return '订单款或者非订单款'
-						break
-					case 5:
-						return '供应商退款'
-						break
-				}
-			},
-			formatOrderType(value) {
-				switch (value) {
-					case 1:
-						return '自主订单'
-						break
-					case 2:
-						return '协销订单'
-						break
-					case 3:
-						return '客服订单'
-						break
-				}
-			},
-			formatStateType(value) {
-				switch (value) {
-					case 0:
-						return '待确认'
-						break
-					case 1:
-						return '已确认'
-						break
-					case 2:
-						return '待审核'
-						break
-					case 3:
-						return '审核通过'
-						break
-				}
-			},
-			StateExpFormat(state) {
-				//订单状态文字和颜色
-				var HtmlStateText = '',
-					stateTextObject = {
-						0: '待确认',
-						4: '交易完成',
-						5: '订单完成',
-						6: '已关闭',
-						7: '交易全退',
-						77: '交易全退',
-						11: '待付款待发货',
-						12: '待付款部分发货',
-						13: '待付款已发货',
-						21: '部分付款待发货',
-						22: '部分付款部分发货',
-						23: '部分付款已发货',
-						31: '已付款待发货',
-						32: '已付款部分发货',
-						33: '已收款',
-						111: '待付款待发货'
-					}
-				Object.keys(stateTextObject).forEach(function(key) {
-					if (key == state) {
-						HtmlStateText = stateTextObject[key]
-					}
-				})
-				return HtmlStateText
-			},
-			NumFormat: function(text) {
-				//处理金额
-				return Number(text).toFixed(2)
-			}
+			this.receiptId = this.listQuery.id = option.id
+			this.getOrderReceiptDetail(this.receiptId)
+			this.getOrderReceiptRebateOrders()
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo'])
+			...mapState(['hasLogin'])
 		},
 		methods: {
-			bindPickerChange(type, e) {
-				// 选择选项
-				switch (type) {
-					case 1:
-						this.paymentTypeText = this.paymentActions[e.target.value].name
-						this.params.type = this.paymentActions[e.target.value].value
-						console.log('款项类型', this.paymentTypeText)
-						console.log('款项类型', this.params.type)
-						break
-					case 2:
-						this.banksTypeText = this.banksActions[e.target.value].name
-						this.params.banksType = this.banksActions[e.target.value].value
-						console.log('收款类型', this.params.banksType)
-						break
-				}
+			getOrderReceiptDetail(id) {
+				// 收款详情
+				this.OrderService.orderReceiptRebateDetails({ id: id })
+					.then(response => {
+						this.receiptInfo = response.data
+					})
+					.catch(err => {
+						this.$util.msg(err.msg, 2000)
+					})
 			},
-			showTuiDateTime() {
-				this.$refs.dateTime.show()
+			getOrderReceiptRebateOrders() {// 收款详情-订单列表
+				this.OrderService.orderReceiptRebateOrders(this.listQuery)
+					.then(response => {
+						let data = response.data
+						if (data.list && data.list.length > 0) {
+							this.orderList = data.list
+						}	
+						setTimeout(()=>{
+							this.skeletonShow = false
+						},1000)
+					})
+					.catch(err => {
+						this.$util.msg(err.msg, 2000)
+					})
 			},
-			confirmDistinguish() {
-				if (this.params.amount == '') {
-					this.$util.msg('请输入收款金额', 2000)
-					return
-				}
-				if (this.isCheckedCharge) {
-					if (this.params.chargeValue == '') {
-						this.$util.msg('请输入手续费', 2000)
-						return
-					}
-				}
-				if (this.params.remarks == '') {
-					this.$util.msg('请填写收款备注', 2000)
-					return
-				}
-				if (this.params.type == 1) {
-					this.contentModalTitle = '确定收款吗?'
-					this.contentModalText = '确认前请仔细检查各项数据是否正确,确认收款后将不能进行修改。' //操作文字提示语句
-				} else if (this.params.type == 2) {
-					this.contentModalTitle = ''
-					this.contentModalText = '确定返佣收款吗?' //操作文字提示语句
-				} else if (this.params.type == 3) {
-					this.contentModalTitle = ''
-					this.contentModalText = '确定供应商退款吗?' //操作文字提示语句
-				}
-				this.modal = true
-				console.log('收款')
-			},
-			handleClick(e) {
-				// 确认收款
-				if (e.index == 1) {
-					this.$api.navigateTo('/pages/collection/detail')
-				}
-				this.modal = false
-			},
-			hideMobel() {
-				this.modal = false
-			},
-			checkedCharge() {
-				// 勾选手续费
-				this.isCheckedCharge = !this.isCheckedCharge
-			},
-			changeNumber(e) {
-				// 校验输入为数字
-				if (!this.$api.isNumber(e.detail.value)) {
-					this.params.amount = ''
-				} else {
-					this.params.amount = e.detail.value
-				}
+			orderDetail(orderId) {
+				//订单详情跳转
+				this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
 			},
 			toNoSms(url) {
 				this.$api.navigateTo(url)
 			},
 			formatColor(state) {
-				//设置邀请码状态亚瑟
+				//设置颜色
 				let stateColor = '',
 					stateColorObject = {
 						1: '#FEAC20',
 						2: '#4cd964',
 						3: '#34CC8C',
-						4: '#007aff',
-						5: '#F94B4B'
+						4: '#F94B4B',
+						5: '#007aff'
 					}
 				Object.keys(stateColorObject).forEach(function(key) {
 					if (key == state) {
@@ -604,53 +454,82 @@
 			flex-direction: column;
 			position: relative;
 			border-radius: 0 0 20rpx 20rpx;
-			.list-title {
+			.tui-order-item{
+				display: flex;
+				flex-direction: column;
 				width: 100%;
-				height: auto;
-				.list-title-t {
+				background: #fff;
+				position: relative;
+				.list-title {
 					width: 100%;
-					height: 50rpx;
-					float: left;
-					font-size: $font-size-28;
-					padding-bottom: 10rpx;
-
-					.list-title-num {
+					height: auto;
+					.list-title-t {
+						width: 100%;
+						height: 50rpx;
 						float: left;
-						text-align: left;
-						color: #e15616;
-						margin-left: 30rpx;
-						line-height: 40rpx;
+						font-size: $font-size-28;
+						padding-bottom: 10rpx;
+						.list-title-tip {
+							float: left;
+							.badges {
+								display: block;
+								float: left;
+								padding: 0 15rpx;
+								height: 40rpx;
+								line-height: 40rpx;
+								border-radius: 20rpx;
+								background: rgba(248, 204, 148, 0.5);
+								font-size: $font-size-24;
+								text-align: center;
+								color: #666666;
+							}
+						}
+						.list-title-tag {
+							float: left;
+							margin-left: 20rpx;
+							.badges {
+								display: block;
+								float: left;
+								padding: 0 15rpx;
+								height: 40rpx;
+								line-height: 40rpx;
+								border-radius: 20rpx;
+								background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
+								font-size: $font-size-24;
+								text-align: center;
+								color: #666666;
+							}
+						}
+						.list-title-num {
+							float: left;
+							text-align: left;
+							color: #e15616;
+							line-height: 40rpx;
+							margin-left: 20rpx;
+						}
 					}
-
-					.list-title-tip {
+					.list-title-a {
+						width: 100%;
+						height: auto;
 						float: left;
-
-						.badges {
-							display: block;
+						padding: 5rpx 8rpx;
+						border-radius: 4rpx;
+						background-color: rgba(247, 247, 247, 1);
+						margin: 10rpx 0;
+						.text{
+							color: #999999;
+						}
+						.list-title-a-text {
+							width: 100%;
+							height: 50rpx;
 							float: left;
-							padding: 0 15rpx;
-							height: 40rpx;
-							line-height: 40rpx;
-							border-radius: 4rpx;
-							background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
 							font-size: $font-size-24;
-							text-align: center;
-							color: #ffffff;
+							line-height: 50rpx;
+							color: #666666;
+							text-align: left;
 						}
 					}
-				}
-				.list-title-a {
-					width: 100%;
-					height: auto;
-					float: left;
-					padding: 5rpx 8rpx;
-					border-radius: 4rpx;
-					background-color: rgba(247, 247, 247, 1);
-					margin: 10rpx 0;
-					.text{
-						color: #999999;
-					}
-					.list-title-a-text {
+					.list-title-b {
 						width: 100%;
 						height: 50rpx;
 						float: left;
@@ -658,24 +537,28 @@
 						line-height: 50rpx;
 						color: #666666;
 						text-align: left;
+						.text{
+							color: #999999;
+						}
+						.list-title-b-item {
+							width: 50%;
+							height: 100%;
+							float: left;
+						}
 					}
 				}
-				.list-title-b {
-					width: 100%;
-					height: 50rpx;
-					float: left;
-					font-size: $font-size-24;
-					line-height: 50rpx;
-					color: #666666;
-					text-align: left;
-					.text{
-						color: #999999;
-					}
-					.list-title-b-item {
-						width: 50%;
-						height: 100%;
-						float: left;
-					}
+			}
+			.list-detail {
+				width: 70rpx;
+				height: 80rpx;
+				line-height: 80rpx;
+				text-align: center;
+				position: absolute;
+				right: 0;
+				bottom: 0;
+				.iconfont {
+					font-size: $font-size-32;
+					color: #999999;
 				}
 			}
 		}

+ 178 - 153
pages/relation/return/index.vue

@@ -101,9 +101,8 @@
 								class="tui-order-item"
 								v-for="(order, index) in orderList"
 								:key="index"
-								@click.stop="orderDetail(order.mainOrder.orderId)"
 							>
-								<view class="list-title">
+								<view class="list-title" @click.stop="orderDetail(order.mainOrder.orderId)">
 									<view class="list-title-t">
 										<view class="list-title-tip">
 											<text class="badges">{{ order.mainOrder.orderType | formatOrderType }}</text>
@@ -142,13 +141,13 @@
 										</view>
 									</view>
 								</view>
-								<view class="list-checked" @click="checkedOrder(order)">
+								<view class="list-checked" @click="checkedOrder(order,index)">
 									<text
 										class="iconfont"
 										:class="order.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
 									></text>
 								</view>
-								<view class="list-detail" @click="handelDetail(order)">
+								<view class="list-detail" @click.stop="orderDetail(order.mainOrder.orderId)">
 									<text class="iconfont icon-xiayibu"></text>
 								</view>
 							</view>
@@ -165,16 +164,38 @@
 			</view>
 		</view>	
 		<!-- 弹窗 -->
-		<tui-modal
-			:show="modal"
-			@click="handleClick"
-			@cancel="hideMobel"
-			:content="contentModalText"
-			color="#333"
-			:size="32"
-			shape="circle"
-			:maskClosable="false"
-		></tui-modal>
+		<tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel(1)" :custom="true" fadeIn >
+			<view class="tui-modal-custom">
+				<view class="tui-prompt-text">
+					返佣金额为<text class="text">¥{{ confirmParams.verbalAmount  }}</text>,
+					订单根据成本计算得出的佣金为<text class="text">¥{{ returnBrokerage }}</text>,
+					金额不一致不能关联,请在后台修改成本使得子订单佣金等与返佣金额后在关联	
+				</view>
+				<view class="tui-prompt-flex">
+					<view class="btn btn-confirm" @click="handleClick1">知道了</view>
+				</view>
+			</view>
+		</tui-modal>	
+		<!--设非订单款项弹窗  -->
+		<tui-modal :show="modal" :padding="'40rpx 30rpx'" @cancel="hideMobel(0)" :custom="true" fadeIn >
+			<view class="tui-modal-custom">
+				<view class="tui-prompt-title">口头约定佣金</view>
+				<view class="tui-prompt-input">
+					<text class="text">¥</text>
+					<input 
+						class="input" 
+						type="number" 
+						placeholder="请输入口头约定佣金(必填)" 
+						@blur="changeNumber($event)" 
+						v-model="confirmParams.verbalAmount" 
+					/>
+				</view>
+				<view class="tui-prompt-flex">
+					<view class="btn btn-cancel" @click="hideMobel(0)">取消</view>
+					<view class="btn btn-confirm" @click="handleClick">确定</view>
+				</view>
+			</view>
+		</tui-modal>	
 	</view>
 </template>
 <script>
@@ -211,8 +232,6 @@ export default {
 			contentModalText: '', //操作文字提示语句
 			modal: false,
 			modal1: false,
-			hanldOrder: '', //储存监听订单信息
-			OperationType: '', //操作类型
 			isCmcustomClass: 'left',
 			isShowHeader: false,
 			height: 64, //header高度
@@ -220,12 +239,12 @@ export default {
 			scrollH: 0, //滚动总高度
 			opcity: 1,
 			checkedOrderList: [],
-			checkedIds:[],
-			checkedRefundIndex: 0,
+			checkedIndex:'',
+			returnBrokerage:0,
 			confirmParams:{
-				confirmType:4,
-				id:0,
-				orderIds:'',
+				shopOrderId:0,
+				verbalAmount:'',
+				rebateRemarks:''
 			},
 			skeletonShow: true,
 			modelTpye:1,// 收款弹窗类型
@@ -258,7 +277,7 @@ export default {
 	methods: {
 		getOrderReceiptDetail(id) {
 			// 收款详情
-			this.OrderService.orderReceiptDetail({ id: id })
+			this.OrderService.orderReceiptRebateDetails({ id: id })
 				.then(response => {
 					this.receiptInfo = response.data
 					this.getOrderReceiptRebateOrders()
@@ -348,88 +367,69 @@ export default {
 					list.push(el.userId)
 				}
 			})
-			if (this.checkedOrderList.length == 0) {
-				this.$util.msg('请选择需要关联的订单!', 2000)
+			if (this.confirmParams.shopOrderId == 0) {
+				this.$util.msg('请选择订单!', 2000)
 				return
 			}
-			if(this.currents === 1){// 订金订单每次只能关联一个订单
-				if (this.checkedOrderList.length > 1) {
-					this.$util.msg('订金订单每次只能关联一个订单!', 2000)
-					return
-				}
-			}
-			if(this.currents === 3){// 退款子订单每次只能关联一个子订单
-				if (this.checkedOrderList.length > 1) {
-					this.$util.msg('只能选择一个子订单!', 2000)
-					return
+			this.confirmParams.verbalAmount = ''
+			this.modal = true
+		},
+		checkedOrder(order,index) {
+			// 勾选关联订单
+			this.checkedIndex = index
+			this.orderList.forEach((el, index) => {
+				if (this.checkedIndex == index) {
+					el.isChecked = true
+					this.confirmParams.shopOrderId = el.shopOrderId
+					this.returnBrokerage = el.brokerage
+				} else {
+					el.isChecked = false
 				}
-			}
-			if (list.length > 1) {
-				this.$util.msg('请选择相同机构的订单!', 2000)
-				return
-			}
-			let payTotalFee = 0 //订单金额
-			let balancePayFee = 0 //余额抵扣
-			let payableAmount = 0 //应收金额
-			let paidAmount = 0 //已收金额
-			let surplusAmount = 0 //剩余应收
-			this.checkedOrderList.forEach(el => {
-				payTotalFee += el.payTotalFee
-				balancePayFee += el.balancePayFee
-				payableAmount += el.payableAmount
-				paidAmount += el.paidAmount
-				surplusAmount += el.surplusAmount
-				this.checkedIds.push(el.orderId)
 			})
-			// 赋值
-			this.totalOrder.payTotalFee = Number(payTotalFee.toFixed(2))
-			this.totalOrder.surplusAmount = Number(surplusAmount.toFixed(2))
-			this.totalOrder.balancePayFee = Number(balancePayFee.toFixed(2))
-			this.totalOrder.payableAmount = Number(payableAmount.toFixed(2))
-			this.totalOrder.paidAmount = Number(paidAmount.toFixed(2))
-			this.totalOrder.orderNums = this.checkedOrderList.length
-			
-			if(this.currents === 1){// 收款金额必须等于订金订单金额才能关联
-				if (this.receiptInfo.receiptAmount != this.totalOrder.payTotalFee) {
-					this.$util.msg('收款金额必须等于订金订单金额才能关联!', 2000)
-					return
-				}
+			console.log('shopOrderId',this.confirmParams.shopOrderId)
+			console.log('returnBrokerage',this.returnBrokerage)
+		},
+		handleClick() {
+			//用户操作订单
+			if(this.confirmParams.verbalAmount == 0){
+				this.$util.msg('请输入口头返佣金!', 2000)
+				return
 			}
-			console.log('totalOrder', this.totalOrder)
-			 //处理收款状态的几种类型
-			if(this.receiptInfo.receiptAmount == this.totalOrder.payableAmount || (this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) > 10){
-				//收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10
-				this.modelTpye = 1
-				console.log('收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10',this.modelTpye)
-			}else if(this.receiptInfo.receiptAmount > this.totalOrder.payableAmount){
-				//收款金额大于订单应收金额(可退款到余额)
-				this.modelTpye = 2
-				console.log('收款金额大于订单应收金额(可退款到余额)',this.modelTpye)
-			}else if((this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) <= 10){
-				//订单应收总金额减去收款金额小于等于10元时,才能抹平确认
-				this.modelTpye = 3
-				console.log('订单应收总金额减去收款金额小于等于10元时,才能抹平确认)',this.modelTpye)
+			if(this.confirmParams.verbalAmount != this.returnBrokerage){
+				this.modal = false
+				this.modal1 = true
+				return
+			}else{
+				this.modal = false
+				this.orderReceiptConfirm(this.confirmParams)
 			}
-			this.modal1 = true
 		},
-		checkedOrder(order) {
-			// 勾选关联订单
-			order.isChecked = !order.isChecked
-			if (order.isChecked) {
-				this.checkedOrderList.push(order)
-			} else {
-				this.checkedOrderList.splice(this.checkedOrderList.indexOf(order), 1)
-			}
+		handleClick1() {
+			//隐藏弹窗
+			this.modal1 = false
 		},
-		handleClick(e) {
-			//用户操作订单
-			let index = e.index
-			if (index == 1) {
-				
+		orderReceiptConfirm(params){
+			//确认关联返佣
+			this.OrderService.orderReceiptConfirmRebateVerbal(params)
+				.then(response => {
+					this.$util.msg('关联成功~', 2000, true, 'success')
+					setTimeout(()=>{
+						this.$api.navigateTo(`/pages/relation/return/detail?id=${response.data}`)
+					},2000)
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		hideMobel(type) {
+			switch(type){
+				case 0:
+					this.modal = false
+					break
+				case 1:
+					this.modal1 = false
+					break
 			}
-		},	
-		hideMobel() {
-			this.modal = false
 		},
 		formatColor(state) {
 			//设置颜色
@@ -448,6 +448,14 @@ export default {
 			})
 			return stateColor
 		},
+		changeNumber(e) {
+			// 校验输入为数字
+			this.confirmParams.receiptAmount = this.toFixedFn(e.detail.value)
+			console.log('receiptAmount', this.confirmParams.receiptAmount)
+		},
+		toFixedFn(val){//处理小数点后两位数
+			return Number(Math.round(val * 100) / 100).toFixed(2)
+		},
 		orderDetail(id) {
 			//订单详情跳转
 			this.$api.navigateTo(`/pages/relation/order/detail?orderId=${id}`)
@@ -696,6 +704,7 @@ page {
 			padding-left: 70rpx;
 			background: #f7f7f7;
 			border-radius: 8rpx;
+			font-size: $font-size-26;
 		}
 		.icon-sousuo {
 			width: 80rpx;
@@ -704,7 +713,7 @@ page {
 			line-height: 70rpx;
 			text-align: center;
 			color: #999999;
-			font-size: $font-size-40;
+			font-size: $font-size-38;
 			position: absolute;
 			left: 0;
 			top: 0;
@@ -772,55 +781,7 @@ page {
 		justify-content: space-between;
 		color: #fff;
 	}
-
-	.tui-btm-item {
-		flex: 1;
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.tui-btm-num {
-		font-size: 32rpx;
-		font-weight: 600;
-		position: relative;
-	}
-
-	.tui-btm-text {
-		font-size: 24rpx;
-		opacity: 0.85;
-		padding-top: 4rpx;
-	}
 }
-
-.uni-badge--small {
-	-webkit-transform: scale(0.8);
-	-ms-transform: scale(0.8);
-	transform: scale(0.8);
-	-webkit-transform-origin: center center;
-	-ms-transform-origin: center center;
-	transform-origin: center center;
-}
-
-.uni-badge {
-	font-family: 'Helvetica Neue', Helvetica, sans-serif;
-	-webkit-box-sizing: border-box;
-	box-sizing: border-box;
-	font-size: 12px;
-	line-height: 1;
-	display: inline-block;
-	padding: 3px 6px;
-	color: #333;
-	border-radius: 100px;
-	background-color: #f1f1f1;
-}
-
-.uni-badge-error {
-	color: #fff;
-	background-color: #dd524d;
-}
-
 .tui-order-list {
 	margin-top: 24rpx;
 	width: 100%;
@@ -857,15 +818,15 @@ page {
 		}
 	}
 	.list-detail {
-		width: 80rpx;
-		height: 280rpx;
-		line-height: 280rpx;
+		width: 70rpx;
+		height: 80rpx;
+		line-height: 80rpx;
 		text-align: center;
 		position: absolute;
 		right: 0;
-		top: 80rpx;
+		bottom: 0;
 		.iconfont {
-			font-size: $font-size-30;
+			font-size: $font-size-32;
 			color: #999999;
 		}
 	}
@@ -933,20 +894,20 @@ page {
 		}
 		.list-title-a-text {
 			width: 100%;
-			height: 40rpx;
+			height: 44rpx;
 			float: left;
 			font-size: $font-size-24;
-			line-height: 40rpx;
+			line-height: 44rpx;
 			color: #666666;
 			text-align: left;
 		}
 	}
 	.list-title-b {
 		width: 100%;
-		height: 40rpx;
+		height: 44rpx;
 		float: left;
 		font-size: $font-size-24;
-		line-height: 40rpx;
+		line-height: 44rpx;
 		color: #666666;
 		text-align: left;
 		.text{
@@ -962,4 +923,68 @@ page {
 		}
 	}
 }
+.tui-prompt-title{
+	line-height: 44rpx;
+	text-align: center;
+}
+.tui-prompt-input{
+	width: 100%;
+	height: 80rpx;
+	box-sizing: border-box;
+	background: #f7f7f7;
+	border-radius: 8rpx;
+	padding:15rpx 20rpx;
+	padding-left: 50rpx;
+	margin: 20rpx 0;
+	position: relative;
+	.text{
+		display: block;
+		width: 50rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		color: #666666;
+		text-align: center;
+		position: absolute;
+		top: 0;
+		left: 0;
+	}
+	.input {
+		width: 100%;
+		height: 100%;
+		line-height: 80rpx;
+		font-size: $font-size-26;
+		color: $color-system;
+	}
+}
+.tui-prompt-flex{
+	width: 100%;
+	height: 70rpx;
+	display: flex;
+	margin-top: 20rpx;
+	.btn{
+		flex: 1;
+		line-height: 70rpx;
+		font-size: $font-size-26;
+		text-align: center;
+		color: #FFFFFF;
+		border-radius: 33rpx;
+		margin: 0 24rpx;
+		&.btn-cancel{
+			background: #F7F7F7;
+			color: #999999;
+		}
+		&.btn-confirm{
+			background: $color-system;
+		}
+	}
+	
+}
+.tui-prompt-text{
+	line-height: 44rpx;
+	font-size: $font-size-26;
+	color: #333333;
+	.text{
+		color: $color-system;
+	}
+}
 </style>

+ 101 - 53
pages/relation/return/list.vue

@@ -86,10 +86,10 @@
 								<view class="list-checked" @click="checkedOrder(order,index)">
 									<text
 										class="iconfont"
-										:class="checkedIndex == index ? 'icon-yixuanze' : 'icon-weixuanze'"
+										:class="order.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
 									></text>
 								</view>
-								<view class="list-detail" @click="handelDetail(order)">
+								<view class="list-detail" @click.stop="orderDetail(order.mainOrder.orderId)">
 									<text class="iconfont icon-xiayibu"></text>
 								</view>
 							</view>
@@ -109,8 +109,8 @@
 		<tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel(1)" :custom="true" fadeIn >
 			<view class="tui-modal-custom">
 				<view class="tui-prompt-text">
-					返佣金额为<text class="text">¥1000</text>,
-					订单根据成本计算得出的佣金为<text class="text">¥1000</text>,
+					返佣金额为<text class="text">¥{{ confirmParams.verbalAmount  }}</text>,
+					订单根据成本计算得出的佣金为<text class="text">¥{{ returnBrokerage }}</text>,
 					金额不一致不能关联,请在后台修改成本使得子订单佣金等与返佣金额后在关联	
 				</view>
 				<view class="tui-prompt-flex">
@@ -123,16 +123,17 @@
 			<view class="tui-modal-custom">
 				<view class="tui-prompt-title">口头约定佣金</view>
 				<view class="tui-prompt-input">
+					<text class="text">¥</text>
 					<input 
 						class="input" 
 						type="number" 
 						placeholder="请输入口头约定佣金(必填)" 
 						@blur="changeNumber($event)" 
-						v-model="noOrderReason" 
+						v-model="confirmParams.verbalAmount" 
 					/>
 				</view>
 				<view class="tui-prompt-flex">
-					<view class="btn btn-cancel" @click="hideMobel">取消</view>
+					<view class="btn btn-cancel" @click="hideMobel(0)">取消</view>
 					<view class="btn btn-confirm" @click="handleClick">确定</view>
 				</view>
 			</view>
@@ -164,7 +165,6 @@ export default {
 			orderList: [],
 			checkedOrderList: [],
 			checkedIndex:'',
-			noOrderReason:'',//设置费订单款备注
 			scrollTop: 0,
 			isEmpty: false,
 			loadding: false,
@@ -176,9 +176,10 @@ export default {
 			contentModalText: '', //操作文字提示语句
 			modal: false,
 			modal1: false,
+			returnBrokerage:0,
 			confirmParams:{
 				shopOrderId:0,
-				verbalAmount:0,
+				verbalAmount:'',
 				rebateRemarks:''
 			},
 			rightDrawer: false,
@@ -281,33 +282,60 @@ export default {
 					list.push(el.userId)
 				}
 			})
-			if (this.checkedOrderList.length == 0) {
-				this.$util.msg('请选择需要关联的订单!', 2000)
+			if (this.confirmParams.shopOrderId == 0) {
+				this.$util.msg('请选择订单!', 2000)
 				return
 			}
-			if (this.checkedOrderList.length > 1) {
-				this.$util.msg('只能选择一个子订单!', 2000)
-				return
-			}
-			this.checkedOrderList.forEach(el => {
-				payTotalFee += el.payTotalFee
-				balancePayFee += el.balancePayFee
-				payableAmount += el.payableAmount
-				paidAmount += el.paidAmount
-				surplusAmount += el.surplusAmount
-				this.checkedIds.push(el.orderId)
-			})
+			this.confirmParams.verbalAmount = ''
 			this.modal = true
 		},
 		checkedOrder(order,index) {
 			// 勾选关联订单
 			this.checkedIndex = index
-			if (order.isChecked) {
-				this.checkedOrderList.push(order)
-			} else {
-				this.checkedOrderList.splice(this.checkedOrderList.indexOf(order), 1)
+			this.orderList.forEach((el, index) => {
+				if (this.checkedIndex == index) {
+					el.isChecked = true
+					this.confirmParams.shopOrderId = el.shopOrderId
+					this.returnBrokerage = el.brokerage
+				} else {
+					el.isChecked = false
+				}
+			})
+			console.log('shopOrderId',this.confirmParams.shopOrderId)
+			console.log('returnBrokerage',this.returnBrokerage)
+		},
+		handleClick() {
+			//用户操作订单
+			if(this.confirmParams.verbalAmount == 0){
+				this.$util.msg('请输入口头返佣金!', 2000)
+				return
+			}
+			if(this.confirmParams.verbalAmount != this.returnBrokerage){
+				this.modal = false
+				this.modal1 = true
+				return
+			}else{
+				this.modal = false
+				this.orderReceiptConfirm(this.confirmParams)
 			}
 		},
+		handleClick1() {
+			//隐藏弹窗
+			this.modal1 = false
+		},
+		orderReceiptConfirm(params){
+			//确认关联返佣
+			this.OrderService.orderReceiptConfirmRebateVerbal(params)
+				.then(response => {
+					this.$util.msg('关联成功~', 2000, true, 'success')
+					setTimeout(()=>{
+						this.$api.navigateTo(`/pages/relation/return/detail?id=${response.data}`)
+					},2000)
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
 		hideMobel(type) {
 			switch(type){
 				case 0:
@@ -318,28 +346,18 @@ export default {
 					break
 			}
 		},
-		handleClick() {
-			//用户操作订单
-			this.modal = false
-			//  var commission = Number(checkedList.attr('brokerage'));
-			//  brokeobj.brokerage =Math.round(commission * 100) / 100;
-			//收款金额不等于子订单佣金金额
-			this.modal1 = true
-		},
-		handleClick1() {
-			//用户操作订单
-			// 确认关联
-			this.modal1 = false
-		},
-		orderDetail(id) {
+		orderDetail(orderId) {
 			//订单详情跳转
 			this.isModalLayer = true
-			this.$api.navigateTo(`/pages/relation/order/detail?orderId=${id}`)
+			this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
 		},
 		changeNumber(e) {
 			// 校验输入为数字
-			this.params.receiptAmount = this.checkedNumberVal(e.detail.value)
-			console.log('receiptAmount', this.params.receiptAmount)
+			this.confirmParams.receiptAmount = this.toFixedFn(e.detail.value)
+			console.log('receiptAmount', this.confirmParams.receiptAmount)
+		},
+		toFixedFn(val){//处理小数点后两位数
+			return Number(Math.round(val * 100) / 100).toFixed(2)
 		},
 		formatColor(state) {
 			//设置颜色
@@ -491,6 +509,7 @@ page {
 			padding-left: 70rpx;
 			background: #f7f7f7;
 			border-radius: 8rpx;
+			font-size: $font-size-26;
 		}
 		.icon-sousuo {
 			width: 80rpx;
@@ -499,7 +518,7 @@ page {
 			line-height: 70rpx;
 			text-align: center;
 			color: #999999;
-			font-size: $font-size-40;
+			font-size: $font-size-38;
 			position: absolute;
 			left: 0;
 			top: 0;
@@ -596,15 +615,15 @@ page {
 		}
 	}
 	.list-detail {
-		width: 80rpx;
-		height: 280rpx;
-		line-height: 280rpx;
+		width: 70rpx;
+		height: 80rpx;
+		line-height: 80rpx;
 		text-align: center;
 		position: absolute;
 		right: 0;
-		top: 80rpx;
+		bottom: 0;
 		.iconfont {
-			font-size: $font-size-30;
+			font-size: $font-size-32;
 			color: #999999;
 		}
 	}
@@ -635,6 +654,22 @@ page {
 				color: #666666;
 			}
 		}
+		.list-title-tag {
+			float: left;
+			margin-left: 20rpx;
+			.badges {
+				display: block;
+				float: left;
+				padding: 0 15rpx;
+				height: 40rpx;
+				line-height: 40rpx;
+				border-radius: 20rpx;
+				background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
+				font-size: $font-size-24;
+				text-align: center;
+				color: #666666;
+			}
+		}
 		.list-title-num {
 			float: left;
 			text-align: left;
@@ -656,20 +691,20 @@ page {
 		}
 		.list-title-a-text {
 			width: 100%;
-			height: 40rpx;
+			height: 44rpx;
 			float: left;
 			font-size: $font-size-24;
-			line-height: 40rpx;
+			line-height: 44rpx;
 			color: #666666;
 			text-align: left;
 		}
 	}
 	.list-title-b {
 		width: 100%;
-		height: 40rpx;
+		height: 44rpx;
 		float: left;
 		font-size: $font-size-24;
-		line-height: 40rpx;
+		line-height: 44rpx;
 		color: #666666;
 		text-align: left;
 		.text{
@@ -696,7 +731,20 @@ page {
 	background: #f7f7f7;
 	border-radius: 8rpx;
 	padding:15rpx 20rpx;
+	padding-left: 50rpx;
 	margin: 20rpx 0;
+	position: relative;
+	.text{
+		display: block;
+		width: 50rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		color: #666666;
+		text-align: center;
+		position: absolute;
+		top: 0;
+		left: 0;
+	}
 	.input {
 		width: 100%;
 		height: 100%;

+ 61 - 7
services/order.service.js

@@ -27,14 +27,22 @@ export default class OrderService {
         return this.AjaxService.get({ 
             url:'/order/receipt/type', 
             data, 
-            isLoading: true ,
-              
+            isLoading: false ,
+        })
+    }
+    /**
+	 *获取收款详情的款项类型
+	/**/
+    orderReceiptDetailType (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/receipt/detail/type', 
+            data, 
+            isLoading: false ,
         })
     }
     /**
 	 *保存收款
 	 * @param smsContent 短信内容
-	 * @param openid 微信openid
 	 * @param payType 付款类型
 	 * @param receiptType 收款类型
 	 * @param receiptAmount 收款金额
@@ -53,7 +61,6 @@ export default class OrderService {
 	 *获取收款列表
 	 * @param startDate 筛选开始时间
 	 * @param endDate 筛选结束时间
-	 * @param openid 微信openid
 	 * @param pageNum 页码
 	 * @param pageSize 条数
 	 * @param receiptStatus 收款状态:0全部 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
@@ -67,16 +74,37 @@ export default class OrderService {
             isLoading: false ,
         })
     }
+    /**
+	 *获取供应商退款收款详情
+	 * @param id 款项Id
+	/**/
+    orderReceiptRefundDetail(data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/receipt/refund', 
+            data, 
+            isLoading: false ,
+        })
+    }
+    /**
+	 *返佣收款详情
+	 * @param Id 款项Id
+	/**/
+    orderReceiptRebateDetails(data = {}) {
+	    return this.AjaxService.get({ 
+	        url:'/order/receipt/rebate', 
+	        data, 
+	        isLoading: false ,
+	    })
+    }
     /**
 	 *获取收款详情
 	 * @param id 款项Id
-	 * @param openid 微信openid
 	/**/
     orderReceiptDetail(data = {}) {
         return this.AjaxService.get({ 
             url:'/order/receipt/detail', 
             data, 
-            isLoading: true ,
+            isLoading: false ,
         })
     }
     /**
@@ -181,6 +209,18 @@ export default class OrderService {
             loadText: '请稍候...' 
         })
     }
+    /**
+	 *返佣关联
+	 * @param shopOrderId 子订单Id
+	/**/
+    orderReceiptConfirmRebate(data = {}) {
+	    return this.AjaxService.post({ 
+	        url:'/order/receipt/confirm/rebate', 
+	        data, 
+	        isLoading: true ,
+	        loadText: '处理中...' 
+	    })
+    }
     /**
 	 *口头返佣关联
 	 * @param shopOrderId 子订单Id
@@ -188,11 +228,25 @@ export default class OrderService {
 	 * @param rebateRemarks 备注
 	/**/
     orderReceiptConfirmRebateVerbal(data = {}) {
-        return this.AjaxService.get({ 
+        return this.AjaxService.post({ 
             url:'/order/receipt/confirm/rebate/verbal', 
             data, 
             isLoading: true ,
             loadText: '处理中...' 
         })
     }
+    /**
+	 *关联供应商退款
+	 * @param Id 收款Id
+	 * @param shopOrderId 子订单Id
+	/**/
+    orderReceiptConfirmRefund(data = {}) {
+	    return this.AjaxService.post({ 
+	        url:'/order/receipt/confirm/refund', 
+	        data, 
+	        isLoading: true ,
+	        loadText: '处理中...' 
+	    })
+    }
+	
 }

+ 1 - 2
services/user.service.js

@@ -14,7 +14,6 @@ export default class UserService {
             url: '/order/receipt/auth',
             data,
             isLoading: false,
-
         })
     }
     /* 账号密码登录 */
@@ -22,7 +21,7 @@ export default class UserService {
         return this.AjaxService.post({
             url: '/order/receipt/password',
             data,
-            isLoading: false,
+            isLoading: true,
             loadText:'登录中...'
 
         })