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
14a086c9
Commit
14a086c9
authored
Oct 13, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 参数配置页面,订单、交易规则、仓位、价格管理取配置里面商城列表数据更换为取接口数据,订单详情积分订单文案显示
parent
1f47f302
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
244 additions
and
88 deletions
+244
-88
index.ts
config/routes/index.ts
+1
-1
index.ts
src/constants/index.ts
+1
-1
priceSetting.tsx
...ages/priceManage/priceStrategy/component/priceSetting.tsx
+7
-2
index.tsx
src/pages/priceManage/schema/index.tsx
+2
-19
adjustRepository.tsx
src/pages/repositories/adjustRepository.tsx
+0
-1
batchPositionSetting.tsx
src/pages/repositories/components/batchPositionSetting.tsx
+8
-13
positionSetting.tsx
src/pages/repositories/components/positionSetting.tsx
+8
-11
index.less
src/pages/systemSetting/parameterSetting/index.less
+85
-0
index.tsx
src/pages/systemSetting/parameterSetting/index.tsx
+0
-0
useOrderDetail.tsx
...ages/transaction/_public/order/effects/useOrderDetail.tsx
+3
-3
index.tsx
src/pages/transaction/components/orderDeleveRecord/index.tsx
+2
-2
index.tsx
src/pages/transaction/components/orderPayTabs/index.tsx
+4
-2
index.tsx
src/pages/transaction/components/orderProductTable/index.tsx
+8
-4
index.tsx
src/pages/transaction/components/orderSaleRecord/index.tsx
+2
-2
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+8
-4
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+23
-6
index.tsx
...pages/transaction/purchaseOrder/orderCollectB2b/index.tsx
+13
-1
index.ts
...transaction/purchaseOrder/orderCollectB2b/schema/index.ts
+10
-9
index.tsx
.../transaction/purchaseOrder/readyPayOrder/detail/index.tsx
+19
-5
ruleSetting.tsx
...s/transaction/transactionRules/components/ruleSetting.tsx
+9
-0
index.tsx
src/pages/transaction/transactionRules/schema/index.tsx
+1
-1
index.tsx
src/utils/index.tsx
+1
-1
type.ts
src/utils/type.ts
+29
-0
No files found.
config/routes/index.ts
View file @
14a086c9
...
@@ -79,7 +79,7 @@ const memberCenterRoute = {
...
@@ -79,7 +79,7 @@ const memberCenterRoute = {
// ProcurementRoute,
// ProcurementRoute,
// // 合同能力
// // 合同能力
// contracRoute,
// contracRoute,
AuthConfigRoute
,
//
AuthConfigRoute,
// MemberRoute,
// MemberRoute,
// HandlingRoute,
// HandlingRoute,
// PayandSettleRoute,
// PayandSettleRoute,
...
...
src/constants/index.ts
View file @
14a086c9
...
@@ -14,7 +14,7 @@ export const REQUEST_HEADER = 'http://'
...
@@ -14,7 +14,7 @@ export const REQUEST_HEADER = 'http://'
/**
/**
* 顶域
* 顶域
*/
*/
export
const
TOP_DOMAIN
=
process
.
env
.
NODE_ENV
!==
'development'
?
getTopDomainByHost
(
GlobalConfig
.
global
.
siteInfo
.
siteUrl
,
true
)
:
'lingxi
dev
.com'
export
const
TOP_DOMAIN
=
process
.
env
.
NODE_ENV
!==
'development'
?
getTopDomainByHost
(
GlobalConfig
.
global
.
siteInfo
.
siteUrl
,
true
)
:
'lingxi
test
.com'
// export const TOP_DOMAIN = getTopDomainByHost(GlobalConfig.global.siteInfo.siteUrl)
// export const TOP_DOMAIN = getTopDomainByHost(GlobalConfig.global.siteInfo.siteUrl)
/**
/**
...
...
src/pages/priceManage/priceStrategy/component/priceSetting.tsx
View file @
14a086c9
...
@@ -17,6 +17,8 @@ import { constructTableData, transformDataForNiceForm } from '../../effect'
...
@@ -17,6 +17,8 @@ import { constructTableData, transformDataForNiceForm } from '../../effect'
import
PriceModal
from
'./priceModal'
import
PriceModal
from
'./priceModal'
import
ProductModal
from
'./productModal'
import
ProductModal
from
'./productModal'
import
MemberModal
from
'./memberModal'
import
MemberModal
from
'./memberModal'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
fectchShopListsSource
}
from
'@/utils/type'
const
{
Search
}
=
Input
const
{
Search
}
=
Input
...
@@ -27,6 +29,10 @@ export interface PriceSettingProps {
...
@@ -27,6 +29,10 @@ export interface PriceSettingProps {
formSubmit
?(
values
),
formSubmit
?(
values
),
}
}
const
fetchShopLists
=
async
()
=>
{
return
await
fectchShopListsSource
({
type
:
1
})
}
const
PriceSetting
:
React
.
FC
<
PriceSettingProps
>
=
(
props
)
=>
{
const
PriceSetting
:
React
.
FC
<
PriceSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
const
priceRef
=
useRef
<
any
>
({})
const
priceRef
=
useRef
<
any
>
({})
...
@@ -92,7 +98,6 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
...
@@ -92,7 +98,6 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
}
}
const
handleSetProductPrice
=
(
record
:
any
)
=>
{
const
handleSetProductPrice
=
(
record
:
any
)
=>
{
console
.
log
(
record
,
'record'
)
if
(
record
?.
id
)
{
if
(
record
?.
id
)
{
priceRef
.
current
.
setVisible
(
true
)
priceRef
.
current
.
setVisible
(
true
)
priceRef
.
current
.
setCurrentSetPriceRow
(
record
)
priceRef
.
current
.
setCurrentSetPriceRow
(
record
)
...
@@ -225,7 +230,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
...
@@ -225,7 +230,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
FormEffectHooks
.
onFormInputChange$
().
subscribe
(()
=>
{
FormEffectHooks
.
onFormInputChange$
().
subscribe
(()
=>
{
onFieldChange
()
onFieldChange
()
})
})
useAsyncSelect
(
'shopId'
,
fetchShopLists
,
[
'name'
,
'id'
])
$
(
'onFieldValueChange'
,
'shopId'
).
subscribe
(
parentState
=>
{
$
(
'onFieldValueChange'
,
'shopId'
).
subscribe
(
parentState
=>
{
if
(
parentState
.
value
)
{
if
(
parentState
.
value
)
{
ctx
.
setFieldState
(
'shopId'
,
state
=>
{
ctx
.
setFieldState
(
'shopId'
,
state
=>
{
...
...
src/pages/priceManage/schema/index.tsx
View file @
14a086c9
...
@@ -12,14 +12,6 @@ const {
...
@@ -12,14 +12,6 @@ const {
// 将获取的商城转化为可用类型
// 将获取的商城转化为可用类型
const
getShopTypeMap
=
(()
=>
{
const
getShopTypeMap
=
(()
=>
{
let
a
=
GlobalConfig
.
web
.
shopInfo
.
reduce
((
prev
,
next
)
=>
{
let
a
=
GlobalConfig
.
web
.
shopInfo
.
reduce
((
prev
,
next
)
=>
{
// const shopTypeEnumValue = SHOP_TYPES.find(v => v.value === next.id)
// if (!shopTypeEnumValue) {
// return prev
// }
// if (!prev.find(v => v.value === shopTypeEnumValue.value)) {
// prev.push(shopTypeEnumValue)
// }
// return prev
if
(
next
.
type
===
SHOP_TYPE
[
"mall"
])
{
if
(
next
.
type
===
SHOP_TYPE
[
"mall"
])
{
prev
.
push
({
label
:
next
[
"name"
],
value
:
next
[
"id"
]
})
prev
.
push
({
label
:
next
[
"name"
],
value
:
next
[
"id"
]
})
}
}
...
@@ -27,16 +19,6 @@ const getShopTypeMap = (() => {
...
@@ -27,16 +19,6 @@ const getShopTypeMap = (() => {
},
[])
},
[])
console
.
log
(
a
)
console
.
log
(
a
)
return
a
return
a
// return GlobalConfig.web.shopInfo.reduce((prev, next) => {
// const shopTypeEnumValue = SHOP_TYPES.find(v => v.value === next.type)
// if (!shopTypeEnumValue) {
// return prev
// }
// if (!prev.find(v => v.value === shopTypeEnumValue.value)) {
// prev.push(shopTypeEnumValue)
// }
// return prev
// }, [])
})()
})()
// 列表高级筛选
// 列表高级筛选
...
@@ -211,7 +193,8 @@ export const setPriceSchema: ISchema = {
...
@@ -211,7 +193,8 @@ export const setPriceSchema: ISchema = {
},
},
shopId
:
{
shopId
:
{
type
:
'number'
,
type
:
'number'
,
enum
:
getShopTypeMap
,
// enum: getShopTypeMap,
enum
:
[],
title
:
'适用商城'
,
title
:
'适用商城'
,
required
:
true
,
required
:
true
,
"x-component-props"
:
{
"x-component-props"
:
{
...
...
src/pages/repositories/adjustRepository.tsx
View file @
14a086c9
...
@@ -296,7 +296,6 @@ const AddRepository:React.FC<{}> = (props) => {
...
@@ -296,7 +296,6 @@ const AddRepository:React.FC<{}> = (props) => {
// setIsEdit(true)
// setIsEdit(true)
//
})
//
})
FormEffectHooks
.
onFormMount$
().
subscribe
(()
=>
{
FormEffectHooks
.
onFormMount$
().
subscribe
(()
=>
{
console
.
log
(
'mount'
)
const
name
=
spyForm
.
getFieldValue
(
'name'
)
const
name
=
spyForm
.
getFieldValue
(
'name'
)
const
inventoryNumber
=
spyForm
.
getFieldValue
(
'inventory'
)
const
inventoryNumber
=
spyForm
.
getFieldValue
(
'inventory'
)
const
asyncEnums
=
reposits
.
current
.
map
(
v
=>
({
const
asyncEnums
=
reposits
.
current
.
map
(
v
=>
({
...
...
src/pages/repositories/components/batchPositionSetting.tsx
View file @
14a086c9
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
,
createAsyncFormActions
}
from
'@formily/antd'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
createAddRepositoryEffect
,
useUnitPreview
}
from
'../effects'
import
{
createAddRepositoryEffect
}
from
'../effects'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
{
import
{
PlusOutlined
,
PlusOutlined
,
LinkOutlined
,
}
from
'@ant-design/icons'
}
from
'@ant-design/icons'
import
{
Button
,
message
,
Select
}
from
'antd'
import
{
Button
,
message
,
Select
}
from
'antd'
import
NiceForm
from
'@/components/NiceForm'
import
NiceForm
from
'@/components/NiceForm'
import
ModalTable
from
'@/components/ModalTable'
import
ModalTable
from
'@/components/ModalTable'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
import
Search
from
'@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
SHOP_TYPES
,
MALL_TYPE
}
from
'@/constants'
;
import
{
MALL_TYPE
}
from
'@/constants'
;
import
{
fectchShopListsSource
}
from
'@/utils/type'
export
interface
BatchPositionSettingProps
{
export
interface
BatchPositionSettingProps
{
addSchemaAction
:
ISchemaFormActions
,
addSchemaAction
:
ISchemaFormActions
,
...
@@ -489,14 +487,11 @@ const BatchPositionSetting:React.FC<BatchPositionSettingProps> = (props) => {
...
@@ -489,14 +487,11 @@ const BatchPositionSetting:React.FC<BatchPositionSettingProps> = (props) => {
onFieldChange
()
onFieldChange
()
})
})
createAddRepositoryEffect
(
addSchemaAction
)
createAddRepositoryEffect
(
addSchemaAction
)
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
parentState
=>
{
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
async
parentState
=>
{
if
(
parentState
.
value
)
{
if
(
parentState
.
value
)
{
cons
ole
.
log
(
'review'
)
cons
t
data
=
await
fectchShopListsSource
({
type
:
parentState
.
value
}
)
setFieldState
(
'shopIds'
,
state
=>
{
setFieldState
(
'shopIds'
,
state
=>
{
state
.
props
[
"x-component-props"
].
dataSource
=
pageStatus
===
PageStatus
.
PREVIEW
?
state
.
props
[
"x-component-props"
].
dataSource
=
data
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
&&
state
.
value
.
includes
(
v
.
id
))
:
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
)
});
});
// 切换商城的时候,指定的会员需要重置
// 切换商城的时候,指定的会员需要重置
setShopType
((
prev
)
=>
{
setShopType
((
prev
)
=>
{
...
...
src/pages/repositories/components/positionSetting.tsx
View file @
14a086c9
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
,
createAsyncFormActions
}
from
'@formily/antd'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
createAddRepositoryEffect
,
useUnitPreview
}
from
'../effects'
import
{
createAddRepositoryEffect
}
from
'../effects'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
{
import
{
PlusOutlined
,
PlusOutlined
,
...
@@ -11,13 +11,13 @@ import {
...
@@ -11,13 +11,13 @@ import {
import
{
Button
,
message
,
Select
}
from
'antd'
import
{
Button
,
message
,
Select
}
from
'antd'
import
NiceForm
from
'@/components/NiceForm'
import
NiceForm
from
'@/components/NiceForm'
import
ModalTable
from
'@/components/ModalTable'
import
ModalTable
from
'@/components/ModalTable'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
import
Search
from
'@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
SHOP_TYPES
,
MALL_TYPE
}
from
'@/constants'
;
import
{
MALL_TYPE
}
from
'@/constants'
;
import
{
fectchShopListsSource
}
from
'@/utils/type'
export
interface
PositionSettingProps
{
export
interface
PositionSettingProps
{
...
@@ -501,14 +501,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
...
@@ -501,14 +501,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
onFieldChange
()
onFieldChange
()
})
})
createAddRepositoryEffect
(
addSchemaAction
)
createAddRepositoryEffect
(
addSchemaAction
)
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
parentState
=>
{
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
async
parentState
=>
{
if
(
parentState
.
value
)
{
if
(
parentState
.
value
)
{
cons
ole
.
log
(
'review'
)
cons
t
data
=
await
fectchShopListsSource
({
type
:
parentState
.
value
}
)
setFieldState
(
'shopIds'
,
state
=>
{
setFieldState
(
'shopIds'
,
state
=>
{
state
.
props
[
"x-component-props"
].
dataSource
=
pageStatus
===
PageStatus
.
PREVIEW
?
state
.
props
[
"x-component-props"
].
dataSource
=
data
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
&&
state
.
value
.
includes
(
v
.
id
))
:
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
)
});
});
// 切换商城的时候,指定的会员需要重置
// 切换商城的时候,指定的会员需要重置
setShopType
((
prev
)
=>
{
setShopType
((
prev
)
=>
{
...
...
src/pages/systemSetting/parameterSetting/index.less
View file @
14a086c9
.rightBtnWrap {
display: flex;
flex-direction: column;
:global {
.ant-btn {
margin: 16px 0;
width: 100%;
}
}
}
.setItemWrap {
display: flex;
justify-content: space-between;
}
.setItemLeft {
p {
font-size: 12px;
color: #252D37;
&:first-child {
font-size: 14px;
}
img {
width: 32px;
height: 32px;
margin-right: 16px;
}
}
}
.setItemRight {
display: flex;
align-items: center;
justify-content: center;
a {
margin-right: 16px;
}
}
.drawerBody {
display: flex;
flex-direction: column;
:global {
.ant-card-body {
padding: 16px;
}
}
.cardMain {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
border-bottom: 1px solid #F5F6F7;
p {
img {
width: 40px;
height: 40px;
border-radius: 19px;
margin-right: 16px;
}
span {
font-size: 14px;
color: #252D37;
}
}
}
.receiveDay {
display: flex;
justify-content: space-between;
margin-top: 16px;
span {
font-size: 12px;
color: #91959B;
}
}
.deadLine {
:global {
.ant-space {
.ant-space-item {
&:first-child {
width: 100%;
}
}
}
}
}
}
src/pages/systemSetting/parameterSetting/index.tsx
View file @
14a086c9
This diff is collapsed.
Click to expand it.
src/pages/transaction/_public/order/effects/useOrderDetail.tsx
View file @
14a086c9
...
@@ -93,9 +93,9 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
...
@@ -93,9 +93,9 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
if
(
type
===
'p_readyPayOrder'
)
{
if
(
type
===
'p_readyPayOrder'
)
{
reloadPayList
(
id
)
reloadPayList
(
id
)
}
}
//
if(data.payments.length > 0){
if
(
data
.
payments
.
length
>
0
){
//
setCurrentPayInfoId(data.payments[0].paymentId)
setCurrentPayInfoId
(
data
.
payments
[
0
].
paymentId
)
//
}
}
}
else
{
}
else
{
message
.
error
(
msg
)
message
.
error
(
msg
)
}
}
...
...
src/pages/transaction/components/orderDeleveRecord/index.tsx
View file @
14a086c9
...
@@ -25,9 +25,9 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
...
@@ -25,9 +25,9 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const
[
disabled
,
setDisabled
]
=
useState
<
boolean
>
(
false
)
const
[
disabled
,
setDisabled
]
=
useState
<
boolean
>
(
false
)
const
{
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
deliveries
,
deliveryDetails
,
orderMode
l
,
orderKind
}
=
data
const
{
deliveries
,
deliveryDetails
,
orderMode
,
orderKind
}
=
data
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
creditsCommodity
=
(
orderMode
l
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// 积分或渠道积分下单模式
const
outOrderCols
:
any
[]
=
[
const
outOrderCols
:
any
[]
=
[
{
{
...
...
src/pages/transaction/components/orderPayTabs/index.tsx
View file @
14a086c9
...
@@ -113,6 +113,8 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
...
@@ -113,6 +113,8 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
const
processEnum
=
data
.
processEnum
const
processEnum
=
data
.
processEnum
const
payments
=
data
.
payments
.
sort
((
a
,
b
)
=>
a
.
batchNo
-
b
.
batchNo
)
const
payments
=
data
.
payments
.
sort
((
a
,
b
)
=>
a
.
batchNo
-
b
.
batchNo
)
const
creditsCommodity
=
(
data
.
orderMode
===
10
||
data
.
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
// 是否可编辑比例
// 是否可编辑比例
const
canEdit
=
history
.
location
.
pathname
.
indexOf
(
'/readyApprovedOrder/detail'
)
!==
-
1
const
canEdit
=
history
.
location
.
pathname
.
indexOf
(
'/readyApprovedOrder/detail'
)
!==
-
1
...
@@ -194,11 +196,11 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
...
@@ -194,11 +196,11 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
// },
// },
},
},
{
{
title
:
'支付金额'
,
title
:
creditsCommodity
?
'积分'
:
'支付金额'
,
dataIndex
:
'payAmount'
,
dataIndex
:
'payAmount'
,
align
:
'center'
,
align
:
'center'
,
key
:
'payAmount'
,
key
:
'payAmount'
,
render
:
(
t
,
r
)
=>
`¥
${
t
}
`
render
:
(
t
,
r
)
=>
creditsCommodity
?
t
:
`¥
${
t
}
`
},
},
{
{
title
:
'支付方式'
,
title
:
'支付方式'
,
...
...
src/pages/transaction/components/orderProductTable/index.tsx
View file @
14a086c9
...
@@ -42,7 +42,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
...
@@ -42,7 +42,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
const
{
product
,
orderMode
,
orderKind
}
=
dataSource
||
{}
const
{
product
,
orderMode
,
orderKind
}
=
dataSource
||
{}
const
{
couponAmount
,
freight
,
productAmount
,
promotionAmount
,
totalAmount
,
products
}
=
product
const
{
couponAmount
,
freight
,
productAmount
,
promotionAmount
,
totalAmount
,
products
}
=
product
const
creditsCommodity
=
(
orderMode
===
24
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
// 合计金额, 如果后端有传则用后端数据
// 合计金额, 如果后端有传则用后端数据
...
@@ -56,14 +56,18 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
...
@@ -56,14 +56,18 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
creditsCommodity
?
sum
:
`¥${sum}`
}
</
div
>
<
div
>
{
creditsCommodity
?
sum
:
`¥${sum}`
}
</
div
>
</
Col
>
</
Col
>
<
Col
span=
{
2
}
>
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
促销立减
</
div
>
<
div
>
促销立减
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
</
Col
>
</
Col
>
<
Col
span=
{
2
}
>
}
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
优惠抵扣
</
div
>
<
div
>
优惠抵扣
</
div
>
<
div
>
{
`-¥${couponAmount}`
}
</
div
>
<
div
>
{
`-¥${couponAmount}`
}
</
div
>
</
Col
>
</
Col
>
}
{
{
contractOrder
?
null
:
<>
contractOrder
?
null
:
<>
<
Col
span=
{
2
}
>
<
Col
span=
{
2
}
>
...
@@ -168,7 +172,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
...
@@ -168,7 +172,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
const
OrderProductTable
:
React
.
FC
<
OrderProductTableProps
>
=
({
editable
})
=>
{
const
OrderProductTable
:
React
.
FC
<
OrderProductTableProps
>
=
({
editable
})
=>
{
const
{
ctl
,
data
,
preview
}
=
useContext
(
OrderDetailContext
)
const
{
ctl
,
data
,
preview
}
=
useContext
(
OrderDetailContext
)
const
{
product
=
[],
orderMode
,
orderKind
}
=
data
||
{}
const
{
product
=
[],
orderMode
,
orderKind
}
=
data
||
{}
const
creditsCommodity
=
(
orderMode
===
24
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
// 合同下单模式
// 合同下单模式
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
...
...
src/pages/transaction/components/orderSaleRecord/index.tsx
View file @
14a086c9
...
@@ -29,10 +29,10 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
...
@@ -29,10 +29,10 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 用于储存已经修改过的订单id
// 用于储存已经修改过的订单id
const
dataRef
=
useRef
<
any
>
([])
const
dataRef
=
useRef
<
any
>
([])
const
{
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
deliveries
,
deliveryDetails
,
orderMode
l
,
externalState
,
orderKind
}
=
data
const
{
deliveries
,
deliveryDetails
,
orderMode
,
externalState
,
orderKind
}
=
data
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
creditsCommodity
=
(
orderMode
l
===
24
||
orderModel
===
25
)
// @todo 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
outOrderCols
:
any
[]
=
[
const
outOrderCols
:
any
[]
=
[
{
{
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
14a086c9
...
@@ -167,7 +167,7 @@ const modalPriceActions = createFormActions()
...
@@ -167,7 +167,7 @@ const modalPriceActions = createFormActions()
export
const
MoneyTotalBox
=
({
dataSource
,
isEditData
})
=>
{
export
const
MoneyTotalBox
=
({
dataSource
,
isEditData
})
=>
{
const
{
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
product
,
receiverAddressId
,
orderMode
,
orderKind
}
=
dataSource
||
{}
const
{
product
,
receiverAddressId
,
orderMode
,
orderKind
}
=
dataSource
||
{}
const
creditsCommodity
=
(
orderMode
===
24
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
{
productAmount
,
freight
,
totalAmount
,
promotionAmount
,
couponAmount
,
products
}
=
product
const
{
productAmount
,
freight
,
totalAmount
,
promotionAmount
,
couponAmount
,
products
}
=
product
...
@@ -226,14 +226,18 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
...
@@ -226,14 +226,18 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
creditsCommodity
?
sum
:
`¥${sum}`
}
</
div
>
<
div
>
{
creditsCommodity
?
sum
:
`¥${sum}`
}
</
div
>
</
Col
>
</
Col
>
<
Col
span=
{
2
}
>
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
促销立减
</
div
>
<
div
>
促销立减
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
</
Col
>
</
Col
>
<
Col
span=
{
2
}
>
}
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
优惠抵扣
</
div
>
<
div
>
优惠抵扣
</
div
>
<
div
><
Button
type=
"link"
style=
{
{
padding
:
0
,
height
:
'18px'
,
lineHeight
:
'18px'
}
}
>
{
`-¥${couponAmount}`
}
</
Button
></
div
>
<
div
><
Button
type=
"link"
style=
{
{
padding
:
0
,
height
:
'18px'
,
lineHeight
:
'18px'
}
}
>
{
`-¥${couponAmount}`
}
</
Button
></
div
>
</
Col
>
</
Col
>
}
{
{
contractOrder
?
null
:
<>
contractOrder
?
null
:
<>
<
Col
span=
{
2
}
>
<
Col
span=
{
2
}
>
...
@@ -381,7 +385,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
...
@@ -381,7 +385,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
{
ctl
,
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
ctl
,
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
page_type
}
=
usePageStatus
()
const
{
page_type
}
=
usePageStatus
()
const
{
product
,
orderMode
,
orderKind
}
=
data
||
{}
const
{
product
,
orderMode
,
orderKind
}
=
data
||
{}
const
creditsCommodity
=
(
orderMode
===
24
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
// 合同下单模式
// 合同下单模式
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
contractOrder
=
(
orderKind
===
OrderKindType
.
SRM_ORDER
)
const
[
warehouseVisible
,
setWarehouseVisible
]
=
useState
(
false
)
const
[
warehouseVisible
,
setWarehouseVisible
]
=
useState
(
false
)
...
...
src/pages/transaction/purchaseOrder/index.tsx
View file @
14a086c9
...
@@ -16,8 +16,8 @@ import styled from 'styled-components'
...
@@ -16,8 +16,8 @@ import styled from 'styled-components'
import
cx
from
'classnames'
import
cx
from
'classnames'
import
ModalForm
from
'@/components/ModalForm'
import
ModalForm
from
'@/components/ModalForm'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
CaretDownOutlined
}
from
'@ant-design/icons'
import
TableOperation
from
'@/components/TableOperation'
import
TableOperation
from
'@/components/TableOperation'
import
{
ORDER_TYPE_POINTS
}
from
'@/constants/order'
const
SelectStyles
=
styled
((
props
)
=>
<
div
className=
'select-list'
{
...
props
}
></
div
>)
`
const
SelectStyles
=
styled
((
props
)
=>
<
div
className=
'select-list'
{
...
props
}
></
div
>)
`
.select_style_border {
.select_style_border {
...
@@ -61,11 +61,11 @@ const fetchTableData = async (params) => {
...
@@ -61,11 +61,11 @@ const fetchTableData = async (params) => {
const
formActions
=
createFormActions
();
const
formActions
=
createFormActions
();
const
destroyActions
=
createFormActions
()
const
destroyActions
=
createFormActions
()
const
showDataSource
=
[
//
const showDataSource = [
{
id
:
1
,
name
:
"换货"
},
//
{ id: 1, name: "换货"},
{
id
:
2
,
name
:
"退货"
},
//
{ id: 2, name: "退货"},
{
id
:
3
,
name
:
"维修"
},
//
{ id: 3, name: "维修"},
]
//
]
const
PurchaseOrder
:
React
.
FC
<
PurchaseOrderProps
>
=
(
props
)
=>
{
const
PurchaseOrder
:
React
.
FC
<
PurchaseOrderProps
>
=
(
props
)
=>
{
const
[
saleVisible
,
setSaleVisible
]
=
useState
<
any
>
(
false
)
const
[
saleVisible
,
setSaleVisible
]
=
useState
<
any
>
(
false
)
...
@@ -75,12 +75,29 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
...
@@ -75,12 +75,29 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
ref
=
useRef
<
any
>
({})
const
ref
=
useRef
<
any
>
({})
const
destoryRef
=
useRef
<
any
>
({})
const
destoryRef
=
useRef
<
any
>
({})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderBuyerCancel
)
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderBuyerCancel
)
const
[
showDataSource
,
setShowDataSource
]
=
useState
([
{
id
:
1
,
name
:
"换货"
},
{
id
:
2
,
name
:
"退货"
},
{
id
:
3
,
name
:
"维修"
},
])
// 售后唤起弹窗
// 售后唤起弹窗
const
handleSaleAfter
=
({
orderId
,
orderType
})
=>
{
const
handleSaleAfter
=
({
orderId
,
orderType
})
=>
{
setSaleVisible
(
true
)
setSaleVisible
(
true
)
setRecordId
(
orderId
)
setRecordId
(
orderId
)
setOrderType
(
orderType
)
setOrderType
(
orderType
)
if
(
orderType
===
ORDER_TYPE_POINTS
)
{
setShowDataSource
(()
=>
[
{
id
:
1
,
name
:
"换货"
},
{
id
:
3
,
name
:
"维修"
}
])
}
else
{
setShowDataSource
(()
=>
[
{
id
:
1
,
name
:
"换货"
},
{
id
:
2
,
name
:
"退货"
},
{
id
:
3
,
name
:
"维修"
}
])
}
}
}
const
handleOk
=
()
=>
{
const
handleOk
=
()
=>
{
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/index.tsx
View file @
14a086c9
...
@@ -28,6 +28,7 @@ import { help } from '../../common'
...
@@ -28,6 +28,7 @@ import { help } from '../../common'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
fetchOrderApi
}
from
'./apis'
import
{
fetchOrderApi
}
from
'./apis'
import
{
fectchShopListsSource
}
from
'@/utils/type'
export
interface
PurchaseOrderDetailProps
{}
export
interface
PurchaseOrderDetailProps
{}
...
@@ -434,7 +435,18 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -434,7 +435,18 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
}
}
}
effects=
{
(
$
,
ctx
)
=>
{
effects=
{
(
$
,
ctx
)
=>
{
useAsyncSelect
(
'orderMode'
,
fetchOrderMode
,
[
'text'
,
'id'
])
useAsyncSelect
(
'orderMode'
,
fetchOrderMode
,
[
'text'
,
'id'
])
$
(
'onFormMount'
).
subscribe
(()
=>
{
$
(
'onFormMount'
).
subscribe
(
async
()
=>
{
const
data
=
await
fectchShopListsSource
({
type
:
1
,
environment
:
1
})
if
(
data
&&
data
.
length
)
{
ctx
.
setFieldState
(
'shopId'
,
state
=>
{
state
.
props
.
enum
=
data
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
id
,
type
:
item
.
type
,
environment
:
item
.
environment
,
}))
})
}
if
(
id
||
modelType
)
{
if
(
id
||
modelType
)
{
ctx
.
setFieldState
(
'orderMode'
,
state
=>
{
ctx
.
setFieldState
(
'orderMode'
,
state
=>
{
state
.
editable
=
false
state
.
editable
=
false
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/schema/index.ts
View file @
14a086c9
...
@@ -3,14 +3,14 @@ import { GlobalConfig } from '@/global/config';
...
@@ -3,14 +3,14 @@ import { GlobalConfig } from '@/global/config';
import
moment
from
'moment'
import
moment
from
'moment'
// 将获取的商城转化为可用类型
// 将获取的商城转化为可用类型
const
getShopTypeMap
=
(()
=>
{
//
const getShopTypeMap = (() => {
return
GlobalConfig
.
web
.
shopInfo
.
filter
(
item
=>
(
item
.
type
===
1
)
&&
(
item
.
environment
===
1
)).
map
(
item
=>
({
//
return GlobalConfig.web.shopInfo.filter(item => (item.type === 1) && (item.environment === 1)).map(item => ({
label
:
item
.
name
,
//
label: item.name,
value
:
item
.
id
,
//
value: item.id,
type
:
item
.
type
,
//
type: item.type,
environment
:
item
.
environment
,
//
environment: item.environment,
}))
//
}))
})()
//
})()
// 基本信息
// 基本信息
const
basicInfo
:
ISchema
=
{
const
basicInfo
:
ISchema
=
{
...
@@ -67,7 +67,8 @@ const basicInfo: ISchema = {
...
@@ -67,7 +67,8 @@ const basicInfo: ISchema = {
},
},
shopId
:
{
shopId
:
{
type
:
'number'
,
type
:
'number'
,
enum
:
getShopTypeMap
,
// enum: getShopTypeMap,
enum
:
[],
title
:
'适应商城'
,
title
:
'适应商城'
,
required
:
true
,
required
:
true
,
// visible: false,
// visible: false,
...
...
src/pages/transaction/purchaseOrder/readyPayOrder/detail/index.tsx
View file @
14a086c9
import
React
,
{
useCallback
,
useRef
}
from
'react'
;
import
React
,
{
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../../_public/order/context'
;
import
{
OrderDetailContext
}
from
'../../../_public/order/context'
;
import
{
Button
}
from
'antd'
;
import
{
Button
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/orderDetailHeader'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/orderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/orderDetailWrapper'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/orderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../../_public/order/effects/useOrderDetail'
;
import
{
useOrderDetail
}
from
'../../../_public/order/effects/useOrderDetail'
;
import
OrderDetailSection
from
'../../../components/orderDetailSection'
;
import
OrderDetailSection
from
'../../../components/orderDetailSection'
;
import
OrderPayModal
from
'@/pages/transaction/components/orderPayModal'
;
import
OrderPayModal
from
'@/pages/transaction/components/orderPayModal'
;
import
{
ENTERPRISE_CENTER_URL
,
REQUEST_HEADER
,
TOP_DOMAIN
}
from
'@/constants'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
const
ReadyConfirmContract
:
React
.
FC
=
()
=>
{
const
ReadyConfirmContract
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'p_readyPayOrder'
})
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'p_readyPayOrder'
})
...
@@ -17,12 +20,23 @@ const ReadyConfirmContract: React.FC = () => {
...
@@ -17,12 +20,23 @@ const ReadyConfirmContract: React.FC = () => {
// 处理积分支付跳转
// 处理积分支付跳转
if
(
data
&&
currentPayInfoId
){
if
(
data
&&
currentPayInfoId
){
if
(
data
.
payments
.
length
>
0
){
if
(
data
.
payments
.
length
>
0
){
// let obj = data.payments.filter(item => item.id === Number(currentPayInfoId))[0]
let
obj
=
data
.
payments
.
filter
(
item
=>
item
.
paymentId
===
Number
(
currentPayInfoId
))[
0
]
// if(obj.channel === 0) {
console
.
log
(
obj
,
currentPayInfoId
)
// history.push(`/pay?orderId=${btoa(JSON.stringify({ orderId: id, memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId }))}`)
if
(
obj
.
payChannel
===
10
)
{
// } else {
const
spam
:
any
=
{
orderId
:
data
.
orderId
,
memberId
:
data
.
vendorMemberId
,
memberRoleId
:
data
.
vendorRoleId
,
batchNo
:
obj
.
batchNo
,
payAmount
:
obj
.
payAmount
,
payType
:
obj
.
payType
,
payChannel
:
obj
.
payChannel
,
}
window
.
location
.
href
=
`
${
ENTERPRISE_CENTER_URL
}
/pay?spam=
${
btoa
(
JSON
.
stringify
(
spam
))}
`
// history.replace(`${REQUEST_HEADER}${ENTERPRISE_CENTER_URL}/${TOP_DOMAIN}/pay?spam=${btoa(JSON.stringify(spam))}`)
}
else
{
payRef
.
current
.
setVisible
(
true
)
payRef
.
current
.
setVisible
(
true
)
//
}
}
}
}
}
}
},
[
data
,
currentPayInfoId
])
},
[
data
,
currentPayInfoId
])
...
...
src/pages/transaction/transactionRules/components/ruleSetting.tsx
View file @
14a086c9
...
@@ -19,6 +19,7 @@ import Submit from '@/components/NiceForm/components/Submit'
...
@@ -19,6 +19,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import
SelectProcesss
from
'./selectProcesss'
import
SelectProcesss
from
'./selectProcesss'
import
{
usePaymentTable
}
from
'../model/usePaymentTable'
import
{
usePaymentTable
}
from
'../model/usePaymentTable'
import
{
help
}
from
'../../common'
import
{
help
}
from
'../../common'
import
{
fectchShopListsSource
}
from
'@/utils/type'
export
interface
RuleSettingProps
{
export
interface
RuleSettingProps
{
addSchemaAction
:
ISchemaFormActions
,
addSchemaAction
:
ISchemaFormActions
,
...
@@ -365,6 +366,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...
@@ -365,6 +366,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
CustomPayments
CustomPayments
}
}
}
}
effects=
{
(
$
,
{
setFieldState
,
setFieldValue
})
=>
{
effects=
{
(
$
,
{
setFieldState
,
setFieldValue
})
=>
{
$
(
'onFormMount'
).
subscribe
(
async
()
=>
{
const
data
=
await
fectchShopListsSource
()
if
(
data
&&
data
.
length
)
{
setFieldState
(
'shopIds'
,
state
=>
{
state
.
props
[
"x-component-props"
].
dataSource
=
data
.
sort
((
a
,
b
)
=>
a
.
type
-
b
.
type
)
});
}
})
FormEffectHooks
.
onFormInputChange$
().
subscribe
(()
=>
{
FormEffectHooks
.
onFormInputChange$
().
subscribe
(()
=>
{
onFieldChange
()
onFieldChange
()
})
})
...
...
src/pages/transaction/transactionRules/schema/index.tsx
View file @
14a086c9
...
@@ -164,7 +164,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
...
@@ -164,7 +164,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
"type"
:
"array:number"
,
"type"
:
"array:number"
,
"x-component"
:
'CardCheckBox'
,
"x-component"
:
'CardCheckBox'
,
"x-component-props"
:
{
"x-component-props"
:
{
dataSource
:
GlobalConfig
.
web
.
shopInfo
.
sort
((
a
,
b
)
=>
a
.
type
-
b
.
type
)
,
dataSource
:
[]
,
type
:
'radio'
// CardCheckBox 单选模式
type
:
'radio'
// CardCheckBox 单选模式
},
},
"title"
:
"适用商城"
,
"title"
:
"适用商城"
,
...
...
src/utils/index.tsx
View file @
14a086c9
...
@@ -611,7 +611,7 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
...
@@ -611,7 +611,7 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
export
const
getDefaultEnterprise
=
()
=>
{
export
const
getDefaultEnterprise
=
()
=>
{
const
shopInfo
=
GlobalConfig
.
web
.
shopInfo
const
shopInfo
=
GlobalConfig
.
web
.
shopInfo
const
webMallList
=
shopInfo
.
filter
((
item
:
{
environment
:
number
;
type
:
number
})
=>
item
.
environment
===
1
&&
item
.
type
===
1
)
const
webMallList
=
shopInfo
.
filter
((
item
:
{
environment
:
number
;
type
:
number
,
memberOperate
:
number
})
=>
item
.
environment
===
1
&&
item
.
type
===
1
&&
item
.
memberOperate
===
0
)
const
defaultMall
=
webMallList
.
filter
((
item
)
=>
item
.
isDefault
===
1
)[
0
]
const
defaultMall
=
webMallList
.
filter
((
item
)
=>
item
.
isDefault
===
1
)[
0
]
let
result
:
any
=
undefined
let
result
:
any
=
undefined
if
(
defaultMall
)
{
if
(
defaultMall
)
{
...
...
src/utils/type.ts
View file @
14a086c9
import
{
GlobalConfig
}
from
'@/global/config'
;
import
{
PublicApi
}
from
'@/services/api'
;
export
function
isString
(
str
:
any
):
str
is
string
{
export
function
isString
(
str
:
any
):
str
is
string
{
return
typeof
str
===
'string'
return
typeof
str
===
'string'
}
}
...
@@ -16,3 +19,29 @@ export const toPercent = (point: number) => {
...
@@ -16,3 +19,29 @@ export const toPercent = (point: number) => {
str
+=
"%"
;
str
+=
"%"
;
return
str
;
return
str
;
}
}
interface
getShopListsParmasProps
{
/** 站点ID */
siteId
?:
number
;
/** 商城环境
* 1.web 2.H5 3.小程序 4.APP
*/
environment
?:
number
;
/** 商城类型
* 1.企业商城 2.积分商城 3.渠道商城 4.渠道自有商城 5.渠道积分商城 6.采购门户 7.物流服务门户 8.加工服务门户 9.行情资讯门户
*/
type
?:
number
;
/** 是否按当前会员类型筛选
* 1 为是
*/
hasMemberType
?:
number
;
}
/**
* 通过站点ID、商城类型、商城环境、是否当前登录会员—获取商城列表数据
* @param params 接口参数
*/
export
const
fectchShopListsSource
=
async
(
params
?:
getShopListsParmasProps
)
=>
{
const
{
data
}
=
await
PublicApi
.
postManageWebShopWebAll
({
...
params
,
siteId
:
GlobalConfig
.
global
.
siteInfo
.
id
},
{
ctlType
:
'none'
})
return
data
}
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