|
@@ -15,7 +15,7 @@
|
|
|
<div style="margin-top: 15px">
|
|
|
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
|
|
<el-form-item label="渠道名称:">
|
|
|
- <el-input v-model="listQuery.keyword" class="input-width" placeholder="请输入渠道名称"
|
|
|
+ <el-input v-model="listQuery.ecName" class="input-width" placeholder="请输入渠道名称"
|
|
|
clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="更新时间:">
|
|
@@ -33,63 +33,44 @@
|
|
|
</el-card>
|
|
|
<div class="table-container">
|
|
|
<el-table ref="adminTable" :data="list" style="width: 100%" v-loading="listLoading" border>
|
|
|
- <el-table-column label="渠道编号" width="100" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="渠道名称" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column label="渠道编号" width="100" align="center" prop="appId"></el-table-column>
|
|
|
+ <el-table-column label="渠道名称" align="center" prop="thirdPartyName"></el-table-column>
|
|
|
<el-table-column label="使用状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="渠道上账总金额/元" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
+ <el-tag type='success' v-if="scope.row.status === 1">正常</el-tag>
|
|
|
+ <el-tag type="danger" v-else>禁用</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="渠道上账总金额/元" align="center" prop="topAllMoney"></el-table-column>
|
|
|
<el-table-column label="渠道应付总金额/元" width="160" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="用户充值总金额/元" width="160" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="用户消费总金额/元" width="140" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
+ {{ scope.row.totalPayable || '0' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="用户充值总金额/元" width="160" align="center" prop="userTopAllMoney"></el-table-column>
|
|
|
+ <el-table-column label="用户消费总金额/元" width="140" align="center"
|
|
|
+ prop="userConsumeAllMoney"></el-table-column>
|
|
|
<el-table-column label="用户退款总金额/元" width="140" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="更新时间" width="140" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ '--' }}
|
|
|
+ {{ scope.row.userRefundAllMoney || '0' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="用户剩余总金额/元" width="140" align="center" prop="userBalance"></el-table-column>
|
|
|
<el-table-column label="操作" width="180" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="primary" plain @click="handleUpdate(scope.$index, scope.row)">
|
|
|
+ <el-button size="mini" type="primary" plain @click="handleUpdate(scope.$index, scope.row)"
|
|
|
+ v-if="scope.row.status === 1">
|
|
|
上账
|
|
|
</el-button>
|
|
|
- <el-button size="mini" type="primary" plain @click="SettleAccount(scope.$index, scope.row)">
|
|
|
+ <el-button size="mini" type="success" plain @click="SettleAccount(scope.$index, scope.row)"
|
|
|
+ v-else>
|
|
|
结算
|
|
|
</el-button>
|
|
|
- <el-button size="mini" type="primary" plain @click="forbidden">
|
|
|
+ <el-button size="mini" type="danger" plain @click="forbiddenStatus(scope.$index, scope.row)"
|
|
|
+ v-if="scope.row.status === 1">
|
|
|
禁用
|
|
|
</el-button>
|
|
|
- <el-button size="mini" type="primary" plain @click="enable">
|
|
|
+ <el-button size="mini" type="warning" plain @click="enable(scope.$index, scope.row)" v-else>
|
|
|
启用
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -102,38 +83,37 @@
|
|
|
:page-size="listQuery.pageSize" :page-sizes="[10, 15, 20]" :total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <el-dialog title="提示" :visible.sync="forbiddenDialogVisible" width="30%" :before-close="handleClose">
|
|
|
+ <el-dialog title="提示" :visible.sync="forbiddenDialogVisible" width="30%">
|
|
|
<span v-if="isforbidden === false">此操作将会禁用该渠道的所有用户(正在充电的用户,会在本次充电完成后被禁用),使其无法充电,是否继续。</span>
|
|
|
<span v-else>该操作会将该渠道禁用的用户,重新启用,是否继续。</span>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="forbiddenDialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="forbiddenDialogVisible = false">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="confirmForbidden">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog :title="isEdit ? '渠道上账' : '渠道结算'" :visible.sync="dialogVisible" width="40%">
|
|
|
- <el-form :model="admin" ref="adminForm" label-width="150px" size="small">
|
|
|
+ <el-form :model="admin" ref="adminForm" label-width="150px" :rules="rules" size="small">
|
|
|
<div style="font-size: 18px;font-weight: bold;">渠道信息</div>
|
|
|
<el-form-item label="渠道编号:">
|
|
|
- <template>{{ 'WQHIAHS124342DSAD' }}</template>
|
|
|
+ <template><span style="color: #969595;">{{ admin.appId }}</span></template>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="渠道名称:">
|
|
|
- <template>{{ 'WQHIAHS124342DSAD' }}</template>
|
|
|
+ <template><span style="color: #969595;">{{ admin.thirdPartyName }}</span></template>
|
|
|
</el-form-item>
|
|
|
<div style="font-size: 18px;font-weight: bold;">使用情况</div>
|
|
|
<el-form-item label="渠道上账总金额/元:">
|
|
|
- <template> {{ '10.00' }} </template>
|
|
|
+ <template><span style="color: #969595;">{{ admin.topAllMoney }}</span></template>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="渠道应付总金额/元:">
|
|
|
- <template> {{ '50.00' }} </template>
|
|
|
+ <template><span style="color: #969595;">{{ admin.totalPayable || '0' }}</span></template>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="本次上账金额/元:">
|
|
|
- <el-input v-model="admin.note" placeholder="请输入上账金额" type="text" :rows="5"
|
|
|
+ <el-form-item label="本次上账金额/元:" prop="upAccount">
|
|
|
+ <el-input v-model="admin.money" placeholder="请输入上账金额" type="text" :rows="5"
|
|
|
style="width: 250px"></el-input>
|
|
|
- <el-checkbox v-if="!isEdit" v-model="checked">负数</el-checkbox>
|
|
|
+ <el-checkbox v-if="!isEdit" v-model="admin.checked">负数</el-checkbox>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="上传凭证:">
|
|
|
- <el-upload action="https://jsonplaceholder.typicode.com/posts/" list-type="picture-card"
|
|
|
- :on-preview="handlePictureCardPreview" :on-remove="handleRemove">
|
|
|
+ <el-upload action="https://jsonplaceholder.typicode.com/posts/" list-type="picture-card">
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
@@ -143,35 +123,18 @@
|
|
|
<el-button type="primary" @click="handleDialogConfirm()" size="small">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="分配角色" :visible.sync="allocDialogVisible" width="30%">
|
|
|
- <el-select v-model="allocRoleIds" multiple placeholder="请选择" size="small" style="width: 80%">
|
|
|
- <el-option v-for="item in allRoleList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="allocDialogVisible = false" size="small">取 消</el-button>
|
|
|
- <el-button type="primary" @click="handleAllocDialogConfirm()" size="small">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {
|
|
|
- fetchList,
|
|
|
- createAdmin,
|
|
|
- updateAdmin,
|
|
|
- updateStatus,
|
|
|
- deleteAdmin,
|
|
|
- getRoleByAdmin,
|
|
|
- allocRole,
|
|
|
-} from "@/api/login";
|
|
|
-import { fetchAllRoleList } from "@/api/role";
|
|
|
+import { useConditionList, updateStatus, upTheAccount } from "@/api/channel";
|
|
|
import { formatDate } from "@/utils/date";
|
|
|
|
|
|
const defaultListQuery = {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- keyword: null,
|
|
|
+ ecName: null,
|
|
|
+ startTime: '',
|
|
|
+ endTime: ''
|
|
|
};
|
|
|
const defaultAdmin = {
|
|
|
id: null,
|
|
@@ -183,9 +146,10 @@ const defaultAdmin = {
|
|
|
status: 1,
|
|
|
};
|
|
|
export default {
|
|
|
- name: "adminList",
|
|
|
+ name: "useCondition",
|
|
|
data() {
|
|
|
return {
|
|
|
+ setQuery: {},
|
|
|
date: '',
|
|
|
isforbidden: false,
|
|
|
forbiddenDialogVisible: false,
|
|
@@ -196,15 +160,25 @@ export default {
|
|
|
dialogVisible: false,
|
|
|
admin: Object.assign({}, defaultAdmin),
|
|
|
isEdit: false,
|
|
|
- allocDialogVisible: false,
|
|
|
allocRoleIds: [],
|
|
|
allRoleList: [],
|
|
|
allocAdminId: null,
|
|
|
+ rules: { upAccount: [{ required: true, message: "请输入金额", trigger: "blur", }] }
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ date(val) {
|
|
|
+ if (val) {
|
|
|
+ this.listQuery.startTime = Date.parse(val[0]);
|
|
|
+ this.listQuery.endTime = Date.parse(val[1]);
|
|
|
+ } else {
|
|
|
+ this.listQuery.startTime = "";
|
|
|
+ this.listQuery.endTime = "";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getList();
|
|
|
- this.getAllRoleList();
|
|
|
},
|
|
|
filters: {
|
|
|
formatDateTime(time) {
|
|
@@ -217,21 +191,50 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 启用
|
|
|
- enable() {
|
|
|
+ enable(index, row) {
|
|
|
this.isforbidden = true
|
|
|
this.forbiddenDialogVisible = true
|
|
|
+ this.setQuery = row
|
|
|
},
|
|
|
// 禁用
|
|
|
- forbidden() {
|
|
|
+ forbiddenStatus(index, row) {
|
|
|
this.isforbidden = false
|
|
|
this.forbiddenDialogVisible = true
|
|
|
+ this.setQuery = row
|
|
|
+ },
|
|
|
+
|
|
|
+ // 确认禁用/启用
|
|
|
+ confirmForbidden() {
|
|
|
+ let isEnable = ''
|
|
|
+ if (this.isforbidden === true) {
|
|
|
+ isEnable = 1
|
|
|
+ } else {
|
|
|
+ isEnable = 2
|
|
|
+ }
|
|
|
+ updateStatus(this.setQuery.thirdPartyId, isEnable).then((res) => {
|
|
|
+ this.forbiddenDialogVisible = false
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功!",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 结算
|
|
|
- SettleAccount() {
|
|
|
+ SettleAccount(index, row) {
|
|
|
this.dialogVisible = true;
|
|
|
this.isEdit = false;
|
|
|
- this.admin = Object.assign({}, defaultAdmin);
|
|
|
+ this.admin = Object.assign({}, row);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 上账
|
|
|
+ handleUpdate(index, row) {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.isEdit = true;
|
|
|
+ this.admin = Object.assign({}, row);
|
|
|
},
|
|
|
|
|
|
handleResetSearch() {
|
|
@@ -250,67 +253,32 @@ export default {
|
|
|
this.listQuery.pageNum = val;
|
|
|
this.getList();
|
|
|
},
|
|
|
- handleStatusChange(index, row) {
|
|
|
- this.$confirm("是否要修改该状态?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- updateStatus(row.id, { status: row.status }).then((response) => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "修改成功!",
|
|
|
- });
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "取消修改",
|
|
|
- });
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- },
|
|
|
- handleDelete(index, row) {
|
|
|
- this.$confirm("是否要删除该用户?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- deleteAdmin(row.id).then((response) => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!",
|
|
|
- });
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- handleUpdate(index, row) {
|
|
|
- this.dialogVisible = true;
|
|
|
- this.isEdit = true;
|
|
|
- this.admin = Object.assign({}, row);
|
|
|
- },
|
|
|
+
|
|
|
handleDialogConfirm() {
|
|
|
this.$confirm("是否要确认?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
+ let updateData = {
|
|
|
+ money: this.admin.money,
|
|
|
+ thirdPartyInfoId: this.admin.thirdPartyId,
|
|
|
+ type: this.isEdit == true ? 1 : 2,
|
|
|
+ voucherPic: ''
|
|
|
+ }
|
|
|
if (this.isEdit) {
|
|
|
- updateAdmin(this.admin.id, this.admin).then((response) => {
|
|
|
+ upTheAccount({ ...updateData }).then((response) => {
|
|
|
this.$message({
|
|
|
- message: "修改成功!",
|
|
|
+ message: "上账成功!",
|
|
|
type: "success",
|
|
|
});
|
|
|
this.dialogVisible = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- createAdmin(this.admin).then((response) => {
|
|
|
+ upTheAccount({ ...updateData }).then((response) => {
|
|
|
this.$message({
|
|
|
- message: "添加成功!",
|
|
|
+ message: "结算成功!",
|
|
|
type: "success",
|
|
|
});
|
|
|
this.dialogVisible = false;
|
|
@@ -319,54 +287,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- handleAllocDialogConfirm() {
|
|
|
- this.$confirm("是否要确认?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- let params = new URLSearchParams();
|
|
|
- params.append("adminId", this.allocAdminId);
|
|
|
- params.append("roleIds", this.allocRoleIds);
|
|
|
- allocRole(params).then((response) => {
|
|
|
- this.$message({
|
|
|
- message: "分配成功!",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.allocDialogVisible = false;
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- handleSelectRole(index, row) {
|
|
|
- this.allocAdminId = row.id;
|
|
|
- this.allocDialogVisible = true;
|
|
|
- this.getRoleListByAdmin(row.id);
|
|
|
- },
|
|
|
getList() {
|
|
|
this.listLoading = true;
|
|
|
- fetchList(this.listQuery).then((response) => {
|
|
|
+ useConditionList(this.listQuery).then((response) => {
|
|
|
this.listLoading = false;
|
|
|
this.list = response.data.list;
|
|
|
this.total = response.data.total;
|
|
|
});
|
|
|
},
|
|
|
- getAllRoleList() {
|
|
|
- fetchAllRoleList().then((response) => {
|
|
|
- this.allRoleList = response.data;
|
|
|
- });
|
|
|
- },
|
|
|
- getRoleListByAdmin(adminId) {
|
|
|
- getRoleByAdmin(adminId).then((response) => {
|
|
|
- let allocRoleList = response.data;
|
|
|
- this.allocRoleIds = [];
|
|
|
- if (allocRoleList != null && allocRoleList.length > 0) {
|
|
|
- for (let i = 0; i < allocRoleList.length; i++) {
|
|
|
- this.allocRoleIds.push(allocRoleList[i].id);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
-<style></style>
|
|
|
+<style>
|
|
|
+</style>
|