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
3d478a44
Commit
3d478a44
authored
Jun 09, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: 修改商品询价 询价报价等状态
parent
28f5f6f4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
2000 additions
and
901 deletions
+2000
-901
index.tsx
src/pages/transaction/components/TableLayout/index.tsx
+130
-0
basicInfo.tsx
...ction/goodsOffer/addEnquiryOrder/components/basicInfo.tsx
+4
-5
flowRecord.tsx
...tion/goodsOffer/addEnquiryOrder/components/flowRecord.tsx
+97
-124
index.tsx
src/pages/transaction/goodsOffer/addEnquiryOrder/index.tsx
+0
-0
schema.ts
src/pages/transaction/goodsOffer/addEnquiryOrder/schema.ts
+106
-0
details.tsx
src/pages/transaction/goodsOffer/components/details.tsx
+7
-31
stateColor.ts
src/pages/transaction/goodsOffer/components/stateColor.ts
+19
-0
index.tsx
src/pages/transaction/goodsOffer/enquiryOrder/index.tsx
+69
-124
schema.ts
src/pages/transaction/goodsOffer/enquiryOrder/schema.ts
+112
-0
index.tsx
src/pages/transaction/goodsOffer/pendingReviewOne/index.tsx
+98
-52
schema.ts
src/pages/transaction/goodsOffer/pendingReviewOne/schema.ts
+108
-0
index.tsx
src/pages/transaction/goodsOffer/pendingReviewTwo/index.tsx
+93
-52
schema.ts
src/pages/transaction/goodsOffer/pendingReviewTwo/schema.ts
+108
-0
index.tsx
src/pages/transaction/goodsOffer/pendingSubmit/index.tsx
+50
-154
schema.ts
src/pages/transaction/goodsOffer/pendingSubmit/schema.ts
+108
-0
index.tsx
src/pages/transaction/inquiryQuote/addInquiryOrder/index.tsx
+0
-0
schema.ts
src/pages/transaction/inquiryQuote/addInquiryOrder/schema.ts
+114
-0
auditModel.tsx
src/pages/transaction/inquiryQuote/components/auditModel.tsx
+3
-3
stateColor.ts
src/pages/transaction/inquiryQuote/components/stateColor.ts
+19
-0
index.tsx
src/pages/transaction/inquiryQuote/enquiryOrder/index.tsx
+68
-122
schema.ts
src/pages/transaction/inquiryQuote/enquiryOrder/schema.ts
+90
-0
index.tsx
...pages/transaction/inquiryQuote/pendingReviewOne/index.tsx
+96
-55
schema.ts
...pages/transaction/inquiryQuote/pendingReviewOne/schema.ts
+114
-0
index.tsx
...pages/transaction/inquiryQuote/pendingReviewTwo/index.tsx
+97
-55
schema.ts
...pages/transaction/inquiryQuote/pendingReviewTwo/schema.ts
+114
-0
index.tsx
src/pages/transaction/inquiryQuote/quoteOrder/index.tsx
+70
-124
schema.ts
src/pages/transaction/inquiryQuote/quoteOrder/schema.ts
+106
-0
No files found.
src/pages/transaction/components/TableLayout/index.tsx
0 → 100644
View file @
3d478a44
import
React
,
{
useRef
,
useState
,
useImperativeHandle
}
from
'react'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
}
from
'antd'
;
import
{
StandardTable
}
from
'god'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
searchSelectGetSelectCategoryOptionEffect
}
from
'@/pages/transaction/effect/index'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
const
{
onFormMount$
}
=
FormEffectHooks
interface
Iprops
{
/** 列表接口 */
fetch
?:
()
=>
Promise
<
unknown
>
,
/** 多选返回 */
fetchRowkeys
?(
e
:
any
),
/** 操作按钮 */
controllerBtns
?:
React
.
ReactNode
,
/** 搜索的schema */
schema
?:
any
,
/** 列表表头 */
columns
:
ColumnType
<
any
>
[],
/** schema搜索第一个的name */
effects
?:
string
,
/** 是否多选 */
selectedRow
?:
boolean
,
/** 刷新 */
reload
?:
any
,
/** 外部状态接口 */
externalStatusFetch
?:
Promise
<
unknown
>
,
/** 内部状态接口 */
interiorStatusFetch
?:
Promise
<
unknown
>
,
}
const
formActions
=
createFormActions
();
const
Table
:
React
.
FC
<
Iprops
>
=
(
props
:
any
)
=>
{
const
{
schema
,
columns
,
effects
,
fetch
,
controllerBtns
,
selectedRow
,
reload
,
fetchRowkeys
,
externalStatusFetch
,
interiorStatusFetch
}
=
props
;
const
tableRef
=
useRef
<
any
>
({});
/** 列表数据 */
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
fetch
({
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
/**多选 */
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
number
>>
([]);
const
rowSelection
=
{
selectedRowKeys
:
selectedRowKeys
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
fetchRowkeys
(
selectedRowKeys
)
setSelectedRowKeys
(
selectedRowKeys
);
},
}
useImperativeHandle
(
reload
,
()
=>
({
reload
:
()
=>
{
tableRef
.
current
.
reload
();
}
}));
// 搜索
const
search
=
(
values
:
any
)
=>
{
tableRef
.
current
.
reload
(
values
)
}
const
useBusinessEffects
=
()
=>
{
const
linkage
=
useLinkageUtils
();
onFormMount$
().
subscribe
(()
=>
{
externalStatusFetch
&&
externalStatusFetch
.
then
(
res
=>
{
const
_enum
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
state
}})
linkage
.
enum
(
'externalState'
,
_enum
)
linkage
.
enum
(
'externalStatusList'
,
_enum
)
})
interiorStatusFetch
&&
interiorStatusFetch
.
then
(
res
=>
{
const
_enum
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
state
}})
linkage
.
enum
(
'interiorState'
,
_enum
)
linkage
.
enum
(
'innerStatusList'
,
_enum
)
})
})
}
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
currentRef=
{
tableRef
}
columns=
{
columns
}
tableProps=
{
{
rowKew
:
'id'
}
}
rowSelection=
{
selectedRow
&&
rowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
expressionScope=
{
{
controllerBtns
}
}
onSubmit=
{
values
=>
search
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
effects
,
FORM_FILTER_PATH
)
FormEffectHooks
.
onFieldChange$
(
'category'
).
subscribe
(
state
=>
{
searchSelectGetSelectCategoryOptionEffect
(
actions
,
'category'
)
})
useBusinessEffects
();
}
}
schema=
{
schema
}
>
</
NiceForm
>
}
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
Table
;
src/pages/transaction/goodsOffer/addEnquiryOrder/components/basicInfo.tsx
View file @
3d478a44
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
Button
}
from
'antd'
;
import
{
Form
,
Input
,
Button
,
Tag
,
Badge
}
from
'antd'
;
import
styles
from
'./index.less'
;
import
{
LinkOutlined
}
from
'@ant-design/icons'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
ModalTable
from
'@/components/ModalTable'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
import
{
quoteOrderInternalState
,
inquiryQuoteOuterState
}
from
'../../../common/tableStatusList'
;
import
moment
from
'moment'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../../components/stateColor'
;
const
layout
:
any
=
{
colon
:
false
,
...
...
@@ -178,10 +177,10 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<
span
>
{
(
Object
.
keys
(
editData
).
length
>
0
&&
editData
.
voucherTime
)
?
format
(
editData
.
voucherTime
)
:
'-'
}
</
span
>
</
Form
.
Item
>
<
Form
.
Item
label=
'外部状态'
name=
'external'
>
<
span
>
{
(
Object
.
keys
(
editData
).
length
>
0
&&
editData
.
externalState
)
?
inquiryQuoteOuterState
(
editData
.
externalState
)
:
'-'
}
</
span
>
<
span
>
{
(
Object
.
keys
(
editData
).
length
>
0
&&
editData
.
externalState
)
?
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
editData
.
externalState
]
}
>
{
editData
.
externalStateName
}
</
Tag
>
:
'-'
}
</
span
>
</
Form
.
Item
>
<
Form
.
Item
label=
'内部状态'
name=
'internal'
>
<
span
>
{
(
Object
.
keys
(
editData
).
length
>
0
&&
editData
.
interiorState
)
?
quoteOrderInternalState
(
editData
.
interiorState
)
:
'-'
}
</
span
>
<
span
>
{
(
Object
.
keys
(
editData
).
length
>
0
&&
editData
.
interiorState
)
?
<
Badge
status=
{
INTERNALSTATE_COLOR
[
editData
.
interiorState
]
}
text=
{
editData
.
interiorStateName
}
/>
:
'-'
}
</
span
>
</
Form
.
Item
>
</
Form
>
{
/* 选择会员弹框 */
}
...
...
src/pages/transaction/goodsOffer/addEnquiryOrder/components/flowRecord.tsx
View file @
3d478a44
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
Radio
}
from
'antd'
;
import
PolymericTable
from
'@/components/PolymericTable'
;
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
moment
from
'moment'
;
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
import
{
PublicApi
}
from
'@/services/api'
;
export
interface
parmas
{
editData
?:
any
}
const
FlowRecord
:
React
.
FC
<
parmas
>
=
(
props
)
=>
{
const
{
editData
}
=
props
;
const
[
radio
,
setRadio
]
=
useState
<
string
>
(
'outer'
);
//切换单据
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
const
outerColumns
:
EditableColumns
[]
=
[{
title
:
'序号'
,
dataIndex
:
'id'
,
},
{
title
:
'操作角色'
,
dataIndex
:
'roleName'
,
},
{
title
:
'状态'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/>
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
dataIndex
:
'auditOpinion'
,
}]
const
insideColumns
:
EditableColumns
[]
=
[{
title
:
'序号'
,
dataIndex
:
'id'
,
},
{
title
:
'操作人'
,
dataIndex
:
'roleName'
,
},
{
title
:
'部门'
,
dataIndex
:
'department'
,
},
{
title
:
'职位'
,
dataIndex
:
'position'
,
},
{
title
:
'状态'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralInteriorState
colorType=
{
2
}
state=
{
text
}
data=
{
interiorState
}
/>
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
dataIndex
:
'auditOpinion'
,
}]
const
onChange
=
(
e
:
any
)
=>
{
setRadio
(
e
.
target
.
value
)
}
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
(
<
div
className=
{
styles
.
revise_style
}
>
<
Radio
.
Group
defaultValue=
"outer"
buttonStyle=
"solid"
onChange=
{
onChange
}
>
<
Radio
.
Button
value=
"outer"
>
外部单据
</
Radio
.
Button
>
<
Radio
.
Button
value=
"inside"
>
内部单据
</
Radio
.
Button
>
</
Radio
.
Group
>
{
radio
===
'outer'
?
<
PolymericTable
dataSource=
{
editData
.
externalInquiryListLogResponses
}
columns=
{
outerColumns
}
loading=
{
false
}
pagination=
{
null
}
/>
:
<
PolymericTable
dataSource=
{
editData
.
interiorInquiryListLogResponses
}
columns=
{
insideColumns
}
loading=
{
false
}
pagination=
{
null
}
/>
}
</
div
>
)
}
export
default
FlowRecord
import
React
,
{
useState
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
Radio
,
Tag
}
from
'antd'
;
import
PolymericTable
from
'@/components/PolymericTable'
;
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
moment
from
'moment'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../../components/stateColor'
;
export
interface
parmas
{
editData
?:
any
}
const
FlowRecord
:
React
.
FC
<
parmas
>
=
(
props
)
=>
{
const
{
editData
}
=
props
;
const
[
radio
,
setRadio
]
=
useState
<
string
>
(
'outer'
);
//切换单据
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
const
outerColumns
:
EditableColumns
[]
=
[{
title
:
'序号'
,
dataIndex
:
'id'
,
},
{
title
:
'操作角色'
,
dataIndex
:
'roleName'
,
},
{
title
:
'状态'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
stateName
}
</
Tag
>
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
dataIndex
:
'auditOpinion'
,
}]
const
insideColumns
:
EditableColumns
[]
=
[{
title
:
'序号'
,
dataIndex
:
'id'
,
},
{
title
:
'操作人'
,
dataIndex
:
'roleName'
,
},
{
title
:
'部门'
,
dataIndex
:
'department'
,
},
{
title
:
'职位'
,
dataIndex
:
'position'
,
},
{
title
:
'状态'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
INTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
stateName
}
</
Tag
>
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'审核意见'
,
dataIndex
:
'auditOpinion'
,
}]
const
onChange
=
(
e
:
any
)
=>
{
setRadio
(
e
.
target
.
value
)
}
return
(
<
div
className=
{
styles
.
revise_style
}
>
<
Radio
.
Group
defaultValue=
"outer"
buttonStyle=
"solid"
onChange=
{
onChange
}
>
<
Radio
.
Button
value=
"outer"
>
外部单据
</
Radio
.
Button
>
<
Radio
.
Button
value=
"inside"
>
内部单据
</
Radio
.
Button
>
</
Radio
.
Group
>
{
radio
===
'outer'
?
<
PolymericTable
dataSource=
{
editData
.
externalInquiryListLogResponses
}
columns=
{
outerColumns
}
loading=
{
false
}
pagination=
{
null
}
/>
:
<
PolymericTable
dataSource=
{
editData
.
interiorInquiryListLogResponses
}
columns=
{
insideColumns
}
loading=
{
false
}
pagination=
{
null
}
/>
}
</
div
>
)
}
export
default
FlowRecord
src/pages/transaction/goodsOffer/addEnquiryOrder/index.tsx
View file @
3d478a44
This diff is collapsed.
Click to expand it.
src/pages/transaction/goodsOffer/addEnquiryOrder/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
ADDINQUIRYORDERSCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
"object"
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
inquiryListNo
:
{
//报价单号
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{},
"x-component-props"
:
{
placeholder
:
"询价单号"
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单摘要"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"被询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
/** 内部状态颜色 */
export
const
EXTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"success"
,
5
:
"error"
,
}
/** 外部状态颜色 */
export
const
INTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"default"
,
5
:
"success"
,
6
:
"error"
,
7
:
"error"
,
}
src/pages/transaction/goodsOffer/components/details.tsx
View file @
3d478a44
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
style
from
'./index.less'
;
import
{
history
}
from
'umi'
;
import
{
Button
,
Tabs
,
Steps
,
Table
,
Popconfirm
}
from
'antd'
;
import
{
Button
,
Tabs
,
Steps
,
Table
,
Popconfirm
,
Tag
,
Badge
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
CheckSquareOutlined
,
LinkOutlined
}
from
'@ant-design/icons'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
...
...
@@ -11,6 +11,7 @@ import { PublicApi } from '@/services/api';
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'./stateColor'
;
const
{
TabPane
}
=
Tabs
;
const
{
Step
}
=
Steps
;
...
...
@@ -140,7 +141,7 @@ const Details: React.FC<parmas> = (props) => {
title
:
'状态'
,
key
:
'state'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
stateName
}
</
Tag
>
},
{
title
:
'操作'
,
key
:
'operation'
,
...
...
@@ -176,7 +177,7 @@ const Details: React.FC<parmas> = (props) => {
title
:
'状态'
,
key
:
'state'
,
dataIndex
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
GeneralInteriorState
colorType=
{
2
}
state=
{
text
}
data=
{
interiorState
}
/
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
INTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
stateName
}
</
Tag
>
},
{
title
:
'操作'
,
key
:
'operation'
,
...
...
@@ -224,31 +225,6 @@ const Details: React.FC<parmas> = (props) => {
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
])
})
},
[])
const
handleSubmit
=
()
=>
{
const
value
=
{
id
,
...
...
@@ -307,16 +283,16 @@ const Details: React.FC<parmas> = (props) => {
<
div
className=
{
style
[
'headerMain-left'
]
}
>
<
div
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
询价会员:
</
div
>
<
div
><
a
>
{
data
.
m
emberName
}
</
a
>
</
div
>
<
div
><
a
>
{
data
.
inquiryListM
emberName
}
</
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
}
/
>
:
<
Tag
color=
{
INTERNALSTATE_COLOR
[
item
.
value
]
}
>
{
data
.
externalStateName
}
</
Tag
>
:
item
.
name
===
'interiorState'
?
<
GeneralInteriorState
colorType=
{
2
}
state=
{
item
.
value
}
data=
{
interiorStat
e
}
/>
:
<
Badge
status=
{
INTERNALSTATE_COLOR
[
item
.
value
]
}
text=
{
data
.
interiorStateNam
e
}
/>
:
item
.
name
===
'voucherTime'
?
format
(
item
.
value
)
:
item
.
value
}
</
div
>
</
div
>
...
...
src/pages/transaction/goodsOffer/components/stateColor.ts
0 → 100644
View file @
3d478a44
/** 内部状态颜色 */
export
const
EXTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"success"
,
5
:
"error"
,
}
/** 外部状态颜色 */
export
const
INTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"default"
,
5
:
"success"
,
6
:
"error"
,
7
:
"error"
,
}
src/pages/transaction/goodsOffer/enquiryOrder/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useEffect
,
useState
}
from
'react'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
}
from
'antd'
;
import
{
StandardTable
}
from
'god'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
enquieryOfferSearchSchema
}
from
'../schema'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
searchSelectGetSelectCategoryOptionEffect
}
from
'../../effect/index'
import
React
,
{
useRef
}
from
'react'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
Tag
,
Badge
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
moment
from
'moment'
import
moment
from
'moment'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
import
{
INQUIRYSEARCHSCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
EnquiryOrder
=
()
=>
{
const
reload
=
useRef
<
any
>
({});
const
formActions
=
createFormActions
();
const
EnquiryOrder
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({});
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
const
columns
:
ColumnType
<
any
>
[]
=
[{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/goodsOffer/enquiryOrder/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'被询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'交付日期'
,
key
:
'deliveryTime'
,
dataIndex
:
'deliveryTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
text
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
)
=>
<
GeneralInteriorState
colorType=
{
2
}
state=
{
text
}
data=
{
interiorState
}
/>
}];
//交易能力 询价报价 询价单查询
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getTransactionInquiryAddList
({...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
// 搜索
const
search
=
(
values
:
any
)
=>
{
if
(
values
.
voucherTime
)
{
values
.
startDocumentsTime
=
timeRange
(
values
.
voucherTime
).
st
values
.
endDocumentsTime
=
timeRange
(
values
.
voucherTime
).
et
delete
values
.
voucherTime
}
ref
.
current
.
reload
(
values
)
}
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
])
})
},[])
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/goodsOffer/enquiryOrder/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'被询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'交付日期'
,
key
:
'deliveryTime'
,
dataIndex
:
'deliveryTime'
,
render
:
(
text
:
any
)
=>
format
(
text
)
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Badge
status=
{
INTERNALSTATE_COLOR
[
text
]
}
text=
{
record
.
interiorStateName
}
/>
},
];
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
currentRef=
{
ref
}
columns=
{
columns
}
tableProps=
{
{
rowKew
:
'id'
}
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
search
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'inquiryListNo'
,
FORM_FILTER_PATH
)
FormEffectHooks
.
onFieldChange$
(
'category'
).
subscribe
(
state
=>
{
searchSelectGetSelectCategoryOptionEffect
(
actions
,
'category'
)
})
}
}
schema=
{
enquieryOfferSearchSchema
}
>
</
NiceForm
>
}
/>
</
Card
>
</
PageHeaderWrapper
>
<
Table
schema=
{
INQUIRYSEARCHSCHEMA
}
columns=
{
columns
}
effects=
"inquiryListNo"
fetch=
{
PublicApi
.
getTransactionInquiryAddList
}
reload=
{
reload
}
externalStatusFetch=
{
PublicApi
.
getTransactionProductInquiryExternalStateEnum
({
type
:
'1'
})
}
interiorStatusFetch=
{
PublicApi
.
getTransactionProductInquiryInteriorStateEnum
({
type
:
'1'
})
}
/>
)
}
export
default
EnquiryOrder
;
export
default
EnquiryOrder
src/pages/transaction/goodsOffer/enquiryOrder/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
INQUIRYSEARCHSCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
properties
:
{
inquiryListNo
:
{
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{},
"x-component-props"
:
{
placeholder
:
"询价单号"
,
align
:
"flex-left"
,
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
justifyContent
:
"flex-start"
,
flexWrap
:
"nowrap"
},
colStyle
:
{
//改变间隔
marginRight
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"被询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
externalState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"外部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
interiorState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"内部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
/** 内部状态颜色 */
export
const
EXTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"success"
,
5
:
"error"
,
}
/** 外部状态颜色 */
export
const
INTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"default"
,
5
:
"success"
,
6
:
"error"
,
7
:
"error"
,
}
src/pages/transaction/goodsOffer/pendingReviewOne/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
{
message
}
from
'antd'
;
import
ReviewList
from
'../components/reviewList'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
history
}
from
'umi'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
moment
from
'moment'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Row
,
Col
,
Button
,
Tag
,
Badge
}
from
'antd'
;
import
{
PENDINGREVIEWONESCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
PendingReviewOne
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
selectRow
,
setSelectRow
]
=
useState
<
Array
<
number
>>
([]);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
PendingReviewOne
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
// 多选
const
selectAll
=
(
values
:
any
)
=>
{
setSelectRow
(
values
);
console
.
log
(
values
,
'我是多选的id'
)
}
// 列表数据
const
fetchData
=
(
params
?:
any
)
=>
{
console
.
log
(
params
)
//可以直接打印参数
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getTransactionInquiryToAuditList
({
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
// 批量操作
const
batchAction
=
()
=>
{
if
(
selectRow
.
length
>
0
)
{
setLoading
(
true
)
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
postTransactionInquiryDocumentsReviewAll
({
ids
:
selectRow
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
setLoading
(
false
)
setSelectRow
([])
ref
.
current
.
reload
();
}
})
})
}
else
{
message
.
error
(
'请选择要操作的询价单!'
)
const
[
rowkeys
,
setRowKeys
]
=
useState
<
Array
<
number
>>
([]);
/** 批量审核 */
const
fetchSubmitBatch
=
async
()
=>
{
const
res
=
await
PublicApi
.
postTransactionInquiryDocumentsReviewAll
({
ids
:
rowkeys
});
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
setRowKeys
([])
}
}
const
column
=
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'被询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'交付日期'
,
key
:
'deliveryTime'
,
dataIndex
:
'deliveryTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'createTime'
,
dataIndex
:
'createTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Badge
status=
{
INTERNALSTATE_COLOR
[
text
]
}
text=
{
record
.
interiorStateName
}
/>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/details?id=${record.id}`
)
}
>
审核
</
Button
>
},
];
return
(
<
ReviewList
reloadRef=
{
ref
}
fetchData=
{
fetchData
}
selectAll=
{
selectAll
}
batchAction=
{
batchAction
}
loading=
{
loading
}
type=
{
2
}
column=
{
column
}
<
Table
selectedRow
reload=
{
ref
}
schema=
{
PENDINGREVIEWONESCHEMA
}
columns=
{
columns
}
effects=
"inquiryListNo"
fetch=
{
PublicApi
.
getTransactionInquiryToAuditList
}
fetchRowkeys=
{
(
e
)
=>
setRowKeys
(
e
)
}
controllerBtns=
{
<
Row
>
<
Col
span=
{
6
}
>
<
Button
disabled=
{
rowkeys
.
length
===
0
}
onClick=
{
fetchSubmitBatch
}
>
批量提交审核
</
Button
>
</
Col
>
</
Row
>
}
/>
)
}
export
default
PendingReviewOne
src/pages/transaction/goodsOffer/pendingReviewOne/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
PENDINGREVIEWONESCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
"object"
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
inquiryListNo
:
{
//报价单号
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
"询价单号搜索"
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单摘要"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"被询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
/** 内部状态颜色 */
export
const
EXTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"success"
,
5
:
"error"
,
}
/** 外部状态颜色 */
export
const
INTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"default"
,
5
:
"success"
,
6
:
"error"
,
7
:
"error"
,
}
src/pages/transaction/goodsOffer/pendingReviewTwo/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
{
message
}
from
'antd'
;
import
ReviewList
from
'../components/reviewList'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
history
}
from
'umi'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
moment
from
'moment'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Row
,
Col
,
Button
,
Tag
,
Badge
}
from
'antd'
;
import
{
PENDINGREVIEWTWOSCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
PendingReviewTwo
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
selectRow
,
setSelectRow
]
=
useState
<
Array
<
number
>>
([]);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
PendingReviewTwo
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
// 多选
const
selectAll
=
(
values
:
any
)
=>
{
setSelectRow
(
values
);
console
.
log
(
values
,
'我是多选的id'
)
}
//列表数据
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getTransactionInquiryToAuditListTwo
({...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
// 批量操作
const
batchAction
=
()
=>
{
if
(
selectRow
.
length
>
0
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setLoading
(
true
)
PublicApi
.
postTransactionInquiryDocumentsReviewAllTwo
({
ids
:
selectRow
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
setLoading
(
false
)
setSelectRow
([])
ref
.
current
.
reload
();
}
})
})
}
else
{
message
.
error
(
'请选择要操作的询价单!'
)
const
[
rowkeys
,
setRowKeys
]
=
useState
<
Array
<
number
>>
([]);
/** 批量审核 */
const
fetchSubmitBatch
=
async
()
=>
{
const
res
=
await
PublicApi
.
postTransactionInquiryDocumentsReviewAllTwo
({
ids
:
rowkeys
});
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
setRowKeys
([])
}
}
const
column
=
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'被询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'交付日期'
,
key
:
'deliveryTime'
,
dataIndex
:
'deliveryTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'createTime'
,
dataIndex
:
'createTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Badge
status=
{
INTERNALSTATE_COLOR
[
text
]
}
text=
{
record
.
interiorStateName
}
/>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/details?id=${record.id}`
)
}
>
审核
</
Button
>
},
];
return
(
<
ReviewList
reloadRef=
{
ref
}
fetchData=
{
fetchData
}
selectAll=
{
selectAll
}
batchAction=
{
batchAction
}
type=
{
3
}
loading=
{
loading
}
column=
{
column
}
<
Table
selectedRow
reload=
{
ref
}
schema=
{
PENDINGREVIEWTWOSCHEMA
}
columns=
{
columns
}
effects=
"inquiryListNo"
fetch=
{
PublicApi
.
getTransactionInquiryToAuditListTwo
}
fetchRowkeys=
{
(
e
)
=>
setRowKeys
(
e
)
}
controllerBtns=
{
<
Row
>
<
Col
span=
{
6
}
>
<
Button
disabled=
{
rowkeys
.
length
===
0
}
onClick=
{
fetchSubmitBatch
}
>
批量提交审核
</
Button
>
</
Col
>
</
Row
>
}
/>
)
}
export
default
PendingReviewTwo
src/pages/transaction/goodsOffer/pendingReviewTwo/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
PENDINGREVIEWTWOSCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
"object"
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
inquiryListNo
:
{
//报价单号
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
"询价单号搜索"
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单摘要"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"被询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
/** 内部状态颜色 */
export
const
EXTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"success"
,
5
:
"error"
,
}
/** 外部状态颜色 */
export
const
INTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"default"
,
5
:
"success"
,
6
:
"error"
,
7
:
"error"
,
}
src/pages/transaction/goodsOffer/pendingSubmit/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useState
,
useEffect
}
from
'react'
;
import
{
Card
,
Button
,
Row
,
Col
,
Popconfirm
,
message
}
from
'antd'
;
import
{
history
}
from
'umi'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
StandardTable
}
from
'god'
;
import
moment
from
'moment'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
{
pendingReviewSchema
}
from
'../schema/pendingReview'
;
import
moment
from
'moment'
import
{
PublicApi
}
from
'@/services/api'
;
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
import
{
Row
,
Col
,
Button
,
Popconfirm
,
Tag
,
Badge
}
from
'antd'
;
import
{
PENDINGSUBMITSCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
formActions
=
createFormActions
();
const
PendingSubmit
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
[
id
,
setId
]
=
useState
<
any
>
(
0
);
const
[
visible
,
setvisible
]
=
useState
<
boolean
>
(
false
);
const
[
selectRow
,
setSelectRow
]
=
useState
([])
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
number
>>
([]);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
)
const
PendingSubmit
=
()
=>
{
const
reload
=
useRef
<
any
>
({});
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
const
[
rowkeys
,
setRowKeys
]
=
useState
<
Array
<
number
>>
([]);
/** 批量审核 */
const
fetchSubmitBatch
=
async
(
id
?:
number
)
=>
{
let
res
=
null
;
if
(
id
)
{
res
=
await
PublicApi
.
postTransactionInquirySubmit
({
id
:
Number
(
id
)
})
}
else
{
res
=
await
PublicApi
.
postTransactionInquirySubmitAll
({
ids
:
rowkeys
});
}
if
(
res
.
code
===
1000
)
{
reload
.
current
.
reload
();
setRowKeys
([])
}
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'询价单号'
,
...
...
@@ -64,154 +67,47 @@ const PendingSubmit: React.FC<{}> = () => {
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
text
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
)
=>
<
GeneralInteriorState
colorType=
{
2
}
state=
{
text
}
data=
{
interiorStat
e
}
/>
render
:
(
text
:
any
,
record
:
any
)
=>
<
Badge
status=
{
INTERNALSTATE_COLOR
[
text
]
}
text=
{
record
.
interiorStateNam
e
}
/>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Popconfirm
title=
"确定要提交吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleSubmit
(
record
.
id
)
}
>
<
Popconfirm
title=
"确定要提交吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
fetchSubmitBatch
(
record
.
id
)
}
>
<
Button
type=
'link'
>
提交询价单
</
Button
>
</
Popconfirm
>
},
]
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
/**多选 */
const
rowSelection
=
{
selectedRowKeys
:
selectedRowKeys
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectRow
(
selectedRows
);
setSelectedRowKeys
(
selectedRowKeys
);
console
.
log
(
`selectedRowKeys:
${
selectedRowKeys
}
`
,
'selectedRows: '
,
selectedRows
)
},
}
/**批量审核通过按钮 */
const
controllerBtns
=
<
Row
>
<
Col
span=
{
6
}
>
<
Button
onClick=
{
()
=>
handleSubmitAll
(
selectedRowKeys
)
}
disabled=
{
selectedRowKeys
.
length
<
1
}
loading=
{
loading
}
>
批量提交审核
</
Button
>
</
Col
>
</
Row
>
// 单个提交
const
handleSubmit
=
(
id
:
any
)
=>
{
const
value
=
{
id
,
state
:
1
}
PublicApi
.
postTransactionInquirySubmit
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
()
}
})
}
/**列表数据 */
const
fetchData
=
(
params
?:
any
)
=>
{
console
.
log
(
params
)
//可以直接打印参数
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getTransactionSubmitInquirySheetList
({
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
/**搜索 */
const
handleSumbit
=
(
values
:
any
)
=>
{
if
(
values
.
voucherTime
)
{
values
.
startDocumentsTime
=
timeRange
(
values
.
voucherTime
).
st
values
.
endDocumentsTime
=
timeRange
(
values
.
voucherTime
).
et
delete
values
.
voucherTime
}
console
.
log
(
'values'
,
values
)
ref
.
current
.
reload
(
values
)
}
/**批量审核 */
const
handleSubmitAll
=
(
ids
:
number
[])
=>
{
if
(
ids
.
length
>
0
)
{
setLoading
(
true
)
PublicApi
.
postTransactionInquirySubmitAll
({
ids
:
ids
}).
then
(
res
=>
{
setLoading
(
false
)
setSelectedRowKeys
([]);
ref
.
current
.
reload
()
})
}
else
{
message
.
error
(
'请选择要操作的询价单!'
)
}
}
const
handleModalOK
=
()
=>
{
setvisible
(
false
)
setTimeout
(()
=>
{
ref
.
current
.
reload
();
},
500
)
}
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
>
<
Card
>
<
StandardTable
currentRef=
{
ref
}
columns=
{
columns
}
tableProps=
{
{
rowKew
:
'id'
}
}
rowSelection=
{
rowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
handleSumbit
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'inquiryListNo'
,
FORM_FILTER_PATH
)
}
}
expressionScope=
{
{
controllerBtns
}
}
schema=
{
pendingReviewSchema
}
<
Table
selectedRow
reload=
{
reload
}
schema=
{
PENDINGSUBMITSCHEMA
}
columns=
{
columns
}
effects=
"inquiryListNo"
fetch=
{
PublicApi
.
getTransactionSubmitInquirySheetList
}
fetchRowkeys=
{
(
e
)
=>
setRowKeys
(
e
)
}
controllerBtns=
{
<
Row
>
<
Col
span=
{
6
}
>
<
Button
disabled=
{
rowkeys
.
length
===
0
}
onClick=
{
()
=>
fetchSubmitBatch
()
}
>
</
NiceForm
>
}
>
</
StandardTable
>
</
Card
>
{
/* <AuditModal
id={id}
type={1}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={handleModalOK}
/> */
}
</
PageHeaderWrapper
>
批量提交审核
</
Button
>
</
Col
>
</
Row
>
}
/>
)
}
export
default
PendingSubmit
src/pages/transaction/goodsOffer/pendingSubmit/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
PENDINGSUBMITSCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
"object"
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
inquiryListNo
:
{
//报价单号
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
"询价单号搜索"
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单摘要"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"被询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
/** 内部状态颜色 */
export
const
EXTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"success"
,
5
:
"error"
,
}
/** 外部状态颜色 */
export
const
INTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"default"
,
5
:
"success"
,
6
:
"error"
,
7
:
"error"
,
}
src/pages/transaction/inquiryQuote/addInquiryOrder/index.tsx
View file @
3d478a44
This diff is collapsed.
Click to expand it.
src/pages/transaction/inquiryQuote/addInquiryOrder/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
ADDINQUIRYORDERSHCEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
"object"
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
quotationNo
:
{
//报价单号
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
"报价单号"
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
inquiryListNo
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单号"
}
},
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"报价单摘要"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
externalState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"外部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
interiorState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"内部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
src/pages/transaction/inquiryQuote/components/auditModel.tsx
View file @
3d478a44
...
...
@@ -36,21 +36,21 @@ const AuditModal: React.FC<Params> = (props) => {
value
.
id
=
Number
(
props
.
id
)
switch
(
props
.
type
)
{
case
1
:
PublicApi
.
post
Order
ProductQuotationtToSubmit
(
value
).
then
(
res
=>
{
PublicApi
.
post
Transaction
ProductQuotationtToSubmit
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
case
2
:
PublicApi
.
post
Order
ProductQuotationtAuditSubmit
(
value
).
then
(
res
=>
{
PublicApi
.
post
Transaction
ProductQuotationtAuditSubmit
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
case
3
:
PublicApi
.
post
Order
ProductQuotationtAuditSubmitTwo
(
value
).
then
(
res
=>
{
PublicApi
.
post
Transaction
ProductQuotationtAuditSubmitTwo
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
...
...
src/pages/transaction/inquiryQuote/components/stateColor.ts
0 → 100644
View file @
3d478a44
/** 内部状态颜色 */
export
const
EXTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"success"
,
5
:
"error"
,
}
/** 外部状态颜色 */
export
const
INTERNALSTATE_COLOR
=
{
1
:
"default"
,
2
:
"default"
,
3
:
"default"
,
4
:
"default"
,
5
:
"success"
,
6
:
"error"
,
7
:
"error"
,
}
src/pages/transaction/inquiryQuote/enquiryOrder/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useEffect
,
useState
}
from
'react'
;
import
{
Link
}
from
'umi'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
,
Button
}
from
'antd'
;
import
{
StandardTable
}
from
'god'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
enquieryOfferSearchSchema
}
from
'../schema'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
searchSelectGetSelectCategoryOptionEffect
}
from
'../../effect/index'
import
React
,
{
useRef
}
from
'react'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
history
}
from
'umi'
;
import
{
Tag
,
Button
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
moment
from
'moment'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
import
{
ENQURIRYORDERSCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
EnquiryOrder
=
()
=>
{
const
reload
=
useRef
<
any
>
({});
const
formActions
=
createFormActions
();
const
EnquiryOrder
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({});
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
const
columns
:
ColumnType
<
any
>
[]
=
[{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/enquiryOrder/rfq/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'被询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'交付日期'
,
key
:
'deliveryTime'
,
dataIndex
:
'deliveryTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
text
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Button
disabled=
{
record
.
isQuoted
===
1
}
type=
'link'
><
Link
to=
{
`/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/quote?id=${record.id}`
}
>
报价
</
Link
></
Button
>
}];
//交易能力 询价报价 询价单查询
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getTransactionProductInquiryList
({...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
// 搜索
const
search
=
(
values
:
any
)
=>
{
if
(
values
.
voucherTime
)
{
values
.
startDocumentsTime
=
timeRange
(
values
.
voucherTime
).
st
values
.
endDocumentsTime
=
timeRange
(
values
.
voucherTime
).
et
delete
values
.
voucherTime
},
{
title
:
'询价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'被询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'交付日期'
,
key
:
'deliveryTime'
,
dataIndex
:
'deliveryTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Button
disabled=
{
record
.
isQuoted
===
1
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/quote?id=${record.id}`
)
}
type=
'link'
>
报价
</
Button
>
}
ref
.
current
.
reload
(
values
)
}
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
>
<
Card
>
<
StandardTable
currentRef=
{
ref
}
columns=
{
columns
}
tableProps=
{
{
rowKew
:
'id'
}
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
search
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'inquiryListNo'
,
FORM_FILTER_PATH
)
FormEffectHooks
.
onFieldChange$
(
'category'
).
subscribe
(
state
=>
{
searchSelectGetSelectCategoryOptionEffect
(
actions
,
'category'
)
})
}
}
schema=
{
enquieryOfferSearchSchema
}
>
</
NiceForm
>
}
/>
</
Card
>
</
PageHeaderWrapper
>
<
Table
schema=
{
ENQURIRYORDERSCHEMA
}
columns=
{
columns
}
effects=
"inquiryListNo"
fetch=
{
PublicApi
.
getTransactionProductInquiryList
}
reload=
{
reload
}
externalStatusFetch=
{
PublicApi
.
getTransactionProductInquiryExternalStateEnum
({
type
:
'1'
})
}
/>
)
}
export
default
EnquiryOrder
;
export
default
EnquiryOrder
src/pages/transaction/inquiryQuote/enquiryOrder/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
ENQURIRYORDERSCHEMA
:
ISchema
=
{
type
:
'object'
,
properties
:
{
megalayout
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
properties
:
{
inquiryListNo
:
{
type
:
'string'
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
'询价单号搜索'
,
align
:
'flex-left'
,
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
justifyContent
:
'flex-start'
,
flexWrap
:
'nowrap'
},
colStyle
:
{
//改变间隔
marginRight
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
memberName
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'被询价会员'
},
},
details
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'询价单摘要'
},
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
externalState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"外部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
}
},
sumbit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
}
src/pages/transaction/inquiryQuote/pendingReviewOne/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
{
message
}
from
'antd'
;
import
ReviewList
from
'../components/reviewList'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
history
}
from
'umi'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
moment
from
'moment'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Row
,
Col
,
Button
,
Tag
,
Badge
}
from
'antd'
;
import
{
PENDINGREVIEWONESCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
PendingReviewOne
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
selectRow
,
setSelectRow
]
=
useState
<
Array
<
number
>>
([]);
const
PendingReviewOne
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
// 多选
const
selectAll
=
(
values
:
any
)
=>
{
setSelectRow
(
values
);
console
.
log
(
values
,
'我是多选的id'
)
}
// 列表数据
const
fetchData
=
(
params
?:
any
)
=>
{
console
.
log
(
params
)
//可以直接打印参数
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderAuditProductQuotationList
({...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
// 批量操作
const
batchAction
=
()
=>
{
if
(
selectRow
.
length
>
0
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
postTransactionProductQuotationtAuditAll
({
ids
:
selectRow
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
ref
.
current
.
reload
();
setSelectRow
([])
}
})
})
}
else
{
message
.
error
(
'请选择要操作的报价单!'
)
const
[
rowkeys
,
setRowKeys
]
=
useState
<
Array
<
number
>>
([]);
/** 批量审核 */
const
fetchSubmitBatch
=
async
()
=>
{
const
res
=
await
PublicApi
.
postTransactionProductQuotationtAuditAll
({
ids
:
rowkeys
});
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
setRowKeys
([])
}
}
const
column
:
ColumnType
<
any
>
[]
=
[{
title
:
'报价单号'
,
key
:
'quotationNo'
,
dataIndex
:
'quotationNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/quote/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/rfq/preview?id=${record.inquiryListId}`
}
>
{
text
}
</
EyePreview
>
}]
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'报价单号'
,
key
:
'quotationNo'
,
dataIndex
:
'quotationNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/quote/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/rfq/preview?id=${record.inquiryListId}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'报价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Badge
status=
{
INTERNALSTATE_COLOR
[
text
]
}
text=
{
record
.
interiorStateName
}
/>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Button
type=
'link'
disabled=
{
record
.
interiorState
===
1
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/quote/detail?id=${record.id}&page_type=2`
)
}
>
审核
</
Button
>
},
]
return
(
<
ReviewList
reloadRef=
{
ref
}
fetchData=
{
fetchData
}
selectAll=
{
selectAll
}
batchAction=
{
batchAction
}
type=
{
2
}
column=
{
column
}
<
Table
selectedRow
reload=
{
ref
}
schema=
{
PENDINGREVIEWONESCHEMA
}
columns=
{
columns
}
effects=
"quotationNo"
fetch=
{
PublicApi
.
getTransactionAuditProductQuotationList
}
externalStatusFetch=
{
PublicApi
.
getTransactionProductInquiryExternalStateEnum
({
type
:
'2'
})
}
interiorStatusFetch=
{
PublicApi
.
getTransactionProductInquiryInteriorStateEnum
({
type
:
'2'
})
}
fetchRowkeys=
{
(
e
)
=>
setRowKeys
(
e
)
}
controllerBtns=
{
<
Row
>
<
Col
span=
{
6
}
>
<
Button
disabled=
{
rowkeys
.
length
===
0
}
onClick=
{
fetchSubmitBatch
}
>
批量提交审核
</
Button
>
</
Col
>
</
Row
>
}
/>
)
}
export
default
PendingReviewOne
src/pages/transaction/inquiryQuote/pendingReviewOne/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
PENDINGREVIEWONESCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
"object"
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
quotationNo
:
{
//报价单号
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
"报价单号"
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
inquiryListNo
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单号"
}
},
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"报价单摘要"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
externalState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"外部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
interiorState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"内部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
src/pages/transaction/inquiryQuote/pendingReviewTwo/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
{
message
}
from
'antd'
;
import
ReviewList
from
'../components/reviewList'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
history
}
from
'umi'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
moment
from
'moment'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Row
,
Col
,
Button
,
Tag
,
Badge
}
from
'antd'
;
import
{
PENDINGREVIEWTWOSCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
PendingReviewTwo
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
selectRow
,
setSelectRow
]
=
useState
<
Array
<
number
>>
([]);
const
PendingReviewOne
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
// 多选
const
selectAll
=
(
values
:
any
)
=>
{
setSelectRow
(
values
);
console
.
log
(
values
,
'我是多选的id'
)
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
// 列表数据
const
fetchData
=
(
params
?:
any
)
=>
{
console
.
log
(
params
)
//可以直接打印参数
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderAuditProductQuotationListTwo
({...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
// 批量操作
const
batchAction
=
()
=>
{
if
(
selectRow
.
length
>
0
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
postTransactionProductQuotationtAuditAllTwo
({
ids
:
selectRow
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
ref
.
current
.
reload
();
setSelectRow
([])
}
})
})
}
else
{
message
.
error
(
'请选择要操作的报价单!'
)
const
[
rowkeys
,
setRowKeys
]
=
useState
<
Array
<
number
>>
([]);
/** 批量审核 */
const
fetchSubmitBatch
=
async
()
=>
{
const
res
=
await
PublicApi
.
postTransactionProductQuotationtAuditAllTwo
({
ids
:
rowkeys
});
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
setRowKeys
([])
}
}
const
column
:
ColumnType
<
any
>
[]
=
[{
title
:
'报价单号'
,
key
:
'quotationNo'
,
dataIndex
:
'quotationNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/quote/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/rfq/preview?id=${record.inquiryListId}`
}
>
{
text
}
</
EyePreview
>
}]
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'报价单号'
,
key
:
'quotationNo'
,
dataIndex
:
'quotationNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/quote/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/rfq/preview?id=${record.inquiryListId}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'报价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Badge
status=
{
INTERNALSTATE_COLOR
[
text
]
}
text=
{
record
.
interiorStateName
}
/>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Button
type=
'link'
disabled=
{
record
.
interiorState
===
1
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/quote/detail?id=${record.id}&page_type=3`
)
}
>
审核
</
Button
>
},
]
return
(
<
ReviewList
reloadRef=
{
ref
}
fetchData=
{
fetchData
}
selectAll=
{
selectAll
}
batchAction=
{
batchAction
}
type=
{
3
}
column=
{
column
}
<
Table
selectedRow
reload=
{
ref
}
schema=
{
PENDINGREVIEWTWOSCHEMA
}
columns=
{
columns
}
effects=
"quotationNo"
fetch=
{
PublicApi
.
getTransactionAuditProductQuotationListTwo
}
externalStatusFetch=
{
PublicApi
.
getTransactionProductInquiryExternalStateEnum
({
type
:
'2'
})
}
interiorStatusFetch=
{
PublicApi
.
getTransactionProductInquiryInteriorStateEnum
({
type
:
'2'
})
}
fetchRowkeys=
{
(
e
)
=>
setRowKeys
(
e
)
}
controllerBtns=
{
<
Row
>
<
Col
span=
{
6
}
>
<
Button
disabled=
{
rowkeys
.
length
===
0
}
onClick=
{
fetchSubmitBatch
}
>
批量提交审核
</
Button
>
</
Col
>
</
Row
>
}
/>
)
}
export
default
PendingReviewOne
export
default
PendingReviewTwo
src/pages/transaction/inquiryQuote/pendingReviewTwo/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
PENDINGREVIEWTWOSCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
"object"
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
quotationNo
:
{
//报价单号
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
"报价单号"
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
inquiryListNo
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单号"
}
},
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"报价单摘要"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价会员"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
externalState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"外部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
interiorState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"内部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
src/pages/transaction/inquiryQuote/quoteOrder/index.tsx
View file @
3d478a44
import
React
,
{
useRef
,
useEffect
,
useState
}
from
'react'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
}
from
'antd'
;
import
{
StandardTable
}
from
'god'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
quoteFormSearch
}
from
'../schema'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
searchSelectGetSelectCategoryOptionEffect
}
from
'../../effect/index'
import
React
,
{
useRef
}
from
'react'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
history
}
from
'umi'
;
import
{
Tag
,
Badge
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
moment
from
'moment'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
GeneralExternalState
from
'@/pages/transaction/common/externalState'
;
import
GeneralInteriorState
from
'@/pages/transaction/common/interiorState'
;
import
{
QUOTEORDERSCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
,
INTERNALSTATE_COLOR
}
from
'../components/stateColor'
;
const
EnquiryOrder
=
()
=>
{
const
reload
=
useRef
<
any
>
({});
const
formActions
=
createFormActions
();
const
EnquiryOrder
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({});
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
const
columns
:
ColumnType
<
any
>
[]
=
[{
title
:
'报价单号'
,
key
:
'quotationNo'
,
dataIndex
:
'quotationNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/quoteOrder/quote/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/quoteOrder/rfq/preview?id=${record.inquiryListId}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'报价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
text
=>
<
GeneralExternalState
colorType=
{
2
}
state=
{
text
}
data=
{
externalState
}
/>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
)
=>
<
GeneralInteriorState
colorType=
{
2
}
state=
{
text
}
data=
{
interiorState
}
/>
}];
//交易能力 询价报价 询价单查询
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getTransactionProductQuotationList
({...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
// 搜索
const
search
=
(
values
:
any
)
=>
{
if
(
values
.
voucherTime
)
{
values
.
startDocumentsTime
=
timeRange
(
values
.
voucherTime
).
st
values
.
endDocumentsTime
=
timeRange
(
values
.
voucherTime
).
et
delete
values
.
voucherTime
}
ref
.
current
.
reload
(
values
)
}
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
])
})
},[])
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'报价单号'
,
key
:
'quotationNo'
,
dataIndex
:
'quotationNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/quoteOrder/quote/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'询价单号'
,
key
:
'inquiryListNo'
,
dataIndex
:
'inquiryListNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/inquiryQuote/quoteOrder/rfq/preview?id=${record.inquiryListId}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'报价单摘要'
,
key
:
'details'
,
dataIndex
:
'details'
,
},
{
title
:
'询价会员'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
,
},
{
title
:
'报价截止时间'
,
key
:
'quotationAsTime'
,
dataIndex
:
'quotationAsTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'单据时间'
,
key
:
'voucherTime'
,
dataIndex
:
'voucherTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
format
(
text
)
},
{
title
:
'外部状态'
,
key
:
'externalState'
,
dataIndex
:
'externalState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Tag
color=
{
EXTERNALSTATE_COLOR
[
text
]
}
>
{
record
.
externalStateName
}
</
Tag
>
},
{
title
:
'内部状态'
,
key
:
'interiorState'
,
dataIndex
:
'interiorState'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Badge
status=
{
INTERNALSTATE_COLOR
[
text
]
}
text=
{
record
.
interiorStateName
}
/>
},
];
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
currentRef=
{
ref
}
columns=
{
columns
}
tableProps=
{
{
rowKew
:
'id'
}
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
search
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'quotationNo'
,
FORM_FILTER_PATH
)
FormEffectHooks
.
onFieldChange$
(
'category'
).
subscribe
(
state
=>
{
searchSelectGetSelectCategoryOptionEffect
(
actions
,
'category'
)
})
}
}
schema=
{
quoteFormSearch
}
>
</
NiceForm
>
}
/>
</
Card
>
</
PageHeaderWrapper
>
<
Table
schema=
{
QUOTEORDERSCHEMA
}
columns=
{
columns
}
effects=
"quotationNo"
fetch=
{
PublicApi
.
getTransactionProductQuotationList
}
reload=
{
reload
}
externalStatusFetch=
{
PublicApi
.
getTransactionProductInquiryExternalStateEnum
({
type
:
'2'
})
}
interiorStatusFetch=
{
PublicApi
.
getTransactionProductInquiryInteriorStateEnum
({
type
:
'2'
})
}
/>
)
}
export
default
EnquiryOrder
;
export
default
EnquiryOrder
src/pages/transaction/inquiryQuote/quoteOrder/schema.ts
0 → 100644
View file @
3d478a44
import
{
ISchema
}
from
"@formily/antd"
;
import
{
FORM_FILTER_PATH
}
from
"@/formSchema/const"
;
export
const
QUOTEORDERSCHEMA
:
ISchema
=
{
type
:
"object"
,
properties
:
{
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
properties
:
{
quotationNo
:
{
type
:
"string"
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
"报价单号"
,
align
:
"flex-left"
,
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
justifyContent
:
"flex-start"
,
flexWrap
:
"nowrap"
},
colStyle
:
{
//改变间隔
marginRight
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
inquiryListNo
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价单号"
}
},
memberName
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"询价会员"
}
},
details
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"报价单摘要"
}
},
"[startDocumentsTime,endDocumentsTime]"
:
{
type
:
"string"
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
"单据时间(全部)"
,
}
},
externalState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"外部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
interiorState
:
{
type
:
"string"
,
"x-component-props"
:
{
placeholder
:
"内部状态"
,
style
:
{
width
:
160
}
},
enum
:
[]
},
}
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
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