Browse Source

报表页内跳转

zzp 2 năm trước cách đây
mục cha
commit
bc342b00ee
5 tập tin đã thay đổi với 339 bổ sung51 xóa
  1. 9 3
      config/api.js
  2. 5 0
      pages.json
  3. 3 3
      pages/report/index.vue
  4. 302 0
      pagesMain/reportInfo.vue
  5. 20 45
      pagesMain/venueDetail.vue

+ 9 - 3
config/api.js

@@ -2,10 +2,10 @@
 // const API_BASE = 'http://192.168.1.126:30000'
 //const API_BASE = 'http://192.168.1.117:8089'
 //const API_BASE = 'http://192.168.1.145/newApi'
-const API_BASE = 'http://192.168.1.109/newApi'
+// const API_BASE = 'http://192.168.1.109/newApi'
 // const API_BASE = 'http://192.168.1.117:8089'
 //const API_BASE = 'http://192.168.1.145/newApi'
-//const API_BASE = 'http://192.168.1.117:8089'
+const API_BASE = 'http://192.168.1.117:8089'
 // const API_BASE = 'http://192.168.1.145/newApi'
 
 module.exports = {
@@ -21,6 +21,13 @@ module.exports = {
 	
 	//  获取统计图数据
 	getCensusChart: API_BASE + '/v2/sale/home/getCustomerCreateStatisticsList',
+	//  久未跟进
+	estrangedList: API_BASE + '/v2/sale/center/estrangedList',
+	//  生日提醒
+	birthdayRemind: API_BASE + '/v2/sale/center/birthdayRemind',
+	//  预约记录
+	oneWeekAppointment: API_BASE + '/v2/sale/center/oneWeekAppointment',
+	
 	//  获取附近场馆列表
 	getNearVenueList: API_BASE + '/v2/sale/home/getVenueNearList',
 	//  获取所有场馆列表
@@ -54,7 +61,6 @@ module.exports = {
 	//  提交已报名表单
 	submitEnrolledForm: API_BASE + '/v2/sale/customer/joinCLass',
 
-	
 	//  无效
 	updateCustomerState: API_BASE + '/v2/sale/customer/updateCustomerState',
 	//  提交意向客户表单

+ 5 - 0
pages.json

@@ -76,6 +76,11 @@
 			"style": {
 				"navigationBarTitleText": ""
 			}
+		},{
+			"path": "reportInfo",
+			"style": {
+				"navigationBarTitleText": ""
+			}
 		},{
 			"path": "allCustomer",
 			"style": {

+ 3 - 3
pages/report/index.vue

@@ -3,7 +3,7 @@
 		<view class="first-content">
 			<view><text style="font-size: 44rpx;font-weight: bold;">客户跟进</text></view>
 			<view class="content-box">
-				<view class="content-info">
+				<view class="content-info" @click.native="goUrl('/pagesMain/reportInfo?type=1&navTitle=久未跟进')">
 					<view class="info-num">{{ info.estranged }}</view>
 					<view class="info-introduce">久未跟进</view>
 					<view class="info-text">长时间未跟进的客户</view>
@@ -13,12 +13,12 @@
 					<view class="info-introduce">即将到期</view>
 					<view class="info-text">会员卡即将过期的会员</view>
 				</view>
-				<view class="content-info">
+				<view class="content-info" @click.native="goUrl('/pagesMain/reportInfo?type=3&navTitle=生日提醒')">
 					<view class="info-num">{{ info.birthdayRemind }}</view>
 					<view class="info-introduce">生日提醒</view>
 					<view class="info-text">即将过生日的会员</view>
 				</view>
-				<view class="content-info">
+				<view class="content-info" @click.native="goUrl('/pagesMain/reportInfo?type=4&navTitle=预约记录')">
 					<view class="info-num">{{ info.oneWeekAppointment }}</view>
 					<view class="info-introduce">预约记录</view>
 					<view class="info-text">预约到店的会员</view>

+ 302 - 0
pagesMain/reportInfo.vue

@@ -0,0 +1,302 @@
+<template>
+	<view class="content">
+	<!-- 	<view class="filter-box">
+			<u-search placeholder="请输入关键字" v-model="filterText" @search="setFilterText" @custom="setFilterText"></u-search>
+		</view> -->
+		<template v-if="tabList[0].tableList.length">
+			<scroll-view scroll-y class="scroll-box" @scrolltolower="handleLoadMore" :refresher-enabled="true"
+			 :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
+			 @refresherrestore="onRestore">
+				<u-card :show-head="false" :foot-border-top="false" margin="10px 15px" borderRadius="40" :foot-style="{padding: '0 10px 5px 0'}" v-for="(site, index2) in tabList[0].tableList"
+				 :key="index2" class="card-box">
+					<view slot="body" class="card-content">
+						<view class="student-info">
+							<view style="width: 100%;margin-bottom: 5px;">
+								<text class="info-name" style="margin-right: 10px;">{{site.studentName}}</text>
+								<text class="info-name">{{site.fatherName}}</text>
+							</view>
+							<view class="info-phone">{{site.parentPhone}}</view>
+							<view class="info-phone" v-if="getType == 3">生日: {{site.parentPhone}}</view>
+							<view class="info-phone" v-if="getType == 4">预约时间: {{site.parentPhone}}</view>
+						</view>
+					</view>
+					<view slot="foot" style="text-align: right;" v-if="getType == 1">
+						<u-button type="warning" :ripple="true" shape="circle" :custom-style="handleCustomStyle" size="mini" @click="handleRecordClick(site.id)">追踪信息</u-button>
+					</view>
+				</u-card>
+				<u-divider v-if="item.isOver" bg-color="transparent" :style="{paddingTop : tabList[0].tableList.length == 0 ? '10px' : ''}">没有更多了</u-divider>
+			</scroll-view>
+		</template>
+		<template v-else>
+			<u-empty mode="data"></u-empty>
+		</template>
+		<!-- 追踪记录 -->
+		<u-popup v-model="recordShow" mode="center" border-radius="30" width="600rpx" height="500px" >
+			<view class="common-title">追踪记录</view>
+			<view class="menber-box" style="overflow-y: auto;height:390px;">
+				<template v-if="recordList.legnth">
+					<view style="padding:5px; border-bottom:1px solid #aaa;" v-for="(item,index) in recordList">
+						<view>{{ item.content }}</view>
+						<view>{{ item.createTime }}</view>
+					</view>
+				</template>
+				<template v-else>
+					<u-empty mode="data"></u-empty>
+				</template>
+			</view>
+			<view class="button-box">
+				<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="recordShow = false">确定</u-button>
+			</view>
+		</u-popup>
+		<u-top-tips ref="uTips"></u-top-tips>
+	</view>
+</template>
+
+<script>
+	import {
+		mapGetters
+	} from 'vuex'
+	const NET = require('@/utils/request')
+	const API = require('@/config/api')
+	export default {
+		computed: {
+			...mapGetters([
+				'customStyle',
+				'handleCustomStyle',
+			])
+		},
+		data() {
+			return {
+				getType: 0,
+				customerId: '',
+				// filterText: '',
+				triggered: false,
+				tabList: [
+				 {
+					name: '未联系',
+					isOver: false,
+					pageIndex: 1,
+					filterText: '',
+					type: 1,
+					tableList: [],
+				}],
+				// 追踪记录
+				recordShow: false,
+				recordList: []
+			}
+		},
+		onLoad(options) {
+			this.getType = options.type
+			uni.setNavigationBarTitle({
+				title: options.navTitle
+			});
+		},
+		onShow() {
+			this.tabList = Object.assign([], this.$options.data().tabList)
+			this.getTableList()
+		},
+		onReady() {},
+		methods: {
+			//  获取列表数据
+			getTableList() {
+				let rUrl = ''
+				switch (parseInt(this.getType)) {
+					case 1:
+						rUrl = API.estrangedList
+						break
+					case 3:
+						rUrl = API.birthdayRemind
+						break
+					case 4:
+						rUrl = API.oneWeekAppointment
+						break
+				}
+				NET.request(rUrl, {
+					page: 1,
+					size: 100,
+				}, 'POST').then(res => {
+					this.triggered = false
+					this.tabList[0].tableList = res.data
+				})
+			},
+			// 查看追踪记录
+			handleRecordClick(id) {
+				NET.request(API.findResourceRecordList, {
+					id,
+					page:1,
+					size: 100}, 'POST').then(res=> {
+						if(res.status == 10000) {
+							this.recordShow = true
+							this.recordList = res.data
+						} else {
+							this.$refs.uTips.show({
+								title: res.message,
+								type: 'warning',
+							})
+						}
+				}) 
+			},
+			//  设置过滤字段
+			setFilterText(value) {
+				this.tabList[0].filterText = value
+				this.onRefresh()
+			},
+			//  下拉刷新
+			onRefresh() {
+				if (!this.triggered) {
+					this.triggered = true
+					this.tabList[0].isOver = false
+					this.tabList[0].pageIndex = 1
+					this.tabList[0].tableList = []
+					this.getTableList()
+				}
+			},
+			//  重置下拉刷新状态
+			onRestore() {
+				this.triggered = false
+			},
+			//  懒加载
+			handleLoadMore() {
+				if (!this.tabList[0].isOver) {
+					this.tabList[0].pageIndex++
+					this.getTableList()
+				}
+			}
+		},
+	}
+</script>
+
+<style>
+	page {
+		width: 100%;
+		height: 100%;
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	@import "@/static/css/themes.scss";
+
+	.content {
+		width: 100%;
+		float: left;
+		
+		.filter-box {
+			height: 48px;
+			padding: 10px 15px;
+			background-color: #FFFFFF;
+		}
+
+		.swiper-box {
+			height: calc(100vh - 82px);
+
+			.swiper-item {
+				height: calc(100vh - 82px);
+
+				.scroll-box {
+					width: 100%;
+					height: calc(100vh - 82px);
+
+					.card-box {
+						.card-content {
+							display: flex;
+							align-items: center;
+
+							.student-info {
+								flex: 1;
+
+								.info-name {
+									// width: 64px;
+									// float: left;
+									line-height: 28px;
+									font-size: 14px;
+									font-weight: bold;
+								}
+
+								.info-type {
+									padding: 0 10px;
+									margin-top: 3px;
+									border-radius: 20px;
+									float: left;
+									line-height: 20px;
+									font-size: 10px;
+									color: #FFFFFF;
+									background-color: #999999;
+								}
+
+								.info-type-active {
+									background-color: $mainColor;
+								}
+
+								.info-phone {
+									font-size: 12px;
+									color: #999999;
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	.menber-box {
+		width: 100%;
+		// float: left;
+		padding: 10px 15px;
+		margin-bottom: 10px;
+		
+		.menber-col {
+			width: 100%;
+			padding: 15px;
+			margin-bottom: 10px;
+			display: inline-block;
+			background-color: #FFFFFF;
+			border-radius: 15px;
+			box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
+			position: relative;
+			overflow: hidden;
+			box-sizing: border-box;
+			
+			.menber-label {
+				width: 100%;
+				margin-bottom: 5px;
+				float: left;
+				font-size: 14px;
+				// line-height: 20px;
+			}
+	
+			.menber-num {
+				width: 100%;
+				float: left;
+				font-size: 26px;
+				line-height: 28px;
+				color: $mainColor;
+			}
+	
+			.menber-icon {
+				font-size: 100px;
+				color: $mainColor;
+				position: absolute;
+				right: -5px;
+				bottom: -30px;
+				opacity: 0.5;
+			}
+		}
+	}
+	.common-title {
+		width:100%;
+		text-align: center;
+		font-size: 20px;
+		margin: 10px 0;
+	}
+	.fix-add-icon {
+		position: fixed;
+		bottom: 15px;
+		right: 15px;
+	}
+	.button-box {
+		// width: 100%;
+		padding: 10px 15px;
+		box-sizing: border-box;
+	}
+</style>
+

+ 20 - 45
pagesMain/venueDetail.vue

@@ -32,8 +32,9 @@
 					</view>
 				</view>
 				<view class="class-content" slot="foot" style="padding-bottom: 10px;text-align: right;">
-					<u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
-					 :hair-line="false" plain @click.stop="cardHandle(item, 1)">体验</u-button>
+					<u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini"
+					 @click.stop="handleAppointmentClick(item.id)">体验</u-button>
+					 			 <!-- @click.stop="cardHandle(item, 1)">体验</u-button> -->
 					<!-- <u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click.stop="cardHandle(item, 2)">报名</u-button> -->
 				</view>
 			</u-card>
@@ -60,6 +61,7 @@
 				</u-card>
 			</scroll-view>
 		</u-popup>
+		<u-picker v-model="timeShow" mode="time" @confirm="handleChooseTimeClick"></u-picker>
 		<u-top-tips ref="uTips" zIndex="100000"></u-top-tips>
 	</view>
 </template>
@@ -81,7 +83,6 @@
 		},
 		data() {
 			return {
-				userId:'',
 				venueId: '',
 				venueInfo: {
 					url: '',
@@ -98,22 +99,14 @@
 				studentList1: [],
 				subscribeShow: false,
 				studentList2: [],
+				timeShow: false
 			}
 		},
 		onLoad(options) {
-			this.userId = options.userId
 			this.venueId = options.id
 			this.initialize()
 		},
 		onShow() {
-			/*NET.request(API.getEnlistAbleStudent, {}, 'POST').then(res => {
-				this.studentList1 = res.data.row
-			}).catch(error => {
-				this.$refs.uTips.show({
-					title: error.message,
-					type: 'warning',
-				})
-			})*/
 			NET.request(API.getSubscribeAbleList, {}, 'POST').then(res => {
 				this.studentList2 = res.data.row
 			}).catch(error => {
@@ -150,30 +143,6 @@
 				// 	url: '/pagesMember/classDetail?id=' + item.id
 				// });
 			},
-			// 体验
-			cardHandle(item, type) {
-				const classId = parseInt(item.id)
-				const customerId = parseInt(this.$store.state.customerId)
-				NET.request(API.customerAppointment, {
-					classId,
-					customerId
-				}, 'POST').then(res => {
-					this.$refs.uTips.show({
-						title: res.message,
-						type: 'success',
-					})
-					setTimeout(()=> {
-						uni.navigateBack({
-							delta: 2
-						})
-					}, 1000)
-				}).catch(error => {
-					this.$refs.uTips.show({
-						title: error.message,
-						type: 'warning',
-					})
-				})
-			},
 			//  学员报名
 			enlistStudent(item) {
 				NET.request(API.enlistStudent, {
@@ -192,29 +161,35 @@
 					})
 				})
 			},
+			handleAppointmentClick(id) {
+				this.timeShow = true
+				this.classId = id
+			},
+			handleChooseTimeClick(args) {
+				const appointmentDate = args.year + '-' + args.month + '-' + args.day
+				console.log(appointmentDate);
+				this.subscribeStudent(appointmentDate)
+			},
 			//  学员预约
-			subscribeStudent(item) {
+			subscribeStudent(appointmentDate) {
 				NET.request(API.customerAppointment, {
+					venueId: this.venueId,
 					classId: this.classId,
-					studentId: this.userId,
+					studentId: this.$store.state.customerId,
+					appointmentDate
 				}, 'POST').then(res => {
 					this.$refs.uTips.show({
 						title: res.message,
 						type: 'success',
 					})
+					this.timeShow = false
 				}).catch(error => {
 					this.$refs.uTips.show({
 						title: error.message,
 						type: 'warning',
 					})
 				})
-			},
-			//  跳转新增学员表单
-			// goToSubscribelForm() {
-			// 	uni.navigateTo({
-			// 		url: '/pagesMember/subscribelForm'
-			// 	});
-			// },
+			}
 		},
 	}
 </script>