canyin-project/ybcy/views/admin/apply/platform_payment.php

333 lines
15 KiB
PHP
Raw Normal View History

2024-11-01 16:07:54 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<?php if ($this->params['site_image']): ?>
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->params['site_image']; ?>"/>
<?php else: ?>
<link rel="shortcut icon" type="image/x-icon" href="<?= Yii::$app->request->baseUrl ?>/web/favicon.ico"/>
<?php endif; ?>
<title> <?php if ($this->params['site_title']): ?>
<?php echo $this->params['site_title']; ?>
<?php else: ?>
应用管理后台
<?php endif; ?>-支付通道设置</title>
<link rel="stylesheet" type="text/css" href="<?= Yii::$app->request->baseUrl ?>/web/static/css/globle.css"/>
<script src="<?= Yii::$app->request->baseUrl ?>/web/static/js/config.js" type="text/javascript"
charset="utf-8"></script>
</head>
<style>
.mar_l20b {
margin-left: 20%;
}
.icon_width {
width: 56px;
height: 56px;
}
.main_search_con .elinput {
width: 300px;
}
.search_button .el-button, .tit_button .el-button {
width: 104px;
height: 38px;
}
.tjpt .el-button {
width: 130px;
height: 38px;
}
.namelogo {
width: 40px;
height: 40px;
border-radius: 50%;
}
</style>
<body>
<div class="head">
<div class="publicHeader"><?php echo $this->render('@app/views/admin/public/publicHeader.html'); ?></div>
</div>
<div class="left">
<div class="publicAside"><?php echo $this->render('@app/views/admin/public/publicAside.html'); ?></div>
</div>
<div class="yb_body">
<div class="layout" id="platformList" v-cloak v-loading="cardLoading">
<el-container>
<el-container>
<el-main>
<div class="main" style="min-width: 800px">
<div class="main-search pad_30 ba_f bor_rad5">
<div class="main_search_tit t_l fon_16 wei">支付通道设置</div>
<div class="main_search_con fon_14">
<div class="flex pad_tb_20">
<div class="mar_r30">
<el-input v-model="formInline.channel_name" placeholder="搜索支付通道名称"
class="elinput"></el-input>
</div>
<div>创建日期:</div>
<div class="mar_r30">
<el-date-picker v-model="formInline.data" type="daterange"
range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
<div class="search_button flex">
<el-button type="primary" @click="search(formInline)">查询</el-button>
<div class="tjpt mar_l20">
<a href="javascript:void(0)">
<el-button @click.native="toAdd" type="primary">新增支付通道</el-button>
</a>
</div>
<!-- <el-button>导出</el-button>-->
</div>
</div>
</div>
</div>
<div class="main-table pad_30 mar_t20 ba_f bor_rad5">
<!-- <div class="table-tit flex-bet">-->
<!-- <div class="flex">-->
<!-- <div class="color_9 fon_14">已选择<span class="mar_lr10 color_rb wei">{{lengthNum || 0}}</span>个支付通道-->
<!-- </div>-->
<!-- <div class="mar_l50 tit_button">-->
<!-- <el-button @click="deactivation()" type="danger" plain>停用</el-button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="mar_t30 fon_14 color_3">
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark"
style="width: 100%" @selection-change="handleSelectionChange"
:header-cell-style="{'text-align':'left'}">
<!-- <el-table-column type="selection" width="55"></el-table-column>-->
<el-table-column prop="channel_id" label="支付通道ID" width="130">
<template slot-scope="scope">
<div class="">{{scope.row.channel_id}}</div>
</template>
</el-table-column>
<el-table-column label="支付通道名称" prop="channel_name" align="left">
<template slot-scope="scope">
<div class="flex pad_tb_10">
<div class="flex-col mar_l20">
<div class="overflowlnr">{{scope.row.channel_name}}</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<div class="">{{scope.row.status_name}}</div>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间">
<template slot-scope="scope">
<div class="">{{scope.row.create_time}}</div>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<div class="textbutton">
<el-button type="text" class="fon_14"
@click="edit(scope.row.channel_id)">
编辑
</el-button>
<el-button v-if="scope.row.status == 1" type="text" class="fon_14" @click="del(scope.row.channel_id)">
停用
</el-button>
<el-button v-else type="text" class="fon_14" @click="open(scope.row.channel_id)">
启用
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="t_l">
<el-pagination background layout="prev, pager, next" :total="total"
:page-size="pagesize"
@current-change="current_change">
</el-pagination>
</div>
</div>
</div>
</div>
</el-main>
</el-container>
</el-container>
</div>
</div>
<script>
$(document).ready(function () {
$(".slimScrollDiv ul .main-nav-li a").eq(1).addClass("menu_active");
$(".main-nav .main-nav-li .submenu").eq(1).addClass("block");
$(".main-nav .main-nav-li .submenu").children().children().eq(1).addClass("menu_active2")
});
</script>
<script>
new Vue({
el: '#platformList',
created() {
this.init();
},
data: function () {
return {
cardLoading: true,
formInline: {
apply_type: '',
apply_name: '',
phone: '',
desc: '',
data: '',
},
checked: true,
tableData: [],
checkId: [],
lengthNum: '',
total: 0,
pagesize: 10,
currentPage: 1,
}
},
methods: {
//初始化
async init() {
var params = {
page: this.currentPage,
}
res = await utils.requestGet({
data: params,
url: "admin/apply/getpaychannellist"
}, this)
if (res.code == 1) {
this.cardLoading = false
this.tableData = res.data
this.total = res.count
}
},
//搜索
async search(formInline) {
console.log(formInline)
let start_time = '';
let end_time = '';
if (this.formInline.data) {
start_time = utils.changeDate(this.formInline.data[0])
end_time = utils.changeDate(this.formInline.data[1])
}
var requstData = {
channel_name: formInline.channel_name,
start_time: start_time,
end_time: end_time,
}
this.tableData = []
res = await utils.requestPost({
data: requstData,
url: "admin/apply/paychennelbysearch"
}, this)
if (res.code == 1) {
this.tableData = res.data
this.total = res.count
}
},
//切换分页
current_change: function (currentPage) {
this.currentPage = currentPage;
this.init()
},
async edit(channel_id) {
location.href ="<?= Yii::$app->urlManager->createUrl('admin/apply/payment_edit');?>"+"?id="+channel_id;
},
async del(id) {
await utils.showConfirm({content: '停用后,该支付通道将停止使用,确定?'}, this)
var requstData = {
id: id,
status: 2,
}
res = await utils.requestPost({
data: requstData,
url: "admin/apply/stoppaychannel"
}, this)
if (res.code == 1) {
this.$message({
type: 'success',
message: '操作成功!',
duration: 500,
onClose: () => {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_payment');?>" + "?id=" + this.id;
},
});
}
},
async open(id) {
await utils.showConfirm({content: '确定继续启用该支付通道,确定?'}, this)
var requstData = {
id: id,
status: 1,
}
res = await utils.requestPost({
data: requstData,
url: "admin/apply/openpaychannel"
}, this)
if (res.code == 1) {
this.$message({
type: 'success',
message: '操作成功!',
duration: 500,
onClose: () => {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_payment');?>";
},
});
}
},
async tourl(id, userId) {
if (!userId) {
await utils.showConfirm({content: '该平台暂未设置操作员账号,请先添加操作员账号,再进行管理!'}, this)
// this.$message.error('请完善用户信息')
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_userm');?>" + "?id=" + id;
} else {
window.open("<?= Yii::$app->urlManager->createUrl('channel/login/url-redirect');?>" + "?channelUserId=" + id)
}
},
toAdd() {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/payment_add');?>";
},
//表格选择框数据-多选框
handleSelectionChange(val) {
console.log(val)
if (val) {
let setctId = []
this.lengthNum = val.length
val.forEach(row => {
setctId.push(row.channel_id);
});
this.checkId = setctId
}
},
//点击停用
async deactivation() {
await utils.showConfirm({content: '此操作将停用该支付通道, 是否继续?'}, this)
var requstData = {
id: this.checkId,
status: 2,
}
res = await utils.requestPost({
data: requstData,
url: "admin/apply/delpaychannel"
}, this)
if (res.code == 1) {
this.$message({
type: 'success',
message: '操作成功!',
duration: 500,
onClose: () => {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_payment');?>";
},
});
}
}
}
})
</script>
</body>
</html>