Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
aiot-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 15dfa52d
authored
Nov 27, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
4f213c56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
237 additions
and
39 deletions
src/views/goods/aa.vue
src/views/goods/product.vue
src/views/goods/aa.vue
0 → 100644
View file @
15dfa52
<!-- 产品管理 -->
<
template
>
<d2-container
class=
"product"
>
<el-form
:inline=
"true"
v-model=
"searchForm"
label-width=
"85px"
slot=
"header"
>
<el-form-item
label=
"产品名称"
>
<el-input
v-model=
"searchForm.goodsName"
placeholder=
"请输入产品名称"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"分类"
>
<el-select
v-model=
"searchForm.goodsType"
placeholder=
"请选择产品分类"
>
<el-option
v-for=
"item in baseData.productTypeList"
:key=
"item.goodsType"
:value=
"item.goodsType"
:label=
"item.goodsTypeName"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"品牌商"
>
<el-select
v-model=
"searchForm.brandMerchantCode"
placeholder=
"请选择品牌商"
>
<el-option
v-for=
"item in baseData.brandList"
:key=
"item.confId"
:label=
"item.confValue"
:value=
"item.confId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
:id=
"tableParams.btnId"
type=
"primary"
icon=
"el-icon-search"
>
查询
</el-button>
<el-button
@
click=
"handleReset"
>
重置
</el-button>
</el-form-item>
</el-form>
<d2-table-header>
<auth-button
category=
"Button"
:data=
"editFormReset"
></auth-button>
</d2-table-header>
<d2-table
ref=
"productTable"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:beforeSearchFn=
"beforeSearchFn"
>
<img
slot=
"img"
slot-scope=
"scope"
class=
"pro-img"
:src=
"scope.scope.thumbUrl"
/>
<auth-button
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
></auth-button>
</d2-table>
</d2-container>
</
template
>
<
script
>
import
_
from
'lodash'
import
{
getList
}
from
'@api/product'
import
{
BaseData
,
brandMerchantList
}
from
'@/common/constants.js'
import
{
mapActions
}
from
'vuex'
export
default
{
name
:
'product'
,
data
()
{
return
{
searchForm
:
{
goodsName
:
''
,
goodsType
:
''
,
brandMerchantCode
:
''
},
editFormReset
:
{
aa
:
''
},
getListApi
:
getList
,
// 表格参数
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
tableOption
:
true
,
tableColumns
:
[{
label
:
'缩略图'
,
prop
:
'thumbUrl'
,
addHtml
:
'img'
},
{
label
:
'产品名称'
,
prop
:
'goodsName'
},
{
label
:
'产品ID'
,
prop
:
'id'
},
{
label
:
'分类'
,
prop
:
'goodsTypeName'
},
{
label
:
'品牌商'
,
prop
:
'brandMerchantName'
},
{
label
:
'创建时间'
,
prop
:
'createDateStr'
},
{
label
:
'产品状态'
,
prop
:
'state'
,
formatter
:
(
cellValue
)
=>
{
// return {
// 0: '上架',
// 1: '下架'
// }[cellValue.state]
return
'上架'
}
}]
},
// 查看门店
detailVisible
:
false
,
// 基本数据
baseData
:
{
productTypeList
:
[],
brandList
:
[]
}
}
},
mounted
()
{
// this.getProductType()
this
.
getBaseData
()
// console.log(storeDetail)
// var allOpt = { confId: '', confKey: '全部' }
// this.baseData.product.unshift(allOpt)
// this.baseData.brandList.unshift(allOpt)
this
.
baseData
.
brandList
=
_
.
cloneDeep
(
brandMerchantList
)
var
allOpt
=
{
confId
:
''
,
confValue
:
'全部'
}
this
.
baseData
.
brandList
.
unshift
(
allOpt
)
},
methods
:
{
// getProductType(){
// let prarms = {}
// getType(prarms).then(res => {
// this.baseData.productTypeList = res || []
// });
// },
...
mapActions
(
'd2admin/base'
,
[
'get'
]),
async
getBaseData
()
{
this
.
baseData
.
productTypeList
=
_
.
cloneDeep
(
await
this
.
get
(
BaseData
.
productType
))
this
.
baseData
.
productTypeList
.
unshift
({
goodsType
:
''
,
goodsTypeName
:
'全部'
})
},
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
'搜索前操作--'
)
resolve
()
})
},
handleReset
()
{
this
.
searchForm
=
{
goodsName
:
''
,
goodsType
:
''
,
brandMerchantCode
:
''
}
},
handleAdd
(
form
)
{
// console.log(form)
this
.
$router
.
push
({
name
:
'editProduct'
,
params
:
{
addOrEdit
:
'add'
,
form
:
form
}
})
},
// handleExport() { },
handleEdit
(
row
)
{
// console.log(row)
this
.
$router
.
push
({
name
:
'editProduct'
,
params
:
{
addOrEdit
:
'edit'
,
form
:
row
}
})
},
handleDetail
(
row
)
{
this
.
detailData
=
row
this
.
detailVisible
=
true
},
handleDetailClose
()
{
this
.
detailVisible
=
false
}
}
}
</
script
>
<
style
scoped
>
.product
.pro-img
{
width
:
80px
;
height
:
80px
;
}
</
style
>
src/views/goods/product.vue
View file @
15dfa52
...
@@ -18,12 +18,13 @@
...
@@ -18,12 +18,13 @@
<el-select
<el-select
v-model=
"searchForm.goodsType"
v-model=
"searchForm.goodsType"
placeholder=
"请选择产品分类"
placeholder=
"请选择产品分类"
clearable
>
>
<el-option
<el-option
v-for=
"item in baseData.
productTypeList
"
v-for=
"item in baseData.
goodsType
"
:key=
"item.goodsType"
:key=
"item.goodsType"
:value=
"item.goodsType"
:label=
"item.goodsTypeName"
:label=
"item.goodsTypeName"
:value=
"item.goodsType"
></el-option>
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -66,7 +67,7 @@
...
@@ -66,7 +67,7 @@
slot=
"img"
slot=
"img"
slot-scope=
"scope"
slot-scope=
"scope"
class=
"pro-img"
class=
"pro-img"
:src=
"scope.scope.thumbUrl"
:src=
"scope.scope.
goodsInfo.
thumbUrl"
/>
/>
<auth-button
<auth-button
slot=
"auth-button"
slot=
"auth-button"
...
@@ -78,10 +79,10 @@
...
@@ -78,10 +79,10 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
_
from
'lodash'
import
{
getList
}
from
'@api/product'
import
{
getList
}
from
'@api/product'
import
{
BaseData
,
brandMerchantList
}
from
'@/common/constants.js'
import
{
BaseData
,
brandMerchantList
}
from
'@/common/constants.js'
import
{
mapActions
}
from
'vuex'
import
{
mapActions
}
from
'vuex'
import
_
from
'lodash'
export
default
{
export
default
{
name
:
'product'
,
name
:
'product'
,
data
()
{
data
()
{
...
@@ -131,44 +132,30 @@ export default {
...
@@ -131,44 +132,30 @@ export default {
}
}
}]
}]
},
},
// 查看门店
detailVisible
:
false
,
// 基本数据
// 基本数据
baseData
:
{
baseData
:
{
productTypeList
:
[],
goodsType
:
[],
brandList
:
[]
brandList
:
[]
}
}
}
}
},
},
mounted
()
{
mounted
()
{
// this.getProductType()
this
.
getBaseData
()
this
.
getBaseData
()
// console.log(storeDetail)
// var allOpt = { confId: '', confKey: '全部' }
// this.baseData.product.unshift(allOpt)
// this.baseData.brandList.unshift(allOpt)
this
.
baseData
.
brandList
=
_
.
cloneDeep
(
brandMerchantList
)
this
.
baseData
.
brandList
=
_
.
cloneDeep
(
brandMerchantList
)
var
allOpt
=
{
confId
:
''
,
confValue
:
'全部'
}
var
allOpt
=
{
confId
:
''
,
confValue
:
'全部'
}
this
.
baseData
.
brandList
.
unshift
(
allOpt
)
this
.
baseData
.
brandList
.
unshift
(
allOpt
)
},
},
methods
:
{
methods
:
{
// getProductType(){
// let prarms = {}
// getType(prarms).then(res => {
// this.baseData.productTypeList = res || []
// });
// },
...
mapActions
(
'd2admin/base'
,
[
'get'
]),
...
mapActions
(
'd2admin/base'
,
[
'get'
]),
async
getBaseData
()
{
async
getBaseData
()
{
this
.
baseData
.
productTypeList
=
_
.
cloneDeep
(
await
this
.
get
(
BaseData
.
productType
))
this
.
baseData
.
goodsType
=
_
.
cloneDeep
(
await
this
.
get
(
BaseData
.
productType
))
this
.
baseData
.
productTypeList
.
unshift
({
this
.
baseData
.
goodsType
.
unshift
({
goodsType
:
''
,
goodsType
:
''
,
goodsTypeName
:
'全部'
goodsTypeName
:
'全部'
})
})
},
},
beforeSearchFn
()
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
'搜索前操作--'
)
console
.
log
(
'搜索前操作--'
)
...
@@ -176,39 +163,28 @@ export default {
...
@@ -176,39 +163,28 @@ export default {
})
})
},
},
handleReset
()
{
handleReset
()
{
this
.
searchForm
=
{
var
keys
=
Object
.
keys
(
this
.
searchForm
)
goodsName
:
''
,
keys
.
forEach
(
item
=>
{
goodsType
:
''
,
this
.
searchForm
[
item
]
=
''
brandMerchantCode
:
''
})
}
},
},
handleAdd
(
form
)
{
handleAdd
(
form
)
{
// console.log(form)
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'edit
P
roduct'
,
name
:
'edit
p
roduct'
,
params
:
{
params
:
{
addOrEdit
:
'add'
,
addOrEdit
:
'add'
,
form
:
form
form
:
form
}
}
})
})
},
},
// handleExport() { },
handleEdit
(
row
)
{
handleEdit
(
row
)
{
// console.log(row)
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'edit
P
roduct'
,
name
:
'edit
p
roduct'
,
params
:
{
params
:
{
addOrEdit
:
'edit'
,
addOrEdit
:
'edit'
,
form
:
row
row
:
row
}
}
})
})
},
handleDetail
(
row
)
{
this
.
detailData
=
row
this
.
detailVisible
=
true
},
handleDetailClose
()
{
this
.
detailVisible
=
false
}
}
}
}
}
}
...
...
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