Commit afccbde8 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

fix: 修改质检单B2B详情查看售后单跳转

parent 5a6dde76
......@@ -278,6 +278,9 @@ const QualityManageDetail = (props) => {
dataIndex: 'afterSalesNo',
width: 96,
ellipsis: true,
render: (_text, record) => <>
{(dataSource?.type === TYPE.B2B && record?.afterSalesStatus === SUCESS && record?.afterSalesId) ? <Button style={{ padding: 0 }} type='link' onClick={() => handleCheckAfter(record)}>{_text}</Button> : _text}
</>
}
] : []),
{
......@@ -288,7 +291,7 @@ const QualityManageDetail = (props) => {
width: dataSource?.type === TYPE.B2B ? 180 : 160,
render: (_text, record) => <>
<Button type='link' onClick={() => handledetection(record)}>{intl.formatMessage({ id: 'quality.jianyanjilu', defaultMessage: '检验记录' })}</Button>
{(dataSource?.type === TYPE.B2B && record?.afterSalesStatus === SUCESS && record?.afterSalesId) && <Button type='link' onClick={() => handleCheckAfter(record)}>{intl.formatMessage({ id: 'quality.zhakanshouhoudan', defaultMessage: '查看售后单' })}</Button>}
{(PATH === 'detail' && (dataSource?.type === TYPE.B2B && record?.afterSalesStatus === SUCESS && record?.afterSalesId)) && <Button type='link' onClick={() => handleCheckAfter(record)}>{intl.formatMessage({ id: 'quality.zhakanshouhoudan', defaultMessage: '查看售后单' })}</Button>}
{(PATH === 'detail' && showAfterBtn(record)) && <>
<Button type='link' onClick={() => handleGenerateSale(false, record)}>{intl.formatMessage({ id: 'quality.shengchengshouhoudan', defaultMessage: '生成售后单' })}</Button>
</>}
......
......@@ -18,6 +18,18 @@ enum TYPE {
SRM
}
enum AFTER_SALE_TYPE {
/** 换货 */
EXCHANGE = 1,
/** 退货 */
RETURN,
/** 维修 */
MAINTAIN
}
/** 已生成 */
const SUCESS = 2;
const QualitySynergyDetail = (props) => {
const {
query: {
......@@ -78,6 +90,21 @@ const QualitySynergyDetail = (props) => {
setVisible(bool)
}
/** 查看售后单 */
const handleCheckAfter = (record) => {
switch (record?.afterSaleType) {
case AFTER_SALE_TYPE.EXCHANGE:
history.push(`/memberCenter/afterService/exchangeApplication/exchangeQuery/detail?id=${record?.afterSalesId}`)
break;
case AFTER_SALE_TYPE.RETURN:
history.push(`/memberCenter/afterService/returnApplication/returnQuery/detail?id=${record?.afterSalesId}`)
break;
case AFTER_SALE_TYPE.MAINTAIN:
history.push(`/memberCenter/afterService/repairApplication/repairQuery/detail?id=${record?.afterSalesId}`)
break;
}
}
/** 质检物料/商品表头 */
const columns: ColumnType<any>[] = [
...((dataSource?.type === TYPE.SRM) ? [
......@@ -216,6 +243,9 @@ const QualitySynergyDetail = (props) => {
dataIndex: 'afterSalesNo',
width: 96,
ellipsis: true,
render: (_text, record) => <>
{(dataSource?.type === TYPE.B2B && record?.afterSalesStatus === SUCESS && record?.afterSalesId) ? <Button style={{ padding: 0 }} type='link' onClick={() => handleCheckAfter(record)}>{_text}</Button> : _text}
</>
}
] : []),
{
......
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