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
def7f675
Commit
def7f675
authored
Aug 23, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
b86060d8
3d23566e
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
356 additions
and
80 deletions
+356
-80
index.tsx
src/components/AddressSelect/index.tsx
+18
-1
index.tsx
src/pages/payandSettle/paySetting/index.tsx
+69
-2
index.tsx
.../components/detailLayout/components/basicLayout/index.tsx
+2
-0
addForm.tsx
...ion/dealAbility/productInquiry/waitAddInquiry/addForm.tsx
+21
-7
inquiryProduct.tsx
...oductInquiry/waitAddInquiry/components/inquiryProduct.tsx
+2
-0
tradeTerms.tsx
...y/productInquiry/waitAddInquiry/components/tradeTerms.tsx
+12
-2
two.tsx
...saction/dealAbility/productInquiry/waitAddInquiry/two.tsx
+1
-16
constants.tsx
...action/marketingAbility/paltformSign/detail/constants.tsx
+3
-3
index.tsx
...readySubmitExamine/components/collocationLayout/index.tsx
+0
-0
columns.tsx
...ty/paltformSign/readySubmitExamine/components/columns.tsx
+6
-3
index.tsx
...nents/listModalLayout/components/collapseLayout/index.tsx
+16
-2
index.tsx
...onents/listModalLayout/components/productLayout/index.tsx
+28
-11
index.tsx
...n/readySubmitExamine/components/listModalLayout/index.tsx
+36
-11
EditableCell.tsx
...bmitExamine/components/productListLayout/EditableCell.tsx
+36
-18
index.tsx
...readySubmitExamine/components/productListLayout/index.tsx
+17
-1
remind.ts
...readySubmitExamine/components/productListLayout/remind.ts
+86
-0
constants.tsx
...tingAbility/paltformSign/readySubmitExamine/constants.tsx
+3
-3
No files found.
src/components/AddressSelect/index.tsx
View file @
def7f675
...
...
@@ -54,6 +54,14 @@ interface IProps {
* 是否可编辑的
*/
editable
?:
boolean
,
/**
* 是否显示下拉框
*/
echo
?:
boolean
,
/**
* 只显示文字
*/
extra
?:
React
.
ReactNode
,
}
export
type
SubmitValuesType
=
{
...
...
@@ -111,6 +119,8 @@ const AddressSelect: React.FC<IProps> = (props) => {
isDefaultAddress
=
false
,
disabled
=
false
,
editable
=
true
,
echo
=
false
,
extra
,
}
=
props
;
const
[
list
,
setList
]
=
useState
<
AddressValueType
[]
>
([]);
const
[
internalValue
,
setInternalValue
]
=
useState
<
AddressValueType
>
();
...
...
@@ -412,7 +422,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
value
:
v
.
code
,
})));
});
const
res
=
addressType
===
2
?
await
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
`
${
id
}
`
})
:
await
PublicApi
.
getLogisticsReceiverAddressGet
({
id
:
`
${
id
}
`
});
const
res
=
addressType
===
2
?
await
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
`
${
id
}
`
})
:
await
PublicApi
.
getLogisticsReceiverAddressGet
({
id
:
`
${
id
}
`
});
if
(
res
.
code
===
1000
)
{
formActions
.
setFieldValue
(
'name'
,
addressType
===
2
?
(
res
.
data
as
GetLogisticsShipperAddressGetResponse
).
shipperName
:
(
res
.
data
as
GetLogisticsReceiverAddressGetResponse
).
receiverName
);
formActions
.
setFieldValue
(
'provinceCode'
,
res
.
data
.
provinceCode
);
...
...
@@ -471,6 +481,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
}
}
>
<
div
className=
{
styles
[
'address-select'
]
}
>
{
!
echo
&&
(
<
div
className=
{
styles
[
'address-select-input'
]
}
>
<
Select
options=
{
options
}
...
...
@@ -482,6 +493,12 @@ const AddressSelect: React.FC<IProps> = (props) => {
}
}
/>
</
div
>
)
}
{
echo
&&
(
<
div
className=
{
styles
[
'address-select-input'
]
}
>
{
extra
}
</
div
>
)
}
<
Button
onClick=
{
()
=>
handleVisibleDrawer
(
true
)
}
className=
{
styles
[
'address-select-action'
]
}
...
...
src/pages/payandSettle/paySetting/index.tsx
View file @
def7f675
import
React
,
{
useEffect
,
useState
,
Fragment
}
from
'react'
;
import
PeripheralLayout
from
'@/pages/transaction/components/detailLayout'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
Tabs
,
Form
,
Button
,
Radio
,
Table
,
Space
,
Image
,
Popconfirm
}
from
'antd'
;
import
{
Tabs
,
Form
,
Button
,
Radio
,
Table
,
Space
,
Image
,
Popconfirm
,
Empty
,
Input
}
from
'antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
Card
from
'@/pages/transaction/components/card'
;
import
style
from
'./index.less'
;
...
...
@@ -13,6 +13,7 @@ import alipay from '@/assets/icons/alipay_icon.png';
import
wechat
from
'@/assets/icons/wechat_icon.png'
;
import
unionpay
from
'@/assets/icons/unionpay_icon.png'
;
import
balance
from
'@/assets/icons/balance_icon.png'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
const
PIC_MAP
=
{
1
:
alipay
,
...
...
@@ -68,6 +69,7 @@ const PaySettingLayout = () => {
const
[
value
,
setValue
]
=
useState
<
parameters
>
({});
const
[
isEdit
,
setIsEdit
]
=
useState
<
boolean
>
(
false
);
const
[
editIndex
,
setEditIndex
]
=
useState
<
number
>
(
0
);
const
[
empty
,
setEmpty
]
=
useState
<
boolean
>
(
false
);
const
columns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -107,6 +109,7 @@ const PaySettingLayout = () => {
useEffect
(()
=>
{
PublicApi
.
getOrderMemberPaymentParameterFind
().
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
setEmpty
(
true
)
return
}
const
{
data
}
=
res
...
...
@@ -246,6 +249,7 @@ const PaySettingLayout = () => {
}
return
(
<>
<
PeripheralLayout
onBack
hideBreak
...
...
@@ -262,6 +266,7 @@ const PaySettingLayout = () => {
}
components=
{
<
Fragment
>
{
!
empty
&&
(
<
Form
{
...
layout
}
form=
{
form
}
>
{
parameterFind
.
map
((
item
,
index
)
=>
(
<
Card
...
...
@@ -325,7 +330,7 @@ const PaySettingLayout = () => {
))
}
</
Tabs
>
)
}
{
item
.
payType
!==
1
&&
(
{
(
item
.
payType
!==
1
&&
item
.
payType
!==
3
)
&&
(
<
Fragment
>
{
item
.
channels
.
map
((
_item
,
_index
)
=>
(
<
Fragment
key=
{
_item
.
payChannel
}
>
...
...
@@ -347,10 +352,70 @@ const PaySettingLayout = () => {
))
}
</
Fragment
>
)
}
{
item
.
payType
===
3
&&
(
<
Fragment
>
{
item
.
channels
.
map
((
_item
,
_index
)
=>
(
<
Fragment
key=
{
_item
.
payChannel
}
>
<
Form
.
Item
label=
{
_item
.
payChannelName
}
name=
{
`payChannel_${_item.payChannel}`
}
initialValue=
{
`_${_item.payChannel}`
}
>
<
Radio
.
Group
size=
"small"
buttonStyle=
"solid"
onChange=
{
(
e
)
=>
handleRadioChang
(
e
,
item
.
payType
)
}
>
<
Radio
.
Button
value=
{
_item
.
payChannel
}
>
是
</
Radio
.
Button
>
<
Radio
.
Button
value=
{
`_${_item.payChannel}`
}
>
否
</
Radio
.
Button
>
</
Radio
.
Group
>
</
Form
.
Item
>
<
Form
.
Item
noStyle
shouldUpdate=
{
(
prevValues
,
currentValues
)
=>
prevValues
[
`payChannel_${_item.payChannel}`
]
!==
currentValues
[
`payChannel_${_item.payChannel}`
]
}
>
{
({
getFieldValue
})
=>
(
getFieldValue
(
`payChannel_${_item.payChannel}`
)
===
6
)
&&
(
<
Fragment
>
<
Form
.
Item
label=
'授信额度设置'
>
<
Space
direction=
'vertical'
style=
{
{
width
:
'100%'
}
}
>
初始申请额度不超过:
<
Input
type=
'number'
addonAfter=
'人民币'
/>
允许满:
<
Input
type=
'number'
addonAfter=
'天'
/>
申请上调:
<
Input
type=
'number'
addonAfter=
'%'
/>
</
Space
>
</
Form
.
Item
>
</
Fragment
>
)
}
</
Form
.
Item
>
</
Fragment
>
))
}
</
Fragment
>
)
}
</
div
>
</
Card
>
))
}
</
Form
>
)
}
{
empty
&&
(
<
Card
>
<
Empty
image=
"https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
imageStyle=
{
{
height
:
60
,
}
}
description=
{
<
span
>
平台还未配置您的支付方式,请联系平台客服
</
span
>
}
/>
</
Card
>
)
}
<
ModalLayout
value=
{
value
}
visible=
{
visible
}
...
...
@@ -361,6 +426,8 @@ const PaySettingLayout = () => {
</
Fragment
>
}
/>
</>
)
}
export
default
PaySettingLayout
;
src/pages/transaction/components/detailLayout/components/basicLayout/index.tsx
View file @
def7f675
...
...
@@ -13,6 +13,8 @@ const count = 0;
const
BasicLayout
:
React
.
FC
<
BasicInfoProps
>
=
(
props
:
any
)
=>
{
const
{
effect
}
=
props
;
console
.
log
(
effect
)
return
(
<
Card
id=
'basicLayout'
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/addForm.tsx
View file @
def7f675
...
...
@@ -10,7 +10,6 @@ import { SaveOutlined } from "@ant-design/icons";
import
AttachLayout
from
"./components/attach"
;
import
{
getCookie
}
from
'@/utils/cookie'
import
{
PublicApi
}
from
"@/services/api"
;
import
{
isEmpty
}
from
"lodash"
;
const
layout
:
any
=
{
colon
:
false
,
...
...
@@ -69,7 +68,9 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
phoneCode
:
res
.
phoneCode
,
shopId
:
res
.
shopId
,
}
id
&&
(
params
.
id
=
id
);
if
(
id
&&
!
two
)
{
params
.
id
=
id
}
fetchRequest
({
...
params
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
setLoading
(
false
)
...
...
@@ -167,6 +168,10 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
memberId
:
data
.
memberId
,
memberRoleId
:
data
.
memberRoleId
,
taxRate
:
data
.
taxRate
,
upperMemberId
:
data
.
upperMemberId
,
upperMemberName
:
data
.
upperMemberName
,
upperMemberRoleId
:
data
.
upperMemberRoleId
,
upperMemberRoleName
:
data
.
upperMemberRoleName
,
})
setMenberInfo
({
memberId
:
data
.
memberId
,
...
...
@@ -189,7 +194,10 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
const
{
data
}
=
res
;
const
inquiryListProductRequests
:
any
[]
=
[];
setEnclosureUrls
(
data
.
enclosureUrls
)
setFullAddress
()
setFullAddress
({
fullAddress
:
data
.
fullAddress
,
fullAddressId
:
data
.
fullAddressId
,
})
if
(
two
)
{
PublicApi
.
getTransactionInquiryGetUpperMemberCommodity
({
inquiryId
:
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
...
...
@@ -208,23 +216,29 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
logistics
:
''
,
memberId
:
item
.
memberId
,
memberRoleId
:
item
.
memberRoleId
,
taxRate
:
item
.
taxRate
taxRate
:
item
.
taxRate
,
upperMemberId
:
item
.
upperMemberId
,
upperMemberName
:
item
.
upperMemberName
,
upperMemberRoleId
:
item
.
upperMemberRoleId
,
upperMemberRoleName
:
item
.
upperMemberRoleName
,
})
})
setMenberInfo
({
memberId
:
res
.
data
.
memberId
,
roleId
:
res
.
data
.
memberRoleId
,
roleName
:
res
.
data
.
memberName
,
roleName
:
res
.
data
.
member
Role
Name
,
})
setInquiryProduct
(
inquiryListProductRequests
)
})
form
.
setFieldsValue
({
...
data
,
deliveryTime
:
moment
(
data
.
deliveryTime
),
quotationAsTime
:
moment
(
data
.
quotationAsTime
),
"inquiryListProductRequests"
:
inquiryListProductRequests
,
"enclosureUrls"
:
data
.
enclosureUrls
,
memberName
:
res
.
data
.
memberName
,
})
})
}
else
{
setMenberInfo
({
...
...
@@ -291,7 +305,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
>
<
BasicInfoLatyout
getMemberInfo=
{
getMemberInfo
}
memb=
{
memberInfo
}
isEdit=
{
spam
||
two
}
/>
<
InquiryProductLayout
getInquiryProduct=
{
getInquiryProduct
}
member=
{
memberInfo
}
setInquiryProduct=
{
inquiryProduct
}
/>
<
TradeTermsLayout
getFullAddress=
{
getFullAddress
}
getContacts=
{
getContacts
}
fullAddress=
{
fullAddress
}
/>
<
TradeTermsLayout
isEdit=
{
two
}
getFullAddress=
{
getFullAddress
}
getContacts=
{
getContacts
}
fullAddress=
{
fullAddress
}
/>
<
AttachLayout
enclosureUrls=
{
enclosureUrls
}
getEnclosureUrls=
{
getEnclosureUrls
}
removeEnclosureUrls=
{
removeEnclosureUrls
}
/>
</
Form
>
}
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/inquiryProduct.tsx
View file @
def7f675
...
...
@@ -145,6 +145,8 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
taxRate
:
v
.
taxRate
,
upperCommoditySkuId
:
v
.
commodityUnitPriceAndPicId
,
upperMemberId
:
v
.
upperMemberId
,
upperMemberName
:
v
.
upperMemberName
,
upperMemberRoleName
:
v
.
upperMemberRoleName
,
upperMemberRoleId
:
v
.
upperMemberRoleId
,
})
})
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/tradeTerms.tsx
View file @
def7f675
...
...
@@ -22,10 +22,12 @@ interface TradeTermsLayoutProps {
getContacts
?:
(
e
)
=>
void
,
/** 回显数据 */
fullAddress
?:
any
,
/** 二次询价 */
isEdit
?:
boolean
,
}
const
TradeTermsLayout
:
React
.
FC
<
TradeTermsLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
getFullAddress
,
getContacts
,
fullAddress
}
=
props
;
const
{
getFullAddress
,
getContacts
,
fullAddress
,
isEdit
}
=
props
;
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
)
const
[
address
,
setaddress
]
=
useState
<
any
>
({});
const
[
telCode
,
setTelCode
]
=
useState
<
any
>
([]);
...
...
@@ -111,7 +113,15 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'交付地址'
>
<
AddressSelect
value=
{
address
}
isDefaultAddress
addressType=
{
1
}
disabled=
{
false
}
onChange=
{
getFullAddress
}
/>
<
AddressSelect
echo=
{
isEdit
}
extra=
{
fullAddress
.
fullAddress
}
value=
{
address
}
isDefaultAddress
addressType=
{
1
}
disabled=
{
false
}
onChange=
{
getFullAddress
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'报价截止时间'
name=
'quotationAsTime'
rules=
{
[{
required
:
true
,
message
:
'请选择报价截止时间'
}]
}
>
<
DatePicker
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/two.tsx
View file @
def7f675
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
React
from
'react'
;
import
AddForm
from
'./addForm'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
isEmpty
}
from
'lodash'
;
const
RfqEnquiryOrder
=
(
props
:
any
)
=>
{
const
{
id
}
=
history
.
location
.
query
;
const
[
spam
,
setSpam
]
=
useState
<
any
>
({});
const
handleGetSpam
=
useCallback
(
async
()
=>
{
await
PublicApi
.
getTransactionInquiryGetUpperMemberCommodity
({
inquiryId
:
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
setSpam
(
res
.
data
)
})
},
[])
useEffect
(()
=>
{
handleGetSpam
()
},
[])
return
(
<
AddForm
...
...
src/pages/transaction/marketingAbility/paltformSign/detail/constants.tsx
View file @
def7f675
...
...
@@ -286,18 +286,18 @@ export const GeneralEffect = (int, data) => {
return
[
{
col
:
[
{
label
:
'每日秒杀时间段'
,
extra
:
''
},
{
label
:
'每日秒杀时间段'
,
extra
:
`
${
format
(
data
.
startTime
,
'HH:mm:ss'
)}
~
${
format
(
data
.
endTime
,
'HH:mm:ss'
)}
`
},
{
label
:
'活动描述'
,
extra
:
data
.
describe
}
]
},
{
col
:
[
{
label
:
'叠加优惠券'
,
extra
:
'
'
},
{
label
:
'叠加优惠券'
,
extra
:
data
.
allowCoupon
?
'允许叠加'
:
'不允许叠加
'
},
]
},
{
col
:
[
{
label
:
'超限规则'
,
extra
:
'
'
},
{
label
:
'超限规则'
,
extra
:
data
.
exceedRule
===
1
?
'原价购买'
:
'不可购买
'
},
]
}
]
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/collocationLayout/index.tsx
View file @
def7f675
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/columns.tsx
View file @
def7f675
...
...
@@ -459,7 +459,9 @@ export const Columns = (int) => {
秒杀价格
<
QuestionCircleOutlined
/>
</
Tooltip
>,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
editable
:
true
,
},
{
title
:
'个人限购数量'
,
...
...
@@ -475,8 +477,9 @@ export const Columns = (int) => {
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
key
:
'operation'
,
dataIndex
:
'operation'
,
operation
:
true
,
},
]
case
14
:
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/listModalLayout/components/collapseLayout/index.tsx
View file @
def7f675
...
...
@@ -3,7 +3,21 @@ import { CaretRightOutlined, DeleteOutlined } from '@ant-design/icons';
import
cx
from
'classnames'
;
import
style
from
'../../index.less'
;
type
RemindLayoutProps
=
{
/** 弹窗标题 */
modalTitle
?:
string
,
/** 选择商品按钮名称 */
buttonTitle
?:
string
,
/** 列表标题 */
listTitle
?:
string
/** 列表label */
label
?:
{[
key
:
number
]:
string
},
/** 提醒 */
message
?:
{[
key
:
number
]:
string
},
}
interface
CollapseLayoutProps
{
/** message */
remind
?:
RemindLayoutProps
,
/** 组编号优惠阶梯换购阶梯 */
index
:
number
,
/** 删除一个 */
...
...
@@ -11,7 +25,7 @@ interface CollapseLayoutProps {
}
const
CollapseLayout
:
React
.
FC
<
CollapseLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
children
,
index
,
deletion
}
=
props
;
const
{
remind
,
children
,
index
,
deletion
}
=
props
;
const
[
isActive
,
setIsActive
]
=
useState
<
boolean
>
(
false
);
useEffect
(()
=>
{
...
...
@@ -26,7 +40,7 @@ const CollapseLayout: React.FC<CollapseLayoutProps> = (props: any) => {
{
/* 头部 */
}
<
div
className=
{
style
.
collapse_header
}
onClick=
{
()
=>
setIsActive
(
!
isActive
)
}
>
<
CaretRightOutlined
rotate=
{
isActive
?
90
:
0
}
/>
<
span
className=
{
style
.
collapse_arrow
}
>
搭配商品
</
span
>
<
span
className=
{
style
.
collapse_arrow
}
>
{
remind
.
listTitle
}
</
span
>
<
DeleteOutlined
onClick=
{
()
=>
deletion
(
index
)
}
/>
</
div
>
{
/* 内容 */
}
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/listModalLayout/components/productLayout/index.tsx
View file @
def7f675
import
React
,
{
Fragment
,
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Input
,
Row
,
Col
,
Image
}
from
'antd'
;
import
{
Form
,
Input
,
Row
,
Col
,
Image
,
Space
}
from
'antd'
;
import
{
DeleteOutlined
}
from
'@ant-design/icons'
;
import
style
from
'../../index.less'
;
...
...
@@ -26,7 +26,22 @@ type ListProps = {
productImgUrl
?:
string
}
type
RemindLayoutProps
=
{
/** 弹窗标题 */
modalTitle
?:
string
,
/** 选择商品按钮名称 */
buttonTitle
?:
string
,
/** 列表标题 */
listTitle
?:
string
/** 列表label */
label
?:
{
[
key
:
number
]:
string
},
/** 提醒 */
message
?:
{
[
key
:
number
]:
string
},
}
export
interface
ProductLayoutProps
{
/** message */
remind
?:
RemindLayoutProps
,
/** 最外层标号 */
index
:
number
,
/** list 数据 */
...
...
@@ -38,7 +53,7 @@ export interface ProductLayoutProps {
}
const
ProductLayout
:
React
.
FC
<
ProductLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
index
,
list
,
onDeletion
,
onEntry
}
=
props
;
const
{
remind
,
index
,
list
,
onDeletion
,
onEntry
}
=
props
;
const
handleChange
=
(
e
,
name
,
_index
?)
=>
{
onEntry
(
name
,
Number
(
e
.
target
.
value
),
_index
)
...
...
@@ -48,22 +63,24 @@ const ProductLayout: React.FC<ProductLayoutProps> = (props: any) => {
<
Fragment
>
{
/* 套餐价格 */
}
<
Form
.
Item
name=
{
`
groupPrice
_${index}`
}
label=
'套餐价格'
rules=
{
[{
required
:
true
,
message
:
'请输入套餐价格'
}]
}
name=
{
`
${remind.type}
_${index}`
}
label=
{
remind
.
label
[
1
]
}
rules=
{
[{
required
:
true
,
message
:
remind
.
message
[
4
]
}]
}
>
<
Input
addon
After=
'元'
onBlur=
{
(
e
)
=>
handleChange
(
e
,
'groupPrice'
)
}
/>
<
Input
addon
Before=
{
remind
.
type
===
'limitValue'
&&
'买'
}
addonAfter=
{
remind
.
label
[
2
]
}
onBlur=
{
(
e
)
=>
handleChange
(
e
,
`${remind.type}`
)
}
/>
</
Form
.
Item
>
{
/* 搭配商品 */
}
{
list
.
map
((
_item
:
ListProps
,
_index
:
number
)
=>
(
<
div
key=
{
`list_${_index + 1}`
}
>
<
div
className=
{
style
.
productLayout_title
}
>
<
span
className=
{
style
.
productLayout_arrow
}
>
搭配商品
{
_index
+
1
}
</
span
>
<
span
className=
{
style
.
productLayout_arrow
}
>
{
remind
.
label
[
3
]
}{
_index
+
1
}
</
span
>
<
DeleteOutlined
onClick=
{
()
=>
onDeletion
(
_index
)
}
/>
</
div
>
<
div
className=
{
style
.
productLayout_contenxt
}
>
<
Form
.
Item
label=
'搭配商品'
label=
{
remind
.
label
[
3
]
}
className=
{
style
.
productLayout_formItem
}
>
<
div
className=
{
style
.
productLayout_item
}
>
...
...
@@ -87,11 +104,11 @@ const ProductLayout: React.FC<ProductLayoutProps> = (props: any) => {
</
div
>
</
Form
.
Item
>
<
Form
.
Item
label=
'搭配数量'
label=
{
remind
.
label
[
4
]
}
name=
{
`num_${index}_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入搭配数量'
}]
}
rules=
{
[{
required
:
true
,
message
:
remind
.
message
[
5
]
}]
}
>
<
Input
addonAfter=
{
_item
.
unit
}
onBlur=
{
(
e
)
=>
handleChange
(
e
,
'num'
,
_index
)
}
/>
<
Input
addonAfter=
{
_item
.
unit
}
onBlur=
{
(
e
)
=>
handleChange
(
e
,
'num'
,
_index
)
}
/>
</
Form
.
Item
>
</
div
>
</
div
>
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/listModalLayout/index.tsx
View file @
def7f675
...
...
@@ -9,11 +9,25 @@ import CollocationLayout from '../collocationLayout';
const
layout
:
any
=
{
labelCol
:
{
style
:
{
width
:
"100px"
}
},
labelAlign
:
"left"
,
validateFirst
:
true
};
type
RemindLayoutProps
=
{
/** 弹窗标题 */
modalTitle
?:
string
,
/** 选择商品按钮名称 */
buttonTitle
?:
string
,
/** 列表标题 */
listTitle
?:
string
/** 列表label */
label
?:
{[
key
:
number
]:
string
},
/** 提醒 */
message
?:
{[
key
:
number
]:
string
},
}
interface
ListModalLayoutProps
{
idNotInList
?:
number
[],
/** messges */
remind
?:
RemindLayoutProps
,
/** 数据回显 */
value
?:
any
[],
/** 设置标题 */
...
...
@@ -63,7 +77,7 @@ interface GoodsSubsidiaryListProps {
}
const
ListModalLayout
:
React
.
FC
<
ListModalLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
idNotInList
,
value
,
shopIdList
,
title
,
visible
,
onClose
,
onConfirm
}
=
props
;
const
{
idNotInList
,
remind
,
value
,
shopIdList
,
title
,
visible
,
onClose
,
onConfirm
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
dataSource
,
setDataSource
]
=
useState
<
GoodsSubsidiaryListProps
[]
>
([]);
const
[
tableModalVisible
,
setTableModalVisible
]
=
useState
<
boolean
>
(
false
);
...
...
@@ -94,7 +108,6 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
})]
}
form
.
setFieldsValue
({
'dataSource'
:
fields
,
[
`dataSource_
${
idx
}
`
]:
fields
[
idx
].
list
,
})
setDataSource
(
fields
);
...
...
@@ -102,7 +115,7 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
const
handleSubmit
=
(
selectRowRecord
:
any
)
=>
{
if
(
isEmpty
(
selectRowRecord
))
{
message
.
warning
(
'请选择搭配商品!'
)
message
.
warning
(
remind
.
message
[
1
]
)
return
}
handleComposed
(
selectRowRecord
)
...
...
@@ -111,6 +124,10 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
const
handleClick
=
()
=>
{
form
.
validateFields
().
then
(
_res
=>
{
if
(
isEmpty
(
_res
))
{
message
.
warning
(
remind
.
message
[
2
])
return
}
onConfirm
(
dataSource
)
})
}
...
...
@@ -142,10 +159,11 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
const
handleDeletion
=
(
index
:
number
)
=>
{
const
fields
=
[...
dataSource
];
fields
.
splice
(
index
,
1
);
form
.
resetFields
()
fields
.
forEach
((
item
,
_index
)
=>
{
item
.
list
.
forEach
((
_item
,
__index
)
=>
{
form
.
setFieldsValue
({
'dataSource'
:
fields
,
[
`limitValue_
${
_index
}
`
]:
item
.
limitValue
,
[
`groupPrice_
${
_index
}
`
]:
item
.
groupPrice
,
[
`num_
${
_index
}
_
${
__index
}
`
]:
_item
.
num
,
})
...
...
@@ -164,10 +182,12 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
const
handleDeletionColloCation
=
(
index
:
number
,
_index
:
number
)
=>
{
const
fields
:
GoodsSubsidiaryListProps
[]
=
[...
dataSource
];
fields
[
index
].
list
.
splice
(
_index
,
1
);
form
.
resetFields
()
fields
.
forEach
((
item
,
_index
)
=>
{
item
.
list
.
forEach
((
_item
,
__index
)
=>
{
form
.
setFieldsValue
({
'dataSource'
:
fields
,
[
`limitValue_
${
_index
}
`
]:
item
.
limitValue
,
[
`groupPrice_
${
_index
}
`
]:
item
.
groupPrice
,
[
`num_
${
_index
}
_
${
__index
}
`
]:
_item
.
num
,
})
})
...
...
@@ -178,8 +198,10 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
/** 输入一个价格或者数量 */
const
handleEntryNumber
=
(
index
:
number
,
name
:
string
,
num
:
number
,
_index
?:
number
)
=>
{
const
fields
:
GoodsSubsidiaryListProps
[]
=
[...
dataSource
];
console
.
log
(
name
)
if
(
name
===
'groupPrice'
||
name
===
'limitValue'
)
{
fields
[
index
][
name
]
=
Number
(
num
);
console
.
log
(
fields
[
index
][
name
])
}
else
{
fields
[
index
].
list
[
_index
][
name
]
=
Number
(
num
);
}
...
...
@@ -187,12 +209,13 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
}
useEffect
(()
=>
{
console
.
log
(
value
,
10086
)
const
fields
=
[...
value
];
fields
.
forEach
((
item
,
_index
)
=>
{
item
.
list
.
forEach
((
_item
,
__index
)
=>
{
form
.
setFieldsValue
({
'dataSource'
:
fields
,
[
`dataSource_
${
_index
}
`
]:
fields
[
_index
].
list
,
[
`limitValue_
${
_index
}
`
]:
item
.
limitValue
,
[
`groupPrice_
${
_index
}
`
]:
item
.
groupPrice
,
[
`num_
${
_index
}
_
${
__index
}
`
]:
_item
.
num
,
})
...
...
@@ -206,25 +229,28 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
width=
{
600
}
title=
{
title
}
visible=
{
visible
}
destroyOnClose
onClose=
{
onClose
}
footer=
{
renderFooter
()
}
>
{
/* 分组列表 */
}
<
Form
{
...
layout
}
form=
{
form
}
>
<
Form
.
Item
style=
{
{
marginBottom
:
'0px'
}
}
name=
'dataSource'
rules=
{
[{
required
:
true
,
message
:
'请设置搭配商品'
}]
}
>
{
dataSource
.
map
((
item
:
GoodsSubsidiaryListProps
,
index
:
number
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
'0px'
}
}
name=
{
`dataSource_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请选择搭配商品'
}]
}
rules=
{
[{
required
:
true
,
message
:
remind
.
message
[
3
]
}]
}
key=
{
`CollapseLayout_${index}`
}
>
<
CollapseLayout
index=
{
index
}
remind=
{
remind
}
deletion=
{
handleDeletion
}
>
{
!
isEmpty
(
item
.
list
)
&&
(
<
ProductLayout
index=
{
index
}
remind=
{
remind
}
list=
{
item
.
list
}
onDeletion=
{
(
_index
:
number
)
=>
handleDeletionColloCation
(
index
,
_index
)
}
onEntry=
{
(
name
:
string
,
num
:
number
,
_index
?:
number
)
=>
handleEntryNumber
(
index
,
name
,
num
,
_index
)
}
...
...
@@ -232,12 +258,11 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
)
}
{
/* 选择搭配商品 */
}
<
Button
type=
"dashed"
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleCollocation
(
index
)
}
>
选择搭配商品
{
remind
.
buttonTitle
}
</
Button
>
</
CollapseLayout
>
</
Form
.
Item
>
))
}
</
Form
.
Item
>
</
Form
>
{
/* 添加分组 */
}
<
Button
type=
"dashed"
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAppend
}
>
添加
</
Button
>
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/productListLayout/EditableCell.tsx
View file @
def7f675
...
...
@@ -36,13 +36,29 @@ const EditableCell = ({
break
;
case
3
:
values
=
await
form
.
getFieldValue
(
'discount'
);
record
.
activityPrice
=
Number
(
record
.
price
)
*
(
Number
(
values
))
/
100
record
.
activityPrice
=
Number
(
record
.
price
)
*
(
Number
(
values
))
/
100
;
break
;
}
console
.
log
(
values
)
handleSave
({
...
record
,
...
values
});
}
catch
(
errInfo
)
{
}
}
const
handleValidator
=
async
(
_rule
,
value
,
dataIndex
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d{1,4})?
$/
;
const
plummetPrice
=
await
form
.
getFieldValue
(
'plummetPrice'
);
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'必填项'
));
}
if
((
Number
(
activities
)
===
11
&&
dataIndex
===
'activityPrice'
)
&&
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
plummetPrice
))))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于起始价格'
));
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
}
/** 编辑按钮 */
if
(
editable
)
{
switch
(
dataIndex
)
{
...
...
@@ -58,22 +74,8 @@ const EditableCell = ({
rules=
{
[
{
required
:
true
,
validator
:
async
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
const
plummetPrice
=
await
form
.
getFieldValue
(
'plummetPrice'
);
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'必填项'
));
validator
:
(
_rule
,
value
)
=>
handleValidator
(
_rule
,
value
,
dataIndex
),
}
if
((
Number
(
activities
)
===
11
&&
dataIndex
===
'activityPrice'
)
&&
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
plummetPrice
))))
{
console
.
log
((
Number
(
activities
)
===
11
&&
dataIndex
===
'activityPrice'
),
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
plummetPrice
)),
10086
)
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于起始价格'
));
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
rate
}
onBlur=
{
rate
}
/>
...
...
@@ -169,7 +171,21 @@ const EditableCell = ({
}
/** 操作按钮 */
if
(
operation
)
{
if
(
Number
(
activities
)
===
15
)
{
switch
(
Number
(
activities
))
{
case
6
:
childNode
=
(
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleSetting
(
record
)
}
>
设置赠品
</
Button
>
<
Popconfirm
title=
"是否删除?"
onConfirm=
{
()
=>
handleDelete
(
record
.
id
)
}
>
<
Button
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
</>
)
break
;
case
15
:
childNode
=
(
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleSetting
(
record
)
}
>
设置搭配
</
Button
>
...
...
@@ -181,7 +197,8 @@ const EditableCell = ({
</
Popconfirm
>
</>
)
}
else
{
break
;
default
:
childNode
=
(
<
Popconfirm
title=
"是否删除?"
...
...
@@ -190,6 +207,7 @@ const EditableCell = ({
<
a
>
删除
</
a
>
</
Popconfirm
>
)
break
;
}
}
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/productListLayout/index.tsx
View file @
def7f675
...
...
@@ -9,6 +9,7 @@ import { PlusOutlined } from '@ant-design/icons';
import
{
EditableContext
}
from
'@/pages/transaction/components/detailLayout/components/context'
;
import
ListModalLayout
from
'../listModalLayout'
;
import
CollocationLayout
from
'../collocationLayout'
;
import
{
remindLayout
,
RemindLayoutProps
}
from
'./remind'
;
/** 表格头 */
const
EditableRow
=
({
index
,
...
props
})
=>
{
...
...
@@ -40,6 +41,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const
[
skuId
,
setSkuId
]
=
useState
<
number
>
(
0
);
const
[
collocation
,
setCollocation
]
=
useState
<
any
[]
>
([]);
const
[
idNotInList
,
setIdNotInList
]
=
useState
<
number
[]
>
([]);
// 排除的id集合 ,Long
const
[
remind
,
setRemind
]
=
useState
<
RemindLayoutProps
>
({});
const
components
=
{
...
...
@@ -129,6 +131,17 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
}
},
[
signUpId
])
useEffect
(()
=>
{
if
(
!
isEmpty
(
data
))
{
const
{
activityDefinedBO
:
{
activityType
,
giveType
,
giftType
}
}
=
data
;
if
(
giveType
&&
giftType
)
{
setRemind
(
remindLayout
(
activityType
,
giveType
,
giftType
))
return
}
setRemind
(
remindLayout
(
activityType
))
}
},
[
data
])
return
(
<
Card
id=
"productListLayout"
...
...
@@ -172,8 +185,10 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
onConfirm=
{
handleOk
}
/>
{
/* 设置搭配商品 */
}
{
!
isEmpty
(
remind
)
&&
(
<
ListModalLayout
title=
"设置搭配商品"
title=
{
remind
.
modalTitle
}
remind=
{
remind
}
idNotInList=
{
[
skuId
]
}
shopIdList=
{
shopIdList
}
visible=
{
listModalVisible
}
...
...
@@ -181,6 +196,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
onConfirm=
{
handleConfirm
}
value=
{
collocation
}
/>
)
}
</
Card
>
)
}
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/productListLayout/remind.ts
0 → 100644
View file @
def7f675
export
type
RemindLayoutProps
=
{
/** 弹窗标题 */
modalTitle
?:
string
,
/** 选择商品按钮名称 */
buttonTitle
?:
string
,
/** 列表标题 */
listTitle
?:
string
/** 列表label */
label
?:
{[
key
:
number
]:
string
},
/** 提醒 */
message
?:
{[
key
:
number
]:
string
},
}
export
const
remindLayout
=
(
int
,
giveType
?,
giftType
?)
=>
{
const
give
=
(
giveType
===
1
?
'满额'
:
'买商品'
);
const
gift
=
(
giftType
===
1
?
'赠商品'
:
'赠优惠券'
);
switch
(
int
)
{
case
6
:
return
{
type
:
'limitValue'
,
modalTitle
:
`设置赠品-
${
give
}${
gift
}
`
,
buttonTitle
:
'添加赠送商品'
,
listTitle
:
`
${
give
}${
gift
}
`
,
label
:
{
1
:
'优惠门槛'
,
2
:
giveType
===
1
?
'元'
:
'个'
,
3
:
'赠送商品'
,
4
:
'赠送数量'
,
5
:
'买'
,
6
:
''
,
},
message
:
{
1
:
'请选择赠送商品!'
,
2
:
'请设置赠送商品!'
,
3
:
'请选择赠送商品!'
,
4
:
'请输入优惠门槛!'
,
5
:
'请输入赠送数量!'
,
}
}
case
13
:
{
return
{
type
:
'limitValue'
,
modalTitle
:
`设置换购商品-
${
give
}
换购商品`
,
buttonTitle
:
'添加换购商品'
,
listTitle
:
`
${
give
}
换购商品`
,
label
:
{
1
:
'换购门槛'
,
2
:
giveType
===
1
?
'元'
:
'个'
,
3
:
'换购商品'
,
4
:
'换购数量'
,
5
:
'满'
,
6
:
'换购单价'
,
},
message
:
{
1
:
'请选择换购商品!'
,
2
:
'请设置换购商品!'
,
3
:
'请选择换购商品!'
,
4
:
'请输入换购门槛!'
,
5
:
'请输入允许换购数量!'
,
}
}
}
case
15
:
return
{
type
:
'groupPrice'
,
modalTitle
:
'设置搭配商品'
,
buttonTitle
:
'选择搭配商品'
,
listTitle
:
'套餐搭配商品'
,
label
:
{
1
:
'套餐价格'
,
2
:
'元'
,
3
:
'搭配商品'
,
4
:
'搭配数量'
,
5
:
''
,
6
:
''
,
},
message
:
{
1
:
'请选择搭配商品!'
,
2
:
'请设置搭配商品!'
,
3
:
'请选择搭配商品!'
,
4
:
'请输入套餐价格!'
,
5
:
'请输入搭配数量!'
,
}
}
}
}
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/constants.tsx
View file @
def7f675
...
...
@@ -286,18 +286,18 @@ export const GeneralEffect = (int, data) => {
return
[
{
col
:
[
{
label
:
'每日秒杀时间段'
,
extra
:
''
},
{
label
:
'每日秒杀时间段'
,
extra
:
<>
{
format
(
data
.
startTime
,
'HH:mm:ss'
)
}
~
{
format
(
data
.
endTime
,
'HH:mm:ss'
)
}
</>
},
{
label
:
'活动描述'
,
extra
:
data
.
describe
}
]
},
{
col
:
[
{
label
:
'叠加优惠券'
,
extra
:
'
'
},
{
label
:
'叠加优惠券'
,
extra
:
data
.
allowCoupon
?
'允许叠加'
:
'不允许叠加
'
},
]
},
{
col
:
[
{
label
:
'超限规则'
,
extra
:
'
'
},
{
label
:
'超限规则'
,
extra
:
data
.
exceedRule
===
1
?
'原价购买'
:
'不可购买
'
},
]
}
]
...
...
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