Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
develop-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7c59048c
authored
Nov 13, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商品管理-导出
1 parent
4f64e075
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
src/views/goods/commodity.vue
src/views/goods/commodity.vue
View file @
7c59048
...
@@ -108,8 +108,7 @@
...
@@ -108,8 +108,7 @@
<
script
>
<
script
>
import
{
getList
,
exportBaseList
}
from
'@api/commodity'
import
{
getList
,
exportBaseList
}
from
'@api/commodity'
import
{
BaseData
}
from
'@/common/constants.js'
import
{
BaseData
}
from
'@/common/constants.js'
import
Blob
from
'@/common/Blob.js'
import
{
export_json_to_excel
}
from
'@/common/Export2Excel.js'
import
Export2Excel
from
'@/common/Export2Excel.js'
import
{
mapActions
}
from
'vuex'
import
{
mapActions
}
from
'vuex'
import
_
from
'lodash'
import
_
from
'lodash'
import
storeDetail
from
'./storeDetail'
import
storeDetail
from
'./storeDetail'
...
@@ -153,7 +152,7 @@ export default {
...
@@ -153,7 +152,7 @@ export default {
prop
:
'brandMerchantName'
prop
:
'brandMerchantName'
},
{
},
{
label
:
'属性'
,
label
:
'属性'
,
prop
:
'attr'
prop
:
'attr
ibute
'
},
{
},
{
label
:
'关联商品数'
,
label
:
'关联商品数'
,
prop
:
'upgradeGoodsNum'
prop
:
'upgradeGoodsNum'
...
@@ -162,12 +161,13 @@ export default {
...
@@ -162,12 +161,13 @@ export default {
prop
:
'merchantNum'
prop
:
'merchantNum'
},
{
},
{
label
:
'产品状态'
,
label
:
'产品状态'
,
prop
:
'
state
'
,
prop
:
'
goodsStatus
'
,
formatter
:
(
cellValue
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
{
// return {
0
:
'上架'
,
// 0: '上架',
1
:
'下架'
// 1: '下架'
}[
cellValue
.
state
]
// }[cellValue.state]
return
'上架'
}
}
},
{
},
{
label
:
'创建时间'
,
label
:
'创建时间'
,
...
@@ -223,13 +223,19 @@ export default {
...
@@ -223,13 +223,19 @@ export default {
})
})
},
},
handleExport
()
{
handleExport
()
{
const
tHeader
=
[
'商品ID'
,
'商品名称'
,
'分类'
,
'品牌商'
]
const
tHeader
=
[
'商品ID'
,
'商品名称'
,
'分类'
,
'品牌商'
,
'属性'
,
'关联商品数'
,
'关联商户数'
,
'产品状态'
,
'创建时间'
]
const
fieldVal
=
[
'goodsCode'
,
'goodsName'
,
'goodsTypeName'
,
'brandMerchantName'
]
const
fieldVal
=
[
'goodsCode'
,
'goodsName'
,
'goodsTypeName'
,
'brandMerchantName'
,
'attribute'
,
'upgradeGoodsNum'
,
'merchantNum'
,
'goodsStatus'
,
'createdDate'
]
exportBaseList
(
this
.
searchForm
).
then
(
res
=>
{
exportBaseList
(
this
.
searchForm
).
then
(
res
=>
{
console
.
log
(
res
)
// console.log(res)
// const exportData = this.
require
.
ensure
([],
()
=>
{
const
data
=
this
.
formatJson
(
fieldVal
,
res
)
export_json_to_excel
(
tHeader
,
data
,
'基础商品列表'
)
})
})
})
},
},
formatJson
(
filterVal
,
jsonData
)
{
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
v
[
j
]))
},
handleEdit
(
row
)
{
handleEdit
(
row
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'editCommodity'
,
name
:
'editCommodity'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment