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
5bca989b
Commit
5bca989b
authored
Aug 27, 2020
by
LeeJiancong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'修改支付'
parent
bbc8a35c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
563 additions
and
32 deletions
+563
-32
index.js
scripts/services/index.js
+1
-8
detail.tsx
src/pages/transaction/enquirySubmit/toSubmit/detail.tsx
+414
-24
detailFormColumnType.ts
...ransaction/enquirySubmit/toSubmit/detailFormColumnType.ts
+148
-0
No files found.
scripts/services/index.js
View file @
5bca989b
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-07-17 18:01:43
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-
19 17:24:16
* @LastEditTime: 2020-08-
27 17:56:48
*/
/**
* 用于在项目开始前获取所有的配置
...
...
@@ -50,13 +50,6 @@ const serviceConfig = {
// // }
// // }
// }
},
//初始化会员支付策略配置
payConfig
:{
paymemberConfig
:{
url
:
'/pay/member/pay/config'
,
method
:
'get'
}
}
...
...
src/pages/transaction/enquirySubmit/toSubmit/detail.tsx
View file @
5bca989b
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
import
ReactDOM
from
'react-dom'
import
{
FormSpy
,
...
...
@@ -16,26 +16,159 @@ import {
useFormEffects
}
from
'@formily/antd'
import
{
history
}
from
'umi'
import
{
Row
,
Col
,
Card
,
Button
,
Popconfirm
,
Select
as
ISelect
}
from
'antd'
;
import
{
LinkOutlined
,
PlusOutlined
,
QuestionCircleOutlined
,
MinusOutlined
,
MinusCircleOutlined
}
from
'@ant-design/icons'
import
{
Row
,
Col
,
Card
,
Button
,
Table
,
Popconfirm
,
Radio
,
Form
,
Spin
,
Select
,
Cascader
,
Tabs
,
Input
,
Tooltip
,
Space
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
MegaLayout
,
Input
,
Switch
,
Select
,
FormMegaLayout
,
FormTab
,
Radio
,
ArrayTable
,
ArrayCards
,
Transfer
}
from
'@formily/antd-components'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
equiryColumns
,
dockingList
}
from
'./detailFormColumnType'
// import {
// MegaLayout, Input, Switch, Select, FormMegaLayout, FormTab,
// Radio, ArrayTable, ArrayCards, Transfer
// } from '@formily/antd-components'
import
{
PublicApi
}
from
'@/services/api'
import
styles
from
'./templateForm.less'
;
import
ReutrnEle
from
'@/components/ReturnEle'
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
import
{
Effects
}
from
'bizcharts'
import
{
GetProductCustomerGetCustomerCategoryTreeResponse
,
GetManageAreaAllResponse
}
from
'@/services'
;
import
{
store
}
from
'@/store'
const
{
TabPane
}
=
Tabs
const
{
Option
}
=
Select
const
actions
=
createFormActions
()
const
layout
=
{
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
20
}
}
const
layoutFormList
=
{
labelCol
:
{
span
:
4
,
},
wrapperCol
:
{
span
:
18
,
push
:
4
},
}
interface
AreaParams
{
provinceCode
:
any
;
provinceName
:
any
;
cityCode
:
any
;
cityName
:
any
;
}
const
Detail
:
React
.
FC
<
{}
>
=
()
=>
{
const
headerTitle
=
'需求单'
const
[
CategoryTreeOne
,
setCategoryTreeOne
]
=
useState
([])
const
[
provinceList
,
setProvinceList
]
=
useState
([])
const
[
showCategory
,
setShowCategory
]
=
useState
(
null
)
const
[
customerCategoryTree
,
setCustomerCategoryTree
]
=
useState
<
GetProductCustomerGetCustomerCategoryTreeResponse
>
()
const
[
proviceOptions
,
setProviceOptions
]
=
useState
<
GetManageAreaAllResponse
>
()
const
[
areaParams
,
setAreaParams
]
=
useState
<
AreaParams
>
()
const
[
platType
,
setplatType
]
=
useState
(
1
)
//需求对接类型
const
{
ProductStore
}
=
store
const
{
setAreaOption
,
productInfoByEdit
,
getBasicFormParamsByEdit
,
setAttributeLists
,
setProductName
}
=
ProductStore
const
FormSumbit
=
(
values
:
any
)
=>
{
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
const
handleLink
=
()
=>
{
}
const
onCustomerCategoryChange
=
(
value
:
any
)
=>
{
let
seletCategoryId
=
value
[
1
]
||
value
[
0
]
console
.
log
(
seletCategoryId
,
'seleellele'
)
if
(
seletCategoryId
)
{
PublicApi
.
getProductCustomerGetCustomerCategoryById
({
id
:
seletCategoryId
}).
then
(
res
=>
{
const
{
data
}
=
res
})
}
else
setShowCategory
(
null
)
}
const
[
pagination
,
setPagination
]
=
useState
({
current
:
1
,
pageSize
:
10
})
const
selectBtn
=
(
<
Button
style=
{
{
backgroundColor
:
'#6B778C'
,
borderColor
:
'#6B778C'
,
color
:
'white'
}
}
onClick=
{
handleLink
}
>
<
LinkOutlined
/>
选择
</
Button
>
)
const
handleOptionBtn
=
(
type
:
any
)
=>
{
}
useEffect
(()
=>
{
PublicApi
.
getProductCustomerGetCustomerCategoryTree
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
{
data
}
=
res
setCategoryTreeOne
(
data
)
}
})
/**
* @description: 省市区
* @param {type}
* @return {type}
*/
PublicApi
.
getManageAreaAll
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
arr
=
[...
res
.
data
]
//裁去最后一级别
for
(
let
index
in
arr
)
{
for
(
let
_index
in
arr
[
index
].
areaResponses
)
{
let
o
=
arr
[
index
].
areaResponses
//@ts-ignore
o
[
_index
].
areaResponses
=
null
}
}
setProviceOptions
(
arr
)
setAreaOption
(
arr
)
}
})
},
[])
/**
* @description: 交易类型
* @param {type}
* @return {type}
*/
const
handlePlatTypeChange
=
(
e
:
any
)
=>
{
setplatType
(
e
.
target
.
value
)
}
/**
* @description: 选择地区
* @param {type}
* @return {type}
*/
const
onCommodityAreaChange
=
(
value
:
any
,
selected
:
any
)
=>
{
let
areaParams
:
AreaParams
=
{
provinceCode
:
null
,
provinceName
:
null
,
cityCode
:
null
,
cityName
:
null
,
}
if
(
selected
.
length
===
2
)
{
areaParams
.
provinceName
=
selected
[
0
].
name
areaParams
.
provinceCode
=
selected
[
0
].
code
areaParams
.
cityName
=
selected
[
1
].
name
areaParams
.
cityCode
=
selected
[
1
].
code
}
setAreaParams
(
areaParams
)
console
.
log
(
value
,
selected
,
areaParams
,
'area'
)
}
const
changePlatform
=
(
e
:
any
)
=>
{
setplatType
(
e
.
target
.
value
)
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
...
...
@@ -48,24 +181,281 @@ const Detail: React.FC<{}> = () => {
<
Card
>
<
Row
>
<
Col
span=
{
24
}
>
<
SchemaForm
actions=
{
actions
}
//要传递
// initialValues={{
// pricingMode: '1',
// transportMode: '1',
// designateList: [{}]
// }}
onSubmit=
{
(
values
)
=>
FormSumbit
(
values
)
}
components=
{
{
Input
,
Select
,
TextArea
:
Input
.
TextArea
,
Switch
,
Radio
,
RadioGroup
:
Radio
.
Group
,
ArrayTable
,
ArrayCards
,
Transfer
}
}
>
<
FormTab
name=
"tabs"
defaultActiveKey=
{
'tab-1'
}
>
<
FormTab
.
TabPane
name=
"tab-1"
tab=
"基本信息"
>
</
FormTab
.
TabPane
>
</
FormTab
>
</
SchemaForm
>
<
Tabs
defaultActiveKey=
'1'
>
<
TabPane
tab=
"基本信息"
key=
'1'
>
<
Row
>
<
Col
span=
{
12
}
>
<
Form
name=
"base-form"
{
...
layout
}
colon=
{
false
}
labelAlign=
"left"
autoComplete=
"off"
>
<
Form
.
Item
label=
"报价单摘要"
required
name=
"details"
>
<
Input
placeholder=
"请输入报价单摘要"
maxLength=
{
30
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"customerCategoryId"
label=
"商品品类"
rules=
{
[
{
required
:
true
,
message
:
'请选择商品品类'
},
]
}
>
<
Cascader
options=
{
CategoryTreeOne
}
fieldNames=
{
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
}
}
onChange=
{
onCustomerCategoryChange
}
placeholder=
"请选择品类"
notFoundContent=
{
<
Spin
size=
"small"
/>
}
/>
</
Form
.
Item
>
{
/* <Form.Item
name=''
required
label={
<span>
商品品类
<Tooltip title="如果您需要的商品不在上述所列商品品类之内,请您联系客服!">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
>
<Row gutter={[16,16]}>
<Col span={8}>
<Form.Item style={{ display: 'inline-block', width: '100%' }}>
<Select placeholder="">
{
CategoryTreeOne.map((v,index) => {
return <Option key={index} value={v.value}>{v.label}</Option>
})
}
</Select>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item style={{ display: 'inline-block', width: '100%' }}>
<Select placeholder="">
<Option value='0'>123</Option>
</Select>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item style={{ display: 'inline-block', width: '100%' }}>
<Select placeholder="">
<Option value='0'>123</Option>
</Select>
</Form.Item>
</Col>
</Row>
</Form.Item> */
}
{
/* <Form.List name="areaList">
{(fields, { add, remove }) => {
return (
<div>
{fields.map((field,index) => (
<Form.Item key={field.key}
{...(index === 0 ? layout :layoutFormList)}
label={
index === 0 && <span>
适用地市
<Tooltip title="设置了归属地市后,此商品可根据地市进行筛选,未设置时默认为所有地市!">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
>
<Space style={{ display: 'flex', marginBottom: 8 }} align="start">
<Form.Item
{...field}
style={{width:300}}
name={[field.name, 'first']}
fieldKey={[field.fieldKey, 'first']}
rules={[{ required: true }]}
>
<Select placeholder="">
{
provinceList.map((v,index) => {
return <Option key={index} value={v.value}>{v.label}</Option>
})
}
</Select>
</Form.Item>
<Form.Item
{...field}
style={{width:300}}
name={[field.name, 'last']}
fieldKey={[field.fieldKey, 'last']}
rules={[{ required: true }]}
>
<Select placeholder="">
<Option value='0'>123</Option>
</Select>
</Form.Item>
<Button size='small' type="primary" onClick={() => add()} icon={<PlusOutlined />} style={{ margin: '0 12px' }} />
{field.key > 0 && (<Button size='small' onClick={() => remove(field.name)} icon={<MinusOutlined />} />)}
</Space>
</Form.Item>
))}
<Form.Item>
<Button
type="dashed"
onClick={() => {
add();
}}
block
>
<PlusOutlined /> Add field
</Button>
</Form.Item>
</div>
);
}}
</Form.List> */
}
<
Form
.
List
name=
"commodityAreaList"
>
{
(
fields
:
any
[],
{
add
,
remove
}:
any
)
=>
{
if
(
!
fields
.
length
)
{
add
()
}
return
(
<
div
>
{
fields
.
map
((
field
,
index
)
=>
(
<
Form
.
Item
{
...
(
index
===
0
?
layout
:
layoutFormList
)}
label=
{
field
.
key
===
0
&&
<
span
>
归属地市
<
Tooltip
title=
"设置了归属地市后,此商品可根据地市进行筛选,未设置时默认为所有地市"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
span
>
}
key=
{
field
.
key
}
>
<
Form
.
Item
{
...
field
}
noStyle
>
<
Cascader
options=
{
proviceOptions
}
changeOnSelect
onChange=
{
onCommodityAreaChange
}
placeholder=
"请选择地区"
fieldNames=
{
{
label
:
'name'
,
value
:
'code'
,
children
:
'areaResponses'
}
}
style=
{
index
===
0
?
{
width
:
'90%'
}
:
{
width
:
'80%'
}
}
notFoundContent=
{
<
Spin
size=
"small"
/>
}
/>
</
Form
.
Item
>
<
Button
size=
'small'
type=
"primary"
onClick=
{
()
=>
add
()
}
icon=
{
<
PlusOutlined
/>
}
style=
{
{
margin
:
'0 12px'
}
}
/>
{
field
.
key
>
0
&&
(<
Button
size=
'small'
onClick=
{
()
=>
remove
(
field
.
name
)
}
icon=
{
<
MinusOutlined
/>
}
/>)
}
</
Form
.
Item
>
))
}
</
div
>
)
}
}
</
Form
.
List
>
<
Form
.
Item
name=
''
label=
'需求单号'
>
</
Form
.
Item
>
<
Form
.
Item
name=
'name'
label=
'会员名称'
>
</
Form
.
Item
>
<
Form
.
Item
name=
'voucherTime'
label=
'单据时间'
>
</
Form
.
Item
>
<
Form
.
Item
name=
''
label=
'外部状态'
>
</
Form
.
Item
>
<
Form
.
Item
name=
''
label=
'内部状态'
>
</
Form
.
Item
>
</
Form
>
</
Col
>
</
Row
>
</
TabPane
>
<
TabPane
tab=
"添加商品"
key=
'2'
>
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleOptionBtn
(
1
)
}
type=
'dashed'
>
添加商品
</
Button
>
<
Table
dataSource=
{
[]
}
columns=
{
equiryColumns
}
pagination=
{
pagination
}
/>
</
TabPane
>
<
TabPane
tab=
"交易条件"
key=
'3'
>
</
TabPane
>
<
TabPane
tab=
"需求对接"
key=
'4'
>
<
Space
size=
{
16
}
>
<
Radio
.
Group
value=
{
platType
}
onChange=
{
(
e
)
=>
changePlatform
(
e
)
}
>
<
Radio
value=
{
1
}
>
发布至平台
<
Tooltip
title=
"需求发布至企业商城求购频"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
<
Radio
value=
{
2
}
>
系统匹配
<
Tooltip
title=
"系统通过需求单品类、商品属性、适用地市与平台会员发布的商品品类、
商品属性、归属地区进行匹配,推荐满足条件的平台会员"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
<
Radio
value=
{
3
}
>
指定会员
<
Tooltip
title=
"选择与当前会员有归属关系的会员且角色类型为服务提供的会员(供应商),
需求只发送给指定会员"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
</
Radio
.
Group
>
</
Space
>
{
platType
==
3
&&
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleOptionBtn
(
2
)
}
type=
'dashed'
>
选择会员
</
Button
>
}
{
platType
!=
1
&&
<
Table
dataSource=
{
[]
}
columns=
{
dockingList
}
pagination=
{
pagination
}
/>
}
</
TabPane
>
<
TabPane
tab=
"流转记录"
key=
'5'
>
</
TabPane
>
</
Tabs
>
</
Col
>
</
Row
>
</
Card
>
...
...
src/pages/transaction/enquirySubmit/toSubmit/detailFormColumnType.ts
0 → 100644
View file @
5bca989b
/*
* @Author: LeeJiancong
* @Date: 2020-08-27 16:27:53
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-27 16:34:59
*/
import
{
ColumnType
}
from
'antd/lib/table/interface'
export
const
equiryColumns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'ID'
,
dataIndex
:
'memberId'
,
align
:
'center'
,
key
:
'memberId'
,
},
{
title
:
'商品规格型号'
,
dataIndex
:
'name'
,
key
:
'name'
,
align
:
'left'
},
{
title
:
'品牌'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'颜色'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'尺码'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'面料'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'产地'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'单位'
,
dataIndex
:
'levelTag'
,
key
:
'levelTag'
,
align
:
'center'
},
{
title
:
'采购数量'
,
dataIndex
:
'levelTag'
,
key
:
'levelTag'
,
align
:
'center'
}
]
export
const
dockingList
:
ColumnType
<
any
>
[]
=
[
{
title
:
'序号'
,
dataIndex
:
'memberId'
,
align
:
'center'
,
key
:
'memberId'
,
},
{
title
:
'公司名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
align
:
'left'
},
{
title
:
'公司地址'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'成立日期'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'公司规模'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'诚信度'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'是否归属会员'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
align
:
'center'
},
{
title
:
'状态'
,
dataIndex
:
'levelTag'
,
key
:
'levelTag'
,
align
:
'center'
},
{
title
:
'操作'
,
dataIndex
:
'levelTag'
,
key
:
'levelTag'
,
align
:
'center'
}
]
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