This commit is contained in:
yyy 2024-12-05 18:47:53 +08:00
parent 225cd55b37
commit 26e6d5b611
4 changed files with 385 additions and 331 deletions

View File

@ -2,29 +2,38 @@ import api from './api'
export function invoicePage(data) { export function invoicePage(data) {
return api.get('/crm/invoice/page', data, { login: false }) return api.get('/bpm/oa/invoice/page', data, {
login: false
})
} }
export function invoiceCreate(data) { export function invoiceCreate(data) {
return api.post('/crm/invoice/create', data, { login: false }) return api.post('/bpm/oa/invoice/create', data, {
login: false
})
} }
export function getInvoice(data) { export function getInvoice(data) {
return api.get('/crm/invoice/get', data, { login: false }) return api.get('/bpm/oa/invoice/get', data, {
login: false
})
} }
export function invoiceUpdate(data) { export function invoiceUpdate(data) {
return api.put('/crm/invoice/update', data, { login: false }) return api.put('/crm/invoice/update', data, {
login: false
})
} }
export function check(data) { export function check(data) {
return api.post('/crm/invoice/check', data, { login: false }) return api.post('/crm/invoice/check', data, {
login: false
})
} }
export function invoiceIssue(data) { export function invoiceIssue(data) {
return api.put('/crm/invoice/issue', data, { login: false }) return api.put('/crm/invoice/issue', data, {
} login: false
})
}

View File

@ -73,9 +73,9 @@
<!-- <uv-form-item label="审批人:"> <!-- <uv-form-item label="审批人:">
<uv-input disabledColor="#ffffff" disabled v-model="form.flowAdminIdName" placeholder="请去审批流程里配置合同审批" /> <uv-input disabledColor="#ffffff" disabled v-model="form.flowAdminIdName" placeholder="请去审批流程里配置合同审批" />
</uv-form-item> --> </uv-form-item> -->
<uv-form-item label="备注:"> <!-- <uv-form-item label="备注:">
<uv-textarea v-model="form.remark" :disabled="isCheck" placeholder="请输入备注"></uv-textarea> <uv-textarea v-model="form.remark" :disabled="isCheck" placeholder="请输入备注"></uv-textarea>
</uv-form-item> </uv-form-item> -->
</uv-form> </uv-form>
<!-- 产品 --> <!-- 产品 -->
<view class="flex cif-title" @click="type !== 'detail' ? selectProduct() : ''"> <view class="flex cif-title" @click="type !== 'detail' ? selectProduct() : ''">

View File

@ -71,7 +71,6 @@
onPageScroll onPageScroll
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
getContractPage,
getOAContractPage, getOAContractPage,
} from '@/api/contract' } from '@/api/contract'
import { import {

View File

@ -1,320 +1,366 @@
<template> <template>
<uv-navbar <uv-navbar :fixed="false" @leftClick="$onClickLeft" bgColor="#09b4f1">
:fixed="false" <template v-slot:left>
@leftClick="$onClickLeft" <uv-icon name="arrow-left" size="19" color="#ffffff"></uv-icon>
bgColor="#09b4f1" </template>
> <template v-slot:center>
<template v-slot:left> <text style="color:#ffffff">{{title}}</text>
<uv-icon name="arrow-left" size="19" color="#ffffff"></uv-icon> </template>
</template> </uv-navbar>
<template v-slot:center> <view class="container">
<text style="color:#ffffff">{{title}}</text> <view class="pb-2 flex px-5" style="background-color: #09b4f1;">
</template> <uv-search placeholder="搜索发票名称" v-model="keyword" bgColor="#ffffff" :customStyle="customStyle"
</uv-navbar> :show-action="false" @change="onSearch"></uv-search>
<view class="container"> </view>
<view class="pb-2 flex px-5" style="background-color: #09b4f1;"> <view class="wrap">
<uv-search placeholder="搜索合同名称" v-model="keyword" bgColor="#ffffff" :customStyle="customStyle" :show-action="false" @change="onSearch"></uv-search> <uv-tabs :list="list" @click="handleSelect" :scrollable="false"></uv-tabs>
<!-- <uv-icon name="/static/images/screen.png" :size="26" @click="openSearch"></uv-icon> --> <scroll-view scroll-y class="sv" :style="{height:scrollHeight+'px'}" :scroll-top="scrollTop" @scroll="scroll"
</view> @scrolltolower="reachBottom">
<view class="wrap"> <view class="page-box">
<uv-tabs :list="list" @click="handleSelect" :scrollable="false"></uv-tabs> <block v-if="dataList.length > 0">
<scroll-view scroll-y class="sv" :style="{height:scrollHeight+'px'}" :scroll-top="scrollTop" @scroll="scroll" @scrolltolower="reachBottom"> <view class="client" v-for="(items, index) in dataList" :key="index" @click="onItem(items.id)">
<view class="page-box"> <view class="top">
<block v-if="dataList.length > 0"> <view class="left uv-line-1">
<view class="client" v-for="(items, index) in dataList" :key="index" @click="onItem(items.id)"> <view class="store uv-line-1">{{items.invoiceName}}</view>
<view class="top"> </view>
<view class="left uv-line-1"> <view class="flex align-center">
<view class="store uv-line-1">{{items.invoiceName}}</view> <text
</view> :style="{color:items.result==1?'#4687fc':items.result==2?'#4cd964':items.result==3?'#dd524d':'#999999'}">{{fillterStatus(items.result)}}</text>
<view class="flex"> <uv-icon name="arrow-right" :size="16"
<uv-text v-if="items.checkStatus === 1" type="warning" text="审核中"></uv-text> :color="items.result==1?'#4687fc':items.result==2?'#4cd964':items.result==3?'#dd524d':'#999999'"></uv-icon>
<uv-text v-else-if="items.checkStatus === 2" type="success" text="审核通过"></uv-text> </view>
<uv-text v-else-if="items.checkStatus === 3" type="info" text="审核未通过"></uv-text> </view>
<uv-text v-else type="error" text="待审核"></uv-text> <view class="item align-center">
<uv-icon name="arrow-right" :size="20"></uv-icon> <view class="content">
</view> <view class="title uv-line-2">开票主体:{{items.invoiceBody}} </view>
</view> </view>
<view class="item align-center"> <view class="right">{{timeFormats(items.createTime)}}</view>
<view class="content"> </view>
<view class="title uv-line-2">开票主体:{{items.invoiceBody}} </view> <view class="bottom">
</view> <view class="client_time">¥{{items.amount}}</view>
<view class="right">{{timeFormats(items.createTime)}}</view> <view class="flex">
</view> <block v-if="items.isCheck">
<view class="bottom"> <view class="btn ml-1 entity" @click.stop="onCheck(items.id)">审核</view>
<view class="client_time">¥:{{items.money}}</view> </block>
<view class="flex"> <block v-else-if="items.checkStatus == 2">
<block v-if="items.isCheck"> <view class="btn ml-1 primary" @click.stop="onCheck(items.id,'look')">开具</view>
<view class="btn ml-1 entity" @click.stop="onCheck(items.id)">审核</view> </block>
</block> </view>
<block v-else-if="items.checkStatus == 2"> </view>
<view class="btn ml-1 primary" @click.stop="onCheck(items.id,'look')">开具</view> </view>
</block> <uv-load-more :status="listStatus"></uv-load-more>
</view> </block>
</view> <uv-empty text="暂无数据" v-else margin-top="50" mode="list"></uv-empty>
</view> </view>
<uv-load-more :status="listStatus" ></uv-load-more> </scroll-view>
</block> </view>
<uv-empty text="暂无数据" v-else margin-top="50" mode="list"></uv-empty> <view class="floatBtn" @click="onAdd">
</view> <uv-icon class="pb-5" name="plus" size="20" color="#09b4f1"></uv-icon>
</scroll-view> </view>
</view> </view>
<view class="floatBtn" @click="onAdd"> </template>
<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 {
invoicePage
} from '@/api/invoice'
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) => {
}) <script setup>
import {
onShow(()=>{ ref,
getList() computed
}) } from 'vue'
import {
const timeFormats = (val) => { onLoad,
if(val){ onShow,
return formatDateTime(val) onReady,
} else { onPageScroll
return '--' } from '@dcloudio/uni-app'
import {
invoicePage
} from '@/api/invoice'
import {
getDictData,
} from '@/api/customer.js'
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) => {
getStatusList()
})
onShow(() => {
getList()
})
const timeFormats = (val) => {
if (val) {
return formatDateTime(val)
} else {
return '--'
}
} }
}
//
// const onCheck = (id, type) => {
const onCheck = (id,type) => { if (type == 'look') {
if(type == 'look'){ uni.navigateTo({
uni.navigateTo({ url: '/pages/components/pages/invoice/add?id=' + id + '&type=edit'
url: '/pages/components/pages/invoice/add?id=' +id + '&type=edit' });
}); } else {
}else{ uni.navigateTo({
uni.navigateTo({ url: '/pages/components/pages/invoice/add?id=' + id + '&type=check'
url: '/pages/components/pages/invoice/add?id=' +id + '&type=check' });
}); }
} }
} const handleSelect = (key) => {
relation.value = key.value
const getList = async(isNextPage,pages) => { page.value = 1
dataList.value = []
await invoicePage({ getList()
pageNo: page.value, }
pageSize: pageSize.value,
relation: relation.value, const getList = async (isNextPage, pages) => {
contractName:keyword.value, await invoicePage({
}).then(res => { pageNo: page.value,
if(res) { pageSize: pageSize.value,
if (res.list.length < 10) { relation: relation.value,
listStatus.value = 'nomore' contractName: keyword.value,
} }).then(res => {
if (res) {
if(res.list.length == 0) { if (res.list.length < 10) {
lastPage.value = true listStatus.value = 'nomore'
} }
if(isNextPage) { if (res.list.length == 0) {
dataList.value = dataList.value.concat(res.list) lastPage.value = true
return }
}
dataList.value = res.list if (isNextPage) {
} dataList.value = dataList.value.concat(res.list)
}) return
} }
const scroll = (e) => { dataList.value = res.list
oldScrollTop.value = e.detail.scrollTop }
} })
}
const reachBottom = () => {
if(lastPage.value || listStatus.value == 'loading') return ; const statusList = ref([])
listStatus.value = 'loading' const getStatusList = () => {
setTimeout(() => { getDictData({
if(lastPage.value) return ; type: 'bpm_process_instance_result'
getList(true,++page.value) }).then(res => {
if(dataList.value.length >= 10) listStatus.value = 'loadmore'; statusList.value = res
else listStatus.value = 'loading'; })
}, 1200) }
}
// //
const onSearch = () => { const fillterStatus = (status) => {
page.value = 1 if (statusList.value.length) {
lastPage.value = false let obj = statusList.value.find(item => {
getList() return item.value == status
} })
return obj == undefined ? '' : obj.name
const onItem = (val) => { } else {
uni.navigateTo({ return status
url: '/pages/components/pages/invoice/add?id=' +val + '&type=edit' }
}); }
}
// const scroll = (e) => {
const onAdd = () => { oldScrollTop.value = e.detail.scrollTop
uni.navigateTo({ }
url: '/pages/components/pages/invoice/add'
}) const reachBottom = () => {
} if (lastPage.value || listStatus.value == 'loading') return;
listStatus.value = 'loading'
setTimeout(() => {
if (lastPage.value) return;
</script> getList(true, ++page.value)
if (dataList.value.length >= 10) listStatus.value = 'loadmore';
<style lang="scss" scoped> else listStatus.value = 'loading';
.container { }, 1200)
background-color: #F7F7F7; }
min-height: 100vh; //
} const onSearch = () => {
.page-box { page.value = 1
padding: 20rpx 20rpx 45rpx; lastPage.value = false
} getList()
.client { }
width: 710rpx;
background-color: #ffffff; const onItem = (val) => {
margin-bottom: 20rpx; uni.navigateTo({
border-radius: 20rpx; url: '/pages/components/pages/invoice/add?id=' + val + '&type=edit'
box-sizing: border-box; });
padding: 20rpx; }
font-size: 28rpx;
.top { //
display: flex; const onAdd = () => {
.left { uni.navigateTo({
display: flex; url: '/pages/components/pages/invoice/add'
align-items: center; })
flex: 1; }
.store { </script>
font-size: 28rpx;
font-weight: bold; <style lang="scss" scoped>
padding-right: 50rpx .container {
} background-color: #F7F7F7;
} min-height: 100vh;
} }
.item {
display: flex; .page-box {
margin: 20rpx 0 0; padding: 20rpx 20rpx 45rpx;
.content { }
flex: 1;
.title { .client {
font-size: 28rpx; width: 710rpx;
line-height: 50rpx; background-color: #ffffff;
} margin-bottom: 20rpx;
.type { border-radius: 20rpx;
margin: 10rpx 0; box-sizing: border-box;
font-size: 24rpx; padding: 20rpx;
color: $uv-tips-color; font-size: 28rpx;
}
} .top {
.right { display: flex;
margin-left: 10rpx;
text-align: right; .left {
color: #777; display: flex;
font-size: 24rpx; align-items: center;
} flex: 1;
}
.bottom { .store {
display: flex; font-size: 28rpx;
margin-top: 20rpx; font-weight: bold;
justify-content: space-between; padding-right: 50rpx
align-items: center; }
.client_time { }
color: #777; }
font-size: 26rpx;
} .item {
.btn { display: flex;
line-height: 56rpx; margin: 20rpx 0 0;
padding: 0rpx 25rpx;
border-radius: 5px; .content {
font-size: 26rpx; flex: 1;
text-align: center;
color: $uv-info-dark; .title {
} font-size: 28rpx;
.entity { line-height: 50rpx;
color: #fff; }
background-color: #FF6146;
} .type {
.primary { margin: 10rpx 0;
color: #FFF; font-size: 24rpx;
background-color: #09b4f1 color: $uv-tips-color;
} }
} }
}
.wrap { .right {
display: flex; margin-left: 10rpx;
flex-direction: column; text-align: right;
width: 100%; color: #777;
} font-size: 24rpx;
}
}
.floatBtn {
font-size: 23rpx; .bottom {
bottom: 100px; display: flex;
right: 20px; margin-top: 20rpx;
border-radius: 5000px; justify-content: space-between;
z-index: 9; align-items: center;
opacity: 1;
width: 130rpx; .client_time {
height: 130rpx; color: #777;
position: fixed; font-size: 28rpx;
display: flex; }
flex-direction: row;
flex-direction: column; .btn {
justify-content: center; line-height: 56rpx;
background-color: #fff; padding: 0rpx 25rpx;
color: #606266; border-radius: 5px;
align-items: center; font-size: 26rpx;
transition: opacity 0.4s; text-align: center;
border: 1px solid #dcdfe6; color: $uv-info-dark;
} }
.entity {
</style> 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>