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
63bb8102
Commit
63bb8102
authored
Nov 02, 2023
by
guang.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 去掉没用代码
parent
429b4681
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
263 deletions
+1
-263
index.jsx
src/pages/GoodsManage/SupplyPriceUpdate/index.jsx
+1
-263
No files found.
src/pages/GoodsManage/SupplyPriceUpdate/index.jsx
View file @
63bb8102
...
@@ -5,26 +5,11 @@ import React, { Component } from 'react';
...
@@ -5,26 +5,11 @@ import React, { Component } from 'react';
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
styles
from
'
../style.less
'
;
import
styles
from
'
../style.less
'
;
import
UpdateStock
from
'
../UpdateStock
'
;
import
{
import
{
apiCategoryListType
,
apiProductBiddingInfo
}
from
'
../service
'
;
categoryList
,
apiCategoryListType
,
getVirtualCategory
,
getTemplateList
,
specList
,
queryAllAfterAddress
,
apiEnableUpdataStock
,
apiQueryLastChangeLog
,
apiProductBiddingInfo
,
}
from
'
../service
'
;
import
LogModal
from
'
../LogModal
'
;
import
{
JDSHOPID
}
from
'
../staticdata
'
;
import
{
JDSHOPID
}
from
'
../staticdata
'
;
import
{
columnManage
}
from
'
./staticdata
'
;
import
{
columnManage
}
from
'
./staticdata
'
;
import
SearchForm
from
'
./components/SearchForm
'
;
import
SearchForm
from
'
./components/SearchForm
'
;
import
TempleatModal
from
'
../TempleatModal
'
;
import
ServiceGoods
from
'
../../ServiceGoods
'
;
import
InfoAudit
from
'
../infoAudit
'
;
import
UpdatePriceStock
from
'
./components/UpdatePriceStock
'
;
import
UpdatePriceStock
from
'
./components/UpdatePriceStock
'
;
import
Takeaway
from
'
../Takeaway
'
;
import
Takeaway
from
'
../Takeaway
'
;
...
@@ -40,30 +25,12 @@ class supplyPriceUpdate extends Component {
...
@@ -40,30 +25,12 @@ class supplyPriceUpdate extends Component {
state
=
{
state
=
{
pageNo
:
1
,
pageNo
:
1
,
loading
:
false
,
loading
:
false
,
treeData
:
[],
categoryTree
:
[],
categoryTree
:
[],
virtualTreeData
:
[],
pageSize
:
20
,
pageSize
:
20
,
priceInfo
:
{},
logVisible
:
false
,
previewVisible
:
false
,
previewVisible
:
false
,
updateStockVisible
:
false
,
createloading
:
false
,
createloading
:
false
,
specListData
:
[],
templeatModalVisible
:
false
,
selectedRowKeys
:
[],
selectedRowKeys
:
[],
isAll
:
0
,
templateList
:
[],
stockSkuIds
:
[],
isType
:
''
,
serviceVisble
:
false
,
serviceData
:
{},
visibleAuditModal
:
false
,
auditRow
:
{},
// 查看审核信息使用
isEditDraft
:
false
,
// 是否编辑草稿
productType
:
1
,
// 商品类型
productType
:
1
,
// 商品类型
takeAway
:
{},
// 弹窗外卖商品参数
searchValue
:
{},
// 搜索条件
searchValue
:
{},
// 搜索条件
refresh
:
''
,
// 外卖刷新
refresh
:
''
,
// 外卖刷新
visibleUpdatePrice
:
false
,
// 修改价格弹窗
visibleUpdatePrice
:
false
,
// 修改价格弹窗
...
@@ -81,10 +48,7 @@ class supplyPriceUpdate extends Component {
...
@@ -81,10 +48,7 @@ class supplyPriceUpdate extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
props
.
SupplyPrice
.
tableData
=
{};
this
.
props
.
SupplyPrice
.
tableData
=
{};
this
.
categoryList
(
this
.
state
.
productType
);
this
.
categoryListByType
(
this
.
state
.
productType
);
this
.
categoryListByType
(
this
.
state
.
productType
);
this
.
getVirtualCategory
();
this
.
specList
();
}
}
handleSearch
=
page
=>
{
handleSearch
=
page
=>
{
...
@@ -164,137 +128,9 @@ class supplyPriceUpdate extends Component {
...
@@ -164,137 +128,9 @@ class supplyPriceUpdate extends Component {
}
}
};
};
viewLog
=
async
rows
=>
{
this
.
currentLog
=
rows
;
this
.
setState
({
logVisible
:
true
,
});
};
setArea
=
async
(
isAll
,
type
)
=>
{
// distribution配送区域 after售后地址
if
(
!
this
.
state
.
selectedRowKeys
.
length
&&
!
isAll
)
{
notification
.
error
({
message
:
'
请选择商品
'
});
return
;
}
const
data
=
type
===
'
distribution
'
?
await
getTemplateList
()
:
await
queryAllAfterAddress
();
const
length
=
type
===
'
distribution
'
?
data
.
data
.
length
:
data
.
data
.
records
.
length
;
if
(
data
.
code
===
'
0000
'
&&
length
)
{
this
.
setState
({
templeatModalVisible
:
true
,
isAll
,
templateList
:
type
===
'
distribution
'
?
data
.
data
:
data
.
data
.
records
,
isType
:
type
,
});
}
else
{
notification
.
error
({
message
:
'
暂无数据
'
});
}
};
filterShopList
=
(
list
=
[],
isEdit
)
=>
filterShopList
=
(
list
=
[],
isEdit
)
=>
list
.
filter
(
item
=>
isEdit
||
!
JDSHOPID
.
includes
(
item
.
id
));
list
.
filter
(
item
=>
isEdit
||
!
JDSHOPID
.
includes
(
item
.
id
));
// 验证是否可以修改库存
checkEnableUpdateStock
=
async
()
=>
{
const
ids
=
this
.
state
.
selectedRowKeys
.
join
(
'
,
'
);
if
(
ids
)
{
const
res
=
await
apiEnableUpdataStock
(
ids
);
if
(
res
.
data
)
{
if
(
res
.
data
.
successSkuIds
?.
length
)
{
this
.
setState
({
priceInfo
:
{},
stockSkuIds
:
res
.
data
.
successSkuIds
,
});
this
.
openModal
({},
1
);
}
else
{
const
message
=
res
.
data
.
failedInfoList
[
0
]?.
message
||
'
未存在可修改库存的商品
'
;
notification
.
info
({
message
});
}
}
}
else
{
notification
.
info
({
message
:
'
请选择
'
});
}
};
openModal
=
(
{
skuId
,
supplyPrice
,
marketPrice
,
salePrice
,
marketableStock
,
supplierId
,
stock
,
productStock
,
state
,
},
isStock
,
)
=>
{
let
visible
=
{};
if
(
isStock
)
{
visible
=
{
updateStockVisible
:
true
};
}
this
.
setState
({
...
visible
,
priceInfo
:
{
id
:
skuId
,
stock
,
productStock
,
marketableStock
,
supplyPrice
,
marketPrice
,
salePrice
,
supplierId
,
state
,
},
});
};
onShowStockModal
=
async
row
=>
{
const
res
=
await
apiQueryLastChangeLog
(
row
.
skuId
);
let
priceInfo
=
{
id
:
row
.
skuId
,
curStock
:
row
.
productStock
,
supplierId
:
row
.
supplierId
,
marketableStock
:
row
.
stock
,
};
if
(
res
.
data
&&
[
1
,
3
].
includes
(
+
res
.
data
.
status
))
{
priceInfo
=
Object
.
assign
(
{
changeReason
:
res
.
data
.
changeReason
,
stock
:
+
res
.
data
.
afterChange
,
changeType
:
res
.
data
.
changeType
,
status
:
res
.
data
.
status
,
stateDesc
:
res
.
data
.
statusDesc
,
rejectReason
:
res
.
data
.
rejectReason
,
},
priceInfo
,
);
}
this
.
setState
({
updateStockVisible
:
true
,
priceInfo
,
stockSkuIds
:
[
row
.
skuId
],
});
};
cancel
=
query
=>
{
this
.
setState
({
updateStockVisible
:
false
});
if
(
query
)
{
this
.
handleSearch
();
}
};
categoryList
=
async
()
=>
{
try
{
const
{
data
:
treeData
}
=
await
categoryList
({});
if
(
!
treeData
)
return
;
this
.
setState
({
treeData
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
};
categoryListByType
=
async
type
=>
{
categoryListByType
=
async
type
=>
{
try
{
try
{
const
{
data
:
categoryTree
}
=
await
apiCategoryListType
(
type
);
const
{
data
:
categoryTree
}
=
await
apiCategoryListType
(
type
);
...
@@ -315,23 +151,6 @@ class supplyPriceUpdate extends Component {
...
@@ -315,23 +151,6 @@ class supplyPriceUpdate extends Component {
}
}
};
};
getVirtualCategory
=
async
()
=>
{
try
{
const
{
data
:
virtualTreeData
}
=
await
getVirtualCategory
();
if
(
!
virtualTreeData
)
return
;
this
.
setState
({
virtualTreeData
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
};
specList
=
async
()
=>
{
const
data
=
await
specList
();
if
(
data
.
businessCode
===
'
0000
'
&&
data
.
data
.
length
)
{
this
.
setState
({
specListData
:
data
.
data
});
}
};
onSelectChange
=
selectedRowKeys
=>
{
onSelectChange
=
selectedRowKeys
=>
{
this
.
setState
({
this
.
setState
({
selectedRowKeys
,
selectedRowKeys
,
...
@@ -355,38 +174,11 @@ class supplyPriceUpdate extends Component {
...
@@ -355,38 +174,11 @@ class supplyPriceUpdate extends Component {
}
}
};
};
// 显示新增商品弹窗
serviceVisbleClose
=
(
flag
,
refresh
)
=>
{
this
.
setState
({
serviceVisble
:
flag
,
isEditDraft
:
false
,
serviceData
:
{},
takeAway
:
{},
});
if
(
refresh
)
{
this
.
handleSearch
();
}
};
onEdit
=
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
this
.
serviceVisbleChange
(
this
.
state
.
auditRow
);
};
// 显示外卖商品弹窗
handleTakeawayEdit
=
params
=>
{
this
.
setState
({
takeAway
:
params
,
serviceVisble
:
true
,
});
};
render
()
{
render
()
{
const
{
const
{
SupplyPrice
:
{
tableData
=
{}
},
SupplyPrice
:
{
tableData
=
{}
},
permissions
,
permissions
,
}
=
this
.
props
;
}
=
this
.
props
;
console
.
log
(
'
tableData :>>
'
,
tableData
);
const
rowSelection
=
{
const
rowSelection
=
{
selectedRowKeys
:
this
.
state
.
selectedRowKeys
,
selectedRowKeys
:
this
.
state
.
selectedRowKeys
,
onChange
:
this
.
onSelectChange
,
onChange
:
this
.
onSelectChange
,
...
@@ -448,15 +240,6 @@ class supplyPriceUpdate extends Component {
...
@@ -448,15 +240,6 @@ class supplyPriceUpdate extends Component {
/>
/>
)
}
)
}
<
LogModal
visible=
{
this
.
state
.
logVisible
}
spuId=
{
this
.
currentLog
?.
spuId
}
id=
{
this
.
currentLog
?.
skuId
}
onCancel=
{
()
=>
{
this
.
currentLog
=
null
;
this
.
setState
({
logVisible
:
false
});
}
}
/>
<
Drawer
<
Drawer
visible=
{
this
.
state
.
previewVisible
}
visible=
{
this
.
state
.
previewVisible
}
width=
"450"
width=
"450"
...
@@ -474,54 +257,9 @@ class supplyPriceUpdate extends Component {
...
@@ -474,54 +257,9 @@ class supplyPriceUpdate extends Component {
title=
"商品预览"
title=
"商品预览"
></
iframe
>
></
iframe
>
</
Drawer
>
</
Drawer
>
<
UpdateStock
visible=
{
this
.
state
.
updateStockVisible
}
skuIds=
{
this
.
state
.
stockSkuIds
}
info=
{
this
.
state
.
priceInfo
}
onCancel=
{
this
.
cancel
}
/>
<
TempleatModal
visible=
{
this
.
state
.
templeatModalVisible
}
selectedRowKeys=
{
this
.
state
.
selectedRowKeys
}
total=
{
tableData
.
total
||
0
}
onCancel=
{
()
=>
{
this
.
setState
({
templeatModalVisible
:
false
,
selectedRowKeys
:
[]
});
this
.
handleSearch
();
}
}
isALL=
{
this
.
state
.
isAll
}
isType=
{
this
.
state
.
isType
}
templateList=
{
this
.
state
.
templateList
}
/>
</>
</>
)
}
)
}
</
Spin
>
</
Spin
>
{
this
.
state
.
serviceVisble
&&
(
<
ServiceGoods
visible=
{
this
.
state
.
serviceVisble
}
onChange=
{
this
.
serviceVisbleClose
}
SourceData=
{
this
.
state
.
serviceData
}
shopList=
{
this
.
shopList
}
categoryList=
{
this
.
state
.
treeData
}
virtualCategoryList=
{
this
.
state
.
virtualTreeData
}
specListData=
{
this
.
state
.
specListData
}
permissions=
{
permissions
}
isDraft=
{
this
.
state
.
isEditDraft
}
productType=
{
this
.
state
.
productType
}
takeAway=
{
this
.
state
.
takeAway
}
/>
)
}
{
this
.
state
.
visibleAuditModal
&&
(
<
InfoAudit
visible=
{
this
.
state
.
visibleAuditModal
}
skuInfo=
{
this
.
state
.
auditRow
}
canEditable=
{
this
.
canEditable
}
onCancel=
{
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
}
}
onEdit=
{
this
.
onEdit
}
/>
)
}
{
this
.
state
.
visibleUpdatePrice
&&
(
{
this
.
state
.
visibleUpdatePrice
&&
(
<
UpdatePriceStock
<
UpdatePriceStock
visible=
{
this
.
state
.
visibleUpdatePrice
}
visible=
{
this
.
state
.
visibleUpdatePrice
}
...
...
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