chenrui 2 tahun lalu
induk
melakukan
3c261ce06a
4 mengubah file dengan 384 tambahan dan 127 penghapusan
  1. 140 121
      pages/sales/chooseCustomerBill.vue
  2. 203 0
      pages/sales/customerList.vue
  3. 40 5
      pages/sales/gather.vue
  4. 1 1
      pages/sales/index.vue

+ 140 - 121
pages/sales/chooseCustomerBill.vue

@@ -1,55 +1,41 @@
 <template>
 	<view class="content flex flex_column">
-		<view class="header u-flex">
-			<view class="tab">
-				<u-tabs :show-bar="false" :active-item-style="activeItemStyle" :list="tabsList" :is-scroll="false" :current="current" @change="changeTabs"></u-tabs>
-			</view>
-			<view class="payType" @click="gatherShow = true">
-				<text :style="{ color: wordColor }">收款方式</text>
-				<u-icon name="shaixuan" custom-prefix="iscm-icon" size="30" :color="wordColor"></u-icon>
+		<view id="tab">
+			<view class="header u-flex">
+				<view class="tab">
+					<u-tabs :show-bar="false" :active-item-style="activeItemStyle" :list="tabsList" :is-scroll="false" :current="params.allCustomerFlag" @change="changeTabs"></u-tabs>
+				</view>
+				<view class="payType" @click="gatherShow = true">
+					<text :style="{ color: wordColor }">收款方式</text>
+					<u-icon name="shaixuan" custom-prefix="iscm-icon" size="30" :color="wordColor"></u-icon>
+				</view>
 			</view>
-		</view>
-		<view class="tabCon flex flex_column" v-show="current == 0">
-			<view class="scroll-con u-flex u-row-between">
+			<view class="scroll-con u-flex u-row-between" v-show="params.allCustomerFlag == 0">
 				<scroll-view scroll-x class="scroll-date">
 					<view class="u-flex" v-show="!showType">
-						<view v-for="(item, i) in 10" :key="i">
+						<view v-for="(item, i) in dayGatherArr" :key="i">
 							<view class="scroll-box" :class="chooseNum == i ? 'activeBox' : ''" v-if="i < 2" @click="handleDate(i)">
-								<view>11.{{ i + 1 }}</view>
-								<view>今日</view>
+								<view>{{item}}</view>
+								<view>{{i==0?'今日':'昨日'}}</view>
 							</view>
-							<view class="scroll-box" v-else :class="chooseNum == i ? 'activeBox' : ''" @click="handleDate(i)">{{ i + 1 }}</view>
+							<view class="scroll-box" v-else :class="chooseNum == i ? 'activeBox' : ''" @click="handleDate(i)">{{item.split('.')[1]}}</view>
 						</view>
 					</view>
 					<view class="u-flex" v-show="showType">
-						<view v-for="(item, i) in 10" :key="i">
-							<view class="scroll-box" :class="chooseNum == i ? 'activeBox' : ''" v-if="i < 2" @click="handleDate(i)">
-								<view>2022.{{ i + 1 }}</view>
-								<view>本月</view>
+						<view v-for="(con, j) in monthGatherArr" :key="j">
+							<view class="scroll-box" :class="chooseNum == j ? 'activeBox' : ''" v-if="j < 2" @click="handleDate(j)">
+								<view>{{con}}</view>
+								<view>{{j==0?'本月':'上月'}}</view>
 							</view>
-							<view class="scroll-box" v-else :class="chooseNum == i ? 'activeBox' : ''" @click="handleDate(i)">2022.{{ i + 1 }}</view>
+							<view class="scroll-box" v-else :class="chooseNum == j ? 'activeBox' : ''" @click="handleDate(j)">{{con}}</view>
 						</view>
 					</view>
 				</scroll-view>
 				<u-image :src="`../../static/${theme}/navIcon/dayImg.png`" width="42" height="42" v-show="!showType" @click="chooseType"></u-image>
 				<u-image :src="`../../static/${theme}/navIcon/monthImg.png`" width="42" height="42" v-show="showType" @click="chooseType"></u-image>
 			</view>
-			<view class="customer-con">
-				<view class="customer-list">
-					<view class="u-line-1">按成修配按成修配按成修配按成修配按成修配按成修配按成修配按成修配按成修配</view>
-					<view class="customer-b u-flex">
-						<view class="customer-box">
-							<text>欠款:</text>
-							<text>¥582222.00</text>
-						</view>
-						<view class="customer-box">收款方式:现金</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="tabCon flex flex_column" v-show="current == 1">
-			<view class="customer-search">
-				<u-search
+			<view class="customer-search" v-show="params.allCustomerFlag == 1">
+				<u-search 
 					v-model="keyword"
 					@input="$u.debounce(getSearchCon, 800)"
 					@search="getSearchCon"
@@ -59,23 +45,9 @@
 					placeholder="请输入客户名称拼音首字母查询"
 				></u-search>
 			</view>
-			<view class="customer-con">
-				<u-index-list :scrollTop="scrollTop">
-					<view v-for="(item, index) in indexList" :key="index">
-						<u-index-anchor :index="item" />
-						<view class="customer-list">
-							<view class="u-line-1">按成修配按成修配按成修配按成修配按成修配按成修配按成修配按成修配按成修配</view>
-							<view class="customer-b u-flex">
-								<view class="customer-box">
-									<text>欠款:</text>
-									<text>¥582222.00</text>
-								</view>
-								<view class="customer-box">收款方式:现金</view>
-							</view>
-						</view>
-					</view>
-				</u-index-list>
-			</view>
+		</view>
+		<view class="customer-con">
+			<customerList ref="customer" :height="listHeight" :params="params" ></customerList>
 		</view>
 		<!-- 收款方式弹窗 -->
 		<search :showModal="gatherShow" @refresh="refreshList" @close="gatherShow=false"/>
@@ -84,8 +56,11 @@
 
 <script>
 import search from './gather.vue'
+import customerList from './customerList.vue'
+import { queryVerifySalesParams } from '@/api/dealerBizParam.js';
+import getDate from '@/libs/getDate.js';
 export default {
-	components:{search},
+	components:{search,customerList},
 	data() {
 		return {
 			tabsList: [
@@ -93,22 +68,37 @@ export default {
 					name: '最近开单'
 				},
 				{
-					name: '全部户'
+					name: '全部户'
 				}
 			],
-			current: 0,
 			activeItemStyle: {
 				color: this.$config('primaryColor'),
 				borderBottom: '4rpx solid ' + this.$config('primaryColor')
 			},
 			wordColor: this.$config('infoColor'),
 			theme: '',
-			chooseNum: 0,
 			showType: false,
-			indexList: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
-			scrollTop: 0,
+			
+			chooseNum: 0,
+			
 			keyword:'',
-			gatherShow:false
+			gatherShow:false,
+			systemSetList:null,//系统参数列表
+			params:{
+				allCustomerFlag:0 ,//1全部  0需要查询条件
+				customer:{
+					queryWord:undefined,
+					settleStyleSn:undefined
+				},
+				bizBeginDate:undefined,
+				bizEndDate:undefined
+			},
+			pageNo:1,
+			pageSize:15,
+			noDataText: '暂无数据',
+			listHeight:200,
+			dayGatherArr:[],
+			monthGatherArr:[]
 		};
 	},
 	onReady() {
@@ -116,31 +106,80 @@ export default {
 			frontColor: '#ffffff',
 			backgroundColor: this.$config('primaryColor')
 		});
+		const query = uni.createSelectorQuery().in(this);
+		query.select('#tab').boundingClientRect(data => {
+		  this.listHeight = Math.floor(data.height)
+		}).exec();
 	},
 	onLoad() {
 		this.theme = getApp().globalData.theme;
+		this.getSetInfo();
+		//获取日期集合
+		this.dayGatherArr = getDate.getWeekGather();
+		this.monthGatherArr = getDate.getMonthGather();
+	},
+	onBackPress() {
+		if(this.gatherShow){
+			this.gatherShow = false
+			return true
+		}
 	},
-	onPageScroll(e) {
-				this.scrollTop = e.scrollTop;
-			},
 	methods: {
+		//获取系统参数
+		getSetInfo(){
+			// month day all
+			queryVerifySalesParams({}).then(res => {
+				this.systemSetList = res.data;
+				let obj=res.data.find(item=>{return item.remarks == 'verify_default_customer'})
+				if(obj.paramValue == 'all'){
+					this.params.allCustomerFlag = 1;
+				}else if(obj.paramValue == 'month'){
+					this.showType = true
+				}else{
+					this.showType = false
+				}
+				this.momentTime(0)
+			});
+		},
 		changeTabs(index) {
-			this.current = index;
+			this.params.allCustomerFlag = index;
+			this.$refs.customer.getList(1);
 		},
 		handleDate(i) {
 			this.chooseNum = i;
+			this.momentTime(i)
 		},
 		chooseType() {
+			this.chooseNum  = 0;
 			this.showType = !this.showType;
+			this.momentTime(0)
+		},
+		momentTime(pos){
+			var obj=null;
+			if(!this.showType){//日
+				 obj =getDate.getFullToday(this.dayGatherArr[pos])
+			}else{
+				obj=getDate.getFullMonth(this.monthGatherArr[pos])
+			}
+			this.params.bizBeginDate = obj.starttime;
+			this.params.bizEndDate = obj.endtime;
+			this.refreshList();
 		},
 		getSearchCon(){
-			
+			this.params.customer.queryWord = this.keyword.trim();
+			this.refreshList();
 		},
 		clearSearch(){
-			
+			this.refreshList();
 		},
-		refreshList(){
-			
+		refreshList(e){
+			const _this= this
+			if(e){
+				_this.params.customer.settleStyleSn = e.code;
+			}
+			this.$nextTick(()=>{
+				_this.$refs.customer.getList(1);
+			})
 		}
 	}
 };
@@ -166,67 +205,47 @@ export default {
 			}
 		}
 	}
-	.tabCon {
-		flex-grow: 1;
-		.scroll-con {
-			width: 100%;
-			background: #fff;
-			margin: 6rpx 0;
-			padding: 10rpx 20rpx;
-			.scroll-date {
-				width: calc(100% - 62rpx);
-				.scroll-box {
-					margin-right: 20rpx;
-					padding: 10rpx 20rpx;
-					text-align: center;
-					font-size: 26rpx;
-					view {
-						&:last-child {
-							font-size: 24rpx;
-							color: #666;
-						}
-					}
-				}
-				.activeBox {
-					font-weight: bold;
-					color: $uni-color-primary;
-					view {
-						&:last-child {
-							font-size: 24rpx;
-							color: $uni-color-primary;
-						}
+	.scroll-con {
+		width: 100%;
+		background: #fff;
+		margin: 6rpx 0;
+		padding: 10rpx 20rpx;
+		.scroll-date {
+			width: calc(100% - 62rpx);
+			.scroll-box {
+				margin-right: 28rpx;
+				padding: 10rpx 20rpx;
+				text-align: center;
+				font-size: 26rpx;
+				view {
+					&:last-child {
+						font-size: 24rpx;
+						color: #666;
 					}
 				}
 			}
-		}
-		.customer-con {
-			flex-grow: 1;
-			overflow: auto;
-			background: #fff;
-			.customer-list {
-				padding: 20rpx;
-				border-bottom: 1rpx solid #f8f8f8;
-			}
-			.customer-b {
-				margin-top: 10rpx;
-				color: #666;
-				font-size: 26rpx;
-				.customer-box {
-					width: 46%;
-					text {
-						&:last-child {
-							color: $uni-color-warning;
-						}
+			.activeBox {
+				font-weight: bold;
+				color: $uni-color-primary;
+				view {
+					&:last-child {
+						font-size: 24rpx;
+						color: $uni-color-primary;
 					}
 				}
 			}
 		}
-		//选择客户
-		.customer-search {
-			padding: 10rpx 20rpx;
-			background: #fff;
-			margin: 6rpx 0;
-		}
+	}
+	.customer-con {
+		flex-grow: 1;
+		overflow: auto;
+		background: #fff;
+	}
+	//选择客户
+	.customer-search {
+		padding: 10rpx 20rpx;
+		background: #fff;
+		margin: 6rpx 0;
 	}
 }
 </style>

+ 203 - 0
pages/sales/customerList.vue

@@ -0,0 +1,203 @@
+<template>
+	<view class="sales-list-component">
+		<view v-if="listData && listData.length>0">
+			<scroll-view class="sales-list-con" :style="{ height: scrollH + 'px' }"  scroll-y @scrolltolower="onreachBottom">
+				<view class="customer-list" v-for="(item,i) in listData" :key="i">
+					<view class="u-line-1">{{item.customer.customerName}}</view>
+					<view class="customer-b u-flex">
+						<view class="customer-box">
+							<text>欠款:</text>
+							<text>¥{{item.settleAmount || 0}}</text>
+						</view>
+						<view class="customer-box">收款方式:{{item.customer.settleStyleSnDictValue}}</view>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+		<view v-else>
+			<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="150" :text="noDataText" mode="list" :margin-top="50"></u-empty>
+		</view>
+		<view style="padding-bottom: 20upx;" ><u-loadmore v-if="totalNum > listData.length || status == 'loading'" :status="status" /></view>
+	</view>
+</template>
+
+<script>
+import { queryCustomerPage } from '@/api/verify.js';
+export default {
+	props: {
+		height: {
+			// 滚动区域高度   upx
+			type: [String, Number],
+			default: 300
+		},
+		params: {
+			// 列表查询条件
+			type: Object,
+			default: () => {
+				return {};
+			}
+		}
+	},
+	data() {
+		return {
+			listData: [],
+			pageNo: 1,
+			pageSize: 10,
+			totalNum: 0,
+			status: 'loadmore',
+			noDataText: '暂无数据',
+			
+			auditModal: false, // 审核弹框
+			dataInfo: null,
+			outModal: false, // 出库弹框
+			delModal: false, // 删除/取消弹框
+			delText: '确认要删除吗?',
+			scrollH: 300
+		};
+	},
+	watch: {
+		height(a, b) {
+			console.log(a, b);
+			const sys = uni.getSystemInfoSync();
+			console.log(sys);
+			if (sys.platform == 'android') {
+				this.scrollH = sys.windowHeight - a;
+			} else {
+				if (sys.safeArea.top) {
+					this.scrollH = sys.windowHeight - a + sys.statusBarHeight - 34;
+				} else {
+					this.scrollH = sys.windowHeight - a - 14;
+				}
+			}
+		}
+	},
+	methods: {
+		refash() {
+			this.listData = [];
+			this.totalNum = 0;
+			this.getList(1);
+		},
+		// 列表
+		getList(pageNo) {
+			const _this = this;
+			if (pageNo) {
+				this.pageNo = pageNo;
+			}
+			let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize });
+			this.status = 'loading';
+			queryCustomerPage(params).then(res => {
+				if (res.status == 200) {
+					if (this.pageNo > 1) {
+						this.listData = this.listData.concat(res.data.list || []);
+					} else {
+						this.listData = res.data.list || [];
+					}
+					this.totalNum = res.data.count || 0;
+				} else {
+					this.listData = [];
+					this.totalNum = 0;
+					this.noDataText = res.message;
+				}
+				this.status = 'loadmore';
+			});
+		},
+		// scroll-view到底部加载更多
+		onreachBottom() {
+			if (this.listData.length < this.totalNum) {
+				this.pageNo += 1;
+				this.getList();
+			}
+		},
+		// 查看详情
+		getDetail(data) {
+			uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data=' + JSON.stringify(data) });
+		},
+		// 编辑
+		handleEdit(data) {
+			uni.navigateTo({ url: '/pages/sales/edit?pageType=edit&data=' + JSON.stringify(data) });
+		},
+		// 操作
+		handleFun(type, data) {
+			this.dataInfo = data;
+			if (type == 'audit') {
+				// 审核
+				this.auditModal = true;
+			} else if (type == 'out') {
+				// 出库
+				this.outModal = true;
+			} else if (type == 'del') {
+				// 删除
+				this.delText = '确认要删除吗?';
+				this.delModal = true;
+			} else if (type == 'cancel') {
+				// 取消
+				this.delText = '确认要取消吗?';
+				this.delModal = true;
+			}
+		},
+		// 审核通过或不通过
+		handleAudit(billStatus) {
+			salesWriteAudit({
+				id: this.dataInfo.id,
+				billStatus: billStatus
+			}).then(res => {
+				if (res.status == 200) {
+					this.toashMsg(res.message);
+					this.getList(1);
+					this.auditModal = false;
+				} else {
+					this.auditModal = false;
+				}
+			});
+		},
+		// 出库
+		handleOut() {
+			salesWriteStockOut({ salesBillSn: this.dataInfo.salesBillSn }).then(res => {
+				if (res.status == 200) {
+					this.toashMsg(res.message);
+					this.getList(1);
+					this.outModal = false;
+				} else {
+					this.outModal = false;
+				}
+			});
+		},
+		// 删除
+		handleDel() {
+			salesDel({ id: this.dataInfo.id }).then(res => {
+				if (res.status == 200) {
+					this.toashMsg(res.message);
+					this.getList(1);
+					this.delModal = false;
+				} else {
+					this.delModal = false;
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.sales-list-component {
+	.sales-list-con {
+		.customer-list {
+			padding: 20rpx;
+			border-bottom: 1rpx solid #f8f8f8;
+		}
+		.customer-b {
+			margin-top: 10rpx;
+			color: #666;
+			font-size: 26rpx;
+			.customer-box {
+				width: 46%;
+				text {
+					&:last-child {
+						color: $uni-color-warning;
+					}
+				}
+			}
+		}
+	}
+}
+</style>

+ 40 - 5
pages/sales/gather.vue

@@ -2,14 +2,14 @@
 	<view class="modal-box">
 		<u-popup v-model="isShow"  @close="isShow=false" mode="right" length="85%" >
 			<view class="modal-con u-flex u-flex-wrap u-row-between" :style="{height:toggle? auto:'180rpx'}">
-				<view class="list" v-for="(item,i) in list" :key="i">{{item}}</view>
+				<view class="list" :class="selectNum==i?'selectBox':''" v-for="(item,i) in list" :key="item.id" @click="handleChoole(i)">{{item.dispName}}</view>
 			</view>
 			<view class="showMore" :style="{color:$config('primaryColor')}" @click="toggle=!toggle">
 				<text>{{toggle?'收起':'更多选项'}}</text>
 				<u-icon :name="toggle?'arrow-up':'arrow-down'" :color="$config('primaryColor')" size="28"></u-icon>
 			</view>
 			<view class="form-footer-btn">
-				<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClean">重置</u-button>
+				<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClear">重置</u-button>
 				<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
 			</view>
 		</u-popup>
@@ -17,13 +17,13 @@
 </template>
 
 <script>
+	import { getLookUpDatas } from '@/api/data';
 	export default{
 		props:{
 			showModal:{
 				type: Boolean,
 				default: false
 			}
-			
 		},
 		data(){
 			return{
@@ -34,11 +34,40 @@
 				},
 				isShow:this.showModal,
 				toggle:false,
-				list:['未指定','现金','月结','挂账','支付宝','微信支付','银行刷卡','银行汇款','待收','托收','农银e管家','农银e管家(代付)','市场通企业支付','市场通个人支付']
+				selectNum:-1,
+				list:[]
 			}
 		},
 		methods:{
-			
+			getList() {
+				getLookUpDatas({
+					lookupCode: 'SETTLE_STYLE',
+					pageNo: 1,
+					pageSize: 1000
+				}).then(result => {
+					if (result && result.status == 200) {
+						this.list = result.data.list;
+					}
+				});
+			},
+			handleChoole(e){
+				if(this.selectNum == e){
+					this.selectNum = -1;
+				}else{
+					this.selectNum = e
+				}
+			},
+			handleSearch(){
+				if(this.selectNum != -1){
+					this.$emit('refresh',this.list[this.selectNum]);
+				}
+				this.isShow = false
+			},
+			handleClear(){
+				this.selectNum=-1;
+				this.isShow = false
+				this.$emit('refresh');
+			}
 		},
 		watch:{
 			//  父页面传过来的弹框状态
@@ -49,6 +78,8 @@
 			isShow (newValue, oldValue) {
 				if (!newValue) {
 					this.$emit('close')
+				}else{
+					this.getList();
 				}
 			}
 		}
@@ -71,6 +102,10 @@
 				background:#f0f0f0;
 				font-size: 26rpx;
 			}
+			.selectBox{
+				background:#007aff;
+				color:#fff;
+			}
 		}
 		.showMore{
 			text-align: center;

+ 1 - 1
pages/sales/index.vue

@@ -35,7 +35,7 @@
 					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/pfind.png`" width="64" height="64"></u-image>
 					<text class="nav-txt">产品查询</text>
 				</view>
-				<view class="nav-item" @click="toPage('/pages/sales/bill')">
+				<view class="nav-item" @click="toPage('/pages/sales/chooseCustomerBill')">
 					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/billImg.png`" width="64" height="64"></u-image>
 					<text class="nav-txt">应收对账单</text>
 				</view>