Commit a21333c1 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 4997f61e 4e0b4725
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09 * @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-24 10:32:10 * @LastEditTime: 2020-12-29 11:32:18
* @Description: 维修商品抽屉组件 * @Description: 维修商品抽屉组件
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -248,7 +248,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -248,7 +248,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
}); });
if (!payload.length) { if (!payload.length) {
this.setState({ loading: false }); this.setState({
dataSource: orderListRes,
loading: false,
});
return; return;
} }
...@@ -575,6 +578,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -575,6 +578,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
</Button> </Button>
</div> </div>
} }
destroyOnClose
> >
<div className={styles.order}> <div className={styles.order}>
<div className={styles['order-head']}> <div className={styles['order-head']}>
......
...@@ -41,7 +41,10 @@ const Balance: React.FC<BalanceProps> = ({ ...@@ -41,7 +41,10 @@ const Balance: React.FC<BalanceProps> = ({
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const getPayAssetAccountGetUserBalance = () => { const getPayAssetAccountGetUserBalance = () => {
setLoading(false); if (!purchaserId || !purchaserRoleId) {
return;
}
setLoading(true);
PublicApi.getPayAssetAccountGetChildUserBalance({ PublicApi.getPayAssetAccountGetChildUserBalance({
childMemberId: `${purchaserId}`, childMemberId: `${purchaserId}`,
childMemberRoleId: `${purchaserRoleId}`, childMemberRoleId: `${purchaserRoleId}`,
......
import React, { useState } from 'react'; import React, { useState, useEffect } from 'react';
import { Descriptions, Space, Button } from 'antd'; import { Descriptions, Space, Button, Spin } from 'antd';
import { PublicApi } from '@/services/api';
interface bankAccount {
id: number, interface Credit {
name: string, quota: number,
bankAccount: string, useQuota: number,
bankDeposit: string, canUseQuota: number,
memberId: number, isUsable: number,
}; };
interface BalanceProps { interface BalanceProps {
/** /**
* 弹窗需要的数据值 * 弹窗需要的数据值
*/ */
value: {[key: string]: any}; value: {[key: string]: any};
/** /**
* 关闭事件 * 关闭事件
*/ */
handleModalVisible: () => void; handleModalVisible: () => void;
/** /**
* 弹窗内确认事件 * 弹窗内确认事件
*/ */
handleConfirm: (values: {[key: string]: any}, modalName: string) => void; handleConfirm: (values: {[key: string]: any}, modalName: string) => void;
/** /**
* 弹窗提交 loading * 弹窗提交 loading
*/ */
submitLoading: boolean; submitLoading: boolean;
}; /**
* 采购商id
const Credit: React.FC<BalanceProps> = ({ */
handleModalVisible, purchaserId: number,
handleConfirm, /**
value, * 采购商角色id
submitLoading, */
}) => { purchaserRoleId: number,
const [bankAccount, setBankAccount] = useState<bankAccount>({ /**
id: 0, * 供应商id
name: '', */
bankAccount: '', supplierId: number,
bankDeposit: '', /**
memberId: 0, * 供应商角色id
}); */
supplierRoleId: number,
return ( };
<>
<Descriptions title="授信额度信息" column={1}> const Credit: React.FC<BalanceProps> = ({
<Descriptions.Item label="总授信额度">¥500000.00</Descriptions.Item> handleModalVisible,
<Descriptions.Item label="已用授信额度">¥500000.00</Descriptions.Item> handleConfirm,
<Descriptions.Item label="可用授信额度">¥500000.00</Descriptions.Item> value,
<Descriptions.Item label="当前退款金额"> submitLoading,
<span style={{ color: '#EF6260' }}>¥6000.00</span> purchaserId,
</Descriptions.Item> purchaserRoleId,
</Descriptions> supplierId,
supplierRoleId,
<div style={{ marginTop: 20, textAlign: 'center' }}> }) => {
<Space> const [credit, setCredit] = useState<Credit>({
<Button onClick={handleModalVisible}> quota: 0,
取消 useQuota: 0,
</Button> canUseQuota: 0,
<Button isUsable: 0,
type="primary" });
onClick={() => handleConfirm(value, 'credit')} const [loading, setLoading] = useState(false);
loading={submitLoading}
> const getMemberCredit = () => {
退款 if (
</Button> !purchaserId ||
</Space> !purchaserRoleId ||
</div> !supplierId ||
</> !supplierRoleId
) ) {
}; return;
}
setLoading(true);
PublicApi.getPayCreditGetMemberCredit({
memberId: `${purchaserId}`,
roleId: `${purchaserRoleId}`,
parentMemberId: `${supplierId}`,
parentMemberRoleId: `${supplierRoleId}`,
}).then(res => {
if (res.code === 1000) {
setCredit(res.data);
}
}).finally(() => {
setLoading(false);
});
};
useEffect(() => {
getMemberCredit();
}, []);
return (
<Spin spinning={loading}>
<Descriptions title="授信额度信息" column={1}>
<Descriptions.Item label="总授信额度">{credit.quota}</Descriptions.Item>
<Descriptions.Item label="已用授信额度">{credit.useQuota}</Descriptions.Item>
<Descriptions.Item label="可用授信额度">{credit.canUseQuota}</Descriptions.Item>
<Descriptions.Item label="当前退款金额">
<span style={{ color: '#EF6260' }}>{value.refundAmount}</span>
</Descriptions.Item>
</Descriptions>
<div style={{ marginTop: 20, textAlign: 'center' }}>
<Space>
<Button onClick={handleModalVisible}>
取消
</Button>
<Button
type="primary"
onClick={() => handleConfirm(value, 'credit')}
loading={submitLoading}
>
退款
</Button>
</Space>
</div>
</Spin>
)
};
export default Credit; export default Credit;
\ No newline at end of file
...@@ -7,10 +7,11 @@ import { uploadVoucherModalSchema } from './schema'; ...@@ -7,10 +7,11 @@ import { uploadVoucherModalSchema } from './schema';
const uploadVoucherFormActions = createFormActions(); const uploadVoucherFormActions = createFormActions();
interface bankAccount { interface BankAccount {
name: string, name: string,
bankAccount: string, bankAccount: string,
bankDeposit: string, bankDeposit: string,
id: number,
}; };
interface UploadVoucherProps { interface UploadVoucherProps {
...@@ -48,22 +49,23 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({ ...@@ -48,22 +49,23 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
purchaserId, purchaserId,
purchaserRoleId, purchaserRoleId,
}) => { }) => {
const [bankAccount, setBankAccount] = useState<bankAccount>({ const [bankAccount, setBankAccount] = useState<BankAccount>({
name: '', name: '',
bankAccount: '', bankAccount: '',
bankDeposit: '', bankDeposit: '',
id: 0,
}); });
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// 获取对公账户信息 // 获取对公账户信息
const getSettleAccountsCorporateAccountConfig = (memberId: number, memberRoleId: number) => { const getSettleAccountsGetMemberAccountConfig = () => {
if (!memberId || !memberRoleId) { if (!purchaserId || !purchaserRoleId) {
return; return;
} }
setLoading(true); setLoading(true);
PublicApi.getSettleAccountsCorporateAccountConfig({ PublicApi.getSettleAccountsGetMemberAccountConfig({
memberId: `${memberId}`, memberId: `${purchaserId}`,
memberRoleId: `${memberRoleId}`, roleId: `${purchaserRoleId}`,
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setBankAccount(res.data); setBankAccount(res.data);
...@@ -74,11 +76,10 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({ ...@@ -74,11 +76,10 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
}; };
useEffect(() => { useEffect(() => {
getSettleAccountsCorporateAccountConfig(purchaserId, purchaserRoleId); getSettleAccountsGetMemberAccountConfig();
}, []); }, []);
const beforeUploadVoucher = file => { const beforeUploadVoucher = file => {
console.log(file.size)
if (file.size / 1024 > 200) { if (file.size / 1024 > 200) {
message.warning('图片大小超过200K'); message.warning('图片大小超过200K');
return Promise.reject(); return Promise.reject();
...@@ -86,17 +87,17 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({ ...@@ -86,17 +87,17 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
}; };
const handleUploadVoucherSubmit = values => { const handleUploadVoucherSubmit = values => {
const { fileList = [] } = values; const { fileList = [], id, ...rest } = values;
if (handleConfirm) { if (handleConfirm) {
if (!bankAccount || !bankAccount.name) { if (!bankAccount || !bankAccount.id) {
message.error('没有收款账户相关信息,无法退款'); message.error('没有收款账户相关信息,无法退款');
return; return;
} }
handleConfirm({ handleConfirm({
...value, ...value,
payProve: { payProve: {
...values, ...rest,
fileList: fileList.map(item => item.status === 'done' && ({ fileList: fileList.map(item => item.status === 'done' && ({
name: item.name, name: item.name,
proveUrl: item.data.url, proveUrl: item.data.url,
...@@ -110,7 +111,7 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({ ...@@ -110,7 +111,7 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
<Spin spinning={loading}> <Spin spinning={loading}>
<NiceForm <NiceForm
previewPlaceholder="" previewPlaceholder=""
initialValues={bankAccount} value={bankAccount}
effects={($, { setFieldState }) => { effects={($, { setFieldState }) => {
}} }}
......
...@@ -41,6 +41,13 @@ const RefundModal: React.FC<RefundModalProps> = ({ ...@@ -41,6 +41,13 @@ const RefundModal: React.FC<RefundModalProps> = ({
value, value,
submitLoading, submitLoading,
}) => { }) => {
const {
purchaserId,
purchaserRoleId,
supplierId,
supplierRoleId,
...rest
} = value;
const tempMap = { const tempMap = {
uploadVoucher: { uploadVoucher: {
...@@ -49,9 +56,9 @@ const RefundModal: React.FC<RefundModalProps> = ({ ...@@ -49,9 +56,9 @@ const RefundModal: React.FC<RefundModalProps> = ({
render: () => ( render: () => (
<Suspense fallback={null}> <Suspense fallback={null}>
<UploadVoucher <UploadVoucher
value={value} value={rest}
purchaserId={value.purchaserId} purchaserId={purchaserId}
purchaserRoleId={value.purchaserRoleId} purchaserRoleId={purchaserRoleId}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
handleModalVisible={handleModalVisible} handleModalVisible={handleModalVisible}
submitLoading={submitLoading} submitLoading={submitLoading}
...@@ -65,7 +72,9 @@ const RefundModal: React.FC<RefundModalProps> = ({ ...@@ -65,7 +72,9 @@ const RefundModal: React.FC<RefundModalProps> = ({
render: () => ( render: () => (
<Suspense fallback={null}> <Suspense fallback={null}>
<Balance <Balance
value={value} value={rest}
purchaserId={purchaserId}
purchaserRoleId={purchaserRoleId}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
handleModalVisible={handleModalVisible} handleModalVisible={handleModalVisible}
submitLoading={submitLoading} submitLoading={submitLoading}
...@@ -79,7 +88,11 @@ const RefundModal: React.FC<RefundModalProps> = ({ ...@@ -79,7 +88,11 @@ const RefundModal: React.FC<RefundModalProps> = ({
render: () => ( render: () => (
<Suspense fallback={null}> <Suspense fallback={null}>
<Credit <Credit
value={value} value={rest}
purchaserId={purchaserId}
purchaserRoleId={purchaserRoleId}
supplierId={supplierId}
supplierRoleId={supplierRoleId}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
handleModalVisible={handleModalVisible} handleModalVisible={handleModalVisible}
submitLoading={submitLoading} submitLoading={submitLoading}
...@@ -93,7 +106,7 @@ const RefundModal: React.FC<RefundModalProps> = ({ ...@@ -93,7 +106,7 @@ const RefundModal: React.FC<RefundModalProps> = ({
render: () => ( render: () => (
<Suspense fallback={null}> <Suspense fallback={null}>
<COD <COD
value={value} value={rest}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
handleModalVisible={handleModalVisible} handleModalVisible={handleModalVisible}
submitLoading={submitLoading} submitLoading={submitLoading}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-05 18:02:18 * @Date: 2020-11-05 18:02:18
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-28 13:53:00 * @LastEditTime: 2020-12-29 11:00:22
* @Description: 退款明细 * @Description: 退款明细
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -66,6 +66,14 @@ interface ReturnDetailInfoProps { ...@@ -66,6 +66,14 @@ interface ReturnDetailInfoProps {
* 采购商角色id * 采购商角色id
*/ */
purchaserRoleId: number, purchaserRoleId: number,
/**
* 供应商id
*/
supplierId: number,
/**
* 供应商角色id
*/
supplierRoleId: number,
}; };
const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
...@@ -76,6 +84,8 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({ ...@@ -76,6 +84,8 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
innerStatus, innerStatus,
purchaserId, purchaserId,
purchaserRoleId, purchaserRoleId,
supplierId,
supplierRoleId,
}) => { }) => {
const [visibleResult, setVisibleResult] = useState(false); const [visibleResult, setVisibleResult] = useState(false);
const [notReceivedLoading, setNotReceivedLoading] = useState(false); const [notReceivedLoading, setNotReceivedLoading] = useState(false);
...@@ -159,21 +169,37 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({ ...@@ -159,21 +169,37 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
case PAY_CHANNEL_BALANCE: { case PAY_CHANNEL_BALANCE: {
setModalName('balance'); setModalName('balance');
setRefundModalVisible(true); setRefundModalVisible(true);
setRefundModalValue({ id, refundAmount: amount }); setRefundModalValue({
id,
refundAmount: amount,
purchaserId,
purchaserRoleId,
});
break; break;
}; };
// 线下支付 // 线下支付
case PAY_CHANNEL_OFFLINE: { case PAY_CHANNEL_OFFLINE: {
setModalName('uploadVoucher'); setModalName('uploadVoucher');
setRefundModalVisible(true); setRefundModalVisible(true);
setRefundModalValue({ id, purchaserId, purchaserRoleId }); setRefundModalValue({
id,
purchaserId,
purchaserRoleId,
});
break; break;
}; };
// 授信支付 // 授信支付
case PAY_CHANNEL_CREDIT: { case PAY_CHANNEL_CREDIT: {
setModalName('credit'); setModalName('credit');
setRefundModalVisible(true); setRefundModalVisible(true);
setRefundModalValue({ id, refundAmount: amount }); setRefundModalValue({
id,
refundAmount: amount,
purchaserId,
purchaserRoleId,
supplierId,
supplierRoleId,
});
break; break;
}; };
// 货到付款 // 货到付款
......
...@@ -29,6 +29,7 @@ const addSchemaAction = createFormActions(); ...@@ -29,6 +29,7 @@ const addSchemaAction = createFormActions();
const { const {
onFormInputChange$, onFormInputChange$,
onFormInit$, onFormInit$,
onFieldInputChange$,
} = FormEffectHooks; } = FormEffectHooks;
interface BillsFormProps { interface BillsFormProps {
...@@ -528,6 +529,10 @@ const ExchangeForm: React.FC<BillsFormProps> = ({ ...@@ -528,6 +529,10 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
}); });
} }
}); });
onFieldInputChange$('supplierMember').subscribe(() => {
setGoodsValue([]);
});
}} }}
onSubmit={handleSubmit} onSubmit={handleSubmit}
actions={addSchemaAction} actions={addSchemaAction}
......
...@@ -418,6 +418,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -418,6 +418,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
innerStatus={detailInfo?.innerStatus} innerStatus={detailInfo?.innerStatus}
purchaserId={detailInfo?.memberId} purchaserId={detailInfo?.memberId}
purchaserRoleId={detailInfo?.roleId} purchaserRoleId={detailInfo?.roleId}
supplierId={detailInfo?.parentMemberId}
supplierRoleId={detailInfo?.parentMemberRoleId}
isPurchaser isPurchaser
/> />
</Suspense> </Suspense>
...@@ -468,8 +470,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -468,8 +470,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</Col> </Col>
<Col span={24}> <Col span={24}>
{/* 内、外部流转记录 */} {/* 内、外部流转记录 */}
<Suspense fallback={null}> <Suspense fallback={null}>
<FlowRecords <FlowRecords
fetchOuterHistory={fetchOuterHistory} fetchOuterHistory={fetchOuterHistory}
fetchInnerHistory={fetchInnerHistory} fetchInnerHistory={fetchInnerHistory}
......
...@@ -465,6 +465,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -465,6 +465,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
innerStatus={detailInfo?.innerStatus} innerStatus={detailInfo?.innerStatus}
purchaserId={detailInfo?.memberId} purchaserId={detailInfo?.memberId}
purchaserRoleId={detailInfo?.roleId} purchaserRoleId={detailInfo?.roleId}
supplierId={detailInfo?.parentMemberId}
supplierRoleId={detailInfo?.parentMemberRoleId}
/> />
</Suspense> </Suspense>
</Col> </Col>
......
...@@ -66,31 +66,26 @@ export const billsSchema: ISchema = { ...@@ -66,31 +66,26 @@ export const billsSchema: ISchema = {
invoicesType: { invoicesType: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '请选择单据类型', placeholder: '单据类型',
allowClear: true,
}, },
enum: [], enum: [],
}, },
inventory: { inventory: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '请选择对应仓库', placeholder: '对应仓库',
allowClear: true,
}, },
enum: [], enum: [],
}, },
transactionTime: { '[startTransactionTime, endTransactionTime]': {
type: 'string', type: 'string',
'x-component': 'dateSelect',
'x-component-props': { 'x-component-props': {
placeholder: '请选择交易时间', placeholder: '交易时间',
allowClear: true,
}, },
enum: [
{ label: '今天', value: 1 },
{ label: '一周内', value: 2 },
{ label: '一个月内', value: 3 },
{ label: '三个月内', value: 4 },
{ label: '六个月内', value: 5 },
{ label: '一年内', value: 6 },
{ label: '一年前', value: 7 },
],
}, },
submit: { submit: {
'x-component': 'Submit', 'x-component': 'Submit',
......
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