初始项目

This commit is contained in:
liupopo
2023-02-11 12:55:02 +08:00
parent 1748bda84a
commit 0b89e36064
3363 changed files with 506201 additions and 1 deletions

View File

@@ -0,0 +1,229 @@
<template> 
<div class="app-container">
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="searchGiftsCategoryList()"
type="primary"
size="small">
查询结果
</el-button>
</div>
<div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索评论编号:">
<el-input style="width: 203px" v-model="listQuery.memberId" placeholder="评论编号"></el-input>
</el-form-item>
<el-form-item label="输入搜索商品编号:">
<el-input style="width: 203px" v-model="listQuery.goodsId" placeholder="商品编号"></el-input>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
</el-card>
<div class="table-container">
<el-table ref="giftsCategoryTable"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
v-loading="listLoading"
border>
<el-table-column type="selection" width="60" align="center"></el-table-column>
<el-table-column prop="id" label="编号">
<template slot-scope="scope">
{{scope.row.id }}
</template>
</el-table-column>
<el-table-column label="会员编号" align="center">
<template slot-scope="scope">{{scope.row.memberId}}</template>
</el-table-column>
<el-table-column label="评论人" align="center">
<template slot-scope="scope">{{scope.row.memberName}}</template>
</el-table-column>
<el-table-column label="商品名称" align="center">
<template slot-scope="scope">{{scope.row.goodsName}}</template>
</el-table-column>
<el-table-column label="商品ID" align="center">
<template slot-scope="scope">{{scope.row.goodsId}}</template>
</el-table-column>
<el-table-column label="评论内容" align="center">
<template slot-scope="scope">{{scope.row.consultContent}}</template>
</el-table-column>
<el-table-column label="创建时间" align="center">
<template slot-scope="scope">{{scope.row.consultAddtime |formatCreateTime}}</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="batch-operate-container">
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:current-page.sync="listQuery.pageNum"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import {fetchList,deleteGifts} from '@/api/pms/productConsult'
import {formatDate} from '@/utils/date';
export default {
name: 'giftsCategoryList',
data() {
return {
operateType: null,
listQuery: {
goodsId: null,
memberId: null,
pageNum: 1,
type:1,
pageSize: 10
},
list: null,
total: null,
listLoading: true,
multipleSelection: []
}
},
created() {
this.getList();
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
getList() {
this.listLoading = true;
fetchList(this.listQuery).then(response => {
this.listLoading = false;
this.list = response.data.records;
this.total = response.data.total;
this.totalPage = response.data.pages;
this.pageSize = response.data.size;
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleDelete(index, row) {
this.$confirm('是否要删除该评论', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteGifts(row.id).then(response => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1000
});
this.getList();
});
});
},
getProductList(index, row) {
console.log(index, row);
},
getProductCommentList(index, row) {
console.log(index, row);
},
handleSizeChange(val) {
this.listQuery.pageNum = 1;
this.listQuery.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.pageNum = val;
this.getList();
},
searchGiftsCategoryList() {
this.listQuery.pageNum = 1;
this.getList();
},
handleBatchOperate() {
console.log(this.multipleSelection);
if (this.multipleSelection < 1) {
this.$message({
message: '请选择一条记录',
type: 'warning',
duration: 1000
});
return;
}
let showStatus = 0;
if (this.operateType === 'showGiftsCategory') {
showStatus = 1;
} else if (this.operateType === 'hideGiftsCategory') {
showStatus = 0;
} else {
this.$message({
message: '请选择批量操作类型',
type: 'warning',
duration: 1000
});
return;
}
let ids = [];
for (let i = 0; i < this.multipleSelection.length; i++) {
ids.push(this.multipleSelection[i].id);
}
let data = new URLSearchParams();
data.append("ids", ids);
data.append("showStatus", showStatus);
updateShowStatus(data).then(response => {
this.getList();
this.$message({
message: '修改成功',
type: 'success',
duration: 1000
});
});
},
addGiftsCategory() {
this.$router.push({path: '/pms/addPmsGiftsCategory'})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>