提交
This commit is contained in:
parent
494c279018
commit
7cdd8308f8
44
src/api/bst/reconciliationDate.js
Normal file
44
src/api/bst/reconciliationDate.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询渠道对账列表
|
||||
export function listReconciliationDate(query) {
|
||||
return request({
|
||||
url: '/bst/reconciliationDate/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询渠道对账详细
|
||||
export function getReconciliationDate(id) {
|
||||
return request({
|
||||
url: '/bst/reconciliationDate/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增渠道对账
|
||||
export function addReconciliationDate(data) {
|
||||
return request({
|
||||
url: '/bst/reconciliationDate',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改渠道对账
|
||||
export function updateReconciliationDate(data) {
|
||||
return request({
|
||||
url: '/bst/reconciliationDate',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除渠道对账
|
||||
export function delReconciliationDate(id) {
|
||||
return request({
|
||||
url: '/bst/reconciliationDate/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
56
src/components/Business/Channel/ChannelSelect.vue
Normal file
56
src/components/Business/Channel/ChannelSelect.vue
Normal file
|
@ -0,0 +1,56 @@
|
|||
<template>
|
||||
<el-select
|
||||
v-model="selectedValue"
|
||||
:multiple="multiple"
|
||||
:clearable="clearable"
|
||||
placeholder="请选择渠道"
|
||||
v-on="$listeners">
|
||||
<el-option v-for="item in options" :key="item.channelId" :label="item.name" :value="item.channelId"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAllChannel } from '@/api/bst/channel';
|
||||
export default {
|
||||
name: 'ChannelSelect',
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Array],
|
||||
default: null
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectedValue: {
|
||||
get() {
|
||||
return this.value;
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
listAllChannel().then(res => {
|
||||
this.options = res.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -216,7 +216,7 @@ export default {
|
|||
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'name', visible: true, label: '名称', minWidth: "200", sortable: true, overflow: false, align: 'left', width: null},
|
||||
{key: 'areaTimeStart', visible: true, label: '运营时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'subArea', visible: true, label: '电子围栏', minWidth: "200", sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'subArea', visible: true, label: '电子围栏', minWidth: "200", sortable: false, overflow: false, align: 'center', width: null},
|
||||
{key: 'userName', visible: true, label: '运营商', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createName', visible: true, label: '创建人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
|
||||
|
|
|
@ -42,11 +42,10 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运营区" prop="areaId">
|
||||
<el-input
|
||||
v-model="queryParams.areaName"
|
||||
placeholder="请输入运营区名称"
|
||||
<area-remote-select
|
||||
v-model="queryParams.areaId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="在线状态" prop="onlineStatus">
|
||||
|
@ -430,6 +429,7 @@ import DeviceTransferDialog from '@/views/bst/device/components/DeviceTransferDi
|
|||
import DeviceSn from '@/views/bst/device/components/DeviceSn.vue';
|
||||
import UserLink from '@/components/Business/User/UserLink.vue';
|
||||
import DeviceLink from '@/components/Business/Device/DeviceLink.vue';
|
||||
import AreaRemoteSelect from '@/components/Business/Area/AreaRemoteSelect.vue';
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
|
@ -441,7 +441,7 @@ export default {
|
|||
name: "Device",
|
||||
mixins: [$showColumns, $device],
|
||||
dicts: ['device_status', 'device_lock_status', 'device_iot_status', 'device_online_status', 'device_quality', 'device_music'],
|
||||
components: {FormCol, DeviceEditDialog, BooleanTag, DeviceTransferDialog, DeviceSn, UserLink, DeviceLink},
|
||||
components: {FormCol, DeviceEditDialog, BooleanTag, DeviceTransferDialog, DeviceSn, UserLink, DeviceLink, AreaRemoteSelect},
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
|
|
313
src/views/bst/reconciliationDate/index.vue
Normal file
313
src/views/bst/reconciliationDate/index.vue
Normal file
|
@ -0,0 +1,313 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="日期" prop="date">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.dateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
placeholder="请选择日期"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付渠道" prop="channelId">
|
||||
<channel-select
|
||||
v-model="queryParams.channelId"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运营区" prop="areaId">
|
||||
<area-remote-select
|
||||
v-model="queryParams.areaId"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-has-permi="['bst:reconciliationDate:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table size="mini" border v-loading="loading" :data="reconciliationDateList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="['actualAmount', 'userActualBonus', 'platformActualBonus', 'actualBonus', 'orderActualAmount'].includes(column.key)">
|
||||
<span style="color: red">{{d.row[column.key] | fix2 | dv}}</span>
|
||||
</template>
|
||||
<template v-else-if="['payAmount', 'refundAmount', 'userBonus', 'userBonusRefund', 'platformBonus', 'platformBonusRefund', 'totalBonus', 'totalBonusRefund', 'orderPayAmount', 'orderRefundAmount'].includes(column.key)">
|
||||
{{d.row[column.key] | fix2 | dv}}
|
||||
</template>
|
||||
<template v-else-if="['difference'].includes(column.key)">
|
||||
<span style="color: red" v-if="d.row.difference != 0">{{d.row[column.key] | fix2 | dv}}</span>
|
||||
<span style="color: green" v-else>{{d.row[column.key] | fix2 | dv}}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listReconciliationDate, getReconciliationDate, delReconciliationDate, addReconciliationDate, updateReconciliationDate } from "@/api/bst/reconciliationDate";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import AreaRemoteSelect from '@/components/Business/Area/AreaRemoteSelect.vue'
|
||||
import ChannelSelect from '@/components/Business/Channel/ChannelSelect.vue';
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "date",
|
||||
order: "descending"
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "ReconciliationDate",
|
||||
mixins: [$showColumns],
|
||||
components: {FormCol, AreaRemoteSelect, ChannelSelect},
|
||||
data() {
|
||||
return {
|
||||
span: 24,
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'date', visible: true, label: '日期', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'channelName', visible: true, label: '渠道', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'areaName', visible: true, label: '运营区', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'orderPayAmount', visible: false, label: '骑行支付', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'orderRefundAmount', visible: false, label: '骑行退款', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'orderActualAmount', visible: false, label: '骑行实收', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'payAmount', visible: true, label: '支付', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'refundAmount', visible: true, label: '退款', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'actualAmount', visible: true, label: '实收', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'userBonus', visible: true, label: '分成', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'userBonusRefund', visible: true, label: '分成退款', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'userActualBonus', visible: true, label: '分成实收', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'platformBonus', visible: true, label: '手续费', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'platformBonusRefund', visible: true, label: '手续费退款', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'platformActualBonus', visible: true, label: '手续费实收', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'totalBonus', visible: false, label: '分成总金额', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'totalBonusRefund', visible: false, label: '分成退款总金额', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'actualBonus', visible: false, label: '实际分成金额', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
{key: 'difference', visible: true, label: '差额', minWidth: null, sortable: true, overflow: false, align: 'right', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 渠道对账表格数据
|
||||
reconciliationDateList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
defaultSort,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
id: null,
|
||||
dateRange: [],
|
||||
channelId: null,
|
||||
channelName: null,
|
||||
areaId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
date: [
|
||||
{ required: true, message: "日期不能为空", trigger: "blur" }
|
||||
],
|
||||
areaId: [
|
||||
{ required: true, message: "运营区ID不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
this.queryParams.orderByColumn = defaultSort.prop;
|
||||
this.queryParams.isAsc = defaultSort.order;
|
||||
} else {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 查询渠道对账列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReconciliationDate(this.queryParams).then(response => {
|
||||
this.reconciliationDateList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
date: null,
|
||||
channelId: null,
|
||||
channelName: null,
|
||||
areaId: null,
|
||||
orderPayAmount: null,
|
||||
orderRefundAmount: null,
|
||||
orderActualAmount: null,
|
||||
payAmount: null,
|
||||
refundAmount: null,
|
||||
actualAmount: null,
|
||||
userBonus: null,
|
||||
userBonusRefund: null,
|
||||
userActualBonus: null,
|
||||
platformBonus: null,
|
||||
platformBonusRefund: null,
|
||||
platformActualBonus: null,
|
||||
totalBonus: null,
|
||||
totalBonusRefund: null,
|
||||
actualBonus: null,
|
||||
difference: null,
|
||||
channelCost: 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
|
||||
getReconciliationDate(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) {
|
||||
updateReconciliationDate(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addReconciliationDate(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 delReconciliationDate(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bst/reconciliationDate/export', {
|
||||
...this.queryParams
|
||||
}, `reconciliationDate_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user