Compare commits
2 Commits
4f10e0c0fb
...
905ea2ae51
Author | SHA1 | Date | |
---|---|---|---|
905ea2ae51 | |||
7f7a7f5721 |
@ -15,8 +15,6 @@ services:
|
||||
hkchc-payment-frontend-server:
|
||||
image: registry.hkchc.team/hkchc-payment-frontend:latest
|
||||
container_name: hkchc-payment-frontend
|
||||
environment:
|
||||
APP_API_URL: "10.10.0.152:50000" # payment backend service
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
working_dir: /etc/nginx/conf.d/
|
||||
|
@ -1,15 +1,12 @@
|
||||
export const AppConfig: {
|
||||
[key:string]: {
|
||||
ldapApiUrl: string,
|
||||
ldapApiKey: string
|
||||
}
|
||||
} = {
|
||||
default:{
|
||||
ldapApiUrl: 'https://test-api.hkchc.team',
|
||||
ldapApiKey: 'MPCbsNa6l2RJ7D1Zo6D03qtVF1P93st3'
|
||||
},
|
||||
production:{
|
||||
ldapApiUrl: 'https://test-api.hkchc.team',
|
||||
ldapApiKey: 'MPCbsNa6l2RJ7D1Zo6D03qtVF1P93st3'
|
||||
ldapApiKey: 'NFIgLIzvmL0ENQeeIDJu5Z7MEp5TjhlE'
|
||||
}
|
||||
}
|
@ -22,7 +22,7 @@ server {
|
||||
}
|
||||
|
||||
location ^~/api {
|
||||
proxy_pass https://localhost:50000;
|
||||
proxy_pass http://localhost:30000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {Button, Checkbox, CheckboxGroup, Space, Table, Tag, Typography} from "@douyinfe/semi-ui";
|
||||
import {ColumnProps} from "@douyinfe/semi-ui/lib/es/table";
|
||||
import React, {ReactNode, useMemo, useState} from "react";
|
||||
import React, {ReactNode, useEffect, useMemo, useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import dayjs from "dayjs";
|
||||
import {IconCheckCircleStroked, IconSetting, IconTickCircle} from "@douyinfe/semi-icons";
|
||||
@ -40,13 +40,15 @@ export const BillList: React.FC<BillListProps> = (props) => {
|
||||
const [currentTotalAmount, setCurrentTotalAmount] = useState(0)
|
||||
const [state, setState] = useSetState<{
|
||||
showColumnsConfig?: boolean;
|
||||
showCols: string[]
|
||||
showCols: string[];
|
||||
selectedKeys: string[];
|
||||
}>({
|
||||
showCols: [
|
||||
"id", "merchant_ref", "student_number", "application_number", 'confirm_status', "initiated_paid_at", "delivered_at",
|
||||
"paid_at", "student_english_name", "student_email", "programme_english_name","department_english_name",
|
||||
"intake_year", "detail", "detail_confirms", "amount", "pay_amount", "actual_payment_amount", "pay_method", "status", "apply_status"
|
||||
]
|
||||
],
|
||||
selectedKeys:[]
|
||||
})
|
||||
|
||||
const billStatusText = (billStatus: string) => {
|
||||
@ -301,6 +303,11 @@ export const BillList: React.FC<BillListProps> = (props) => {
|
||||
setCurrentTotalAmount(_total)
|
||||
return originList;
|
||||
}, [props.source])
|
||||
useEffect(()=>{
|
||||
setState({
|
||||
selectedKeys:[]
|
||||
})
|
||||
},[currentList])
|
||||
|
||||
return <Card
|
||||
title={<Space>
|
||||
@ -347,6 +354,7 @@ export const BillList: React.FC<BillListProps> = (props) => {
|
||||
|
||||
</div>}
|
||||
<div className="bill-list-table">
|
||||
{JSON.stringify(state.selectedKeys)}
|
||||
<Table<BillModel>
|
||||
bordered
|
||||
columns={columns}
|
||||
@ -368,7 +376,9 @@ export const BillList: React.FC<BillListProps> = (props) => {
|
||||
loading={props.loading}
|
||||
rowSelection={props.onRowSelection ? {
|
||||
fixed: true,
|
||||
selectedRowKeys: state.selectedKeys,
|
||||
onChange: (selectedRowKeys) => {
|
||||
setState({selectedKeys: selectedRowKeys as string[]})
|
||||
selectedRowKeys && props.onRowSelection?.(selectedRowKeys)
|
||||
},
|
||||
getCheckboxProps: (record) => {
|
||||
|
@ -35,6 +35,7 @@
|
||||
"confirm_bill_type": "Confirm Bill",
|
||||
"confirm_bill_type_batch": "Batch confirm Bill Type",
|
||||
"confirm_bill_warning_amount": "The bill amount and actual payment amount are inconsistent",
|
||||
"confirm_bill_warning_amount_id": "The bill id({{id}}) confirmed amount and actual payment amount are inconsistent",
|
||||
"confirm_confirm_title": "Confirm check and sync the Bill?",
|
||||
"confirm_select_empty": "Require confirm bill data",
|
||||
"confirm_student_number": "Confirm Student Number",
|
||||
|
@ -35,6 +35,7 @@
|
||||
"confirm_bill_type": "确认账单",
|
||||
"confirm_bill_type_batch": "批量确认账单",
|
||||
"confirm_bill_warning_amount": "账单金额和实付金额不一致",
|
||||
"confirm_bill_warning_amount_id": "账单ID({{id}})确认金额和实付金额不一致",
|
||||
"confirm_confirm_title": "请确定对账并同步此账单?",
|
||||
"confirm_select_empty": "对账账单为空",
|
||||
"confirm_student_number": "确认学号",
|
||||
|
@ -34,7 +34,8 @@
|
||||
"confirm_bill_number": "確認帳單編號",
|
||||
"confirm_bill_type": "確認賬單",
|
||||
"confirm_bill_type_batch": "批次確認帳單",
|
||||
"confirm_bill_warning_amount": "账单金额和实付金额不一致",
|
||||
"confirm_bill_warning_amount": "帳單金額和實付金額不一致",
|
||||
"confirm_bill_warning_amount_id": "帳單ID({{id}})確認金額和實付金額不一致",
|
||||
"confirm_confirm_title": "請確定對帳并同步此帳單?",
|
||||
"confirm_select_empty": "對帳帳單為空",
|
||||
"confirm_student_number": "確認學號",
|
||||
|
@ -103,7 +103,7 @@ export const BillTypeConfirmModal: React.FC<BillTypeConfirmProps> = (props) => {
|
||||
const onBillConfirm = () => {
|
||||
// 判断confirm的总金额是否和实付金额相等
|
||||
const total = state.detail_confirms.reduce((total, item) => {
|
||||
return total + item.amount
|
||||
return total + Number(item.amount)
|
||||
}, 0)
|
||||
if(total != props.bill.actual_payment_amount){
|
||||
Modal.warning({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import {Button, Popconfirm} from "@douyinfe/semi-ui";
|
||||
import {Button, Modal, Popconfirm} from "@douyinfe/semi-ui";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {confirmBillType} from "@/service/api/bill.ts";
|
||||
import {useSetState} from "ahooks";
|
||||
@ -21,7 +21,24 @@ export const BillTypeConfirmBatch: React.FC<BillTypeConfirmBatchProps> = (props)
|
||||
}
|
||||
const confirmBillTypeBatch = () => {
|
||||
const bills: BillConfirmParams[] = [];
|
||||
props.data?.list.filter(item => props.selectKeys.includes(item.id)).forEach(item => {
|
||||
const arr = props.data?.list.filter(item => props.selectKeys.includes(item.id));
|
||||
if(!arr) return;
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
const item = arr[i];
|
||||
if(item.confirm_status != 'UNCONFIRMED'){
|
||||
continue;
|
||||
}
|
||||
// 判断confirm的总金额是否和实付金额相等
|
||||
const total = item.details.reduce((total, item) => {
|
||||
return total + Number(item.amount)
|
||||
}, 0)
|
||||
if(total != item.actual_payment_amount){
|
||||
Modal.warning({
|
||||
title: 'Warning',
|
||||
content: t('bill.confirm_bill_warning_amount_id',{id: item.id})
|
||||
})
|
||||
return;
|
||||
}
|
||||
bills.push({
|
||||
id: item.id,
|
||||
confirm_application_number: String(item.application_number),
|
||||
@ -34,7 +51,7 @@ export const BillTypeConfirmBatch: React.FC<BillTypeConfirmBatchProps> = (props)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
if (bills.length == 0) return;
|
||||
confirm(bills)
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Button, Space, TabPane, Tabs, Notification, Popconfirm, Toast} from "@douyinfe/semi-ui";
|
||||
import {Button, Space, TabPane, Tabs, Notification, Popconfirm, Toast, Modal} from "@douyinfe/semi-ui";
|
||||
import {useRequest, useSetState} from "ahooks";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {useState} from "react";
|
||||
@ -6,22 +6,22 @@ import {useState} from "react";
|
||||
import SearchForm from "@/components/bill/search-form.tsx";
|
||||
import {BillList} from "@/components/bill/list.tsx";
|
||||
import {billList, BillQueryParams, confirmBills} from "@/service/api/bill.ts";
|
||||
import useAuth from "@/hooks/useAuth.ts";
|
||||
import {BizError} from "@/service/types.ts";
|
||||
|
||||
const BillReconciliation = () => {
|
||||
const {t} = useTranslation()
|
||||
const {user} = useAuth();
|
||||
const [queryParams, setBillQueryParams] = useState<BillQueryParams>({
|
||||
apply_status: 'UNCHECKED'
|
||||
});
|
||||
const {data, loading, refresh} = useRequest(() => billList({
|
||||
...queryParams,
|
||||
status: 'PAID',
|
||||
confirm_status: 'CONFIRMED',
|
||||
department: user?.department == 'RO' ? 'RO' : 'FO',
|
||||
confirm_status: 'CONFIRMED'
|
||||
}), {
|
||||
refreshDeps: [queryParams],
|
||||
onSuccess:()=>{
|
||||
setState({checkingId: -1})
|
||||
},
|
||||
onError: (e: Error) => {
|
||||
Toast.error({
|
||||
content: `${t('base.query_bill')}:${e.message}`,
|
||||
@ -39,7 +39,26 @@ const BillReconciliation = () => {
|
||||
Notification.error({title: 'Notice', content: t('bill.confirm_select_empty')})
|
||||
return
|
||||
}
|
||||
setState({checkingId: records.length > 1 ? 0 : records[0]})
|
||||
const arr = data?.list.filter(item =>records.includes(item.id));
|
||||
if(!arr) return;
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
const item = arr[i];
|
||||
|
||||
// 判断confirm的总金额是否和实付金额相等
|
||||
const total = item.detail_confirms? item.detail_confirms.reduce((total, item) => {
|
||||
return total + Number(item.amount)
|
||||
}, 0) : 0;
|
||||
|
||||
if (total != item.actual_payment_amount) {
|
||||
Modal.warning({
|
||||
title: 'Warning',
|
||||
content: t('bill.confirm_bill_warning_amount_id', {id: item.id})
|
||||
})
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setState({checkingId: records.length > 1 ? 0 : Number(records[0])})
|
||||
confirmBills(records).then(() => {
|
||||
Notification.success({title: 'Notice', content: t('bill.confirm_success')})
|
||||
refresh()
|
||||
@ -60,6 +79,7 @@ const BillReconciliation = () => {
|
||||
onConfirm={() => confirmBill([_record.id])}
|
||||
okText={t('base.confirm')}
|
||||
cancelText={t('base.cancel')}
|
||||
disabled={state.checkingId == _record.id}
|
||||
>
|
||||
<Button
|
||||
loading={state.checkingId == _record.id} size={'small'} theme={'solid'}
|
||||
|
@ -74,7 +74,7 @@ export function confirmBillType(bills:BillConfirmParams[]) {
|
||||
return post<BillModel>(`/bills/confirm`, {bills})
|
||||
}
|
||||
|
||||
export function confirmBills(bill_ids: number[]) {
|
||||
export function confirmBills(bill_ids: number[] | string[]) {
|
||||
return post(`/bills/apply`, {bill_ids})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user