From 1ff25eb88fb65aad13cb27656503f6e816962006 Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Tue, 30 Dec 2025 18:03:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=88=E5=90=8C=E5=92=8C?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 80 ++++- components/Card.vue | 2 +- components/DictTag.vue | 20 +- components/FormItem.vue | 27 -- main.js | 8 +- pages.json | 8 +- pages/contract/index.vue | 608 +++++++++++--------------------------- pages/contract/info.vue | 78 ++++- pages/workbench/index.vue | 18 +- store/index.js | 35 ++- 10 files changed, 380 insertions(+), 504 deletions(-) delete mode 100644 components/FormItem.vue diff --git a/App.vue b/App.vue index ac935cd..127baa3 100644 --- a/App.vue +++ b/App.vue @@ -1,18 +1,68 @@ - - \ No newline at end of file diff --git a/components/Card.vue b/components/Card.vue index 3acfd7f..fa99789 100644 --- a/components/Card.vue +++ b/components/Card.vue @@ -14,7 +14,7 @@ }) - \ No newline at end of file diff --git a/components/FormItem.vue b/components/FormItem.vue deleted file mode 100644 index d2ecfb9..0000000 --- a/components/FormItem.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - - - \ No newline at end of file diff --git a/main.js b/main.js index e08df03..0be544c 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,10 @@ import App from './App' +import Top from '@/components/Top.vue' import Card from '@/components/Card.vue' import DictTag from '@/components/DictTag.vue' -import FormItem from '@/components/FormItem.vue' +import FormItem from '@/components/form/FormItem.vue' +import SearchInput from '@/components/SearchInput.vue' +import Picker from '@/components/form/Picker.vue' // #ifndef VUE3 import Vue from 'vue' @@ -20,9 +23,12 @@ import { } from 'vue' export function createApp() { const app = createSSRApp(App) + app.component('Top', Top) app.component('Card', Card) app.component('DictTag', DictTag) app.component('FormItem', FormItem) + app.component('SearchInput', SearchInput) + app.component('Pickera', Picker) return { app } diff --git a/pages.json b/pages.json index d3b9627..272fb5d 100644 --- a/pages.json +++ b/pages.json @@ -23,13 +23,19 @@ "style": { "navigationStyle": "custom" } + }, + { + "path": "pages/workHourReporting/index", + "style": { + "navigationStyle": "custom" + } } ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" + "backgroundColor": "#F8F8F8" }, "uniIdRouter": {} } \ No newline at end of file diff --git a/pages/contract/index.vue b/pages/contract/index.vue index def71ee..a863262 100644 --- a/pages/contract/index.vue +++ b/pages/contract/index.vue @@ -1,58 +1,96 @@ @@ -61,10 +99,17 @@ ref, toRefs, onMounted, + nextTick, } from 'vue'; import { useDict } from '@/utils/dict.js' + import { + listContractInfo + } from '@/api/contractInfo'; + import { + getHeight + } from '@/utils/index.js' const { contract_category, @@ -78,380 +123,59 @@ 'contract_status' ]) ); + const containRef = ref(null) + const moreFormItem = ref(false) + const toggleForm = () => { + moreFormItem.value = !moreFormItem.value + } + const searchForm = ref({ + pageNum: 1, + pageSize: 10, + }) + const list = ref([]) + const total = ref(0) - const list = ref([{ - "contractId": "2001118586166714370", - "contractFlag": "1", - "contractCode": "HT202512170005", - "customerContractCode": null, - "contractName": "13", - "contractCategory": "1", - "contractType": null, - "businessDirection": "1", - "contractDeptId": 100, - "contractDate": null, - "totalPrice": "0.00", - "oneCustomerId": null, - "oneRepresent": null, - "oneDate": null, - "twoCustomerId": null, - "twoRepresent": null, - "twoDate": null, - "contractStatus": "1", - "flowStatus": "draft", - "templateId": null, - "ossId": null, - "paymentMethod": null, - "signatureAppendix": null, - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": null, - "twoCustomerName": null, - "deptName": "青岛海威物联科技有限公司" - }, - { - "contractId": "2000863577393192962", - "contractFlag": "1", - "contractCode": "HT202512160002", - "customerContractCode": null, - "contractName": "合同20251216", - "contractCategory": "1", - "contractType": null, - "businessDirection": "5", - "contractDeptId": 107, - "contractDate": null, - "totalPrice": "20.00", - "oneCustomerId": 2, - "oneRepresent": "甲方", - "oneDate": "2025-12-11 00:00:00", - "twoCustomerId": 1, - "twoRepresent": "乙方授", - "twoDate": "2025-12-09 00:00:00", - "contractStatus": "1", - "flowStatus": "draft", - "templateId": "1976189070472728577", - "ossId": null, - "paymentMethod": null, - "signatureAppendix": null, - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": "某一集团股份有限公司", - "twoCustomerName": "青岛海威物联科技有限公司", - "deptName": "软件产品部" - }, - { - "contractId": "2000481472066621442", - "contractFlag": "1", - "contractCode": "HT202512150001", - "customerContractCode": null, - "contractName": "产品销售合同1215", - "contractCategory": "2", - "contractType": null, - "businessDirection": "5", - "contractDeptId": 107, - "contractDate": "2025-12-15 00:00:00", - "totalPrice": "80000.00", - "oneCustomerId": 2, - "oneRepresent": "甲方", - "oneDate": "2025-12-18 00:00:00", - "twoCustomerId": 1, - "twoRepresent": "乙方", - "twoDate": "2025-12-31 00:00:00", - "contractStatus": "3", - "flowStatus": "finish", - "templateId": null, - "ossId": "2000506818547793921", - "paymentMethod": null, - "signatureAppendix": null, - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": "某一集团股份有限公司", - "twoCustomerName": "青岛海威物联科技有限公司", - "deptName": "软件产品部" - }, - { - "contractId": "1997918929098559489", - "contractFlag": "1", - "contractCode": "HT202512080003", - "customerContractCode": null, - "contractName": "同名称", - "contractCategory": "1", - "contractType": "2", - "businessDirection": "3", - "contractDeptId": 100, - "contractDate": null, - "totalPrice": "23840.00", - "oneCustomerId": 3, - "oneRepresent": null, - "oneDate": null, - "twoCustomerId": 1, - "twoRepresent": null, - "twoDate": null, - "contractStatus": "1", - "flowStatus": "draft", - "templateId": "1976189070472728577", - "ossId": null, - "paymentMethod": "3-3-3-1", - "signatureAppendix": null, - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": "某一集团山东分公司", - "twoCustomerName": "青岛海威物联科技有限公司", - "deptName": "青岛海威物联科技有限公司" - }, - { - "contractId": "1996824342348529665", - "contractFlag": "1", - "contractCode": "HT202512050001", - "customerContractCode": null, - "contractName": "测试合同001", - "contractCategory": "1", - "contractType": "2", - "businessDirection": "1", - "contractDeptId": 107, - "contractDate": "2025-12-19 00:00:00", - "totalPrice": "1350.00", - "oneCustomerId": 2, - "oneRepresent": "甲方", - "oneDate": "2025-12-18 00:00:00", - "twoCustomerId": 1, - "twoRepresent": " 乙方", - "twoDate": "2025-12-11 00:00:00", - "contractStatus": "3", - "flowStatus": "finish", - "templateId": "1976189070472728577", - "ossId": null, - "paymentMethod": "3-3-3-1", - "signatureAppendix": "1996829163566764034", - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": "某一集团股份有限公司", - "twoCustomerName": "青岛海威物联科技有限公司", - "deptName": "软件产品部" - }, - { - "contractId": "1996466907519762434", - "contractFlag": "1", - "contractCode": "HT202512040001", - "customerContractCode": null, - "contractName": "市场实施合同一", - "contractCategory": "1", - "contractType": "2", - "businessDirection": "1", - "contractDeptId": 107, - "contractDate": "2025-12-12 00:00:00", - "totalPrice": "3810.00", - "oneCustomerId": 2, - "oneRepresent": "甲方授", - "oneDate": "2025-12-16 00:00:00", - "twoCustomerId": 1, - "twoRepresent": "乙方", - "twoDate": "2025-12-18 00:00:00", - "contractStatus": "3", - "flowStatus": "finish", - "templateId": "1976189070472728577", - "ossId": null, - "paymentMethod": "3-3-3-1", - "signatureAppendix": "1996470593947987969", - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": "某一集团股份有限公司", - "twoCustomerName": "青岛海威物联科技有限公司", - "deptName": "软件产品部" - }, - { - "contractId": "1994225942858510338", - "contractFlag": "1", - "contractCode": "HT202511280001", - "customerContractCode": null, - "contractName": "合同名称1", - "contractCategory": "1", - "contractType": "2", - "businessDirection": null, - "contractDeptId": 100, - "contractDate": null, - "totalPrice": "27.00", - "oneCustomerId": null, - "oneRepresent": null, - "oneDate": null, - "twoCustomerId": null, - "twoRepresent": null, - "twoDate": null, - "contractStatus": "1", - "flowStatus": "draft", - "templateId": null, - "ossId": null, - "paymentMethod": "3-3-3-1", - "signatureAppendix": null, - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": null, - "twoCustomerName": null, - "deptName": "青岛海威物联科技有限公司" - }, - { - "contractId": "1991418792844570626", - "contractFlag": "1", - "contractCode": null, - "customerContractCode": "A", - "contractName": "备件销售合同1120", - "contractCategory": "2", - "contractType": "2", - "businessDirection": "7", - "contractDeptId": 106, - "contractDate": "2025-11-05 00:00:00", - "totalPrice": "6090.00", - "oneCustomerId": 3, - "oneRepresent": "甲方", - "oneDate": "2025-11-19 00:00:00", - "twoCustomerId": 1, - "twoRepresent": "乙方", - "twoDate": "2025-11-13 00:00:00", - "contractStatus": "3", - "flowStatus": "finish", - "templateId": "1976189070472728577", - "ossId": null, - "paymentMethod": "3-3-3-1", - "signatureAppendix": null, - "internalContractCode": "E", - "externalContractCode": "S", - "orderContractCode": "T", - "projectContractCode": "Y", - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": "某一集团山东分公司", - "twoCustomerName": "青岛海威物联科技有限公司", - "deptName": "市场部" - }, - { - "contractId": "1991345844477517825", - "contractFlag": "1", - "contractCode": "HT202511200002", - "customerContractCode": null, - "contractName": "产品销售合同1120", - "contractCategory": "2", - "contractType": "2", - "businessDirection": "1", - "contractDeptId": 106, - "contractDate": "2025-11-08 00:00:00", - "totalPrice": "1100.00", - "oneCustomerId": 2, - "oneRepresent": "甲方A", - "oneDate": "2025-11-19 00:00:00", - "twoCustomerId": 1, - "twoRepresent": "乙方", - "twoDate": "2025-11-18 00:00:00", - "contractStatus": "4", - "flowStatus": "invalid", - "templateId": "1976189070472728577", - "ossId": null, - "paymentMethod": "3-3-3-1", - "signatureAppendix": null, - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": "某一集团股份有限公司", - "twoCustomerName": "青岛海威物联科技有限公司", - "deptName": "市场部" - }, - { - "contractId": "1988899504180830209", - "contractFlag": "2", - "contractCode": null, - "customerContractCode": null, - "contractName": "合同名称AS", - "contractCategory": null, - "contractType": null, - "businessDirection": null, - "contractDeptId": null, - "contractDate": null, - "totalPrice": null, - "oneCustomerId": null, - "oneRepresent": null, - "oneDate": null, - "twoCustomerId": null, - "twoRepresent": null, - "twoDate": null, - "contractStatus": "1", - "flowStatus": "draft", - "templateId": null, - "ossId": null, - "paymentMethod": "3-3-3-1", - "signatureAppendix": null, - "internalContractCode": null, - "externalContractCode": null, - "orderContractCode": null, - "projectContractCode": null, - "warrantyPeriod": null, - "taxRate": null, - "remark": null, - "activeFlag": "1", - "contractMaterialList": null, - "oneCustomerName": null, - "twoCustomerName": null, - "deptName": null + const checkFull = () => { + let res = false + return new Promise(resolve => { + uni.createSelectorQuery() + .select('#contain') // 页面级查询,不用 .in(proxy) + .boundingClientRect(rect => { + resolve(rect?.height < pageHeight.value) + }) + .exec() + }) + } + const search = async () => { + const res = await listContractInfo(searchForm.value); + list.value = list.value.concat(res.rows); + total.value = res.total; + await nextTick() + if (await checkFull()) { + if (searchForm.value.pageNum * searchForm.value.pageSize < total.value) { + searchForm.value.pageNum += 1 + search() + } } - ]) + } + const getList = () => { + searchForm.value.pageNum = 1 + list.value = [] + search() + } + const searchFormReset = () => { + searchForm.value = { + pageNum: 1, + pageSize: 10, + } + } + const onScrollToLower = () => { + if (searchForm.value.pageNum * searchForm.value.pageSize < total.value) { + searchForm.value.pageNum += 1 + search() + } + } const itemOperation = (e) => { - console.log(e); if (e.contractStatus !== '1') { uni.navigateTo({ url: '/pages/contract/info?type=1&id=' + e.contractId @@ -463,31 +187,57 @@ }) } } - - const onSubmit = (e) => { - console.log(e.detail.value); - } - const pageHeight = ref(0) + const barHeight = ref(0) const sys = uni.getSystemInfoSync() onMounted(() => { - pageHeight.value = sys.windowHeight + setTimeout(() => { + if ((process.env.UNI_PLATFORM === 'app-plus' || process.env.UNI_PLATFORM === 'app')) { + const statusBarHeight = plus.navigator.getStatusbarHeight() + barHeight.value = statusBarHeight + pageHeight.value = sys.windowHeight - statusBarHeight + } else { + pageHeight.value = sys.windowHeight + } + search() + }, 100) }) \ No newline at end of file diff --git a/pages/workbench/index.vue b/pages/workbench/index.vue index 060d5bb..e95c011 100644 --- a/pages/workbench/index.vue +++ b/pages/workbench/index.vue @@ -1,5 +1,5 @@