|
@@ -44,11 +44,28 @@
|
44
|
44
|
</div>
|
45
|
45
|
<div class="system-table-box">
|
46
|
46
|
<el-table :data="goods.list" stripe style="width: 100%">
|
47
|
|
- <el-table-column prop="RoleName" label="角色名">
|
|
47
|
+ <el-table-column prop="GoodsName" label="商品名称">
|
48
|
48
|
</el-table-column>
|
49
|
|
- <el-table-column label="创建时间" width="300">
|
|
49
|
+ <el-table-column label="图片" width="300">
|
50
|
50
|
<template slot-scope="scope">
|
51
|
|
- <label>{{FormatDate(scope.row.CreateDate)}}</label>
|
|
51
|
+ <img :src="(scope.row.Images[0] || {}).ImgUrl" style="width:200px;" />
|
|
52
|
+ </template>
|
|
53
|
+ </el-table-column>
|
|
54
|
+ <el-table-column prop="Price" label="价格">
|
|
55
|
+ </el-table-column>
|
|
56
|
+ <el-table-column label="类型">
|
|
57
|
+ <template slot-scope="scope">
|
|
58
|
+ <label>{{getTypeName(scope.row.TypeId)}}</label>
|
|
59
|
+ </template>
|
|
60
|
+ </el-table-column>
|
|
61
|
+ <el-table-column label="规格">
|
|
62
|
+ <template slot-scope="scope">
|
|
63
|
+ <label>{{getSpecNames(scope.row.Specs)}}</label>
|
|
64
|
+ </template>
|
|
65
|
+ </el-table-column>
|
|
66
|
+ <el-table-column label="案场">
|
|
67
|
+ <template slot-scope="scope">
|
|
68
|
+ <label>{{getCaseName(scope.row.CaseId)}}</label>
|
52
|
69
|
</template>
|
53
|
70
|
</el-table-column>
|
54
|
71
|
<el-table-column fixed='right' label="操作" width="300">
|
|
@@ -117,7 +134,17 @@ export default {
|
117
|
134
|
...mapGoodsActions([
|
118
|
135
|
'GetGoodsList',
|
119
|
136
|
'GetGoodTypes',
|
|
137
|
+ 'DelGoods',
|
120
|
138
|
]),
|
|
139
|
+ getTypeName (typeid) {
|
|
140
|
+ return (this.types.list.filter(x => x.TypeId === typeid)[0] || {}).TypeName
|
|
141
|
+ },
|
|
142
|
+ getSpecNames (specs) {
|
|
143
|
+ return (specs || []).map(x => x.SpecName).join(',')
|
|
144
|
+ },
|
|
145
|
+ getCaseName (caseid) {
|
|
146
|
+ return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
|
|
147
|
+ },
|
121
|
148
|
search () { // 搜索
|
122
|
149
|
this.postData.page = 1
|
123
|
150
|
this.currentList = []
|
|
@@ -130,23 +157,23 @@ export default {
|
130
|
157
|
console.log(`每页 ${val} 条`)
|
131
|
158
|
},
|
132
|
159
|
handleCurrentChange (val) {
|
133
|
|
- this.GetRolesList({ page: val })
|
134
|
|
- console.log(`当前页: ${val}`)
|
|
160
|
+ this.postData.page = this.currentPage
|
|
161
|
+ this.getList()
|
135
|
162
|
},
|
136
|
163
|
handleEdit (index, row) {
|
137
|
164
|
// 编辑
|
138
|
|
- this.$router.push({ name: 'editGoods', query: { id: row.GooddId } })
|
|
165
|
+ this.$router.push({ name: 'editGoods', query: { id: row.GoodsId } })
|
139
|
166
|
},
|
140
|
167
|
handleDelete (index, row) {
|
141
|
168
|
// 删除
|
142
|
169
|
console.log(index, row)
|
143
|
|
- this.$confirm('确认删除此角色?', '提示', {
|
|
170
|
+ this.$confirm('确认删除此商品?', '提示', {
|
144
|
171
|
confirmButtonText: '确定',
|
145
|
172
|
cancelButtonText: '取消',
|
146
|
173
|
type: 'warning'
|
147
|
174
|
})
|
148
|
175
|
.then(() => {
|
149
|
|
- this.DelRole({id: row.RoleId, callback: this.delCallBack})
|
|
176
|
+ this.DelGoods({id: row.GoodsId, callback: this.delCallBack})
|
150
|
177
|
})
|
151
|
178
|
.catch(() => {
|
152
|
179
|
this.$message({
|
|
@@ -166,7 +193,7 @@ export default {
|
166
|
193
|
this.$router.push({ name: 'editGoods' })
|
167
|
194
|
},
|
168
|
195
|
},
|
169
|
|
- mounted () {
|
|
196
|
+ created () {
|
170
|
197
|
this.GetGoodTypes({ pagesize: 1000, caseid: this.CaseId })
|
171
|
198
|
this.$nextTick(function () {
|
172
|
199
|
this.getList()
|