| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <view class="admin-sfht-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="list-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" :shenfen="shenfen" @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">
- <uni-list class="sfht-scroll-view">
- <uni-list-item v-for="item in data.list" class="sfht-list-item-box">
- <template v-slot:body>
- <view class="sfht-card-box">
- <view class="card-head-row">
- <view @click="handleDelete(item)" class="del-btn-box">
- <icon class="del-btn"></icon>
- </view>
- <button type="default" class="phone-green-btn ht-head-btn" v-if="item.status == 0" @click="tuisong(item)">推送</button>
- <button type="default" class="phone-green-btn ht-head-btn"
- @click.stop="handlePreview(item)">预览</button>
- <button type="default" class="phone-white-btn ht-head-btn"
- @click.stop="handleEditor(item)" v-if="item.status<2">编辑</button>
- <button type="default" v-if="item.status==1" class="phone-white-btn ht-head-btn"
- @click.stop="handleShengxiao(item)">生效</button>
- </view>
- <view class="card-body-row">
- <view class="body-row">
- <view class="title-text">
- <icon class="user-icon"></icon>家政人员名称
- </view>
- <view class="value-text">{{item.realName}}</view>
- </view>
- <view class="body-row">
- <view class="title-text">
- <icon class="idcard-icon"></icon>客户名称
- </view>
- <view class="value-text">{{item.khName}}</view>
- </view>
- </view>
- <view class="card-body-row">
- <view class="body-row">
- <view class="title-text">
- <icon class="date-icon"></icon>合同开始时间
- </view>
- <view class="value-text">{{item.startDate}}</view>
- </view>
- <view class="body-row">
- <view class="title-text">
- <icon class="date-icon"></icon>合同结束时间
- </view>
- <view class="value-text">{{item.endDate}}</view>
- </view>
- <view class="body-row">
- <view class="title-text">
- <icon class="htzt-icon"></icon>合同状态
- </view>
- <view class="status-0" v-if="item.status== 0">待签字</view>
- <view class="status-1" v-if="item.status== 1">待审核</view>
- <view class="status-2" v-if="item.status== 2">有效</view>
- <view class="status-3" v-if="item.status== 3">失效</view>
- </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>
- <!-- 删除子账号 -->
- <common-dialog ref="commonDialogRef" title="删除确认" content="你确定要执行这个操作吗"
- @confirm-btn="handleDeleteConfirm"></common-dialog>
- <customTabbarAdminVue :current-tab="1"></customTabbarAdminVue>
- </view>
- </template>
- <script setup>
- import {
- ref,
- reactive,
- nextTick
- } from "vue";
- import {
- onShow,
- 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";
- import commonDialog from '@/components/dialog/commonDialog.vue';
- import {
- getSanfangDelete
- } from "../../../api/sanfang";
- const searchDialogRef = ref(null);
- const commonDialogRef = ref(null)
- const data = reactive({
- status: 0,
- statusText: '待签字',
- state: 'more',
- list: [], // 考试列表
- loading: false,
- jzRealName: '',
- khRealName: '',
- page: 0,
- size: 10,
- })
- const isOpen = ref(false)
- const active = ref(null);
- const listStatus = ref([{
- statusText: '有效',
- status: 2,
- },
- {
- statusText: '待审核',
- status: 1,
- },
- {
- statusText: '待签字',
- status: 0,
- }, {
- statusText: '失效',
- status: 3,
- }
- ])
- const shenfen = ref(null);
- function toggle() {
- searchDialogRef.value.handleShow();
- }
-
- function handleShengxiao(da) {
- httpApi.getSanfangShengxiao({id:da.id}).then(res => {
- if (res.data) {
- uni.showToast({
- title: '合同已生效'
- })
- onRefresh();
- }
- })
- }
- function tuisong(data){
-
- if (!plus.runtime.isApplicationExist({
- pname: 'com.tencent.mm'
- })) {
- uni.showToast({
- title: '请先安装微信',
- icon: 'none'
- });
- return;
- }
-
- // 分享到小程序 我想加个参数
- uni.share({
- provider: 'weixin',
- scene: "WXSceneSession",
- type: 5,
- imageUrl: 'https://www.chengxiangjiaoyu.com/pic/hetong.jpg',
- title: '合同',
- miniProgram: {
- id: 'gh_fa5889151e7d',
- path: 'pages/Login/clientIndex?from=appcx&id='+data.id,
- type: 2, //暂时用体验版
- webUrl: 'http://uniapp.dcloud.io'
- },
- success: ret => {
- console.log(JSON.stringify(ret));
- }
- });
- }
- function goUpPage() {
- // uni.redirectTo({
- // url: '/pages/admin/ShouYe/shouye'
- // })
- uni.navigateBack()
- }
- 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 handleDelete(item) {
- active.value = item;
- commonDialogRef.value.handleShow();
- }
- function handleDeleteConfirm() {
- httpApi.getSanfangDelete({
- id: active.value.id
- }).then(res => {
- if (res.code == 0) {
- uni.showToast({
- title: '成功'
- })
- onRefresh();
- } else {
- uni.showToast({
- title: '失败'
- })
- }
- })
- }
- function handleEditor(item) {
- uni.navigateTo({
- url: `/pages/admin/Hetong/addSanfangHetong?flag=editor&id=${item.id}`
- })
- }
- function handlePreview(item) {
- uni.navigateTo({
- url: `/pages/admin/Hetong/previewHetong?id=${item.id}`
- })
- }
- 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.state = '';
- 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) => {
- const {
- from,
- jzName,
- khName
- } = options;
- if (jzName) {
- data.jzRealName = jzName;
- shenfen.value = 'jz'
- nextTick(() => {
- searchDialogRef.value.handleSetValue(jzName)
- })
- }
- if (khName) {
- data.khRealName = khName
- shenfen.value = 'kh'
- nextTick(() => {
- searchDialogRef.value.handleSetValue(khName)
- })
- }
- })
- onShow(() => {
- data.page = 0;
- data.list = [];
- data.state = '';
- getMore()
- })
- </script>
- <style>
- </style>
|