|
|
@@ -15,43 +15,106 @@
|
|
|
<view class="jz-new-btn-box">
|
|
|
<button type="default" class="phone-green-btn" @click="handleAdd">新增合同</button>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 状态面板 -->
|
|
|
<view class="all-type-box" v-show="isOpen" @click="clickAlltype">
|
|
|
<view class="phone-radio-group data-check-radio-group">
|
|
|
<!-- 技能块展示 -->
|
|
|
- <view v-for="item in listStatus" @click="handleSelectStatus(item)" :key="item.status" class="phone-radio-item">
|
|
|
+ <view v-for="item in listStatus" @click="handleSelectStatus(item)" :key="item.status"
|
|
|
+ class="phone-radio-item">
|
|
|
{{ item.statusText }}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view>
|
|
|
+ <search-dialog ref="searchDialogRef" @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">
|
|
|
+ <uni-list-item v-for="item in data.list" class="jz-list-item-box">
|
|
|
+ <template v-slot:body>
|
|
|
+ <view class="head-top">
|
|
|
+ <button type="default">预览</button>
|
|
|
+ <button type="default">推送</button>
|
|
|
+ <button type="default">删除</button>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view>
|
|
|
+ <view>家政人员名称</view>
|
|
|
+ <view>{{item.jzRealName}}</view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view>客户名称</view>
|
|
|
+ <view>{{item.khRealName}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view>
|
|
|
+ <view>合同开始时间</view>
|
|
|
+ <view>{{item.startDate}}</view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view>合同结束时间</view>
|
|
|
+ <view>{{item.endDate}}</view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view>合同状态</view>
|
|
|
+ <view v-if="item.status== 0">待签字</view>
|
|
|
+ <view v-if="item.status== 1">待审核</view>
|
|
|
+ <view v-if="item.status== 2">有效</view>
|
|
|
+ <view v-if="item.status== 3">失效</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </uni-list-item>
|
|
|
+ <uni-load-more :status="data.state" @click="getMore(0)"
|
|
|
+ :contentText="data.contentText"></uni-load-more>
|
|
|
+ </uni-list>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <customTabbarAdminVue :current-tab="1"></customTabbarAdminVue>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import {
|
|
|
ref,
|
|
|
- reactive
|
|
|
+ reactive,
|
|
|
+ nextTick
|
|
|
} from "vue";
|
|
|
import {
|
|
|
onLoad
|
|
|
} from "@dcloudio/uni-app";
|
|
|
- import {
|
|
|
- getJiazhengList,
|
|
|
- getJiazhengJineng,
|
|
|
- getJiazhengZhiyeAll,
|
|
|
- getJiazhengLeixing
|
|
|
- } from "@/api/jiazheng.js"
|
|
|
+ import * as httpApi from "@/api/sanfang.js"
|
|
|
+ import searchDialog from "./components/search.vue";
|
|
|
import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
|
|
|
|
|
|
+ const searchDialogRef = ref(null);
|
|
|
const data = reactive({
|
|
|
status: 0,
|
|
|
- statusText: '待签字'
|
|
|
+ statusText: '待签字',
|
|
|
+ state: 'more',
|
|
|
+ list: [], // 考试列表
|
|
|
+ loading: false,
|
|
|
+ jzRealName: '',
|
|
|
+ khRealName: '',
|
|
|
+ page: 0,
|
|
|
+ size: 10,
|
|
|
})
|
|
|
const isOpen = ref(false)
|
|
|
-
|
|
|
- const listStatus = ref([
|
|
|
- {
|
|
|
+
|
|
|
+ const listStatus = ref([{
|
|
|
statusText: '有效',
|
|
|
status: 2,
|
|
|
},
|
|
|
@@ -62,14 +125,16 @@
|
|
|
{
|
|
|
statusText: '待签字',
|
|
|
status: 0,
|
|
|
- },{
|
|
|
+ }, {
|
|
|
statusText: '失效',
|
|
|
status: 3,
|
|
|
}
|
|
|
])
|
|
|
|
|
|
|
|
|
- function toggle() {}
|
|
|
+ function toggle() {
|
|
|
+ searchDialogRef.value.handleShow();
|
|
|
+ }
|
|
|
|
|
|
function goUpPage() {}
|
|
|
|
|
|
@@ -80,11 +145,101 @@
|
|
|
function handleSelectStatus(item) {
|
|
|
data.status = item.status;
|
|
|
data.statusText = item.statusText;
|
|
|
+
|
|
|
+ onRefresh();
|
|
|
}
|
|
|
|
|
|
function handleAdd() {}
|
|
|
-
|
|
|
|
|
|
+ function dialogSearchBtn(opt, searchInput) {
|
|
|
+ if (opt == 2) {
|
|
|
+ data.khRealName = searchInput
|
|
|
+ data.jzRealName = '';
|
|
|
+ } else {
|
|
|
+ data.khRealName = '';
|
|
|
+ data.jzRealName = searchInput
|
|
|
+ }
|
|
|
+
|
|
|
+ onRefresh()
|
|
|
+ }
|
|
|
+
|
|
|
+ function dialogSearchReset() {
|
|
|
+ data.jzRealName = '';
|
|
|
+ data.khRealName = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ function onScrolltolower() {
|
|
|
+ getMore()
|
|
|
+ }
|
|
|
+
|
|
|
+ function onRefresh() {
|
|
|
+ if (data.loading) return;
|
|
|
+ data.page = 0;
|
|
|
+ data.list = [];
|
|
|
+ data.loading = true;
|
|
|
+ refreshData();
|
|
|
+ }
|
|
|
+
|
|
|
+ function refreshData() {
|
|
|
+ const opt = {
|
|
|
+ jzRealName: data.jzRealName,
|
|
|
+ khRealName: data.khRealName,
|
|
|
+ page: data.page,
|
|
|
+ size: data.size,
|
|
|
+ status: data.status
|
|
|
+ }
|
|
|
+ data.list = [];
|
|
|
+ // 数学
|
|
|
+ data.state = 'loading';
|
|
|
+ data.page++;
|
|
|
+ opt.page = data.page;
|
|
|
+
|
|
|
+ httpApi.getSanfangList(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 = {
|
|
|
+ jzRealName: data.jzRealName,
|
|
|
+ khRealName: data.khRealName,
|
|
|
+ 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.getSanfangList(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;
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ onLoad((options) => {
|
|
|
+ getMore()
|
|
|
+ })
|
|
|
</script>
|
|
|
|
|
|
<style>
|