Commit 194cfcfe authored by lxd's avatar lxd

faet: 问题修复

parent 5de0c276
...@@ -21,12 +21,17 @@ export const redInvoiceState = { ...@@ -21,12 +21,17 @@ export const redInvoiceState = {
1: { text: '', actionValue: 2 }, 1: { text: '', actionValue: 2 },
2: { text: '', actionValue: 1 }, 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 [ return [
{
title: '序号',
dataIndex: 'index',
hideInSearch: true,
width: '50px',
render: (text, record, index) => (current - 1) * pageSize + index + 1,
},
{ {
title: '供应商名称', title: '供应商名称',
dataIndex: 'supplierName', dataIndex: 'supplierName',
...@@ -150,7 +155,7 @@ export function columns(res) { ...@@ -150,7 +155,7 @@ export function columns(res) {
</Button> </Button>
<Button <Button
type="primary" type="primary"
disabled={row.blueInvoiceState === 1} disabled={row.blueInvoiceState === 1 && row.payState !== 1}
className={styles.button} className={styles.button}
onClick={() => res.edit(2, row)} onClick={() => res.edit(2, row)}
> >
......
...@@ -24,6 +24,7 @@ const PaymentMange = () => { ...@@ -24,6 +24,7 @@ const PaymentMange = () => {
const [toExamineData, settoExamineData] = useState({}); const [toExamineData, settoExamineData] = useState({});
const [loading, setloading] = useState(false); const [loading, setloading] = useState(false);
const [status, setstatus] = useState(1); const [status, setstatus] = useState(1);
const [pages, setpages] = useState({});
const [toExamineModalVisibel, setToExamineModalVisibel] = useState(false); const [toExamineModalVisibel, setToExamineModalVisibel] = useState(false);
const reload = () => { const reload = () => {
...@@ -131,6 +132,7 @@ const PaymentMange = () => { ...@@ -131,6 +132,7 @@ const PaymentMange = () => {
onClick={() => { onClick={() => {
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
form?.resetFields(); form?.resetFields();
reload();
}} }}
> >
{resetText} {resetText}
...@@ -154,8 +156,12 @@ const PaymentMange = () => { ...@@ -154,8 +156,12 @@ const PaymentMange = () => {
<ProTable <ProTable
actionRef={actionRef} actionRef={actionRef}
formRef={formRef} formRef={formRef}
request={params => query({ ...params })} request={params => {
columns={columns(res)} const { current, pageSize } = params;
setpages({ current, pageSize });
return query({ ...params });
}}
columns={columns(res, pages)}
rowKey={r => r.id} rowKey={r => r.id}
search={{ search={{
collapsed: false, collapsed: false,
......
...@@ -35,12 +35,21 @@ export async function qiniuToken() { ...@@ -35,12 +35,21 @@ export async function qiniuToken() {
} }
// 付款单导出 // 付款单导出
export async function selfPaymentExport(params) { export async function selfPaymentExport(params) {
console.log(params?.dateTimeRange?.[0]);
const queryParams = { const queryParams = {
payBatchNo: params?.payBatchNo, payBatchNo: params?.payBatchNo,
payBeginDate: params?.dateTimeRange?.[0], payBeginDate: params?.dateTimeRange?.[0]
payEndDate: params?.dateTimeRange?.[1], ? moment(params?.dateTimeRange?.[0]).format('yyyy-MM-DD')
paidBeginDate: params?.payTimeRange?.[0], : '',
paidEndDate: params?.payTimeRange?.[1], 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, redInvoiceState: params?.redInvoiceState,
blueInvoiceState: params?.blueInvoiceState, blueInvoiceState: params?.blueInvoiceState,
payState: params?.payState, payState: params?.payState,
......
...@@ -12,13 +12,15 @@ export const orderStateNum = { ...@@ -12,13 +12,15 @@ export const orderStateNum = {
3: { text: '已生成结算单' }, 3: { text: '已生成结算单' },
}; };
export const columns = [ export function columns(pages) {
const { current, pageSize } = pages;
return [
{ {
title: '序号', title: '序号',
dataIndex: 'index', dataIndex: 'index',
hideInSearch: true, hideInSearch: true,
width: '50px', width: '50px',
render: (text, record, index) => `${index + 1}`, render: (text, record, index) => (current - 1) * pageSize + index + 1,
}, },
{ {
title: '供应商名称', title: '供应商名称',
...@@ -75,7 +77,8 @@ export const columns = [ ...@@ -75,7 +77,8 @@ export const columns = [
width: '100px', width: '100px',
filters: false, filters: false,
}, },
]; ];
}
export const toolBarRender = gather => { export const toolBarRender = gather => {
const { onDownload, confirmAction } = gather; const { onDownload, confirmAction } = gather;
......
...@@ -13,6 +13,8 @@ const ReconciliationQuery = () => { ...@@ -13,6 +13,8 @@ const ReconciliationQuery = () => {
const [selectedRowKeys, setselectedRowKeys] = useState([]); const [selectedRowKeys, setselectedRowKeys] = useState([]);
const [selectedRows, setselectedRows] = useState([]); const [selectedRows, setselectedRows] = useState([]);
const [loading, setloading] = useState(false); const [loading, setloading] = useState(false);
const [pages, setpages] = useState({});
const [billName, setbillName] = useState('');
const reload = () => { const reload = () => {
if (actionRef.current) { if (actionRef.current) {
...@@ -25,10 +27,12 @@ const ReconciliationQuery = () => { ...@@ -25,10 +27,12 @@ const ReconciliationQuery = () => {
const billType = data[0]?.billType; const billType = data[0]?.billType;
const sameData = data.filter(item => item.billType === billType); const sameData = data.filter(item => item.billType === billType);
if (data.length === sameData.length && sameData.length < 32) { if (data.length === sameData.length && sameData.length < 32) {
const billName = billType === '10' ? '销售' : '售后';
setbillName(billName);
return true; return true;
} }
if (sameData.length > 31) { if (sameData.length > 31) {
notification.error({ message: '最多选择31条数据账单' }); notification.error({ message: '一次最多选择31个账单批次' });
return false; return false;
} }
notification.error({ message: '不同账单类型不可批量操作' }); notification.error({ message: '不同账单类型不可批量操作' });
...@@ -42,7 +46,7 @@ const ReconciliationQuery = () => { ...@@ -42,7 +46,7 @@ const ReconciliationQuery = () => {
return true; return true;
} }
if (!sameData.length && !data.length) { if (!sameData.length && !data.length) {
notification.error({ message: '请选择数据账单' }); notification.error({ message: '请选择1~31条账单批次' });
return false; return false;
} }
notification.error({ message: '只有待确认账单可以确认' }); notification.error({ message: '只有待确认账单可以确认' });
...@@ -77,13 +81,13 @@ const ReconciliationQuery = () => { ...@@ -77,13 +81,13 @@ const ReconciliationQuery = () => {
setloading(true); setloading(true);
const data = await downloadSelfBillDetail(selectedRowKeys); const data = await downloadSelfBillDetail(selectedRowKeys);
const blob = new Blob([data]); const blob = new Blob([data]);
saveAs(blob, `付款单导出数据-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`); saveAs(blob, `${billName}-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
setloading(false); setloading(false);
setselectedRowKeys([]); setselectedRowKeys([]);
setselectedRows([]); setselectedRows([]);
reload(); reload();
} else { } else {
notification.error({ message: '最少下载1条数据账单或最多下载31条数据账单' }); notification.error({ message: '请选择1~31条账单批次' });
setloading(false); setloading(false);
} }
}; };
...@@ -118,6 +122,7 @@ const ReconciliationQuery = () => { ...@@ -118,6 +122,7 @@ const ReconciliationQuery = () => {
onClick={() => { onClick={() => {
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
form?.resetFields(); form?.resetFields();
reload();
}} }}
> >
{resetText} {resetText}
...@@ -128,8 +133,12 @@ const ReconciliationQuery = () => { ...@@ -128,8 +133,12 @@ const ReconciliationQuery = () => {
<PageHeaderWrapper> <PageHeaderWrapper>
<ProTable <ProTable
actionRef={actionRef} actionRef={actionRef}
request={params => query({ ...params })} request={params => {
columns={columns} const { current, pageSize } = params;
setpages({ current, pageSize });
return query({ ...params });
}}
columns={columns(pages)}
rowKey={r => r.id} rowKey={r => r.id}
search={{ search={{
collapsed: false, collapsed: false,
......
...@@ -18,7 +18,16 @@ export const paymentStateEnum = { ...@@ -18,7 +18,16 @@ export const paymentStateEnum = {
false: { text: '' }, false: { text: '' },
}; };
export const columns = [ 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: '供应商名称', title: '供应商名称',
dataIndex: 'supplierName', dataIndex: 'supplierName',
...@@ -102,7 +111,8 @@ export const columns = [ ...@@ -102,7 +111,8 @@ export const columns = [
valueEnum: paymentStateEnum, valueEnum: paymentStateEnum,
hideInTable: true, hideInTable: true,
}, },
]; ];
}
export const toolBarRender = paymentOrder => () => [ export const toolBarRender = paymentOrder => () => [
<Button type="primary" onClick={paymentOrder}> <Button type="primary" onClick={paymentOrder}>
......
...@@ -13,6 +13,7 @@ const SettlementSheet = () => { ...@@ -13,6 +13,7 @@ const SettlementSheet = () => {
const [selectedRowKeys, setselectedRowKeys] = useState([]); const [selectedRowKeys, setselectedRowKeys] = useState([]);
const [selectedRowsList, setselectedRowsList] = useState([]); const [selectedRowsList, setselectedRowsList] = useState([]);
const [loading, setloading] = useState(false); const [loading, setloading] = useState(false);
const [pages, setpages] = useState({});
const reload = () => { const reload = () => {
if (actionRef.current) { if (actionRef.current) {
...@@ -127,6 +128,7 @@ const SettlementSheet = () => { ...@@ -127,6 +128,7 @@ const SettlementSheet = () => {
onClick={() => { onClick={() => {
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
form?.resetFields(); form?.resetFields();
reload();
}} }}
> >
{resetText} {resetText}
...@@ -137,8 +139,12 @@ const SettlementSheet = () => { ...@@ -137,8 +139,12 @@ const SettlementSheet = () => {
<PageHeaderWrapper> <PageHeaderWrapper>
<ProTable <ProTable
actionRef={actionRef} actionRef={actionRef}
request={params => query({ ...params })} request={params => {
columns={columns} const { current, pageSize } = params;
setpages({ current, pageSize });
return query({ ...params });
}}
columns={columns(pages)}
rowKey={r => r.settleBatchNo} rowKey={r => r.settleBatchNo}
search={{ search={{
collapsed: false, 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