Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
freemud-coupon-export-app
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
秦嘉祺
freemud-coupon-export-app
Commits
2496c3a9
Commit
2496c3a9
authored
Mar 10, 2021
by
秦嘉祺
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20210310_调整导码量单位' into 'master'
调整导码数量单位 See merge request
!2
parents
4d028376
55197846
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
13 deletions
+42
-13
src/global.less
+5
-0
src/pages/table-list/components/CreateForm.tsx
+29
-11
src/pages/table-list/index.tsx
+7
-1
src/pages/table-list/service.ts
+1
-1
No files found.
src/global.less
View file @
2496c3a9
...
...
@@ -45,3 +45,7 @@ ol {
}
}
}
.ant-form-explain {
color: #f5222d;
}
\ No newline at end of file
src/pages/table-list/components/CreateForm.tsx
View file @
2496c3a9
import
{
Form
,
Input
,
Modal
,
Select
,
DatePicker
,
InputNumber
}
from
'antd'
;
import
{
Form
,
Input
,
Modal
,
Select
,
DatePicker
}
from
'antd'
;
import
{
FormComponentProps
}
from
'antd/es/form'
;
import
React
,
{
Component
}
from
'react'
;
import
{
number
}
from
'prop-types'
;
import
moment
from
'moment'
;
const
FormItem
=
Form
.
Item
;
...
...
@@ -18,12 +17,31 @@ interface CreateFormProps extends FormComponentProps {
class
CreateForm
extends
Component
<
CreateFormProps
,
any
>
{
// const { dispatch } = this.props;
// const { modalVisible, form, handleAdd, handleModalVisible } = this.props;
state
=
{
amountUnit
:
0
};
componentWillReceiveProps
(
props
:
any
)
{
const
{
modalVisible
}
=
this
.
props
;
if
(
!
modalVisible
)
{
this
.
setState
({
amountUnit
:
0
});
}
}
selectAmountUnit
=
(
value
:
number
)
=>
{
this
.
setState
({
amountUnit
:
value
});
}
okHandle
=
()
=>
{
const
{
form
,
handleAdd
}
=
this
.
props
;
form
.
validateFields
((
err
,
fieldsValue
)
=>
{
if
(
err
)
return
;
// form.resetFields();
const
{
amountUnit
}
=
this
.
state
;
if
(
amountUnit
===
1
)
{
fieldsValue
.
CouponAmount
=
fieldsValue
.
CouponAmount
*
10000
;
}
handleAdd
(
fieldsValue
);
});
};
...
...
@@ -52,6 +70,12 @@ class CreateForm extends Component<CreateFormProps, any> {
render
()
{
const
{
modalVisible
,
form
,
handleModalVisible
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
const
selectAfter
=
(
<
Select
defaultValue=
{
0
}
className=
"select-after"
onChange=
{
this
.
selectAmountUnit
}
>
<
Option
value=
{
0
}
>
个
</
Option
>
<
Option
value=
{
1
}
>
万
</
Option
>
</
Select
>
);
return
(
<
Modal
destroyOnClose
...
...
@@ -78,12 +102,12 @@ class CreateForm extends Component<CreateFormProps, any> {
rules
:
[{
required
:
true
,
message
:
'请输入活动号'
,
min
:
1
}],
})(<
Input
placeholder=
"请输入活动号"
/>)
}
</
FormItem
>
<
FormItem
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
15
}
}
label=
"导码量"
>
<
FormItem
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
15
}
}
label=
"导码量"
help=
"注意导码单位!"
>
{
getFieldDecorator
(
'CouponAmount'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入导码量'
},
{
pattern
:
/^
[
1-9
]\d
*$/g
,
required
:
true
,
message
:
'只能输入正整数'
}],
})(<
Input
placeholder=
"请输入导码量,单位是
万"
addonAfter=
{
<
div
>
万
</
div
>
}
/>)
}
})(<
Input
placeholder=
"请输入导码量,单位是
个或万"
addonAfter=
{
selectAfter
}
/>)
}
</
FormItem
>
<
FormItem
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
15
}
}
label=
{
"有效期"
}
>
{
getFieldDecorator
(
'vaildDate'
,
{
...
...
@@ -117,12 +141,6 @@ class CreateForm extends Component<CreateFormProps, any> {
}
],
})
// (
// <Select placeholder="请选择供应商" style=
{{
width
:
'100%'
}}
>
// <Option value="1575">趋加</Option>
// <Option value="2250">趋加麦钱包</Option>
// <Option value="1701">趋加支付宝</Option>
// </Select>)
}
(
<
Select
placeholder=
"请选择供应商"
style=
{
{
width
:
'100%'
}
}
>
<
Option
value=
"1679"
>
趋佳
</
Option
>
...
...
src/pages/table-list/index.tsx
View file @
2496c3a9
...
...
@@ -128,7 +128,13 @@ class TableList extends Component<TableListProps, TableListState> {
dataIndex
:
'CouponAmount'
,
sorter
:
true
,
align
:
'right'
,
render
:
(
val
:
string
)
=>
`
${
val
}
万`
,
render
:
(
val
:
number
)
=>
{
if
(
val
>
10000
)
{
return
<
span
>
{
val
/
10000
}
<
span
style=
{
{
color
:
"#f5222d"
}
}
>
万
</
span
></
span
>;
}
else
{
return
val
;
}
},
// mark to display a total number
needTotal
:
true
,
},
...
...
src/pages/table-list/service.ts
View file @
2496c3a9
...
...
@@ -3,7 +3,7 @@ import { TableListParams } from './data.d';
//export const apiAddress = "http://localhost:8001";
//export const apiAddress = "http://172.16.0.152:809";
export
const
apiAddress
=
"http://115.159.226.87:8090"
;
export
const
apiAddress
=
"http://115.159.226.87:8090"
;
const
getExportRecord
=
apiAddress
+
"/Coupon/GetExportRecord"
;
const
addExportRecord
=
apiAddress
+
"/Coupon/AddExportRecord"
;
...
...
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