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
linweijiong
jinfa-platform
Commits
bb308619
Commit
bb308619
authored
Aug 13, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增退货入库单相关
parent
3555a3d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
8 deletions
+117
-8
returnManageRoute.ts
config/routes/afterServiceRoute/returnManageRoute.ts
+8
-0
addWarehouseBill.tsx
.../returnManage/returnPrAddWarehousing/addWarehouseBill.tsx
+106
-0
index.tsx
...fterService/returnManage/returnPrAddWarehousing/index.tsx
+3
-8
No files found.
config/routes/afterServiceRoute/returnManageRoute.ts
View file @
bb308619
...
...
@@ -160,6 +160,14 @@ const route: RouterChild = {
name
:
'returnPrAddWarehousing'
,
component
:
'@/pages/afterService/returnManage/returnPrAddWarehousing/index'
,
},
// 待新增退货入库单-新增
{
path
:
'/memberCenter/afterService/returnManage/returnPrAddWarehousing/add'
,
name
:
'returnAddDeliverBill'
,
component
:
'@/pages/afterService/returnManage/returnPrAddWarehousing/addWarehouseBill'
,
hideInMenu
:
true
,
noMargin
:
true
,
},
// 待新增退货入库单-详情
{
path
:
'/memberCenter/afterService/returnManage/returnPrAddWarehousing/detail'
,
...
...
src/pages/afterService/returnManage/returnPrAddWarehousing/addWarehouseBill.tsx
0 → 100644
View file @
bb308619
/*
* @Author: XieZhiXiong
* @Date: 2021-08-13 18:19:27
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-13 18:34:10
* @Description: 新增退货入库单
*/
import
React
,
{
useState
}
from
'react'
;
import
{
FormEffectHooks
}
from
'@formily/antd'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
moment
from
'moment'
;
import
{
DOC_TYPE_RETURN_RECEIPT
}
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
ReturnAddWarehouseBill
=
()
=>
{
const
{
applyId
}
=
usePageStatus
();
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
fetchRelatedInfo
=
():
Promise
<
RelatedInfoDataType
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getAsReturnGoodsGetDetailBySupplier
({
returnId
:
applyId
,
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
({
relatedNo
:
res
.
data
.
applyNo
,
memberName
:
res
.
data
.
consumerName
,
address
:
`
${
res
.
data
.
returnGoodsAddress
?.
sendUserName
||
''
}
/ ${res.data.returnGoodsAddress
?
.sendUserTel || ''} ${res.data.returnGoodsAddress
?
.sendAddress || ''}`,
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
.
returnCount
,
})),
}
);
}
reject();
}).catch((err) => {
reject(err);
});
});
};
const handleSubmit = (values: BillSubmitValuesType) => {
PublicApi.postAsReturnGoodsAddReturnGoodsStorage({
returnId: applyId,
storageTime: values.createTime ? moment(values.createTime).valueOf() : 0,
orderAbstract: values.digest,
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_RETURN_RECEIPT}
fetchRelatedInfo={fetchRelatedInfo}
submitLoading={submitLoading}
onSubmit={handleSubmit}
customEffects={() => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</>
);
};
export default ReturnAddWarehouseBill;
src/pages/afterService/returnManage/returnPrAddWarehousing/index.tsx
View file @
bb308619
...
...
@@ -2,13 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-08 17:19:58
* @LastEditTime: 202
1-08-13 18:54:51
* @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 {
RETURN_INNER_STATUS_NOT_ADDED_RETURN_STORAGE
,
RETURN_INNER_STATUS_UNREVIEWED_RETURN_STORAGE
,
}
from
'@/constants/afterService'
;
import
{
DOC_TYPE_RETURN_RECEIPT
,
DEPENDENT_DOC_RETURN
,
}
from
'@/constants/commodity'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
EyePreview
from
'@/components/EyePreview'
;
...
...
@@ -145,7 +140,7 @@ const ReturnPrAddWarehousing: React.FC = () => {
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/
tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.returnId}&invoicesTypeId=${DOC_TYPE_RETURN_RECEIPT}&relevanceInvoices=${DEPENDENT_DOC_RETURN
}`
)
history
.
push
(
`/memberCenter/
afterService/returnManage/returnPrAddWarehousing/add?applyId=${record.returnId
}`
)
}
>
新增
...
...
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