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
dfe30212
Commit
dfe30212
authored
Nov 17, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接售后退货中...
parent
e7173bb3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
232 additions
and
45 deletions
+232
-45
index.less
src/pages/afterService/components/AddressFormItem/index.less
+4
-0
index.tsx
src/pages/afterService/components/AddressFormItem/index.tsx
+6
-2
index.tsx
src/pages/afterService/components/GoodsDrawer/index.tsx
+10
-3
useBusinessEffects.ts
...ubmit/components/RepairForm/effects/useBusinessEffects.ts
+1
-1
index.ts
...tion/repairPrSubmit/components/RepairForm/schema/index.ts
+0
-3
index.tsx
...terService/returnApplication/returnPrAddDeliver/index.tsx
+3
-3
index.tsx
...rService/returnApplication/returnPrAddLogistics/index.tsx
+3
-3
index.tsx
...erService/returnApplication/returnPrConfirmBack/index.tsx
+3
-3
verify.tsx
...rService/returnApplication/returnPrConfirmBack/verify.tsx
+1
-1
verify.tsx
...ervice/returnApplication/returnPrConfirmResult/verify.tsx
+1
-1
index.tsx
.../afterService/returnApplication/returnPrDeliver/index.tsx
+3
-3
useBusinessEffects.ts
...ubmit/components/ReturnForm/effects/useBusinessEffects.ts
+13
-1
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+184
-21
index.ts
...tion/returnPrSubmit/components/ReturnForm/schema/index.ts
+0
-0
No files found.
src/pages/afterService/components/AddressFormItem/index.less
View file @
dfe30212
...
...
@@ -32,6 +32,10 @@
z-index: 5;
}
}
&.disabled {
cursor: not-allowed;
}
}
}
...
...
src/pages/afterService/components/AddressFormItem/index.tsx
View file @
dfe30212
...
...
@@ -27,6 +27,8 @@ interface AddressFormItemProps {
// 默认展示的条数
showCount
?:
number
;
onChange
:
(
id
:
string
)
=>
{};
// 禁用的
disabled
?:
boolean
;
};
const
AddressFormItem
:
React
.
FC
<
AddressFormItemProps
>
&
{
isFieldComponent
:
boolean
}
=
({
...
...
@@ -34,6 +36,7 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
showCount
=
3
,
dataSource
=
[],
onChange
,
disabled
=
false
,
})
=>
{
const
[
showMore
,
setShowMore
]
=
useState
(
false
);
...
...
@@ -54,7 +57,7 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
};
const
handleSelectItem
=
record
=>
{
if
(
onChange
)
{
if
(
onChange
&&
!
disabled
)
{
onChange
(
record
);
}
};
...
...
@@ -65,7 +68,8 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
{
showDataSource
.
map
(
item
=>
(
<
li
className=
{
classNames
(
styles
[
'addressList-item'
],
{
[
styles
.
active
]:
item
.
id
===
(
value
&&
value
.
id
),
[
styles
.
active
]:
item
.
id
===
(
value
&&
value
.
id
),
[
styles
.
disabled
]:
disabled
,
})
}
onClick=
{
()
=>
handleSelectItem
(
item
)
}
key=
{
item
.
id
}
...
...
src/pages/afterService/components/GoodsDrawer/index.tsx
View file @
dfe30212
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-17 1
1:15:2
6
* @LastEditTime: 2020-11-17 1
5:22:4
6
* @Description: 维修商品抽屉组件
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
...
@@ -70,6 +70,8 @@ export interface OrderListRes {
interface
GoodsDrawerProps
{
// 选中值(子表格的值)
checked
:
number
[];
// 抽屉标题
title
?:
string
;
// 是否可见的
visible
:
boolean
;
// 关闭事件
...
...
@@ -235,7 +237,11 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
'已维修数量'
,
dataIndex
:
'repairCount'
,
align
:
'center'
,
},
];
// 获取订单列表
...
...
@@ -448,13 +454,14 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
loading
,
}
=
this
.
state
;
const
{
title
=
'选择维修商品'
,
visible
=
false
,
nestProps
=
{},
}
=
this
.
props
;
return
(
<
Drawer
title=
"选择维修商品"
title=
{
title
}
width=
{
1200
}
onClose=
{
this
.
handleClose
}
afterVisibleChange=
{
this
.
handleAfterVisibleChange
}
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/effects/useBusinessEffects.ts
View file @
dfe30212
...
...
@@ -36,7 +36,7 @@ export const useBusinessEffects = (context, actions) => {
getFieldState
,
setFieldState
,
}
=
actions
;
const
linkage
=
useLinkageUtils
();
//
const linkage = useLinkageUtils();
// 校验维修数量
onFieldInputChange$
(
'repairGoodsList.*.repairCount'
).
subscribe
(
fieldState
=>
{
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/schema/index.ts
View file @
dfe30212
import
{
ISchema
}
from
'@formily/antd'
;
import
Search
from
'@/components/NiceForm/components/Search'
;
import
Submit
from
'@/components/NiceForm/components/Submit'
;
import
{
}
from
'@/constants'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
src/pages/afterService/returnApplication/returnPrAddDeliver/index.tsx
View file @
dfe30212
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
09 10:28:17
* @LastEditTime: 2020-11-
17 17:20:43
* @Description: 待新增退货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -87,12 +87,12 @@ const ReturnPrAddDeliver: React.FC = () => {
},
{
title
:
'退货批次'
,
dataIndex
:
'
b
atch'
,
dataIndex
:
'
returnB
atch'
,
align
:
'center'
,
},
{
title
:
'退货发货单号'
,
dataIndex
:
'
deliver
No'
,
dataIndex
:
'
returnDelivery
No'
,
align
:
'center'
,
render
:
text
=>
<
a
>
{
text
}
</
a
>,
},
...
...
src/pages/afterService/returnApplication/returnPrAddLogistics/index.tsx
View file @
dfe30212
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-1
1 09:53:54
* @LastEditTime: 2020-11-1
7 17:22:07
* @Description: 待新增退货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -73,12 +73,12 @@ const ReturnPrAddLogistics: React.FC = () => {
},
{
title
:
'退货批次'
,
dataIndex
:
'
b
atch'
,
dataIndex
:
'
returnB
atch'
,
align
:
'center'
,
},
{
title
:
'退货发货单号'
,
dataIndex
:
'
deliver
No'
,
dataIndex
:
'
returnDelivery
No'
,
align
:
'center'
,
render
:
text
=>
<
a
>
{
text
}
</
a
>,
},
...
...
src/pages/afterService/returnApplication/returnPrConfirmBack/index.tsx
View file @
dfe30212
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-1
1 10:21:46
* @LastEditTime: 2020-11-1
7 17:24:12
* @Description: 待新增退货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -76,12 +76,12 @@ const ReturnPrConfirmBack: React.FC = () => {
},
{
title
:
'退货批次'
,
dataIndex
:
'
b
atch'
,
dataIndex
:
'
returnB
atch'
,
align
:
'center'
,
},
{
title
:
'退货发货单号'
,
dataIndex
:
'
deliver
No'
,
dataIndex
:
'
returnDelivery
No'
,
align
:
'center'
,
render
:
text
=>
<
a
>
{
text
}
</
a
>,
},
...
...
src/pages/afterService/returnApplication/returnPrConfirmBack/verify.tsx
View file @
dfe30212
...
...
@@ -16,7 +16,7 @@ const ReturnPrConfirmBackVerify: React.FC = () => {
}
setSubmitLoading
(
true
);
PublicApi
.
postAsReturnGoodsConfirmAllReturnGoodsReceipt
({
return
Id
:
id
,
data
Id
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
...
...
src/pages/afterService/returnApplication/returnPrConfirmResult/verify.tsx
View file @
dfe30212
...
...
@@ -16,7 +16,7 @@ const ReturnPrConfirmResultVerify: React.FC = () => {
}
setSubmitLoading
(
true
);
PublicApi
.
postAsReturnGoodsConfirmAllRefund
({
return
Id
:
id
,
data
Id
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
...
...
src/pages/afterService/returnApplication/returnPrDeliver/index.tsx
View file @
dfe30212
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-1
1 10:04:10
* @LastEditTime: 2020-11-1
7 17:23:01
* @Description: 待新增退货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -76,12 +76,12 @@ const ReturnPrDeliver: React.FC = () => {
},
{
title
:
'退货批次'
,
dataIndex
:
'
b
atch'
,
dataIndex
:
'
returnB
atch'
,
align
:
'center'
,
},
{
title
:
'退货发货单号'
,
dataIndex
:
'
deliver
No'
,
dataIndex
:
'
returnDelivery
No'
,
align
:
'center'
,
render
:
text
=>
<
a
>
{
text
}
</
a
>,
},
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/effects/useBusinessEffects.ts
View file @
dfe30212
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
03 18:50:28
* @LastEditTime: 2020-11-
17 16:13:43
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -39,4 +39,15 @@ export const useBusinessEffects = (context, actions) => {
}
=
actions
;
const
linkage
=
useLinkageUtils
();
// 联动配送方式
onFieldValueChange$
(
'deliveryType'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
// 如果选中 自提
if
(
value
===
2
)
{
linkage
.
show
(
'shippingAddress'
);
}
else
{
linkage
.
hide
(
'shippingAddress'
);
}
});
}
\ No newline at end of file
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
dfe30212
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Button
,
Card
,
Spin
,
message
}
from
'antd'
;
import
{
Button
,
Card
,
Spin
,
Badge
,
message
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
Radio
,
ArrayTable
}
from
'@formily/antd-components'
;
import
{
history
,
Prompt
}
from
'umi'
;
...
...
@@ -7,9 +8,11 @@ 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
{
PurchaseOrderInsideWorkStateTexts
,
ORDER_TYPE2
}
from
'@/constants'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
GoodsDrawer
from
'..
/GoodsDrawer'
;
import
GoodsDrawer
,
{
OrderListRes
}
from
'../../../../components
/GoodsDrawer'
;
import
AddressFormItem
from
'../../../../components/AddressFormItem'
;
import
ReturnInfoDrawer
from
'../../../../components/ReturnInfoDrawer'
;
import
{
addBillSchema
}
from
'./schema'
;
...
...
@@ -36,14 +39,129 @@ const RepairForm: React.FC<BillsFormProps> = ({
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
[
visibleGoodsDrawer
,
setVisibleGoodsDrawer
]
=
useState
(
false
);
const
[
visibleReturnInfoDrawer
,
setVisibleReturnInfoDrawer
]
=
useState
(
false
);
const
[
goodsValue
,
setGoodsValue
]
=
useState
([]);
const
tableColumn
:
ColumnType
<
any
>
[]
=
[
{
title
:
'订单号'
,
dataIndex
:
'orderNo'
,
align
:
'center'
,
},
{
title
:
'订单摘要'
,
dataIndex
:
'orderThe'
,
align
:
'center'
,
},
{
title
:
'供应会员'
,
dataIndex
:
'supplyMembersName'
,
align
:
'center'
,
},
{
title
:
'下单时间'
,
dataIndex
:
'createTime'
,
align
:
'center'
,
},
{
title
:
'订单状态'
,
dataIndex
:
'externalState'
,
align
:
'center'
,
render
:
text
=>
PurchaseOrderInsideWorkStateTexts
[
text
],
},
{
title
:
'订单类型'
,
dataIndex
:
'type'
,
align
:
'center'
,
render
:
text
=>
ORDER_TYPE2
[
text
],
},
];
const
childTableColumn
:
ColumnType
<
any
>
[]
=
[
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
},
{
title
:
'订单数量'
,
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
'单价'
,
dataIndex
:
'price'
,
align
:
'center'
,
},
{
title
:
'金额'
,
dataIndex
:
'price'
,
align
:
'center'
,
},
{
title
:
'已退货数量'
,
dataIndex
:
'returnCount'
,
align
:
'center'
,
},
// 缺
{
title
:
'已退款金额'
,
dataIndex
:
'returnCount2'
,
align
:
'center'
,
},
];
// 根据供应会员获取订单列表
const
getOrderList
=
(
params
):
Promise
<
OrderListRes
>
=>
{
const
supplierMemberValue
=
addSchemaAction
.
getFieldValue
(
'supplierMember'
);
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderOneBatchOrderList
({
...
params
,
supplyMembersId
:
supplierMemberValue
[
0
].
memberId
,
supplyMembersRoleId
:
supplierMemberValue
[
0
].
roleId
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
);
}
reject
();
}).
catch
(()
=>
{
reject
();
});
});
};
useEffect
(()
=>
{
},
[]);
// 弹出单据明细
const
handleAdd
=
()
=>
{
// do something
const
handleAddGoods
=
()
=>
{
const
supplierMemberValue
=
addSchemaAction
.
getFieldValue
(
'supplierMember'
);
if
(
!
supplierMemberValue
||
!
supplierMemberValue
.
length
)
{
message
.
error
(
'请先选择供应会员'
);
return
;
}
setVisibleGoodsDrawer
(
true
);
};
const
TableAddButton
=
isEdit
||
!
id
?
(
...
...
@@ -51,7 +169,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
setVisibleGoodsDrawer
(
true
)
}
onClick=
{
handleAddGoods
}
type=
"dashed"
>
选择退货商品
...
...
@@ -67,18 +185,13 @@ const RepairForm: React.FC<BillsFormProps> = ({
};
const
handleRemoveItem
=
(
index
:
number
)
=>
{
// do something
// const newSelectRow = [...productRowCtl.selectRow];
// const newSelectedRowKeys = [...productRowCtl.selectedRowKeys];
// const newValue = [...addSchemaAction.getFieldValue('invoicesDetailsRequests')];
// newSelectRow.splice(index, 1);
// newSelectedRowKeys.splice(index, 1);
// productRowCtl.setSelectRow(newSelectRow);
// productRowCtl.setSelectedRowKeys(newSelectedRowKeys);
// newValue.splice(index, 1);
// addSchemaAction.setFieldValue('invoicesDetailsRequests', newValue);
const
newGoodsValue
=
[...
goodsValue
];
const
newValue
=
[...
addSchemaAction
.
getFieldValue
(
'returnGoodsList'
)];
const
deleted
=
newValue
.
splice
(
index
,
1
);
addSchemaAction
.
setFieldValue
(
'returnGoodsList'
,
newValue
);
newGoodsValue
.
splice
(
newGoodsValue
.
findIndex
(
item
=>
item
===
deleted
[
0
].
id
),
1
);
setGoodsValue
(
newGoodsValue
);
};
// ArrayTable自定义渲染
...
...
@@ -110,6 +223,46 @@ const RepairForm: React.FC<BillsFormProps> = ({
}
};
const
handleGoodsConfirm
=
values
=>
{
const
preValues
=
addSchemaAction
.
getFieldValue
(
'returnGoodsList'
);
const
value
=
[];
values
.
forEach
(
item
=>
{
const
existing
=
preValues
.
find
(
val
=>
val
.
id
===
item
.
id
);
const
atom
=
existing
?
existing
:
{
id
:
item
.
id
,
orderId
:
item
.
orderId
,
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
unitName
,
unit
:
item
.
costPrice
,
purchaseCount
:
item
.
purchaseCount
,
purchasePrice
:
0
,
// 待补
returnCount
:
0
,
// 待补
returnReason
:
''
,
};
value
.
push
(
atom
);
});
addSchemaAction
.
setFieldValue
(
'returnGoodsList'
,
value
);
};
const
handleGoodsChange
=
values
=>
{
setGoodsValue
(
values
);
};
const
OuterStatus
=
(
<
StatusTag
type=
{
'success'
}
title=
{
'待提交'
}
/>
);
const
InnerStatus
=
(
<
Badge
color=
"#C0C4CC"
text=
{
'待提交审核'
}
/>
);
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
PageHeaderWrapper
...
...
@@ -120,10 +273,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
!
id
?
'新建
单据
'
:
'新建
退货申请单
'
:
isEdit
?
'编辑
单据
'
:
'查看
单据
'
'编辑
退货申请单
'
:
'查看
退货申请单
'
}
extra=
{
(
isEdit
||
!
id
)
...
...
@@ -146,6 +299,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
initialValues=
{
{}
}
expressionScope=
{
{
TableAddButton
,
OuterStatus
,
InnerStatus
,
renderListTableRemove
,
beforeUpload
,
}
}
...
...
@@ -169,8 +324,16 @@ const RepairForm: React.FC<BillsFormProps> = ({
</
Card
>
<
GoodsDrawer
title=
"选择退货商品"
visible=
{
visibleGoodsDrawer
}
fetchOrderList=
{
getOrderList
}
onClose=
{
()
=>
setVisibleGoodsDrawer
(
false
)
}
onConfirm=
{
handleGoodsConfirm
}
checked=
{
goodsValue
}
onChange=
{
handleGoodsChange
}
nestProps=
{
{
NestColumns
:
[
tableColumn
,
childTableColumn
],
}
}
/>
<
ReturnInfoDrawer
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/schema/index.ts
View file @
dfe30212
This diff is collapsed.
Click to expand it.
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