diff --git a/src/pages.json b/src/pages.json index def9012..fbb424f 100644 --- a/src/pages.json +++ b/src/pages.json @@ -430,7 +430,20 @@ "style": { "navigationBarTitleText": "支付详情" } + }, + { + "path": "components/addIncomeDetail", + "style": { + "navigationBarTitleText": "新增收入明细" + } + }, + { + "path": "components/incomeContent", + "style": { + "navigationBarTitleText": "收入详情" + } } + ] } // { diff --git a/src/pagesApp/components/CustomFilterDialog.vue b/src/pagesApp/components/CustomFilterDialog.vue index d210277..16df3b3 100644 --- a/src/pagesApp/components/CustomFilterDialog.vue +++ b/src/pagesApp/components/CustomFilterDialog.vue @@ -3,7 +3,7 @@ 筛选 - + @@ -47,7 +47,7 @@ :show="showDialog.showSupplier" @handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}" @changeUser="changeUser" - :isShipment="state.type.key === 2 ? true : false" + :isShipment="(state.type.key === 2 || isShipment) ? true : false" > + diff --git a/src/pagesApp/components/incomeContent.vue b/src/pagesApp/components/incomeContent.vue new file mode 100644 index 0000000..f72c300 --- /dev/null +++ b/src/pagesApp/components/incomeContent.vue @@ -0,0 +1,76 @@ + + + diff --git a/src/pagesApp/components/payContent.vue b/src/pagesApp/components/payContent.vue index 172230c..a62ae01 100644 --- a/src/pagesApp/components/payContent.vue +++ b/src/pagesApp/components/payContent.vue @@ -43,7 +43,7 @@ const getPayment = (item: any) => { ]; }; const getPaymentMethod = (item: any) => { - return ["", "现金", "转账", "微信", "支付宝"][item.paymentType]; + return ["", "现金", "转账", "微信", "支付宝"][item.paymentMethod]; }; onLoad((option: any) => { // 接收传递的标题参数 diff --git a/src/pagesApp/incomeDetail.vue b/src/pagesApp/incomeDetail.vue index c93cf48..8493221 100644 --- a/src/pagesApp/incomeDetail.vue +++ b/src/pagesApp/incomeDetail.vue @@ -1,5 +1,333 @@ \ No newline at end of file +import { FinanceApi } from "@/services"; +import PageView from "@/components/PageView/index.vue"; +import { formatDate, getCurrentMonthStartAndEnd } from "@/utils"; +import TimeDialog from "./components/TimeDialog.vue"; +import FilterDialog from "./components/CustomFilterDialog.vue"; + +const options1 = ref([ + { + text: "删除", + style: { + backgroundColor: "rgba(217, 4, 30, 1)", + fontSize: "24rpx", + }, + }, +]); +const keyword = ref(""); +const state = reactive({ + startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"), + endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"), + name: "本月", + currentPaymentType: -1, + isShowStatus: false, + statusList: [ + { + name: "全部", + key: -1, + }, + { + name: "出货单收款", + key: 0, + }, + { + name: "其他收款", + key: 1, + } + ], + userId: -1, + userType: -1, + params: {}, +}); + +const getPayment = (item: any) => { + return ["出货单收款", "其他收款"][ + item.paymentType + ]; +}; +const showDialog = < + { + [key: string]: boolean; + } +>reactive({ + showTime: false, + showFilter: false, +}); + +const handleDialog = (key: string, v: boolean) => { + showDialog[key] = v; +}; +const handleSelectStatus = (v: any) => { + state.isShowStatus = false; + state.currentPaymentType = v.key; + resetPageList(); + getList(); +}; +const changeOther = (obj: any) => { + state.userId = obj.userId; + state.userType = obj.type; + resetPageList(); + getList(); +}; +const pageList: PageResult = reactive({ + total: 0, + list: [], + pageNum: 1, + pageSize: 10, +}); +const resetPageList = () => { + pageList.noMoreData = false; + pageList.total = 0; + pageList.list = []; + pageList.pageNum = 1; + pageList.pageSize = 10; +}; +const handleSearch = () => { + resetPageList(); + getList(); +}; +const handleAdd = () => { + uni.navigateTo({ + url: "/pagesApp/components/addIncomeDetail", // 要跳转到的页面路径 + }); +}; +// 删除 +const handleItem = (item: any) => { + FinanceApi.deleteRevenueDes({ id: item.id }).then((res) => { + if (res.code === 200) { + uni.showToast({ + title: "删除成功", + }); + resetPageList(); + getList(); + } + }); +}; +// 获得详情 +const getDetail = (item: any) => { + uni.navigateTo({ + url: "/pagesApp/components/incomeContent?id=" + item.id, // 要跳转到的页面路径 + }); +}; +const changeTime = (obj: any) => { + state.startTime = obj.startTime; + state.endTime = obj.endTime; + state.name = obj.name; + resetPageList(); + getList(); +}; +const getList = (v?: boolean) => { + if (v) { + if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) { + pageList.pageNum++; + } else { + pageList.noMoreData = true; + return; + } + } + let params: any = { + pageSize: pageList.pageSize, + pageNumber: pageList.pageNum, + startTime: state.startTime + " 00:00:00", + endTime: state.endTime + " 23:59:59", + oddNumbers: keyword.value, + }; + if (state.currentPaymentType > -1) { + params.paymentType = state.currentPaymentType; + } + if (state.userId > -1) { + params.customerId = state.userId; + } + + pageList.isLoading = true; + FinanceApi.getRevenueDetailsPage(params).then((res: any) => { + if (res.code === 200) { + pageList.isLoading = false; + (pageList as any).list = (pageList as any).list = pageList.list.concat( + res.data.list + ); + pageList.total = (res.data as any).total; + } + }); +}; +onMounted(() => { + getList(); +}); + + diff --git a/src/pagesApp/paymentDetail.vue b/src/pagesApp/paymentDetail.vue index 161a0a6..df2fc66 100644 --- a/src/pagesApp/paymentDetail.vue +++ b/src/pagesApp/paymentDetail.vue @@ -340,4 +340,3 @@ onMounted(() => { } } -./components/CustomFilterDialog.vue diff --git a/src/services/finance.ts b/src/services/finance.ts index 014b2a1..24f2a3d 100644 --- a/src/services/finance.ts +++ b/src/services/finance.ts @@ -37,15 +37,6 @@ export const deletePaymentDs = (data: any) => { } -// 收入明细新增 -export const addRevenueDes = (data: any) => { - return http({ - method: 'POST', - url: '/api/recategory/addRevenueDes', - data, - }) -} - // 分页查询支付明细 export const getPaymentDetailsPage = (data: any) => { return http({ @@ -61,4 +52,37 @@ export const getByPaymentId = (data: any) => { url: '/api/paymentdtails/getByPaymentId', data, }) -} \ No newline at end of file +} + +// 收货明细分页查询 +export const getRevenueDetailsPage = (data: any) => { + return http({ + method: 'GET', + url: '/api/revenuedetails/getRevenueDetailsPage', + data, + }) +} +// 收入明细查看详情 +export const getRevenueDetailsById = (data: any) => { + return http({ + method: 'GET', + url: '/api/revenuedetails/getRevenueDetailsById', + data, + }) +} +// 收入明细新增 +export const addIncome = (data: any) => { + return http({ + method: 'POST', + url: '/api/revenuedetails/addRevenueDes', + data, + }) +} +// 收入明细逻辑删除 +export const deleteRevenueDes = (data: any) => { + return http({ + method: 'POST', + url: '/api/revenuedetails/deleteRevenueDes', + data, + }) +}