From 26e6d5b6119e08872f4cf45053f112c81bcb5058 Mon Sep 17 00:00:00 2001 From: yyy <2605810609@qq.com> Date: Thu, 5 Dec 2024 18:47:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/invoice.js | 29 +- pages/components/pages/contract/add.vue | 4 +- pages/components/pages/contract/index.vue | 1 - pages/components/pages/invoice/index.vue | 682 ++++++++++++---------- 4 files changed, 385 insertions(+), 331 deletions(-) diff --git a/api/invoice.js b/api/invoice.js index 5a1e727..4e0862a 100644 --- a/api/invoice.js +++ b/api/invoice.js @@ -2,29 +2,38 @@ import api from './api' 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) { - return api.post('/crm/invoice/create', data, { login: false }) + return api.post('/bpm/oa/invoice/create', data, { + login: false + }) } 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) { - return api.put('/crm/invoice/update', data, { login: false }) + return api.put('/crm/invoice/update', data, { + login: false + }) } 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) { - return api.put('/crm/invoice/issue', data, { login: false }) -} - - - + return api.put('/crm/invoice/issue', data, { + login: false + }) +} \ No newline at end of file diff --git a/pages/components/pages/contract/add.vue b/pages/components/pages/contract/add.vue index 7a969b4..6bc6fee 100644 --- a/pages/components/pages/contract/add.vue +++ b/pages/components/pages/contract/add.vue @@ -73,9 +73,9 @@ - + diff --git a/pages/components/pages/contract/index.vue b/pages/components/pages/contract/index.vue index dd2a0df..2643285 100644 --- a/pages/components/pages/contract/index.vue +++ b/pages/components/pages/contract/index.vue @@ -71,7 +71,6 @@ onPageScroll } from '@dcloudio/uni-app' import { - getContractPage, getOAContractPage, } from '@/api/contract' import { diff --git a/pages/components/pages/invoice/index.vue b/pages/components/pages/invoice/index.vue index 0a74cc7..0020df4 100644 --- a/pages/components/pages/invoice/index.vue +++ b/pages/components/pages/invoice/index.vue @@ -1,320 +1,366 @@ - - - - - + + // 审核 + const onCheck = (id, type) => { + if (type == 'look') { + uni.navigateTo({ + url: '/pages/components/pages/invoice/add?id=' + id + '&type=edit' + }); + } else { + uni.navigateTo({ + url: '/pages/components/pages/invoice/add?id=' + id + '&type=check' + }); + } + } + + const handleSelect = (key) => { + relation.value = key.value + page.value = 1 + dataList.value = [] + getList() + } + + const getList = async (isNextPage, pages) => { + await invoicePage({ + pageNo: page.value, + pageSize: pageSize.value, + relation: 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 statusList = ref([]) + const getStatusList = () => { + getDictData({ + type: 'bpm_process_instance_result' + }).then(res => { + statusList.value = res + }) + } + + //格式化状态 + const fillterStatus = (status) => { + if (statusList.value.length) { + let obj = statusList.value.find(item => { + return item.value == status + }) + return obj == undefined ? '' : obj.name + } else { + return status + } + } + + + 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/invoice/add?id=' + val + '&type=edit' + }); + } + + // 添加 + const onAdd = () => { + uni.navigateTo({ + url: '/pages/components/pages/invoice/add' + }) + } + + + \ No newline at end of file