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
f56395f6
Commit
f56395f6
authored
Aug 20, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增换货发货单相关
parent
c9d0425a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
194 additions
and
9 deletions
+194
-9
exchangeManageRoute.ts
config/routes/afterServiceRoute/exchangeManageRoute.ts
+16
-0
menu.ts
src/locales/zh-CN/menu.ts
+2
-0
addDeliverBill.tsx
...ce/exchangeManage/exchangePrAddDeliver/addDeliverBill.tsx
+107
-0
deliverBillDetail.tsx
...exchangeManage/exchangePrAddDeliver/deliverBillDetail.tsx
+65
-0
index.tsx
...fterService/exchangeManage/exchangePrAddDeliver/index.tsx
+4
-9
No files found.
config/routes/afterServiceRoute/exchangeManageRoute.ts
View file @
f56395f6
...
...
@@ -236,6 +236,22 @@ const route: RouterChild = {
hideInMenu
:
true
,
noMargin
:
true
,
},
// 待新增退货发货单-新增
{
path
:
'/memberCenter/afterService/exchangeManage/exchangePrAddDeliver/add'
,
name
:
'exchangeAddDeliverBill'
,
component
:
'@/pages/afterService/exchangeManage/exchangePrAddDeliver/addDeliverBill'
,
hideInMenu
:
true
,
noMargin
:
true
,
},
// 待新增退货发货单-退货发货单详情
{
path
:
'/memberCenter/afterService/exchangeManage/exchangePrAddDeliver/deliverDetail'
,
name
:
'exchangeDeliverBillDetail'
,
component
:
'@/pages/afterService/exchangeManage/exchangePrAddDeliver/deliverBillDetail'
,
hideInMenu
:
true
,
noMargin
:
true
,
},
// 待新增换货发货单-订单详情
{
path
:
'/memberCenter/afterService/exchangeManage/exchangePrAddDeliver/orderDetail'
,
...
...
src/locales/zh-CN/menu.ts
View file @
f56395f6
...
...
@@ -580,6 +580,8 @@ export default {
'menu.afterService.exchangeManage.exchangePrReceived'
:
'待退货收货'
,
'menu.afterService.exchangeManage.verifyExchangePrReceived'
:
'退货收货'
,
'menu.afterService.exchangeManage.exchangePrAddDeliver'
:
'待新增换货发货单'
,
'menu.afterService.exchangeManage.exchangeAddDeliverBill'
:
'新增换货发货单'
,
'menu.afterService.exchangeManage.exchangeDeliverBillDetail'
:
'查看换货发货单'
,
'menu.afterService.exchangeManage.exchangePrAddLogistics'
:
'待新增物流单'
,
'menu.afterService.exchangeManage.exchangePrDeliver'
:
'待换货发货'
,
'menu.afterService.exchangeManage.verifyExchangePrDeliver'
:
'换货发货'
,
...
...
src/pages/afterService/exchangeManage/exchangePrAddDeliver/addDeliverBill.tsx
0 → 100644
View file @
f56395f6
/*
* @Author: XieZhiXiong
* @Date: 2021-08-20 15:14:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 15:20:22
* @Description: 新增换货发货单
*/
import
React
,
{
useState
}
from
'react'
;
import
{
FormEffectHooks
}
from
'@formily/antd'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
moment
from
'moment'
;
import
{
DOC_TYPE_EXCHANGE_INVOICE
}
from
'@/constants/commodity'
;
import
BillsFormPage
,
{
RelatedInfoDataType
,
BillSubmitValuesType
}
from
'@/pages/transaction/stockSellStorage/bills/components/BillsFormPage'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
{
onFormInputChange$
,
}
=
FormEffectHooks
;
const
ExchangeAddDeliverBill
=
()
=>
{
const
{
applyId
}
=
usePageStatus
();
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
fetchRelatedInfo
=
():
Promise
<
RelatedInfoDataType
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getAsReplaceGoodsGetDetailBySupplier
({
replaceId
:
applyId
,
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
({
relatedNo
:
res
.
data
.
applyNo
,
memberName
:
res
.
data
.
supplierName
,
address
:
`
${
res
.
data
.
returnGoodsAddress
?.
receiveUserName
||
''
}
/ ${res.data.returnGoodsAddress
?
.receiveUserTel || ''} ${res.data.returnGoodsAddress
?
.receiveAddress || ''}`,
logisticsType
:
res
.
data
.
returnGoodsAddress
?.
deliveryType
,
billDetails
:
res
.
data
.
goodsDetailList
.
map
((
item
)
=>
({
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
category
,
price
:
item
.
purchasePrice
,
relatedCount
:
item
.
replaceCount
,
count
:
item
.
receiveCount
,
})),
}
);
}
reject();
}).catch((err) => {
reject(err);
});
});
};
const handleSubmit = (values: BillSubmitValuesType) => {
PublicApi.postAsReplaceGoodsAddReplaceDeliveryGoods({
replaceId: applyId,
deliveryTime: values.createTime ? moment(values.createTime).valueOf() : 0,
orderAbstract: values.digest,
remark: values.remark,
inventoryName: values.inventoryName,
inventoryRole: values.inventoryRole,
detailList: values.billDetails.map((item) => ({
orderNo: item.orderNo,
productId: item.productId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.unit,
count: item.count,
})),
}).then((res) => {
if (res.code === 1000) {
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
} else {
setSubmitLoading(false);
}
});
};
return (
<>
<BillsFormPage
billType={DOC_TYPE_EXCHANGE_INVOICE}
fetchRelatedInfo={fetchRelatedInfo}
submitLoading={submitLoading}
onSubmit={handleSubmit}
customEffects={() => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</>
);
};
export default ExchangeAddDeliverBill;
src/pages/afterService/exchangeManage/exchangePrAddDeliver/deliverBillDetail.tsx
0 → 100644
View file @
f56395f6
/*
* @Author: XieZhiXiong
* @Date: 2021-08-20 15:14:49
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 15:17:47
* @Description: 换货发货单详情
*/
import
React
from
'react'
;
import
{
DOC_TYPE_EXCHANGE_INVOICE
}
from
'@/constants/commodity'
;
import
BillsFormPage
,
{
RelatedInfoDataType
}
from
'@/pages/transaction/stockSellStorage/bills/components/BillsFormPage'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
moment
from
'moment'
;
const
ExchangeDeliverBillDetail
=
()
=>
{
const
{
id
}
=
usePageStatus
();
const
fetchRelatedInfo
=
():
Promise
<
RelatedInfoDataType
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getAsReplaceGoodsGetReturnDeliveryGoodsDetail
({
returnDeliveryId
:
id
,
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
({
relatedNo
:
res
.
data
.
applyNo
,
memberName
:
res
.
data
.
memberName
,
address
:
`
${
res
.
data
.
userName
||
''
}
/
${
res
.
data
.
tel
||
''
}
${
res
.
data
.
address
||
''
}
`
,
logisticsType
:
res
.
data
.
deliveryType
,
inventoryId
:
res
.
data
.
inventoryName
,
inventoryRole
:
res
.
data
.
inventoryRole
,
digest
:
res
.
data
.
orderAbstract
,
createTime
:
res
.
data
.
orderTime
?
moment
(
res
.
data
.
orderTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
,
billDetails
:
res
.
data
.
goodsDetailDeliveryList
.
map
((
item
)
=>
({
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
category
,
price
:
item
.
purchasePrice
,
relatedCount
:
item
.
replaceCount
,
count
:
item
.
replaceDeliveryCount
,
})),
remark
:
res
.
data
.
remark
,
});
}
reject
();
}).
catch
((
err
)
=>
{
reject
(
err
);
});
});
};
return
(
<>
<
BillsFormPage
billType=
{
DOC_TYPE_EXCHANGE_INVOICE
}
fetchRelatedInfo=
{
fetchRelatedInfo
}
editable=
{
false
}
/>
</>
);
};
export
default
ExchangeDeliverBillDetail
;
src/pages/afterService/exchangeManage/exchangePrAddDeliver/index.tsx
View file @
f56395f6
...
...
@@ -2,13 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
1-19 14:53:19
* @LastEditTime: 2021-0
8-20 15:39:47
* @Description: 待新增换货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
import
{
Card
,
Badge
,
Progress
,
Button
,
Modal
}
from
'antd'
;
import
{
Card
,
Badge
,
Button
,
Modal
}
from
'antd'
;
import
{
ClockCircleOutlined
,
ExclamationCircleOutlined
,
}
from
'@ant-design/icons'
;
import
{
history
,
Link
}
from
'umi'
;
...
...
@@ -22,10 +21,6 @@ import {
EXCHANGE_INNER_STATUS_NOT_ADDED_REPLACE_DELIVERY
,
EXCHANGE_INNER_STATUS_UNREVIEWED_REPLACE_DELIVERY
,
}
from
'@/constants/afterService'
;
import
{
DOC_TYPE_EXCHANGE_INVOICE
,
DEPENDENT_DOC_EXCHANGE
,
}
from
'@/constants/commodity'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
EyePreview
from
'@/components/EyePreview'
;
...
...
@@ -109,7 +104,7 @@ const ExchangePrAddDeliver: React.FC = () => {
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<
Link
to=
{
`/memberCenter/
tranactionAbility/stockSellStorage/bills/detail?id=${record.replace
DeliveryId}`
}
to=
{
`/memberCenter/
afterService/exchangeManage/exchangePrAddDeliver/deliverDetail?id=${record.return
DeliveryId}`
}
>
{
text
}
</
Link
>
...
...
@@ -140,7 +135,7 @@ const ExchangePrAddDeliver: React.FC = () => {
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/
tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.replaceId}&invoicesTypeId=${DOC_TYPE_EXCHANGE_INVOICE}&relevanceInvoices=${DEPENDENT_DOC_EXCHANGE
}`
)
history
.
push
(
`/memberCenter/
afterService/exchangeManage/exchangePrAddDeliver/add?applyId=${record.replaceId
}`
)
}
>
新增
...
...
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