|
@@ -0,0 +1,226 @@
|
|
|
+<template>
|
|
|
+ <div class="container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
+ <el-form-item label="会员类型名称" prop="tenantVipName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.tenantVipName"
|
|
|
+ placeholder="请输入会员类型名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ row-key="id"
|
|
|
+ style="width: 100%"
|
|
|
+ :maxHeight="tableHeight - 40"
|
|
|
+ v-loading="loading"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ @sort-change="sortChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" :reserve-selection="true" v-if="!choose"></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column v-if="choose" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-checkbox-group v-model="checkList1">
|
|
|
+ <el-checkbox :label="scope.row.id">{{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="tenantVipName" label="会员类型名称"></el-table-column>
|
|
|
+ <el-table-column prop="lastTime" label="持续时长"></el-table-column>
|
|
|
+ <el-table-column prop="createPersonName" label="创建人"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" label="创建时间"></el-table-column>
|
|
|
+ <el-table-column prop="remark" label="备注"></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleEdit(scope.row)"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.id != 0"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div>
|
|
|
+ <el-pagination background layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
|
|
|
+ @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+export default {
|
|
|
+
|
|
|
+ components: {},
|
|
|
+ props: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: false,
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ tableData: [],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ tenantVipName: undefined
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ tenantVipName: [
|
|
|
+ { required: true, message: "会员类型名称不能为空", trigger: "blur" }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {},
|
|
|
+ computed: {},
|
|
|
+ created() {},
|
|
|
+ mounted() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询vip列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ this.$api.getVipList(this.queryParams).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.tableData = response.data.records
|
|
|
+ this.total = response.data.total
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ }).catch(error=>{
|
|
|
+ this.tableData = []
|
|
|
+ this.total = 0
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd(row) {
|
|
|
+ this.$router.push('/administrator/addVip');
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm: function() {
|
|
|
+ this.open = false;
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ },
|
|
|
+ handleEdit(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/administrator/editVip',
|
|
|
+ query: {
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ handleDelete(row) {
|
|
|
+ this.removeVip([row.id]);
|
|
|
+ },
|
|
|
+ removeVip(ids,type){
|
|
|
+ this.$confirm('确认删除本条数据吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ var params = {
|
|
|
+ ids:ids,
|
|
|
+ }
|
|
|
+ this.$api.deleteVip(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.getList()
|
|
|
+ if(type){
|
|
|
+ this.multipleSelection = []
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ }else{
|
|
|
+ var id = response.data.data[0]
|
|
|
+ var index = this.multipleSelection.findIndex(item=>{
|
|
|
+ return item.id == id
|
|
|
+ })
|
|
|
+ if(index!=-1){
|
|
|
+ this.multipleSelection.splice(index,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }).catch(error=>{
|
|
|
+ this.$message.error('删除失败')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.container{
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.padding_20{
|
|
|
+ padding: 20px
|
|
|
+}
|
|
|
+::v-deep .el-table,
|
|
|
+.el-table__expanded-cell {
|
|
|
+ background-color: transparent;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-table tr {
|
|
|
+ background-color: transparent !important;
|
|
|
+}
|
|
|
+::v-deep .el-table__body td,::v-deep .el-table__header th,
|
|
|
+.el-table .cell {
|
|
|
+ background-color: transparent;
|
|
|
+}
|
|
|
+::v-deep .el-table::before {
|
|
|
+ //去除底部白线
|
|
|
+ left: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 0px;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|