Commit 7763fa05 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 采购订单新建b2b询价报价下单

parent 957577a3
......@@ -143,16 +143,16 @@ export const upperCommodityColumns: ColumnType<any>[] = [
title: '商品名称',
dataIndex: 'name',
key: 'name',
width: 240,
width: 180,
ellipsis: true,
},
{
title: '商品品类',
title: '品类',
dataIndex: ['customerCategory', 'name'],
key: 'customerCategory.name',
},
{
title: '商品品牌',
title: '品牌',
dataIndex: ['brand', 'name'],
key: 'brand.name',
},
......
......@@ -84,9 +84,9 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
if(type === 'p_readyPayOrder') {
reloadPayList(id)
}
if(data.payments.length > 0){
setCurrentPayInfoId(data.payments[0].paymentId)
}
// if(data.payments.length > 0){
// setCurrentPayInfoId(data.payments[0].paymentId)
// }
} else {
message.error(msg)
}
......
......@@ -211,9 +211,9 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
// 开始提交线下支付数据
if(current === 1) {
const payOrderUrls = formRef.current.urlList
const vouchers = formRef.current.urlList
const checkedId = checked.id
if (!payOrderUrls || payOrderUrls.length === 0 || payOrderUrls.includes('')) {
if (!vouchers || vouchers.length === 0 || vouchers.includes('')) {
message.error('请先上传凭证')
return;
}
......@@ -267,7 +267,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
const handleSubmitPay = async () => {
const payOrderUrls = formRef.current.urlList
const vouchers = formRef.current.urlList
// 当前选中的支付信息
let payInfoObj = data.payments.filter(item => item.paymentId === Number(currentPayInfoId))[0]
let params: any = {
......@@ -283,8 +283,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
params.payPassword = encryptedByAES(code)
} else if(current === 1) {
// params.payOrderUrls = payOrderUrls.join(',')
params.payOrderUrls = payOrderUrls
params.vouchers = vouchers
}
if(!settleAccountsError) {
......
......@@ -27,18 +27,14 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
useEffect(() => {
// 过滤支付信息 取第一个待支付或者未到账的id
if(data?.payments?.length) {
let payments = data.payments.filter(item => item.showPayment)
let payments = data.payments.sort((a, b) => a.batchNo - b.batchNo).filter(item => item.showPayment)
console.log(data.payments.sort((a, b) => a.batchNo - b.batchNo), payments, 'lo')
if(payments.length) {
ctl.setPayId(payments[0].paymentId)
}
}
}, [])
const onChange = (activeKey) => {
// ctl.setPayId(activeKey)
}
const TabHeader = ({dataSource}) => {
return <Row justify='space-between' style={{minWidth: 216}}>
<Col>
......@@ -58,35 +54,43 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
</Col>
<Col>
<StatusColors status={dataSource.outerStatus} text={dataSource.outerStatusName} type='payOut'/>
{ dataSource.externalState === PayOutWorkState.CONFIRM_ACCOUNT && dataSource.payChannel === 5 && dataSource.payWay === 2 &&
<p className={style.look} onClick={()=>setVisible(true)}>查看 &gt;</p>
}
{ dataSource.vouchers.length ? <p className={style.look} onClick={()=>setVisible(true)}>查看 &gt;</p> : null}
</Col>
</Row>
}
const urlsDatas = data.payments.filter(item => item['payChannel'] === 5 && item['payWay'] === 2).map(_item => _item['voucher']).filter(__item => __item.length)
// const canCtlData = data.payments.find(v => v.showView) || {} //@todo 需后端提供showView字段支持
const canCtlData = data.payments.find(v => v.vouchers.length) || {}
const urlsDatas = canCtlData.vouchers || []
return (
<>
<Row gutter={24} style={{marginTop: 24}}>
<Col span={processEnum === 24 ? 12 : 24}>
<MellowCard bordered={false} fullHeight>
<Tabs defaultActiveKey='1' onChange={onChange}>
{ data.payments && data.payments.map(v => <TabPane key={v.paymentId} tab={<TabHeader dataSource={v}/>}>
<Row>
<Col className={style.fontGray} span={4}>支付环节: </Col>
<Col>{v.payNode}</Col>
</Row>
<Row>
<Col className={style.fontGray} span={4}>支付方式: </Col>
<Col>{v.payTypeName}</Col>
</Row>
<Row>
<Col className={style.fontGray} span={4}>支付渠道: </Col>
<Col>{v.payChannelName}</Col>
</Row>
</TabPane>) }
<Tabs defaultActiveKey='1'>
{
data.payments.length
?
data.payments.map(v => <TabPane key={v.paymentId} tab={<TabHeader dataSource={v}/>}>
<Row>
<Col className={style.fontGray} span={4}>支付环节: </Col>
<Col>{v.payNode}</Col>
</Row>
<Row>
<Col className={style.fontGray} span={4}>支付方式: </Col>
<Col>{v.payTypeName}</Col>
</Row>
<Row>
<Col className={style.fontGray} span={4}>支付渠道: </Col>
<Col>{v.payChannelName}</Col>
</Row>
</TabPane>)
:
null
}
</Tabs>
</MellowCard>
</Col>
......
......@@ -66,13 +66,16 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
visible={visible}
confirm={handleConfirm}
cancel={() => setVisible(false)}
fetchTableData={async (params) => (await PublicApi.getTransactionNotarizeEnquiryProductQuotationList({...params, externalState: 4}, {useCache: true, ttl: 10 * 1000})).data}
fetchTableData={async (params) => (await PublicApi.getTransactionNotarizeEnquiryProductQuotationList({...params, externalState: 4, shopId: schemaAction.getFieldValue('shopId')})).data}
rowSelection={rowSelection}
modalType='inquiryByDefault'
searchName="quotationNo"
tableProps={{
rowKey: 'id'
}}
resetModal={{
destroyOnClose: true
}}
{...restProps}
/>
)
......
......@@ -38,15 +38,12 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
const getPayLists = (memberId, memberRoleId) => {
const shopId = ctx.getFieldValue('shopId')
const products = ctx.getFieldValue('products').map(item => ({ productId: item.commodityId, skuId: item.productId }))
if(shopId && products?.lenght)
PublicApi.postOrderBuyerCreateB2bPaymentFind({
memberId,
roleId: memberRoleId,
shopId: shopId,
shopId: ctx.getFieldValue('shopId'),
orderMode: ctx.getFieldValue('orderMode'),
products: products
products: orderProducts.map(item => ({ productId: item.commodityId, skuId: item.productId }))
}, { ctlType: 'none' }).then(res => {
const { code, data } = res
if (code === 1000) {
......
......@@ -25,12 +25,14 @@ const ReadyConfirmContract: React.FC = () => {
// }
}
}
console.log(currentPayInfoId)
}, [data, currentPayInfoId])
const renderPayPrice = () => {
if(data){
if(data.payments.length > 0){
let obj = data.payments.filter(item => item.paymentId === Number(currentPayInfoId))[0]
console.log(obj, 'obj')
if(obj)
return obj.payAmount
}
......
......@@ -18,7 +18,6 @@ import DataSet from "@antv/data-set";
const CircleChart = props => {
const { sumPrice = 100, alreadyPay = 10 } = props
const { DataView } = DataSet;
const dv = new DataView();
const userData = [
{ type: '总金额', value: sumPrice - alreadyPay },
......
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