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
a722eb43
Commit
a722eb43
authored
Nov 20, 2023
by
武广
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/bidding-two' into 'master'
Feature/bidding two See merge request
!104
parents
e020b0fb
327a1353
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
505 additions
and
125 deletions
+505
-125
ImportListModal.jsx
src/components/ImportGoodsModal/ImportListModal.jsx
+105
-0
config.js
src/components/ImportGoodsModal/config.js
+12
-0
index.jsx
src/components/ImportGoodsModal/index.jsx
+120
-0
index.less
src/components/ImportGoodsModal/index.less
+40
-0
service.js
src/components/ImportGoodsModal/service.js
+28
-0
SearchForm.jsx
...s/GoodsManage/SupplyPriceUpdate/components/SearchForm.jsx
+129
-76
UpdatePriceStock.jsx
...sManage/SupplyPriceUpdate/components/UpdatePriceStock.jsx
+3
-2
index.jsx
src/pages/GoodsManage/SupplyPriceUpdate/index.jsx
+5
-20
staticdata.js
src/pages/GoodsManage/SupplyPriceUpdate/staticdata.js
+22
-27
style.less
src/pages/GoodsManage/SupplyPriceUpdate/style.less
+7
-0
service.js
src/pages/GoodsManage/service.js
+34
-0
No files found.
src/components/ImportGoodsModal/ImportListModal.jsx
0 → 100644
View file @
a722eb43
import
{
DownloadOutlined
}
from
'
@ant-design/icons
'
;
import
{
Modal
,
Button
,
Empty
,
Pagination
}
from
'
antd
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
unstable_batchedUpdates
}
from
'
react-dom
'
;
import
styles
from
'
./index.less
'
;
import
{
apiUploadResult
}
from
'
./service
'
;
const
ImportListModal
=
props
=>
{
const
{
visible
}
=
props
;
const
[
data
,
setData
]
=
useState
([]);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
pageInfo
,
setPageInfo
]
=
useState
({
pageNo
:
1
,
pageSize
:
2
,
});
const
getImportData
=
async
params
=>
{
const
res
=
await
apiUploadResult
({
type
:
props
.
type
,
...
params
,
});
if
(
res
?.
data
)
{
unstable_batchedUpdates
(()
=>
{
setData
(
res
.
data
.
records
);
setTotal
(
res
.
data
.
total
);
});
}
};
const
onChangePage
=
(
pageNo
,
pageSize
)
=>
{
const
obj
=
{
pageNo
,
pageSize
};
setPageInfo
(
obj
);
getImportData
(
obj
);
};
const
onDownload
=
url
=>
{
window
.
location
.
href
=
url
;
};
useEffect
(()
=>
{
getImportData
(
pageInfo
);
},
[]);
return
(
<
Modal
title=
{
<
div
>
查看导入记录
<
span
className=
{
styles
.
subTitle
}
>
(仅展示近半年记录)
</
span
>
</
div
>
}
open=
{
visible
}
onCancel=
{
props
.
onCancel
}
width=
"800px"
footer=
{
false
}
>
{
data
.
length
?
(
<
div
>
<
div
className=
{
styles
.
tableBody
}
>
{
data
.
map
(
item
=>
(
<
div
className=
{
styles
.
card
}
key=
{
item
.
id
}
>
<
div
>
<
div
className=
{
styles
.
top
}
>
<
span
>
导入数据:
{
item
.
total
}
</
span
>
<
span
>
成功数:
{
item
.
successCount
}
</
span
>
<
span
>
失败数:
{
item
.
failedCount
}
</
span
>
</
div
>
<
div
>
<
span
>
导入时间:
{
item
.
createdAt
}
</
span
>
<
span
>
操作人:
{
item
.
createdBy
}
</
span
>
</
div
>
</
div
>
<
div
className=
{
styles
.
errWrappper
}
>
{
item
.
failedCount
>
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
onDownload
(
item
.
failedFileUrl
)
}
>
<
DownloadOutlined
/>
下载错误数据
</
Button
>
)
}
{
item
.
status
&&
+
item
.
status
.
code
===
3
&&
(
<
div
className=
{
styles
.
errorMessage
}
>
{
item
.
failedMessage
}
</
div
>
)
}
</
div
>
</
div
>
))
}
</
div
>
<
div
className=
{
styles
.
pagewrapper
}
>
<
Pagination
total=
{
total
}
showTotal=
{
e
=>
`总共 ${e} 条数据`
}
pageSize=
{
pageInfo
.
pageSize
}
defaultCurrent=
{
pageInfo
.
pageNo
}
onChange=
{
onChangePage
}
onShowSizeChange=
{
onChangePage
}
showQuickJumper
// showSizeChanger
/>
</
div
>
</
div
>
)
:
(
<
Empty
/>
)
}
</
Modal
>
);
};
export
default
ImportListModal
;
src/components/ImportGoodsModal/config.js
0 → 100644
View file @
a722eb43
// 导入配置
export
const
ImportConfig
=
{
// 竞价商品批量选品
binding
:
{
title
:
'
自营商品供货价库存批量更新
'
,
type
:
6
,
tempPath
:
''
,
limitNum
:
5000
,
hideDownload
:
true
,
tip
:
'
SKU
'
,
},
};
src/components/ImportGoodsModal/index.jsx
0 → 100644
View file @
a722eb43
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Form
}
from
'
@ant-design/compatible
'
;
import
{
Modal
,
Button
,
Upload
,
notification
}
from
'
antd
'
;
import
styles
from
'
./index.less
'
;
import
{
apiImportGoods
}
from
'
./service
'
;
import
ImportListModal
from
'
./ImportListModal
'
;
import
{
ImportConfig
}
from
'
./config
'
;
const
ImportGoods
=
React
.
memo
(
props
=>
{
const
[
importFile
,
setImportFile
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
visibleRecord
,
setVisibleRecord
]
=
useState
(
false
);
const
[
config
,
setConfig
]
=
useState
({});
// 关闭弹窗
const
onCancel
=
()
=>
{
props
.
onHide
();
};
// 查看导入记录
const
onShowRecord
=
()
=>
{
setVisibleRecord
(
true
);
};
// 下载模板
const
onDownTemplate
=
()
=>
{
if
(
config
.
tempPath
)
{
window
.
location
.
href
=
config
.
tempPath
;
}
else
if
(
props
.
onDownload
)
{
props
.
onDownload
(
config
);
}
};
// 导入
const
onImport
=
async
()
=>
{
if
(
!
importFile
.
length
)
{
notification
.
error
({
message
:
'
请选择导入文件
'
,
});
return
;
}
setLoading
(
true
);
const
result
=
await
apiImportGoods
(
importFile
[
0
],
config
.
type
);
setLoading
(
false
);
if
(
result
?.
success
)
{
setImportFile
([]);
notification
.
success
({
message
:
'
导入成功
'
,
});
}
};
// 导入按钮配置属性
const
uploadFileAttr
=
{
name
:
'
file
'
,
maxCount
:
1
,
fileList
:
importFile
,
async
customRequest
(
info
)
{
setImportFile
([
info
.
file
]);
return
false
;
},
accept
:
'
.xlsx
'
,
showUploadList
:
true
,
onRemove
:
()
=>
{
setImportFile
([]);
},
};
useEffect
(()
=>
{
if
(
props
.
visible
)
{
setConfig
(
ImportConfig
[
props
.
importType
]);
}
},
[
props
.
visible
]);
return
(
<>
<
Modal
title=
{
config
.
title
}
open=
{
props
.
visible
}
onCancel=
{
onCancel
}
footer=
{
[
<
Button
type=
"link"
onClick=
{
onShowRecord
}
key=
"btnlook"
>
查看导入记录
</
Button
>,
!
config
.
hideDownload
&&
(
<
Button
type=
"link"
onClick=
{
onDownTemplate
}
key=
"btndown"
>
下载模板
</
Button
>
),
<
Button
onClick=
{
onCancel
}
key=
"btncancel"
>
关闭
</
Button
>,
<
Button
type=
"primary"
loading=
{
loading
}
onClick=
{
onImport
}
key=
"btnimprot"
>
导入
</
Button
>,
]
}
>
<
Form
>
<
Form
.
Item
label=
"导入文件"
>
<
Upload
{
...
uploadFileAttr
}
>
<
Button
type=
"link"
key=
"btnsel"
>
选择文件
</
Button
>
</
Upload
>
<
div
className=
{
styles
.
textDesc
}
>
<
div
>
1、仅支持按商品
{
config
.
tip
}
导入,纵向排列
</
div
>
<
div
>
2、支持Excel格式文件,导入数量限制
{
config
.
limitNum
}
条
</
div
>
</
div
>
</
Form
.
Item
>
</
Form
>
</
Modal
>
{
visibleRecord
&&
(
<
ImportListModal
visible=
{
visibleRecord
}
type=
{
config
.
type
}
onCancel=
{
()
=>
setVisibleRecord
(
false
)
}
/>
)
}
</>
);
});
export
default
Form
.
create
()(
ImportGoods
);
src/components/ImportGoodsModal/index.less
0 → 100644
View file @
a722eb43
.card {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
padding: 20px;
background-color: #fafafa;
span {
display: inline-block;
padding-right: 15px;
}
}
.top {
margin-bottom: 15px;
font-weight: 600;
font-size: 16px;
}
.subTitle {
color: #333;
font-weight: normal;
font-size: 14px;
}
.tableBody {
min-height: 244px;
}
.pagewrapper {
text-align: right;
}
.errWrappper {
display: flex;
align-items: flex-end;
justify-content: flex-end;
}
.errorMessage {
max-width: 300px;
}
.textDesc {
color: #999;
line-height: 32px;
}
src/components/ImportGoodsModal/service.js
0 → 100644
View file @
a722eb43
import
request
from
'
@/utils/request
'
;
import
config
from
'
@/../config/env.config
'
;
import
qs
from
'
qs
'
;
const
{
goodsApi
}
=
config
;
// 商品导入接口
export
async
function
apiImportGoods
(
file
,
type
)
{
const
params
=
new
FormData
();
params
.
append
(
'
file
'
,
file
);
params
.
append
(
'
type
'
,
type
);
const
res
=
await
request
.
post
(
'
/api/merchants/importFile/excel
'
,
{
data
:
params
,
prefix
:
goodsApi
,
});
return
res
;
}
// 分页查询上传文件结果
export
async
function
apiUploadResult
(
params
)
{
const
data
=
await
request
.
get
(
`/api/merchants/importFile/info/page
${
qs
.
stringify
(
params
,
{
addQueryPrefix
:
true
})}
`
,
{
prefix
:
goodsApi
,
},
);
return
data
;
}
src/pages/GoodsManage/SupplyPriceUpdate/components/SearchForm.jsx
View file @
a722eb43
...
@@ -2,8 +2,9 @@ import { Form, Button, Input, Select, notification, Cascader, InputNumber } from
...
@@ -2,8 +2,9 @@ import { Form, Button, Input, Select, notification, Cascader, InputNumber } from
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
SwapRightOutlined
}
from
'
@ant-design/icons
'
;
import
{
SwapRightOutlined
}
from
'
@ant-design/icons
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
ImportGoodsModal
from
'
@/components/ImportGoodsModal
'
;
import
styles
from
'
../../style.less
'
;
import
styles
from
'
../../style.less
'
;
import
{
stateList
}
from
'
../../staticdata
'
;
import
{
apiDownBiddingTemplate
,
apiUploadGoodsFile
}
from
'
../../service
'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
...
@@ -16,6 +17,7 @@ class goodsManage extends Component {
...
@@ -16,6 +17,7 @@ class goodsManage extends Component {
state
=
{
state
=
{
productType
:
null
,
productType
:
null
,
visibleImport
:
false
,
};
};
componentDidMount
()
{
componentDidMount
()
{
...
@@ -32,6 +34,13 @@ class goodsManage extends Component {
...
@@ -32,6 +34,13 @@ class goodsManage extends Component {
this
.
props
.
handleSearch
(
1
);
this
.
props
.
handleSearch
(
1
);
};
};
// 下载模版
onDownload
=
()
=>
{
const
form
=
this
.
formRef
.
current
;
const
values
=
form
.
getFieldsValue
();
apiDownBiddingTemplate
(
values
);
};
valueMin
=
value
=>
{
valueMin
=
value
=>
{
const
{
getFieldValue
,
setFieldsValue
}
=
this
.
formRef
.
current
;
const
{
getFieldValue
,
setFieldsValue
}
=
this
.
formRef
.
current
;
const
minVal
=
getFieldValue
(
'
supplyPriceMin
'
);
const
minVal
=
getFieldValue
(
'
supplyPriceMin
'
);
...
@@ -85,90 +94,134 @@ class goodsManage extends Component {
...
@@ -85,90 +94,134 @@ class goodsManage extends Component {
});
});
};
};
onShowImport
=
importType
=>
{
this
.
setState
({
visibleImport
:
true
,
importType
,
});
};
onHideImport
=
()
=>
{
this
.
setState
({
visibleImport
:
false
,
});
};
// 上传文件设置
uploadConfig
=
()
=>
{
const
that
=
this
;
return
{
name
:
'
file
'
,
async
customRequest
(
info
)
{
that
.
setState
({
loading
:
true
,
});
const
result
=
await
apiUploadGoodsFile
(
info
.
file
);
if
(
result
.
businessCode
===
'
0000
'
)
{
notification
.
success
({
message
:
'
导入成功
'
});
}
that
.
setState
({
loading
:
false
,
});
},
accept
:
'
.xlsx
'
,
showUploadList
:
false
,
};
};
render
()
{
render
()
{
const
{
treeData
}
=
this
.
props
;
const
{
treeData
}
=
this
.
props
;
const
selectW
=
{
width
:
250
};
const
selectW
=
{
width
:
250
};
const
iptNumWidth
=
{
width
:
118
};
const
iptNumWidth
=
{
width
:
118
};
const
filterOption
=
(
input
,
op
)
=>
op
.
props
.
children
.
includes
(
input
);
return
(
return
(
<
Form
<
div
>
ref=
{
this
.
formRef
}
<
Form
name=
"horizontal_login"
ref=
{
this
.
formRef
}
initialValues=
{
{
productType
:
1
}
}
name=
"horizontal_login"
layout=
"inline"
initialValues=
{
{
productType
:
1
}
}
className=
{
styles
.
searchForm
}
layout=
"inline"
>
className=
{
styles
.
searchForm
}
<
FormItem
label=
"SKU编码"
name=
"skuId"
>
>
<
InputNumber
placeholder=
"请输入SKU编码"
max=
{
99999999999999999
}
style=
{
selectW
}
/>
<
FormItem
label=
"SKU编码"
name=
"skuId"
>
</
FormItem
>
<
InputNumber
placeholder=
"请输入SKU编码"
max=
{
99999999999999999
}
style=
{
selectW
}
/>
<
FormItem
label=
"商品名称"
name=
"skuName"
>
</
FormItem
>
<
Input
placeholder=
"请输入商品名称"
allowClear
style=
{
selectW
}
/>
<
FormItem
label=
"商品名称"
name=
"skuName"
>
</
FormItem
>
<
Input
placeholder=
"请输入商品名称"
allowClear
style=
{
selectW
}
/>
<
FormItem
label=
"商品类型"
name=
"productType"
>
</
FormItem
>
<
Select
style=
{
selectW
}
placeholder=
"请选择商品类型"
onChange=
{
this
.
onChangeProductType
}
>
<
FormItem
label=
"商品类型"
name=
"productType"
>
<
Option
value=
{
1
}
>
实体商品
</
Option
>
<
Select
<
Option
value=
{
4
}
>
服务类商品
</
Option
>
style=
{
selectW
}
<
Option
value=
{
5
}
>
外卖商品
</
Option
>
placeholder=
"请选择商品类型"
</
Select
>
onChange=
{
this
.
onChangeProductType
}
</
FormItem
>
>
<
FormItem
label=
"类目"
name=
"productCategoryId"
>
<
Option
value=
{
1
}
>
实体商品
</
Option
>
<
Cascader
<
Option
value=
{
4
}
>
服务类商品
</
Option
>
placeholder=
"请选择类目"
<
Option
value=
{
5
}
>
外卖商品
</
Option
>
style=
{
selectW
}
</
Select
>
showSearch
</
FormItem
>
changeOnSelect
<
FormItem
label=
"类目"
name=
"productCategoryId"
>
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
<
Cascader
options=
{
treeData
}
placeholder=
"请选择类目"
/>
style=
{
selectW
}
</
FormItem
>
showSearch
{
this
.
state
.
productType
!==
5
&&
(
changeOnSelect
<>
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
<
FormItem
label=
"审核状态"
name=
"state"
>
options=
{
treeData
}
<
Select
/>
style=
{
selectW
}
</
FormItem
>
placeholder=
"请选择审核状态"
{
this
.
state
.
productType
!==
5
&&
(
allowClear
<>
filterOption=
{
filterOption
}
<
FormItem
label=
"供货价区间"
>
>
<
FormItem
name=
"supplyPriceMin"
className=
{
styles
.
iptNumRight
}
noStyle
>
{
stateList
?.
map
(
item
=>
(
<
InputNumber
placeholder=
"请输入"
min=
{
0
}
max=
{
999999999
}
style=
{
iptNumWidth
}
/>
<
Option
key=
{
item
.
value
}
value=
{
item
.
value
}
>
</
FormItem
>
{
item
.
label
}
<
span
>
</
Option
>
<
SwapRightOutlined
/>
))
}
</
span
>
</
Select
>
<
FormItem
name=
"supplyPriceMax"
className=
{
styles
.
iptNumRight
}
noStyle
>
</
FormItem
>
<
InputNumber
<
FormItem
label=
"供货价区间"
>
style=
{
iptNumWidth
}
<
FormItem
name=
"supplyPriceMin"
className=
{
styles
.
iptNumRight
}
noStyle
>
min=
{
0
}
<
InputNumber
placeholder=
"请输入"
min=
{
0
}
max=
{
999999999
}
style=
{
iptNumWidth
}
/>
max=
{
999999999
}
placeholder=
"请输入"
onChange=
{
this
.
valueMin
}
/>
</
FormItem
>
</
FormItem
>
</
FormItem
>
<
span
>
<
FormItem
name=
"thirdSkuNo"
label=
"第三方SKU编码"
>
<
SwapRightOutlined
/>
<
Input
placeholder=
"请输入第三方SKU编码"
allowClear
style=
{
selectW
}
/>
</
span
>
<
FormItem
name=
"supplyPriceMax"
className=
{
styles
.
iptNumRight
}
noStyle
>
<
InputNumber
style=
{
iptNumWidth
}
min=
{
0
}
max=
{
999999999
}
placeholder=
"请输入"
onChange=
{
this
.
valueMin
}
/>
</
FormItem
>
</
FormItem
>
</
FormItem
>
</>
<
FormItem
name=
"thirdSkuNo"
label=
"第三方SKU编码"
>
)
}
<
Input
placeholder=
"请输入第三方SKU编码"
allowClear
style=
{
selectW
}
/>
<
FormItem
className=
{
styles
.
queryBtn
}
>
</
FormItem
>
<
Button
onClick=
{
()
=>
this
.
handleSearch
()
}
type=
"primary"
className=
{
styles
.
button
}
>
</>
查询
</
Button
>
<
Button
onClick=
{
()
=>
this
.
onReset
()
}
className=
{
styles
.
button
}
>
重置
</
Button
>
<
Button
type=
"primary"
className=
{
styles
.
button
}
onClick=
{
()
=>
this
.
onShowImport
(
'
binding
'
)
}
>
导入商品
</
Button
>
<
Button
onClick=
{
()
=>
this
.
onDownload
()
}
type=
"link"
className=
{
styles
.
button
}
>
下载模板
</
Button
>
</
FormItem
>
</
Form
>
{
this
.
state
.
visibleImport
&&
(
<
ImportGoodsModal
visible=
{
this
.
state
.
visibleImport
}
importType=
{
this
.
state
.
importType
}
onHide=
{
this
.
onHideImport
}
/>
)
}
)
}
<
FormItem
className=
{
styles
.
queryBtn
}
>
</
div
>
<
Button
onClick=
{
()
=>
this
.
handleSearch
()
}
type=
"primary"
className=
{
styles
.
button
}
>
查询
</
Button
>
<
Button
onClick=
{
()
=>
this
.
onReset
()
}
className=
{
styles
.
button
}
>
重置
</
Button
>
</
FormItem
>
</
Form
>
);
);
}
}
}
}
...
...
src/pages/GoodsManage/SupplyPriceUpdate/components/UpdatePriceStock.jsx
View file @
a722eb43
...
@@ -8,7 +8,7 @@ import { apiProductBiddingUpdate } from '../../service';
...
@@ -8,7 +8,7 @@ import { apiProductBiddingUpdate } from '../../service';
* 更新供货价
* 更新供货价
* * */
* * */
const
UpdatePriceStock
=
options
=>
{
const
UpdatePriceStock
=
options
=>
{
const
{
visible
,
skuData
,
productId
}
=
options
;
const
{
visible
,
skuData
,
productId
,
spuName
}
=
options
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
specArr
,
setSpecArr
]
=
useState
([]);
// 规格列
const
[
specArr
,
setSpecArr
]
=
useState
([]);
// 规格列
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
...
@@ -69,10 +69,11 @@ const UpdatePriceStock = options => {
...
@@ -69,10 +69,11 @@ const UpdatePriceStock = options => {
onCancel=
{
options
.
onCancel
}
onCancel=
{
options
.
onCancel
}
onOk=
{
onSubmit
}
onOk=
{
onSubmit
}
confirmLoading=
{
loading
}
confirmLoading=
{
loading
}
width=
{
10
00
}
width=
{
8
00
}
className=
{
styles
.
priceStockTable
}
className=
{
styles
.
priceStockTable
}
destroyOnClose
destroyOnClose
>
>
<
div
className=
{
styles
.
modalTitle
}
>
SPU名称:
{
spuName
}
</
div
>
<
Form
form=
{
form
}
scrollToFirstError
component=
{
false
}
>
<
Form
form=
{
form
}
scrollToFirstError
component=
{
false
}
>
<
EditableContext
.
Provider
value=
{
form
}
>
<
EditableContext
.
Provider
value=
{
form
}
>
<
Table
<
Table
...
...
src/pages/GoodsManage/SupplyPriceUpdate/index.jsx
View file @
a722eb43
...
@@ -29,13 +29,13 @@ class supplyPriceUpdate extends Component {
...
@@ -29,13 +29,13 @@ class supplyPriceUpdate extends Component {
pageSize
:
20
,
pageSize
:
20
,
previewVisible
:
false
,
previewVisible
:
false
,
createloading
:
false
,
createloading
:
false
,
selectedRowKeys
:
[],
productType
:
1
,
// 商品类型
productType
:
1
,
// 商品类型
searchValue
:
{},
// 搜索条件
searchValue
:
{},
// 搜索条件
refresh
:
''
,
// 外卖刷新
refresh
:
''
,
// 外卖刷新
visibleUpdatePrice
:
false
,
// 修改价格弹窗
visibleUpdatePrice
:
false
,
// 修改价格弹窗
skuPriceStockList
:
[],
// 修改价格弹窗数据
skuPriceStockList
:
[],
// 修改价格弹窗数据
spuId
:
''
,
spuId
:
''
,
spuName
:
''
,
};
};
currentLog
=
null
;
currentLog
=
null
;
...
@@ -55,7 +55,6 @@ class supplyPriceUpdate extends Component {
...
@@ -55,7 +55,6 @@ class supplyPriceUpdate extends Component {
const
searchValue
=
this
.
searchForm
.
getFieldsValue
()
||
{};
const
searchValue
=
this
.
searchForm
.
getFieldsValue
()
||
{};
this
.
setState
({
searchValue
});
this
.
setState
({
searchValue
});
if
(
searchValue
.
productType
!==
5
)
{
if
(
searchValue
.
productType
!==
5
)
{
this
.
onSelectChange
([]);
const
currentPage
=
this
.
state
.
pageNo
;
const
currentPage
=
this
.
state
.
pageNo
;
this
.
setState
(
this
.
setState
(
{
{
...
@@ -113,7 +112,6 @@ class supplyPriceUpdate extends Component {
...
@@ -113,7 +112,6 @@ class supplyPriceUpdate extends Component {
this
.
setState
({
this
.
setState
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
20
,
pageSize
:
20
,
selectedRowKeys
:
[],
});
});
this
.
handleSearch
();
this
.
handleSearch
();
};
};
...
@@ -121,9 +119,6 @@ class supplyPriceUpdate extends Component {
...
@@ -121,9 +119,6 @@ class supplyPriceUpdate extends Component {
onLoad
=
error
=>
{
onLoad
=
error
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
notification
.
success
({
message
:
'
操作成功
'
});
notification
.
success
({
message
:
'
操作成功
'
});
this
.
setState
({
selectedRowKeys
:
[],
});
this
.
handleSearch
();
this
.
handleSearch
();
}
}
};
};
...
@@ -151,12 +146,6 @@ class supplyPriceUpdate extends Component {
...
@@ -151,12 +146,6 @@ class supplyPriceUpdate extends Component {
}
}
};
};
onSelectChange
=
selectedRowKeys
=>
{
this
.
setState
({
selectedRowKeys
,
});
};
// 显示更新供货价弹窗
// 显示更新供货价弹窗
serviceVisbleChange
=
async
row
=>
{
serviceVisbleChange
=
async
row
=>
{
try
{
try
{
...
@@ -166,7 +155,8 @@ class supplyPriceUpdate extends Component {
...
@@ -166,7 +155,8 @@ class supplyPriceUpdate extends Component {
if
(
!
data
)
return
;
if
(
!
data
)
return
;
this
.
setState
({
this
.
setState
({
spuId
:
row
.
spuId
,
spuId
:
row
.
spuId
,
skuPriceStockList
:
data
,
spuName
:
data
.
productName
,
skuPriceStockList
:
data
.
itemList
,
visibleUpdatePrice
:
true
,
visibleUpdatePrice
:
true
,
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -179,11 +169,7 @@ class supplyPriceUpdate extends Component {
...
@@ -179,11 +169,7 @@ class supplyPriceUpdate extends Component {
SupplyPrice
:
{
tableData
=
{}
},
SupplyPrice
:
{
tableData
=
{}
},
permissions
,
permissions
,
}
=
this
.
props
;
}
=
this
.
props
;
const
rowSelection
=
{
const
{
pageNo
,
pageSize
}
=
this
.
state
;
selectedRowKeys
:
this
.
state
.
selectedRowKeys
,
onChange
:
this
.
onSelectChange
,
};
const
{
pageNo
,
pageSize
,
selectedRowKeys
}
=
this
.
state
;
this
.
canEditable
=
permissions
[
GOOD_MANAGE
.
EDITABLE
];
this
.
canEditable
=
permissions
[
GOOD_MANAGE
.
EDITABLE
];
return
(
return
(
...
@@ -200,7 +186,6 @@ class supplyPriceUpdate extends Component {
...
@@ -200,7 +186,6 @@ class supplyPriceUpdate extends Component {
treeData=
{
this
.
state
.
categoryTree
}
treeData=
{
this
.
state
.
categoryTree
}
shopList=
{
this
.
shopList
}
shopList=
{
this
.
shopList
}
checkStock=
{
this
.
checkEnableUpdateStock
}
checkStock=
{
this
.
checkEnableUpdateStock
}
selectNum=
{
selectedRowKeys
.
length
}
changeProductType=
{
this
.
changeProductType
}
changeProductType=
{
this
.
changeProductType
}
setArea=
{
(
isALL
,
type
)
=>
this
.
setArea
(
isALL
,
type
)
}
setArea=
{
(
isALL
,
type
)
=>
this
.
setArea
(
isALL
,
type
)
}
/>
/>
...
@@ -223,7 +208,6 @@ class supplyPriceUpdate extends Component {
...
@@ -223,7 +208,6 @@ class supplyPriceUpdate extends Component {
pagination=
{
false
}
pagination=
{
false
}
className=
{
styles
.
tabletop
}
className=
{
styles
.
tabletop
}
scroll=
{
{
x
:
'
100%
'
,
y
:
500
}
}
scroll=
{
{
x
:
'
100%
'
,
y
:
500
}
}
rowSelection=
{
rowSelection
}
/>
/>
</
Spin
>
</
Spin
>
<
br
/>
<
br
/>
...
@@ -268,6 +252,7 @@ class supplyPriceUpdate extends Component {
...
@@ -268,6 +252,7 @@ class supplyPriceUpdate extends Component {
}
}
}
}
skuData=
{
this
.
state
.
skuPriceStockList
}
skuData=
{
this
.
state
.
skuPriceStockList
}
productId=
{
this
.
state
.
spuId
}
productId=
{
this
.
state
.
spuId
}
spuName=
{
this
.
state
.
spuName
}
refresh=
{
this
.
handleSearch
}
refresh=
{
this
.
handleSearch
}
/>
/>
)
}
)
}
...
...
src/pages/GoodsManage/SupplyPriceUpdate/staticdata.js
View file @
a722eb43
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Input
,
Form
,
InputNumber
,
Button
}
from
'
antd
'
;
import
{
Input
,
Form
,
InputNumber
,
Button
,
notification
}
from
'
antd
'
;
import
{
isIntegerNotMust
,
isCheckPriceTwoDecimal
}
from
'
@/utils/validator
'
;
import
{
isIntegerNotMust
,
isCheckPriceTwoDecimal
}
from
'
@/utils/validator
'
;
import
styles
from
'
./style.less
'
;
import
styles
from
'
./style.less
'
;
...
@@ -44,16 +44,10 @@ export function column(specArr = []) {
...
@@ -44,16 +44,10 @@ export function column(specArr = []) {
<
/div
>
<
/div
>
),
),
},
},
{
title
:
'
重量(kg)
'
,
width
:
135
,
align
:
'
center
'
,
dataIndex
:
'
weight
'
,
},
{
{
title
:
'
库存
'
,
title
:
'
库存
'
,
width
:
12
0
,
width
:
8
0
,
dataIndex
:
'
productS
tock
'
,
dataIndex
:
'
s
tock
'
,
align
:
'
center
'
,
align
:
'
center
'
,
render
:
(
_
,
row
,
index
)
=>
(
render
:
(
_
,
row
,
index
)
=>
(
<
div
>
<
div
>
...
@@ -61,7 +55,7 @@ export function column(specArr = []) {
...
@@ -61,7 +55,7 @@ export function column(specArr = []) {
label
=
""
label
=
""
key
=
"
stock
"
key
=
"
stock
"
name
=
{[
'
data
'
,
index
,
'
stock
'
]}
name
=
{[
'
data
'
,
index
,
'
stock
'
]}
initialValue
=
{
row
.
productS
tock
||
0
}
initialValue
=
{
row
.
s
tock
||
0
}
rules
=
{[{
required
:
true
,
message
:
'
请输入库存!
'
},
{
validator
:
isIntegerNotMust
}]}
rules
=
{[{
required
:
true
,
message
:
'
请输入库存!
'
},
{
validator
:
isIntegerNotMust
}]}
>
>
<
InputNumber
min
=
{
0
}
max
=
{
500
}
/
>
<
InputNumber
min
=
{
0
}
max
=
{
500
}
/
>
...
@@ -69,18 +63,6 @@ export function column(specArr = []) {
...
@@ -69,18 +63,6 @@ export function column(specArr = []) {
<
/div
>
<
/div
>
),
),
},
},
{
title
:
'
库存预警
'
,
width
:
120
,
dataIndex
:
'
productStockWarning
'
,
align
:
'
center
'
,
},
{
title
:
'
商品自编码
'
,
dataIndex
:
'
thirdSkuNo
'
,
width
:
200
,
align
:
'
center
'
,
},
];
];
}
}
...
@@ -89,7 +71,7 @@ export function columnManage() {
...
@@ -89,7 +71,7 @@ export function columnManage() {
{
{
title
:
'
SKU编码
'
,
title
:
'
SKU编码
'
,
dataIndex
:
'
skuId
'
,
dataIndex
:
'
skuId
'
,
width
:
16
0
,
width
:
20
0
,
align
:
'
center
'
,
align
:
'
center
'
,
},
},
{
{
...
@@ -98,17 +80,30 @@ export function columnManage() {
...
@@ -98,17 +80,30 @@ export function columnManage() {
dataIndex
:
'
skuName
'
,
dataIndex
:
'
skuName
'
,
},
},
{
{
title
:
'
供应商价格
'
,
title
:
'
市场价
'
,
dataIndex
:
'
marketPrice
'
,
dataIndex
:
'
marketPrice
'
,
width
:
160
,
width
:
160
,
align
:
'
center
'
,
align
:
'
center
'
,
sorter
:
(
a
,
b
)
=>
a
.
marketPrice
-
b
.
marketPrice
,
render
:
(
_
,
row
)
=>
<
div
>
{(
row
.
marketPrice
||
0
).
toFixed
(
2
)}
<
/div>
,
},
{
title
:
'
供货价
'
,
dataIndex
:
'
supplyPrice
'
,
width
:
160
,
align
:
'
center
'
,
sorter
:
(
a
,
b
)
=>
a
.
supplyPrice
-
b
.
supplyPrice
,
sorter
:
(
a
,
b
)
=>
a
.
supplyPrice
-
b
.
supplyPrice
,
render
:
(
_
,
row
)
=>
(
render
:
(
_
,
row
)
=>
(
<
div
className
=
{
styles
.
price
}
>
<
div
>
{(
row
.
supplyPrice
&&
(
row
.
supplyPrice
||
0
).
toFixed
(
2
))
||
'
-
'
}
<
/div
>
<
p
>
市场价:
{(
row
.
marketPrice
||
0
).
toFixed
(
2
)}
<
/p
>
<
/div
>
),
),
},
},
{
title
:
'
库存
'
,
dataIndex
:
'
stock
'
,
width
:
160
,
align
:
'
center
'
,
render
:
(
_
,
row
)
=>
<
div
>
{
row
.
stock
||
'
-
'
}
<
/div>
,
},
{
{
title
:
'
操作
'
,
title
:
'
操作
'
,
dataIndex
:
'
action
'
,
dataIndex
:
'
action
'
,
...
...
src/pages/GoodsManage/SupplyPriceUpdate/style.less
View file @
a722eb43
.priceStockTable {
.priceStockTable {
:global(.ant-modal-body) {
padding: 0 15px !important;
}
:global(.ant-table-cell) {
:global(.ant-table-cell) {
padding: 5px 0 0 0 !important;
padding: 5px 0 0 0 !important;
line-height: 32px !important;
line-height: 32px !important;
vertical-align: top !important;
vertical-align: top !important;
}
}
}
}
.modalTitle {
height: 40px;
line-height: 40px;
}
.hidden {
.hidden {
width: 0;
width: 0;
height: 0;
height: 0;
...
...
src/pages/GoodsManage/service.js
View file @
a722eb43
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
import
request
from
'
@/utils/request
'
;
import
request
from
'
@/utils/request
'
;
import
config
from
'
../../../config/env.config
'
;
import
config
from
'
../../../config/env.config
'
;
import
{
stringify
}
from
'
qs
'
;
import
{
stringify
}
from
'
qs
'
;
import
{
saveAs
}
from
'
file-saver
'
;
import
{
format
}
from
'
date-fns
'
;
import
_
from
'
lodash
'
;
import
_
from
'
lodash
'
;
const
{
goodsApi
,
kdspApi
}
=
config
;
const
{
goodsApi
,
kdspApi
}
=
config
;
...
@@ -421,3 +423,35 @@ export async function apiBiddingList(params) {
...
@@ -421,3 +423,35 @@ export async function apiBiddingList(params) {
headers
,
headers
,
});
});
}
}
/**
* 导入竞价商品信息
* yApi: http://yapi.quantgroups.com/project/389/interface/api/45896
* * */
export
async
function
apiUploadGoodsFile
(
file
)
{
const
params
=
new
FormData
();
params
.
append
(
'
file
'
,
file
);
params
.
append
(
'
type
'
,
6
);
const
data
=
await
request
.
post
(
'
/api/merchants/importFile/excel
'
,
{
data
:
params
,
prefix
:
goodsApi
,
});
return
data
;
}
/**
* 下载竞价商品模版
* yApi: http://yapi.quantgroups.com/project/389/interface/api/67269
* * */
export
async
function
apiDownBiddingTemplate
(
params
)
{
const
productCategoryId
=
params
?.
productCategoryId
||
[];
params
.
productCategoryId
=
(
productCategoryId
.
length
&&
productCategoryId
[
productCategoryId
.
length
-
1
])
||
''
;
const
res
=
await
request
.
post
(
'
/api/merchants/products/bidding-template/export
'
,
{
data
:
stringify
(
_
.
omitBy
(
params
,
v
=>
v
===
undefined
&&
v
===
null
&&
v
===
''
)),
headers
,
prefix
:
goodsApi
,
responseType
:
'
arrayBuffer
'
,
});
const
blob
=
new
Blob
([
res
]);
saveAs
(
blob
,
`自营商品供货价更新表-
${
format
(
new
Date
(),
'
yyyy-MM-dd
'
)}
.xlsx`
);
}
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