2023-01-29 10:26:52 +08:00

364 lines
12 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{extend name="public/base" /}
{block name="body"}
<style>
.clear{clear:both;height:0px;line-height:0px;width:1px;}
.clear20{clear:both;height:20px;line-height:20px;width:1px;}
.clear10{clear:both;height:10px;line-height:10px;width:1px;}
.tttr th{text-align: center;}
.tttr td{text-align: center;}
.cids{letter-spacing:1px;font-weight:600;color:#1f283a;}
.th-cid{color:#fff;background:#619dce;}
.th-num{color:#fff;background:#64ccc4;}
.th-m{color: #fff;background:#cc8b6a;}
.th-h{color:#fff;background: #7c98d8;}
.th-q{color:#fff;background:hsl(138, 82%, 35%);}
.inlineCheckbox{width:35px;height:35px;}
.td-num{color: #22353d;}
.td-m{color: red;}
.td-h{color:#1c3a37;}
.table tbody>tr>td:first-child{letter-spacing:1px;font-weight:600;color:#1f283a;}
.sum-div{
width:90%;
height:90px;
background: #fff;
position: fixed;
top:8.6%;
right: 0;
box-shadow: 1px 2px 3px #999999;
display:none;
}
.sum-li{
width:25%;
float: left;
}
.sum-li p{
margin-top:5%;
font-size:18px;
text-align: center;
}
.sum-li span{
font-size:17px;
text-align: center;
display: block;
}
.red{color:red}
.cont{display: flex;justify-content: center;align-items: center;}
.wd50{width:50px;}
.widh35{height:28px;font-size:12px;text-align:center;margin-left:6px;}
.zycon{display: flex;justify-content: space-between;}
.log{
width:100%;
height:66px;
background: #fff;
display: flex;
align-items: center;
padding-left:20px;
}
</style>
<div class="main-box-body clearfix" id="app">
<div class="log">
<el-button type="primary" @click="getlogs()">自动控户日志</el-button>
<el-button type="primary" @click="getcopylogs()">自动复制计划日志</el-button>
<el-button type="success" @click="getcopylogs()">开启自动复制</el-button>
</div>
<el-dialog title="自动控户日志" :visible.sync="dialogTableVisible" width="80%">
<el-table
height="388"
border
v-loading="loading"
:data="logs.filter(data => !search || data.log.toLowerCase().includes(search.toLowerCase()))"
style="width: 100%">
<el-table-column
label="时间"
prop="addtime"
width="110">
</el-table-column>
<el-table-column
label="详情"
prop="log"
width="666">
</el-table-column>
<el-table-column
align="right"
width="188">
<template slot="header" slot-scope="scope">
<el-input
v-model="search"
size="mini"
placeholder="输入计划名称"/>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="自动复制计划日志" :visible.sync="dialogTableVisible2" width="80%">
<el-table
height="388"
border
v-loading="loading"
:data="copylogs.filter(data => !search || data.log.toLowerCase().includes(search.toLowerCase()))"
style="width: 100%">
<el-table-column
label="时间"
prop="addtime"
width="110">
</el-table-column>
<el-table-column
label="详情"
prop="log"
width="666">
</el-table-column>
<el-table-column
align="right"
width="188">
<template slot="header" slot-scope="scope">
<el-input
v-model="search"
size="mini"
placeholder="输入关键字"/>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
<div class="main-box clearfix">
<div class="main-box-body clearfix">
<div class="clear10"></div>
<p class="text-success">{$text}</p>
<table class="table table-bordered bj" id="table" cellspacing="0" cellpadding="2" border="1">
<thead>
<tr class="tttr">
<th class="th-cid">计划名称</th>
<th class="th-cid">计划ID</th>
<th class="th-cid">回传比例</th>
<th class="th-cid">用户数</th>
<th class="th-cid">充值笔数</th>
<th class="th-cid">充值金额</th>
<th class="th-cid">消耗金额</th>
<th class="th-cid">自然回传</th>
<th class="th-cid">不回传</th>
<th class="th-cid">人为回传</th>
<th class="th-cid">回传详情</th>
<th class="th-cid">用户分析</th>
</tr>
</thead>
<tbody id="table" cellspacing="0" cellpadding="2" border="1">
{volist name="list" id="v" key="k"}
<tr class="tttr">
<td>{$v.adName}</td>
<td>{$v.adId}</td>
<td>
{if $isopen==1}
{$v.value}
{else}
<div class="cont">
<input type="text" class="text-center wd50" value="{$v.value}" id="one{$v.adId}" onkeyup="value=value.replace(/[^\d+(\.\d+)?$]/g,'')">
<button class="btn btn-danger widh35" onclick="setone('{$trId}','{$v.adId}','{$v.adName}')">设置</button>
</div>
{/if}
</td>
<td>{$v.reg}</td>
<td>{$v.paynum}</td>
<td class="red">{$v.mon}</td>
<td class="red">{$v.statCost}</td>
<td>{$v.success}</td>
<td>{$v.not}</td>
<td>{$v.control}</td>
<td class="cont"><a href="/admin/transfer/planreturnlog?id={$trId}&adid={$v.adId}&aidname={$v.adName}"><button class="btn btn-danger">查看</button></a></td>
<td><a href="/admin/userreturninfo/index?id={$trId}&adid={$v.adId}&aidname={$v.adName}"><button class="btn btn-danger">查看</button></a></td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
{/block}
{block name="script"}
<script src = "/public/js/colResizable-1.6.min.js" ></script>
<!-- datepicker statr -->
<link href="/public/plugs/datepicker/css/foundation-datepicker.min.css" rel="stylesheet" type="text/css">
<script src="/public/plugs/datepicker/js/foundation-datepicker.js"></script>
<script src="/public/plugs/datepicker/js/foundation-datepicker.zh-CN.js"></script>
<script>
$(function(){
//此处实现表格可拖放属性
$("#table").colResizable({
liveDrag:true,//实现实时拖动,可看见拖动轨迹
draggingClass:"dragging", //防止拖动出险虚标线
resizeMode: "overflow" //表的宽度可以超过父级宽度
});
$('#startdata').fdatepicker({
clearBtn: true,
todayBtn: true,
format: 'yyyy-mm-dd h:i',
pickTime: true
});
$('#enddata').fdatepicker({
clearBtn: true,
todayBtn: true,
format: 'yyyy-mm-dd h:i',
pickTime: true
});
});
// 验证表单
function verificationfrom() {
var formtime = $('#formtime');
if (formtime.find('input:eq(0)').val() == '') {
swal('错误', '时间错误', { icon: "error", buttons: { confirm: { className: 'btn btn-danger' } }, });
} else if (formtime.find('input:eq(1)').val() == '') {
swal('错误', '时间错误', { icon: "error", buttons: { confirm: { className: 'btn btn-danger' } }, });
} else {
formtime.submit();
}
}
function openplan(id,t){
if(t===1){
var txt = '确定切换为按计划回传?'
}else{
var txt = '确定切换为按落地页回传?'
}
swal({
title: '操作',
text: txt,
type: 'warning',
buttons: {
confirm: {
text: '确认',
className: 'btn btn-success'
},
cancel: {
text: '取消',
visible: true,
className: 'btn btn-danger'
}
}
}).then((Delete) => {
if (Delete) {
swal("切换中......", {buttons: false,timer: 3000,});
$.ajax({
type: "POST",
url: "{:url('Transfer/openplan')}",
data: { id: id, t:t},
dataType: "json",
success: function (data) {
if (data.status == 1) {
swal('操作', data.reg, { icon: "success", buttons: { confirm: { className: 'btn btn-success' } }, });
window.location = '';
} else {
swal('错误', data.reg, { icon: "error", buttons: { confirm: { className: 'btn btn-danger' } }, });
}
}
});
} else {
swal.close();
}
});
}
//设置单条比例
function setone(id,adid,aidname){
var value=$('#one'+adid).val()
if(value && value<=100){
swal({
title: '操作',
text: '确认修改 '+aidname+' 的回传比例为 '+value+' ',
type: 'warning',
buttons: {
confirm: {
text: '确认',
className: 'btn btn-success'
},
cancel: {
text: '取消',
visible: true,
className: 'btn btn-danger'
}
}
}).then((Delete) => {
if (Delete) {
$.ajax({
type: "POST",
url: "{:url('Transfer/oneplan')}",
data: { id: id, adid:adid,val:value},
dataType: "json",
success: function (data) {
if (data.status == 1) {
swal('操作', data.reg, { icon: "success", buttons: { confirm: { className: 'btn btn-success' } }, });
window.location = '';
} else {
swal('错误', data.reg, { icon: "error", buttons: { confirm: { className: 'btn btn-danger' } }, });
}
}
});
} else {
swal.close();
}
});
}else{
swal('错误', '不能超过100或不能为空', { icon: "error", buttons: { confirm: { className: 'btn btn-danger' } }, });
}
}
var app = new Vue({
el: '#app',
data: {
formLabelWidth: '200px',
dialogTableVisible:false,
dialogTableVisible2:false,
copylogs:[],
logs:[],
search:'',
loading:false,
},
methods: {
getlogs(){
this.dialogTableVisible = true
this.loading = true;
var that = this
$.ajax({
type: "POST",
url: "{:url('Postbackconfig/getlogs')}",
data: {tid:"{$trId}"},
dataType: "json",
success: function(data) {
if (data.status == 1) {
that.logs = data.logs
console.log(that.logs)
}
that.loading = false
}
});
},
getcopylogs(){
this.dialogTableVisible2 = true
this.loading = true;
var that = this
$.ajax({
type: "POST",
url: "{:url('Plancopy/copylogs')}",
data: {tid:"{$trId}"},
dataType: "json",
success: function(data) {
if (data.status == 1) {
that.copylogs = data.logs
}
that.loading = false
}
});
},
},
})
</script>
{/block}