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
05511112
Commit
05511112
authored
Nov 20, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
8917f098
ed41bf7b
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
647 additions
and
195 deletions
+647
-195
index.tsx
...ges/afterService/components/ExchangeAddressInfo/index.tsx
+126
-7
index.ts
...terService/components/ExchangeAddressInfo/schema/index.ts
+44
-14
index.tsx
...pages/afterService/components/ReturnAddressInfo/index.tsx
+124
-8
index.ts
...afterService/components/ReturnAddressInfo/schema/index.ts
+33
-12
index.tsx
...ervice/exchangeApplication/exchangePrAddDeliver/index.tsx
+5
-5
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+6
-7
index.tsx
...terService/exchangeManage/components/DetailInfo/index.tsx
+152
-51
index.tsx
src/pages/afterService/exchangeManage/exchangePr1/index.tsx
+3
-3
verify.tsx
src/pages/afterService/exchangeManage/exchangePr1/verify.tsx
+12
-13
index.tsx
src/pages/afterService/exchangeManage/exchangePr2/index.tsx
+1
-1
verify.tsx
src/pages/afterService/exchangeManage/exchangePr2/verify.tsx
+11
-12
index.tsx
...fterService/exchangeManage/exchangePrAddDeliver/index.tsx
+3
-3
verify.tsx
.../afterService/exchangeManage/exchangePrConfirm/verify.tsx
+12
-13
verify.tsx
...s/afterService/exchangeManage/exchangePrSubmit/verify.tsx
+12
-12
index.less
src/pages/lxMall/components/FindMore/index.less
+1
-1
index.tsx
src/pages/lxMall/pay/components/balance/index.tsx
+1
-0
index.less
src/pages/lxMall/pay/components/transfer/index.less
+1
-0
index.tsx
src/pages/lxMall/pay/components/wechat/index.tsx
+2
-2
index.less
src/pages/transaction/components/orderPayModal/index.less
+2
-2
index.tsx
src/pages/transaction/components/orderPayModal/index.tsx
+1
-1
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+71
-3
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+12
-18
index.ts
...ockSellStorage/bills/components/BillsForm/schema/index.ts
+12
-7
No files found.
src/pages/afterService/components/ExchangeAddressInfo/index.tsx
View file @
05511112
...
...
@@ -2,12 +2,15 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
17 17:49:19
* @Description:
退货地址信息
* @LastEditTime: 2020-11-
20 14:43:15
* @Description:
换货收货地址
*/
import
React
from
'react'
;
import
MellowCard
from
'@/components/MellowCard'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
schema
}
from
'./schema'
;
import
styles
from
'./index.less'
;
...
...
@@ -18,23 +21,88 @@ const {
onFieldInputChange$
,
}
=
FormEffectHooks
;
export
interface
Values
{
deliveryType
:
number
,
id
:
number
,
isDefault
:
number
,
sendAddress
:
string
|
undefined
,
sendUserName
:
string
|
undefined
,
sendUserTel
:
string
|
undefined
,
};
interface
ExchangeAddressInfo
{
// 是否是编辑的
isEdit
?:
boolean
;
// 换货收货地址
deliveryAddress
:
{
// id
id
?:
number
;
// 配送方式
deliveryType
?:
number
;
// 收件人姓名
name
:
string
;
// phone
phone
:
string
;
// 完整地址
fullAddress
:
string
;
},
// 换货发货地址
shippingAddress
:
{
// id
id
?:
number
;
// 配送方式
deliveryType
?:
number
;
// 收件人姓名
name
:
string
;
// phone
phone
:
string
;
// 完整地址
fullAddress
:
string
;
},
// onSubmit
onSubmit
:
(
values
:
Values
)
=>
void
;
};
const
ExchangeAddressInfo
:
React
.
FC
<
ExchangeAddressInfo
>
=
({
isEdit
=
false
,
deliveryAddress
=
{},
shippingAddress
=
{},
onSubmit
,
})
=>
{
const
handleSubmit
=
values
=>
{
};
const
DeliveryAddress
=
(
// 获取发货地址
const
fetchShipperAddress
=
():
Promise
<
any
[]
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getLogisticsSelectListShipperAddress
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
options
=
res
.
data
?
res
.
data
.
map
(
item
=>
({
label
:
`
${
item
.
fullAddress
}
/
${
item
.
shipperName
}
/
${
item
.
phone
}
`
,
value
:
item
.
id
,
...
item
,
}))
:
[];
resolve
(
options
);
}
reject
();
}).
catch
(()
=>
{
reject
();
});
});
};
const
Address
=
(
<
div
>
<
p
>
张三 / 185 2929 6475
</
p
>
<
p
>
广东省广州市海珠区新港东路1068号中洲中心北塔6楼
</
p
>
<
p
>
{
deliveryAddress
.
name
||
''
}
/
{
deliveryAddress
.
phone
||
''
}
</
p
>
<
p
>
{
deliveryAddress
.
fullAddress
||
''
}
</
p
>
</
div
>
);
...
...
@@ -44,11 +112,62 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
fullHeight
>
<
NiceForm
initialValues=
{
{
deliveryType
:
shippingAddress
.
deliveryType
,
shippingAddress
:
shippingAddress
.
id
,
pickupAddress
:
shippingAddress
.
id
,
}
}
expressionScope=
{
{
Delivery
Address
,
Address
,
}
}
effects=
{
(
$
,
{
setFieldState
})
=>
{
effects=
{
(
$
,
{
setFieldState
,
getFieldValue
})
=>
{
useAsyncSelect
(
'*(shippingAddress,pickupAddress)'
,
fetchShipperAddress
,
[
'label'
,
'value'
]);
const
linkage
=
useLinkageUtils
();
// 联动配送方式
onFieldValueChange$
(
'deliveryType'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
switch
(
value
)
{
// 物流
case
1
:
{
linkage
.
show
(
'shippingAddress'
);
linkage
.
hide
(
'pickupAddress'
);
break
;
};
// 自提
case
2
:
{
linkage
.
hide
(
'shippingAddress'
);
linkage
.
show
(
'pickupAddress'
);
break
;
};
// 无需物流
case
3
:
{
linkage
.
hide
(
'*(shippingAddress,pickupAddress)'
);
break
;
};
default
:
break
};
});
onFieldInputChange$
(
'*(shippingAddress,pickupAddress)'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
,
originAsyncData
}
=
fieldState
;
const
deliveryTypeValue
=
getFieldValue
(
'deliveryType'
);
const
fullData
=
originAsyncData
.
find
(
item
=>
item
.
id
===
value
);
if
(
onSubmit
)
{
onSubmit
({
deliveryType
:
deliveryTypeValue
,
id
:
fullData
?
fullData
.
id
:
undefined
,
isDefault
:
fullData
?
fullData
.
isDefault
:
undefined
,
sendAddress
:
fullData
?
fullData
.
fullAddress
:
undefined
,
sendUserName
:
fullData
?
fullData
.
shipperName
:
undefined
,
sendUserTel
:
fullData
?
fullData
.
phone
:
undefined
,
});
}
});
}
}
editable=
{
isEdit
}
actions=
{
modalFormActions
}
...
...
src/pages/afterService/components/ExchangeAddressInfo/schema/index.ts
View file @
05511112
...
...
@@ -2,10 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2020-11-09 15:56:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
17 17:46:41
* @LastEditTime: 2020-11-
20 14:54:37
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
UPLOAD_TYPE
,
DELIVERY_TYPE_ENUM
}
from
'@/constants'
;
export
const
schema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -14,34 +15,63 @@ export const schema: ISchema = {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
6
,
full
:
true
,
labelCol
:
8
,
wrapperCol
:
16
,
labelAlign
:
'left'
,
},
properties
:
{
mode
:
{
type
:
'string'
,
deliveryType
:
{
title
:
'配送方式'
,
default
:
'物流'
,
'x-component'
:
'Text'
,
'x-component-props'
:
{},
type
:
'string'
,
default
:
1
,
enum
:
DELIVERY_TYPE_ENUM
,
'x-component-props'
:
{
style
:
{
width
:
'80%'
,
},
shippingAddress
:
{
},
},
deliveryAddress
:
{
type
:
'string'
,
title
:
'换货收货地址'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{Address}}'
,
},
},
shippingAddress
:
{
type
:
'string'
,
title
:
'换货发货地址'
,
enum
:
[],
required
:
true
,
'x-component-props'
:
{
placeholder
:
'请选择'
,
style
:
{
width
:
'80%'
,
},
},
deliveryAddress
:
{
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择换货发货地址'
,
},
],
},
pickupAddress
:
{
type
:
'string'
,
title
:
'换货
发货地址'
,
'x-component'
:
'Children'
,
title
:
'换货
自提地址'
,
enum
:
[]
,
'x-component-props'
:
{
children
:
'{{DeliveryAddress}}'
,
placeholder
:
'请选择'
,
style
:
{
width
:
'80%'
,
},
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择换货自提地址'
,
},
],
},
},
},
...
...
src/pages/afterService/components/ReturnAddressInfo/index.tsx
View file @
05511112
...
...
@@ -2,12 +2,15 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
12 13:48:08
* @LastEditTime: 2020-11-
20 15:40:21
* @Description: 退货地址信息
*/
import
React
from
'react'
;
import
MellowCard
from
'@/components/MellowCard'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
schema
}
from
'./schema'
;
import
styles
from
'./index.less'
;
...
...
@@ -18,23 +21,88 @@ const {
onFieldInputChange$
,
}
=
FormEffectHooks
;
export
interface
Values
{
deliveryType
:
number
,
id
:
number
,
isDefault
:
number
,
receiveAddress
:
string
|
undefined
,
receiveUserName
:
string
|
undefined
,
receiveUserTel
:
string
|
undefined
,
};
interface
ReturnAddressInfo
{
// 是否是编辑的
isEdit
?:
boolean
;
// 退货收货地址
deliveryAddress
:
{
// id
id
?:
number
;
// 配送方式
deliveryType
?:
number
;
// 收件人姓名
name
:
string
;
// phone
phone
:
string
;
// 完整地址
fullAddress
:
string
;
},
// 退货发货地址
shippingAddress
:
{
// id
id
?:
number
;
// 配送方式
deliveryType
?:
number
;
// 收件人姓名
name
:
string
;
// phone
phone
:
string
;
// 完整地址
fullAddress
:
string
;
},
// onSubmit
onSubmit
:
(
values
:
Values
)
=>
void
;
};
const
ReturnAddressInfo
:
React
.
FC
<
ReturnAddressInfo
>
=
({
isEdit
=
false
,
deliveryAddress
=
{},
shippingAddress
=
{},
onSubmit
,
})
=>
{
const
handleSubmit
=
values
=>
{
};
const
DeliveryAddress
=
(
// 获取收货地址
const
fetchDeliveryAddress
=
():
Promise
<
any
[]
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getLogisticsSelectListReceiverAddress
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
options
=
res
.
data
?
res
.
data
.
map
(
item
=>
({
label
:
`
${
item
.
fullAddress
}
/
${
item
.
receiverName
}
/
${
item
.
phone
}
`
,
value
:
item
.
id
,
...
item
,
}))
:
[];
resolve
(
options
);
}
reject
();
}).
catch
(()
=>
{
reject
();
});
});
};
const
Address
=
(
<
div
>
<
p
>
张三 / 185 2929 6475
</
p
>
<
p
>
广东省广州市海珠区新港东路1068号中洲中心北塔6楼
</
p
>
<
p
>
{
shippingAddress
.
name
||
''
}
/
{
shippingAddress
.
phone
||
''
}
</
p
>
<
p
>
{
shippingAddress
.
fullAddress
||
''
}
</
p
>
</
div
>
);
...
...
@@ -44,13 +112,61 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
fullHeight
>
<
NiceForm
effects=
{
(
$
,
{
setFieldState
})
=>
{
onFieldValueChange$
(
'shippingAddress'
).
subscribe
(
fieldState
=>
{
console
.
log
(
'配送方式'
,
fieldState
.
value
);
initialValues=
{
{
deliveryType
:
shippingAddress
.
deliveryType
,
deliveryAddress
:
deliveryAddress
.
id
,
}
}
effects=
{
(
$
,
{
setFieldState
,
getFieldValue
})
=>
{
useAsyncSelect
(
'deliveryAddress'
,
fetchDeliveryAddress
,
[
'label'
,
'value'
]);
const
linkage
=
useLinkageUtils
();
// 联动配送方式
onFieldValueChange$
(
'deliveryType'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
switch
(
value
)
{
// 物流
case
1
:
{
linkage
.
show
(
'shippingAddress'
);
linkage
.
hide
(
'pickupAddress'
);
break
;
};
// 自提
case
2
:
{
linkage
.
hide
(
'shippingAddress'
);
linkage
.
show
(
'pickupAddress'
);
break
;
};
// 无需物流
case
3
:
{
linkage
.
hide
(
'*(shippingAddress,pickupAddress)'
);
break
;
};
default
:
break
};
});
onFieldInputChange$
(
'deliveryAddress'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
,
originAsyncData
}
=
fieldState
;
const
deliveryTypeValue
=
getFieldValue
(
'deliveryType'
);
const
fullData
=
originAsyncData
.
find
(
item
=>
item
.
id
===
value
);
if
(
onSubmit
)
{
onSubmit
({
deliveryType
:
deliveryTypeValue
,
id
:
fullData
?
fullData
.
id
:
undefined
,
isDefault
:
fullData
?
fullData
.
isDefault
:
undefined
,
receiveAddress
:
fullData
?
fullData
.
fullAddress
:
undefined
,
receiveUserName
:
fullData
?
fullData
.
receiverName
:
undefined
,
receiveUserTel
:
fullData
?
fullData
.
phone
:
undefined
,
});
}
});
}
}
expressionScope=
{
{
Delivery
Address
,
Address
,
}
}
editable=
{
isEdit
}
actions=
{
modalFormActions
}
...
...
src/pages/afterService/components/ReturnAddressInfo/schema/index.ts
View file @
05511112
...
...
@@ -2,10 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2020-11-09 15:56:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
09 16:19:24
* @LastEditTime: 2020-11-
20 15:41:12
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
UPLOAD_TYPE
,
DELIVERY_TYPE_ENUM
}
from
'@/constants'
;
export
const
schema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -14,33 +15,53 @@ export const schema: ISchema = {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
6
,
full
:
true
,
labelCol
:
8
,
wrapperCol
:
16
,
labelAlign
:
'left'
,
},
properties
:
{
mode
:
{
type
:
'string'
,
deliveryType
:
{
title
:
'配送方式'
,
default
:
'物流'
,
'x-component'
:
'Text'
,
'x-component-props'
:
{},
type
:
'string'
,
enum
:
DELIVERY_TYPE_ENUM
,
editable
:
false
,
'x-component-props'
:
{
style
:
{
width
:
'80%'
,
},
shippingAddress
:
{
},
},
deliveryAddress
:
{
type
:
'string'
,
title
:
'退货收货地址'
,
enum
:
[],
required
:
true
,
'x-component-props'
:
{
placeholder
:
'请选择'
,
style
:
{
width
:
'80%'
,
},
},
deliveryAddress
:
{
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择退货收货地址'
,
},
],
},
shippingAddress
:
{
type
:
'string'
,
title
:
'退货发货地址'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{DeliveryAddress}}'
,
children
:
'{{Address}}'
,
},
},
pickupAddress
:
{
type
:
'string'
,
title
:
'退货自提地址'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{Address}}'
,
},
},
},
...
...
src/pages/afterService/exchangeApplication/exchangePrAddDeliver/index.tsx
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
19 18:15:56
* @LastEditTime: 2020-11-
20 16:03:42
* @Description: 待新增退货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -67,7 +67,7 @@ const ExchangePrAddDeliver: React.FC = () => {
},
{
title
:
'申请单摘要'
,
dataIndex
:
'
parentMemberName
'
,
dataIndex
:
'
applyAbstract
'
,
align
:
'center'
,
},
{
...
...
@@ -77,17 +77,17 @@ const ExchangePrAddDeliver: React.FC = () => {
},
{
title
:
'单据时间'
,
dataIndex
:
'
created
'
,
dataIndex
:
'
applyTime
'
,
align
:
'center'
,
},
{
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/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
05511112
...
...
@@ -58,7 +58,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const
[
replaceGoodsList
,
setReplaceGoodsList
]
=
useState
<
GetAsReplaceGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
replaceGoodsLoading
,
set
Repair
GoodsLoading
]
=
useState
(
false
);
const
[
replaceGoodsLoading
,
set
Exchange
GoodsLoading
]
=
useState
(
false
);
const
[
goodsValue
,
setGoodsValue
]
=
useState
([]);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
[
visibleGoodsDrawer
,
setVisibleGoodsDrawer
]
=
useState
(
false
);
...
...
@@ -194,14 +194,13 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
);
setDetailInfo
({
...
detailInfo
,
proofFileList
:
faultFileList
.
map
(
item
=>
normalizeFiledata
(
item
.
filePath
)),
deliveryAddress
:
{
fullAddress
:
replaceGoodsAddress
.
send
Address
,
fullAddress
:
replaceGoodsAddress
.
receive
Address
,
id
:
123
,
// 缺
isDefault
:
1
,
// 缺
phone
:
replaceGoodsAddress
.
send
UserTel
,
receiverName
:
replaceGoodsAddress
.
send
UserName
,
phone
:
replaceGoodsAddress
.
receive
UserTel
,
receiverName
:
replaceGoodsAddress
.
receive
UserName
,
},
// 物流
shippingAddress
:
returnGoodsAddress
.
deliveryType
===
1
?
{
...
...
@@ -243,7 +242,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
if
(
!
id
)
{
return
;
}
set
Repair
GoodsLoading
(
true
);
set
Exchange
GoodsLoading
(
true
);
PublicApi
.
getAsReplaceGoodsPageReturnedGoods
({
replaceId
:
id
,
current
:
`
${
1
}
`
,
...
...
@@ -254,7 +253,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
setGoodsValue
(
res
.
data
&&
res
.
data
.
data
?
res
.
data
.
data
.
map
(
item
=>
item
.
orderRecordId
)
:
[]);
}
}).
finally
(()
=>
{
set
Repair
GoodsLoading
(
false
);
set
Exchange
GoodsLoading
(
false
);
});
};
...
...
src/pages/afterService/exchangeManage/components/DetailInfo/index.tsx
View file @
05511112
...
...
@@ -9,22 +9,29 @@ import {
Col
,
Badge
,
Switch
,
Tooltip
,
message
,
}
from
'antd'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
FormOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetAsReturnGoodsGetDetailBySupplierResponse
}
from
'@/services/AfterServiceApi'
;
import
{
CREDIT_INNER_STATUS
,
CREDIT_OUTER_STATUS
,
CREDIT_STATUS
}
from
'@/constants'
;
import
{
GetAsReplaceGoodsGetDetailBySupplierResponse
,
GetAsReplaceGoodsPageReturnedGoodsResponse
,
}
from
'@/services/AfterServiceApi'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
}
from
'@/utils'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
AuditProcess
from
'@/components/AuditProcess'
;
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
ReturnInfoDrawer
from
'../../../components/ReturnInfoDrawer'
;
import
{
}
from
'../../../constants'
;
import
{
Values
as
ExchangeAddressValues
}
from
'../../../components/ExchangeAddressInfo'
;
import
{
Values
as
ReturnAddressValues
}
from
'../../../components/ReturnAddressInfo'
;
import
{
EXCHANGE_OUTER_STATUS_TAG_MAP
,
EXCHANGE_INNER_STATUS_BADGE_MAP
,
}
from
'../../../constants'
;
const
ProductList
=
React
.
lazy
(()
=>
import
(
'../../../components/ProductList'
));
const
ExchangeReceivedInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/ExchangeReceivedInfo'
));
...
...
@@ -46,20 +53,81 @@ interface DetailInfoProps {
headExtra
?:
React
.
ReactNode
;
};
interface
DetailInfo
extends
GetAsReplaceGoodsGetDetailBySupplierResponse
{
fileList
:
FileData
[];
};
const
DetailInfo
:
React
.
FC
<
DetailInfoProps
>
=
({
id
,
isEdit
=
false
,
target
,
headExtra
=
null
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
GetAsReturnGoodsGetDetailBySupplierResponse
>
(
null
);
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
(
null
);
const
[
replaceGoodsList
,
setReplaceGoodsList
]
=
useState
<
GetAsReplaceGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
[
replaceGoodsLoading
,
setExchangeGoodsLoading
]
=
useState
(
false
);
const
[
exchangeAddress
,
setExchangeAddress
]
=
useState
<
ExchangeAddressValues
>
(
null
);
const
[
returnAddress
,
setReturnAddress
]
=
useState
<
ReturnAddressValues
>
(
null
);
// 获取换货申请详情
const
getDetailInfo
=
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoloading
(
true
);
PublicApi
.
getAsReplaceGoodsGetDetailBySupplier
({
replaceId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
faultFileList
,
...
rest
}
=
res
.
data
;
setDetailInfo
({
faultFileList
,
fileList
:
faultFileList
.
map
(
item
=>
normalizeFiledata
(
item
.
filePath
)),
...
rest
,
});
}
}).
finally
(()
=>
{
setInfoloading
(
false
);
});
};
// 获取换货明细列表
const
getReplaceGoods
=
()
=>
{
if
(
!
id
)
{
return
;
}
setExchangeGoodsLoading
(
true
);
PublicApi
.
getAsReplaceGoodsPageReturnedGoods
({
replaceId
:
id
,
current
:
`
${
1
}
`
,
pageSize
:
`
${
99999
}
`
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setReplaceGoodsList
(
res
.
data
);
}
}).
finally
(()
=>
{
setExchangeGoodsLoading
(
false
);
});
};
const
handleReturn
=
record
=>
{
if
(
!
isEdit
)
{
if
(
!
isEdit
||
!
id
)
{
return
;
}
console
.
log
(
'否后退货'
,
record
)
PublicApi
.
postAsReplaceGoodsSetNeedReturnGoods
({
replaceId
:
+
id
,
replaceGoodsId
:
record
.
productId
,
isNeed
:
record
.
needReplaceName
===
1
?
0
:
1
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
getReplaceGoods
();
}
});
};
const
productColumns
:
EditableColumns
[]
=
[
...
...
@@ -75,8 +143,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
),
},
{
title
:
'ID'
,
dataIndex
:
'
i
d'
,
title
:
'
商品
ID'
,
dataIndex
:
'
productI
d'
,
align
:
'center'
,
},
{
...
...
@@ -101,27 +169,39 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
},
{
title
:
'采购数量'
,
dataIndex
:
'quantity'
,
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
'采购单价'
,
dataIndex
:
'purchasePrice'
,
align
:
'center'
,
},
{
title
:
'采购金额'
,
dataIndex
:
'
a
mount'
,
dataIndex
:
'
purchaseA
mount'
,
align
:
'center'
,
},
{
title
:
'换货数量'
,
dataIndex
:
'
num
'
,
dataIndex
:
'
replaceCount
'
,
align
:
'center'
,
},
{
title
:
'换货原因'
,
dataIndex
:
'reason'
,
dataIndex
:
're
placeRe
ason'
,
align
:
'center'
,
},
{
title
:
'是否需要退货'
,
dataIndex
:
'status'
,
title
:
(
<>
<
span
style=
{
{
marginRight
:
8
}
}
>
是否需要退货
</
span
>
<
Tooltip
title=
"如果商品因为缺陷原因,无法再退回加工后重新使用,可选择不需要退货,选择后,采购方无须退回不良品。"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</>
),
dataIndex
:
'needReplaceName'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<>
...
...
@@ -135,27 +215,19 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
},
];
// 获取换货申请详情
const
getDetailInfo
=
()
=>
{
if
(
!
id
)
{
return
;
}
// setInfoloading(true);
// PublicApi.getAsReturnGoodsGetDetailBySupplier({
// returnId: id,
// }).then(res => {
// if (res.code === 1000) {
// setDetailInfo(res.data);
// }
// }).finally(() => {
// setInfoloading(false);
// });
};
useEffect
(()
=>
{
getDetailInfo
();
getReplaceGoods
();
},
[]);
const
handleExchangeAddressSubmit
=
values
=>
{
setExchangeAddress
(
values
);
};
const
handleReturnAddressSubmit
=
values
=>
{
setReturnAddress
(
values
);
};
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
PageHeaderWrapper
...
...
@@ -188,14 +260,14 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
padding
:
'0 32px'
,
}
}
>
<
Descriptions
.
Item
label=
"申请单摘要
:
"
>
{
detailInfo
?.
applyAbstract
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"申请单摘要"
>
{
detailInfo
?.
applyAbstract
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"采购会员"
>
{
detailInfo
?.
consumerName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"单据时间"
>
{
detailInfo
?.
applyTime
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"外部状态"
>
<
StatusTag
type=
"success"
title=
{
'售后完成'
}
/>
<
StatusTag
type=
{
EXCHANGE_OUTER_STATUS_TAG_MAP
[
detailInfo
?.
outerStatus
]
}
title=
{
detailInfo
?.
outerStatusName
}
/>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"内部状态"
>
<
Badge
color=
{
'#41CC9E'
}
text=
{
'已确认售后完成'
}
/>
<
Badge
color=
{
EXCHANGE_INNER_STATUS_BADGE_MAP
[
detailInfo
?.
innerStatus
]
}
text=
{
detailInfo
?.
innerStatusName
}
/>
</
Descriptions
.
Item
>
</
Descriptions
>
</
PageHeader
>
...
...
@@ -238,13 +310,10 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<
Suspense
fallback=
{
null
}
>
<
ProductList
title=
"换货商品"
rowKey=
"orderRecordId"
columns=
{
productColumns
}
dataSource=
{
[
{
id
:
1
,
applyNo
:
'123'
,
},
]
}
loading=
{
replaceGoodsLoading
}
dataSource=
{
replaceGoodsList
.
data
}
/>
</
Suspense
>
</
Col
>
...
...
@@ -293,33 +362,65 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<
Row
gutter=
{
24
}
>
<
Col
span=
{
6
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
{
/* 相关不良原因举证附件 */
}
<
Suspense
fallback=
{
null
}
>
<
FileList
/>
<
FileList
fileList=
{
detailInfo
?.
fileList
}
/>
</
Suspense
>
</
Col
>
<
Col
span=
{
6
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
{
/* 退货收货地址 */
}
<
Suspense
fallback=
{
null
}
>
<
ReturnAddressInfo
isEdit=
{
isEdit
}
/>
<
ReturnAddressInfo
deliveryAddress=
{
{
id
:
1
,
// 缺
name
:
detailInfo
?.
returnGoodsAddress
?.
receiveUserName
,
phone
:
detailInfo
?.
returnGoodsAddress
?.
receiveUserTel
,
fullAddress
:
detailInfo
?.
returnGoodsAddress
?.
receiveAddress
,
}
}
shippingAddress=
{
{
deliveryType
:
detailInfo
?.
returnGoodsAddress
?.
deliveryType
,
name
:
detailInfo
?.
returnGoodsAddress
?.
sendUserName
,
phone
:
detailInfo
?.
returnGoodsAddress
?.
sendUserTel
,
fullAddress
:
detailInfo
?.
returnGoodsAddress
?.
sendAddress
,
}
}
isEdit=
{
isEdit
}
onSubmit=
{
handleReturnAddressSubmit
}
/>
</
Suspense
>
</
Col
>
<
Col
span=
{
6
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
{
/* 换货收货地址 */
}
<
Suspense
fallback=
{
null
}
>
<
ExchangeAddressInfo
isEdit=
{
isEdit
}
/>
<
ExchangeAddressInfo
deliveryAddress=
{
{
name
:
detailInfo
?.
replaceGoodsAddress
?.
receiveUserName
,
phone
:
detailInfo
?.
replaceGoodsAddress
?.
receiveUserTel
,
fullAddress
:
detailInfo
?.
replaceGoodsAddress
?.
receiveAddress
,
}
}
shippingAddress=
{
{
id
:
1
,
// 缺
deliveryType
:
detailInfo
?.
replaceGoodsAddress
?.
deliveryType
,
name
:
detailInfo
?.
replaceGoodsAddress
?.
sendUserName
,
phone
:
detailInfo
?.
replaceGoodsAddress
?.
sendUserTel
,
fullAddress
:
detailInfo
?.
replaceGoodsAddress
?.
sendAddress
,
}
}
isEdit=
{
isEdit
}
onSubmit=
{
handleExchangeAddressSubmit
}
/>
</
Suspense
>
</
Col
>
{
detailInfo
&&
detailInfo
.
evaluate
&&
(
<
Col
span=
{
6
}
>
{
/* 售后评价 */
}
<
Suspense
fallback=
{
null
}
>
<
Score
/>
<
Score
score=
{
detailInfo
?.
evaluate
?.
level
}
/>
</
Suspense
>
</
Col
>
)
}
</
Row
>
</
Col
>
...
...
@@ -327,8 +428,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
{
/* 内、外部流转记录 */
}
<
Suspense
fallback=
{
null
}
>
<
FlowRecords
outerHistory=
{
[]
}
innerHistory=
{
[]
}
outerHistory=
{
detailInfo
?.
outerRecordList
}
innerHistory=
{
detailInfo
?.
innerRecordList
}
/>
</
Suspense
>
</
Col
>
...
...
src/pages/afterService/exchangeManage/exchangePr1/index.tsx
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-17 18:07:41
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
19 18:28:1
6
* @LastEditTime: 2020-11-
20 15:43:5
6
* @Description: 待提交审核换货申请单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -42,7 +42,7 @@ const ExchangePr1: React.FC = () => {
render
:
(
text
,
record
)
=>
(
<>
<
EyePreview
url=
{
`/memberCenter/afterService/exchangeManage/exchangPr1/detail?id=${record.replaceId}`
}
url=
{
`/memberCenter/afterService/exchangeManage/exchang
e
Pr1/detail?id=${record.replaceId}`
}
>
{
text
}
</
EyePreview
>
...
...
@@ -86,7 +86,7 @@ const ExchangePr1: React.FC = () => {
<>
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/exchangeManage/exchangPr1/verify?id=${record.replaceId}`
)
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/exchangeManage/exchang
e
Pr1/verify?id=${record.replaceId}`
)
}
>
提交审核
</
Button
>
...
...
src/pages/afterService/exchangeManage/exchangePr1/verify.tsx
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
17 18:13:55
* @LastEditTime: 2020-11-
20 15:46:31
* @Description:
*/
import
React
,
{
useState
}
from
'react'
;
...
...
@@ -23,17 +23,17 @@ const ExchangePr1Verify: React.FC = () => {
if
(
!
id
)
{
return
;
}
//
setConfirmLoading(true);
// PublicApi.postAsReturnGoodsSubmitVerify
({
//
applyId: id,
//
...values,
//
}).then(res => {
//
if (res.code === 1000) {
//
history.goBack();
//
}
//
}).finally(() => {
//
setConfirmLoading(false);
//
});
setConfirmLoading
(
true
);
PublicApi
.
postAsReplaceGoodsVerifyStepOne
({
applyId
:
id
,
...
values
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
return
(
...
...
@@ -50,7 +50,6 @@ const ExchangePr1Verify: React.FC = () => {
单据审核
</
Button
>
)
}
isEdit
/>
<
VerifyModal
...
...
src/pages/afterService/exchangeManage/exchangePr2/index.tsx
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-17 18:07:41
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
18 10:11:17
* @LastEditTime: 2020-11-
20 15:47:08
* @Description: 待提交审核换货申请单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
src/pages/afterService/exchangeManage/exchangePr2/verify.tsx
View file @
05511112
...
...
@@ -23,17 +23,17 @@ const ExchangePr2Verify: React.FC = () => {
if
(
!
id
)
{
return
;
}
//
setConfirmLoading(true);
// PublicApi.postAsReturnGoodsSubmitVerify
({
//
applyId: id,
//
...values,
//
}).then(res => {
//
if (res.code === 1000) {
//
history.goBack();
//
}
//
}).finally(() => {
//
setConfirmLoading(false);
//
});
setConfirmLoading
(
true
);
PublicApi
.
postAsReplaceGoodsVerifyStepTwo
({
applyId
:
id
,
...
values
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
return
(
...
...
@@ -50,7 +50,6 @@ const ExchangePr2Verify: React.FC = () => {
单据审核
</
Button
>
)
}
isEdit
/>
<
VerifyModal
...
...
src/pages/afterService/exchangeManage/exchangePrAddDeliver/index.tsx
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
19 18:55:37
* @LastEditTime: 2020-11-
20 16:02:32
* @Description: 待新增换货发货单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -67,7 +67,7 @@ const ExchangePrAddDeliver: React.FC = () => {
},
{
title
:
'申请单摘要'
,
dataIndex
:
'
parentMemberName
'
,
dataIndex
:
'
applyAbstract
'
,
align
:
'center'
,
},
{
...
...
@@ -77,7 +77,7 @@ const ExchangePrAddDeliver: React.FC = () => {
},
{
title
:
'单据时间'
,
dataIndex
:
'
created
'
,
dataIndex
:
'
applyTime
'
,
align
:
'center'
,
},
{
...
...
src/pages/afterService/exchangeManage/exchangePrConfirm/verify.tsx
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
18 10:19:22
* @LastEditTime: 2020-11-
20 15:49:38
* @Description:
*/
import
React
,
{
useState
}
from
'react'
;
...
...
@@ -23,17 +23,17 @@ const ExchangePrConfirmVerify: React.FC = () => {
if
(
!
id
)
{
return
;
}
//
setConfirmLoading(true);
// PublicApi.postAsReturnGoodsSubmit
Verify({
//
applyId: id,
//
...values,
//
}).then(res => {
//
if (res.code === 1000) {
//
history.goBack();
//
}
//
}).finally(() => {
//
setConfirmLoading(false);
//
});
setConfirmLoading
(
true
);
PublicApi
.
postAsReplaceGoodsConfirm
Verify
({
applyId
:
id
,
...
values
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
return
(
...
...
@@ -50,7 +50,6 @@ const ExchangePrConfirmVerify: React.FC = () => {
确认单据
</
Button
>
)
}
isEdit
/>
<
VerifyModal
...
...
src/pages/afterService/exchangeManage/exchangePrSubmit/verify.tsx
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
17 18:13:55
* @LastEditTime: 2020-11-
20 10:47:03
* @Description:
*/
import
React
,
{
useState
}
from
'react'
;
...
...
@@ -23,17 +23,17 @@ const ExchangePrSubmitVerify: React.FC = () => {
if
(
!
id
)
{
return
;
}
//
setConfirmLoading(true);
// PublicApi.postAsReturn
GoodsSubmitVerify({
//
applyId: id,
//
...values,
//
}).then(res => {
//
if (res.code === 1000) {
//
history.goBack();
//
}
//
}).finally(() => {
//
setConfirmLoading(false);
//
});
setConfirmLoading
(
true
);
PublicApi
.
postAsReplace
GoodsSubmitVerify
({
applyId
:
id
,
...
values
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
return
(
...
...
src/pages/lxMall/components/FindMore/index.less
View file @
05511112
...
...
@@ -175,7 +175,7 @@
&_content {
display: flex;
margin-top: 2
4
px;
margin-top: 2
8
px;
.content_text {
flex: 1;
...
...
src/pages/lxMall/pay/components/balance/index.tsx
View file @
05511112
...
...
@@ -44,6 +44,7 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
const
fetchBalanceInfo
=
()
=>
{
let
param
=
{
payType
:
orderInfo
.
ruleConfigurationId
,
parentMemberId
:
orderInfo
.
supplyMembersId
,
parentMemberRoleId
:
orderInfo
.
supplyMembersRoleId
}
...
...
src/pages/lxMall/pay/components/transfer/index.less
View file @
05511112
...
...
@@ -22,6 +22,7 @@
.bank_payway_upload_dragger {
position: relative;
margin-top: 20px;
overflow: hidden;
}
.bank_payway_upload {
...
...
src/pages/lxMall/pay/components/wechat/index.tsx
View file @
05511112
...
...
@@ -64,7 +64,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
}
const
checkPayState
=
()
=>
{
if
(
checkCount
<
12
)
{
if
(
checkCount
<
20
)
{
let
param
=
{
id
:
Number
(
orderId
),
paymentInformationId
:
payInfo
.
paymentInformationId
,
...
...
@@ -82,7 +82,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
checkCount
++
checkTimer
=
setTimeout
(()
=>
{
checkPayState
()
},
5
000
)
},
8
000
)
}
}
else
{
message
.
error
(
res
.
message
)
...
...
src/pages/transaction/components/orderPayModal/index.less
View file @
05511112
...
...
@@ -73,11 +73,11 @@
.codeItem {
width: 48px;
height: 48px;
line-height:
48px
;
line-height:
0.5
;
text-align: center;
background: #FFFFFF;
border: 1px solid #EBECF0;
font-size:
26
px;
font-size:
80
px;
}
.codeInput {
height: 48px;
...
...
src/pages/transaction/components/orderPayModal/index.tsx
View file @
05511112
...
...
@@ -407,7 +407,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
className=
{
style
.
codeItem
}
key=
{
index
}
>
{
code
[
index
]
}
{
code
[
index
]
?.
replace
(
/
[
0-9
]
/g
,
'·'
)
}
</
div
>)
}
<
Input
.
Password
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
05511112
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-1
0-23 16:00:01
* @LastEditTime: 2020-1
1-20 19:01:57
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -321,14 +321,12 @@ export const useBusinessEffects = (context, actions) => {
setFieldValue
(
'supplyMembersName'
,
first
?
first
.
supplyMembersName
:
''
);
setFieldValue
(
'relevanceInvoicesId'
,
first
?
first
.
id
:
null
);
setFieldValue
(
'address'
,
first
?
`
${
first
.
fullAddress
}
${
first
.
receiverName
}
/
${
first
.
phone
}
`
:
''
);
setFieldValue
(
'transport'
,
first
&&
first
.
deliveryType
?
DELIVERY_TYPE
[
first
.
deliveryType
]
:
''
);
// 以下数据只用于收集,不用于展示
setFieldValue
(
'deliveryAddresId'
,
first
?
first
.
deliveryAddresId
:
null
);
setFieldValue
(
'receiverName'
,
first
?
first
.
receiverName
:
''
);
setFieldValue
(
'fullAddress'
,
first
?
first
.
fullAddress
:
''
);
setFieldValue
(
'phone'
,
first
?
first
.
phone
:
''
);
setFieldValue
(
'deliveryType'
,
first
?
first
.
deliveryType
:
null
);
setFieldValue
(
'isDefault'
,
first
?
first
.
isDefault
:
false
);
if
(
!
first
)
{
...
...
@@ -389,6 +387,17 @@ export const useBusinessEffects = (context, actions) => {
setFieldValue
(
'invoicesDetailsRequests'
,
[]);
});
// 关联明细
onFieldInputChange$
(
'invoicesDetailsRequests'
).
subscribe
(
fieldState
=>
{
const
{
value
}
=
fieldState
;
if
(
!
value
.
length
)
{
// 明细数据为空,或者明细每项数据的 商品 未选,物流方式都设置成 ''
setFieldValue
(
'transport'
,
''
);
setFieldValue
(
'deliveryType'
,
null
);
}
});
// 关联明细 商品下拉框 联动商品ID、单价
onFieldInputChange$
(
'invoicesDetailsRequests.*.product'
).
subscribe
(
fieldState
=>
{
const
{
name
,
originAsyncData
,
value
}
=
fieldState
;
...
...
@@ -436,6 +445,25 @@ export const useBusinessEffects = (context, actions) => {
state
.
value
=
`¥0.00`
;
}
);
// 配送方式,一个单据只能有一个配送方式
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.deliveryType`
}),
state
=>
{
state
.
value
=
undefined
;
}
);
const
invoicesDetailsRequestsValue
=
getFieldValue
(
'invoicesDetailsRequests'
);
// 明细每项数据的 商品 未选中,物流方式设置成 ''
if
(
invoicesDetailsRequestsValue
.
every
(
item
=>
!
item
.
product
)
)
{
setFieldValue
(
'transport'
,
''
);
setFieldValue
(
'deliveryType'
,
null
);
}
}
if
(
!
current
)
{
...
...
@@ -482,6 +510,46 @@ export const useBusinessEffects = (context, actions) => {
state
.
value
=
`¥
${(
current
.
purchaseCount
*
current
.
price
).
toFixed
(
2
)}
`
;
}
);
// 配送方式,一个单据只能有一个配送方式
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.deliveryType`
}),
state
=>
{
state
.
value
=
current
.
logistics
&&
current
.
logistics
.
deliveryType
?
current
.
logistics
.
deliveryType
:
undefined
;
}
);
setTimeout
(()
=>
{
const
invoicesDetailsRequestsValue
=
getFieldValue
(
'invoicesDetailsRequests'
);
// 配送方式,一个单据只能有一个配送方式
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.product`
}),
state
=>
{
if
(
current
.
logistics
&&
invoicesDetailsRequestsValue
.
some
(
item
=>
item
.
deliveryType
&&
item
.
deliveryType
!==
current
.
logistics
.
deliveryType
)
)
{
state
.
errors
=
'商品配送方式不一致,请保持一次性'
;
}
else
{
state
.
errors
=
''
;
}
}
);
// 明细每项数据的 商品 选中,物流方式设置成 为对应商品的物流方式
if
(
current
.
logistics
&&
current
.
logistics
.
deliveryType
&&
invoicesDetailsRequestsValue
.
every
(
item
=>
item
.
deliveryType
===
current
.
logistics
.
deliveryType
)
)
{
setFieldValue
(
'transport'
,
DELIVERY_TYPE
[
current
.
logistics
.
deliveryType
]);
setFieldValue
(
'deliveryType'
,
current
.
logistics
.
deliveryType
);
}
},
0
);
});
// 关联明细 商品数量 联动计算商品金额
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.tsx
View file @
05511112
...
...
@@ -33,6 +33,8 @@ import {
DOC_TYPE_RETURN_RECEIPT
,
DOC_TYPE_EXCHANGE_INVOICE
,
DOC_TYPE_EXCHANGE_RECEIPT
,
DELIVERY_TYPE
,
}
from
'@/constants'
;
import
{
addBillSchema
,
goodsSearchSchema
}
from
'./schema'
;
import
{
createEffects
}
from
'./effects'
;
...
...
@@ -141,6 +143,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
deliveryType
,
isDefault
,
invoicesDetailsList
,
transport
,
...
rest
}
=
res
.
data
;
...
...
@@ -148,6 +151,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
...
item
,
product
:
item
.
productId
,
amount
:
`¥
${(
+
item
.
productCount
*
item
.
price
).
toFixed
(
2
)}
`
,
deliveryType
,
}))
:
[];
addSchemaAction
.
setFieldState
(
...
...
@@ -170,7 +174,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
fullAddress
:
fullAddress
||
''
,
receiverName
:
receiverName
||
''
,
phone
:
phone
||
''
,
deliveryType
,
//
deliveryType,
isDefault
,
}
]
:
...
...
@@ -178,10 +182,9 @@ const BillsForm: React.FC<BillsFormProps> = ({
,
invoicesDetailsRequests
:
details
,
...
rest
,
deliveryType
,
transport
:
DELIVERY_TYPE
[
deliveryType
],
});
productRowCtl
.
setSelectRow
(
details
);
productRowCtl
.
setSelectedRowKeys
(
details
.
map
(
item
=>
item
.
id
));
}).
finally
(()
=>
{
setInfoLoading
(
false
);
});
...
...
@@ -378,6 +381,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const
newInvoicesDetailsRequests
=
invoicesDetailsRequests
.
map
(({
product
,
productCount
,
deliveryType
,
...
rest
})
=>
({
productCount
:
+
productCount
,
...
...
@@ -537,11 +541,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const
values
=
[];
productRowCtl
.
selectRow
.
forEach
(
item
=>
{
const
existing
=
preValues
.
find
(
val
=>
val
.
goodsId
===
item
.
id
);
const
atom
=
existing
?
existing
:
{
const
atom
=
{
itemNo
:
item
.
code
,
goodsId
:
item
.
id
,
itemNmae
:
item
.
name
,
...
...
@@ -559,7 +559,9 @@ const BillsForm: React.FC<BillsFormProps> = ({
};
values
.
push
(
atom
);
});
addSchemaAction
.
setFieldValue
(
'invoicesDetailsRequests'
,
values
);
addSchemaAction
.
setFieldValue
(
'invoicesDetailsRequests'
,
preValues
.
concat
(
values
));
productRowCtl
.
setSelectRow
([]);
productRowCtl
.
setSelectedRowKeys
([]);
setVisible
(
false
);
}
...
...
@@ -575,15 +577,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
}
const
handleRemoveItem
=
(
index
:
number
)
=>
{
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
);
};
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/schema/index.ts
View file @
05511112
...
...
@@ -340,7 +340,7 @@ export const addBillSchema: ISchema = {
type
:
'string'
,
'x-component'
:
'Text'
,
title
:
'物流方式'
,
default
:
''
,
// default: '', // 奇了怪了,initialValues 覆盖不了 default,就这个字段会
},
// 不用于展示,只用于收集值
deliveryAddresId
:
{
...
...
@@ -450,7 +450,7 @@ export const addBillSchema: ISchema = {
'x-component-props'
:
{
allowClear
:
true
,
style
:
{
width
:
1
0
0
,
width
:
1
8
0
,
},
},
'x-rules'
:
[
...
...
@@ -460,11 +460,6 @@ export const addBillSchema: ISchema = {
},
],
},
// 不用于展示,只收集值
productName
:
{
type
:
'string'
,
display
:
false
,
},
productId
:
{
type
:
'string'
,
title
:
'商品ID'
,
...
...
@@ -497,6 +492,16 @@ export const addBillSchema: ISchema = {
title
:
'金额'
,
'x-component'
:
'Text'
,
},
// 不用于展示,只收集值
productName
:
{
type
:
'string'
,
display
:
false
,
},
// 配送方式,不用于展示,只收集值
deliveryType
:
{
type
:
'string'
,
display
:
false
,
},
},
}
},
...
...
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