Commit dce8886c by 吕明尚

增加充值和赠送金额日志

parent dbd21930
import request from '@/utils/request'
// 查询赠送金额日志列表
export function listGiftAmountLog(query) {
return request({
url: '/system/giftAmountLog/list',
method: 'get',
params: query
})
}
// 查询赠送金额日志详细
export function getGiftAmountLog(id) {
return request({
url: '/system/giftAmountLog/' + id,
method: 'get'
})
}
// 新增赠送金额日志
export function addGiftAmountLog(data) {
return request({
url: '/system/giftAmountLog',
method: 'post',
data: data
})
}
// 修改赠送金额日志
export function updateGiftAmountLog(data) {
return request({
url: '/system/giftAmountLog',
method: 'put',
data: data
})
}
// 删除赠送金额日志
export function delGiftAmountLog(id) {
return request({
url: '/system/giftAmountLog/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询充值金额日志列表
export function listRechargeAmountLog(query) {
return request({
url: '/system/rechargeAmountLog/list',
method: 'get',
params: query
})
}
// 查询充值金额日志详细
export function getRechargeAmountLog(id) {
return request({
url: '/system/rechargeAmountLog/' + id,
method: 'get'
})
}
// 新增充值金额日志
export function addRechargeAmountLog(data) {
return request({
url: '/system/rechargeAmountLog',
method: 'post',
data: data
})
}
// 修改充值金额日志
export function updateRechargeAmountLog(data) {
return request({
url: '/system/rechargeAmountLog',
method: 'put',
data: data
})
}
// 删除充值金额日志
export function delRechargeAmountLog(id) {
return request({
url: '/system/rechargeAmountLog/' + id,
method: 'delete'
})
}
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" size="small">
<el-form-item label="会员昵称" prop="nickName">
<el-input
v-model="queryParams.nickName"
clearable
placeholder="请输入会员昵称"
/>
</el-form-item>
<el-form-item label="会员手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入会员手机号"
/>
</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:giftAmountLog: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="giftAmountLogList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<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="currentAmount"/>
<el-table-column align="center" label="变动金额" prop="variableAmount"/>
<el-table-column align="center" label="操作类型" prop="operationType">
<template slot-scope="scope">
<dict-tag :options="dict.type.operation_type" :value="scope.row.operationType"/>
</template>
</el-table-column>
<el-table-column align="center" label="操作时间" prop="operationTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operationTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作时间" prop="operationTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operationTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark"/>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import {
listGiftAmountLog,
getGiftAmountLog,
delGiftAmountLog,
addGiftAmountLog,
updateGiftAmountLog
} from "@/api/system/giftAmountLog";
export default {
name: "GiftAmountLog",
dicts: ['operation_type'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 赠送金额日志表格数据
giftAmountLogList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
currentAmount: null,
nickName: null,
phone: null,
},
// 表单参数
form: {},
// 表单校验
rules: {}
};
},
created() {
this.getList();
},
methods: {
/** 查询赠送金额日志列表 */
getList() {
this.loading = true;
listGiftAmountLog(this.queryParams).then(response => {
this.giftAmountLogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
consumerId: null,
currentAmount: null,
variableAmount: null,
operationType: null,
operationTime: 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
getGiftAmountLog(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) {
updateGiftAmountLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addGiftAmountLog(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 delGiftAmountLog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/giftAmountLog/export', {
...this.queryParams
}, `giftAmountLog_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" size="small">
<el-form-item label="会员昵称" prop="nickName">
<el-input
v-model="queryParams.nickName"
clearable
placeholder="请输入会员昵称"
/>
</el-form-item>
<el-form-item label="会员手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入会员手机号"
/>
</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:rechargeAmountLog: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="rechargeAmountLogList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<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="currentAmount"/>
<el-table-column align="center" label="变动金额" prop="variableAmount"/>
<el-table-column align="center" label="操作类型" prop="operationType">
<template slot-scope="scope">
<dict-tag :options="dict.type.operation_type" :value="scope.row.operationType"/>
</template>
</el-table-column>
<el-table-column align="center" label="操作时间" prop="operationTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operationTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark"/>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import {
listRechargeAmountLog,
getRechargeAmountLog,
delRechargeAmountLog,
addRechargeAmountLog,
updateRechargeAmountLog
} from "@/api/system/rechargeAmountLog";
export default {
name: "RechargeAmountLog",
dicts: ['operation_type'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 充值金额日志表格数据
rechargeAmountLogList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
currentAmount: null,
variableAmount: null,
nickName: null,
phone: null,
},
// 表单参数
form: {},
// 表单校验
rules: {}
};
},
created() {
this.getList();
},
methods: {
/** 查询充值金额日志列表 */
getList() {
this.loading = true;
listRechargeAmountLog(this.queryParams).then(response => {
this.rechargeAmountLogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
consumerId: null,
currentAmount: null,
variableAmount: null,
operationType: null,
operationTime: 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
getRechargeAmountLog(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) {
updateRechargeAmountLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRechargeAmountLog(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 delRechargeAmountLog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/rechargeAmountLog/export', {
...this.queryParams
}, `rechargeAmountLog_${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