|
@@ -5,14 +5,14 @@
|
|
商品分类管理
|
|
商品分类管理
|
|
</h2>
|
|
</h2>
|
|
<div class="m-core">
|
|
<div class="m-core">
|
|
- <!-- <el-button
|
|
|
|
|
|
+ <el-button
|
|
v-permission="'category/upset'"
|
|
v-permission="'category/upset'"
|
|
@click="openTypes('create')"
|
|
@click="openTypes('create')"
|
|
type="primary"
|
|
type="primary"
|
|
style="margin-bottom:20px"
|
|
style="margin-bottom:20px"
|
|
>
|
|
>
|
|
添加
|
|
添加
|
|
- </el-button> -->
|
|
|
|
|
|
+ </el-button>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<div class="tableWrap">
|
|
<div class="tableWrap">
|
|
<el-table
|
|
<el-table
|
|
@@ -37,23 +37,23 @@
|
|
type="text"
|
|
type="text"
|
|
>修改</el-button
|
|
>修改</el-button
|
|
>
|
|
>
|
|
- <!-- <el-button
|
|
|
|
|
|
+ <el-button
|
|
@click="onTypesDelOpeation(scope.row)"
|
|
@click="onTypesDelOpeation(scope.row)"
|
|
v-permission="'category/del'"
|
|
v-permission="'category/del'"
|
|
type="text"
|
|
type="text"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
- > -->
|
|
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <!-- <pagination
|
|
|
|
|
|
+ <pagination
|
|
sync
|
|
sync
|
|
:total.sync="pageInfo.total"
|
|
:total.sync="pageInfo.total"
|
|
:page.sync="pageInfo.page"
|
|
:page.sync="pageInfo.page"
|
|
:limit.sync="pageInfo.limit"
|
|
:limit.sync="pageInfo.limit"
|
|
:page-sizes="pageInfo.page_size"
|
|
:page-sizes="pageInfo.page_size"
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
- /> -->
|
|
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<el-dialog
|
|
<el-dialog
|
|
@@ -206,20 +206,19 @@ export default {
|
|
page: this.pageInfo.page
|
|
page: this.pageInfo.page
|
|
}).then(res => {
|
|
}).then(res => {
|
|
let result = res.data;
|
|
let result = res.data;
|
|
- console.log(result, "res,", res);
|
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- result.forEach(row => {
|
|
|
|
|
|
+ result.rows.forEach(row => {
|
|
let subjectname = [],
|
|
let subjectname = [],
|
|
subjectIds = [];
|
|
subjectIds = [];
|
|
- (row.subjects || []).forEach(item => {
|
|
|
|
|
|
+ row.subjects.forEach(item => {
|
|
subjectname.push(item.name);
|
|
subjectname.push(item.name);
|
|
subjectIds.push(item.id);
|
|
subjectIds.push(item.id);
|
|
});
|
|
});
|
|
row.subjectName = subjectname;
|
|
row.subjectName = subjectname;
|
|
row.subjectIds = subjectIds;
|
|
row.subjectIds = subjectIds;
|
|
});
|
|
});
|
|
- this.tableList = result;
|
|
|
|
- // this.pageInfo.total = result.total;
|
|
|
|
|
|
+ this.tableList = result.rows;
|
|
|
|
+ this.pageInfo.total = result.total;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -252,10 +251,9 @@ export default {
|
|
let result = res.data;
|
|
let result = res.data;
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
let tempArray = [];
|
|
let tempArray = [];
|
|
-
|
|
|
|
- (result.rows || []).forEach((item, index) => {
|
|
|
|
|
|
+ result.rows.forEach((item, index) => {
|
|
let subject = [];
|
|
let subject = [];
|
|
- (item.subjects || []).forEach(s => {
|
|
|
|
|
|
+ item.subjects.forEach(s => {
|
|
subject.push({
|
|
subject.push({
|
|
value: s.id,
|
|
value: s.id,
|
|
label: s.name
|
|
label: s.name
|
|
@@ -268,7 +266,6 @@ export default {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
this.subjectList = tempArray;
|
|
this.subjectList = tempArray;
|
|
- console.log(this.subjectList, "12");
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|