瀏覽代碼

修改bug

chenrui 2 年之前
父節點
當前提交
0fa88f425c
共有 2 個文件被更改,包括 141 次插入99 次删除
  1. 122 93
      pages/sales/billHistory.vue
  2. 19 6
      pages/sales/billHistoryDetail.vue

+ 122 - 93
pages/sales/billHistory.vue

@@ -1,102 +1,130 @@
 <template>
 	<view class="content flex flex_column">
-		<view class="p-header" @click="jumpPage('/pages/sales/chooseShelf?customerSn='+(targetSn?targetSn:''))">
-			<text>{{ curCustomerName || '全部客户' }}</text>
-			<u-icon name="arrow-right"></u-icon>
+		<view>
+			<view class="p-header" @click="jumpPage('/pages/sales/chooseShelf?customerSn=' + (targetSn ? targetSn : ''))">
+				<text>{{ curCustomerName || '全部客户' }}</text>
+				<u-icon name="arrow-right"></u-icon>
+			</view>
+			<u-tabs :list="tabsList" :is-scroll="false" :current="current" @change="change"></u-tabs>
 		</view>
-		<view class="p-content" v-if="billList && billList.length>0">
-			<view class="list" @click="jumpPage('/pages/sales/billHistoryDetail?billId='+item.verifySn)" v-for="(item,i) in billList" :key="i">
-				<view class="list_t u-flex u-row-between">
-					<view class="u-line-1">{{item.customer.customerName}}</view>
-					<view>¥{{toThousands(item.settleAmount||0,2)}}</view>
-				</view>
-				<view class="list_b u-flex u-row-between" >
-					<view>{{item.createDate}}</view>
-					<view class="u-flex" v-if="item.billStatus != 'UNSETTLE'">
-						<view>已付款</view>
-						<u-icon name="yifukuan" custom-prefix="iscm-icon" size="40" :color="wordColor"></u-icon>
+		<view class="p-content">
+			<view  v-if="billList && billList.length > 0">
+				<view class="list" @click="jumpPage('/pages/sales/billHistoryDetail?billId=' + item.verifySn)" v-for="(item, i) in billList" :key="i">
+					<view class="list_t u-flex u-row-between">
+						<view class="u-line-1">{{ item.customer.customerName }}</view>
+						<view>¥{{ toThousands(item.settleAmount || 0, 2) }}</view>
+					</view>
+					<view class="list_b u-flex u-row-between">
+						<view>{{ item.createDate }}</view>
+						<view class="u-flex" v-if="item.billStatus != 'UNSETTLE'">
+							<view>已付款</view>
+							<u-icon name="yifukuan" custom-prefix="iscm-icon" size="40" :color="wordColor"></u-icon>
+						</view>
 					</view>
 				</view>
 			</view>
-		</view>
-		<view v-if="billList&&billList.length==0">
-			<u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="50"></u-empty>
-		</view>
-		<view style="padding: 20upx;" v-else>
-			<u-loadmore :status="status" v-if="status=='loading'"/>
+			<view v-if="billList && billList.length == 0">
+				<u-empty
+					v-if="status != 'loading'"
+					:src="`/static/${$config('themePath')}/def_no_data@3x.png`"
+					icon-size="180"
+					:text="noDataText"
+					mode="list"
+					:margin-top="50"
+				></u-empty>
+			</view>
+			<view style="padding: 20upx;" v-else><u-loadmore :status="status" v-if="status == 'loading'" /></view>
 		</view>
 	</view>
 </template>
 
 <script>
-	import { queryPage } from '@/api/verify.js';
-	import { toThousands } from '@/libs/tools.js'
-	export default {
-		data(){
-			return {
-				toThousands,
-				wordColor:this.$config('infoColor'),
-				curCustomerName:'',
-				pageNo: 1,
-				pageSize: 10,
-				totalNum: 0,
-				status: 'loadmore',
-				noDataText: '暂无数据',
-				billList:[],
-				targetSn:undefined
-			}
-		},
-		onLoad() {
-			uni.$on('chooseShelfOk',(data)=>{
-				this.pageNo=1;
-				this.targetSn = data.customerSn ?data.customerSn :undefined
-				this.curCustomerName=data.customerName
-				this.getList();
-			})
+import { queryPage } from '@/api/verify.js';
+import { toThousands } from '@/libs/tools.js';
+export default {
+	data() {
+		return {
+			toThousands,
+			wordColor: this.$config('infoColor'),
+			curCustomerName: '',
+			pageNo: 1,
+			pageSize: 10,
+			totalNum: 0,
+			status: 'loadmore',
+			noDataText: '暂无数据',
+			billList: [],
+			targetSn: undefined,
+			tabsList: [
+				{
+					id: 1,
+					name: '全部'
+				},
+				{
+					id: 2,
+					name: '未付款'
+				},
+				{
+					id: 3,
+					name: '已结清'
+				}
+			],
+			current: 0
+		};
+	},
+	onLoad() {
+		uni.$on('chooseShelfOk', data => {
+			this.pageNo = 1;
+			this.targetSn = data.customerSn ? data.customerSn : undefined;
+			this.curCustomerName = data.customerName;
+			this.getList();
+		});
+	},
+	onReady() {
+		setTimeout(() => {
+			this.getList();
+		}, 500);
+	},
+	methods: {
+		change(index) {
+			this.current = index;
 		},
-		onReady() {
-			setTimeout(()=>{
-				this.getList();
-			},500)
+		jumpPage(url) {
+			uni.navigateTo({
+				url
+			});
 		},
-		methods:{
-			jumpPage(url){
-				uni.navigateTo({
-					url
-				})
-			},
-			getList(){
-				let params = {targetSn:this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
-				this.status = 'loading';
-				queryPage(params).then(res => {
-					if (res.status == 200) {
-						if (this.pageNo > 1) {
-							this.billList = this.billList.concat(res.data.list || []);
-						} else {
-							this.billList = res.data.list || [];
-						}
-						this.totalNum = res.data.count || 0;
+		getList() {
+			let params = { targetSn: this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
+			this.status = 'loading';
+			queryPage(params).then(res => {
+				if (res.status == 200) {
+					if (this.pageNo > 1) {
+						this.billList = this.billList.concat(res.data.list || []);
 					} else {
-						this.billList = [];
-						this.totalNum = 0;
-						this.noDataText = res.message;
+						this.billList = res.data.list || [];
 					}
-					this.status = 'loadmore';
-				});
-			}
-		},
-		onReachBottom() {
-			if (this.billList.length < this.totalNum) {
-				this.pageNo += 1;
-				this.getList();
-			}else{
-				this.status = 'nomore'
-			}
-		},
-		onUnload(){
-			uni.$off('chooseShelfOk')
+					this.totalNum = res.data.count || 0;
+				} else {
+					this.billList = [];
+					this.totalNum = 0;
+					this.noDataText = res.message;
+				}
+				this.status = 'loadmore';
+			});
+		}
+	},
+	onReachBottom() {
+		if (this.billList.length < this.totalNum) {
+			this.pageNo += 1;
+			this.getList();
+		} else {
+			this.status = 'nomore';
 		}
+	},
+	onUnload() {
+		uni.$off('chooseShelfOk');
 	}
+};
 </script>
 
 <style lang="scss" scoped>
@@ -108,29 +136,30 @@
 		text-align: center;
 		padding-bottom: 20rpx;
 	}
-	.p-content{
+	.p-content {
 		flex-grow: 1;
-		padding:20rpx;
-		.list{
+		padding:20rpx 20rpx 0;
+		overflow-y: scroll;
+		.list {
 			width: 100%;
 			background: #ffffff;
-			padding:30rpx 20rpx;
+			padding: 30rpx 20rpx;
 			border-radius: 20rpx;
 			box-sizing: border-box;
 			margin-bottom: 20rpx;
-			.list_t{
+			.list_t {
 				margin-bottom: 20rpx;
-				view{
-					&:first-child{
+				view {
+					&:first-child {
 						width: calc(100% - 200rpx);
 					}
-					&:last-child{
-						color:$uni-color-warning;
+					&:last-child {
+						color: $uni-color-warning;
 					}
 				}
 			}
-			.list_b{
-				color:$uni-text-color-grey;
+			.list_b {
+				color: $uni-text-color-grey;
 				font-size: $uni-font-size-sm;
 				font-weight: 500;
 			}

+ 19 - 6
pages/sales/billHistoryDetail.vue

@@ -15,7 +15,7 @@
 			</view> -->
 			<view class="head_list">
 				<text>付款状态</text>
-				<text>{{ billInfo.billStatus == 'UNSETTLE' ? '未付款' : billInfo.settleStyleSnDictValue ? '已付款(' + billInfo.settleStyleSnDictValue + ')' : '已付款' }}</text>
+				<text>{{ billInfo.billStatus == 'UNSETTLE' ? '未付款' : billInfo.settleStyleSnDictValue ? '已结清(' + billInfo.settleStyleSnDictValue + ')' : '已结清' }}</text>
 			</view>
 		</view>
 		<view class="b_detail">
@@ -39,10 +39,22 @@
 					<text>¥{{ billInfo.settleAmount||billInfo.settleAmount ==0? toThousands(billInfo.settleAmount,2):'--' }}</text>
 				</view>
 			</view>
+			<view class="detail_list u-flex" v-if="billInfo.billStatus != 'UNSETTLE'">
+				<view class="detail_box">
+					<text>实际折让金额:</text>
+					<text>¥{{ billInfo.discountAmount||billInfo.discountAmount==0? toThousands(billInfo.discountAmount,2):'--'}}</text>
+				</view>
+				<view class="detail_box">
+					<text>实际收款金额:</text>
+					<text>¥{{ billInfo.settleAmount||billInfo.settleAmount ==0? toThousands(billInfo.settleAmount,2):'--' }}</text>
+				</view>
+			</view>
 		</view>
 		<view class="detail_con"><billList ref="billBox" :list="billArr"></billList></view>
-		<view class="footer" v-if="billInfo.billStatus == 'UNSETTLE'">
-			<u-button type="primary" :loading="btnLoading" @click="submitOrder" :custom-style="customStyle" shape="circle">再次发送对账单</u-button>
+		<view class="footer flex" v-if="billInfo.billStatus == 'UNSETTLE'">
+			<div>编辑</div>
+			<u-button type="warning" shape="circle">确认收款</u-button>
+			<u-button type="primary" shape="circle" :loading="btnLoading" @click="submitOrder" :custom-style="customStyle">再次发送对账单</u-button>
 		</view>
 		<!-- 分享询问弹窗 -->
 		<u-modal v-model="shareShow" :show-cancel-button="true" :content="shareContent" @confirm="handleShare" @cancel="shareShow = false;btnLoading = false;"></u-modal>
@@ -60,9 +72,9 @@ export default {
 		return {
 			customStyle: {
 				backgroundColor: this.$config('primaryColor'),
-				color: '#fff',
-				verifySn: ''
+				color: '#fff'
 			},
+			verifySn: '',
 			billInfo: null,
 			billArr: [],
 			timeInfo: '',
@@ -150,6 +162,7 @@ export default {
 .content {
 	height: 100vh;
 	width: 100%;
+	box-sizing: border-box;
 	.b_head {
 		background-color: #fff;
 		.head_list {
@@ -199,7 +212,7 @@ export default {
 	.footer {
 		padding: 10rpx 20rpx;
 		background: #fff;
-		margin-top: 20rpx;
+		align-items: center;
 	}
 }
 </style>