Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
db562e8c
Commit
db562e8c
authored
Mar 13, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改类型
parent
3581b8d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
69 deletions
+52
-69
index.jsx
src/pages/GoodsManage/SearchForm/index.jsx
+42
-66
index.jsx
src/pages/GoodsManage/index.jsx
+9
-2
service.js
src/pages/GoodsManage/service.js
+1
-1
No files found.
src/pages/GoodsManage/SearchForm/index.jsx
View file @
db562e8c
...
...
@@ -31,6 +31,7 @@ class goodsManage extends Component {
state
=
{
loading
:
false
,
productType
:
null
,
};
componentDidMount
()
{
...
...
@@ -78,6 +79,13 @@ class goodsManage extends Component {
}
};
onChangeProductType
=
(
v
=
null
)
=>
{
this
.
props
.
changeProductType
(
v
);
this
.
setState
({
productType
:
v
,
});
};
// 导出明细
onExportGoodsInfo
=
async
()
=>
{
this
.
setState
({
...
...
@@ -105,7 +113,6 @@ class goodsManage extends Component {
const
{
treeData
,
permissions
}
=
this
.
props
;
const
selectW
=
{
width
:
250
};
const
iptNumWidth
=
{
width
:
118
};
const
that
=
this
;
const
canEditable
=
permissions
[
GOOD_MANAGE
.
EDITABLE
];
const
content
=
(
<
div
>
...
...
@@ -130,31 +137,6 @@ class goodsManage extends Component {
</
Button
>
</
div
>
);
// const uploadProps = {
// name: 'file',
// async customRequest(info) {
// const result = await uploadFile(info.file);
// if (result && result.businessCode === '0000') {
// that.handleSearch();
// notification.success({
// message: '操作成功',
// });
// } else {
// notification.warning({
// message: result.msg,
// description: (
// <div>
// {result.data?.length &&
// result.data.map(item => <p>{item.skuNo + item.errSkuMessage}</p>)}
// </div>
// ),
// duration: 6,
// });
// }
// },
// accept: '.xlsx',
// showUploadList: false,
// };
const
filterOption
=
(
input
,
op
)
=>
op
.
props
.
children
.
includes
(
input
);
return
(
...
...
@@ -170,6 +152,19 @@ class goodsManage extends Component {
<
FormItem
label=
"商品名称"
name=
"skuName"
>
<
Input
placeholder=
"请输入商品名称"
allowClear
style=
{
selectW
}
/>
</
FormItem
>
<
FormItem
label=
"商品类型"
name=
"productType"
>
<
Select
style=
{
selectW
}
placeholder=
"请选择商品类型"
allowClear
onChange=
{
this
.
onChangeProductType
}
>
<
Option
value=
{
1
}
>
实体商品
</
Option
>
<
Option
value=
{
2
}
>
虚拟商品
</
Option
>
<
Option
value=
{
4
}
>
服务类商品
</
Option
>
<
Option
value=
{
5
}
>
外卖商品
</
Option
>
</
Select
>
</
FormItem
>
<
FormItem
label=
"类目"
name=
"productCategoryId"
>
<
Cascader
placeholder=
"请选择类目"
...
...
@@ -180,20 +175,22 @@ class goodsManage extends Component {
options=
{
treeData
}
/>
</
FormItem
>
<
FormItem
label=
"审核状态"
name=
"state"
>
<
Select
style=
{
selectW
}
placeholder=
"请选择审核状态"
allowClear
filterOption=
{
filterOption
}
>
{
stateList
?.
map
(
item
=>
(
<
Option
key=
{
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Option
>
))
}
</
Select
>
</
FormItem
>
{
this
.
state
.
productType
!==
5
&&
(
<
FormItem
label=
"审核状态"
name=
"state"
>
<
Select
style=
{
selectW
}
placeholder=
"请选择审核状态"
allowClear
filterOption=
{
filterOption
}
>
{
stateList
?.
map
(
item
=>
(
<
Option
key=
{
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Option
>
))
}
</
Select
>
</
FormItem
>
)
}
<
FormItem
label=
"供货价区间"
>
<
FormItem
name=
"supplyPriceMin"
className=
{
styles
.
iptNumRight
}
noStyle
>
<
InputNumber
placeholder=
"请输入"
style=
{
iptNumWidth
}
/>
...
...
@@ -203,16 +200,11 @@ class goodsManage extends Component {
<
InputNumber
style=
{
iptNumWidth
}
placeholder=
"请输入"
onChange=
{
this
.
valueMin
}
/>
</
FormItem
>
</
FormItem
>
<
FormItem
label=
"商品类型"
name=
"productType"
>
<
Select
style=
{
selectW
}
placeholder=
"请选择商品类型"
>
<
Option
value=
{
1
}
>
实体商品
</
Option
>
<
Option
value=
{
2
}
>
虚拟商品
</
Option
>
<
Option
value=
{
4
}
>
服务类商品
</
Option
>
</
Select
>
</
FormItem
>
<
FormItem
name=
"thirdSkuNo"
label=
"第三方SKU编码"
>
<
Input
placeholder=
"请输入第三方SKU编码"
allowClear
style=
{
selectW
}
/>
</
FormItem
>
{
this
.
state
.
productType
!==
5
&&
(
<
FormItem
name=
"thirdSkuNo"
label=
"第三方SKU编码"
>
<
Input
placeholder=
"请输入第三方SKU编码"
allowClear
style=
{
selectW
}
/>
</
FormItem
>
)
}
<
FormItem
className=
{
styles
.
queryBtn
}
>
<
Button
onClick=
{
()
=>
this
.
handleSearch
()
}
type=
"primary"
className=
{
styles
.
button
}
>
查询
...
...
@@ -236,22 +228,6 @@ class goodsManage extends Component {
</
Button
>
</
Popover
>
{
this
.
props
.
selectNum
>
0
&&
<
Tag
color=
"green"
>
已选商品
{
this
.
props
.
selectNum
}
</
Tag
>
}
{
/* <Button
className={styles.button}
type="primary"
icon="download"
ghost
onClick={() => {
window.location.href = 'https://kdspstatic.q-gp.com/批量修改库存模板.xlsx';
}}
>
模版
</Button>
<Upload {...uploadProps}>
<Button type="primary" className={styles.button}>
批量库存修改
</Button>
</Upload> */
}
</
FormItem
>
)
:
(
''
...
...
src/pages/GoodsManage/index.jsx
View file @
db562e8c
...
...
@@ -12,6 +12,7 @@ import UpdateStock from './UpdateStock';
import
{
spuDetail
,
categoryList
,
apiCategoryListType
,
getVirtualCategory
,
getTemplateList
,
specList
,
...
...
@@ -265,9 +266,10 @@ class goodsManage extends Component {
}
};
categoryList
=
async
()
=>
{
categoryList
=
async
type
=>
{
const
api
=
type
?
apiCategoryListType
:
categoryList
;
try
{
const
{
data
:
treeData
}
=
await
categoryList
(
);
const
{
data
:
treeData
}
=
await
api
(
type
);
if
(
!
treeData
)
return
;
this
.
setState
({
treeData
});
}
catch
(
e
)
{
...
...
@@ -275,6 +277,10 @@ class goodsManage extends Component {
}
};
changeProductType
=
e
=>
{
this
.
categoryList
(
e
);
};
getVirtualCategory
=
async
()
=>
{
try
{
const
{
data
:
virtualTreeData
}
=
await
getVirtualCategory
();
...
...
@@ -404,6 +410,7 @@ class goodsManage extends Component {
shopList=
{
this
.
shopList
}
checkStock=
{
this
.
checkEnableUpdateStock
}
selectNum=
{
selectedRowKeys
.
length
}
changeProductType=
{
this
.
changeProductType
}
setArea=
{
(
isALL
,
type
)
=>
this
.
setArea
(
isALL
,
type
)
}
/>
</
Card
>
...
...
src/pages/GoodsManage/service.js
View file @
db562e8c
...
...
@@ -89,7 +89,7 @@ export async function categoryList() {
}
/**
* 商品分类
* type 商品类型:1-实物类,2-虚拟类,4-服务类
* type 商品类型:1-实物类,2-虚拟类,4-服务类
5 外卖
* */
export
async
function
apiCategoryListType
(
type
)
{
return
request
.
get
(
`/product/category/getByProductType/
${
type
}
`
,
{
...
...
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