分类筛选+协议分页

This commit is contained in:
2024-05-16 15:47:55 +08:00
parent 840e8fe762
commit 1b845e5f2f
2 changed files with 277 additions and 155 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="mod-config">
<div class="mod-config" >
<el-form
:inline="true"
:model="dataForm"
@@ -12,6 +12,17 @@
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-select v-model="dataForm.goodsType" placeholder="请选择商品类型" clearable >
<el-option
v-for="item in goodsTypeList"
:key="item.dictType"
:label="item.dictValue"
:value="item.dictType"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
@click="
@@ -36,6 +47,7 @@
</el-form-item>
</el-form>
<el-table
height="70vh"
:data="dataList"
border
v-loading="dataListLoading"
@@ -183,7 +195,7 @@
<commonTags ref="commonTags"></commonTags>
<correlation ref="correlation"></correlation>
<choose-book v-if="chooseBookVisible" :bookIds = bookIds ref="chooseBook" :chooseBookVisible = chooseBookVisible @closeBookf = "closeBookf"></choose-book> -->
<choose-book v-if="chooseBookVisible" :bookIds = bookIds ref="chooseBook" :chooseBookVisible = chooseBookVisible @closeBookf = "closeBookf"></choose-book>
</div>
</template>
@@ -200,8 +212,9 @@ export default {
data() {
return {
dataForm: {
key: ""
},
key: "",
goodsType: "",
}, goodsTypeList: [],
dataList: [],
publishStatus: false,
pageIndex: 1,
@@ -224,8 +237,18 @@ export default {
},
activated() {
this.getDataList();
this.getGoodsTypeList();
},
methods: {
getGoodsTypeList() {
this.$http({
url: this.$http.adornUrl("/book/sysdictdata/selectByType/goodsType"),
method: "get"
}).then(({ data }) => {
// console.log(data.dataList)
this.goodsTypeList = data.dataList;
});
},
handleEditTags(id) {
this.$nextTick(() => {
this.$refs.commonTags.open(id);
@@ -251,18 +274,26 @@ export default {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/book/shopproduct/list"),
method: "get",
params: this.$http.adornParams({
page: this.pageIndex,
this.$http
.request({
url: this.$http.adornUrl(`/master/shopProduct/listByPage`),
method: "POST",
data: {
current: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
})
}).then(({ data }) => {
productName: this.dataForm.key,
goodsType: this.dataForm.goodsType
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
.then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list;
this.totalPage = data.page.totalCount;
this.dataList = data.result.records;
this.totalPage = data.result.pages;
} else {
this.dataList = [];
this.totalPage = 0;