Browse Source

客户页面

wangxy 3 ngày trước cách đây
mục cha
commit
cd1be7e72d

+ 13 - 0
api/sanfang.js

@@ -12,3 +12,16 @@ export function getSanfangList(data = {}) {
 }
 
 
+export function getKehuList(data = {}) {
+  return request({
+    url: '/app/guanliyuan/kehu/list',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+

+ 175 - 0
pages/admin/Hetong/components/selectJz.vue

@@ -0,0 +1,175 @@
+<template>
+	<uni-popup ref="popupRef" type="bottom" background-color="#fff" :is-mask-click="false" :mask-click="false">
+		<view class="ht-qm-popup">
+			<view class="phone-navBar-box">
+				<view @click="goUpPage" class="nav-bar-icon"></view>
+				<text class="nav-bar-title">选择家政阿姨</text>
+				<uni-icons class="nav-bar-right-icon bar-ml10" type="search" size="20"
+					@click="toggle('top')"></uni-icons>
+			</view>
+			<view>
+				<search-dialog ref="searchDialogRef" shenfen="jz" @search-btn="dialogSearchBtn"
+					@reset-search="dialogSearchReset"></search-dialog>
+			</view>
+			<!-- 无限滚动容器 -->
+			<view>
+				<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
+					:refresher-threshold="50" @scrolltolower="onScrolltolower" refresher-background="transparent"
+					@refresherrefresh="onRefresh" class="jz-scroll-view">
+					<uni-list class="admin-list-box">
+						<radio-group @change="radioChange">
+							<uni-list-item v-for="item in data.list" class="jz-list-item-box">
+								<template v-slot:body>
+									<view>
+										<view>{{item.realName}}</view>
+										<view>
+											<radio :value="item.id" :checked="item.id === data.activeData" />
+										</view>
+									</view>
+								</template>
+							</uni-list-item>
+						</radio-group>
+						<uni-load-more :status="data.state" @click="getMore(0)"
+							:contentText="data.contentText"></uni-load-more>
+					</uni-list>
+				</scroll-view>
+			</view>
+
+			<view>
+				<button @click="handleSelect">选择此家政阿姨</button>
+			</view>
+
+		</view>
+	</uni-popup>
+</template>
+
+<script setup>
+	import {
+		ref,
+		reactive,
+		nextTick
+	} from "vue";
+	import {
+		onLoad
+	} from "@dcloudio/uni-app";
+	import * as httpApi from "@/api/sanfang.js"
+	import {
+		getJiazhengList
+	} from "@/api/jiazheng.js"
+	import searchDialog from "./components/search.vue";
+
+
+	const emits = defineEmits(['select'])
+
+	function goback2() {}
+
+	const searchDialogRef = ref(null);
+	const popupRef = ref(null)
+	const data = reactive({
+		status: 0,
+		statusText: '待签字',
+		state: 'more',
+		list: [], // 考试列表
+		loading: false,
+		realName: '',
+		page: 0,
+		size: 10,
+		activeData: null
+	})
+
+	function toggle() {
+		searchDialogRef.value.handleShow();
+	}
+
+	function dialogSearchBtn(opt, searchInput) {
+		data.realName = searchInput
+		onRefresh()
+	}
+
+	function dialogSearchReset() {
+		data.realName = '';
+	}
+
+	function onScrolltolower() {
+		getMore()
+	}
+
+	function onRefresh() {
+		if (data.loading) return;
+		data.page = 0;
+		data.list = [];
+		data.loading = true;
+		refreshData();
+	}
+
+	function refreshData() {
+		const opt = {
+			realName: data.realName,
+			page: data.page,
+			size: data.size,
+			status: data.status
+		}
+		data.list = [];
+		// 数学
+		data.state = 'loading';
+		data.page++;
+		opt.page = data.page;
+
+		getJiazhengList(opt).then(res => {
+			data.list = data.list.concat(res.data.data);
+			data.loading = false;
+
+			if (res.data.total > data.list.length) {
+				data.state = 'more';
+			} else {
+				data.state = 'no-more';
+			}
+		}).catch(err => {
+			data.state = 'more';
+		}).finally(() => {
+			data.loading = false;
+		})
+	}
+
+	function getMore() {
+		const opt = {
+			realName: data.realName,
+			page: data.page,
+			size: data.size,
+			status: data.status
+		}
+		if (data.state == 'no-more') return;
+		data.state = 'loading';
+		data.page++;
+		opt.page = data.page;
+		getJiazhengList(opt).then(res => {
+			data.list = data.list.concat(res.data.data);
+			data.loading = false;
+			if (res.data.total > data.list.length) {
+				data.state = 'more';
+			} else {
+				data.state = 'no-more';
+			}
+		}).catch(err => {
+			data.state = 'more';
+		}).finally(() => {
+			data.loading = false;
+		})
+	}
+
+	function radioChange(opt) {
+		data.activeData = opt.id
+	}
+
+	function handleSelect() {
+		emits('select', data.activeData)
+	}
+
+	function handleShow() {
+		popupRef.value.open();
+		onRefresh();
+	}
+</script>
+
+<style>
+</style>

+ 178 - 0
pages/admin/Hetong/components/selectKh.vue

@@ -0,0 +1,178 @@
+<template>
+	<uni-popup ref="popupRef" type="bottom" background-color="#fff" :is-mask-click="false" :mask-click="false">
+		<view class="ht-qm-popup">
+			<view class="phone-navBar-box">
+				<view @click="goUpPage" class="nav-bar-icon"></view>
+				<text class="nav-bar-title">选择客户</text>
+				<uni-icons class="nav-bar-right-icon bar-ml10" type="search" size="20"
+					@click="toggle('top')"></uni-icons>
+			</view>
+			<view>
+				<search-dialog ref="searchDialogRef" shenfen="jz" @search-btn="dialogSearchBtn"
+					@reset-search="dialogSearchReset"></search-dialog>
+			</view>
+			
+			<view class="jz-new-btn-box">
+				<button type="default" class="phone-green-btn" @click="handleAddKehu">新增客户</button>
+			</view>
+			
+			<!-- 无限滚动容器 -->
+			<view>
+				<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
+					:refresher-threshold="50" @scrolltolower="onScrolltolower" refresher-background="transparent"
+					@refresherrefresh="onRefresh" class="jz-scroll-view">
+					<uni-list class="admin-list-box">
+						<radio-group @change="radioChange">
+							<uni-list-item v-for="item in data.list" class="jz-list-item-box">
+								<template v-slot:body>
+
+									<view>
+										<view>{{item.realName}}</view>
+										<view>
+											<radio :value="item.value" :checked="index === current" />
+										</view>
+									</view>
+								</template>
+							</uni-list-item>
+						</radio-group>
+						<uni-load-more :status="data.state" @click="getMore(0)"
+							:contentText="data.contentText"></uni-load-more>
+					</uni-list>
+				</scroll-view>
+			</view>
+			<view>
+				<button @click="handleSelect">选择此家政阿姨</button>
+			</view>
+		</view>
+	</uni-popup>
+</template>
+
+<script setup>
+	import {
+		ref,
+		reactive,
+		nextTick
+	} from "vue";
+	import {
+		onLoad
+	} from "@dcloudio/uni-app";
+	import * as httpApi from "@/api/sanfang.js"
+	import searchDialog from "./components/search.vue";
+
+	const emits = defineEmits(['select'])
+
+	function goback2() {}
+
+	const searchDialogRef = ref(null);
+	const popupRef = ref(null)
+	const data = reactive({
+		status: 0,
+		statusText: '待签字',
+		state: 'more',
+		list: [], // 考试列表
+		loading: false,
+		realName: '',
+		page: 0,
+		size: 10,
+		activeData: null
+	})
+
+	function toggle() {
+		searchDialogRef.value.handleShow();
+	}
+
+	function dialogSearchBtn(opt, searchInput) {
+		data.realName = searchInput
+		onRefresh()
+	}
+
+	function dialogSearchReset() {
+		data.realName = '';
+	}
+
+	function onScrolltolower() {
+		getMore()
+	}
+
+	function onRefresh() {
+		if (data.loading) return;
+		data.page = 0;
+		data.list = [];
+		data.loading = true;
+		refreshData();
+	}
+
+	function refreshData() {
+		const opt = {
+			realName: data.realName,
+			page: data.page,
+			size: data.size,
+			status: data.status
+		}
+		data.list = [];
+		// 数学
+		data.state = 'loading';
+		data.page++;
+		opt.page = data.page;
+
+		httpApi.getKehuList(opt).then(res => {
+			data.list = data.list.concat(res.data.data);
+			data.loading = false;
+
+			if (res.data.total > data.list.length) {
+				data.state = 'more';
+			} else {
+				data.state = 'no-more';
+			}
+		}).catch(err => {
+			data.state = 'more';
+		}).finally(() => {
+			data.loading = false;
+		})
+	}
+
+	function getMore() {
+		const opt = {
+			realName: data.realName,
+			page: data.page,
+			size: data.size,
+			status: data.status
+		}
+		if (data.state == 'no-more') return;
+		data.state = 'loading';
+		data.page++;
+		opt.page = data.page;
+		httpApi.getKehuList(opt).then(res => {
+			data.list = data.list.concat(res.data.data);
+			data.loading = false;
+			if (res.data.total > data.list.length) {
+				data.state = 'more';
+			} else {
+				data.state = 'no-more';
+			}
+		}).catch(err => {
+			data.state = 'more';
+		}).finally(() => {
+			data.loading = false;
+		})
+	}
+
+	function radioChange(opt) {
+		data.activeData = opt.id
+	}
+	
+	function handleAddKehu() {}
+
+
+	function handleSelect() {
+		emits('select', data.activeData)
+	}
+
+	function handleShow() {
+		popupRef.value.open();
+		onRefresh();
+	}
+</script>
+
+<style>
+</style>