Browse Source

供货商结帐增加实收确认

jf 5 years ago
parent
commit
22970087d0
1 changed files with 61 additions and 4 deletions
  1. 61 4
      ghsApp/src/pagesArrears/details.vue

+ 61 - 4
ghsApp/src/pagesArrears/details.vue

@@ -54,9 +54,21 @@
 				</view>
 				</view>
 			</template>
 			</template>
 			<view class="btn-view">
 			<view class="btn-view">
-				<button :class="['admin-button-com', 'blue']" @click="batchEvent" >收款</button>
+				<!--<button :class="['admin-button-com', 'blue']" @click="batchEvent" >收款</button>-->
+				<button :class="['admin-button-com', 'blue']" @click="isModelFun" >收款</button>
 			</view>
 			</view>
 		</view>
 		</view>
+		<modal-module :show="isModel" @cancel="modalCancel" @click="affirm" :title="'收款'" color="#333" :size="32" padding="30rpx 30rpx" >
+			<template slot="customContent">
+				<view class="select-cmd_bx">
+					<view class="num_bx">
+						<view class="flex">总金额:{{selectTotalAmount}}</view>
+						<view class="flex">实收:<input @focus="modifyPrice = null" v-model="modifyPrice" type="number"/></view>
+						<view class="flex">优惠:{{(selectTotalAmount - modifyPrice).toFixed(2)}}</view>
+					</view>
+				</view>
+			</template>
+		</modal-module>
 	</view>
 	</view>
 </template>
 </template>
 <script>
 <script>
@@ -64,17 +76,20 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import DetailsItem from "./detailsItem";
 import DetailsItem from "./detailsItem";
 import { getOrderDebtListApi,clearOrderApi } from "@/api/arrears/index";
 import { getOrderDebtListApi,clearOrderApi } from "@/api/arrears/index";
 import wexinPay from "@/utils/pay/wxPay";
 import wexinPay from "@/utils/pay/wxPay";
+import ModalModule from "@/components/plugin/modal";
 
 
 export default {
 export default {
-	components: { AppWrapperEmpty, DetailsItem },
+	components: { AppWrapperEmpty, ModalModule,DetailsItem },
 	data() {
 	data() {
 		return {
 		return {
+			modifyPrice:null,
 			customInfo: "",
 			customInfo: "",
 			totalAmount: "",
 			totalAmount: "",
 			num: "",
 			num: "",
 			detailsList: [],
 			detailsList: [],
 			listLoading: false,
 			listLoading: false,
-      isAllCheck: false
+			isAllCheck: false,
+			isModel: false
 		};
 		};
 	},
 	},
 	onPullDownRefresh() {
 	onPullDownRefresh() {
@@ -109,6 +124,7 @@ export default {
 					}
 					}
 				}
 				}
 			}
 			}
+			this.modifyPrice = amount.toFixed(2);
 			return amount.toFixed(2);
 			return amount.toFixed(2);
 		}
 		}
 	},
 	},
@@ -122,6 +138,30 @@ export default {
     }
     }
   },
   },
 	methods: {
 	methods: {
+		isModelFun(){
+			if (this.$util.isEmpty(this.selectList)) {
+				this.$msg("请选择还款订单");
+				return;
+			}
+			this.isModel = true;
+		},
+		affirm(val) {
+			if (val.index === 0) {
+				this.isModel = false;
+				console.log('取消')
+			} else {
+
+				let ids = this.selectList.map(ele => {
+					return {id:ele.id};
+				});
+				let parameter = {
+					id:JSON.stringify(ids),
+					customId:this.customInfo.id,
+				}
+				this.paySuccess(parameter)
+				console.log('确认')
+			}
+		},
 		async initData() {
 		async initData() {
 			try {
 			try {
 				this.listLoading = true;
 				this.listLoading = true;
@@ -196,7 +236,7 @@ export default {
 		},
 		},
 		// 支付成功
 		// 支付成功
 		async paySuccess(parameter) {
 		async paySuccess(parameter) {
-			await clearOrderApi(parameter);
+			await clearOrderApi({...parameter,modifyPrice:this.modifyPrice});
 			this.pageTo({url:'/common/pageSuccess?title=收款成功', type: 2});
 			this.pageTo({url:'/common/pageSuccess?title=收款成功', type: 2});
 		},
 		},
 		payFail() {
 		payFail() {
@@ -309,5 +349,22 @@ export default {
       color: $mainColor !important;
       color: $mainColor !important;
     }
     }
   }
   }
+	.select-cmd_bx {
+		.num_bx {
+			margin-bottom: 80px;
+			view{
+				height: 80rpx;
+				font-size: 28rpx;
+			}
+			input {
+				height: 80rpx;
+				border: 1px solid #dddddd;
+				border-radius: 4px;
+				text-align: left;
+				margin-right: 24px;
+				font-size: 40rpx;
+			}
+		}
+	}
 }
 }
 </style>
 </style>