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
shenshaokai
jinfa-platform
Commits
d2166fb0
Commit
d2166fb0
authored
Aug 15, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
0caf966a
e4def9b4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
175 additions
and
49 deletions
+175
-49
addGoods.tsx
src/pages/commodity/goods/addGoods.tsx
+5
-1
index.tsx
src/pages/commodity/goods/index.tsx
+51
-25
index.tsx
src/pages/commodity/goods/schema/index.tsx
+94
-0
basicInfoForm.tsx
...ages/commodity/products/addProductsItem/basicInfoForm.tsx
+13
-13
index.tsx
src/pages/commodity/products/index.tsx
+9
-9
viewBrand.tsx
src/pages/trademark/viewBrand.tsx
+3
-1
No files found.
src/pages/commodity/goods/addGoods.tsx
View file @
d2166fb0
...
...
@@ -134,7 +134,7 @@ const AddGoods = () => {
message
:
'请填入货号'
},
{
pattern
:
/^
(?=
.*
\d)(?=
.*
[
a-zA-Z
])(?=
.*
[
~!@#$%^&*-_
])[\d
a-zA-Z~!@#$%^&*-_
]
{1,20}$/
,
pattern
:
/^
(?=
.*
\d)(?=
.*
[
a-z
_
A-Z
])(?=
.*
[
~!@#$%^&*-_
])[\d
a-zA-Z~!@#$%^&*-_
]
{1,20}$/
,
message
:
'最长20个字符(由字母、数组、特殊字符组成)'
}
]
}
...
...
@@ -260,6 +260,10 @@ const AddGoods = () => {
{
required
:
true
,
message
:
'请填入成本价'
,
},
{
pattern
:
/^
\d
+
(\.\d
{1,4}
)?
$/
,
message
:
'小数点后仅限四位'
,
}
]
}
>
...
...
src/pages/commodity/goods/index.tsx
View file @
d2166fb0
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Form
,
Card
,
Modal
,
Result
,
Progress
,
Select
,
Dropdown
,
Menu
,
Row
,
Col
,
Input
,
Popconfirm
,
message
}
from
'antd'
import
{
Button
,
Form
,
Space
,
Card
,
Modal
,
Result
,
Progress
,
Select
,
Dropdown
,
Menu
,
Row
,
Col
,
Input
,
Popconfirm
,
message
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PlusOutlined
,
...
...
@@ -16,6 +16,13 @@ import { ColumnType } from 'antd/lib/table/interface'
import
styles
from
"./index.less"
import
{
PublicApi
}
from
'@/services/api'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
NiceForm
from
'@/components/NiceForm'
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
goodsSchema
}
from
'./schema'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
const
{
Option
}
=
Select
;
...
...
@@ -41,8 +48,10 @@ interface paramItem {
batch
:
string
;
}
const
formActions
=
createFormActions
();
const
Goods
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
({})
const
ref
=
useRef
<
any
>
({})
const
[
selectRow
,
setSelectRow
]
=
useState
<
Item
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
number
>>
([])
const
[
importModal
,
setImportModal
]
=
useState
(
false
)
...
...
@@ -116,7 +125,7 @@ const Goods: React.FC<{}> = () => {
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handleSingleDelete
(
record
)
}
onCancel=
{
()
=>
console
.
log
(
'取消'
)
}
onCancel=
{
()
=>
console
.
log
(
'取消'
)
}
okText=
"是"
cancelText=
"否"
>
...
...
@@ -131,16 +140,16 @@ const Goods: React.FC<{}> = () => {
const
fetchData
=
(
params
:
any
)
=>
{
console
.
log
(
params
)
return
new
Promise
((
resolve
,
reject
)
=>
{
let
obj
=
{
...
params
}
PublicApi
.
getProductGoodsGetGoodsList
(
obj
).
then
(
res
=>
{
let
obj
=
{
...
params
}
PublicApi
.
getProductGoodsGetGoodsList
(
obj
).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
const
handleSingleDelete
=
(
record
:
any
)
=>
{
if
(
record
?.
id
)
PublicApi
.
postProductGoodsDeleteBatchGoods
({
idList
:
[
record
.
id
]}).
then
(
res
=>
{
const
handleSingleDelete
=
(
record
:
any
)
=>
{
if
(
record
?.
id
)
PublicApi
.
postProductGoodsDeleteBatchGoods
({
idList
:
[
record
.
id
]
}).
then
(
res
=>
{
//@ts-ignore
ref
.
current
.
reload
()
})
...
...
@@ -284,12 +293,12 @@ const Goods: React.FC<{}> = () => {
const
handleMenuClick
=
(
e
:
any
)
=>
{
// console.log('menu', e, selectedRowKeys); // 1 批量删除;2 删除导入批次
if
(
e
.
key
===
'1'
)
{
PublicApi
.
postProductGoodsDeleteBatchGoods
({
idList
:
goodsRowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
e
.
key
===
'1'
)
{
PublicApi
.
postProductGoodsDeleteBatchGoods
({
idList
:
goodsRowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
//@ts-ignore
ref
.
current
.
reload
()
})
}
else
if
(
e
.
key
===
'2'
)
{
}
else
if
(
e
.
key
===
'2'
)
{
console
.
log
(
'删除导入批次'
)
setDeleteBatchModal
(
true
)
}
...
...
@@ -307,7 +316,7 @@ const Goods: React.FC<{}> = () => {
const
handleSearch
=
(
val
:
string
)
=>
{
console
.
log
(
val
)
let
obj
=
{
...
filterParams
,
name
:
val
}
let
obj
=
{
...
filterParams
,
name
:
val
}
setFilterParams
(
obj
)
//@ts-ignore
ref
.
current
.
reload
(
obj
)
...
...
@@ -322,17 +331,17 @@ const Goods: React.FC<{}> = () => {
ref
.
current
.
reload
(
restObj
)
}
const
nameChange
=
(
e
:
any
)
=>
{
const
nameChange
=
(
e
:
any
)
=>
{
console
.
log
(
e
.
target
.
value
)
let
obj
=
{
...
filterParams
,
name
:
e
.
target
.
value
}
let
obj
=
{
...
filterParams
,
name
:
e
.
target
.
value
}
setFilterParams
(
obj
)
}
const
handleBrandSearch
=
(
value
:
any
)
=>
{
// end value
const
handleBrandSearch
=
(
value
:
any
)
=>
{
// end value
console
.
log
(
value
,
'handleBrandSearch'
)
if
(
value
)
{
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setBrandData
(
res
.
data
)
})
}
else
{
...
...
@@ -340,18 +349,18 @@ const Goods: React.FC<{}> = () => {
}
}
const
handleBrandChange
=
(
value
:
any
)
=>
{
const
handleBrandChange
=
(
value
:
any
)
=>
{
setBrandValue
(
value
)
console
.
log
(
value
,
'handleBrandChange'
)
let
obj
=
{
...
filterParams
,
brandId
:
value
}
let
obj
=
{
...
filterParams
,
brandId
:
value
}
setFilterParams
(
obj
)
}
const
handleClassSearch
=
(
value
:
any
)
=>
{
const
handleClassSearch
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'handleClassSearch'
)
if
(
value
)
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setClassData
(
res
.
data
)
})
}
else
{
...
...
@@ -359,13 +368,30 @@ const Goods: React.FC<{}> = () => {
}
}
const
handleClassChange
=
(
value
:
any
)
=>
{
const
handleClassChange
=
(
value
:
any
)
=>
{
setClassValue
(
value
)
let
obj
=
{
...
filterParams
,
customerCategoryId
:
value
}
let
obj
=
{
...
filterParams
,
customerCategoryId
:
value
}
setFilterParams
(
obj
)
console
.
log
(
value
,
'handleClassChange'
)
}
const
controllerBtns
=
(
<
Space
>
<
Button
type=
'primary'
onClick=
{
()
=>
history
.
push
(
'/memberCenter/commodityAbility/commodity/goods/addGoods'
)
}
>
<
PlusOutlined
/>
新建
</
Button
>
<
Button
style=
{
{
margin
:
'0 16px'
}
}
onClick=
{
()
=>
setImportModal
(
true
)
}
>
导入数据
</
Button
>
<
Dropdown
overlay=
{
menuMore
}
trigger=
{
[
'click'
]
}
>
<
Button
>
更多
<
DownOutlined
/>
</
Button
>
</
Dropdown
>
</
Space
>
);
return
(
<
PageHeaderWrapper
>
<
Card
>
...
...
@@ -373,7 +399,7 @@ const Goods: React.FC<{}> = () => {
columns=
{
columns
}
currentRef=
{
ref
}
rowSelection=
{
goodsRowSelection
}
tableProps=
{
{
rowKey
:
"id"
}
}
tableProps=
{
{
rowKey
:
"id"
}
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
Row
>
...
...
src/pages/commodity/goods/schema/index.tsx
0 → 100644
View file @
d2166fb0
import
{
ISchema
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
export
const
goodsSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
topLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
ctl
:
{
type
:
'object'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{controllerBtns}}'
,
},
},
name
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'货品名称'
,
},
},
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
},
colStyle
:
{
marginLeft
:
20
,
},
},
properties
:
{
code
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'货号'
},
},
brandId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'品牌'
,
showSearch
:
true
,
showArrow
:
true
,
filterOption
:
false
,
defaultActiveFirstOption
:
false
,
notFoundContent
:
false
,
style
:
{
width
:
'100%'
},
},
},
customerCategoryId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'品类'
,
style
:
{
width
:
'100%'
}
},
},
batch
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'导入批次'
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
'查询'
,
},
},
},
},
},
},
},
};
\ No newline at end of file
src/pages/commodity/products/addProductsItem/basicInfoForm.tsx
View file @
d2166fb0
...
...
@@ -300,29 +300,29 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
<
Tooltip
title=
"设置了归属地市后,此商品可根据地市进行筛选,未设置时默认为所有地市"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
<
i
style=
{
{
color
:
'red'
}
}
>
*
</
i
>
</
span
>
}
rules=
{
[
{
required
:
true
,
message
:
'请选择地区'
}
]
}
//
rules=
{[
//
{
//
required: true,
//
message: '请选择地区'
//
}
//
]
}
key=
{
field
.
key
}
>
<
Form
.
Item
{
...
field
}
rules=
{
[
{
required
:
true
,
message
:
"请选择地区"
,
},
]
}
//
rules=
{[
//
{
//
required: true,
//
message: "请选择地区",
//
},
//
]
}
noStyle
>
<
Cascader
options=
{
proviceOptions
}
changeOnSelect
onChange=
{
onCommodityAreaChange
}
placeholder=
"请选择地区"
fieldNames=
{
{
label
:
'name'
,
value
:
'code'
,
children
:
'areaResponses'
}
}
...
...
src/pages/commodity/products/index.tsx
View file @
d2166fb0
...
...
@@ -37,8 +37,8 @@ interface paramItem {
name
:
string
;
code
:
string
;
priceType
:
number
;
M
in
:
number
;
M
ax
:
number
;
m
in
:
number
;
m
ax
:
number
;
brandId
:
number
;
customerCategoryId
:
number
;
status
:
number
;
...
...
@@ -65,8 +65,8 @@ const Products: React.FC<{}> = () => {
name
:
''
,
code
:
''
,
priceType
:
null
,
M
in
:
null
,
M
ax
:
null
,
m
in
:
null
,
m
ax
:
null
,
brandId
:
0
,
customerCategoryId
:
0
,
status
:
null
,
...
...
@@ -478,7 +478,7 @@ const Products: React.FC<{}> = () => {
}
const
handleReset
=
()
=>
{
let
restObj
=
{
name
:
''
,
code
:
''
,
Max
:
null
,
M
in
:
null
,
priceType
:
null
,
brandId
:
0
,
customerCategoryId
:
0
,
status
:
null
}
let
restObj
=
{
name
:
''
,
code
:
''
,
max
:
null
,
m
in
:
null
,
priceType
:
null
,
brandId
:
0
,
customerCategoryId
:
0
,
status
:
null
}
setFilterParams
(
restObj
)
setBrandValue
(
undefined
)
setClassValue
(
undefined
)
...
...
@@ -650,11 +650,11 @@ const Products: React.FC<{}> = () => {
<
Input
.
Group
compact
>
<
Input
type=
"number"
value=
{
filterParams
.
M
in
}
value=
{
filterParams
.
m
in
}
style=
{
{
width
:
'40%'
,
textAlign
:
'center'
}
}
min=
{
0
}
placeholder=
"最低价格"
onChange=
{
(
e
)
=>
setFilterParams
({...
filterParams
,
M
in
:
+
e
.
target
.
value
})
}
onChange=
{
(
e
)
=>
setFilterParams
({...
filterParams
,
m
in
:
+
e
.
target
.
value
})
}
/>
<
Input
style=
{
{
...
...
@@ -670,7 +670,7 @@ const Products: React.FC<{}> = () => {
/>
<
Input
type=
"number"
value=
{
filterParams
.
M
ax
}
value=
{
filterParams
.
m
ax
}
style=
{
{
width
:
'40%'
,
textAlign
:
'center'
,
...
...
@@ -678,7 +678,7 @@ const Products: React.FC<{}> = () => {
}
}
min=
{
0
}
placeholder=
"最高价格"
onChange=
{
(
e
)
=>
setFilterParams
({...
filterParams
,
M
ax
:
+
e
.
target
.
value
})
}
onChange=
{
(
e
)
=>
setFilterParams
({...
filterParams
,
m
ax
:
+
e
.
target
.
value
})
}
/>
</
Input
.
Group
>
</
Col
>
...
...
src/pages/trademark/viewBrand.tsx
View file @
d2166fb0
...
...
@@ -33,6 +33,8 @@ const viewBrand: React.FC<{}> = () => {
setFixStep
(
0
)
else
if
(
res
.
data
.
status
===
2
)
setFixStep
(
1
)
else
setFixStep
(
2
)
}
})
PublicApi
.
getProductBrandGetBrandCheckRecord
({
brandId
:
id
}).
then
(
res
=>
{
...
...
@@ -126,7 +128,7 @@ const viewBrand: React.FC<{}> = () => {
}
const
tips
=
<>
证明材料
<
Tooltip
title=
"证明材料:如商标注册证书、品牌授权证书等证明材料"
><
span
>
<
QuestionCircleOutlined
/></
span
></
Tooltip
></>
const
content
=
<>
<
Descriptions
colon=
{
true
}
style=
{
{
textAlign
:
'center'
}
}
>
<
Descriptions
colon=
{
true
}
style=
{
{
textAlign
:
'center'
,
marginLeft
:
100
,
width
:
800
}
}
>
<
Descriptions
.
Item
label=
"申请审核时间"
>
{
brandInfo
.
applyTime
&&
moment
(
brandInfo
.
applyTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"审核状态"
>
{
...
...
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