| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <template>
- <view class="admin-jiazheng-list">
- <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 class="jiazheng-search-box">
- <view @click.stop="clickAlltype" class="select-item-box">
- <text class="select-text">{{data.statusText}}</text>
- <icon class="select-jt-default" />
- </view>
- </view>
- <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">
- {{ 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,
- nextTick
- } from "vue";
- import {
- onLoad
- } from "@dcloudio/uni-app";
- 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: '待签字',
- state: 'more',
- list: [], // 考试列表
- loading: false,
- jzRealName: '',
- khRealName: '',
- page: 0,
- size: 10,
- })
- const isOpen = ref(false)
- const listStatus = ref([{
- statusText: '有效',
- status: 2,
- },
- {
- statusText: '待审核',
- status: 1,
- },
- {
- statusText: '待签字',
- status: 0,
- }, {
- statusText: '失效',
- status: 3,
- }
- ])
- function toggle() {
- searchDialogRef.value.handleShow();
- }
- function goUpPage() {}
- function clickAlltype() {
- isOpen.value = !isOpen.value;
- }
- function handleSelectStatus(item) {
- data.status = item.status;
- data.statusText = item.statusText;
- onRefresh();
- }
- function handleAdd() {
- uni.navigateTo({
- url: '/pages/admin/Hetong/addSanfangHetong'
- })
- }
- 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>
- </style>
|