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
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
274 additions
and
119 deletions
+274
-119
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
+14
-10
index.tsx
src/pages/transaction/components/orderSaleRecord/index.tsx
+2
-2
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+14
-10
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
+47
-19
No files found.
config/routes/index.ts
View file @
14a086c9
...
...
@@ -79,7 +79,7 @@ const memberCenterRoute = {
// ProcurementRoute,
// // 合同能力
// contracRoute,
AuthConfigRoute
,
//
AuthConfigRoute,
// MemberRoute,
// HandlingRoute,
// PayandSettleRoute,
...
...
src/constants/index.ts
View file @
14a086c9
...
...
@@ -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)
/**
...
...
src/pages/priceManage/priceStrategy/component/priceSetting.tsx
View file @
14a086c9
...
...
@@ -17,6 +17,8 @@ import { constructTableData, transformDataForNiceForm } from '../../effect'
import
PriceModal
from
'./priceModal'
import
ProductModal
from
'./productModal'
import
MemberModal
from
'./memberModal'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
fectchShopListsSource
}
from
'@/utils/type'
const
{
Search
}
=
Input
...
...
@@ -27,6 +29,10 @@ export interface PriceSettingProps {
formSubmit
?(
values
),
}
const
fetchShopLists
=
async
()
=>
{
return
await
fectchShopListsSource
({
type
:
1
})
}
const
PriceSetting
:
React
.
FC
<
PriceSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
const
priceRef
=
useRef
<
any
>
({})
...
...
@@ -92,7 +98,6 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
}
const
handleSetProductPrice
=
(
record
:
any
)
=>
{
console
.
log
(
record
,
'record'
)
if
(
record
?.
id
)
{
priceRef
.
current
.
setVisible
(
true
)
priceRef
.
current
.
setCurrentSetPriceRow
(
record
)
...
...
@@ -225,7 +230,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
FormEffectHooks
.
onFormInputChange$
().
subscribe
(()
=>
{
onFieldChange
()
})
useAsyncSelect
(
'shopId'
,
fetchShopLists
,
[
'name'
,
'id'
])
$
(
'onFieldValueChange'
,
'shopId'
).
subscribe
(
parentState
=>
{
if
(
parentState
.
value
)
{
ctx
.
setFieldState
(
'shopId'
,
state
=>
{
...
...
src/pages/priceManage/schema/index.tsx
View file @
14a086c9
...
...
@@ -12,14 +12,6 @@ const {
// 将获取的商城转化为可用类型
const
getShopTypeMap
=
(()
=>
{
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"
])
{
prev
.
push
({
label
:
next
[
"name"
],
value
:
next
[
"id"
]
})
}
...
...
@@ -27,16 +19,6 @@ const getShopTypeMap = (() => {
},
[])
console
.
log
(
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 = {
},
shopId
:
{
type
:
'number'
,
enum
:
getShopTypeMap
,
// enum: getShopTypeMap,
enum
:
[],
title
:
'适用商城'
,
required
:
true
,
"x-component-props"
:
{
...
...
src/pages/repositories/adjustRepository.tsx
View file @
14a086c9
...
...
@@ -296,7 +296,6 @@ const AddRepository:React.FC<{}> = (props) => {
// setIsEdit(true)
//
})
FormEffectHooks
.
onFormMount$
().
subscribe
(()
=>
{
console
.
log
(
'mount'
)
const
name
=
spyForm
.
getFieldValue
(
'name'
)
const
inventoryNumber
=
spyForm
.
getFieldValue
(
'inventory'
)
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
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
,
createAsyncFormActions
}
from
'@formily/antd'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
createAddRepositoryEffect
,
useUnitPreview
}
from
'../effects'
import
{
createAddRepositoryEffect
}
from
'../effects'
import
{
PublicApi
}
from
'@/services/api'
import
{
PlusOutlined
,
LinkOutlined
,
}
from
'@ant-design/icons'
import
{
Button
,
message
,
Select
}
from
'antd'
import
NiceForm
from
'@/components/NiceForm'
import
ModalTable
from
'@/components/ModalTable'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
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
{
addSchemaAction
:
ISchemaFormActions
,
...
...
@@ -489,14 +487,11 @@ const BatchPositionSetting:React.FC<BatchPositionSettingProps> = (props) => {
onFieldChange
()
})
createAddRepositoryEffect
(
addSchemaAction
)
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
parentState
=>
{
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
async
parentState
=>
{
if
(
parentState
.
value
)
{
cons
ole
.
log
(
'review'
)
cons
t
data
=
await
fectchShopListsSource
({
type
:
parentState
.
value
}
)
setFieldState
(
'shopIds'
,
state
=>
{
state
.
props
[
"x-component-props"
].
dataSource
=
pageStatus
===
PageStatus
.
PREVIEW
?
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
&&
state
.
value
.
includes
(
v
.
id
))
:
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
)
state
.
props
[
"x-component-props"
].
dataSource
=
data
});
// 切换商城的时候,指定的会员需要重置
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
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
,
createAsyncFormActions
}
from
'@formily/antd'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
createAddRepositoryEffect
,
useUnitPreview
}
from
'../effects'
import
{
createAddRepositoryEffect
}
from
'../effects'
import
{
PublicApi
}
from
'@/services/api'
import
{
PlusOutlined
,
...
...
@@ -11,13 +11,13 @@ import {
import
{
Button
,
message
,
Select
}
from
'antd'
import
NiceForm
from
'@/components/NiceForm'
import
ModalTable
from
'@/components/ModalTable'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
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
{
...
...
@@ -501,14 +501,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
onFieldChange
()
})
createAddRepositoryEffect
(
addSchemaAction
)
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
parentState
=>
{
$
(
'onFieldValueChange'
,
'shopType'
).
subscribe
(
async
parentState
=>
{
if
(
parentState
.
value
)
{
cons
ole
.
log
(
'review'
)
cons
t
data
=
await
fectchShopListsSource
({
type
:
parentState
.
value
}
)
setFieldState
(
'shopIds'
,
state
=>
{
state
.
props
[
"x-component-props"
].
dataSource
=
pageStatus
===
PageStatus
.
PREVIEW
?
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
&&
state
.
value
.
includes
(
v
.
id
))
:
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
===
parentState
.
value
)
state
.
props
[
"x-component-props"
].
dataSource
=
data
});
// 切换商城的时候,指定的会员需要重置
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) => {
if
(
type
===
'p_readyPayOrder'
)
{
reloadPayList
(
id
)
}
//
if(data.payments.length > 0){
//
setCurrentPayInfoId(data.payments[0].paymentId)
//
}
if
(
data
.
payments
.
length
>
0
){
setCurrentPayInfoId
(
data
.
payments
[
0
].
paymentId
)
}
}
else
{
message
.
error
(
msg
)
}
...
...
src/pages/transaction/components/orderDeleveRecord/index.tsx
View file @
14a086c9
...
...
@@ -25,9 +25,9 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const
[
disabled
,
setDisabled
]
=
useState
<
boolean
>
(
false
)
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
creditsCommodity
=
(
orderMode
l
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// 积分或渠道积分下单模式
const
outOrderCols
:
any
[]
=
[
{
...
...
src/pages/transaction/components/orderPayTabs/index.tsx
View file @
14a086c9
...
...
@@ -113,6 +113,8 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
const
processEnum
=
data
.
processEnum
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
...
...
@@ -194,11 +196,11 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
// },
},
{
title
:
'支付金额'
,
title
:
creditsCommodity
?
'积分'
:
'支付金额'
,
dataIndex
:
'payAmount'
,
align
:
'center'
,
key
:
'payAmount'
,
render
:
(
t
,
r
)
=>
`¥
${
t
}
`
render
:
(
t
,
r
)
=>
creditsCommodity
?
t
:
`¥
${
t
}
`
},
{
title
:
'支付方式'
,
...
...
src/pages/transaction/components/orderProductTable/index.tsx
View file @
14a086c9
...
...
@@ -42,7 +42,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
const
{
product
,
orderMode
,
orderKind
}
=
dataSource
||
{}
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
)
// 合计金额, 如果后端有传则用后端数据
...
...
@@ -56,14 +56,18 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
creditsCommodity
?
sum
:
`¥${sum}`
}
</
div
>
</
Col
>
<
Col
span=
{
2
}
>
<
div
>
促销立减
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
</
Col
>
<
Col
span=
{
2
}
>
<
div
>
优惠抵扣
</
div
>
<
div
>
{
`-¥${couponAmount}`
}
</
div
>
</
Col
>
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
促销立减
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
</
Col
>
}
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
优惠抵扣
</
div
>
<
div
>
{
`-¥${couponAmount}`
}
</
div
>
</
Col
>
}
{
contractOrder
?
null
:
<>
<
Col
span=
{
2
}
>
...
...
@@ -168,7 +172,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
const
OrderProductTable
:
React
.
FC
<
OrderProductTableProps
>
=
({
editable
})
=>
{
const
{
ctl
,
data
,
preview
}
=
useContext
(
OrderDetailContext
)
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
)
...
...
src/pages/transaction/components/orderSaleRecord/index.tsx
View file @
14a086c9
...
...
@@ -29,10 +29,10 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 用于储存已经修改过的订单id
const
dataRef
=
useRef
<
any
>
([])
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
creditsCommodity
=
(
orderMode
l
===
24
||
orderModel
===
25
)
// @todo 积分或渠道积分下单模式
const
creditsCommodity
=
(
orderMode
===
10
||
orderMode
===
25
)
// @todo 积分或渠道积分下单模式
const
outOrderCols
:
any
[]
=
[
{
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
14a086c9
...
...
@@ -167,7 +167,7 @@ const modalPriceActions = createFormActions()
export
const
MoneyTotalBox
=
({
dataSource
,
isEditData
})
=>
{
const
{
reloadFormData
}
=
useContext
(
OrderDetailContext
)
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
{
productAmount
,
freight
,
totalAmount
,
promotionAmount
,
couponAmount
,
products
}
=
product
...
...
@@ -226,14 +226,18 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
creditsCommodity
?
sum
:
`¥${sum}`
}
</
div
>
</
Col
>
<
Col
span=
{
2
}
>
<
div
>
促销立减
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
</
Col
>
<
Col
span=
{
2
}
>
<
div
>
优惠抵扣
</
div
>
<
div
><
Button
type=
"link"
style=
{
{
padding
:
0
,
height
:
'18px'
,
lineHeight
:
'18px'
}
}
>
{
`-¥${couponAmount}`
}
</
Button
></
div
>
</
Col
>
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
促销立减
</
div
>
<
div
>
{
`-¥${promotionAmount}`
}
</
div
>
</
Col
>
}
{
!
creditsCommodity
&&
<
Col
span=
{
2
}
>
<
div
>
优惠抵扣
</
div
>
<
div
><
Button
type=
"link"
style=
{
{
padding
:
0
,
height
:
'18px'
,
lineHeight
:
'18px'
}
}
>
{
`-¥${couponAmount}`
}
</
Button
></
div
>
</
Col
>
}
{
contractOrder
?
null
:
<>
<
Col
span=
{
2
}
>
...
...
@@ -381,7 +385,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
{
ctl
,
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
page_type
}
=
usePageStatus
()
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
[
warehouseVisible
,
setWarehouseVisible
]
=
useState
(
false
)
...
...
src/pages/transaction/purchaseOrder/index.tsx
View file @
14a086c9
...
...
@@ -16,8 +16,8 @@ import styled from 'styled-components'
import
cx
from
'classnames'
import
ModalForm
from
'@/components/ModalForm'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
CaretDownOutlined
}
from
'@ant-design/icons'
import
TableOperation
from
'@/components/TableOperation'
import
{
ORDER_TYPE_POINTS
}
from
'@/constants/order'
const
SelectStyles
=
styled
((
props
)
=>
<
div
className=
'select-list'
{
...
props
}
></
div
>)
`
.select_style_border {
...
...
@@ -61,11 +61,11 @@ const fetchTableData = async (params) => {
const
formActions
=
createFormActions
();
const
destroyActions
=
createFormActions
()
const
showDataSource
=
[
{
id
:
1
,
name
:
"换货"
},
{
id
:
2
,
name
:
"退货"
},
{
id
:
3
,
name
:
"维修"
},
]
//
const showDataSource = [
//
{ id: 1, name: "换货"},
//
{ id: 2, name: "退货"},
//
{ id: 3, name: "维修"},
//
]
const
PurchaseOrder
:
React
.
FC
<
PurchaseOrderProps
>
=
(
props
)
=>
{
const
[
saleVisible
,
setSaleVisible
]
=
useState
<
any
>
(
false
)
...
...
@@ -75,12 +75,29 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
ref
=
useRef
<
any
>
({})
const
destoryRef
=
useRef
<
any
>
({})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderBuyerCancel
)
const
[
showDataSource
,
setShowDataSource
]
=
useState
([
{
id
:
1
,
name
:
"换货"
},
{
id
:
2
,
name
:
"退货"
},
{
id
:
3
,
name
:
"维修"
},
])
// 售后唤起弹窗
const
handleSaleAfter
=
({
orderId
,
orderType
})
=>
{
setSaleVisible
(
true
)
setRecordId
(
orderId
)
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
=
()
=>
{
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/index.tsx
View file @
14a086c9
...
...
@@ -28,6 +28,7 @@ import { help } from '../../common'
import
styles
from
'./index.less'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
fetchOrderApi
}
from
'./apis'
import
{
fectchShopListsSource
}
from
'@/utils/type'
export
interface
PurchaseOrderDetailProps
{}
...
...
@@ -434,7 +435,18 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
}
effects=
{
(
$
,
ctx
)
=>
{
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
)
{
ctx
.
setFieldState
(
'orderMode'
,
state
=>
{
state
.
editable
=
false
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/schema/index.ts
View file @
14a086c9
...
...
@@ -3,14 +3,14 @@ import { GlobalConfig } from '@/global/config';
import
moment
from
'moment'
// 将获取的商城转化为可用类型
const
getShopTypeMap
=
(()
=>
{
return
GlobalConfig
.
web
.
shopInfo
.
filter
(
item
=>
(
item
.
type
===
1
)
&&
(
item
.
environment
===
1
)).
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
id
,
type
:
item
.
type
,
environment
:
item
.
environment
,
}))
})()
//
const getShopTypeMap = (() => {
//
return GlobalConfig.web.shopInfo.filter(item => (item.type === 1) && (item.environment === 1)).map(item => ({
//
label: item.name,
//
value: item.id,
//
type: item.type,
//
environment: item.environment,
//
}))
//
})()
// 基本信息
const
basicInfo
:
ISchema
=
{
...
...
@@ -67,7 +67,8 @@ const basicInfo: ISchema = {
},
shopId
:
{
type
:
'number'
,
enum
:
getShopTypeMap
,
// enum: getShopTypeMap,
enum
:
[],
title
:
'适应商城'
,
required
:
true
,
// visible: false,
...
...
src/pages/transaction/purchaseOrder/readyPayOrder/detail/index.tsx
View file @
14a086c9
import
React
,
{
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../../_public/order/context'
;
import
{
Button
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/orderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/orderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../../_public/order/effects/useOrderDetail'
;
import
OrderDetailSection
from
'../../../components/orderDetailSection'
;
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
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'p_readyPayOrder'
})
...
...
@@ -17,12 +20,23 @@ const ReadyConfirmContract: React.FC = () => {
// 处理积分支付跳转
if
(
data
&&
currentPayInfoId
){
if
(
data
.
payments
.
length
>
0
){
// let obj = data.payments.filter(item => item.id === Number(currentPayInfoId))[0]
// if(obj.channel === 0) {
// history.push(`/pay?orderId=${btoa(JSON.stringify({ orderId: id, memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId }))}`)
// } else {
let
obj
=
data
.
payments
.
filter
(
item
=>
item
.
paymentId
===
Number
(
currentPayInfoId
))[
0
]
console
.
log
(
obj
,
currentPayInfoId
)
if
(
obj
.
payChannel
===
10
)
{
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
)
//
}
}
}
}
},
[
data
,
currentPayInfoId
])
...
...
src/pages/transaction/transactionRules/components/ruleSetting.tsx
View file @
14a086c9
...
...
@@ -19,6 +19,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import
SelectProcesss
from
'./selectProcesss'
import
{
usePaymentTable
}
from
'../model/usePaymentTable'
import
{
help
}
from
'../../common'
import
{
fectchShopListsSource
}
from
'@/utils/type'
export
interface
RuleSettingProps
{
addSchemaAction
:
ISchemaFormActions
,
...
...
@@ -365,6 +366,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
CustomPayments
}
}
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
(()
=>
{
onFieldChange
()
})
...
...
src/pages/transaction/transactionRules/schema/index.tsx
View file @
14a086c9
...
...
@@ -164,7 +164,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
"type"
:
"array:number"
,
"x-component"
:
'CardCheckBox'
,
"x-component-props"
:
{
dataSource
:
GlobalConfig
.
web
.
shopInfo
.
sort
((
a
,
b
)
=>
a
.
type
-
b
.
type
)
,
dataSource
:
[]
,
type
:
'radio'
// CardCheckBox 单选模式
},
"title"
:
"适用商城"
,
...
...
src/utils/index.tsx
View file @
14a086c9
...
...
@@ -611,7 +611,7 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
export
const
getDefaultEnterprise
=
()
=>
{
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
]
let
result
:
any
=
undefined
if
(
defaultMall
)
{
...
...
src/utils/type.ts
View file @
14a086c9
export
function
isString
(
str
:
any
):
str
is
string
{
return
typeof
str
===
'string'
}
// 分数转小数
export
const
toPoint
=
(
percent
:
string
)
=>
{
let
str
:
any
=
percent
.
replace
(
"%"
,
""
);
str
=
str
/
100
;
return
str
;
}
// 小数转分数
export
const
toPercent
=
(
point
:
number
)
=>
{
// let str = Number(point * 100).toFixed(1);
let
str
:
any
=
Number
(
point
*
100
);
str
+=
"%"
;
return
str
;
}
\ No newline at end of file
import
{
GlobalConfig
}
from
'@/global/config'
;
import
{
PublicApi
}
from
'@/services/api'
;
export
function
isString
(
str
:
any
):
str
is
string
{
return
typeof
str
===
'string'
}
// 分数转小数
export
const
toPoint
=
(
percent
:
string
)
=>
{
let
str
:
any
=
percent
.
replace
(
"%"
,
""
);
str
=
str
/
100
;
return
str
;
}
// 小数转分数
export
const
toPercent
=
(
point
:
number
)
=>
{
// let str = Number(point * 100).toFixed(1);
let
str
:
any
=
Number
(
point
*
100
);
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