Selaa lähdekoodia

充值结账流程

shish 1 vuosi sitten
vanhempi
commit
1c29a888d0

+ 7 - 4
hdApp/src/admin/member/detail.vue

@@ -78,7 +78,13 @@
     <view class="module-com content_box user-open_bx">
       <view class="input-line-wrap">
         <tui-list-cell @click="pageTo({ url: '/admin/order/debtList?id='+data.id })" class="line-cell" :hover="false" :arrow="true" >
-            <view class="tui-title">赊账订单</view>
+            <view class="tui-title">挂账订单</view>
+        </tui-list-cell>
+        <tui-list-cell @click="pageTo({ url: '/admin/settle/list?customId='+data.id })" class="line-cell" :hover="false" :arrow="true" >
+            <view class="tui-title">结账记录</view>
+        </tui-list-cell>
+        <tui-list-cell @click="pageTo({ url: '/admin/custom/balanceChange?id='+data.id })" class="line-cell" :hover="false" :arrow="true" >
+            <view class="tui-title">余额变动</view>
         </tui-list-cell>
         <tui-list-cell @click="pageTo({ url: '/admin/custom/rechargeChange?id='+data.id })" class="line-cell" :hover="false" :arrow="true" >
             <view class="tui-title">充值记录</view>
@@ -86,9 +92,6 @@
         <tui-list-cell @click="pageTo({ url: '/admin/order/itemOrder?customId='+data.id })" class="line-cell" :hover="false" :arrow="true" >
             <view class="tui-title">下单记录</view>
         </tui-list-cell>
-        <tui-list-cell @click="pageTo({ url: '/admin/custom/balanceChange?id='+data.id })" class="line-cell" :hover="false" :arrow="true" >
-            <view class="tui-title">余额变动</view>
-        </tui-list-cell>
         <tui-list-cell @click="pageTo({ url: '/admin/custom/levelChange?id='+data.id })" class="line-cell" :hover="false" :arrow="true" >
             <view class="tui-title">等级变动</view>
         </tui-list-cell>

+ 454 - 0
hdApp/src/admin/settle/detail.vue

@@ -0,0 +1,454 @@
+<template>
+	<view class="app-content">
+		<view class="info-content_box">
+			<view class="title">
+				单据信息
+			</view>
+			<view class="bills-info_box content-box">
+				<view class="order-info_box" v-if="detailInfo.hasNoticeCustom && detailInfo.hasNoticeCustom == 1">
+					<view>通知客户:</view>
+					<view style="color:green;font-weight:bold;">已自动通知</view>
+				</view>
+				<view class="order-info_box">
+					<view>结账日期:</view>
+					<view>{{ detailInfo.addTime ? detailInfo.addTime.substr(0,16) : '' }}</view>
+				</view>
+				<view class="order-info_box" v-if="detailInfo.deadline!='0000-00-00 00:00:00'">
+					<view>过期时间:</view>
+					<view>{{ detailInfo.deadline ? detailInfo.deadline.substr(0,16) : '' }}</view>
+				</view>
+				<view class="order-info_box">
+					<view>结账单号:</view>
+					<view>{{ detailInfo.orderSn }}</view>
+					<view class="price">
+						<button @click="copy(detailInfo.orderSn)" class="admin-button-com default" > 复制 </button>
+					</view>
+				</view>
+
+				<view class="order-info_box" v-if="detailInfo.status == 2">
+					<view>支付方式:</view>
+					<view>
+						{{ detailInfo.payWay==0?'微信':detailInfo.payWay==1?'支付宝':detailInfo.payWay==4?'现金':detailInfo.payWay==5?'银行卡':detailInfo.payWay==11?'抵扣':'--' }}
+						<text v-if="detailInfo.onlinePay == 1">
+							<text v-if="detailInfo.payWay==0 || detailInfo.payWay==1">(线下)</text>
+						</text>
+						<text v-else style="font-weight:bold;color:#3385ff;">(线上)</text>
+					</view>
+				</view>
+
+				<view class="order-info_box" v-if="detailInfo.status == 2 && detailInfo.payRemark!=''">
+					<view>支付说明:</view>
+					<view>
+						{{ detailInfo.payRemark }}
+					</view>
+				</view>
+
+				<view class="order-info_box">
+					<view>操作人员:</view>
+					<view>{{ detailInfo.hdStaffName!=''?detailInfo.hdStaffName:'客户' }}</view>
+				</view>
+				<view class="order-info_box">
+					<view>结账状态:</view>
+					<view>{{detailInfo.status==1?'待结清':detailInfo.status==2?'已结清':detailInfo.status==3?'已取消':'待结清'}}</view>
+				</view>
+			</view>
+			<view class="title">
+				客户
+			</view>
+			<view class="address-des_bx content-box">
+				<view>
+					<view> {{ detailInfo.customName }} {{ detailInfo.customMobile }} </view>
+				</view>
+				<view>
+					<i @click="callUp(detailInfo.customMobile)" class="iconfont icondianhua1" ></i>
+				</view>
+			</view>
+			<view class="title">
+				订单信息
+			</view>
+			<view class="module-com content-box">
+				<view class="commodity-view">
+					<view class="commodity-list">
+						<view v-for="(s, idx) in detailInfo.orderList" :key="idx" class="commodity-item" >
+							<view class="item-info" @click="pageTo({url: '/pagesOrder/detail',query: {id: s.id,},})" >
+								<view class="info-line">
+									<text class="item-name">{{ s.orderSn }} 时间 {{s.payTime ? s.payTime.substr(5,11):''}}</text>
+									<text class="item-price">
+										<text class="unit">¥</text>
+										<text class="price">{{ s.actPrice?parseFloat(s.actPrice):0 }}</text>
+									</text>
+								</view>
+								<view class="info-line">
+									<text class="item-type">
+										<text v-if="Number(s.bigNum)>0">{{s.bigNum}}扎</text>
+										<text v-if="Number(s.smallNum)>0">{{s.smallNum}}支</text>
+										<text style="margin-left:20upx;color:red;font-weight:bold;" v-if="Number(s.tkPrice)>0">已退款¥{{parseFloat(s.tkPrice)}}</text>
+									</text>
+									<text class="item-count" style="color: #3385ff;">查看明细</text>
+								</view>
+							</view>
+						</view>
+					</view>
+					<view class="summary-bar">
+						<view class="operate-view" ></view>
+						<view class="describe-view">
+							共{{ detailInfo.orderNum || 0 }}个订单
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="content-box price-detail">
+				<div class="module-com input-line-wrap">
+					<tui-list-cell class="line-cell" :hover="false">
+						<div class="tui-title">总金额</div>
+						<div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.prePrice }}</div>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.discountAmount > 0">
+						<div class="tui-title">优惠</div>
+						<div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.discountAmount }}</div>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false">
+						<div class="tui-title">实付</div>
+						<div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.realPrice }}</div>
+					</tui-list-cell>
+
+				</div>
+			</view>
+			<view class="content-box price-detail" v-if="detailInfo.remark && detailInfo.remark.length > 0">
+				<div class="module-com input-line-wrap">
+					<tui-list-cell class="line-cell" :hover="false">
+						<div class="tui-title">备注</div>
+						<input :disabled="true" v-model="detailInfo.remark" placeholder-class="phcolor" class="tui-input" name="name" maxlength="50" type="text" />
+					</tui-list-cell>
+				</div>
+			</view>
+
+		</view>
+		<view class="app-footer">
+			<button class="admin-button-com default" v-if="detailInfo.status == 1" @click="cancelFn(detailInfo)">取消</button>
+		</view>
+
+	</view>
+</template>
+<script>
+import { getSettleDetail,cancelSettle } from "@/api/settle/index";
+import productMins from "@/mixins/product";
+import TuiListCell from "@/components/plugin/list-cell";
+import { APIHOST } from '@/config'
+import { mapGetters } from "vuex";
+export default {
+	name: "settleDetail",
+	components: {
+		TuiListCell
+	},
+	mixins: [productMins],
+	data() {
+		return {
+			selectJobType: "order_change",
+			autoLoad: false,
+			stepActive: 0,
+			form: { name: "" },
+			detailInfo: {},
+			loading: false,
+			title:'点击查账和结账',
+			payRemark:'',
+			payWay:0,
+			payName:''
+		};
+	},
+	computed: {
+		...mapGetters({ dictInfo:"getDictionariesInfo" })
+	},
+	onLoad() {
+
+		//返回上一页到客户详情页时,需要刷新
+		let pages = getCurrentPages();
+		let prevPage = pages[ pages.length - 2 ];
+		if(prevPage && prevPage.$vm) {
+			prevPage.$vm.needRefresh = 1
+		}
+
+	},
+  	onShareAppMessage(res) {
+		return {
+			title: this.title,
+			desc: "",
+			imageUrl: APIHOST+'/image/custom/hit_me_clear.jpg',
+			path: "admin/settle/showBill?id="+this.detailInfo.id,
+		}
+	},
+	methods: {
+		inviteClear(){
+			let that = this
+            let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
+			uni.share({
+				provider: "weixin",
+				scene: 'WXSceneSession',
+				type: 5,
+				title: that.title,
+				summary: '暂无',
+				imageUrl: APIHOST+'/image/custom/hit_me_clear.jpg',//图片一定要有,不然会分享失败
+				miniProgram: {
+					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
+					path: "admin/settle/showBill?id="+this.detailInfo.id,
+					type: 0,// 0-正式版; 1-测试版; 2-体验版
+					webUrl: 'https://www.wixhb.com'
+				},
+				success: function(res) {
+					//console.log(res)
+				},
+				fail: function(err) {
+					//console.log(err)
+				}
+			})
+		},
+		cancelFn(info){
+			let that = this
+			that.$util.confirmModal({content:'确认取消?'},() => {
+				cancelSettle({id:info.id}).then(res=>{
+					if(res.code == 1){
+						that.$msg('取消成功')
+						that.init()
+					}
+				})
+			})
+		},
+		copy(val) {
+			const self = this;
+			uni.setClipboardData({
+				data: val,
+				success: function() {
+					self.$msg("复制成功");
+				}
+			});
+		},
+		callUp(mobile) {
+			uni.makePhoneCall({
+				phoneNumber: mobile
+			});
+		},
+		async init() {
+			const { id } = this.option;
+			if (!id) {
+				return;
+			}
+			const { data } = await getSettleDetail({id});
+			this.detailInfo = data;
+			let customName = data.customName ? data.customName : ''
+			let name = data.hdShopName ? data.hdShopName : '';
+			let num = data.num ? data.num : 0
+			let price = data.actPrice ? parseFloat(data.actPrice) : 0
+			this.title = name+' '+customName+' '+num+'笔 ¥'+price
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.info-content_box {
+	padding: 0 20upx 100upx;
+	& > .title {
+		color: #666666;
+		font-size: 28upx;
+		font-weight: 600;
+		padding: 30upx 3upx;
+	}
+	& .address-des_bx {
+		display: flex;
+		padding: 20upx 10upx 30upx 20upx;
+		& > view:nth-child(1) {
+			flex: 1;
+			margin-top: 10upx;
+			& > view:nth-child(1) {
+				color: #333333;
+				font-size: 30upx;
+			}
+			& > view:nth-child(2) {
+				color: #666666;
+				font-size: 28upx;
+				font-weight: 400;
+				margin-top: 20upx;
+			}
+		}
+		& > view:nth-child(2) {
+			display: flex;
+			& .icondianhua1 {
+				font-size: 50upx;
+				color: #3385ff;
+				margin-left: 0upx;
+			}
+		}
+	}
+	.bills-info_box {
+		padding: 30upx 20upx 30upx;
+		// border-bottom: 1upx solid #EEEEEE;
+		& > .order-info_box {
+			display: flex;
+			align-items: center;
+			font-size: 26upx;
+			font-weight: 400;
+			margin-bottom: 5upx;
+			& > view:nth-child(1) {
+				color: #999999;
+				width: 135upx;
+				text-align: right;
+			}
+			& > view:nth-child(2) {
+				color: #333333;
+			}
+			& > .price {
+				flex: 1;
+				font-size: 30upx;
+				color: #333333;
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+				& .iconxiangyou {
+					color: #999999;
+					font-size: 25upx;
+					margin-left: 12upx;
+				}
+			}
+		}
+	}
+	.content-box {
+		background-color: #ffffff;
+		border-radius: 10upx;
+	}
+	.commodity-view {
+		display: flex;
+		flex-direction: column;
+		.commodity-list {
+			padding: 20upx;
+			.commodity-item {
+				display: flex;
+				margin-bottom: 20upx;
+				.item-icon {
+					flex-shrink: 0;
+					width: 140upx;
+					height: 140upx;
+				}
+				.item-info {
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+					flex: 1;
+					margin-left: 20upx;
+					.info-line {
+						margin-bottom: 20upx;
+						display: flex;
+						justify-content: space-between;
+						align-items: flex-end;
+						.item-name {
+							color: #666;
+							font-size: 28upx;
+						}
+						.item-price {
+							color: #333;
+							font-size: 22upx;
+							.price {
+								font-size: 32upx;
+								font-weight: bold;
+							}
+						}
+						.item-type {
+							color: #999;
+							font-size: 24upx;
+						}
+						.item-count {
+							color: #666;
+							font-size:28upx;
+						}
+					}
+				}
+			}
+		}
+		.summary-bar {
+			padding: 0 20upx;
+			height: 90upx;
+			display: flex;
+
+			align-items: center;
+			justify-content: space-between;
+			border-top: 1upx solid #eeeeee;
+			.operate-view {
+				display: flex;
+
+				align-items: center;
+				color: #3385ff;
+				font-size: 26upx;
+				.iconfont {
+					margin-right: 20upx;
+					font-size: 40upx;
+				}
+			}
+			.describe-view {
+				display: flex;
+
+				align-items: center;
+				color: #333;
+				font-size: 24upx;
+				.price {
+					font-weight: bold;
+					font-size: 36upx;
+				}
+			}
+		}
+	}
+	.shipping-address {
+		display: flex;
+		align-items: center;
+		margin-top: 20upx;
+		& > view:nth-child(1) {
+			color: #999999;
+			font-size: 28upx;
+			font-weight: 400;
+			display: inline-block;
+			padding: 30upx 0 30upx 20upx;
+			flex: 1;
+			& > text {
+				color: #333333;
+				font-weight: 600;
+			}
+		}
+		& > view:nth-child(2) {
+			font-size: 60upx;
+			color: #d6e7ff;
+			margin-right: 10upx;
+		}
+	}
+	.price-detail {
+		margin-top: 20upx;
+		margin-bottom: 20upx;
+	}
+	.detail-price_box {
+		color: #333333;
+		font-size: 22upx;
+		text-align: right;
+		flex: 1;
+		font-weight: 600;
+		&.red {
+			color: #ff2842;
+		}
+	}
+}
+.app-footer {
+	display: flex;
+	align-items: center;
+	justify-content: flex-end;
+	& .admin-button-com {
+		padding: 0;
+		margin-right: 30upx;
+		width: 165upx;
+		height: 73upx;
+		line-height: 73upx;
+		text-align: center;
+		color: #3385ff;
+		border: 1upx solid #3385ff;
+		&.disabled{
+			color: #666666;
+			border: 1upx solid #ccc;
+		}
+	}
+}
+</style> 

+ 153 - 0
hdApp/src/admin/settle/list.vue

@@ -0,0 +1,153 @@
+<template>
+	<view class="settle-page">
+		<view style="font-size:36upx;margin-top:20upx;">累计已结账:¥{{totalAmount}}</view>
+		<view scroll-y class="settle-list">
+			<block v-if="!$util.isEmpty(list.data)">
+				<SettleItem v-for="(item, index) in list.data" :key="index" :info="item" @click="gotoDetail(item)"></SettleItem>
+			</block>
+			<block v-else>
+				<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+			</block>
+		</view>
+	</view>
+</template>
+<script>
+import SettleItem from "./settleOrderItem";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { list } from "@/mixins";
+import { getList } from "@/api/settle";
+export default {
+	components: {
+		SettleItem,
+		AppWrapperEmpty
+	},
+	mixins: [list],
+	data() {
+		return {
+			totalAmount:0
+		}
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getSettleList().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getSettleList().then((res) => {
+				uni.stopPullDownRefresh();
+			});
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	methods: {
+		async init() {
+			this.getSettleList();
+		},
+		getSettleList() {
+			let options = {
+				page: this.list.page,
+				pageSize: this.list.pageSize,
+				customId:this.option.customId
+			};
+			return getList(options).then(res => {
+				this.totalAmount = res.data.totalAmount ? parseFloat(res.data.totalAmount) : 0
+				this.completes(res);
+			})
+		},
+		gotoDetail(item) {
+			uni.navigateTo({
+				url: `/admin/settle/detail?id=${item.id}`,
+				success: result => {},
+				fail: () => {},
+				complete: () => {}
+			});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.settle-page {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	background-color: #f9fbfc;
+	.settle-list {
+		padding-top: 20upx;
+		padding-bottom: 80upx;
+		flex: 1;
+		.settle-item {
+			margin-bottom: 1upx;
+			padding: 30upx;
+			display: flex;
+			align-items: center;
+			box-shadow: 0upx 1upx 0upx 0upx #eeeeee;
+			background-color: #fff;
+			.info {
+				flex: 1;
+				margin-right: 20upx;
+				.info-order {
+					font-size: 32upx;
+					font-weight: 600;
+					color: #333333;
+				}
+				.info-name {
+					margin: 40upx 0 20upx;
+					font-size: 28upx;
+					font-weight: 400;
+					color: #666666;
+				}
+				.info-time {
+					margin-right: 30upx;
+					font-size: 28upx;
+					font-weight: 400;
+					color: #666666;
+				}
+			}
+			.status {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				flex-shrink: 0;
+				width: 100upx;
+				color: #cccccc;
+				.status-name {
+					margin-top: 10upx;
+					font-size: 24upx;
+				}
+				.iconfont {
+					font-size: 46upx;
+				}
+				&.primary {
+					color: #3385ff;
+				}
+				&.gray {
+					color: #cccccc;
+				}
+				&.warn {
+					color: #ffaf1d;
+				}
+			}
+		}
+	}
+	.bar-view {
+		flex-shrink: 0;
+		display: flex;
+		justify-content: flex-end;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+				width: 140upx;
+			}
+		}
+	}
+}
+</style> 

+ 122 - 0
hdApp/src/admin/settle/settleOrderItem.vue

@@ -0,0 +1,122 @@
+<template>
+	<view class="settle-item-view" @click="clickItemEvent">
+		<view class="item-header">
+			<view class="title">
+				<text class="name"> {{ info.customName }} </text>
+			</view>
+			<view class="status">{{info.status==1?'待结清':info.status==2?'已结清':info.status==3?'已取消':'待结清'}}</view>
+		</view>
+		<view class="item-main" >
+			<view class="item-info">
+				<view class="info-row">
+					<text class="info-label"> 日期:</text>
+					<text class="info-value">{{ info.addTime?info.addTime.substr(0,16):'' }} </text>
+				</view>
+
+				<view class="info-row">
+					<text class="info-label"> 单号:</text>
+					<text class="info-value">{{ info.orderSn }} </text>
+				</view>
+				<view class="info-row">
+					<text class="info-label"> 操作:</text>
+					<text class="info-value">{{ info.hdStaffName!=''?info.hdStaffName:'客户' }} </text>
+				</view>
+			</view>
+			<view class="item-price"
+				>¥{{ info.actPrice?parseFloat(info.actPrice):0 }} <text class="iconfont iconxiangyou"></text>
+			</view>
+		</view>
+		
+	</view>
+</template>
+<script>
+export default {
+	name: "settleItem",
+	props: {
+		info: {
+			required: true
+		}
+	},
+	data() {
+		return {};
+	},
+	computed: {},
+	methods: {
+		clickItemEvent() {
+			this.$emit("click", this.info);
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.settle-item-view {
+	padding: 30upx;
+	margin-bottom: 20upx;
+	width: 100%;
+	background-color: #fff;
+	.item-header {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		margin-bottom: 20upx;
+		.title {
+			display: flex;
+			align-items: center;
+			flex: 1;
+
+			.icon {
+				margin-right: 20upx;
+				width: 50upx;
+				height: 50upx;
+				border-radius: 25upx;
+				border-radius: 50%;
+			}
+			.name {
+				font-size: 32upx;
+				font-weight: 600;
+				color: #333333;
+			}
+		}
+		.status {
+			flex-shrink: 0;
+			color: $mainColor;
+		}
+	}
+	.item-main {
+		display: flex;
+
+		align-items: flex-end;
+		.item-info {
+			flex: 1;
+
+			font-size: 26upx;
+			.info-row {
+				margin-top: 12upx;
+				display: flex;
+				align-items: center;
+			}
+			.info-label {
+				font-weight: 400;
+				color: #999999;
+			}
+			.info-value {
+				font-weight: 400;
+				color: #333333;
+			}
+		}
+		.item-price {
+			display: flex;
+			align-items: center;
+			flex-shrink: 0;
+
+			font-size: 30upx;
+			font-weight: 600;
+			color: #333333;
+			.iconfont {
+				font-size: 28upx;
+				color: #999999;
+			}
+		}
+	}
+}
+</style> 

+ 25 - 0
hdApp/src/api/settle/index.js

@@ -3,4 +3,29 @@ import https from "@/plugins/luch-request_0.0.7/request";
 //花店给客户结清尾款
 export const confirmSettle = data => {
 	return https.post('/settle/confirm-settle', data)
+}
+
+//获取客户结账记录列表
+export const getList = data => {
+	return https.get('/settle/get-list', data)
+}
+
+//获取结账单详情
+export const getSettleDetail = data => {
+	return https.get('/settle/get-detail', data)
+}
+
+//取消结账单
+export const cancelSettle = data => {
+	return https.post('/settle/cancel-settle', data)
+}
+
+//确认结账
+export const confirmClearSettle = data => {
+	return https.post('/settle/confirm-clear', data)
+}
+
+//退款
+export const refundSettleMoney = data => {
+	return https.post('/settle/refund-money', data)
 }

+ 7 - 0
hdApp/src/pages.json

@@ -34,6 +34,13 @@
 				{"path": "myEventList","style": {"navigationBarTitleText": "我提交的记录"}}
 			]
 		},
+		{
+			"root": "admin/settle",
+			"pages": [
+				{"path": "list","style": {"navigationBarTitleText": "结账单","enablePullDownRefresh": false}},
+				{"path": "detail","style": {"navigationBarTitleText": "详情","enablePullDownRefresh": false}}
+			]
+		},
 		{
 			"root": "admin/ptItem",
 			"pages": [