Commit 69b178a2 authored by 卢均锐's avatar 卢均锐

feat: 开票管理-订单号点击跳转

-销售订单详情兼容订单号查询
parent cc8cf398
...@@ -190,7 +190,7 @@ const SettlementList: React.FC = () => { ...@@ -190,7 +190,7 @@ const SettlementList: React.FC = () => {
break; break;
case 3: case 3:
case 4: case 4:
window.open(`/memberCenter/tranactionAbility/saleOrder/orderList/preview?id=${record.dataId}`) window.open(`/memberCenter/tranactionAbility/saleOrder/orderList/preview?orderNo=${record.orderNo}`)
break; break;
case 5: case 5:
window.open(`/memberCenter/afterService/returnManage/returnQuery/detail?id=${record.dataId}`) window.open(`/memberCenter/afterService/returnManage/returnQuery/detail?id=${record.dataId}`)
......
...@@ -7,7 +7,7 @@ import StatusColors from '../../../components/statusColors' ...@@ -7,7 +7,7 @@ import StatusColors from '../../../components/statusColors'
import { message } from 'antd' import { message } from 'antd'
import { history } from 'umi' import { history } from 'umi'
import { OrderKindType } from '@/constants/order' import { OrderKindType } from '@/constants/order'
import { getOrderBuyerDetail, getOrderBuyerValidatePayDetail, getOrderBuyerValidatePayType, getOrderBuyerValidateReceiveDetail, getOrderVendorDetail, getOrderVendorValidateDeliveryDetail, getOrderVendorValidatePayConfirmDetail } from '@/services/OrderNewV2Api' import { getOrderBuyerDetail, getOrderBuyerValidatePayDetail, getOrderBuyerValidatePayType, getOrderBuyerValidateReceiveDetail, getOrderVendorDetail, getOrderVendorValidateDeliveryDetail, getOrderVendorValidatePayConfirmDetail, getOrderCommonSettleOrderDetail } from '@/services/OrderNewV2Api'
interface OrderDetailHookProps { interface OrderDetailHookProps {
/** 采购、销售、待收货、待确认发货、待支付、待确认支付 */ /** 采购、销售、待收货、待确认发货、待支付、待确认支付 */
...@@ -27,18 +27,19 @@ export const useOrderDetail = (options: OrderDetailHookProps) => { ...@@ -27,18 +27,19 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
const { orderNo } = history.location.query const { orderNo } = history.location.query
const { type } = options const { type } = options
const dataRef = useRef<any>([ const dataRef = useRef<any>([
{ label: intl.formatMessage({id: 'purchaseOrder.orderCollect.schema.quoteNo'}), name: 'quoteNo', span: 8, render: (text, record) => <Link {
to={ label: intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.quoteNo' }), name: 'quoteNo', span: 8, render: (text, record) => <Link
type[0] === 's' to={
? type[0] === 's'
(record.orderKind === OrderKindType.REQUISITION_ORDER ? null : `/memberCenter/tranactionAbility/inquiryOffer/offerSearch/offer/preview?id=${record?.quoteId}`) ?
: (record.orderKind === OrderKindType.REQUISITION_ORDER ? null : `/memberCenter/tranactionAbility/inquiryOffer/offerSearch/offer/preview?id=${record?.quoteId}`)
(record.orderKind === OrderKindType.REQUISITION_ORDER ? `/memberCenter/procurementAbility/purchaseRequisition/purchaseRequisitionList/preview?id=${record?.quoteId}` : `/memberCenter/tranactionAbility/confirmOffer/offerSearch/offer/preview?id=${record?.quoteId}`) :
}> (record.orderKind === OrderKindType.REQUISITION_ORDER ? `/memberCenter/procurementAbility/purchaseRequisition/purchaseRequisitionList/preview?id=${record?.quoteId}` : `/memberCenter/tranactionAbility/confirmOffer/offerSearch/offer/preview?id=${record?.quoteId}`)
}>
{text} {text}
</Link> </Link>
}, },
{ label: intl.formatMessage({id: 'purchaseRequisition.dingdanzhaiyao'}), name: 'digest', span: 8 }, { label: intl.formatMessage({ id: 'purchaseRequisition.dingdanzhaiyao' }), name: 'digest', span: 8 },
{ label: type[0] === 's' ? intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.buyerMemberMajorId' }) : intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.vendorMemberName' }), name: type[0] === 's' ? 'buyerMemberName' : 'vendorMemberName', span: 8 }, { label: type[0] === 's' ? intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.buyerMemberMajorId' }) : intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.vendorMemberName' }), name: type[0] === 's' ? 'buyerMemberName' : 'vendorMemberName', span: 8 },
{ label: intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.orderMode' }), name: 'orderModeName', span: 8 }, { label: intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.orderMode' }), name: 'orderModeName', span: 8 },
{ label: intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.type' }), name: 'orderTypeName', span: 8 }, { label: intl.formatMessage({ id: 'purchaseOrder.orderCollect.schema.type' }), name: 'orderTypeName', span: 8 },
...@@ -71,15 +72,15 @@ export const useOrderDetail = (options: OrderDetailHookProps) => { ...@@ -71,15 +72,15 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
let api = null; let api = null;
switch (type) { switch (type) {
case 'purchaseOrder': api = getOrderBuyerDetail; case 'purchaseOrder': api = getOrderBuyerDetail;
break; break;
case 'saleOrder': api = getOrderVendorDetail; case 'saleOrder': api = orderNo ? getOrderCommonSettleOrderDetail : getOrderVendorDetail;
break; break;
case 'p_readyReceiveOrder': api = getOrderBuyerValidateReceiveDetail; case 'p_readyReceiveOrder': api = getOrderBuyerValidateReceiveDetail;
break; break;
case 's_readyConfirmDelevedOrder': api = getOrderVendorValidateDeliveryDetail; case 's_readyConfirmDelevedOrder': api = getOrderVendorValidateDeliveryDetail;
break; break;
case 'p_readyPayOrder': api = getOrderBuyerValidatePayDetail; case 'p_readyPayOrder': api = getOrderBuyerValidatePayDetail;
break; break;
case 's_readyPayResult': api = getOrderVendorValidatePayConfirmDetail; case 's_readyPayResult': api = getOrderVendorValidatePayConfirmDetail;
default: default:
api = getOrderBuyerDetail; api = getOrderBuyerDetail;
...@@ -91,15 +92,15 @@ export const useOrderDetail = (options: OrderDetailHookProps) => { ...@@ -91,15 +92,15 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
if (id || orderNo) { if (id || orderNo) {
const fn = getDetailsApi(type) const fn = getDetailsApi(type)
// @ts-ignore // @ts-ignore
fn( id ? { orderId: id } : { orderNo }, { ctlType: "none" }).then(res => { fn(id ? { orderId: id } : { orderNo }, { ctlType: "none" }).then(res => {
const { code, data, message: msg } = res const { code, data, message: msg } = res
if (code === 1000) { if (code === 1000) {
setFormData(data) setFormData(data)
// 待支付订单获取所有支付方式 // 待支付订单获取所有支付方式
if(type === 'p_readyPayOrder') { if (type === 'p_readyPayOrder') {
reloadPayList(id) reloadPayList(id)
} }
if(data.payments.length > 0){ if (data.payments.length > 0) {
// 过滤出未支付的 第一个 // 过滤出未支付的 第一个
const payObj = data.payments.filter(item => item.showPayment)[0] const payObj = data.payments.filter(item => item.showPayment)[0]
setCurrentPayInfoId(payObj?.paymentId ? payObj.paymentId : data.payments[0].paymentId) setCurrentPayInfoId(payObj?.paymentId ? payObj.paymentId : data.payments[0].paymentId)
...@@ -110,7 +111,7 @@ export const useOrderDetail = (options: OrderDetailHookProps) => { ...@@ -110,7 +111,7 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
}, [id]) }, [id])
const reloadPayList = (orderId) => { const reloadPayList = (orderId) => {
getOrderBuyerValidatePayType({orderId}).then(res => { getOrderBuyerValidatePayType({ orderId }).then(res => {
const { code, data } = res const { code, data } = res
if (code === 1000) { if (code === 1000) {
setPaylist(data) setPaylist(data)
......
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