This commit is contained in:
yyy 2024-12-02 17:44:56 +08:00
parent 0113bba6c0
commit c44b46605d
5 changed files with 1143 additions and 1052 deletions

View File

@ -2,36 +2,75 @@ import api from './api'
export function getContractPage(data) {
return api.get('/crm/contract/page', data, { login: false })
return api.get('/crm/contract/page', data, {
login: false
})
}
export function getContractNo(data) {
return api.get('/crm/contract/getCode', data, { login: false })
return api.get('/crm/contract/getCode', data, {
login: false
})
}
export function createContract(data) {
return api.post('/crm/contract/create', data, { login: false })
return api.post('/crm/contract/create', data, {
login: false
})
}
export function getContract(data) {
return api.get('/crm/contract/get', data, { login: false })
return api.get('/crm/contract/get', data, {
login: false
})
}
export function getContractProductListByContractId(data) {
return api.get('/crm/contract/contract-product/list-by-contract-id', data, { login: false })
return api.get('/crm/contract/contract-product/list-by-contract-id', data, {
login: false
})
}
export function updateContract(data) {
return api.put('/crm/contract/update', data, { login: false })
return api.put('/crm/contract/update', data, {
login: false
})
}
export function check(data) {
return api.post('/crm/contract/check', data, { login: false })
return api.post('/crm/contract/check', data, {
login: false
})
}
//改成OA之后的
export function getOAContractPage(data) {
return api.get('/bpm/oa/contract/page', data, {
login: false
})
}
//创建
export function createOAContract(data) {
return api.post('/bpm/oa/contract/create', data, {
login: false
})
}
//详情
export function getOAContract(data) {
return api.get('/bpm/oa/contract/get', data, {
login: false
})
}
//详情
export function getByProcessInstanceId(data) {
return api.get('/bpm/oa/contract/getByProcessInstanceId', data, {
login: false
})
}
//获得同部门的合同审批
export function getListByDeptId(data) {
return api.get('/bpm/oa/contract/getListByDeptId', data, {
login: false
})
}

View File

@ -1,4 +1,4 @@
export const VUE_APP_API_URL = 'http://192.168.0.179:48080/admin-api'
export const VUE_APP_API_URL = 'http://192.168.0.107:48080/admin-api'
export const VUE_APP_UPLOAD_URL = VUE_APP_API_URL + '/infra/file/upload'
export const VUE_APP_UPLOAD_URL2 = VUE_APP_API_URL + '/system/user/profile/update-avatar'
export const APP_ID = 'wx91fcb30adb2df321'

File diff suppressed because it is too large Load Diff

View File

@ -1,337 +1,351 @@
<template>
<uv-navbar
:fixed="false"
@leftClick="$onClickLeft"
bgColor="#09b4f1"
>
<template v-slot:left>
<uv-icon name="arrow-left" size="19" color="#ffffff"></uv-icon>
</template>
<template v-slot:center>
<text style="color:#ffffff">{{title}}</text>
</template>
</uv-navbar>
<view class="container">
<view class="pb-2 flex px-5" style="background-color: #09b4f1;">
<uv-search placeholder="搜索合同名称" v-model="keyword" bgColor="#ffffff" :customStyle="customStyle" :show-action="false" @change="onSearch"></uv-search>
<!-- <uv-icon name="/static/images/screen.png" :size="26" @click="openSearch"></uv-icon> -->
</view>
<view class="wrap">
<uv-tabs :list="list" @click="handleSelect" :scrollable="false"></uv-tabs>
<scroll-view scroll-y class="sv" :style="{height:scrollHeight+'px'}" :scroll-top="scrollTop" @scroll="scroll" @scrolltolower="reachBottom">
<view class="page-box">
<block v-if="dataList.length > 0">
<view class="client" v-for="(items, index) in dataList" :key="index" @click="onItem(items.id)">
<view class="top">
<view class="left uv-line-1">
<view class="store uv-line-1">{{items.name}}</view>
</view>
<view class="flex">
<uv-text v-if="items.checkStatus === 1" type="warning" text="审核中"></uv-text>
<uv-text v-else-if="items.checkStatus === 2" type="success" text="审核通过"></uv-text>
<uv-text v-else-if="items.checkStatus === 3" type="info" text="审核未通过"></uv-text>
<uv-text v-else type="error" text="待审核"></uv-text>
<uv-icon name="arrow-right" :size="20"></uv-icon>
</view>
</view>
<view class="item align-center">
<view class="content">
<view class="title uv-line-2">{{items.money}} <text class="pl-1">回款:{{items.returnMoney}}</text> </view>
</view>
<view class="right">{{items.orderAdminName ? items.orderAdminName : '--'}}</view>
</view>
<view class="bottom">
<view class="client_time">到期{{timeFormats(items.endTime)}}</view>
<view class="flex">
<block v-if="items.isCheck">
<view class="btn ml-1 entity" @click.stop="onCheck(items.id)">审核</view>
</block>
<block v-else>
<view class="btn ml-1 primary" @click.stop="onCheck(items.id,'look')">详情</view>
</block>
</view>
</view>
</view>
<uv-load-more :status="listStatus" ></uv-load-more>
</block>
<uv-empty text="暂无数据" v-else margin-top="50" mode="list"></uv-empty>
</view>
</scroll-view>
</view>
<view class="floatBtn" @click="onAdd">
<uv-icon class="pb-5" name="plus" size="20" color="#09b4f1"></uv-icon>
</view>
</view>
</template>
<script setup>
import {
ref,
computed
} from 'vue'
import { onLoad,onShow ,onReady,onPageScroll} from '@dcloudio/uni-app'
import {
getContractPage
} from '@/api/contract'
import { formatDateTime } from '@/utils/util'
const title = ref('合同')
const keyword = ref('')
const oldScrollTop = ref(0)
const scrollTop = ref(-1)
const dataList = ref([])
const relation = ref('my')
const list = ref(
[{
name: '我的合同',
value: 'my'
}, {
name: '下属合同',
value: 'sub'
}]
)
const current = ref(0)
const dx = ref(0)
const pH = ref(0)
const scrollHeight = ref(0)
const page = ref(1)
const pageSize = ref(10)
const lastPage = ref(false)
const listStatus = ref('loadmore')
const isRefresh = ref(false)
defineExpose({isRefresh})
onReady(()=>{
uni.getSystemInfo({
success(res) {
pH.value = res.windowHeight
let scrollH = uni.createSelectorQuery().select(".sv")
scrollH.boundingClientRect(data=>{
let pH0 = pH.value
scrollHeight.value = pH0 - data.top
}).exec()
}
})
})
onLoad((e) => {
<template>
<uv-navbar :fixed="false" @leftClick="$onClickLeft" bgColor="#09b4f1">
<template v-slot:left>
<uv-icon name="arrow-left" size="19" color="#ffffff"></uv-icon>
</template>
<template v-slot:center>
<text style="color:#ffffff">{{title}}</text>
</template>
</uv-navbar>
<view class="container">
<view class="pb-2 flex px-5" style="background-color: #09b4f1;">
<uv-search placeholder="搜索合同名称" v-model="keyword" bgColor="#ffffff" :customStyle="customStyle"
:show-action="false" @change="onSearch"></uv-search>
<!-- <uv-icon name="/static/images/screen.png" :size="26" @click="openSearch"></uv-icon> -->
</view>
<view class="wrap">
<uv-tabs :list="list" @click="handleSelect" :scrollable="false"></uv-tabs>
<scroll-view scroll-y class="sv" :style="{height:scrollHeight+'px'}" :scroll-top="scrollTop" @scroll="scroll"
@scrolltolower="reachBottom">
<view class="page-box">
<block v-if="dataList.length > 0">
<view class="client" v-for="(items, index) in dataList" :key="index" @click="onItem(items.id)">
<view class="top">
<view class="left uv-line-1">
<view class="store uv-line-1">{{items.name}}</view>
</view>
<view class="flex">
<uv-text v-if="items.checkStatus === 1" type="warning" text="审核中"></uv-text>
<uv-text v-else-if="items.checkStatus === 2" type="success" text="审核通过"></uv-text>
<uv-text v-else-if="items.checkStatus === 3" type="info" text="审核未通过"></uv-text>
<uv-text v-else type="error" text="待审核"></uv-text>
<uv-icon name="arrow-right" :size="20"></uv-icon>
</view>
</view>
<view class="item align-center">
<view class="content">
<view class="title uv-line-2">{{items.money}} <text class="pl-1">回款:{{items.returnMoney}}</text>
</view>
</view>
<view class="right">{{items.orderAdminName ? items.orderAdminName : '--'}}</view>
</view>
<view class="bottom">
<view class="client_time">到期{{timeFormats(items.endTime)}}</view>
<view class="flex">
<block v-if="items.isCheck">
<view class="btn ml-1 entity" @click.stop="onCheck(items.id)">审核</view>
</block>
<block v-else>
<view class="btn ml-1 primary" @click.stop="onCheck(items.id,'look')">详情</view>
</block>
</view>
</view>
</view>
<uv-load-more :status="listStatus"></uv-load-more>
</block>
<uv-empty text="暂无数据" v-else margin-top="50" mode="list"></uv-empty>
</view>
</scroll-view>
</view>
<view class="floatBtn" @click="onAdd">
<uv-icon class="pb-5" name="plus" size="20" color="#09b4f1"></uv-icon>
</view>
</view>
</template>
})
onShow(()=>{
//if (isRefresh.value) {
isRefresh.value = false
page.value = 1
lastPage.value = false
scrollTop.value = 0
dataList.value = []
getList()
//}
})
const timeFormats = (val) => {
if(val){
return formatDateTime(val)
} else {
return '--'
<script setup>
import {
ref,
computed
} from 'vue'
import {
onLoad,
onShow,
onReady,
onPageScroll
} from '@dcloudio/uni-app'
import {
getContractPage,
getOAContractPage
} from '@/api/contract'
import {
formatDateTime
} from '@/utils/util'
const title = ref('合同')
const keyword = ref('')
const oldScrollTop = ref(0)
const scrollTop = ref(-1)
const dataList = ref([])
const relation = ref(true)
const list = ref(
[{
name: '我的合同',
value: true
}, {
name: '下属合同',
value: false
}]
)
const current = ref(0)
const dx = ref(0)
const pH = ref(0)
const scrollHeight = ref(0)
const page = ref(1)
const pageSize = ref(10)
const lastPage = ref(false)
const listStatus = ref('loadmore')
const isRefresh = ref(false)
defineExpose({
isRefresh
})
onReady(() => {
uni.getSystemInfo({
success(res) {
pH.value = res.windowHeight
let scrollH = uni.createSelectorQuery().select(".sv")
scrollH.boundingClientRect(data => {
let pH0 = pH.value
scrollHeight.value = pH0 - data.top
}).exec()
}
})
})
onLoad((e) => {
isRefresh.value = false
page.value = 1
lastPage.value = false
scrollTop.value = 0
dataList.value = []
getList()
})
const timeFormats = (val) => {
if (val) {
return formatDateTime(val)
} else {
return '--'
}
}
}
const handleSelect = (key) => {
relation.value = key.value
getList()
}
//
const onCheck = (id,type) => {
if(type == 'look'){
uni.navigateTo({
url: '/pages/components/pages/contract/add?id=' +id + '&type=edit'
});
}else{
uni.navigateTo({
url: '/pages/components/pages/contract/add?id=' +id + '&type=check'
});
}
}
const getList = async(isNextPage,pages) => {
await getContractPage({
pageNo: page.value,
pageSize: pageSize.value,
relation: relation.value,
name:keyword.value,
}).then(res => {
if(res) {
if (res.list.length < 10) {
listStatus.value = 'nomore'
}
if(res.list.length == 0) {
lastPage.value = true
}
if(isNextPage) {
dataList.value = dataList.value.concat(res.list)
return
}
dataList.value = res.list
}
})
}
const scroll = (e) => {
oldScrollTop.value = e.detail.scrollTop
}
const reachBottom = () => {
if(lastPage.value || listStatus.value == 'loading') return ;
listStatus.value = 'loading'
setTimeout(() => {
if(lastPage.value) return ;
getList(true,++page.value)
if(dataList.value.length >= 10) listStatus.value = 'loadmore';
else listStatus.value = 'loading';
}, 1200)
}
//
const onSearch = () => {
page.value = 1
lastPage.value = false
getList()
}
const onItem = (val) => {
uni.navigateTo({
url: '/pages/components/pages/contract/add?id=' +val + '&type=edit'
});
}
//
const onAdd = () => {
uni.navigateTo({
url: '/pages/components/pages/contract/add'
})
}
</script>
<style lang="scss" scoped>
.container {
background-color: #F7F7F7;
min-height: 100vh;
}
.page-box {
padding: 20rpx 20rpx 45rpx;
}
.client {
width: 710rpx;
background-color: #ffffff;
margin-bottom: 20rpx;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
.top {
display: flex;
.left {
display: flex;
align-items: center;
flex: 1;
.store {
font-size: 28rpx;
font-weight: bold;
padding-right: 50rpx
}
}
}
.item {
display: flex;
margin: 20rpx 0 0;
.content {
flex: 1;
.title {
font-size: 28rpx;
line-height: 50rpx;
}
.type {
margin: 10rpx 0;
font-size: 24rpx;
color: $uv-tips-color;
}
}
.right {
margin-left: 10rpx;
text-align: right;
.decimal {
font-size: 24rpx;
margin-top: 4rpx;
}
.number {
color: $uv-tips-color;
font-size: 24rpx;
}
}
}
.bottom {
display: flex;
margin-top: 20rpx;
justify-content: space-between;
align-items: center;
.client_time {
color: #777;
font-size: 26rpx;
}
.btn {
line-height: 56rpx;
padding: 0rpx 25rpx;
border-radius: 5px;
font-size: 26rpx;
text-align: center;
color: $uv-info-dark;
}
.entity {
color: #fff;
background-color: #FF6146;
}
.primary {
color: #FFF;
background-color: #09b4f1
}
}
}
.wrap {
display: flex;
flex-direction: column;
width: 100%;
}
.floatBtn {
font-size: 23rpx;
bottom: 100px;
right: 20px;
border-radius: 5000px;
z-index: 9;
opacity: 1;
width: 130rpx;
height: 130rpx;
position: fixed;
display: flex;
flex-direction: row;
flex-direction: column;
justify-content: center;
background-color: #fff;
color: #606266;
align-items: center;
transition: opacity 0.4s;
border: 1px solid #dcdfe6;
}
</style>
const handleSelect = (key) => {
relation.value = key.value
getList()
}
//
const onCheck = (id, type) => {
if (type == 'look') {
uni.navigateTo({
url: '/pages/components/pages/contract/add?id=' + id + '&type=edit'
});
} else {
uni.navigateTo({
url: '/pages/components/pages/contract/add?id=' + id + '&type=check'
});
}
}
const getList = async (isNextPage, pages) => {
await getOAContractPage({
pageNo: page.value,
pageSize: pageSize.value,
isMyContract: relation.value,
contractName: keyword.value,
}).then(res => {
if (res) {
if (res.list.length < 10) {
listStatus.value = 'nomore'
}
if (res.list.length == 0) {
lastPage.value = true
}
if (isNextPage) {
dataList.value = dataList.value.concat(res.list)
return
}
dataList.value = res.list
}
})
}
const scroll = (e) => {
oldScrollTop.value = e.detail.scrollTop
}
const reachBottom = () => {
if (lastPage.value || listStatus.value == 'loading') return;
listStatus.value = 'loading'
setTimeout(() => {
if (lastPage.value) return;
getList(true, ++page.value)
if (dataList.value.length >= 10) listStatus.value = 'loadmore';
else listStatus.value = 'loading';
}, 1200)
}
//
const onSearch = () => {
page.value = 1
lastPage.value = false
getList()
}
const onItem = (val) => {
uni.navigateTo({
url: '/pages/components/pages/contract/add?id=' + val + '&type=edit'
});
}
//
const onAdd = () => {
uni.navigateTo({
url: '/pages/components/pages/contract/add'
})
}
</script>
<style lang="scss" scoped>
.container {
background-color: #F7F7F7;
min-height: 100vh;
}
.page-box {
padding: 20rpx 20rpx 45rpx;
}
.client {
width: 710rpx;
background-color: #ffffff;
margin-bottom: 20rpx;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
.top {
display: flex;
.left {
display: flex;
align-items: center;
flex: 1;
.store {
font-size: 28rpx;
font-weight: bold;
padding-right: 50rpx
}
}
}
.item {
display: flex;
margin: 20rpx 0 0;
.content {
flex: 1;
.title {
font-size: 28rpx;
line-height: 50rpx;
}
.type {
margin: 10rpx 0;
font-size: 24rpx;
color: $uv-tips-color;
}
}
.right {
margin-left: 10rpx;
text-align: right;
.decimal {
font-size: 24rpx;
margin-top: 4rpx;
}
.number {
color: $uv-tips-color;
font-size: 24rpx;
}
}
}
.bottom {
display: flex;
margin-top: 20rpx;
justify-content: space-between;
align-items: center;
.client_time {
color: #777;
font-size: 26rpx;
}
.btn {
line-height: 56rpx;
padding: 0rpx 25rpx;
border-radius: 5px;
font-size: 26rpx;
text-align: center;
color: $uv-info-dark;
}
.entity {
color: #fff;
background-color: #FF6146;
}
.primary {
color: #FFF;
background-color: #09b4f1
}
}
}
.wrap {
display: flex;
flex-direction: column;
width: 100%;
}
.floatBtn {
font-size: 23rpx;
bottom: 100px;
right: 20px;
border-radius: 5000px;
z-index: 9;
opacity: 1;
width: 130rpx;
height: 130rpx;
position: fixed;
display: flex;
flex-direction: row;
flex-direction: column;
justify-content: center;
background-color: #fff;
color: #606266;
align-items: center;
transition: opacity 0.4s;
border: 1px solid #dcdfe6;
}
</style>

View File

@ -25,7 +25,9 @@
</view>
<!-- 标签 -->
<view class="tap" v-if="customer.tags !='' ">
<uv-tags :text="item" plain type="warning" size="mini" v-for="(item,i) in customer.tags" :key="i" />
<view v-for="(item,i) in customer.tags" :key="i" style="margin-right: 10rpx;">
<uv-tags :text="item" plain type="warning" size="mini" />
</view>
</view>
<view class="relation flex">
<view class="left">手机<text class="dial" @click="call(customer.mobile)">{{customer.mobile}}</text></view>