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
09830307
Commit
09830307
authored
Dec 29, 2020
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复物流能力提交物流单的, 修改商品询价接口新增rouldId和ruleName
parent
77608542
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
734 additions
and
693 deletions
+734
-693
index.tsx
src/components/ModalTable/index.tsx
+152
-149
index.ts
src/components/ModalTable/schema/index.ts
+61
-0
index.tsx
src/pages/logistics/addLogistics/index.tsx
+2
-3
orderSearchDetail.tsx
src/pages/logistics/components/orderSearchDetail.tsx
+35
-25
addCompany.tsx
src/pages/logistics/list/addCompany.tsx
+12
-68
setUpModal.tsx
src/pages/payandSettle/paySetting/components/setUpModal.tsx
+2
-2
index.tsx
src/pages/payandSettle/paySetting/index.tsx
+8
-8
addForm.tsx
src/pages/transaction/goodsOffer/addEnquiryOrder/addForm.tsx
+12
-6
basicInfo.tsx
...ction/goodsOffer/addEnquiryOrder/components/basicInfo.tsx
+2
-1
enquiryGoods.tsx
...on/goodsOffer/addEnquiryOrder/components/enquiryGoods.tsx
+17
-0
details.tsx
src/pages/transaction/goodsOffer/components/details.tsx
+431
-431
No files found.
src/components/ModalTable/index.tsx
View file @
09830307
import
React
,
{
ReactText
,
useRef
,
useEffect
,
useLayoutEffect
}
from
'react'
;
import
{
StandardTable
}
from
'god'
;
import
NestTable
from
'@/components/NestTable'
;
import
{
IStandardTableProps
}
from
'god/dist/src/standard-table'
;
import
{
Row
,
Col
,
Modal
}
from
'antd'
;
import
{
productModalSchema
,
productModalByMemberSchema
,
memberModalSchema
,
inquirySchema
,
demandSchema
,
enquirySchema
,
mergeOrderSchema
,
goodsModalSchema
,
demandNumberSchema
,
logisticsDeliverySearchSchema
,
addOrderModalSchema
,
logisticsSelectGoodsSearchSchema
,
SelectRfqOrderSearchSchema
}
from
'./schema'
;
import
Search
from
'../NiceForm/components/Search'
;
import
SearchSelect
from
'../NiceForm/components/SearchSelect'
;
import
Submit
from
'../NiceForm/components/Submit'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
DateSelect
from
'../NiceForm/components/DateSelect'
;
export
interface
ModalTableProps
extends
IStandardTableProps
<
any
>
{
width
?:
number
,
modalTitle
?:
ReactText
,
confirm
?(),
cancel
?(),
visible
?:
boolean
,
resetModal
?:
object
,
modalType
?:
'productByDefault'
|
'productByMember'
|
'memberByDefault'
|
'inquiryByDefault'
|
'demandByDefault'
|
'enquiryModel'
|
'MergeOrderByDefault'
|
'goodsModalSchema'
|
'demandNumberSchema'
|
'logisticsDelivery'
|
'addOrderModalSchema'
|
'selectGoodsSchema'
|
'selectRfqOrder'
|
'none'
,
useNestTable
?:
boolean
,
// 是否使用嵌套表格
nestColumns
?:
any
[],
nestTableProps
?:
any
,
// fix: 新增参数, 为true时每次开启弹窗都会重新reload接口
forceRender
?:
boolean
,
searchName
?:
string
}
const
ModalTable
:
React
.
FC
<
ModalTableProps
>
=
(
props
)
=>
{
const
{
width
=
704
,
modalTitle
,
confirm
,
cancel
,
visible
,
currentRef
,
resetModal
,
modalType
=
'none'
,
forceRender
,
useNestTable
=
false
,
nestColumns
,
nestTableProps
,
searchName
,
...
resetTable
}
=
props
const
selfRef
=
currentRef
||
useRef
<
any
>
({})
useEffect
(()
=>
{
if
(
visible
&&
forceRender
)
{
// 重新开启时需reload接口
// fix: 去掉自动reload接口, 防止重复请求
// fix: 新增forceRender接口, 用于控制弹窗是否需要reload
selfRef
.
current
.
reload
&&
selfRef
.
current
.
reload
()
}
else
{
selfRef
.
current
.
resetField
&&
selfRef
.
current
.
resetField
({
validate
:
false
})
}
},
[
visible
])
const
modelSchemaRender
=
()
=>
{
switch
(
modalType
)
{
case
'productByDefault'
:
{
return
productModalSchema
}
case
'productByMember'
:
{
return
productModalByMemberSchema
}
case
'memberByDefault'
:
{
return
memberModalSchema
}
case
'inquiryByDefault'
:
{
return
inquirySchema
}
case
'enquiryModel'
:{
return
enquirySchema
}
case
'demandByDefault'
:
{
return
demandSchema
}
case
'MergeOrderByDefault'
:
{
return
mergeOrderSchema
}
case
'goodsModalSchema'
:
{
return
goodsModalSchema
}
case
'demandNumberSchema'
:
{
return
demandNumberSchema
}
case
'logisticsDelivery'
:
{
return
logisticsDeliverySearchSchema
}
case
'addOrderModalSchema'
:
{
return
addOrderModalSchema
}
case
'selectGoodsSchema'
:
{
return
logisticsSelectGoodsSearchSchema
}
case
'selectRfqOrder'
:
{
return
SelectRfqOrderSearchSchema
}
case
'none'
:
{
return
{}
}
}
}
return
(
<
Modal
width=
{
width
}
title=
{
modalTitle
}
onOk=
{
confirm
}
onCancel=
{
cancel
}
visible=
{
visible
}
{
...
resetModal
}
>
{
useNestTable
?
(
<
NestTable
NestColumns=
{
nestColumns
}
className=
"common_tb"
rowClassName=
{
(
_
,
index
)
=>
(
index
%
2
)
===
0
&&
"tb_bg"
}
{
...
nestTableProps
}
/>
)
:
(
<
StandardTable
tableType=
'small'
currentRef=
{
selfRef
}
formRender=
{
(
child
,
ps
)
=>
<
Row
justify=
'space-between'
style=
{
{
marginBottom
:
16
}
}
>
<
Col
span=
{
18
}
style=
{
{
zIndex
:
99
}
}
>
{
child
}
</
Col
>
<
Col
style=
{
{
marginTop
:
4
}
}
>
{
ps
}
</
Col
>
</
Row
>
}
formilyProps=
{
modalType
===
'none'
?
null
:
{
ctx
:
{
schema
:
modelSchemaRender
(),
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
,
DateSelect
},
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
searchName
?
searchName
:
'name'
,
FORM_FILTER_PATH
,
);
}
}
}
}
{
...
resetTable
}
/>
)
}
</
Modal
>
)
}
ModalTable
.
defaultProps
=
{}
export
default
ModalTable
import
React
,
{
ReactText
,
useRef
,
useEffect
,
useLayoutEffect
}
from
'react'
;
import
{
StandardTable
}
from
'god'
;
import
NestTable
from
'@/components/NestTable'
;
import
{
IStandardTableProps
}
from
'god/dist/src/standard-table'
;
import
{
Row
,
Col
,
Modal
}
from
'antd'
;
import
{
productModalSchema
,
productModalByMemberSchema
,
memberModalSchema
,
inquirySchema
,
demandSchema
,
enquirySchema
,
mergeOrderSchema
,
goodsModalSchema
,
demandNumberSchema
,
logisticsDeliverySearchSchema
,
addOrderModalSchema
,
logisticsSelectGoodsSearchSchema
,
SelectRfqOrderSearchSchema
,
SelectLogisticsService
}
from
'./schema'
;
import
Search
from
'../NiceForm/components/Search'
;
import
SearchSelect
from
'../NiceForm/components/SearchSelect'
;
import
Submit
from
'../NiceForm/components/Submit'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
DateSelect
from
'../NiceForm/components/DateSelect'
;
export
interface
ModalTableProps
extends
IStandardTableProps
<
any
>
{
width
?:
number
,
modalTitle
?:
ReactText
,
confirm
?(),
cancel
?(),
visible
?:
boolean
,
resetModal
?:
object
,
modalType
?:
'productByDefault'
|
'productByMember'
|
'memberByDefault'
|
'inquiryByDefault'
|
'demandByDefault'
|
'enquiryModel'
|
'MergeOrderByDefault'
|
'goodsModalSchema'
|
'demandNumberSchema'
|
'logisticsDelivery'
|
'addOrderModalSchema'
|
'selectGoodsSchema'
|
'selectRfqOrder'
|
'SelectLogisticsService'
|
'none'
,
useNestTable
?:
boolean
,
// 是否使用嵌套表格
nestColumns
?:
any
[],
nestTableProps
?:
any
,
// fix: 新增参数, 为true时每次开启弹窗都会重新reload接口
forceRender
?:
boolean
,
searchName
?:
string
}
const
ModalTable
:
React
.
FC
<
ModalTableProps
>
=
(
props
)
=>
{
const
{
width
=
704
,
modalTitle
,
confirm
,
cancel
,
visible
,
currentRef
,
resetModal
,
modalType
=
'none'
,
forceRender
,
useNestTable
=
false
,
nestColumns
,
nestTableProps
,
searchName
,
...
resetTable
}
=
props
const
selfRef
=
currentRef
||
useRef
<
any
>
({})
useEffect
(()
=>
{
if
(
visible
&&
forceRender
)
{
// 重新开启时需reload接口
// fix: 去掉自动reload接口, 防止重复请求
// fix: 新增forceRender接口, 用于控制弹窗是否需要reload
selfRef
.
current
.
reload
&&
selfRef
.
current
.
reload
()
}
else
{
selfRef
.
current
.
resetField
&&
selfRef
.
current
.
resetField
({
validate
:
false
})
}
},
[
visible
])
const
modelSchemaRender
=
()
=>
{
switch
(
modalType
)
{
case
'productByDefault'
:
{
return
productModalSchema
}
case
'productByMember'
:
{
return
productModalByMemberSchema
}
case
'memberByDefault'
:
{
return
memberModalSchema
}
case
'inquiryByDefault'
:
{
return
inquirySchema
}
case
'enquiryModel'
:{
return
enquirySchema
}
case
'demandByDefault'
:
{
return
demandSchema
}
case
'MergeOrderByDefault'
:
{
return
mergeOrderSchema
}
case
'goodsModalSchema'
:
{
return
goodsModalSchema
}
case
'demandNumberSchema'
:
{
return
demandNumberSchema
}
case
'logisticsDelivery'
:
{
return
logisticsDeliverySearchSchema
}
case
'addOrderModalSchema'
:
{
return
addOrderModalSchema
}
case
'selectGoodsSchema'
:
{
return
logisticsSelectGoodsSearchSchema
}
case
'selectRfqOrder'
:
{
return
SelectRfqOrderSearchSchema
}
case
'SelectLogisticsService'
:
{
return
SelectLogisticsService
}
case
'none'
:
{
return
{}
}
}
}
return
(
<
Modal
width=
{
width
}
title=
{
modalTitle
}
onOk=
{
confirm
}
onCancel=
{
cancel
}
visible=
{
visible
}
{
...
resetModal
}
>
{
useNestTable
?
(
<
NestTable
NestColumns=
{
nestColumns
}
className=
"common_tb"
rowClassName=
{
(
_
,
index
)
=>
(
index
%
2
)
===
0
&&
"tb_bg"
}
{
...
nestTableProps
}
/>
)
:
(
<
StandardTable
tableType=
'small'
currentRef=
{
selfRef
}
formRender=
{
(
child
,
ps
)
=>
<
Row
justify=
'space-between'
style=
{
{
marginBottom
:
16
}
}
>
<
Col
span=
{
18
}
style=
{
{
zIndex
:
99
}
}
>
{
child
}
</
Col
>
<
Col
style=
{
{
marginTop
:
4
}
}
>
{
ps
}
</
Col
>
</
Row
>
}
formilyProps=
{
modalType
===
'none'
?
null
:
{
ctx
:
{
schema
:
modelSchemaRender
(),
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
,
DateSelect
},
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
searchName
?
searchName
:
'name'
,
FORM_FILTER_PATH
,
);
}
}
}
}
{
...
resetTable
}
/>
)
}
</
Modal
>
)
}
ModalTable
.
defaultProps
=
{}
export
default
ModalTable
src/components/ModalTable/schema/index.ts
View file @
09830307
...
...
@@ -798,3 +798,64 @@ export const SelectRfqOrderSearchSchema: ISchema = {
}
}
}
/** 选择物流服务商 */
export
const
SelectLogisticsService
:
ISchema
=
{
type
:
'object'
,
properties
:
{
name
:
{
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'会员名称'
,
align
:
'flex-left'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
style
:
{
marginRight
:
0
}
},
colStyle
:
{
marginTop
:
20
,
},
},
properties
:
{
roleId
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
"x-component-props"
:
{
placeholder
:
'选择会员角色'
,
fetchSearch
:
()
=>
{
return
new
Promise
(
resolve
=>
{
PublicApi
.
getMemberManageRoleAll
().
then
(
res
=>
{
res
.
data
.
forEach
((
item
:
any
)
=>
{
item
.
id
=
item
.
roleId
;
item
.
name
=
item
.
roleName
;
})
resolve
(
res
)
})
})
},
style
:
{
width
:
160
}
}
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
}
src/pages/logistics/addLogistics/index.tsx
View file @
09830307
...
...
@@ -425,9 +425,9 @@ const AddLogistics: React.FC<{}> = () => {
volume
:
item
.
volume
})
})
goodsForm
.
resetFields
()
setdetailList
([...
arr
])
setvisible
(
false
)
console
.
log
(
selectRow
,
10086
)
}
/***表头区域 */
...
...
@@ -569,7 +569,6 @@ const AddLogistics: React.FC<{}> = () => {
goodsRowCtl
.
setSelectRow
(
list
)
goodsRowCtl
.
setSelectedRowKeys
(
list
.
map
(
v
=>
v
.
productId
));
setdetailList
([...
list
])
goodsForm
.
resetFields
();
}
/**打开选择商品 */
...
...
@@ -598,7 +597,7 @@ const AddLogistics: React.FC<{}> = () => {
if
(
detailList
.
length
>
0
)
{
if
(
goodsRef
.
errorFields
)
{
data
[
1
]
=
goodsRef
.
errorFields
.
length
;
setbadge
(
data
);
setbadge
(
[...
data
]
);
}
else
{
data
[
1
]
=
0
;
setbadge
(
data
)
...
...
src/pages/logistics/components/orderSearchDetail.tsx
View file @
09830307
import
React
,
{
useEffect
,
useState
,
ReactNode
,
useRef
}
from
'react'
;
import
{
Row
,
Col
,
Table
,
Input
,
Button
,
Tag
,
Badge
,
Steps
,
}
from
'antd'
import
{
Row
,
Col
,
Table
,
Input
,
Button
,
Tag
,
Badge
,
Steps
,
message
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
CheckSquareOutlined
}
from
'@ant-design/icons'
import
{
ColumnType
}
from
'antd/lib/table/interface'
...
...
@@ -9,10 +9,12 @@ import { PublicApi } from '@/services/api'
import
moment
from
'moment'
import
style
from
'./index.less'
import
statuStyle
from
'../colorTag'
import
{
getLogisticsSelectListFreightTemplate
}
from
'@/services/LogisticsApi'
;
const
{
Step
}
=
Steps
const
detailInfo
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
[
freightPrice
,
setfreightPrice
]
=
useState
<
any
>
(
null
);
let
[
isextraOption
,
setIsextraOption
]
=
useState
(
false
)
let
[
dataInfo
,
setdataInfo
]
=
useState
<
any
>
({
status
:
''
,
...
...
@@ -141,7 +143,7 @@ const detailInfo: React.FC<{}> = () => {
dataIndex
:
'operatorRoleId'
,
align
:
'center'
,
key
:
'operatorRoleId'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
<
span
>
{
index
+
1
}
</
span
>
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
<
span
>
{
index
+
1
}
</
span
>
},
{
title
:
'操作角色'
,
...
...
@@ -156,10 +158,10 @@ const detailInfo: React.FC<{}> = () => {
key
:
'status'
,
render
:
(
text
:
number
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
;
text
===
1
?
component
=
<
Badge
status=
'default'
text=
"待提交"
/>:
text
===
2
?
component
=
<
Badge
status=
'processing'
text=
"待确认"
/>
:
text
===
3
?
component
=
<
Badge
status=
'error'
text=
"不接受物流单"
/>
:
component
=
<
Badge
status=
'success'
text=
"接受物流单"
/>
text
===
1
?
component
=
<
Badge
status=
'default'
text=
"待提交"
/>
:
text
===
2
?
component
=
<
Badge
status=
'processing'
text=
"待确认"
/>
:
text
===
3
?
component
=
<
Badge
status=
'error'
text=
"不接受物流单"
/>
:
component
=
<
Badge
status=
'success'
text=
"接受物流单"
/>
return
component
;
},
},
...
...
@@ -168,16 +170,16 @@ const detailInfo: React.FC<{}> = () => {
dataIndex
:
'type'
,
align
:
'center'
,
key
:
'type'
,
render
:
(
text
:
number
,
record
:
any
)
=>
<>
{
text
===
1
?
'提交物流单'
:
'确认物流单'
}
</>
render
:
(
text
:
number
,
record
:
any
)
=>
<>
{
text
===
1
?
'提交物流单'
:
'确认物流单'
}
</>
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
key
:
'operateTime'
,
render
:(
text
:
any
,
record
:
any
)
=>
<>
{
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</>
},
render
:
(
text
:
any
,
record
:
any
)
=>
<>
{
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</>
},
{
title
:
'审核意见'
,
dataIndex
:
'remark'
,
...
...
@@ -213,9 +215,10 @@ const detailInfo: React.FC<{}> = () => {
}
//待确认物流单
if
(
pathdetail
===
'toOrderComfirmList'
||
path
[
path
.
length
-
1
]
===
'option'
)
{
if
(
pathdetail
===
'toOrderComfirmList'
||
path
[
path
.
length
-
1
]
===
'option'
)
{
PublicApi
.
getLogisticsOrderWaitConfirmGet
({
id
:
id
}).
then
(
res
=>
{
setdataInfo
(
res
.
data
)
setfreightPrice
(
res
.
data
.
freightPrice
)
let
current
=
0
if
(
res
.
data
.
status
==
1
)
{
current
=
0
...
...
@@ -229,8 +232,7 @@ const detailInfo: React.FC<{}> = () => {
})
}
return
()
=>
{
}
setfreightPrice
(
dataInfo
.
freightPrice
)
},
[])
const
handleModalOK
=
()
=>
{
...
...
@@ -238,14 +240,20 @@ const detailInfo: React.FC<{}> = () => {
history
.
goBack
()
}
const
[
freightPrice
,
setfreightPrice
]
=
useState
<
any
>
(
null
);
// 输入报价价格
const
inputOnchange
=
(
e
:
any
)
=>
{
const
value
=
e
.
target
.
value
;
setfreightPrice
(
value
);
}
const
handleAudit
=
()
=>
{
if
(
freightPrice
)
{
setvisible
(
true
)
}
else
{
message
.
error
(
'请输入运费'
)
}
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
window
.
history
.
back
()
}
...
...
@@ -263,7 +271,7 @@ const detailInfo: React.FC<{}> = () => {
extra=
{
type
===
'option'
&&
<>
<
Button
onClick=
{
()
=>
setvisible
(
true
)
}
className=
{
style
[
'saveBtn'
]
}
>
<
Button
onClick=
{
handleAudit
}
className=
{
style
[
'saveBtn'
]
}
>
<
CheckSquareOutlined
/>
确认物流单
</
Button
>
...
...
@@ -420,14 +428,16 @@ const detailInfo: React.FC<{}> = () => {
item
.
key
===
'freight'
?
<>
{
type
===
'option'
?
<
Input
addonBefore=
"¥"
onBlur=
{
inputOnchange
}
value=
{
item
.
value
}
type=
'number'
maxLength=
{
25
}
style=
{
{
width
:
'300px'
}
}
/>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
<
Input
value=
{
freightPrice
}
addonBefore=
"¥"
onChange=
{
inputOnchange
}
type=
'number'
maxLength=
{
25
}
style=
{
{
width
:
'300px'
}
}
/>
</
div
>
:
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
dataInfo
.
status
<
3
?
'未报价'
:
item
.
value
}
...
...
@@ -453,7 +463,7 @@ const detailInfo: React.FC<{}> = () => {
columns=
{
columns
}
dataSource=
{
dataInfo
.
logisticsOrderLogList
}
pagination=
{
false
}
rowKey=
{
(
record
:
any
,
index
:
number
)
=>
index
}
rowKey=
{
(
record
:
any
,
index
:
number
)
=>
index
}
/>
{
/* <OrderLog id={id} pathName={history.location.pathname} /> 2020-12-11 已经在详情接口返回 不需要这个了 */
}
</
Col
>
...
...
src/pages/logistics/list/addCompany.tsx
View file @
09830307
...
...
@@ -94,16 +94,6 @@ const company: React.FC<parmas> = (props) => {
useEffect
(()
=>
{
let
_title
=
pageStatus
===
PageStatus
.
PREVIEW
?
'查看'
:
id
?
'编辑'
:
'新建'
setHeaderTitle
(
`
${
_title
}
物流公司`
)
PublicApi
.
getMemberManageRoleAll
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
{
data
}
=
res
||
{}
let
list
=
data
.
map
(
v
=>
({
label
:
v
.
roleName
,
value
:
v
.
roleId
}))
setroleList
(
list
)
}
})
if
(
id
)
{
PublicApi
.
getLogisticsCompanyGet
({
id
:
id
}).
then
(
res
=>
{
const
data
=
res
.
data
...
...
@@ -120,7 +110,6 @@ const company: React.FC<parmas> = (props) => {
const
handleSubmitAllSetting
=
()
=>
{
menuForm
.
validateFields
().
then
((
values
:
any
)
=>
{
console
.
log
(
values
,
'嘿嘿嘿'
)
if
(
id
)
{
values
.
id
=
id
setLoading
(
true
)
...
...
@@ -175,15 +164,16 @@ const company: React.FC<parmas> = (props) => {
const
handleSelectOk
=
()
=>
{
console
.
log
(
'数据'
,
productRowCtl
);
const
selectRow
=
productRowCtl
.
selectRow
[
0
]
let
{
memberId
,
roleId
,
name
}
=
selectRow
menuForm
.
setFieldsValue
({
companyMemberId
:
memberId
,
companyRoleId
:
roleId
,
name
:
name
})
setsVisible
(
false
)
if
(
productRowCtl
.
selectRow
.
length
>
0
)
{
const
selectRow
=
productRowCtl
.
selectRow
[
0
]
let
{
memberId
,
roleId
,
name
}
=
selectRow
menuForm
.
setFieldsValue
({
companyMemberId
:
memberId
,
companyRoleId
:
roleId
,
name
:
name
})
setsVisible
(
false
)
}
}
const
handleSelectCancel
=
()
=>
{
setsVisible
(
false
)
...
...
@@ -203,25 +193,6 @@ const company: React.FC<parmas> = (props) => {
</
Button
>
)
const
formSearch
:
ISchema
=
{
type
:
'object'
,
properties
:
{
name
:
{
type
:
'string'
,
"x-component"
:
"Search"
,
"x-component-props"
:
{
placeholder
:
'输入关键字搜索'
}
},
roleId
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'选择会员角色'
},
enum
:
roleList
}
}
}
return
(
<
PageHeaderWrapper
...
...
@@ -342,29 +313,7 @@ const company: React.FC<parmas> = (props) => {
</
Card
>
</
Col
>
</
Row
>
{
/* <Modal
title="选择平台物流服务商"
width='800px'
visible={visible}
onOk={handleSelectOk}
onCancel={handleSelectCancel}
okText="确认"
cancelText="取消"
>
<Row>
<Col span={10}> <Input.Search placeholder="输入关键字进行搜索" /></Col>
<Col span={14}></Col>
</Row>
<StandardTable
columns={columns}
currentRef={ref}
rowSelection={{
type:'radio',
...rowSelection
}}
fetchTableData={(params: any) => fetchData(params)}
/>
</Modal> */
}
<
ModalTable
modalTitle=
'选择平台物流服务商'
confirm=
{
handleSelectOk
}
...
...
@@ -373,16 +322,11 @@ const company: React.FC<parmas> = (props) => {
columns=
{
columns
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
params
=>
fetchData
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
formSearch
}
}
}
modalType=
"SelectLogisticsService"
tableProps=
{
{
rowKey
:
'memberId'
}
}
>
</
ModalTable
>
...
...
src/pages/payandSettle/paySetting/components/setUpModal.tsx
View file @
09830307
...
...
@@ -40,7 +40,7 @@ const SetUpModal: React.FC<setUpModalParams> = (props) => {
}
const
obj
=
{
id
:
edit
.
id
?
edit
.
id
:
undefined
,
code
:
option
.
children
,
code
:
option
.
children
?
option
.
children
:
edit
.
code
,
value
:
res
.
value
,
describe
:
res
.
describe
,
type
:
idType
,
...
...
@@ -63,7 +63,7 @@ const SetUpModal: React.FC<setUpModalParams> = (props) => {
form
.
setFieldsValue
({
code
:
edit
.
payWayCodeTypeEnum
,
value
:
edit
.
value
,
describe
:
edit
.
edit
describe
:
edit
.
describe
})
}
},
[
edit
])
...
...
src/pages/payandSettle/paySetting/index.tsx
View file @
09830307
...
...
@@ -70,12 +70,12 @@ const PayWaySetTemplate: React.FC<{}> = () => {
const
onDel
=
(
value
:
any
,
index
:
number
,
idx
:
number
)
=>
{
console
.
log
(
value
,
index
,
idx
,
10086
)
const
data
=
[...
payItem
];
if
(
Number
(
value
)
===
1
)
{
data
[
idx
].
payParametersAddListRequests
.
splice
(
index
,
1
);
data
[
idx
].
payParametersAddListRequests
=
[...
data
[
idx
].
payParametersAddListRequests
]
}
else
{
if
(
Number
(
value
)
===
2
)
{
data
[
idx
].
payParametersList
.
splice
(
index
,
1
);
data
[
idx
].
payParametersList
=
[...
data
[
idx
].
payParametersList
]
}
else
{
data
[
idx
].
payParametersAddListRequests
.
splice
(
index
,
1
);
data
[
idx
].
payParametersAddListRequests
=
[...
data
[
idx
].
payParametersAddListRequests
]
}
setPayItem
([...
data
]);
}
...
...
@@ -83,12 +83,12 @@ const PayWaySetTemplate: React.FC<{}> = () => {
const
onEdit
=
(
value
:
any
,
type
:
number
,
index
:
number
,
idx
:
number
)
=>
{
console
.
log
(
value
,
type
,
index
,
idx
)
const
data
=
[...
payItem
];
if
(
type
===
1
)
{
data
[
idx
].
payParametersAddListRequests
[
index
]
=
{
...
value
};
data
[
idx
].
payParametersAddListRequests
=
[...
data
[
idx
].
payParametersAddListRequests
]
}
else
{
if
(
type
===
2
)
{
data
[
idx
].
payParametersList
[
index
]
=
{
...
value
};
data
[
idx
].
payParametersList
=
[...
data
[
idx
].
payParametersList
]
}
else
{
data
[
idx
].
payParametersAddListRequests
[
index
]
=
{
...
value
};
data
[
idx
].
payParametersAddListRequests
=
[...
data
[
idx
].
payParametersAddListRequests
]
}
console
.
log
(
data
,
10086
)
setPayItem
(
data
);
...
...
src/pages/transaction/goodsOffer/addEnquiryOrder/addForm.tsx
View file @
09830307
...
...
@@ -28,14 +28,16 @@ const AddQuotes: React.FC<parmas> = (props) => {
const
[
enclosureUrls
,
setenclosureUrls
]
=
useState
<
any
>
([]);
const
[
loading
,
setloading
]
=
useState
<
boolean
>
(
false
);
const
handleGetDetails
=
async
()
=>
{
await
PublicApi
.
getOrderInquiryListDetails
({
id
}).
then
(
res
=>
{
await
PublicApi
.
getOrderInquiryListDetails
({
id
}).
then
(
(
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
setgoodsList
(
res
.
data
.
inquiryListProductRequests
);
setenclosureUrls
(
res
.
data
.
enclosureUrls
)
setEditData
(
res
.
data
)
setmember
({
name
:
res
.
data
.
memberName
,
memberId
:
res
.
data
.
memberId
memberId
:
res
.
data
.
memberId
,
memberRoleId
:
res
.
data
.
memberRoleId
,
memberRoleName
:
res
.
data
.
memberRoleName
})
}
})
...
...
@@ -62,7 +64,9 @@ const AddQuotes: React.FC<parmas> = (props) => {
setgoodsList
(
inquiryGoods
);
setmember
({
name
:
data
.
memberName
,
memberId
:
data
.
memberId
memberId
:
data
.
memberId
,
memberRoleId
:
data
.
memberRoleId
,
memberRoleName
:
data
.
memberRoleName
})
setEditData
({
inquiryListProductRequests
:
inquiryGoods
,
...
...
@@ -79,9 +83,9 @@ const AddQuotes: React.FC<parmas> = (props) => {
const
tradingConditions
=
await
tradingConditionsRef
.
current
.
validateFields
();
const
basicInfoData
=
basicInfo
.
data
;
const
tradingConditionsData
=
tradingConditions
.
data
;
console
.
log
(
basicInfo
,
tradingConditions
,
100086
)
console
.
log
(
basicInfo
,
tradingConditions
,
100086
)
if
(
basicInfo
.
state
&&
tradingConditions
.
state
)
{
if
(
goodsList
.
length
===
0
)
{
if
(
goodsList
.
length
===
0
)
{
message
.
error
(
'请添加一个询价商品!'
);
setloading
(
false
);
return
...
...
@@ -93,7 +97,9 @@ const AddQuotes: React.FC<parmas> = (props) => {
...
address
,
enclosureUrls
,
memberName
:
member
.
name
,
memberId
:
member
.
memberId
memberId
:
member
.
memberId
,
memberRoleId
:
member
.
memberRoleId
,
memberRoleName
:
member
.
memberRoleName
}
if
(
id
&&
type
===
2
)
{
parmas
.
id
=
editData
.
id
;
...
...
src/pages/transaction/goodsOffer/addEnquiryOrder/components/basicInfo.tsx
View file @
09830307
...
...
@@ -41,7 +41,8 @@ const BasicInfo: React.FC<queryProps> = (props) => {
const
memberInfo
=
{
name
:
memberRowCtl
.
selectRow
[
0
].
name
,
memberId
:
memberRowCtl
.
selectRow
[
0
].
memberId
,
memberRoleId
:
memberRowCtl
.
selectRow
[
0
].
roleId
memberRoleId
:
memberRowCtl
.
selectRow
[
0
].
roleId
,
memberRoleName
:
memberRowCtl
.
selectRow
[
0
].
roleName
}
setmemberId
(
memberRowCtl
.
selectRow
[
0
].
memberId
)
setroleId
(
memberRowCtl
.
selectRow
[
0
].
roleId
)
...
...
src/pages/transaction/goodsOffer/addEnquiryOrder/components/enquiryGoods.tsx
View file @
09830307
...
...
@@ -181,6 +181,23 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
// 编辑时回显的数据
useEffect
(()
=>
{
if
(
Object
.
keys
(
editData
).
length
>
0
)
{
const
arr
:
any
[]
=
[];
editData
.
inquiryListProductRequests
.
forEach
(
item
=>
{
arr
.
push
({
id
:
item
.
productId
,
name
:
item
.
productName
,
customerCategoryName
:
item
.
category
,
brandName
:
item
.
brand
,
unitName
:
item
.
unit
,
logistics
:
item
.
logistics
,
memberId
:
item
.
memberId
,
memberRoleId
:
item
.
memberRoleId
,
mainPic
:
item
.
imgUrl
,
purchaseCount
:
item
.
purchaseCount
})
})
memberRowCtl
.
setSelectRow
(
arr
);
memberRowCtl
.
setSelectedRowKeys
(
editData
.
inquiryListProductRequests
.
map
(
v
=>
v
.
productId
))
setgoodsList
(
editData
.
inquiryListProductRequests
);
}
},
[
editData
])
...
...
src/pages/transaction/goodsOffer/components/details.tsx
View file @
09830307
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
style
from
'./index.less'
;
import
{
history
}
from
'umi'
;
import
{
Button
,
Tabs
,
Steps
,
Table
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
CheckSquareOutlined
,
LinkOutlined
}
from
'@ant-design/icons'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
AuditModal
from
'../components/auditModel'
;
import
moment
from
'moment'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
const
{
TabPane
}
=
Tabs
;
const
{
Step
}
=
Steps
;
export
const
HEADER_WRAPPER_TEXTS
=
{
'details'
:
'询价摘要'
,
'voucherTime'
:
'单据时间'
,
'externalState'
:
'外部状态'
,
'interiorState'
:
'内部状态'
,
}
export
interface
parmas
{
page_type
?:
any
,
id
?:
any
,
view
?:
any
,
action
?:
boolean
}
const
Details
:
React
.
FC
<
parmas
>
=
(
props
)
=>
{
const
[
visible
,
setvisible
]
=
useState
(
false
)
//type: 1.待提交询价单,2.待审核询价单1级,3.待审核询价单2级,4.询价单查询,5.询价单查询,6.待新增报价单
//view: 1.询价单号,2.报价单号
//action: 审核按钮
const
{
id
,
page_type
,
view
,
action
}
=
props
;
const
{
pathname
}
=
history
.
location
;
const
last
=
pathname
.
split
(
'/'
)[
pathname
.
split
(
'/'
).
length
-
1
];
const
[
headerWrapperData
,
setheaderWrapperData
]
=
useState
<
Array
<
any
>>
([]);
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
// 模拟数据
const
[
data
,
setdata
]
=
useState
<
any
>
({});
// 询价商品
const
inquiryGoods
:
ColumnType
<
any
>
[]
=
[{
title
:
'ID'
,
key
:
'productId'
,
dataIndex
:
'productId'
,
},
{
title
:
'报价商品名称'
,
key
:
'productName'
,
dataIndex
:
'productName'
,
},
{
title
:
'品类'
,
key
:
'category'
,
dataIndex
:
'category'
,
},
{
title
:
'品牌'
,
key
:
'brand'
,
dataIndex
:
'brand'
,
},
{
title
:
'单位'
,
key
:
'unit'
,
dataIndex
:
'unit'
,
},
{
title
:
'采购数量'
,
key
:
'purchaseCount'
,
dataIndex
:
'purchaseCount'
,
}]
// 条件交易&其他报价说明
const
infoTem
=
{
base
:
{
title
:
'交易条件'
,
leftElem
:
[
{
title
:
'交付日期'
,
key
:
''
,
value
:
format
(
data
.
deliveryTime
)
},
{
title
:
'交付地址'
,
key
:
''
,
value
:
data
.
fullAddress
},
{
title
:
'物流要求'
,
key
:
''
,
value
:
data
.
logistics
}
],
centerElem
:
[
{
title
:
'报价截止日期'
,
key
:
''
,
value
:
format
(
data
.
quotationAsTime
)
},
{
title
:
'报价要求'
,
key
:
''
,
value
:
data
.
offer
},
{
title
:
'包装要求'
,
key
:
''
,
value
:
data
.
packRequire
},
],
rightElem
:
[
{
title
:
'付款方式'
,
key
:
''
,
value
:
data
.
paymentType
},
{
title
:
'税费要求'
,
key
:
''
,
value
:
data
.
taxes
},
{
title
:
'其他要求'
,
key
:
''
,
value
:
data
.
otherRequire
}
],
},
freight
:
{
title
:
'其他报价说明'
,
leftElem
:
[
// { title: '最小起订', key: '', value: data.minimumOrder },
{
title
:
'交付说明'
,
key
:
''
,
value
:
data
.
fullAddress
},
{
title
:
'付款说明'
,
key
:
''
,
value
:
data
.
paymentType
},
],
centerElem
:
[
{
title
:
'税费说明'
,
key
:
''
,
value
:
data
.
taxes
},
{
title
:
'物流说明'
,
key
:
''
,
value
:
data
.
logistics
},
// { title: '包装说明', key: '', value: data.packRequire },
],
rightElem
:
[
{
title
:
'包装说明'
,
key
:
''
,
value
:
data
.
packRequire
},
{
title
:
'其他说明'
,
key
:
''
,
value
:
data
.
otherRequire
}
],
},
}
// 详情请求
useEffect
(()
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderInquiryListDetails
({
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setdata
(
res
.
data
)
}
})
})
},
[])
// 外部流转记录&内部流转记录
const
flowRecord
=
{
external
:
[{
title
:
'序号'
,
key
:
'inquiryListId'
,
dataIndex
:
'inquiryListId'
,
},
{
title
:
'操作角色'
,
key
:
'roleName'
,
dataIndex
:
'roleName'
,
},
{
title
:
'状态'
,
key
:
'state'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/>
},
{
title
:
'操作'
,
key
:
'operation'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
key
:
'operationTime'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
key
:
'auditOpinion'
,
dataIndex
:
'auditOpinion'
,
}],
interior
:
[{
title
:
'流转记录'
,
key
:
'inquiryListId'
,
dataIndex
:
'inquiryListId'
,
},
{
title
:
'操作人'
,
key
:
'roleName'
,
dataIndex
:
'roleName'
,
},
{
title
:
'部门'
,
key
:
'department'
,
dataIndex
:
'department'
,
},
{
title
:
'职位'
,
key
:
'position'
,
dataIndex
:
'position'
,
},
{
title
:
'状态'
,
key
:
'state'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralInteriorState
colorType=
{
2
}
state=
{
text
}
data=
{
interiorState
}
/>
},
{
title
:
'操作'
,
key
:
'operation'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
key
:
'operationTime'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
key
:
'auditOpinion'
,
dataIndex
:
'auditOpinion'
,
}],
}
// 添加商品数据组合
useEffect
(()
=>
{
if
(
Object
.
keys
(
data
).
length
>
0
)
{
// 组合数据
const
arr
=
[];
Object
.
keys
(
data
).
forEach
((
key
)
=>
{
if
(
HEADER_WRAPPER_TEXTS
[
key
])
{
arr
.
push
({
label
:
HEADER_WRAPPER_TEXTS
[
key
],
value
:
data
[
key
],
name
:
key
,
})
}
})
setheaderWrapperData
(
arr
)
console
.
log
(
arr
,
'组合的数据'
)
}
},
[
data
])
// 提交后返回
const
handleModalOK
=
()
=>
{
setvisible
(
false
)
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
/**下载 */
const
onDownload
=
(
file
:
any
)
=>
{
window
.
location
.
href
=
`/api/order/contractTemplate/downloadContract?contractName=
${
file
.
name
}
&contractUrl=
${
file
.
url
}
`
}
const
[
externalState
,
setExternalState
]
=
useState
<
any
>
([]);
const
[
interiorState
,
setInteriorState
]
=
useState
<
any
>
([]);
useEffect
(()
=>
{
const
external
=
new
Promise
(
resolve
=>
{
// 询价查询, 询价报价, 确认询价报价单 通用外部状态
PublicApi
.
getOrderProductInquiryExternalStateEnum
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
const
interior
=
new
Promise
(
resolve
=>
{
// 询价查询, 询价报价, 确认询价报价单 通用内部状态
PublicApi
.
getOrderProductInquiryInteriorStateEnum
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
Promise
.
all
([
external
,
interior
]).
then
(
res
=>
{
setExternalState
(
res
[
0
])
setInteriorState
(
res
[
1
])
})
},
[])
return
(
<
PageHeaderWrapper
className=
{
style
.
header
}
onBack=
{
()
=>
history
.
goBack
()
}
title=
{
<>
<
div
className=
{
style
[
'headerTop'
]
}
>
<
div
className=
{
style
[
'headerTop-prefix'
]
}
>
单
</
div
>
<
div
className=
{
style
[
'headerTop-name'
]
}
>
{
Number
(
view
)
===
1
?
'询价单号'
:
'报价单号'
}
:
{
Number
(
view
)
===
1
?
data
.
inquiryListNo
:
data
.
quotationNo
}
</
div
>
<
div
className=
{
style
[
`levelIcon${'1'}`
]
}
></
div
>
</
div
>
</>
}
extra=
{
<>
{
(
last
===
'details'
&&
(
Number
(
page_type
)
===
2
||
Number
(
page_type
)
===
3
)
&&
(
data
.
interiorState
===
2
||
data
.
interiorState
===
3
))
&&
<>
<
Button
type=
'primary'
className=
{
style
[
'saveBtn'
]
}
onClick=
{
()
=>
{
setvisible
(
true
)
}
}
>
<
CheckSquareOutlined
/>
单据审核
</
Button
>
</>
}
{
(
last
===
'details'
&&
Number
(
page_type
)
===
6
&&
data
.
interiorState
===
1
)
&&
<
Button
className=
{
style
[
'saveBtn'
]
}
onClick=
{
()
=>
setvisible
(
true
)
}
>
<
CheckSquareOutlined
/>
提交
</
Button
>
}
</>
}
content=
{
<
div
className=
{
style
[
'headerMain'
]
}
>
<
div
className=
{
style
[
'headerMain-left'
]
}
>
<
div
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
询价会员:
</
div
>
<
div
><
a
>
{
data
.
memberName
}
</
a
>
</
div
>
</
div
>
{
headerWrapperData
&&
headerWrapperData
.
map
(
item
=>
(
<
div
key=
{
item
.
name
}
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
{
item
.
label
}
:
</
div
>
<
div
>
{
item
.
name
===
'externalState'
?
<
GeneralExternalState
colorType=
{
2
}
state=
{
item
.
value
}
data=
{
externalState
}
/>
:
item
.
name
===
'interiorState'
?
<
GeneralInteriorState
colorType=
{
2
}
state=
{
item
.
value
}
data=
{
interiorState
}
/>
:
item
.
name
===
'voucherTime'
?
format
(
item
.
value
)
:
item
.
value
}
</
div
>
</
div
>
))
}
</
div
>
</
div
>
}
>
<
div
className=
{
style
.
item_wrap
}
>
<
Tabs
>
<
TabPane
tab=
"外部流转"
key=
"1"
>
<
Steps
style=
{
{
padding
:
'20px 0'
}
}
progressDot
current=
{
Number
(
data
.
externalState
-
1
)
}
>
{
Object
.
keys
(
data
).
length
>
0
&&
data
.
externalInquiryListStateResponses
.
map
((
item
,
index
)
=>
{
return
(
<
Step
key=
{
index
}
title=
{
item
.
roleName
}
description=
{
item
.
operationalProcess
}
status=
{
item
.
isExecute
?
'finish'
:
'wait'
}
/>
);
})
}
</
Steps
>
</
TabPane
>
<
TabPane
tab=
"内部流转"
key=
"2"
>
<
Steps
style=
{
{
padding
:
'20px 0'
}
}
progressDot
current=
{
Number
(
data
.
interiorState
-
1
)
}
>
{
Object
.
keys
(
data
).
length
>
0
&&
data
.
interiorRequisitionFormStateResponses
.
map
((
item
,
index
)
=>
{
return
(
<
Step
key=
{
index
}
title=
{
item
.
roleName
}
description=
{
item
.
operationalProcess
}
status=
{
item
.
isExecute
?
'finish'
:
'wait'
}
/>
);
})
}
</
Steps
>
</
TabPane
>
</
Tabs
>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
div
className=
{
style
.
mainCol_title
}
>
询价商品
</
div
>
<
Table
columns=
{
inquiryGoods
}
pagination=
{
false
}
rowKey=
'id'
dataSource=
{
data
.
inquiryListProductRequests
}
/>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
div
className=
{
style
.
mainCol_title
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
title
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows'
]
}
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
leftElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
style=
{
{
flex
:
'1.5 1'
}
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
value
}
</
div
>
</
div
>
);
},
)
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
centerElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
value
}
</
div
>
</
div
>
);
},
)
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
rightElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
value
}
</
div
>
</
div
>
);
},
)
}
</
div
>
</
div
>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
div
className=
{
style
.
mainCol_title
}
>
附件
</
div
>
<
div
className=
{
style
.
upload_data
}
>
{
data
.
enclosureUrls
&&
data
.
enclosureUrls
.
map
((
v
,
i
)
=>
(
<
div
key=
{
i
}
className=
{
style
.
upload_item
}
onClick=
{
()
=>
onDownload
(
v
)
}
>
<
div
className=
{
style
.
upload_left
}
>
<
LinkOutlined
/>
<
span
>
{
v
.
name
}
</
span
>
</
div
>
</
div
>
))
}
</
div
>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
Tabs
>
<
TabPane
tab=
"外部流转记录"
key=
"1"
>
<
Table
columns=
{
flowRecord
.
external
}
rowKey=
'id'
pagination=
{
false
}
dataSource=
{
data
.
externalInquiryListLogResponses
}
/>
</
TabPane
>
<
TabPane
tab=
"内部流转记录"
key=
"2"
>
<
Table
columns=
{
flowRecord
.
interior
}
rowKey=
'id'
pagination=
{
false
}
dataSource=
{
data
.
interiorInquiryListLogResponses
}
/>
</
TabPane
>
</
Tabs
>
</
div
>
<
AuditModal
id=
{
id
}
type=
{
page_type
}
dialogVisible=
{
visible
}
onCancel=
{
()
=>
setvisible
(
false
)
}
onOK=
{
handleModalOK
}
/>
</
PageHeaderWrapper
>
)
}
export
default
Details
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
style
from
'./index.less'
;
import
{
history
}
from
'umi'
;
import
{
Button
,
Tabs
,
Steps
,
Table
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
CheckSquareOutlined
,
LinkOutlined
}
from
'@ant-design/icons'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
AuditModal
from
'../components/auditModel'
;
import
moment
from
'moment'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
const
{
TabPane
}
=
Tabs
;
const
{
Step
}
=
Steps
;
export
const
HEADER_WRAPPER_TEXTS
=
{
'details'
:
'询价摘要'
,
'voucherTime'
:
'单据时间'
,
'externalState'
:
'外部状态'
,
'interiorState'
:
'内部状态'
,
}
export
interface
parmas
{
page_type
?:
any
,
id
?:
any
,
view
?:
any
,
action
?:
boolean
}
const
Details
:
React
.
FC
<
parmas
>
=
(
props
)
=>
{
const
[
visible
,
setvisible
]
=
useState
(
false
)
//type: 1.待提交询价单,2.待审核询价单1级,3.待审核询价单2级,4.询价单查询,5.询价单查询,6.待新增报价单
//view: 1.询价单号,2.报价单号
//action: 审核按钮
const
{
id
,
page_type
,
view
,
action
}
=
props
;
const
{
pathname
}
=
history
.
location
;
const
last
=
pathname
.
split
(
'/'
)[
pathname
.
split
(
'/'
).
length
-
1
];
const
[
headerWrapperData
,
setheaderWrapperData
]
=
useState
<
Array
<
any
>>
([]);
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
// 模拟数据
const
[
data
,
setdata
]
=
useState
<
any
>
({});
// 询价商品
const
inquiryGoods
:
ColumnType
<
any
>
[]
=
[{
title
:
'ID'
,
key
:
'productId'
,
dataIndex
:
'productId'
,
},
{
title
:
'报价商品名称'
,
key
:
'productName'
,
dataIndex
:
'productName'
,
},
{
title
:
'品类'
,
key
:
'category'
,
dataIndex
:
'category'
,
},
{
title
:
'品牌'
,
key
:
'brand'
,
dataIndex
:
'brand'
,
},
{
title
:
'单位'
,
key
:
'unit'
,
dataIndex
:
'unit'
,
},
{
title
:
'采购数量'
,
key
:
'purchaseCount'
,
dataIndex
:
'purchaseCount'
,
}]
// 条件交易&其他报价说明
const
infoTem
=
{
base
:
{
title
:
'交易条件'
,
leftElem
:
[
{
title
:
'交付日期'
,
key
:
''
,
value
:
format
(
data
.
deliveryTime
)
},
{
title
:
'交付地址'
,
key
:
''
,
value
:
data
.
fullAddress
},
{
title
:
'物流要求'
,
key
:
''
,
value
:
data
.
logistics
}
],
centerElem
:
[
{
title
:
'报价截止日期'
,
key
:
''
,
value
:
format
(
data
.
quotationAsTime
)
},
{
title
:
'报价要求'
,
key
:
''
,
value
:
data
.
offer
},
{
title
:
'包装要求'
,
key
:
''
,
value
:
data
.
packRequire
},
],
rightElem
:
[
{
title
:
'付款方式'
,
key
:
''
,
value
:
data
.
paymentType
},
{
title
:
'税费要求'
,
key
:
''
,
value
:
data
.
taxes
},
{
title
:
'其他要求'
,
key
:
''
,
value
:
data
.
otherRequire
}
],
},
freight
:
{
title
:
'其他报价说明'
,
leftElem
:
[
// { title: '最小起订', key: '', value: data.minimumOrder },
{
title
:
'交付说明'
,
key
:
''
,
value
:
data
.
fullAddress
},
{
title
:
'付款说明'
,
key
:
''
,
value
:
data
.
paymentType
},
],
centerElem
:
[
{
title
:
'税费说明'
,
key
:
''
,
value
:
data
.
taxes
},
{
title
:
'物流说明'
,
key
:
''
,
value
:
data
.
logistics
},
// { title: '包装说明', key: '', value: data.packRequire },
],
rightElem
:
[
{
title
:
'包装说明'
,
key
:
''
,
value
:
data
.
packRequire
},
{
title
:
'其他说明'
,
key
:
''
,
value
:
data
.
otherRequire
}
],
},
}
// 详情请求
useEffect
(()
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderInquiryListDetails
({
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setdata
(
res
.
data
)
}
})
})
},
[])
// 外部流转记录&内部流转记录
const
flowRecord
=
{
external
:
[{
title
:
'序号'
,
key
:
'inquiryListId'
,
dataIndex
:
'inquiryListId'
,
},
{
title
:
'操作角色'
,
key
:
'roleName'
,
dataIndex
:
'roleName'
,
},
{
title
:
'状态'
,
key
:
'state'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/>
},
{
title
:
'操作'
,
key
:
'operation'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
key
:
'operationTime'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
key
:
'auditOpinion'
,
dataIndex
:
'auditOpinion'
,
}],
interior
:
[{
title
:
'流转记录'
,
key
:
'inquiryListId'
,
dataIndex
:
'inquiryListId'
,
},
{
title
:
'操作人'
,
key
:
'roleName'
,
dataIndex
:
'roleName'
,
},
{
title
:
'部门'
,
key
:
'department'
,
dataIndex
:
'department'
,
},
{
title
:
'职位'
,
key
:
'position'
,
dataIndex
:
'position'
,
},
{
title
:
'状态'
,
key
:
'state'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralInteriorState
colorType=
{
2
}
state=
{
text
}
data=
{
interiorState
}
/>
},
{
title
:
'操作'
,
key
:
'operation'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
key
:
'operationTime'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
key
:
'auditOpinion'
,
dataIndex
:
'auditOpinion'
,
}],
}
// 添加商品数据组合
useEffect
(()
=>
{
if
(
Object
.
keys
(
data
).
length
>
0
)
{
// 组合数据
const
arr
=
[];
Object
.
keys
(
data
).
forEach
((
key
)
=>
{
if
(
HEADER_WRAPPER_TEXTS
[
key
])
{
arr
.
push
({
label
:
HEADER_WRAPPER_TEXTS
[
key
],
value
:
data
[
key
],
name
:
key
,
})
}
})
setheaderWrapperData
(
arr
)
console
.
log
(
arr
,
'组合的数据'
)
}
},
[
data
])
// 提交后返回
const
handleModalOK
=
()
=>
{
setvisible
(
false
)
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
/**下载 */
const
onDownload
=
(
file
:
any
)
=>
{
window
.
location
.
href
=
`/api/order/contractTemplate/downloadContract?contractName=
${
file
.
name
}
&contractUrl=
${
file
.
url
}
`
}
const
[
externalState
,
setExternalState
]
=
useState
<
any
>
([]);
const
[
interiorState
,
setInteriorState
]
=
useState
<
any
>
([]);
useEffect
(()
=>
{
const
external
=
new
Promise
(
resolve
=>
{
// 询价查询, 询价报价, 确认询价报价单 通用外部状态
PublicApi
.
getOrderProductInquiryExternalStateEnum
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
const
interior
=
new
Promise
(
resolve
=>
{
// 询价查询, 询价报价, 确认询价报价单 通用内部状态
PublicApi
.
getOrderProductInquiryInteriorStateEnum
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
Promise
.
all
([
external
,
interior
]).
then
(
res
=>
{
setExternalState
(
res
[
0
])
setInteriorState
(
res
[
1
])
})
},
[])
return
(
<
PageHeaderWrapper
className=
{
style
.
header
}
onBack=
{
()
=>
history
.
goBack
()
}
title=
{
<>
<
div
className=
{
style
[
'headerTop'
]
}
>
<
div
className=
{
style
[
'headerTop-prefix'
]
}
>
单
</
div
>
<
div
className=
{
style
[
'headerTop-name'
]
}
>
{
Number
(
view
)
===
1
?
'询价单号'
:
'报价单号'
}
:
{
Number
(
view
)
===
1
?
data
.
inquiryListNo
:
data
.
quotationNo
}
</
div
>
<
div
className=
{
style
[
`levelIcon${'1'}`
]
}
></
div
>
</
div
>
</>
}
extra=
{
<>
{
(
last
===
'details'
&&
(
Number
(
page_type
)
===
2
||
Number
(
page_type
)
===
3
)
&&
(
data
.
interiorState
===
2
||
data
.
interiorState
===
3
))
&&
<>
<
Button
type=
'primary'
className=
{
style
[
'saveBtn'
]
}
onClick=
{
()
=>
{
setvisible
(
true
)
}
}
>
<
CheckSquareOutlined
/>
单据审核
</
Button
>
</>
}
{
(
last
===
'details'
&&
Number
(
page_type
)
===
6
&&
data
.
interiorState
===
1
)
&&
<
Button
className=
{
style
[
'saveBtn'
]
}
onClick=
{
()
=>
setvisible
(
true
)
}
>
<
CheckSquareOutlined
/>
提交
</
Button
>
}
</>
}
content=
{
<
div
className=
{
style
[
'headerMain'
]
}
>
<
div
className=
{
style
[
'headerMain-left'
]
}
>
<
div
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
询价会员:
</
div
>
<
div
><
a
>
{
data
.
memberName
}
</
a
>
</
div
>
</
div
>
{
headerWrapperData
&&
headerWrapperData
.
map
(
item
=>
(
<
div
key=
{
item
.
name
}
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
{
item
.
label
}
:
</
div
>
<
div
>
{
item
.
name
===
'externalState'
?
<
GeneralExternalState
colorType=
{
2
}
state=
{
item
.
value
}
data=
{
externalState
}
/>
:
item
.
name
===
'interiorState'
?
<
GeneralInteriorState
colorType=
{
2
}
state=
{
item
.
value
}
data=
{
interiorState
}
/>
:
item
.
name
===
'voucherTime'
?
format
(
item
.
value
)
:
item
.
value
}
</
div
>
</
div
>
))
}
</
div
>
</
div
>
}
>
<
div
className=
{
style
.
item_wrap
}
>
<
Tabs
>
<
TabPane
tab=
"外部流转"
key=
"1"
>
<
Steps
style=
{
{
padding
:
'20px 0'
}
}
progressDot
current=
{
Number
(
data
.
externalState
-
1
)
}
>
{
Object
.
keys
(
data
).
length
>
0
&&
data
.
externalInquiryListStateResponses
.
map
((
item
,
index
)
=>
{
return
(
<
Step
key=
{
index
}
title=
{
item
.
roleName
}
description=
{
item
.
operationalProcess
}
status=
{
item
.
isExecute
?
'finish'
:
'wait'
}
/>
);
})
}
</
Steps
>
</
TabPane
>
<
TabPane
tab=
"内部流转"
key=
"2"
>
<
Steps
style=
{
{
padding
:
'20px 0'
}
}
progressDot
current=
{
Number
(
data
.
interiorState
-
1
)
}
>
{
Object
.
keys
(
data
).
length
>
0
&&
data
.
interiorRequisitionFormStateResponses
.
map
((
item
,
index
)
=>
{
return
(
<
Step
key=
{
index
}
title=
{
item
.
roleName
}
description=
{
item
.
operationalProcess
}
status=
{
item
.
isExecute
?
'finish'
:
'wait'
}
/>
);
})
}
</
Steps
>
</
TabPane
>
</
Tabs
>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
div
className=
{
style
.
mainCol_title
}
>
询价商品
</
div
>
<
Table
columns=
{
inquiryGoods
}
pagination=
{
false
}
rowKey=
'id'
dataSource=
{
data
.
inquiryListProductRequests
}
/>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
div
className=
{
style
.
mainCol_title
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
title
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows'
]
}
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
leftElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
style=
{
{
flex
:
'1.5 1'
}
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
value
}
</
div
>
</
div
>
);
},
)
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
centerElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
value
}
</
div
>
</
div
>
);
},
)
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[(
Number
(
page_type
)
===
1
||
Number
(
page_type
)
===
5
)
?
'freight'
:
'base'
].
rightElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
value
}
</
div
>
</
div
>
);
},
)
}
</
div
>
</
div
>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
div
className=
{
style
.
mainCol_title
}
>
附件
</
div
>
<
div
className=
{
style
.
upload_data
}
>
{
data
.
enclosureUrls
&&
data
.
enclosureUrls
.
map
((
v
,
i
)
=>
(
<
div
key=
{
i
}
className=
{
style
.
upload_item
}
onClick=
{
()
=>
onDownload
(
v
)
}
>
<
div
className=
{
style
.
upload_left
}
>
<
LinkOutlined
/>
<
span
>
{
v
.
name
}
</
span
>
</
div
>
</
div
>
))
}
</
div
>
</
div
>
<
div
className=
{
style
.
item_wrap
}
>
<
Tabs
>
<
TabPane
tab=
"外部流转记录"
key=
"1"
>
<
Table
columns=
{
flowRecord
.
external
}
rowKey=
'id'
pagination=
{
false
}
dataSource=
{
data
.
externalInquiryListLogResponses
}
/>
</
TabPane
>
<
TabPane
tab=
"内部流转记录"
key=
"2"
>
<
Table
columns=
{
flowRecord
.
interior
}
rowKey=
'id'
pagination=
{
false
}
dataSource=
{
data
.
interiorInquiryListLogResponses
}
/>
</
TabPane
>
</
Tabs
>
</
div
>
<
AuditModal
id=
{
id
}
type=
{
page_type
}
dialogVisible=
{
visible
}
onCancel=
{
()
=>
setvisible
(
false
)
}
onOK=
{
handleModalOK
}
/>
</
PageHeaderWrapper
>
)
}
export
default
Details
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