| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 | <template>	<view>		<wm-watermark :text="userInfo2.phone" :num="50"></wm-watermark>		<view class="scoped-list">			<view v-if="customerList.length == 0" class="empty-wrap"><u-empty mode="list" text="暂无成交单"></u-empty></view>			<view v-for="(item, index) in customerList" class="sl-item" :key="index">				<view v-if="item.trade_state == 2" :class="'sli-top t4'">[{{tradeStateObj[item.trade_state]}}][{{ thtObj[item.house_type] }}] {{ item.deal_item }}{{ item.house_no }}				</view>				<view v-else :class="'sli-top t' + item.deal_type">[{{tradeStateObj[item.trade_state]}}][{{ thtObj[item.house_type] }}] {{ item.deal_item }}{{ item.house_no }} 					<view v-if="item.create_by === userInfo2.id" class="r2" @click="pageTo('/pages/trade/create', { info: item })">编辑</view>					<view class="r" @click="copyTextHandle(item)">喜报</view>				</view>				<view class="sli-body" @click="pageTo('/pages/trade/record?id=' + item.id)">					<view class="sli-p2">总价:<view class="n">{{ item.price }}元</view> => {{(Number(item.price)/item.area).toFixed(2)}}元|<view class="n">{{ item.area }}㎡</view></view>					<view class="sli-p4" v-if="item.discount">折扣:{{ item.discount || '未知' }}</view>					<view class="sli-p1">客户:{{ item.customer_name }}({{ item.customer_phone }})</view>					<view class="sli-p1">业务:{{ item.deal_clerk }}报备至{{ item.report_dept }}({{ tdtObj[item.deal_type] }})</view>					<view class="sli-p1">佣金:<view class="n">{{ item.brokerage || '0' }}</view> 元 | 返佣<view class="n">{{ item.rebate || '0' }}</view>元					</view>					<!-- <view class="sli-state">佣金审核:<view :class="'s s' + item.check_state">{{ checkStateObj[item.check_state]}}{{ item.check_state == 1 ? '或不需审核' : '' }}</view></view> -->					<view class="sli-p3">所属门店:{{ item.store_type || '未填' }}</view>					<view class="sli-p3">成交日期:{{ item.deal_at }}</view>				</view>			</view>		</view>		<view class="float-search2" @click="pageTo('/pages/trade/create')"><u-icon name="plus" size="42" color="#fff"></u-icon></view>		<view class="float-search" @click="searchPopupShow = true"><u-icon name="search" size="42" color="#fff"></u-icon></view>		<u-popup v-model="searchPopupShow" mode="center" width="80%" height="860rpx" border-radius="20">			<view class="bwin-popup">				<view class="popup-header">成交单搜索</view>				<view class="popup-body">					<u-radio-group v-model="searchFormData.house_type" active-color="#2979ff">						<u-radio name=" ">全部</u-radio>						<u-radio name="1">新房</u-radio>						<u-radio name="2">二手房</u-radio>					</u-radio-group>					<u-divider marginTop="10" marginBottom="10">或</u-divider>					<u-input v-model="searchFormData.deal_item" border placeholder="请输入成交项目(支持模糊搜索)"></u-input>					<u-divider marginTop="10" marginBottom="10">或</u-divider>					<u-input v-model="searchFormData.deal_clerk" border placeholder="请输入成交业务员姓名(支持模糊搜索)"></u-input>					<u-divider marginTop="10" marginBottom="10">或</u-divider>					<u-input v-model="searchFormData.customer_name" border placeholder="请输入客户姓名(支持模糊搜索)"></u-input>					<u-divider marginTop="10" marginBottom="10">或</u-divider>					<u-input v-model="searchFormData.customer_phone" border placeholder="请输入客户手机号(可仅输入一部分)"></u-input>				</view>				<view class="popup-footer" style="position: absolute;">					<u-button size="medium" @click="searchPopupShow = false">取消</u-button>					<u-button size="medium" type="primary" @click="searchHandle()">搜索</u-button>				</view>			</view>		</u-popup>								<u-loadmore			v-if="customerList.length > 0"			marginTop="32"			:line="true"			:status="loadmore.status"			:loading-text="loadmore.loadingText"			:loadmore-text="loadmore.defaultText"			:nomore-text="loadmore.nomoreText"		/>	</view></template><script>import { arrToObj } from '@/utils'import wmWatermark from '@/components/wm-watermark/wm-watermark.vue'import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'var that;export default {	components: {		wmWatermark	},	data() {		const userInfo2 = uni.getStorageSync('MD_userInfo2')		return {			userInfo2,			thtObj: {},			tdtObj: {},			checkStateObj: {},			tradeStateObj: {},			searchKeyword: null,			searchPopupShow: false,			searchFormData: {				deal_item: '',				deal_clerk: userInfo2.roles == 7 ? userInfo2.nickname : '',				customer_name: '',				customer_phone: '',				house_type: '',			}, // 搜索栏数据			customerList: [],			loadmore: {				status: 'loadmore',				loadingText: '努力加载中',				defaultText: '轻轻上拉 查看更多',				nomoreText: '实在没有了',				currnetPage: 1			}		};	},	onLoad(params) {		that = this;		// 默认筛选项		if (params.filterStepStatus !== undefined) {			that.filterStepStatus = parseInt(params.filterStepStatus);			this.filterDropdownValue = [[],[],[],[that.filterStepStatus],[]]		}		const dictObj = uni.getStorageSync('MD_dict')		this.thtObj = arrToObj(dictObj.trade_house_type)		this.tdtObj = arrToObj(dictObj.trade_deal_type)		this.checkStateObj = arrToObj(dictObj.check_state)		this.tradeStateObj = arrToObj(dictObj.trade_state)				this.getDataList()	},	created () {	},	onReachBottom() {		if (that.loadmore.status == 'nomore') return;		that.loadmore.currnetPage++		this.getDataList()	},	onPullDownRefresh() {		// 防止频繁刷新	},	methods: {		// 带监听器跳转		pageTo(url, data) {			/// xxxxx			uni.navigateTo({				url: url,				events: {					// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据					update: function(data) {						// 当B页面运行 eventChannel.emit('update', { a:1 }); 时,会运行这里的代码逻辑。					}				},				success: function(res) {					// 通过eventChannel向被打开页面传送数据					res.eventChannel.emit('data', data);				}			});		},		copyTextHandle (item) {			uni.api.cust.apitradesubtotal({				user_id: item.create_by,				deal_at: item.deal_at,			}).then(res =>{let curContent = `【洪楼News】${item.deal_at}喜报恭喜${item.deal_clerk}小伙伴今日成交${this.thtObj[item.house_type]}第1套本月(${res.month}月)喜报总计:${res.month_total}套,本月个人总计:${res.user_total}套(1)客户姓名: ${item.customer_name}(2)报备电话:${item.customer_phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}(3)报备渠道:${item.report_dept}(${this.tdtObj[item.deal_type]})(4)成交项目:${item.deal_item}(5)具体房号:${item.house_no}(6)面积:${item.area}㎡(7)总价:${item.price}元(8)单价:${(Number(item.price)/item.area).toFixed(2)}元(9)折扣:${item.discount || '未知' }所属门店:${item.store_type || '未填' }齐心协力向前冲,洪楼业绩显峥嵘!`if (item.house_type == 2) {curContent = `【洪楼News】${item.deal_at}喜报恭喜${item.deal_clerk}小伙伴今日成交${this.thtObj[item.house_type]}第1套本月(${res.month}月)喜报总计:${res.month_total}套,本月个人总计:${res.user_total}套(1)客户姓名: ${item.customer_name}(2)报备电话:${item.customer_phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}(3)报备渠道:${item.report_dept}(${this.tdtObj[item.deal_type]})(4)成交项目:${item.deal_item}(5)具体房号:${item.house_no}(6)面积:${item.area}㎡(7)总价:${item.price}元(8)单价:${(Number(item.price)/item.area).toFixed(2)}元(9)折扣:${item.discount || '未知' }房源录入:${item.house_create || '未填' }[${item.house_id || 0}]所属门店:${item.store_type || '未填' }齐心协力向前冲,洪楼业绩显峥嵘!`}				uniCopy({					content: curContent,					success:(res)=>{						uni.showToast({							title: res,							icon: 'none'						})					},					error:(e)=>{						uni.showToast({							title: e,							icon: 'none',							duration:3000,						})					}				})			})		},		delHandle (item) {			uni.$msgConfirm('确定删除吗?', () => {								uni.api.cust.apiprivatecustomerdel({					id: item.id				}).then(res => {					uni.$msg('删除成功~')					this.loadmore.currnetPage = 1					this.getDataList()				})			})		},		getDataList (bc) {			const that = this			let params = {				...this.searchFormData			}			uni.api.cust.apitradelist({				page: that.loadmore.currnetPage,				...params,			}).then(res => {				const list = res.list || []				if (list.length < 10) {					that.loadmore.status = 'nomore';				}				if (res.current_page === 1) {					if (list.length == 0) {						uni.$msg('无搜索结果', 'none');					}					that.customerList = [...list]				} else {					that.customerList = that.customerList.concat(list)				}				if (bc) bc()			})		},		customBack() {			uni.navigateBack();		},		// 带监听器跳转		pageTo(url, data) {			/// xxxxx			uni.navigateTo({				url: url,				events: {					// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据					update: function(data) {						// 当B页面运行 eventChannel.emit('update', { a:1 }); 时,会运行这里的代码逻辑。					}				},				success: function(res) {					// 通过eventChannel向被打开页面传送数据					res.eventChannel.emit('data', data);				}			});		},		searchHandle() {			that.loadmore.currnetPage = 1			this.getDataList(() => {				this.searchPopupShow = false			})		},	}};</script><style lang="scss">.scoped-list {	padding-top: 20rpx;	.sl-item {		box-shadow: 0 0 5px #ccc;		margin: 0 20rpx 20rpx;		border-radius: 20rpx;		overflow: hidden;		.sli-top {			position: relative;			height: 70rpx;			line-height: 70rpx;			color: #fff;			background: #2d8cf0;			padding-left: 20rpx;			&.t2 {				background: #19be6b;			}			&.t3 {				background: #795548;			}			&.t4 {				background: #ccc;			}			.r {				position: absolute;				top: 0;				right: 20rpx;				height: 70rpx;				line-height: 70rpx;				color: #eee;			}			.r2 {				position: absolute;				top: 0;				right: 100rpx;				height: 70rpx;				line-height: 70rpx;				color: #eee;			}		}		.sli-body {			padding: 10rpx 20rpx;		}		.sli-p1 {			color: #666;			margin-bottom: 10rpx;			font-size: 28rpx;			.n {				color: #ff9900;				display: inline-block;				font-weight: bold;			}			.i {				color: #2d8cf0;				font-weight: bold;				display: inline-block;				padding-left: 10rpx;			}		}		.sli-p2 {			color: #333;			margin-bottom: 10rpx;			.n {				font-size: 30rpx;				display: inline-block;				font-weight: bold;				color: #ed4014;			}		}		.sli-p3 {			color: #999;			font-size: 28rpx;			margin-bottom: 10rpx;		}		.sli-p4 {			background: rgba(255,229,100,.3);			color: #666;			margin-bottom: 10rpx;		}		.sli-state {			margin-bottom: 10rpx;			color: #666;			.s {				font-weight: bold;				background: #2d8cf0;				padding: 6rpx 10rpx;				color: #fff;				border-radius: 10rpx;				display: inline-block;				font-size: 24rpx;				&.s1 {					background: #ccc;				}				&.s5 {					background: #19be6b;				}			}		}	}}.float-search {	opacity: 0.9;	position: fixed;	right: 20rpx;	bottom: 40rpx;	padding: 20rpx;	border-radius: 50%;	background-color: $u-theme-color;}.float-search2 {	opacity: 0.9;	position: fixed;	right: 20rpx;	bottom: 150rpx;	padding: 20rpx;	border-radius: 50%;	background-color: $u-theme-color;}</style>
 |