594 行
24 KiB
HTML
可执行文件
594 行
24 KiB
HTML
可执行文件
<!--加盟店结算管理-->
|
|
<!--[1.6.48]-->
|
|
<style>
|
|
th {
|
|
background-color: #f5f7fa !important;
|
|
}
|
|
|
|
th > .cell {
|
|
white-space: nowrap !important;
|
|
text-align: center;
|
|
}
|
|
|
|
th, td {
|
|
text-align: center;
|
|
line-height: 30px;
|
|
padding: 0;
|
|
}
|
|
|
|
th > .cell, td > .cell {
|
|
text-align: center;
|
|
}
|
|
|
|
.el-pagination {
|
|
padding: 8px;
|
|
}
|
|
|
|
.el-table__row > td:last-child > .cell {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.el-divider--horizontal {
|
|
margin: 10px 0 !important;
|
|
}
|
|
|
|
.headers-box {
|
|
display: flex;
|
|
width: 100%;
|
|
flex-wrap: wrap;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.headers-box > .el-input, .headers-box > .el-select {
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.headers-list {
|
|
width: 25%;
|
|
min-width: 150px;
|
|
height: 6vw;
|
|
min-height: 90px;
|
|
margin: 0 20px;
|
|
text-align: center;
|
|
display: flex;
|
|
align-items: center;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
background-color: #ebeef5;
|
|
}
|
|
|
|
.headers-list-size {
|
|
font-size: 22px;
|
|
text-align: center;
|
|
margin-right: 19px;
|
|
margin-top: 10px;
|
|
}
|
|
</style>
|
|
<div id="franchiseApp" v-cloak>
|
|
<div class="headers-box" style="flex-wrap: nowrap">
|
|
<div class="headers-list">
|
|
<div>总提现金额(元)</div>
|
|
<div class="headers-list-size">{{total_money}}</div>
|
|
</div>
|
|
<div class="headers-list">
|
|
<div>总平账金额(元)</div>
|
|
<div class="headers-list-size">{{total_flat_money*-1}}</div>
|
|
</div>
|
|
<div class="headers-list">
|
|
<div>待提现金额(元)</div>
|
|
<div class="headers-list-size">{{stay_money}}</div>
|
|
</div>
|
|
<div class="headers-list">
|
|
<div>待平账金额(元)</div>
|
|
<div class="headers-list-size">{{stay_flat_money*-1}}</div>
|
|
</div>
|
|
</div>
|
|
<el-divider></el-divider>
|
|
<!--搜索-->
|
|
<div class="headers-box">
|
|
<el-select
|
|
style="width: 190px;"
|
|
size="small"
|
|
v-model="store_id"
|
|
filterable
|
|
remote
|
|
clearable
|
|
v-load-more="getStoreList"
|
|
reserve-keyword
|
|
@change="changeSelectStore"
|
|
placeholder="选择门店"
|
|
:remote-method="searchStore">
|
|
<el-option
|
|
v-for="item in storeList"
|
|
:key="item.id"
|
|
:label="item.store_name"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
<el-select v-model="settlement" clearable size="small" placeholder="结算周期">
|
|
<el-option v-for="item in settlement_interval" :key="item.value" :label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
|
|
<el-select v-model="data_type" clearable size="small" placeholder="结算方式">
|
|
<el-option v-for="item in clearing_form" :key="item.value" :label="item.label" :value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
|
|
<el-select v-model="status" size="small" clearable placeholder="审核状态">
|
|
<el-option v-for="item in audit_status" :key="item.value" :label="item.label" :value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
<div>
|
|
<el-date-picker size="small"
|
|
clearable
|
|
style="margin-right: 10px"
|
|
v-model="apply_time"
|
|
type="datetimerange"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
range-separator="至"
|
|
start-placeholder="开始日期" end-placeholder="结束日期">
|
|
</el-date-picker>
|
|
<el-tooltip class="item"
|
|
style="margin-top: 8px"
|
|
effect="dark"
|
|
content="账单生成时间"
|
|
placement="top-start">
|
|
<i class="el-icon-question"></i>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
<div class="headers-box" style="margin-top: 10px">
|
|
<el-button type="primary" plain size="small" @click="currentPage=1;getData()">搜索</el-button>
|
|
<el-button v-if="operate.accountSet" type="primary" plain size="small" @click="accountSetting()">结算账户设置
|
|
</el-button>
|
|
<el-button size="small" @click="exports">导出</el-button>
|
|
</div>
|
|
<!--数据列表-->
|
|
<div style="width: 100%;">
|
|
<el-table ref="multipleTable"
|
|
:data="tableData"
|
|
size="small"
|
|
tooltip-effect="dark"
|
|
style="width: 100%;margin-top: 20px;"
|
|
border
|
|
@selection-change="handleSelectionChange">
|
|
<el-table-column type="index" label="序号" width="50"></el-table-column>
|
|
<el-table-column prop="store_name" label="结算门店" min-width="120px"></el-table-column>
|
|
<el-table-column prop="franchisee_time" label="结算日期" min-width="290px"></el-table-column>
|
|
<el-table-column prop="add_time" label="账单生成时间" min-width="150px"></el-table-column>
|
|
<el-table-column prop="apply_time" label="申请时间" min-width="150px"></el-table-column>
|
|
<el-table-column prop="type_remark" label="结算方式"></el-table-column>
|
|
<el-table-column prop="money" label="结算金额"></el-table-column>
|
|
<el-table-column prop="status_remark" label="审核状态" min-width="90px"></el-table-column>
|
|
<el-table-column v-if="operate.operate" label="操作" width="150px">
|
|
<template slot-scope="scope">
|
|
<template v-if="scope.row.data_type==1">
|
|
<template v-if="scope.row.status==2">
|
|
<el-button type="text" size="mini" @click="operatingReceipt(1,scope.row)">提现审核
|
|
</el-button>
|
|
</template>
|
|
<el-button v-else type="text" size="mini" @click="operatingReceipt(2,scope.row)">详情
|
|
</el-button>
|
|
<template v-if="scope.row.status==3">
|
|
<el-button type="text" size="mini" @click="reject(scope.row)">驳回信息</el-button>
|
|
</template>
|
|
<template v-if="scope.row.status==4">
|
|
<el-button type="text" size="mini" @click="makeMoney(scope.row)">打款</el-button>
|
|
</template>
|
|
<template v-if="scope.row.status==5">
|
|
<el-button type="text" size="mini" @click="seeMakeMoney(scope.row)">
|
|
打款详情
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
<template v-else>
|
|
<template v-if="scope.row.status==6">
|
|
<el-button type="text" size="mini" @click="operatingReceipt(3,scope.row)">平账审核
|
|
</el-button>
|
|
</template>
|
|
<el-button v-else type="text" size="mini" @click="operatingReceipt(4,scope.row)">详情
|
|
</el-button>
|
|
<template v-if="scope.row.status==7">
|
|
<el-button type="text" size="mini" @click="reject(scope.row)">驳回信息</el-button>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-pagination @size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
:current-page="currentPage"
|
|
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]" :page-size="limit"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="total_num">
|
|
</el-pagination>
|
|
</div>
|
|
<!--打款详情-->
|
|
<el-dialog :title="settlement_data.title"
|
|
:visible.sync="showSettlementDetail"
|
|
:modal-append-to-body="false"
|
|
:append-to-body="false">
|
|
<div style="padding: 0 20px;">
|
|
<el-form label-width="136px" size="small">
|
|
<el-form-item label="结算账户类型:">
|
|
<span v-if="settlement_data.clearing_form==1">银行卡</span>
|
|
<span v-if="settlement_data.clearing_form==2">支付宝</span>
|
|
</el-form-item>
|
|
<el-form-item label="账号:">{{settlement_data.account_number}}</el-form-item>
|
|
<el-form-item v-if="settlement_data.clearing_form==1" label="开户行信息:">{{settlement_data.opening_bank}}
|
|
</el-form-item>
|
|
<el-form-item label="姓名:">{{settlement_data.name}}</el-form-item>
|
|
<el-form-item label="打款金额:">
|
|
<span style="font-weight: bold;font-size: 16px">{{settlement_data.money}}</span>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-dialog>
|
|
<!--驳回详情-->
|
|
<el-dialog :title="reject_data.title"
|
|
:visible.sync="showRejectDetail"
|
|
:modal-append-to-body="false"
|
|
:append-to-body="false">
|
|
<div style="padding: 0 20px;">
|
|
<el-form label-width="136px">
|
|
<el-form-item label="驳回时间:">{{reject_data.time}}</el-form-item>
|
|
<el-form-item label="驳回原因:">{{reject_data.reject_reason}}</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
<script type="text/javascript">
|
|
Vue.directive('load-more', {
|
|
bind(el, binding) {
|
|
// 获取element-ui定义好的scroll盒子
|
|
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
|
|
SELECTWRAP_DOM.addEventListener('scroll', function () {
|
|
const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight;
|
|
if (CONDITION) {
|
|
binding.value();
|
|
}
|
|
})
|
|
}
|
|
});
|
|
var franchiseApp = new Vue({
|
|
el: "#franchiseApp",
|
|
data: function () {
|
|
return {
|
|
total_money: '',
|
|
total_flat_money: '',
|
|
stay_money: '',
|
|
stay_flat_money: '',
|
|
store_total_money: "",
|
|
settlement: '',//结算周期
|
|
data_type: '',//结算方式
|
|
apply_time: '',//账单生成时间
|
|
status: '',//审核状态
|
|
limit: 10,
|
|
total_num: 0,
|
|
currentPage: 1,
|
|
pageSize: 10,
|
|
currentLen: 0,
|
|
settlement_interval: [
|
|
{
|
|
value: 1,
|
|
label: '日结'
|
|
}, {
|
|
value: 2,
|
|
label: '周结'
|
|
}, {
|
|
value: 3,
|
|
label: '月结'
|
|
}
|
|
],//结算周期
|
|
clearing_form: [
|
|
{
|
|
value: '1',
|
|
label: '提现'
|
|
}, {
|
|
value: '2',
|
|
label: '平账'
|
|
}
|
|
],//结算方式
|
|
audit_status: [
|
|
{
|
|
value: 1,
|
|
label: '待提现'
|
|
}, {
|
|
value: 2,
|
|
label: '提现待审核'
|
|
}, {
|
|
value: 3,
|
|
label: '提现驳回'
|
|
}, {
|
|
value: 4,
|
|
label: '提现通过待打款'
|
|
}, {
|
|
value: 5,
|
|
label: '已打款'
|
|
}, {
|
|
value: 6,
|
|
label: '平账待审核'
|
|
}, {
|
|
value: 7,
|
|
label: '平账驳回'
|
|
}, {
|
|
value: 8,
|
|
label: '已平账'
|
|
}, {
|
|
value: 9,
|
|
label: '待平账'
|
|
}, {
|
|
value: 10,
|
|
label: '无需操作'
|
|
}
|
|
],//审核状态
|
|
tableData: [],
|
|
multipleSelection: [],
|
|
settlement_data: {},//打款详情
|
|
showSettlementDetail: false,//是否显示打款详情
|
|
reject_data: {},//驳回详情
|
|
showRejectDetail: false,//是否显示打款详情
|
|
operate: {
|
|
operate: false,
|
|
accountSet: false,
|
|
},//操作权限
|
|
storeList: [],//门店列表
|
|
store_id: '',//选择的门店id
|
|
store_loading: false,//是否正在获取门店
|
|
store_page: 1,//门店分页页数
|
|
store_limit: 10,//每页获取门店数量
|
|
store_name: '',//门店搜索关键词
|
|
store_canLoad: true,//是否还有更多门店
|
|
|
|
}
|
|
},
|
|
methods: {
|
|
//获取列表数据
|
|
getData() {
|
|
$.ajax({
|
|
url: "{:U('getList')}",
|
|
type: 'post',
|
|
data: {
|
|
user_type: 1,//1商户 2门店
|
|
status: this.status, //审核状态
|
|
store_id: this.store_id, //门店id
|
|
data_type: this.data_type, //结算方式
|
|
money: this.tableData.money, //结算金额
|
|
type: this.settlement, //结算周期
|
|
start_time: this.apply_time ? this.apply_time[0] : '', //开始时间
|
|
end_time: this.apply_time ? this.apply_time[1] : '', //结束时间
|
|
page: this.currentPage,
|
|
limit: this.pageSize,
|
|
},
|
|
dataType: 'json',
|
|
success: res => {
|
|
console.log(res)
|
|
if (res.status == 1) {
|
|
this.tableData = res.data;
|
|
this.total_num = res.pages.total_num;
|
|
} else {
|
|
this.$confirm(res.msg, "错误提示", {
|
|
confirmButtonText: '确定',
|
|
showCancelButton: false,
|
|
type: 'error'
|
|
}).then(() => {
|
|
}).catch(() => {
|
|
})
|
|
}
|
|
|
|
},
|
|
error: res => {
|
|
this.requestError(res);
|
|
}
|
|
})
|
|
},
|
|
//获取统计数据
|
|
getSumTotal() {
|
|
$.ajax({
|
|
url: "{:U('getSumTotal')}",
|
|
type: 'post',
|
|
data: {
|
|
user_type: 1,//1商户 2门店
|
|
status: this.status, //审核状态
|
|
store_id: this.store_id, //门店id
|
|
data_type: this.data_type, //结算方式
|
|
money: this.tableData.money, //结算金额
|
|
type: this.settlement, //结算周期
|
|
start_time: this.apply_time ? this.apply_time[0] : '', //开始时间
|
|
end_time: this.apply_time ? (this.apply_time[1] + '23:59:59') : '', //结束时间
|
|
},
|
|
dataType: 'json',
|
|
success: res => {
|
|
if (res.status == 1) {
|
|
console.log(res);
|
|
this.total_money = res.total.total_money ? res.total.total_money : '0.00';
|
|
this.total_flat_money = res.total.total_flat_money ? res.total.total_flat_money : '0.00';
|
|
this.stay_money = res.total.stay_money ? res.total.stay_money : '0.00';
|
|
this.stay_flat_money = res.total.stay_flat_money ? res.total.stay_flat_money : '0.00';
|
|
}
|
|
},
|
|
error: res => {
|
|
this.requestError(res);
|
|
}
|
|
})
|
|
},
|
|
//错误提示
|
|
requestError(res) {
|
|
console.log(res);
|
|
this.$confirm("请求发生错误", "错误提示", {
|
|
confirmButtonText: '确定',
|
|
showCancelButton: false,
|
|
type: 'error'
|
|
}).then(() => {
|
|
}).catch(() => {
|
|
})
|
|
},
|
|
//数据导出
|
|
exports() {
|
|
var arr = [
|
|
`user_type=1`,
|
|
`store_id=${this.store_id}`,
|
|
`type=${this.settlement}`,
|
|
`data_type=${this.data_type}`,
|
|
`start_time=${this.apply_time ? this.apply_time[0] : ''}`, //开始时间
|
|
`end_time=${this.apply_time ? this.apply_time[1] : ''}`, //结束时间
|
|
`status=${this.status}`,
|
|
`id=${this.multipleSelection.join(',')}`
|
|
];
|
|
console.log(arr)
|
|
location.href = `{:U('accountCSV')}?${arr.join('&')}`;
|
|
},
|
|
|
|
handleSelectionChange(val) {
|
|
this.multipleSelection = [];
|
|
val.forEach(item => {
|
|
this.multipleSelection.push(item.id)
|
|
console.log(item)
|
|
});
|
|
console.log(val);
|
|
},
|
|
handleSizeChange: function (val) {
|
|
this.pageSize = val; //切换每页数量
|
|
this.currentPage = 1;
|
|
this.getData();
|
|
},
|
|
handleCurrentChange: function (val) {
|
|
this.currentPage = val;
|
|
this.getData(); //切换页数
|
|
},
|
|
|
|
//提现详情、提现审核、平账审核
|
|
operatingReceipt: function (type, item) {
|
|
item.operating_user = 1;//1商户 2门店
|
|
sessionStorage.setItem("operatingReceipt", JSON.stringify(item));
|
|
var title = {
|
|
1: '提现审核',
|
|
2: '提现详情',
|
|
3: '平账审核',
|
|
4: '平账详情',
|
|
};
|
|
MenuApp.pathData.push({
|
|
name: title[type],
|
|
path: '/index.php/Retail/FranchiseDeal/operatingReceipt',
|
|
onClose: () => {
|
|
this.getData();
|
|
}
|
|
})
|
|
},
|
|
//打款
|
|
makeMoney: function (item) {
|
|
sessionStorage.setItem("operatingReceipt", JSON.stringify(item));
|
|
MenuApp.pathData.push({
|
|
name: '打款',
|
|
path: '/index.php/Retail/FranchiseDeal/makeMoney',
|
|
onClose: () => {
|
|
this.getData();
|
|
}
|
|
})
|
|
},
|
|
//查看打款详情
|
|
seeMakeMoney: function (item) {
|
|
this.settlement_data = JSON.parse(item.settlement_json);
|
|
this.settlement_data.title = `打款详情 - ${item.store_name} - ${item.franchisee_time}`;
|
|
this.showSettlementDetail = true;
|
|
},
|
|
//查看驳回信息
|
|
reject: function (item) {
|
|
this.reject_data = {
|
|
title: `驳回详情 - ${item.store_name} - ${item.franchisee_time}`,
|
|
time: item.reject_time,
|
|
reject_reason: item.reject_reason,
|
|
};
|
|
this.showRejectDetail = true;
|
|
},
|
|
//结算账户设置
|
|
accountSetting: function () {
|
|
MenuApp.pathData.push({
|
|
name: '结算账户设置',
|
|
path: '/index.php/Retail/FranchiseDeal/accountSetting',
|
|
});
|
|
},
|
|
//修改门店
|
|
changeSelectStore(val) {
|
|
if (!val) {
|
|
this.searchStore();
|
|
}
|
|
},
|
|
//准备查询门店
|
|
searchStore: function (keyword) {
|
|
this.store_name = keyword;
|
|
this.store_page = 1;
|
|
this.store_canLoad = true;
|
|
this.getStoreList();
|
|
},
|
|
//获取分门店列表
|
|
getStoreList() {
|
|
if (!this.store_canLoad) {
|
|
return;
|
|
}
|
|
this.store_loading = true;
|
|
this.store_canLoad = false;
|
|
$.ajax({
|
|
url: "/index.php/Retail/Store/getStoreLimitList",
|
|
type: 'post',
|
|
data: {
|
|
page: this.store_page,
|
|
limit: this.store_limit,
|
|
store_name: this.store_name,
|
|
store_class: 2,
|
|
},
|
|
success: (res) => {
|
|
this.store_loading = false;
|
|
if (res.status == 1) {
|
|
if (this.store_page == 1) {
|
|
this.storeList = res.data;
|
|
} else {
|
|
this.storeList.push.apply(this.storeList, res.data);
|
|
}
|
|
this.store_page++;
|
|
if (this.store_limit == res.data.length) {
|
|
this.store_canLoad = true;
|
|
}
|
|
}
|
|
},
|
|
error: (data) => {
|
|
console.log(data);
|
|
this.store_loading = false;
|
|
this.$alert('请求发生错误,请稍后重试!', '错误提示', {
|
|
confirmButtonText: '确定',
|
|
callback: action => {
|
|
|
|
}
|
|
});
|
|
}
|
|
})
|
|
},
|
|
},
|
|
mounted() {
|
|
this.getData();
|
|
this.getSumTotal();
|
|
this.getStoreList();
|
|
|
|
//获取操作权限
|
|
var auth_list = {
|
|
operate: '/index.php/Retail/FranchiseDeal/status',
|
|
accountSet: '/index.php/Retail/FranchiseDeal/accountSet',
|
|
};
|
|
$.ajax({
|
|
url: "{:U('Retail/Component/checkOperateAuth')}",
|
|
type: "post",
|
|
data: {
|
|
auth_list: JSON.stringify(auth_list),
|
|
},
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.operate = res.data;
|
|
}
|
|
}
|
|
})
|
|
}
|
|
})
|
|
</script>
|