Commit f74cd1d4 by 吕明尚

月卡,次卡后台管理系统

parent b5398f33
import request from '@/utils/request'
// 查询用户月卡列表
export function listConsumerMonthlyCard(query) {
return request({
url: '/system/consumerMonthlyCard/list',
method: 'get',
params: query
})
}
// 查询用户月卡详细
export function getConsumerMonthlyCard(id) {
return request({
url: '/system/consumerMonthlyCard/' + id,
method: 'get'
})
}
// 新增用户月卡
export function addConsumerMonthlyCard(data) {
return request({
url: '/system/consumerMonthlyCard',
method: 'post',
data: data
})
}
// 修改用户月卡
export function updateConsumerMonthlyCard(data) {
return request({
url: '/system/consumerMonthlyCard',
method: 'put',
data: data
})
}
// 删除用户月卡
export function delConsumerMonthlyCard(id) {
return request({
url: '/system/consumerMonthlyCard/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询用户次卡列表
export function listConsumerSecondaryCard(query) {
return request({
url: '/system/consumerSecondaryCard/list',
method: 'get',
params: query
})
}
// 查询用户次卡详细
export function getConsumerSecondaryCard(id) {
return request({
url: '/system/consumerSecondaryCard/' + id,
method: 'get'
})
}
// 新增用户次卡
export function addConsumerSecondaryCard(data) {
return request({
url: '/system/consumerSecondaryCard',
method: 'post',
data: data
})
}
// 修改用户次卡
export function updateConsumerSecondaryCard(data) {
return request({
url: '/system/consumerSecondaryCard',
method: 'put',
data: data
})
}
// 删除用户次卡
export function delConsumerSecondaryCard(id) {
return request({
url: '/system/consumerSecondaryCard/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询月卡配置列表
export function listMonthlyCardConf(query) {
return request({
url: '/system/monthlyCardConf/list',
method: 'get',
params: query
})
}
// 查询月卡配置详细
export function getMonthlyCardConf(id) {
return request({
url: '/system/monthlyCardConf/' + id,
method: 'get'
})
}
// 新增月卡配置
export function addMonthlyCardConf(data) {
return request({
url: '/system/monthlyCardConf',
method: 'post',
data: data
})
}
// 修改月卡配置
export function updateMonthlyCardConf(data) {
return request({
url: '/system/monthlyCardConf',
method: 'put',
data: data
})
}
// 删除月卡配置
export function delMonthlyCardConf(id) {
return request({
url: '/system/monthlyCardConf/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询月卡使用记录列表
export function listMonthlyCardLog(query) {
return request({
url: '/system/monthlyCardLog/list',
method: 'get',
params: query
})
}
// 查询月卡使用记录详细
export function getMonthlyCardLog(id) {
return request({
url: '/system/monthlyCardLog/' + id,
method: 'get'
})
}
// 新增月卡使用记录
export function addMonthlyCardLog(data) {
return request({
url: '/system/monthlyCardLog',
method: 'post',
data: data
})
}
// 修改月卡使用记录
export function updateMonthlyCardLog(data) {
return request({
url: '/system/monthlyCardLog',
method: 'put',
data: data
})
}
// 删除月卡使用记录
export function delMonthlyCardLog(id) {
return request({
url: '/system/monthlyCardLog/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询月卡订单列表
export function listMonthlyCardOrder(query) {
return request({
url: '/system/monthlyCardOrder/list',
method: 'get',
params: query
})
}
// 查询月卡订单详细
export function getMonthlyCardOrder(id) {
return request({
url: '/system/monthlyCardOrder/' + id,
method: 'get'
})
}
// 新增月卡订单
export function addMonthlyCardOrder(data) {
return request({
url: '/system/monthlyCardOrder',
method: 'post',
data: data
})
}
// 修改月卡订单
export function updateMonthlyCardOrder(data) {
return request({
url: '/system/monthlyCardOrder',
method: 'put',
data: data
})
}
// 删除月卡订单
export function delMonthlyCardOrder(id) {
return request({
url: '/system/monthlyCardOrder/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询次卡配置列表
export function listSecondaryCardConf(query) {
return request({
url: '/system/secondaryCardConf/list',
method: 'get',
params: query
})
}
// 查询次卡配置详细
export function getSecondaryCardConf(id) {
return request({
url: '/system/secondaryCardConf/' + id,
method: 'get'
})
}
// 新增次卡配置
export function addSecondaryCardConf(data) {
return request({
url: '/system/secondaryCardConf',
method: 'post',
data: data
})
}
// 修改次卡配置
export function updateSecondaryCardConf(data) {
return request({
url: '/system/secondaryCardConf',
method: 'put',
data: data
})
}
// 删除次卡配置
export function delSecondaryCardConf(id) {
return request({
url: '/system/secondaryCardConf/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询次卡使用记录列表
export function listSecondaryCardLog(query) {
return request({
url: '/system/secondaryCardLog/list',
method: 'get',
params: query
})
}
// 查询次卡使用记录详细
export function getSecondaryCardLog(id) {
return request({
url: '/system/secondaryCardLog/' + id,
method: 'get'
})
}
// 新增次卡使用记录
export function addSecondaryCardLog(data) {
return request({
url: '/system/secondaryCardLog',
method: 'post',
data: data
})
}
// 修改次卡使用记录
export function updateSecondaryCardLog(data) {
return request({
url: '/system/secondaryCardLog',
method: 'put',
data: data
})
}
// 删除次卡使用记录
export function delSecondaryCardLog(id) {
return request({
url: '/system/secondaryCardLog/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询次卡购买记录列表
export function listSecondaryCardOrder(query) {
return request({
url: '/system/secondaryCardOrder/list',
method: 'get',
params: query
})
}
// 查询次卡购买记录详细
export function getSecondaryCardOrder(id) {
return request({
url: '/system/secondaryCardOrder/' + id,
method: 'get'
})
}
// 新增次卡购买记录
export function addSecondaryCardOrder(data) {
return request({
url: '/system/secondaryCardOrder',
method: 'post',
data: data
})
}
// 修改次卡购买记录
export function updateSecondaryCardOrder(data) {
return request({
url: '/system/secondaryCardOrder',
method: 'put',
data: data
})
}
// 删除次卡购买记录
export function delSecondaryCardOrder(id) {
return request({
url: '/system/secondaryCardOrder/' + id,
method: 'delete'
})
}
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-form-item label="月卡配置表id" prop="monthlyCardConfId">
<el-input
v-model="queryParams.monthlyCardConfId"
clearable
placeholder="请输入月卡配置表id"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input
v-model="queryParams.consumerId"
clearable
placeholder="请输入用户ID"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入用户手机号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="免费时长" prop="freeDuration">
<el-input
v-model="queryParams.freeDuration"
clearable
placeholder="请输入免费时长"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月卡天数" prop="monthlyCardDays">
<el-input
v-model="queryParams.monthlyCardDays"
clearable
placeholder="请输入月卡天数"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="次卡有效期" prop="expirationDate">
<el-date-picker v-model="queryParams.expirationDate"
clearable
placeholder="请选择次卡有效期"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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
v-hasPermi="['system:consumerMonthlyCard:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:consumerMonthlyCard:edit']"
:disabled="single"
icon="el-icon-edit"
plain
size="mini"
type="success"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:consumerMonthlyCard:remove']"
:disabled="multiple"
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:consumerMonthlyCard:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="consumerMonthlyCardList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<!-- <el-table-column label="月卡配置表id" align="center" prop="monthlyCardConfId" />-->
<!-- <el-table-column label="用户ID" align="center" prop="consumerId" />-->
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户头像" prop="avatar" width="100">
<template slot-scope="scope">
<image-preview :height="50" :src="scope.row.avatar" :width="50"/>
</template>
</el-table-column>
<el-table-column align="center" label="用户手机号" prop="phone"/>
<el-table-column align="center" label="用户手机号" prop="phone"/>
<el-table-column align="center" label="月卡名称" prop="confName"/>
<el-table-column align="center" label="月卡金额" prop="confAmount"/>
<el-table-column align="center" label="免费时长" prop="freeDuration"/>
<el-table-column align="center" label="月卡天数" prop="monthlyCardDays"/>
<el-table-column align="center" label="次卡有效期" prop="expirationDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.expirationDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['system:consumerMonthlyCard:edit']"
icon="el-icon-edit"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
v-hasPermi="['system:consumerMonthlyCard:remove']"
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改用户月卡对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="月卡配置表id" prop="monthlyCardConfId">
<el-input v-model="form.monthlyCardConfId" placeholder="请输入月卡配置表id"/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input v-model="form.consumerId" placeholder="请输入用户ID"/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入用户手机号"/>
</el-form-item>
<el-form-item label="免费时长" prop="freeDuration">
<el-input v-model="form.freeDuration" placeholder="请输入免费时长"/>
</el-form-item>
<el-form-item label="月卡天数" prop="monthlyCardDays">
<el-input v-model="form.monthlyCardDays" placeholder="请输入月卡天数"/>
</el-form-item>
<el-form-item label="次卡有效期" prop="expirationDate">
<el-date-picker v-model="form.expirationDate"
clearable
placeholder="请选择次卡有效期"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listConsumerMonthlyCard,
getConsumerMonthlyCard,
delConsumerMonthlyCard,
addConsumerMonthlyCard,
updateConsumerMonthlyCard
} from "@/api/system/consumerMonthlyCard";
export default {
name: "ConsumerMonthlyCard",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户月卡表格数据
consumerMonthlyCardList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
monthlyCardConfId: null,
consumerId: null,
phone: null,
freeDuration: null,
monthlyCardDays: null,
expirationDate: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
monthlyCardConfId: [
{required: true, message: "月卡配置表id不能为空", trigger: "blur"}
],
consumerId: [
{required: true, message: "用户ID不能为空", trigger: "blur"}
],
phone: [
{required: true, message: "用户手机号不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询用户月卡列表 */
getList() {
this.loading = true;
listConsumerMonthlyCard(this.queryParams).then(response => {
this.consumerMonthlyCardList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
monthlyCardConfId: null,
consumerId: null,
phone: null,
freeDuration: null,
monthlyCardDays: null,
expirationDate: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加用户月卡";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getConsumerMonthlyCard(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改用户月卡";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateConsumerMonthlyCard(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addConsumerMonthlyCard(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除用户月卡编号为"' + ids + '"的数据项?').then(function () {
return delConsumerMonthlyCard(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/consumerMonthlyCard/export', {
...this.queryParams
}, `consumerMonthlyCard_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="85px" size="small">
<el-form-item label="用户手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入用户手机号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:consumerSecondaryCard:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:consumerSecondaryCard:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:consumerSecondaryCard:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
v-hasPermi="['system:consumerSecondaryCard:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="consumerSecondaryCardList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<!-- <el-table-column label="次卡配置表id" align="center" prop="secondaryCardConfId" />-->
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户头像" prop="avatar" width="100">
<template slot-scope="scope">
<image-preview :height="50" :src="scope.row.avatar" :width="50"/>
</template>
</el-table-column>
<el-table-column align="center" label="用户手机号" prop="phone"/>
<el-table-column align="center" label="次卡名称" prop="confName"/>
<el-table-column align="center" label="次卡金额" prop="confAmount"/>
<!-- <el-table-column label="用户ID" align="center" prop="consumerId" />-->
<!-- <el-table-column label="用户手机号" align="center" prop="phone" />-->
<!-- <el-table-column label="套餐id" align="center" prop="packId" />-->
<el-table-column align="center" label="套餐名称" prop="packName"/>
<el-table-column align="center" label="套餐金额" prop="packPrice"/>
<el-table-column align="center" label="次卡有效期" prop="expirationDate"/>
<el-table-column align="center" label="次卡次数" prop="number"/>
<!-- <el-table-column label="删除标记:1-删除,0-正常" align="center" prop="isDelete" />-->
<el-table-column align="center" label="备注" prop="remark"/>
<!-- <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="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:consumerSecondaryCard:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:consumerSecondaryCard:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改用户次卡对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="次卡配置表id" prop="secondaryCardConfId">
<el-input v-model="form.secondaryCardConfId" placeholder="请输入次卡配置表id"/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input v-model="form.consumerId" placeholder="请输入用户ID"/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入用户手机号"/>
</el-form-item>
<el-form-item label="套餐id" prop="packId">
<el-input v-model="form.packId" placeholder="请输入套餐id"/>
</el-form-item>
<el-form-item label="次卡有效期" prop="expirationDate">
<el-input v-model="form.expirationDate" placeholder="请输入次卡有效期"/>
</el-form-item>
<el-form-item label="次卡次数" prop="number">
<el-input v-model="form.number" placeholder="请输入次卡次数"/>
</el-form-item>
<el-form-item label="删除标记:1-删除,0-正常" prop="isDelete">
<el-input v-model="form.isDelete" placeholder="请输入删除标记:1-删除,0-正常"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listConsumerSecondaryCard,
getConsumerSecondaryCard,
delConsumerSecondaryCard,
addConsumerSecondaryCard,
updateConsumerSecondaryCard
} from "@/api/system/consumerSecondaryCard";
export default {
name: "ConsumerSecondaryCard",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户次卡表格数据
consumerSecondaryCardList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
secondaryCardConfId: null,
consumerId: null,
phone: null,
packId: null,
expirationDate: null,
number: null,
isDelete: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
secondaryCardConfId: [
{required: true, message: "次卡配置表id不能为空", trigger: "blur"}
],
consumerId: [
{required: true, message: "用户ID不能为空", trigger: "blur"}
],
phone: [
{required: true, message: "用户手机号不能为空", trigger: "blur"}
],
packId: [
{required: true, message: "套餐id不能为空", trigger: "blur"}
],
number: [
{required: true, message: "次卡次数不能为空", trigger: "blur"}
],
isDelete: [
{required: true, message: "删除标记:1-删除,0-正常不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询用户次卡列表 */
getList() {
this.loading = true;
listConsumerSecondaryCard(this.queryParams).then(response => {
this.consumerSecondaryCardList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
secondaryCardConfId: null,
consumerId: null,
phone: null,
packId: null,
expirationDate: null,
number: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加用户次卡";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getConsumerSecondaryCard(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改用户次卡";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateConsumerSecondaryCard(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addConsumerSecondaryCard(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除用户次卡编号为"' + ids + '"的数据项?').then(function () {
return delConsumerSecondaryCard(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/consumerSecondaryCard/export', {
...this.queryParams
}, `consumerSecondaryCard_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-form-item label="配置名称" prop="name">
<el-input
v-model="queryParams.name"
clearable
placeholder="请输入配置名称"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月卡金额" prop="monthlyCardAmount">
<el-input
v-model="queryParams.monthlyCardAmount"
clearable
placeholder="请输入月卡金额"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="免费时长" prop="freeDuration">
<el-input
v-model="queryParams.freeDuration"
clearable
placeholder="请输入免费时长"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月卡天数" prop="monthlyCardDays">
<el-input
v-model="queryParams.monthlyCardDays"
clearable
placeholder="请输入月卡天数"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="是否删除(0:否,1:是)" prop="isDelete">-->
<!-- <el-input-->
<!-- v-model="queryParams.isDelete"-->
<!-- placeholder="请输入是否删除(0:否,1:是)"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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
v-hasPermi="['system:monthlyCardConf:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardConf:edit']"
:disabled="single"
icon="el-icon-edit"
plain
size="mini"
type="success"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardConf:remove']"
:disabled="multiple"
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardConf:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="monthlyCardConfList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<el-table-column align="center" label="配置名称" prop="name"/>
<el-table-column align="center" label="月卡金额" prop="monthlyCardAmount"/>
<el-table-column align="center" label="免费时长" prop="freeDuration"/>
<el-table-column align="center" label="月卡天数" prop="monthlyCardDays"/>
<!-- <el-table-column label="是否删除(0:否,1:是)" align="center" prop="isDelete" />-->
<el-table-column align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['system:monthlyCardConf:edit']"
icon="el-icon-edit"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
v-hasPermi="['system:monthlyCardConf:remove']"
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改月卡配置对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="配置名称" prop="name">
<el-input v-model="form.name" placeholder="请输入配置名称"/>
</el-form-item>
<el-form-item label="月卡金额" prop="monthlyCardAmount">
<el-input-number v-model="form.monthlyCardAmount" :max="999" :min="1"/>
<!-- <el-input v-model="form.monthlyCardAmount" placeholder="请输入月卡金额" />-->
</el-form-item>
<el-form-item label="免费时长" prop="freeDuration">
<el-input-number v-model="form.freeDuration" :max="999" :min="1"/>
<!-- <el-input v-model="form.freeDuration" placeholder="请输入免费时长" />-->
</el-form-item>
<el-form-item label="月卡天数" prop="monthlyCardDays">
<el-input-number v-model="form.monthlyCardDays" :max="999" :min="1"/>
<!-- <el-input v-model="form.monthlyCardDays" placeholder="请输入月卡天数" />-->
</el-form-item>
<!-- <el-form-item label="是否删除(0:否,1:是)" prop="isDelete">-->
<!-- <el-input v-model="form.isDelete" placeholder="请输入是否删除(0:否,1:是)" />-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listMonthlyCardConf,
getMonthlyCardConf,
delMonthlyCardConf,
addMonthlyCardConf,
updateMonthlyCardConf
} from "@/api/system/monthlyCardConf";
export default {
name: "MonthlyCardConf",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 月卡配置表格数据
monthlyCardConfList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
monthlyCardAmount: null,
freeDuration: null,
monthlyCardDays: null,
isDelete: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
monthlyCardAmount: [
{required: true, message: "月卡金额不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询月卡配置列表 */
getList() {
this.loading = true;
listMonthlyCardConf(this.queryParams).then(response => {
this.monthlyCardConfList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
name: null,
monthlyCardAmount: null,
freeDuration: null,
monthlyCardDays: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加月卡配置";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getMonthlyCardConf(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改月卡配置";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMonthlyCardConf(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMonthlyCardConf(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除月卡配置编号为"' + ids + '"的数据项?').then(function () {
return delMonthlyCardConf(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/monthlyCardConf/export', {
...this.queryParams
}, `monthlyCardConf_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-form-item label="用户月卡id" prop="consumerMonthlyCardId">
<el-input
v-model="queryParams.consumerMonthlyCardId"
clearable
placeholder="请输入用户月卡id"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input
v-model="queryParams.consumerId"
clearable
placeholder="请输入用户ID"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入用户手机号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="使用时长" prop="useDuration">
<el-input
v-model="queryParams.useDuration"
clearable
placeholder="请输入使用时长"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="剩余时长" prop="residueDuration">
<el-input
v-model="queryParams.residueDuration"
clearable
placeholder="请输入剩余时长"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="删除标记:1-删除,0-正常" prop="isDelete">
<el-input
v-model="queryParams.isDelete"
clearable
placeholder="请输入删除标记:1-删除,0-正常"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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
v-hasPermi="['system:monthlyCardLog:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardLog:edit']"
:disabled="single"
icon="el-icon-edit"
plain
size="mini"
type="success"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardLog:remove']"
:disabled="multiple"
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardLog:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="monthlyCardLogList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<!-- <el-table-column label="用户月卡id" align="center" prop="consumerMonthlyCardId" />-->
<!-- <el-table-column label="用户ID" align="center" prop="consumerId" />-->
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户头像" prop="avatar" width="100">
<template slot-scope="scope">
<image-preview :height="50" :src="scope.row.avatar" :width="50"/>
</template>
</el-table-column>
<el-table-column align="center" label="用户手机号" prop="phone"/>
<el-table-column align="center" label="月卡名称" prop="confName"/>
<el-table-column align="center" label="月卡金额" prop="confAmount"/>
<el-table-column align="center" label="使用时长" prop="useDuration"/>
<el-table-column align="center" label="剩余时长" prop="residueDuration"/>
<el-table-column align="center" label="删除标记:1-删除,0-正常" prop="isDelete"/>
<el-table-column align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['system:monthlyCardLog:edit']"
icon="el-icon-edit"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
v-hasPermi="['system:monthlyCardLog:remove']"
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改月卡使用记录对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户月卡id" prop="consumerMonthlyCardId">
<el-input v-model="form.consumerMonthlyCardId" placeholder="请输入用户月卡id"/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input v-model="form.consumerId" placeholder="请输入用户ID"/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入用户手机号"/>
</el-form-item>
<el-form-item label="使用时长" prop="useDuration">
<el-input v-model="form.useDuration" placeholder="请输入使用时长"/>
</el-form-item>
<el-form-item label="剩余时长" prop="residueDuration">
<el-input v-model="form.residueDuration" placeholder="请输入剩余时长"/>
</el-form-item>
<el-form-item label="删除标记:1-删除,0-正常" prop="isDelete">
<el-input v-model="form.isDelete" placeholder="请输入删除标记:1-删除,0-正常"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listMonthlyCardLog,
getMonthlyCardLog,
delMonthlyCardLog,
addMonthlyCardLog,
updateMonthlyCardLog
} from "@/api/system/monthlyCardLog";
export default {
name: "MonthlyCardLog",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 月卡使用记录表格数据
monthlyCardLogList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
consumerMonthlyCardId: null,
consumerId: null,
phone: null,
useDuration: null,
residueDuration: null,
isDelete: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
consumerMonthlyCardId: [
{required: true, message: "用户月卡id不能为空", trigger: "blur"}
],
consumerId: [
{required: true, message: "用户ID不能为空", trigger: "blur"}
],
phone: [
{required: true, message: "用户手机号不能为空", trigger: "blur"}
],
useDuration: [
{required: true, message: "使用时长不能为空", trigger: "blur"}
],
residueDuration: [
{required: true, message: "剩余时长不能为空", trigger: "blur"}
],
isDelete: [
{required: true, message: "删除标记:1-删除,0-正常不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询月卡使用记录列表 */
getList() {
this.loading = true;
listMonthlyCardLog(this.queryParams).then(response => {
this.monthlyCardLogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
consumerMonthlyCardId: null,
consumerId: null,
phone: null,
useDuration: null,
residueDuration: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加月卡使用记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getMonthlyCardLog(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改月卡使用记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMonthlyCardLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMonthlyCardLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除月卡使用记录编号为"' + ids + '"的数据项?').then(function () {
return delMonthlyCardLog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/monthlyCardLog/export', {
...this.queryParams
}, `monthlyCardLog_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-form-item label="月卡购买记录编号" prop="monthlyCardNo">
<el-input
v-model="queryParams.monthlyCardNo"
clearable
placeholder="请输入月卡购买记录编号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="扫呗平台唯一订单号" prop="outTradeNo">
<el-input
v-model="queryParams.outTradeNo"
clearable
placeholder="请输入扫呗平台唯一订单号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商户订单号" prop="terminalTrace">
<el-input
v-model="queryParams.terminalTrace"
clearable
placeholder="请输入商户订单号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月卡购买金额" prop="monthlyCardAmount">
<el-input
v-model="queryParams.monthlyCardAmount"
clearable
placeholder="请输入月卡购买金额"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月卡配置id" prop="monthlyCardConfId">
<el-input
v-model="queryParams.monthlyCardConfId"
clearable
placeholder="请输入月卡配置id"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input
v-model="queryParams.consumerId"
clearable
placeholder="请输入用户ID"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入用户手机号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付时间" prop="payTime">
<el-date-picker v-model="queryParams.payTime"
clearable
placeholder="请选择支付时间"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="是否删除(0:否,1:是)" prop="isDelete">
<el-input
v-model="queryParams.isDelete"
clearable
placeholder="请输入是否删除(0:否,1:是)"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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
v-hasPermi="['system:monthlyCardOrder:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardOrder:edit']"
:disabled="single"
icon="el-icon-edit"
plain
size="mini"
type="success"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardOrder:remove']"
:disabled="multiple"
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:monthlyCardOrder:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="monthlyCardOrderList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户头像" prop="avatar" width="100">
<template slot-scope="scope">
<image-preview :height="50" :src="scope.row.avatar" :width="50"/>
</template>
</el-table-column>
<el-table-column align="center" label="用户手机号" prop="phone"/>
<el-table-column align="center" label="月卡购买记录编号" prop="monthlyCardNo"/>
<el-table-column align="center" label="扫呗平台唯一订单号" prop="outTradeNo"/>
<el-table-column align="center" label="商户订单号" prop="terminalTrace"/>
<el-table-column align="center" label="月卡购买金额" prop="monthlyCardAmount"/>
<el-table-column align="center" label="月卡名称" prop="confName"/>
<!-- <el-table-column label="月卡金额" align="center" prop="confAmount" />-->
<!-- <el-table-column label="月卡配置id" align="center" prop="monthlyCardConfId" />-->
<!-- <el-table-column label="用户ID" align="center" prop="consumerId" />-->
<el-table-column align="center" label="支付方式" prop="payType"/>
<el-table-column align="center" label="订单状态" prop="payStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.order_pay_status" :value="scope.row.payStatus"/>
</template>
</el-table-column>
<el-table-column align="center" label="支付时间" prop="payTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="是否删除(0:否,1:是)" prop="isDelete"/>
<el-table-column align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['system:monthlyCardOrder:edit']"
icon="el-icon-edit"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
v-hasPermi="['system:monthlyCardOrder:remove']"
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改月卡订单对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="月卡购买记录编号" prop="monthlyCardNo">
<el-input v-model="form.monthlyCardNo" placeholder="请输入月卡购买记录编号"/>
</el-form-item>
<el-form-item label="扫呗平台唯一订单号" prop="outTradeNo">
<el-input v-model="form.outTradeNo" placeholder="请输入扫呗平台唯一订单号"/>
</el-form-item>
<el-form-item label="商户订单号" prop="terminalTrace">
<el-input v-model="form.terminalTrace" placeholder="请输入商户订单号"/>
</el-form-item>
<el-form-item label="月卡购买金额" prop="monthlyCardAmount">
<el-input v-model="form.monthlyCardAmount" placeholder="请输入月卡购买金额"/>
</el-form-item>
<el-form-item label="月卡配置id" prop="monthlyCardConfId">
<el-input v-model="form.monthlyCardConfId" placeholder="请输入月卡配置id"/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input v-model="form.consumerId" placeholder="请输入用户ID"/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入用户手机号"/>
</el-form-item>
<el-form-item label="支付时间" prop="payTime">
<el-date-picker v-model="form.payTime"
clearable
placeholder="请选择支付时间"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="是否删除(0:否,1:是)" prop="isDelete">
<el-input v-model="form.isDelete" placeholder="请输入是否删除(0:否,1:是)"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listMonthlyCardOrder,
getMonthlyCardOrder,
delMonthlyCardOrder,
addMonthlyCardOrder,
updateMonthlyCardOrder
} from "@/api/system/monthlyCardOrder";
export default {
name: "MonthlyCardOrder",
dicts: ['order_pay_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 月卡订单表格数据
monthlyCardOrderList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
monthlyCardNo: null,
outTradeNo: null,
terminalTrace: null,
monthlyCardAmount: null,
monthlyCardConfId: null,
consumerId: null,
phone: null,
payType: null,
payStatus: null,
payTime: null,
isDelete: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
monthlyCardNo: [
{required: true, message: "月卡购买记录编号不能为空", trigger: "blur"}
],
monthlyCardAmount: [
{required: true, message: "月卡购买金额不能为空", trigger: "blur"}
],
consumerId: [
{required: true, message: "用户ID不能为空", trigger: "blur"}
],
phone: [
{required: true, message: "用户手机号不能为空", trigger: "blur"}
],
payStatus: [
{required: true, message: "状态:0-待支付,1-支付成功,2-退款中,3-退款完成不能为空", trigger: "change"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询月卡订单列表 */
getList() {
this.loading = true;
listMonthlyCardOrder(this.queryParams).then(response => {
this.monthlyCardOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
monthlyCardNo: null,
outTradeNo: null,
terminalTrace: null,
monthlyCardAmount: null,
monthlyCardConfId: null,
consumerId: null,
phone: null,
payType: null,
payStatus: null,
payTime: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加月卡订单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getMonthlyCardOrder(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改月卡订单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMonthlyCardOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMonthlyCardOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除月卡订单编号为"' + ids + '"的数据项?').then(function () {
return delMonthlyCardOrder(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/monthlyCardOrder/export', {
...this.queryParams
}, `monthlyCardOrder_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="100px" size="small">
<el-form-item label="配置名称" prop="name">
<el-input
v-model="queryParams.name"
clearable
placeholder="请输入配置名称"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属套餐" prop="packId">
<el-select v-model="queryParams.packId" clearable placeholder="请选择套餐">
<el-option
v-for="item in packList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="次卡金额" prop="secondaryCardAmount">-->
<!-- <el-input-->
<!-- v-model="queryParams.secondaryCardAmount"-->
<!-- placeholder="请输入次卡金额"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="套餐id" prop="packId">-->
<!-- <el-input-->
<!-- v-model="queryParams.packId"-->
<!-- placeholder="请输入套餐id"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="次卡有效期" prop="validityPeriod">
<el-input
v-model="queryParams.validityPeriod"
clearable
placeholder="请输入次卡有效期"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="次卡次数" prop="number">
<el-input
v-model="queryParams.number"
clearable
placeholder="请输入次卡次数"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="是否删除(0:否,1:是)" prop="isDelete">-->
<!-- <el-input-->
<!-- v-model="queryParams.isDelete"-->
<!-- placeholder="请输入是否删除(0:否,1:是)"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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
v-hasPermi="['system:secondaryCardConf:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:secondaryCardConf:edit']"
:disabled="single"
icon="el-icon-edit"
plain
size="mini"
type="success"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:secondaryCardConf:remove']"
:disabled="multiple"
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:secondaryCardConf:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="secondaryCardConfList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<el-table-column align="center" label="配置名称" prop="name"/>
<el-table-column align="center" label="次卡金额" prop="secondaryCardAmount"/>
<!-- <el-table-column label="套餐id" align="center" prop="packId" />-->
<el-table-column align="center" label="套餐名称" prop="packName"/>
<el-table-column align="center" label="套餐金额" prop="packPrice"/>
<el-table-column align="center" label="次卡有效期" prop="validityPeriod"/>
<el-table-column align="center" label="次卡次数" prop="number"/>
<!-- <el-table-column label="是否删除(0:否,1:是)" align="center" prop="isDelete" />-->
<el-table-column align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['system:secondaryCardConf:edit']"
icon="el-icon-edit"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
v-hasPermi="['system:secondaryCardConf:remove']"
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改次卡配置对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="配置名称" prop="name">
<el-input v-model="form.name" placeholder="请输入配置名称"/>
</el-form-item>
<el-form-item label="次卡金额" prop="secondaryCardAmount">
<el-input-number v-model="form.secondaryCardAmount" :max="999" :min="1"/>
<!-- <el-input v-model="form.secondaryCardAmount" placeholder="请输入次卡金额" />-->
</el-form-item>
<el-form-item label="套餐id" prop="packId">
<el-input v-model="form.packId" placeholder="请输入套餐id"/>
</el-form-item>
<el-form-item label="次卡有效期" prop="validityPeriod">
<el-input-number v-model="form.validityPeriod" :max="999" :min="1"/>
<!-- <el-input v-model="form.validityPeriod" placeholder="请输入次卡有效期" />-->
</el-form-item>
<el-form-item label="次卡次数" prop="number">
<el-input-number v-model="form.number" :max="999" :min="1"/>
<!-- <el-input v-model="form.number" placeholder="请输入次卡次数" />-->
</el-form-item>
<!-- <el-form-item label="是否删除(0:否,1:是)" prop="isDelete">-->
<!-- <el-input v-model="form.isDelete" placeholder="请输入是否删除(0:否,1:是)" />-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listSecondaryCardConf,
getSecondaryCardConf,
delSecondaryCardConf,
addSecondaryCardConf,
updateSecondaryCardConf
} from "@/api/system/secondaryCardConf";
import {query} from '@/api/system/pack'
export default {
name: "SecondaryCardConf",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 次卡配置表格数据
secondaryCardConfList: [],
packList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
secondaryCardAmount: null,
packId: null,
validityPeriod: null,
number: null,
isDelete: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
secondaryCardAmount: [
{required: true, message: "次卡金额不能为空", trigger: "blur"}
],
packId: [
{required: true, message: "套餐id不能为空", trigger: "blur"}
],
number: [
{required: true, message: "次卡次数不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
this.onPackList()
},
methods: {
/** 查询次卡配置列表 */
getList() {
this.loading = true;
listSecondaryCardConf(this.queryParams).then(response => {
this.secondaryCardConfList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
name: null,
secondaryCardAmount: null,
packId: null,
validityPeriod: null,
number: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加次卡配置";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getSecondaryCardConf(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改次卡配置";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSecondaryCardConf(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSecondaryCardConf(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除次卡配置编号为"' + ids + '"的数据项?').then(function () {
return delSecondaryCardConf(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/secondaryCardConf/export', {
...this.queryParams
}, `secondaryCardConf_${new Date().getTime()}.xlsx`)
},
onPackList() {
query().then(res => {
this.packList = res.data
})
},
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="100px" size="small">
<!-- <el-form-item label="用户次卡id" prop="consumerSecondaryCardId">-->
<!-- <el-input-->
<!-- v-model="queryParams.consumerSecondaryCardId"-->
<!-- placeholder="请输入用户次卡id"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="用户ID" prop="consumerId">-->
<!-- <el-input-->
<!-- v-model="queryParams.consumerId"-->
<!-- placeholder="请输入用户ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="用户手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入用户手机号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="套餐id" prop="packId">-->
<!-- <el-input-->
<!-- v-model="queryParams.packId"-->
<!-- placeholder="请输入套餐id"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="所属套餐" prop="packId">
<el-select v-model="queryParams.packId" clearable placeholder="请选择套餐">
<el-option
v-for="item in packList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="使用次数" prop="usageCount">-->
<!-- <el-input-->
<!-- v-model="queryParams.usageCount"-->
<!-- placeholder="请输入使用次数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="剩余次数" prop="residueCount">-->
<!-- <el-input-->
<!-- v-model="queryParams.residueCount"-->
<!-- placeholder="请输入剩余次数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="删除标记:1-删除,0-正常" prop="isDelete">-->
<!-- <el-input-->
<!-- v-model="queryParams.isDelete"-->
<!-- placeholder="请输入删除标记:1-删除,0-正常"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:secondaryCardLog:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:secondaryCardLog:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:secondaryCardLog:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
v-hasPermi="['system:secondaryCardLog:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="secondaryCardLogList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<el-table-column align="center" label="主键" prop="id"/>
<!-- <el-table-column label="用户次卡id" align="center" prop="consumerSecondaryCardId" />-->
<!-- <el-table-column label="用户ID" align="center" prop="consumerId" />-->
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户头像" prop="avatar" width="100">
<template slot-scope="scope">
<image-preview :height="50" :src="scope.row.avatar" :width="50"/>
</template>
</el-table-column>
<el-table-column align="center" label="用户手机号" prop="phone"/>
<!-- <el-table-column label="套餐id" align="center" prop="packId" />-->
<el-table-column align="center" label="次卡名称" prop="confName"/>
<el-table-column align="center" label="次卡金额" prop="confAmount"/>
<el-table-column align="center" label="套餐名称" prop="packName"/>
<el-table-column align="center" label="套餐金额" prop="packPrice"/>
<el-table-column align="center" label="使用次数" prop="usageCount"/>
<el-table-column align="center" label="剩余次数" prop="residueCount"/>
<!-- <el-table-column label="删除标记:1-删除,0-正常" align="center" prop="isDelete" />-->
<el-table-column align="center" label="备注" prop="remark"/>
<!-- <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="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:secondaryCardLog:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:secondaryCardLog:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改次卡使用记录对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户次卡id" prop="consumerSecondaryCardId">
<el-input v-model="form.consumerSecondaryCardId" placeholder="请输入用户次卡id"/>
</el-form-item>
<el-form-item label="用户ID" prop="consumerId">
<el-input v-model="form.consumerId" placeholder="请输入用户ID"/>
</el-form-item>
<el-form-item label="用户手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入用户手机号"/>
</el-form-item>
<el-form-item label="套餐id" prop="packId">
<el-input v-model="form.packId" placeholder="请输入套餐id"/>
</el-form-item>
<el-form-item label="使用次数" prop="usageCount">
<el-input v-model="form.usageCount" placeholder="请输入使用次数"/>
</el-form-item>
<el-form-item label="剩余次数" prop="residueCount">
<el-input v-model="form.residueCount" placeholder="请输入剩余次数"/>
</el-form-item>
<el-form-item label="删除标记:1-删除,0-正常" prop="isDelete">
<el-input v-model="form.isDelete" placeholder="请输入删除标记:1-删除,0-正常"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listSecondaryCardLog,
getSecondaryCardLog,
delSecondaryCardLog,
addSecondaryCardLog,
updateSecondaryCardLog
} from "@/api/system/secondaryCardLog";
import {query} from '@/api/system/pack'
export default {
name: "SecondaryCardLog",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 次卡使用记录表格数据
secondaryCardLogList: [],
packList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
consumerSecondaryCardId: null,
consumerId: null,
phone: null,
packId: null,
usageCount: null,
residueCount: null,
isDelete: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
consumerSecondaryCardId: [
{required: true, message: "用户次卡id不能为空", trigger: "blur"}
],
consumerId: [
{required: true, message: "用户ID不能为空", trigger: "blur"}
],
phone: [
{required: true, message: "用户手机号不能为空", trigger: "blur"}
],
packId: [
{required: true, message: "套餐id不能为空", trigger: "blur"}
],
usageCount: [
{required: true, message: "使用次数不能为空", trigger: "blur"}
],
residueCount: [
{required: true, message: "剩余次数不能为空", trigger: "blur"}
],
isDelete: [
{required: true, message: "删除标记:1-删除,0-正常不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
this.onPackList();
},
methods: {
/** 查询次卡使用记录列表 */
getList() {
this.loading = true;
listSecondaryCardLog(this.queryParams).then(response => {
this.secondaryCardLogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
consumerSecondaryCardId: null,
consumerId: null,
phone: null,
packId: null,
usageCount: null,
residueCount: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加次卡使用记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getSecondaryCardLog(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改次卡使用记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSecondaryCardLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSecondaryCardLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除次卡使用记录编号为"' + ids + '"的数据项?').then(function () {
return delSecondaryCardLog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/secondaryCardLog/export', {
...this.queryParams
}, `secondaryCardLog_${new Date().getTime()}.xlsx`)
},
onPackList() {
query().then(res => {
this.packList = res.data
})
},
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="100px" size="small">
<el-form-item label="订单编号" prop="secondaryCardNo">
<el-input
v-model="queryParams.secondaryCardNo"
clearable
placeholder="请输入次卡购买记录编号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="扫呗订单号" prop="outTradeNo">
<el-input
v-model="queryParams.outTradeNo"
clearable
placeholder="请输入扫呗平台唯一订单号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商户订单号" prop="terminalTrace">
<el-input
v-model="queryParams.terminalTrace"
clearable
placeholder="请输入商户订单号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="次卡购买金额" prop="secondaryCardAmount">-->
<!-- <el-input-->
<!-- v-model="queryParams.secondaryCardAmount"-->
<!-- placeholder="请输入次卡购买金额"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="次卡配置表id" prop="secondaryCardConfId">-->
<!-- <el-input-->
<!-- v-model="queryParams.secondaryCardConfId"-->
<!-- placeholder="请输入次卡配置表id"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="次卡用户ID" prop="consumerId">-->
<!-- <el-input-->
<!-- v-model="queryParams.consumerId"-->
<!-- placeholder="请输入次卡用户ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="用户手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入次卡用户手机号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付时间" prop="payTime">
<el-date-picker v-model="queryParams.payTime"
clearable
placeholder="请选择支付时间"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="删除标记:1-删除,0-正常" prop="isDelete">-->
<!-- <el-input-->
<!-- v-model="queryParams.isDelete"-->
<!-- placeholder="请输入删除标记:1-删除,0-正常"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @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"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:secondaryCardOrder:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:secondaryCardOrder:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:secondaryCardOrder:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
v-hasPermi="['system:secondaryCardOrder:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="secondaryCardOrderList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户头像" prop="avatar" width="100">
<template slot-scope="scope">
<image-preview :height="50" :src="scope.row.avatar" :width="50"/>
</template>
</el-table-column>
<el-table-column align="center" label="用户手机号" prop="phone" width="160"/>
<el-table-column align="center" label="购买记录编号" prop="secondaryCardNo" width="180"/>
<el-table-column align="center" label="扫呗平台唯一订单号" prop="outTradeNo" width="210"/>
<!-- <el-table-column label="商户订单号" align="center" prop="terminalTrace" />-->
<el-table-column align="center" label="购买金额" prop="secondaryCardAmount"/>
<el-table-column align="center" label="次卡名称" prop="confName"/>
<el-table-column align="center" label="次卡金额" prop="confAmount"/>
<el-table-column align="center" label="套餐名称" prop="packName" width="100"/>
<el-table-column align="center" label="套餐金额" prop="packPrice"/>
<!-- <el-table-column label="次卡配置表id" align="center" prop="secondaryCardConfId" />-->
<!-- <el-table-column label="次卡用户ID" align="center" prop="consumerId" />-->
<el-table-column align="center" label="支付方式" prop="payType"/>
<!-- <el-table-column label="状态:0-待支付,1-支付成功,2-退款中,3-退款完成" align="center" prop="payStatus" />-->
<el-table-column align="center" label="订单状态" prop="payStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.order_pay_status" :value="scope.row.payStatus"/>
</template>
</el-table-column>
<el-table-column align="center" label="支付时间" prop="payTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="删除标记:1-删除,0-正常" align="center" prop="isDelete" />-->
<el-table-column align="center" label="备注" prop="remark"/>
<!-- <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="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:secondaryCardOrder:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:secondaryCardOrder:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改次卡购买记录对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="次卡购买记录编号" prop="secondaryCardNo">
<el-input v-model="form.secondaryCardNo" placeholder="请输入次卡购买记录编号"/>
</el-form-item>
<el-form-item label="扫呗平台唯一订单号" prop="outTradeNo">
<el-input v-model="form.outTradeNo" placeholder="请输入扫呗平台唯一订单号"/>
</el-form-item>
<el-form-item label="商户订单号" prop="terminalTrace">
<el-input v-model="form.terminalTrace" placeholder="请输入商户订单号"/>
</el-form-item>
<el-form-item label="次卡购买金额" prop="secondaryCardAmount">
<el-input v-model="form.secondaryCardAmount" placeholder="请输入次卡购买金额"/>
</el-form-item>
<el-form-item label="次卡配置表id" prop="secondaryCardConfId">
<el-input v-model="form.secondaryCardConfId" placeholder="请输入次卡配置表id"/>
</el-form-item>
<el-form-item label="次卡用户ID" prop="consumerId">
<el-input v-model="form.consumerId" placeholder="请输入次卡用户ID"/>
</el-form-item>
<el-form-item label="次卡用户手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入次卡用户手机号"/>
</el-form-item>
<el-form-item label="支付时间" prop="payTime">
<el-date-picker v-model="form.payTime"
clearable
placeholder="请选择支付时间"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="删除标记:1-删除,0-正常" prop="isDelete">
<el-input v-model="form.isDelete" placeholder="请输入删除标记:1-删除,0-正常"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listSecondaryCardOrder,
getSecondaryCardOrder,
delSecondaryCardOrder,
addSecondaryCardOrder,
updateSecondaryCardOrder
} from "@/api/system/secondaryCardOrder";
export default {
name: "SecondaryCardOrder",
dicts: ['order_pay_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 次卡购买记录表格数据
secondaryCardOrderList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
secondaryCardNo: null,
outTradeNo: null,
terminalTrace: null,
secondaryCardAmount: null,
secondaryCardConfId: null,
consumerId: null,
phone: null,
payType: null,
payStatus: null,
payTime: null,
isDelete: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
secondaryCardNo: [
{required: true, message: "次卡购买记录编号不能为空", trigger: "blur"}
],
secondaryCardAmount: [
{required: true, message: "次卡购买金额不能为空", trigger: "blur"}
],
secondaryCardConfId: [
{required: true, message: "次卡配置表id不能为空", trigger: "blur"}
],
consumerId: [
{required: true, message: "次卡用户ID不能为空", trigger: "blur"}
],
phone: [
{required: true, message: "次卡用户手机号不能为空", trigger: "blur"}
],
payStatus: [
{required: true, message: "状态:0-待支付,1-支付成功,2-退款中,3-退款完成不能为空", trigger: "change"}
],
isDelete: [
{required: true, message: "删除标记:1-删除,0-正常不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询次卡购买记录列表 */
getList() {
this.loading = true;
listSecondaryCardOrder(this.queryParams).then(response => {
this.secondaryCardOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
secondaryCardNo: null,
outTradeNo: null,
terminalTrace: null,
secondaryCardAmount: null,
secondaryCardConfId: null,
consumerId: null,
phone: null,
payType: null,
payStatus: null,
payTime: null,
isDelete: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加次卡购买记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getSecondaryCardOrder(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改次卡购买记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSecondaryCardOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSecondaryCardOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除次卡购买记录编号为"' + ids + '"的数据项?').then(function () {
return delSecondaryCardOrder(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/secondaryCardOrder/export', {
...this.queryParams
}, `secondaryCardOrder_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment