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
shenshaokai
jinfa-platform
Commits
0e5a9bd4
Commit
0e5a9bd4
authored
Sep 29, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
进货单下单
parent
4d18cc22
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
62 additions
and
21 deletions
+62
-21
app.tsx
src/app.tsx
+3
-3
BasicLayout.tsx
src/layouts/BasicLayout.tsx
+0
-1
MenuSlider.tsx
src/layouts/components/MenuSlider.tsx
+4
-1
RightContent.tsx
src/layouts/components/RightContent.tsx
+2
-0
index.tsx
...eOrder/orderDetail/components/productModalTable/index.tsx
+1
-1
index.ts
...es/transaction/purchaseOrder/orderDetail/effects/index.ts
+29
-4
index.tsx
src/pages/transaction/purchaseOrder/orderDetail/index.tsx
+21
-9
index.tsx
src/pages/transaction/purchaseOrder/orderPreview/index.tsx
+1
-1
auth.ts
src/utils/auth.ts
+1
-1
No files found.
src/app.tsx
View file @
0e5a9bd4
...
...
@@ -153,9 +153,9 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
// 路由切换时, 自动回到顶部
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
if
(
isDev
)
{
return
;
}
//
if (isDev) {
//
return;
//
}
if
(
whiteLists
.
includes
(
location
.
pathname
))
{
return
...
...
src/layouts/BasicLayout.tsx
View file @
0e5a9bd4
...
...
@@ -122,7 +122,6 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
setOpenKeys
([])
}
},
[
currentRouter
,
location
.
pathname
,
collapsed
])
console
.
log
(
getPageTitle
({
pathname
:
location
.
pathname
}),
"getPageTitle({ pathname: location.pathname })"
)
return
(
<
ProLayout
title=
""
...
...
src/layouts/components/MenuSlider.tsx
View file @
0e5a9bd4
...
...
@@ -7,6 +7,7 @@ import {
import
OuterSider
from
'./OuterSide'
import
{
GlobalConfig
}
from
'@/global/config'
import
styles
from
'../styles/MenuSlider.less'
import
{
getRouters
}
from
'@/utils/auth'
;
const
{
Sider
}
=
Layout
const
{
SubMenu
}
=
Menu
;
...
...
@@ -33,9 +34,11 @@ const MenuSlider: React.FC<MenuSliderProps> = (props) => {
const
getMenus
=
(
menuArray
:
any
,
hasChildren
:
boolean
=
false
)
=>
{
if
(
!!
menuArray
&&
menuArray
.
length
>
0
)
{
return
menuArray
.
map
((
item
:
any
)
=>
{
if
(
item
.
hideInMenu
)
{
// 不存在路由表内或者 需要隐藏
if
(
item
.
hideInMenu
||
!
getRouters
().
includes
(
item
.
path
))
{
return
null
}
if
(
item
.
children
)
{
return
(
<
SubMenu
...
...
src/layouts/components/RightContent.tsx
View file @
0e5a9bd4
...
...
@@ -8,6 +8,7 @@ import SelectLang from './SelectLang';
import
Location
from
'./Location'
;
import
Roles
from
'./Roles'
;
import
styles
from
'../styles/RightContent.less'
;
import
{
Link
}
from
'umi'
;
// export type SiderTheme = 'light' | 'dark';
// export interface GlobalHeaderRightProps extends Partial<ConnectProps> {
...
...
@@ -26,6 +27,7 @@ const GlobalHeaderRight: React.SFC<{}> = (props) => {
return
(
<
div
className=
{
className
}
>
<
Link
to=
'/'
style=
{
{
color
:
'rgba(0, 0, 0, 0.85)'
}
}
>
返回商城
</
Link
>
<
Roles
/>
<
Location
/>
<
SelectLang
/>
...
...
src/pages/transaction/purchaseOrder/orderDetail/components/productModalTable/index.tsx
View file @
0e5a9bd4
...
...
@@ -83,7 +83,7 @@ export const AddressPop = (props) => {
</
Space
>
:
children
}
const
filterProductDataById
=
(
data
,
targetData
)
=>
{
export
const
filterProductDataById
=
(
data
,
targetData
)
=>
{
return
targetData
.
reduce
(
async
(
prev
:
any
[],
next
)
=>
{
const
{
logistics
}
=
next
if
(
logistics
.
deliveryType
===
2
)
{
...
...
src/pages/transaction/purchaseOrder/orderDetail/effects/index.ts
View file @
0e5a9bd4
...
...
@@ -6,6 +6,7 @@ import { history } from 'umi';
import
{
fetchOrderApi
}
from
'../apis'
;
import
{
useUpdate
}
from
'@umijs/hooks'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
filterProductDataById
}
from
'../components/productModalTable'
// 异步填充表格字段
const
asyncPadDataForProduct
=
async
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
productValue
:
any
)
=>
{
...
...
@@ -110,10 +111,13 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
// 表单初始化时,对应操作
export
const
useOrderFormInitEffect
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
)
=>
{
const
{
orderModel
=
0
}
=
history
.
location
.
query
FormEffectHooks
.
onFormMount$
().
subscribe
(()
=>
{
// query中存在orderModel参数, 则是从其他页面跳转而来,需禁用其余query选项
const
typeEnums
=
parseInt
(
orderModel
)
const
{
modelType
=
0
,
spam_id
}
=
history
.
location
.
query
FormEffectHooks
.
onFormMount$
().
subscribe
(
async
()
=>
{
// query中存在modelType参数, 则是从其他页面跳转而来,需禁用其余query选项
// 商城跳转过来的数据
const
initValue
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
spam_id
))
const
typeEnums
=
parseInt
(
modelType
)
ctx
.
setFieldState
(
'orderModel'
,
state
=>
{
state
.
props
.
enum
=
state
.
props
.
enum
.
map
(
v
=>
{
const
assign
:
any
=
Object
.
assign
({},
v
)
...
...
@@ -124,6 +128,27 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
}).
sort
((
prev
,
next
)
=>
prev
.
disabled
?
prev
.
value
:
next
.
value
-
prev
.
value
)
})
// 从商城跳转, 需回显数据
if
(
initValue
)
{
ctx
.
setFieldValue
(
'supplyMembersId'
,
initValue
.
supplyMembersId
)
ctx
.
setFieldValue
(
'supplyMembersName'
,
initValue
.
supplyMembersName
)
ctx
.
setFieldValue
(
'orderProductRequests'
,
await
filterProductDataById
([],
initValue
.
orderList
[
0
].
orderList
.
map
(
v
=>
{
return
{
...
v
,
brandName
:
v
.
brand
,
customerCategoryName
:
v
.
category
,
unitPrice
:
v
.
priceRange
.
reduce
((
prev
,
next
)
=>
{
prev
[
next
.
range
]
=
next
.
price
return
prev
},
{}),
isMemberPrice
:
!!
v
.
memberDiscount
,
purchaseCount
:
v
.
count
,
price
:
v
.
count
*
v
.
unitPrice
,
}
})))
}
// 写入收货地址数据
useProductAddress
(
ctx
)
})
...
...
src/pages/transaction/purchaseOrder/orderDetail/index.tsx
View file @
0e5a9bd4
...
...
@@ -45,11 +45,6 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
const
addSchemaAction
=
createFormActions
()
const
orderTitle
=
{
0
:
'新增订单'
,
1
:
'审核订单'
,
}
// 总计金额联动框
export
const
MoneyTotalBox
=
registerVirtualBox
(
'moneyTotalBox'
,
props
=>
{
// @todo 由于缺乏商品字段, 目前选用假数据
...
...
@@ -59,7 +54,6 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
const
sum
=
data
.
reduce
((
prev
,
next
)
=>
prev
+
(
next
.
price
||
0
),
0
)
const
[
freePrice
,
setFreePrice
]
=
useState
<
number
>
(
0
)
useEffect
(()
=>
{
if
(
sum
+
freePrice
)
{
form
.
notify
(
'sumPrice'
,
sum
+
freePrice
)
...
...
@@ -113,13 +107,29 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
)
const
update
=
useUpdate
()
const
[
productSumPrice
,
setProductSumPrice
]
=
useState
<
number
>
(
0
)
const
[
initFormValue
,
setInitFormValue
]
=
useState
<
any
>
(
null
)
const
{
pageStatus
,
id
,
page_type
=
'0'
,
modelType
,
spam_id
}
=
usePageStatus
()
const
[
initFormValue
,
setInitFormValue
]
=
useState
<
any
>
(()
=>
{
let
resultState
=
{}
if
(
modelType
)
{
resultState
=
{
orderModel
:
parseInt
(
modelType
)
}
}
// 订单数据
if
(
spam_id
)
{
const
item
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
spam_id
))
if
(
item
)
{
console
.
log
(
item
)
}
}
return
resultState
})
const
[
paymentColumns
,
paymentComponents
,
paymentSave
]
=
usePaymentInfo
(
addSchemaAction
)
const
{
productAddButton
,
productRef
,
productColumns
,
productComponents
,
...
sectionProps
}
=
useProductTable
(
addSchemaAction
)
// 页面进入时, 当前所处的下单模式
const
{
pageStatus
,
id
,
page_type
=
'0'
}
=
usePageStatus
()
useEffect
(()
=>
{
if
(
id
)
{
...
...
@@ -172,7 +182,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
}
if
(
fnResult
.
code
===
1000
)
{
history
.
goBack
()
// 跳转至待新增列表
window
.
sessionStorage
.
removeItem
(
spam_id
)
history
.
replace
(
'/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder'
)
}
setBtnLoading
(
false
)
}
catch
(
error
)
{
...
...
src/pages/transaction/purchaseOrder/orderPreview/index.tsx
View file @
0e5a9bd4
...
...
@@ -269,7 +269,7 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
{
/* 提交时触发的弹窗集合 */
}
<
ModalForm
modalTitle=
'
单据审核
'
modalTitle=
'
提示
'
currentRef=
{
approvedRef
}
confirm=
{
handleConfirmApproved
}
actions=
{
approvedActions
}
...
...
src/utils/auth.ts
View file @
0e5a9bd4
...
...
@@ -24,7 +24,7 @@ export const setRouters = (routers: any[]) => {
window
.
sessionStorage
.
setItem
(
'rt'
,
JSON
.
stringify
(
routers
))
}
export
const
getRouters
=
()
=>
{
export
const
getRouters
=
()
:
string
[]
=>
{
try
{
const
sessionRt
=
window
.
sessionStorage
.
getItem
(
'rt'
)
return
sessionRt
?
JSON
.
parse
(
sessionRt
)
:
[]
...
...
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