Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
d1689dec
Commit
d1689dec
authored
Jan 07, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 订单列表 跳转售后相关逻辑
parent
bccb17f8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
252 additions
and
61 deletions
+252
-61
index.tsx
src/pages/afterService/components/GoodsDrawer/index.tsx
+40
-37
index.less
...ages/afterService/components/RepairAddressInfo/index.less
+0
-1
addExchange.tsx
...vice/exchangeApplication/exchangePrSubmit/addExchange.tsx
+4
-1
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+71
-15
addRepair.tsx
...terService/repairApplication/repairPrSubmit/addRepair.tsx
+4
-1
index.tsx
...pplication/repairPrSubmit/components/RepairForm/index.tsx
+64
-1
index.tsx
...rService/returnApplication/returnPrAddLogistics/index.tsx
+1
-1
addReturn.tsx
...terService/returnApplication/returnPrSubmit/addReturn.tsx
+4
-1
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+64
-3
No files found.
src/pages/afterService/components/GoodsDrawer/index.tsx
View file @
d1689dec
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-31 14:29:36
* @LastEditTime: 202
1-01-07 16:57:04
* @Description: 维修商品抽屉组件
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
...
@@ -43,6 +43,10 @@ interface GoodsDrawerProps {
nestProps
?:
{
[
key
:
string
]:
any
,
};
/**
* 是否展示检索框
*/
searchable
?:
boolean
;
/**
* 流程类型:1.订单交易流程 2.售后换货流程 3.售后退货流程 4.售后维修流程
...
...
@@ -54,11 +58,11 @@ interface GoodsDrawerState {
page
:
number
;
size
:
number
;
searchVal
:
{
orderNo
:
string
,
orderThe
:
string
,
startCreateTime
:
string
,
endCreateTime
:
string
,
type
:
string
,
orderNo
?
:
string
,
orderThe
?
:
string
,
startCreateTime
?
:
string
,
endCreateTime
?
:
string
,
type
?
:
string
,
},
dataSource
:
OrderListRes
;
selectedRowKeys
:
number
[];
...
...
@@ -117,13 +121,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
this
.
state
=
{
page
:
1
,
size
:
PAGE_SIZE
,
searchVal
:
{
orderNo
:
''
,
orderThe
:
''
,
startCreateTime
:
undefined
,
endCreateTime
:
undefined
,
type
:
undefined
,
},
searchVal
:
{},
dataSource
:
{
totalCount
:
0
,
data
:
[],
...
...
@@ -565,6 +563,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
title
=
'选择维修商品'
,
visible
=
false
,
nestProps
=
{},
searchable
=
false
,
}
=
this
.
props
;
return
(
...
...
@@ -591,21 +590,23 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
destroyOnClose
>
<
div
className=
{
styles
.
order
}
>
<
div
className=
{
styles
[
'order-head'
]
}
>
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
this
.
handleSearch
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'orderNo'
,
FORM_FILTER_PATH
,
);
}
}
schema=
{
listSearchSchema
}
/>
</
div
>
{
searchable
&&
(
<
div
className=
{
styles
[
'order-head'
]
}
>
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
this
.
handleSearch
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'orderNo'
,
FORM_FILTER_PATH
,
);
}
}
schema=
{
listSearchSchema
}
/>
</
div
>
)
}
<
div
className=
{
styles
[
'order-body'
]
}
>
<
NestTable
...
...
@@ -630,15 +631,17 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
/>
</
div
>
<
div
className=
{
styles
[
'order-foot'
]
}
>
<
Pagination
current=
{
page
}
pageSize=
{
size
}
total=
{
dataSource
.
totalCount
}
onChange=
{
this
.
handlePaginationChange
}
showQuickJumper
/>
</
div
>
{
searchable
&&
(
<
div
className=
{
styles
[
'order-foot'
]
}
>
<
Pagination
current=
{
page
}
pageSize=
{
size
}
total=
{
dataSource
.
totalCount
}
onChange=
{
this
.
handlePaginationChange
}
showQuickJumper
/>
</
div
>
)
}
</
div
>
</
Drawer
>
);
...
...
src/pages/afterService/components/RepairAddressInfo/index.less
View file @
d1689dec
.desc {
:global {
.ant-descriptions-item-label {
min-width: 176px;
color: #909399;
}
}
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/addExchange.tsx
View file @
d1689dec
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
ExchangeForm
from
'./components/ExchangeForm'
;
const
AddExchange
:
React
.
FC
=
()
=>
{
const
{
orderId
}
=
usePageStatus
();
return
(
<
ExchangeForm
isEdit
/>
<
ExchangeForm
orderId=
{
orderId
}
isEdit
/>
);
};
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
d1689dec
...
...
@@ -10,7 +10,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetAsReplaceGoodsPageReturnedGoodsResponse
}
from
'@/services/AfterServiceApi'
;
import
{
GetAsReplaceGoodsPageReturnedGoodsResponse
Detail
}
from
'@/services/AfterServiceApi'
;
import
{
normalizeFiledata
,
FileData
,
isJSONStr
}
from
'@/utils'
;
import
{
PurchaseOrderOutWorkStateTexts
,
ORDER_TYPE2
}
from
'@/constants'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
...
...
@@ -37,6 +37,10 @@ interface BillsFormProps {
id
?:
string
;
// 是否是编辑的
isEdit
?:
boolean
;
/**
* 订单id,从订单列表跳转过来的
*/
orderId
?:
number
,
};
interface
DetailInfo
{
...
...
@@ -51,16 +55,21 @@ interface DetailInfo {
innerStatus
?:
number
,
innerStatusName
?:
string
,
deliveryType
?:
number
,
replaceGoodsList
?:
GetAsReplaceGoodsPageReturnedGoodsResponseDetail
[],
/**
* 订单编号
*/
orderNo
?:
string
,
}
const
ExchangeForm
:
React
.
FC
<
BillsFormProps
>
=
({
id
,
isEdit
=
false
,
orderId
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
});
const
[
replaceGoodsList
,
setReplaceGoodsList
]
=
useState
<
GetAsReplaceGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
goodsValue
,
setGoodsValue
]
=
useState
([]);
...
...
@@ -158,6 +167,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderOneBatchOrderList
({
orderNo
:
detailInfo
.
orderNo
,
...
params
,
supplyMembersId
:
supplierMemberValue
[
0
].
memberId
,
supplyMembersRoleId
:
supplierMemberValue
[
0
].
roleId
,
...
...
@@ -172,7 +182,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
});
};
// 获取
维修
申请详情
// 获取
换货
申请详情
const
getDetailInfo
=
()
=>
{
if
(
!
id
)
{
return
;
...
...
@@ -245,11 +255,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
]
:
[]
,
...
rest
,
});
setReplaceGoodsList
({
data
:
goodsDetailList
.
map
(
item
=>
({
replaceGoodsList
:
goodsDetailList
.
map
(
item
=>
({
...
item
,
extraData
:
{
remaining
:
item
.
purchaseCount
||
0
,
// 已换货数量,这里取 采购数量判断即可
...
...
@@ -257,7 +263,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
taskType
,
},
})),
totalCount
:
goodsDetailList
.
length
,
...
rest
,
});
setGoodsValue
(
goodsDetailList
.
map
(
item
=>
item
.
orderRecordId
));
}
...
...
@@ -266,8 +272,56 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
});
};
// 获取订单详情
const
getOrderDetailInfo
=
()
=>
{
if
(
!
orderId
)
{
return
;
}
setInfoLoading
(
true
);
PublicApi
.
getOrderProcurementOrderDetails
({
id
:
`
${
orderId
}
`
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
supplyMembersName
,
supplyMembersId
,
supplyMembersRoleId
,
orderNo
,
}
=
res
.
data
;
addSchemaAction
.
setFieldState
(
'*(supplierMember)'
,
state
=>
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
}
);
setDetailInfo
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
supplierMember
:
supplyMembersName
?
[
{
name
:
supplyMembersName
,
memberId
:
supplyMembersId
,
roleId
:
supplyMembersRoleId
,
},
]
:
[]
,
orderNo
,
});
}
})
.
finally
(()
=>
{
setInfoLoading
(
false
);
});
};
useEffect
(()
=>
{
getDetailInfo
();
getOrderDetailInfo
();
},
[]);
const
handleAddGoods
=
()
=>
{
...
...
@@ -308,6 +362,8 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
innerStatusName
,
applyNo
,
applyTime
,
orderNo
,
...
rest
}
=
value
;
...
...
@@ -449,8 +505,10 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
value
.
push
(
atom
);
});
const
concated
=
[...
value
,
...
preValues
];
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
).
reverse
();
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
);
if
(
preValues
.
length
)
{
newData
.
reverse
();
}
addSchemaAction
.
setFieldValue
(
'replaceGoodsList'
,
newData
);
};
...
...
@@ -499,10 +557,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
>
<
Card
>
<
NiceForm
value=
{
{
...
detailInfo
,
replaceGoodsList
:
replaceGoodsList
.
data
,
}
}
value=
{
detailInfo
}
previewPlaceholder=
" "
expressionScope=
{
{
TableAddButton
,
...
...
@@ -556,6 +611,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
nestProps=
{
{
NestColumns
:
[
tableColumn
,
childTableColumn
],
}
}
searchable=
{
!
orderId
}
/>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
...
...
src/pages/afterService/repairApplication/repairPrSubmit/addRepair.tsx
View file @
d1689dec
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
RepairForm
from
'./components/RepairForm'
;
const
AddRepair
:
React
.
FC
=
()
=>
{
const
{
orderId
}
=
usePageStatus
();
return
(
<
RepairForm
isEdit
/>
<
RepairForm
orderId=
{
orderId
}
isEdit
/>
);
};
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/index.tsx
View file @
d1689dec
...
...
@@ -39,17 +39,26 @@ interface DetailInfo {
outerStatusName
?:
string
,
innerStatus
?:
number
,
innerStatusName
?:
string
,
/**
* 订单编号
*/
orderNo
?:
string
,
}
interface
BillsFormProps
{
id
?:
string
;
// 是否是编辑的
isEdit
?:
boolean
;
/**
* 订单id,从订单列表跳转过来的
*/
orderId
?:
number
,
};
const
RepairForm
:
React
.
FC
<
BillsFormProps
>
=
({
id
,
isEdit
=
false
,
orderId
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
...
...
@@ -111,6 +120,53 @@ const RepairForm: React.FC<BillsFormProps> = ({
});
};
// 获取订单详情
const
getOrderDetailInfo
=
()
=>
{
if
(
!
orderId
)
{
return
;
}
setInfoLoading
(
true
);
PublicApi
.
getOrderProcurementOrderDetails
({
id
:
`
${
orderId
}
`
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
supplyMembersName
,
supplyMembersId
,
supplyMembersRoleId
,
orderNo
,
}
=
res
.
data
;
addSchemaAction
.
setFieldState
(
'*(supplierMember)'
,
state
=>
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
}
);
setDetailInfo
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
supplierMember
:
supplyMembersName
?
[
{
name
:
supplyMembersName
,
memberId
:
supplyMembersId
,
roleId
:
supplyMembersRoleId
,
},
]
:
[]
,
orderNo
,
});
}
})
.
finally
(()
=>
{
setInfoLoading
(
false
);
});
};
// 获取维修明细列表
const
getRepairGoods
=
()
=>
{
if
(
!
id
)
{
...
...
@@ -148,6 +204,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderOneBatchOrderList
({
orderNo
:
detailInfo
.
orderNo
,
...
params
,
supplyMembersId
:
supplierMemberValue
[
0
].
memberId
,
supplyMembersRoleId
:
supplierMemberValue
[
0
].
roleId
,
...
...
@@ -164,6 +221,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
useEffect
(()
=>
{
getDetailInfo
();
getOrderDetailInfo
();
getRepairGoods
();
},
[]);
...
...
@@ -195,6 +253,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
faultFileList
=
[],
repairGoodsList
,
repairAddress
,
orderNo
,
...
rest
}
=
values
;
...
...
@@ -292,7 +351,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
value
.
push
(
atom
);
});
const
concated
=
[...
value
,
...
preValues
];
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
).
reverse
();
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
);
if
(
preValues
.
length
)
{
newData
.
reverse
();
}
addSchemaAction
.
setFieldValue
(
'repairGoodsList'
,
newData
);
};
...
...
@@ -390,6 +452,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
onConfirm=
{
handleGoodsConfirm
}
checked=
{
goodsValue
}
onChange=
{
handleGoodsChange
}
searchable=
{
!
orderId
}
/>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
...
...
src/pages/afterService/returnApplication/returnPrAddLogistics/index.tsx
View file @
d1689dec
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-07 1
1:12:29
* @LastEditTime: 2021-01-07 1
6:12:25
* @Description: 待新增退货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
src/pages/afterService/returnApplication/returnPrSubmit/addReturn.tsx
View file @
d1689dec
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
ReturnForm
from
'./components/ReturnForm'
;
const
AddReturn
:
React
.
FC
=
()
=>
{
const
{
orderId
}
=
usePageStatus
();
return
(
<
ReturnForm
isEdit
/>
<
ReturnForm
orderId=
{
orderId
}
isEdit
/>
);
};
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
d1689dec
...
...
@@ -37,6 +37,10 @@ interface BillsFormProps {
id
?:
string
;
// 是否是编辑的
isEdit
?:
boolean
;
/**
* 订单id,从订单列表跳转过来的
*/
orderId
?:
number
,
};
interface
DetailInfo
{
...
...
@@ -51,11 +55,16 @@ interface DetailInfo {
innerStatus
?:
number
,
innerStatusName
?:
string
,
deliveryType
?:
number
,
/**
* 订单编号
*/
orderNo
?:
string
,
}
const
ReturnForm
:
React
.
FC
<
BillsFormProps
>
=
({
id
,
isEdit
=
false
,
orderId
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
...
...
@@ -165,6 +174,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderOneBatchOrderList
({
orderNo
:
detailInfo
.
orderNo
,
...
params
,
supplyMembersId
:
supplierMemberValue
[
0
].
memberId
,
supplyMembersRoleId
:
supplierMemberValue
[
0
].
roleId
,
...
...
@@ -179,7 +189,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
});
};
// 获取
维修
申请详情
// 获取
退货
申请详情
const
getDetailInfo
=
()
=>
{
if
(
!
id
)
{
return
;
...
...
@@ -270,8 +280,56 @@ const ReturnForm: React.FC<BillsFormProps> = ({
});
};
// 获取订单详情
const
getOrderDetailInfo
=
()
=>
{
if
(
!
orderId
)
{
return
;
}
setInfoLoading
(
true
);
PublicApi
.
getOrderProcurementOrderDetails
({
id
:
`
${
orderId
}
`
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
supplyMembersName
,
supplyMembersId
,
supplyMembersRoleId
,
orderNo
,
}
=
res
.
data
;
addSchemaAction
.
setFieldState
(
'*(supplierMember)'
,
state
=>
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
}
);
setDetailInfo
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
supplierMember
:
supplyMembersName
?
[
{
name
:
supplyMembersName
,
memberId
:
supplyMembersId
,
roleId
:
supplyMembersRoleId
,
},
]
:
[]
,
orderNo
,
});
}
})
.
finally
(()
=>
{
setInfoLoading
(
false
);
});
};
useEffect
(()
=>
{
getDetailInfo
();
getOrderDetailInfo
();
},
[]);
const
handleAddGoods
=
()
=>
{
...
...
@@ -477,8 +535,10 @@ const ReturnForm: React.FC<BillsFormProps> = ({
value
.
push
(
atom
);
});
const
concated
=
[...
value
,
...
preValues
];
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
).
reverse
();
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
);
if
(
preValues
.
length
)
{
newData
.
reverse
();
}
addSchemaAction
.
setFieldValue
(
'returnGoodsList'
,
newData
);
};
...
...
@@ -614,6 +674,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
nestProps=
{
{
NestColumns
:
[
tableColumn
,
childTableColumn
],
}
}
searchable=
{
!
orderId
}
/>
<
ReturnInfoDrawer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment