Commit 194cfcfe authored by lxd's avatar lxd

faet: 问题修复

parent 5de0c276
......@@ -21,12 +21,17 @@ export const redInvoiceState = {
1: { text: '', actionValue: 2 },
2: { text: '', actionValue: 1 },
};
export const onChangeActiveState = async ({ channelId, activeState }) => {
console.log(channelId, activeState);
};
export function columns(res) {
export function columns(res, pages) {
const { current, pageSize } = pages;
return [
{
title: '序号',
dataIndex: 'index',
hideInSearch: true,
width: '50px',
render: (text, record, index) => (current - 1) * pageSize + index + 1,
},
{
title: '供应商名称',
dataIndex: 'supplierName',
......@@ -150,7 +155,7 @@ export function columns(res) {
</Button>
<Button
type="primary"
disabled={row.blueInvoiceState === 1}
disabled={row.blueInvoiceState === 1 && row.payState !== 1}
className={styles.button}
onClick={() => res.edit(2, row)}
>
......
......@@ -24,6 +24,7 @@ const PaymentMange = () => {
const [toExamineData, settoExamineData] = useState({});
const [loading, setloading] = useState(false);
const [status, setstatus] = useState(1);
const [pages, setpages] = useState({});
const [toExamineModalVisibel, setToExamineModalVisibel] = useState(false);
const reload = () => {
......@@ -131,6 +132,7 @@ const PaymentMange = () => {
onClick={() => {
// eslint-disable-next-line no-unused-expressions
form?.resetFields();
reload();
}}
>
{resetText}
......@@ -154,8 +156,12 @@ const PaymentMange = () => {
<ProTable
actionRef={actionRef}
formRef={formRef}
request={params => query({ ...params })}
columns={columns(res)}
request={params => {
const { current, pageSize } = params;
setpages({ current, pageSize });
return query({ ...params });
}}
columns={columns(res, pages)}
rowKey={r => r.id}
search={{
collapsed: false,
......
......@@ -35,12 +35,21 @@ export async function qiniuToken() {
}
// 付款单导出
export async function selfPaymentExport(params) {
console.log(params?.dateTimeRange?.[0]);
const queryParams = {
payBatchNo: params?.payBatchNo,
payBeginDate: params?.dateTimeRange?.[0],
payEndDate: params?.dateTimeRange?.[1],
paidBeginDate: params?.payTimeRange?.[0],
paidEndDate: params?.payTimeRange?.[1],
payBeginDate: params?.dateTimeRange?.[0]
? moment(params?.dateTimeRange?.[0]).format('yyyy-MM-DD')
: '',
payEndDate: params?.dateTimeRange?.[1]
? moment(params?.dateTimeRange?.[1]).format('yyyy-MM-DD')
: '',
paidBeginDate: params?.payTimeRange?.[0]
? moment(params?.payTimeRange?.[1]).format('yyyy-MM-DD')
: '',
paidEndDate: params?.payTimeRange?.[1]
? moment(params?.payTimeRange?.[1]).format('yyyy-MM-DD')
: '',
redInvoiceState: params?.redInvoiceState,
blueInvoiceState: params?.blueInvoiceState,
payState: params?.payState,
......
......@@ -12,70 +12,73 @@ export const orderStateNum = {
3: { text: '已生成结算单' },
};
export const columns = [
{
title: '序号',
dataIndex: 'index',
hideInSearch: true,
width: '50px',
render: (text, record, index) => `${index + 1}`,
},
{
title: '供应商名称',
dataIndex: 'supplierName',
width: '150px',
hideInSearch: true,
},
{
title: '结算单批次号',
dataIndex: 'settleBatchNo',
width: '160px',
},
{
title: '账单日期',
key: 'dateTimeRange',
dataIndex: 'createdAtRange',
valueType: 'dateRange',
width: '120px',
hideInTable: true,
initialValue: [],
align: 'center',
},
{
title: '账单日期',
dataIndex: 'billDateStr',
key: 'billDateStr',
hideInSearch: true,
align: 'center',
width: '160px',
},
{
title: '账单类型',
dataIndex: 'billType',
valueEnum: activeStateEnum,
width: '120px',
filters: false,
},
{
title: '金额',
dataIndex: 'amount',
width: '100px',
hideInSearch: true,
},
{
title: '笔数',
dataIndex: 'quantity',
width: '100px',
hideInSearch: true,
},
{
title: '状态',
dataIndex: 'status',
valueEnum: orderStateNum,
width: '100px',
filters: false,
},
];
export function columns(pages) {
const { current, pageSize } = pages;
return [
{
title: '序号',
dataIndex: 'index',
hideInSearch: true,
width: '50px',
render: (text, record, index) => (current - 1) * pageSize + index + 1,
},
{
title: '供应商名称',
dataIndex: 'supplierName',
width: '150px',
hideInSearch: true,
},
{
title: '结算单批次号',
dataIndex: 'settleBatchNo',
width: '160px',
},
{
title: '账单日期',
key: 'dateTimeRange',
dataIndex: 'createdAtRange',
valueType: 'dateRange',
width: '120px',
hideInTable: true,
initialValue: [],
align: 'center',
},
{
title: '账单日期',
dataIndex: 'billDateStr',
key: 'billDateStr',
hideInSearch: true,
align: 'center',
width: '160px',
},
{
title: '账单类型',
dataIndex: 'billType',
valueEnum: activeStateEnum,
width: '120px',
filters: false,
},
{
title: '金额',
dataIndex: 'amount',
width: '100px',
hideInSearch: true,
},
{
title: '笔数',
dataIndex: 'quantity',
width: '100px',
hideInSearch: true,
},
{
title: '状态',
dataIndex: 'status',
valueEnum: orderStateNum,
width: '100px',
filters: false,
},
];
}
export const toolBarRender = gather => {
const { onDownload, confirmAction } = gather;
......
......@@ -13,6 +13,8 @@ const ReconciliationQuery = () => {
const [selectedRowKeys, setselectedRowKeys] = useState([]);
const [selectedRows, setselectedRows] = useState([]);
const [loading, setloading] = useState(false);
const [pages, setpages] = useState({});
const [billName, setbillName] = useState('');
const reload = () => {
if (actionRef.current) {
......@@ -25,10 +27,12 @@ const ReconciliationQuery = () => {
const billType = data[0]?.billType;
const sameData = data.filter(item => item.billType === billType);
if (data.length === sameData.length && sameData.length < 32) {
const billName = billType === '10' ? '销售' : '售后';
setbillName(billName);
return true;
}
if (sameData.length > 31) {
notification.error({ message: '最多选择31条数据账单' });
notification.error({ message: '一次最多选择31个账单批次' });
return false;
}
notification.error({ message: '不同账单类型不可批量操作' });
......@@ -42,7 +46,7 @@ const ReconciliationQuery = () => {
return true;
}
if (!sameData.length && !data.length) {
notification.error({ message: '请选择数据账单' });
notification.error({ message: '请选择1~31条账单批次' });
return false;
}
notification.error({ message: '只有待确认账单可以确认' });
......@@ -77,13 +81,13 @@ const ReconciliationQuery = () => {
setloading(true);
const data = await downloadSelfBillDetail(selectedRowKeys);
const blob = new Blob([data]);
saveAs(blob, `付款单导出数据-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${billName}-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
setloading(false);
setselectedRowKeys([]);
setselectedRows([]);
reload();
} else {
notification.error({ message: '最少下载1条数据账单或最多下载31条数据账单' });
notification.error({ message: '请选择1~31条账单批次' });
setloading(false);
}
};
......@@ -118,6 +122,7 @@ const ReconciliationQuery = () => {
onClick={() => {
// eslint-disable-next-line no-unused-expressions
form?.resetFields();
reload();
}}
>
{resetText}
......@@ -128,8 +133,12 @@ const ReconciliationQuery = () => {
<PageHeaderWrapper>
<ProTable
actionRef={actionRef}
request={params => query({ ...params })}
columns={columns}
request={params => {
const { current, pageSize } = params;
setpages({ current, pageSize });
return query({ ...params });
}}
columns={columns(pages)}
rowKey={r => r.id}
search={{
collapsed: false,
......
......@@ -18,91 +18,101 @@ export const paymentStateEnum = {
false: { text: '' },
};
export const columns = [
{
title: '供应商名称',
dataIndex: 'supplierName',
width: '150px',
hideInSearch: true,
},
{
title: '付款单批次号',
dataIndex: 'payBatchNo',
width: '160px',
},
{
title: '结算单批次号',
dataIndex: 'settleBatchNo',
width: '150px',
},
{
title: '结算单生成日期',
key: 'dateTimeRange',
dataIndex: 'createdAtRange',
valueType: 'dateRange',
width: '120px',
hideInTable: true,
initialValue: [],
align: 'center',
},
{
title: '帐单确认周期',
dataIndex: 'createdAtRange',
key: 'createdAtRange',
hideInSearch: true,
align: 'center',
width: '160px',
render: (text, record) => `${record.billPeriodStart}-${record.billPeriodEnd}`,
},
{
title: '账期',
dataIndex: 'billPeriodType',
valueEnum: dateStateEnum,
width: '120px',
hideInSearch: true,
filters: false,
},
{
title: '结算单生成日期',
dataIndex: 'createdAt',
key: 'createdAt',
hideInSearch: true,
align: 'center',
width: '160px',
},
{
title: '销售金额',
dataIndex: 'saleAmount',
width: '100px',
hideInSearch: true,
},
{
title: '退款金额',
dataIndex: 'refundAmount',
width: '100px',
hideInSearch: true,
},
{
title: '结算金额',
dataIndex: 'payableAmount',
width: '130px',
hideInSearch: true,
},
{
title: '结算状态',
dataIndex: 'settleState',
valueEnum: orderStateNum,
width: '100px',
initialValue: 0,
filters: false,
},
{
title: '是否生成付款单',
dataIndex: 'isCreatePaymentBill',
valueEnum: paymentStateEnum,
hideInTable: true,
},
];
export function columns(pages) {
const { current, pageSize } = pages;
return [
{
title: '序号',
dataIndex: 'index',
hideInSearch: true,
width: '50px',
render: (text, record, index) => (current - 1) * pageSize + index + 1,
},
{
title: '供应商名称',
dataIndex: 'supplierName',
width: '150px',
hideInSearch: true,
},
{
title: '付款单批次号',
dataIndex: 'payBatchNo',
width: '160px',
},
{
title: '结算单批次号',
dataIndex: 'settleBatchNo',
width: '150px',
},
{
title: '结算单生成日期',
key: 'dateTimeRange',
dataIndex: 'createdAtRange',
valueType: 'dateRange',
width: '120px',
hideInTable: true,
initialValue: [],
align: 'center',
},
{
title: '帐单确认周期',
dataIndex: 'createdAtRange',
key: 'createdAtRange',
hideInSearch: true,
align: 'center',
width: '160px',
render: (text, record) => `${record.billPeriodStart}-${record.billPeriodEnd}`,
},
{
title: '账期',
dataIndex: 'billPeriodType',
valueEnum: dateStateEnum,
width: '120px',
hideInSearch: true,
filters: false,
},
{
title: '结算单生成日期',
dataIndex: 'createdAt',
key: 'createdAt',
hideInSearch: true,
align: 'center',
width: '160px',
},
{
title: '销售金额',
dataIndex: 'saleAmount',
width: '100px',
hideInSearch: true,
},
{
title: '退款金额',
dataIndex: 'refundAmount',
width: '100px',
hideInSearch: true,
},
{
title: '结算金额',
dataIndex: 'payableAmount',
width: '130px',
hideInSearch: true,
},
{
title: '结算状态',
dataIndex: 'settleState',
valueEnum: orderStateNum,
width: '100px',
initialValue: 0,
filters: false,
},
{
title: '是否生成付款单',
dataIndex: 'isCreatePaymentBill',
valueEnum: paymentStateEnum,
hideInTable: true,
},
];
}
export const toolBarRender = paymentOrder => () => [
<Button type="primary" onClick={paymentOrder}>
......
......@@ -13,6 +13,7 @@ const SettlementSheet = () => {
const [selectedRowKeys, setselectedRowKeys] = useState([]);
const [selectedRowsList, setselectedRowsList] = useState([]);
const [loading, setloading] = useState(false);
const [pages, setpages] = useState({});
const reload = () => {
if (actionRef.current) {
......@@ -127,6 +128,7 @@ const SettlementSheet = () => {
onClick={() => {
// eslint-disable-next-line no-unused-expressions
form?.resetFields();
reload();
}}
>
{resetText}
......@@ -137,8 +139,12 @@ const SettlementSheet = () => {
<PageHeaderWrapper>
<ProTable
actionRef={actionRef}
request={params => query({ ...params })}
columns={columns}
request={params => {
const { current, pageSize } = params;
setpages({ current, pageSize });
return query({ ...params });
}}
columns={columns(pages)}
rowKey={r => r.settleBatchNo}
search={{
collapsed: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment