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
7b3d7961
Commit
7b3d7961
authored
Jul 21, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 对接新订单采购订单查询筛选下拉和订单列表
parent
30ad2185
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
54 deletions
+87
-54
addBrand.tsx
src/pages/trademark/addBrand.tsx
+2
-2
constant.ts
src/pages/transaction/_public/order/constant.ts
+29
-23
index.tsx
src/pages/transaction/effect/index.tsx
+37
-1
index.tsx
src/pages/transaction/purchaseOrder/constant/index.tsx
+18
-18
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+1
-10
No files found.
src/pages/trademark/addBrand.tsx
View file @
7b3d7961
...
...
@@ -80,8 +80,8 @@ const AddBrand: React.FC<{}> = () => {
setFormValues
(
data
)
form
.
setFieldsValue
(
data
)
setlogoUrl
(
data
.
logoUrl
)
//
if(data.status === 4)
//
setBanSomeField(true)
if
(
data
.
status
===
4
)
setBanSomeField
(
true
)
// 多图回显
let
proveImgs
=
Object
.
values
(
data
.
proveUrl
)
let
files
=
[];
...
...
src/pages/transaction/_public/order/constant.ts
View file @
7b3d7961
import
{
get
SaleOrderInsideWorkState
}
from
'./../../effect/index'
;
import
{
get
PurchaseOrderSelectOption
,
getSaleOrderSelectOption
}
from
'./../../effect/index'
;
import
{
ISchema
}
from
'@formily/antd'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
// import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants/order'
import
{
getOrderType
,
getPurchaseOrderInsideWorkState
,
getPurchaseOrderOutWorkState
,
}
from
'../../effect'
export
const
orderTypeLabel
=
[
''
,
...
...
@@ -42,9 +40,13 @@ export enum SALE_ORDER_STATUS {
export
const
tableListSchema
:
any
=
()
=>
{
const
OrderType
=
getOrderType
()
const
PurchaseOrderOutWorkStateTexts
=
getPurchaseOrderOutWorkState
()
const
PurchaseOrderInsideWorkStateTexts
=
getPurchaseOrderInsideWorkState
()
const
res
=
getPurchaseOrderSelectOption
()
if
(
res
)
{
const
{
orderTypes
:
OrderType
,
innerStatus
:
PurchaseOrderInsideWorkStateTexts
,
outerStatus
:
PurchaseOrderOutWorkStateTexts
}
=
res
return
{
type
:
'object'
,
...
...
@@ -90,52 +92,53 @@ export const tableListSchema: any = () => {
},
properties
:
{
orderThe
:
{
digest
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入订单摘要'
,
}
},
"supplyMembers
Name"
:
{
"member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入供应会员名称'
}
},
"t
ype"
:
{
"orderT
ype"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择订单类型'
},
enum
:
OrderType
.
map
(
item
=>
({
label
:
item
[
'name
'
],
value
:
item
[
'status
'
],
label
:
item
[
'text
'
],
value
:
item
[
'id
'
],
}))
},
"externalState
"
:
{
"outerStatus
"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择外部状态'
},
enum
:
PurchaseOrderOutWorkStateTexts
.
map
(
item
=>
({
label
:
item
[
'name
'
],
value
:
item
[
'status
'
],
label
:
item
[
'text
'
],
value
:
item
[
'id
'
],
}))
},
"interiorState
"
:
{
"innerStatus
"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择内部状态'
},
enum
:
PurchaseOrderInsideWorkStateTexts
.
map
(
item
=>
({
label
:
item
[
'name
'
],
value
:
item
[
'status
'
],
label
:
item
[
'text
'
],
value
:
item
[
'id
'
],
}))
},
"[startCreateTime,endCreateTim
e]"
:
{
type
:
'array
'
,
"x-component"
:
'DateRangePickerUnix'
,
"[startDate, endDat
e]"
:
{
type
:
'daterange
'
,
//
"x-component": 'DateRangePickerUnix',
'x-component-props'
:
{
// showTime: true,
placeholder
:
[
'开始时间'
,
'结束时间'
],
},
},
...
...
@@ -149,6 +152,7 @@ export const tableListSchema: any = () => {
},
}
}
}
}
...
...
@@ -160,9 +164,11 @@ export const tableListSchema: any = () => {
export
const
saleTableListSchema
:
any
=
()
=>
{
const
OrderType
=
getOrderType
()
const
PurchaseOrderOutWorkStateTexts
=
getPurchaseOrderOutWorkState
()
const
SaleOrderInsideWorkStateTexts
=
getSaleOrderInsideWorkState
()
const
{
orderTypes
:
OrderType
,
innerStatus
:
SaleOrderInsideWorkStateTexts
,
outerStatus
:
PurchaseOrderOutWorkStateTexts
}
=
getSaleOrderSelectOption
()
return
{
type
:
'object'
,
...
...
src/pages/transaction/effect/index.tsx
View file @
7b3d7961
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetOrderBuyerPageItemsResponse
}
from
'@/services/OrderV2Api'
;
...
...
@@ -17,10 +18,45 @@ export const searchSelectGetSelectCategoryOptionEffect = (context: any, fieldNam
/** 订单状态逻辑复用 */
interface
IState
{
s
a
tatus
:
number
;
status
:
number
;
name
:
string
;
}
/** 获取采购订单下拉项:订单类型、内部状态、外部状态 */
export
const
getPurchaseOrderSelectOption
=
()
=>
{
const
[
state
,
setstate
]
=
useState
<
GetOrderBuyerPageItemsResponse
>
()
useEffect
(()
=>
{
PublicApi
.
getOrderBuyerPageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
}
})
},
[])
return
state
}
/** @todo 获取销售订单下拉项:订单类型、内部状态、外部状态 */
export
const
getSaleOrderSelectOption
=
()
=>
{
const
[
state
,
setstate
]
=
useState
<
any
>
()
// useEffect(() => {
// PublicApi.getOrderBuyerPageItems({}).then(res => {
// const { code, data } = res
// if(code === 1000) {
// setstate(data)
// }
// })
// }, [])
return
state
}
// **以下*即将弃用*** //
/** 获取订单类型映射 */
export
const
getOrderType
=
()
=>
{
const
[
state
,
setstate
]
=
useState
<
IState
[]
>
([])
...
...
src/pages/transaction/purchaseOrder/constant/index.tsx
View file @
7b3d7961
...
...
@@ -31,15 +31,15 @@ export const baseOrderListColumns: any = () => {
{
title
:
'订单摘要'
,
align
:
'center'
,
dataIndex
:
'
orderThe
'
,
key
:
'
orderThe
'
,
dataIndex
:
'
digest
'
,
key
:
'
digest
'
,
ellipsis
:
true
,
},
{
title
:
'供应会员'
,
align
:
'center'
,
dataIndex
:
'
supplyMembers
Name'
,
key
:
'
supplyMembers
Name'
,
dataIndex
:
'
member
Name'
,
key
:
'
member
Name'
,
ellipsis
:
true
,
},
{
...
...
@@ -59,28 +59,28 @@ export const baseOrderListColumns: any = () => {
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'
t
ypeName'
,
key
:
'
t
ypeName'
,
filters
:
OrderType
.
map
((
e
,
i
)
=>
({
text
:
e
[
'
name'
],
value
:
Number
(
e
[
'status
'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
t
ype
,
dataIndex
:
'
orderT
ypeName'
,
key
:
'
orderT
ypeName'
,
filters
:
OrderType
.
map
((
e
,
i
)
=>
({
text
:
e
[
'
text'
],
value
:
Number
(
e
[
'id
'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
orderT
ype
,
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'
externalStat
e'
,
key
:
'
externalStat
e'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'
externalState
Name'
]
}
/>,
filters
:
PurchaseOrderOutWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'
name'
],
value
:
Number
(
e
[
'status
'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
externalState
,
dataIndex
:
'
outerStatusNam
e'
,
key
:
'
outerStatusNam
e'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'
outerStatus
Name'
]
}
/>,
filters
:
PurchaseOrderOutWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'
text'
],
value
:
Number
(
e
[
'id
'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
outerStatus
,
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'in
teriorStat
e'
,
key
:
'in
teriorStat
e'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
text=
{
record
[
'in
teriorState
Name'
]
}
/>,
filters
:
PurchaseOrderInsideWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'
name'
],
value
:
Number
(
e
[
'status
'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
in
teriorState
,
dataIndex
:
'in
nerStatusNam
e'
,
key
:
'in
nerStatusNam
e'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
text=
{
record
[
'in
nerStatus
Name'
]
}
/>,
filters
:
PurchaseOrderInsideWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'
text'
],
value
:
Number
(
e
[
'id
'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
in
nerStatus
,
}
]
}
src/pages/transaction/purchaseOrder/index.tsx
View file @
7b3d7961
...
...
@@ -54,7 +54,7 @@ const SelectStyles = styled((props) => <div className='select-list' {...props}><
export
interface
PurchaseOrderProps
{
}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrder
ProcurementOrderList
(
params
)
const
{
data
}
=
await
PublicApi
.
getOrder
BuyerPage
(
params
)
return
data
}
...
...
@@ -119,8 +119,6 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
handleCancel
=
async
(
id
)
=>
{
destoryRef
.
current
.
setVisible
(
true
)
destroyActions
.
setFieldValue
(
'id'
,
id
)
// await PublicApi.postOrderPurchaseOrderCancel({id})
// ref.current.reload()
}
/** 参照后台数据生成 */
...
...
@@ -134,7 +132,6 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
'4'
:
[
'售后'
,
'评价'
],
}
const
operationHandler
=
{
// @todo 取消订单
'取消订单'
:
()
=>
handleCancel
(
record
.
id
),
'售后'
:
()
=>
handleSaleAfter
(
record
.
id
),
'评价'
:
()
=>
handleEvaluate
(
record
.
id
),
...
...
@@ -156,12 +153,6 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
:
any
,
record
:
any
)
=>
renderOptionButton
(
record
)
// render: (text, record) => <>
// { record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER && !record.procurementEevaluateState && <Button type='link' onClick={() => handleEvaluate(record.id)}>评价</Button> }
// {
// (record.receivingTimes >= 1 || record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER) && <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button>
// }
// </>
}
])
...
...
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