feat: pad点单设置修复
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
<template>
|
||||
<el-dialog title="选择商品" top="5vh" v-model="dialogVisible">
|
||||
<el-dialog title="选择商品" top="5vh" v-model="dialogVisible" @close="resetHandle">
|
||||
<el-form :model="searhForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searhForm.name" placeholder="商品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searhForm.category" placeholder="商品分类" :disabled="disableCategory">
|
||||
<el-select
|
||||
style="width: 200px"
|
||||
v-model="searhForm.category"
|
||||
placeholder="商品分类"
|
||||
:disabled="disableCategory"
|
||||
>
|
||||
<el-option
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
@@ -110,7 +115,7 @@ export default {
|
||||
},
|
||||
categoryList: [],
|
||||
tableData: {
|
||||
page: 0,
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
@@ -131,14 +136,14 @@ export default {
|
||||
this.$emit("success", res);
|
||||
this.close();
|
||||
},
|
||||
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.searhForm.name = "";
|
||||
this.searhForm.category = "";
|
||||
this.tableData.page = 0;
|
||||
this.tableData.page = 1;
|
||||
this.tableData.size = 10;
|
||||
this.tableData.list = [];
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
@@ -147,7 +152,7 @@ export default {
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.tableData.page = e;
|
||||
this.getTableData();
|
||||
},
|
||||
// 商品列表
|
||||
@@ -160,8 +165,8 @@ export default {
|
||||
name: this.searhForm.name,
|
||||
categoryId: this.searhForm.category,
|
||||
});
|
||||
this.tableData.list = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
this.tableData.list = res.records;
|
||||
this.tableData.total = res.totalRow;
|
||||
|
||||
if (this.goods.length) {
|
||||
this.$nextTick(() => {
|
||||
@@ -179,10 +184,10 @@ export default {
|
||||
async tbShopCategoryGet() {
|
||||
try {
|
||||
const res = await paoductCategoryApi.getPage({
|
||||
page: 0,
|
||||
size: 100,
|
||||
page: 1,
|
||||
size: 600,
|
||||
});
|
||||
this.categoryList = res.content;
|
||||
this.categoryList = res.records;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -194,17 +199,12 @@ export default {
|
||||
} else {
|
||||
this.goods = [];
|
||||
}
|
||||
this.resetHandle();
|
||||
|
||||
console.log(categoryId);
|
||||
|
||||
if (categoryId) {
|
||||
this.searhForm.category = categoryId;
|
||||
}
|
||||
|
||||
console.log(this.searhForm);
|
||||
|
||||
await this.tbShopCategoryGet();
|
||||
|
||||
await this.getTableData();
|
||||
},
|
||||
close() {
|
||||
|
||||
Reference in New Issue
Block a user