修改:消费返利 - 返利列表显示调整

添加:支持修改第7个月的返利金额,支持时间筛选临期充值
This commit is contained in:
wuhui_zzw 2024-03-23 10:50:16 +08:00
parent d0f87196aa
commit 0ed0b0928a
3 changed files with 596 additions and 125 deletions

View File

@ -5,6 +5,7 @@ namespace Yunshop\Rebate\admin;
use app\common\components\BaseController;
use app\common\facades\Setting;
use app\common\helpers\PaginationHelper;
use Illuminate\Support\Facades\DB;
use Yunshop\CollectionRoom\models\CollectionRoomModel;
use Yunshop\NewPoster\models\Poster;
use Yunshop\Rebate\models\Rebate;
@ -18,19 +19,73 @@ class IndexController extends BaseController{
* @throws \Throwable
*/
public function index(){
if(request()->isMethod('post')){
//参数获取
$pageSize = request()->input('page_size',10);
$search = request()->input('search');
// 获取列表信息
$field = [
'id',
'uid',
'order_id',
'goods_id',
'created_at',
DB::raw('sum(money) as total_money'),
DB::raw('max(status) as max_status'),
];
$result = Rebate::getGroupList($pageSize,$search,$field);
return $this->successJson('success',[
'current_page' => $result['current_page'],
'data' => $result['data'],
'last_page' => $result['last_page'],
]);
}
return view('Yunshop\Rebate::index.index')->render();
}
/**
* Common: 查看某期的返利明细
* Author: wu-hui
* Time: 2024/03/22 17:07
* @return array|\Illuminate\Http\JsonResponse|string
* @throws \Throwable
*/
public function detail(){
//参数获取
$pageSize = request()->input('page_size',10);
$search = request()->input('search');
$search = request()->input('search');
// 获取列表信息
$result = Rebate::getList($pageSize,$search);
$data = [
'list' => $result['data'],
'pager' => PaginationHelper::show($result['total'],$result['current_page'],$result['per_page']),
'search' => $search
];
return view('Yunshop\Rebate::index.index',$data)->render();
return $this->successJson('success',[
'current_page' => $result['current_page'],
'data' => $result['data'],
'last_page' => $result['last_page'],
]);
}
/**
* Common: 修改入账金额
* Author: wu-hui
* Time: 2024/03/22 18:32
* @return \Illuminate\Http\JsonResponse
*/
public function updateMoney(){
//参数获取
$id = request()->input('id');
$money = request()->input('new_money');
Rebate::uniacid()
->where('id',$id)
->where('month', 7)
->update(['money' => $money]);
return $this->successJson('success');
}
/**
* Common: 基本设置
* Author: wu-hui

View File

@ -30,14 +30,53 @@ class Rebate extends BaseModel{
* @param string[] $field
* @return array
*/
public function getList($pageSize,$search,$field = ['*']){
public static function getList($pageSize,$search,$field = ['*']){
$model = self::getSearch($search, $field)->orderBy('id','asc');
$list = $model->paginate($pageSize);
return $list ? $list->toArray() : [];
}
/**
* Common: 获取分组内容
* Author: wu-hui
* Time: 2024/03/22 17:09
* @param $pageSize
* @param $search
* @param string[] $field
* @return array
*/
public function getGroupList($pageSize,$search,$field = ['*']){
$model = self::getSearch($search, $field)
->groupBy('order_id','goods_id')
->orderBy('id','desc');
$list = $model->paginate($pageSize);
return $list ? $list->toArray() : [];
}
/**
* Common: 公共搜索内容
* Author: wu-hui
* Time: 2024/03/22 16:13
* @param $search
* @param string[] $field
* @return mixed
*/
public static function getSearch($search,array $field = ['*']){
// 条件生成
$where = [];
if($search['uid'] > 0) $where[] = ['uid','=',$search['uid']];
if($search['order_id'] > 0) $where[] = ['order_id','=',$search['order_id']];
if($search['goods_id'] > 0) $where[] = ['goods_id','=',$search['goods_id']];
if($search['quarter'] > 0) $where[] = ['quarter','=',$search['quarter']];
if($search['month'] > 0) $where[] = ['month','=',$search['month']];
if(!empty($search['time']) && is_array($search['time'])){
$start = $search['time'][0];
$end = $search['time'][1];
$where[] = ['expect_thaw_time','>=',$start];
$where[] = ['expect_thaw_time','<=',$end];
}
// 列表获取
$model = self::uniacid()
return self::uniacid()
->select($field)
->where($where)
->when(!empty($search['nickname']),function($query) use ($search){
@ -61,12 +100,7 @@ class Rebate extends BaseModel{
'goods' => function($query){
$query->select(['id','title']);
}
])
// ->orderBy('expect_thaw_time','DESC')
->orderBy('id','DESC');
$list = $model->paginate($pageSize);
return $list ? $list->toArray() : [];
]);
}

View File

@ -1,4 +1,3 @@
<script src="{!!resource_absolute('static/js/xlsx.full.min.js')!!}"></script>
@extends('layouts.base')
<style>
.user{
@ -38,126 +37,509 @@
.label{
font-size: 15px!important;
}
.el-pagination{
margin-top: 15px!important;
}
.distance{
color: #f56c6c!important;
}
</style>
@section('content')
<div class="w1200 m0a" id="storeManagerIndex">
{{--顶部搜索--}}
<div class="panel panel-info">
<div class="panel-body">
<form action="" method="post" class="form-horizontal" role="form" id="form1">
<div class="form-group">
<div class="col-sm-11 col-xs-12">
<div class="row row-fix tpl-category-container" >
<div class="col-xs-12 col-sm-8 col-lg-3">
<input class="form-control" name="search[uid]" id="" type="text" value="{{ $search['uid'] }}" placeholder="用户ID">
</div>
<div class="col-xs-12 col-sm-8 col-lg-3">
<input class="form-control" name="search[nickname]" id="" type="text" value="{{ $search['nickname'] }}" placeholder="用户昵称|真实姓名">
</div>
<div class="col-xs-12 col-sm-8 col-lg-3">
<input class="form-control" name="search[order_id]" id="" type="text" value="{{ $search['order_id'] }}" placeholder="订单id">
</div>
<div class="col-xs-12 col-sm-8 col-lg-3">
<input class="form-control" name="search[goods_id]" id="" type="text" value="{{ $search['goods_id'] }}" placeholder="商品id">
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-11 col-xs-12">
<div class="row row-fix tpl-category-container" >
<div class="col-xs-12 col-sm-8 col-lg-3">
{{--状态0=冻结中1=待结算,2=已结算3=已失效4=已退款(失效)--}}
<select class="form-control tpl-category-parent" name="search[status]">
<option value="" @if (!$search['status'] && $search['status'] != 0) selected="selected" @endif>全部</option>
<option value="0" @if ($search['status'] === '0') selected="selected" @endif>冻结中</option>
<option value="1" @if ($search['status'] == 1) selected="selected" @endif>待结算</option>
<option value="2" @if ($search['status'] == 2) selected="selected" @endif>已结算</option>
<option value="3" @if ($search['status'] == 3) selected="selected" @endif>已失效</option>
<option value="4" @if ($search['status'] == 4) selected="selected" @endif>已退款</option>
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-6 col-lg-6">
<button class="btn btn-success" id="search"><i class="fa fa-search"></i> 搜索</button>
</div>
</div>
</form>
</div>
</div>
{{--信息列表--}}
<div class="w1200 m0a" id="mainContent">
{{--列表信息--}}
<div class="panel panel-default">
<div class="panel-body" style="padding-top: 0;margin-bottom: 30px;overflow: auto;padding-right: 30px;">
<table class="table" style="min-width:1500px;overflow: auto;">
<thead>
<tr>
<th style="text-align:center;width: 80px;">ID</th>
<th style="text-align:center;">用户信息</th>
<th style="text-align:center;width: 200px;">订单商品</th>
<th style="text-align:center;">阶段时间</th>
<th style="text-align:center;width: 90px;">状态</th>
<th style="text-align:center;">预计解冻时间<br />实际解冻时间</th>
<th style="text-align:center;width: 130px;">返利金额</th>
<th style="text-align:center;width: 150px;">解冻后是否需要复购</th>
<th style="text-align:center;">下单时间</th>
</tr>
</thead>
<tbody>
@foreach ($list as $item)
<tr style="height: 50px;">
<td style="text-align:center;">{{ $item['id'] }}</td>
<td style="text-align:center;" >
<div class="user">
<div class="user-avatar">
<img class="avatar-image" src="{{$item['member']['avatar_image']}}" />
<div class="panel-body">
{{--选项卡&基础内容--}}
<el-tabs v-model="activeName">
<el-tab-pane label="返利信息" name="_list">
{{--搜索--}}
<el-form :inline="true" :model="search_info">
<el-form-item label="会员ID">
<el-input v-model="search_info.uid" placeholder="请输入会员ID"></el-input>
</el-form-item>
<el-form-item label="用户昵称">
<el-input v-model="search_info.nickname" placeholder="请输入用户昵称"></el-input>
</el-form-item>
<el-form-item label="订单ID">
<el-input v-model="search_info.order_id" placeholder="请输入订单ID"></el-input>
</el-form-item>
<el-form-item label="商品ID">
<el-input v-model="search_info.goods_id" placeholder="请输入商品ID"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="clickSearch('_list')">查询</el-button>
</el-form-item>
</el-form>
{{--表格--}}
<el-table :data="list" style="width: 100%">
<el-table-column align="center" prop="id" label="ID" width="80"></el-table-column>
<el-table-column align="center" prop="member" label="用户信息" width="230">
<template slot-scope="scope">
<div class="user">
<div class="user-avatar">
<img class="avatar-image" :src="scope.row.member.avatar_image || ''" />
</div>
<div class="user-info">
<div class="user-nickname">昵称:[[scope.row.member.nickname || '']]</div>
<div class="user-status">ID[[scope.row.member.uid || '']]</div>
</div>
</div>
<div class="user-info">
<div class="user-nickname">{{ $item['member']['username'] ? : $item['member']['nickname'] }}</div>
<div class="user-status">ID{{ $item['member']['uid'] }}</div>
</template>
</el-table-column>
<el-table-column align="center" label="订单商品" width="200">
<template slot-scope="scope">
[[ scope.row.goods.title ]]<br />
[[ scope.row.order.order_sn ]]
</template>
</el-table-column>
<el-table-column align="center" label="状态" width="110">
<template slot-scope="scope">
<el-tag v-if="[0,1,2].includes(Number(scope.row.max_status))" type="success">进行中</el-tag>
<el-tag v-else type="danger">已失效</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="total_money" label="总收益" width="130"></el-table-column>
<el-table-column align="center" prop="created_at" label="下单时间" width="200"></el-table-column>
<el-table-column align="center" prop="created_at" label="操作">
<template slot-scope="scope">
<el-button type="info" @click="seeInfo(scope.row.goods_id,scope.row.order_id)">查看明细</el-button>
</template>
</el-table-column>
</el-table>
{{--分页--}}
<el-pagination
v-if="total_page > 1"
background
layout="prev, pager, next"
:page-count="total_page"
:current-page="page"
@current-change="changePage($event, '_list')">
</el-pagination>
</el-tab-pane>
<el-tab-pane label="临期充值" name="recently">
<!--搜索-->
<el-form :inline="true" :model="recently_search_info">
{{--<el-form-item label="会员ID">--}}
{{-- <el-input v-model="recently_search_info.uid" placeholder="请输入会员ID"></el-input>--}}
{{--</el-form-item>--}}
{{--<el-form-item label="用户昵称">--}}
{{-- <el-input v-model="recently_search_info.nickname" placeholder="请输入用户昵称"></el-input>--}}
{{--</el-form-item>--}}
{{--<el-form-item label="订单ID">--}}
{{-- <el-input v-model="recently_search_info.order_id" placeholder="请输入订单ID"></el-input>--}}
{{--</el-form-item>--}}
{{--<el-form-item label="商品ID">--}}
{{-- <el-input v-model="recently_search_info.goods_id" placeholder="请输入商品ID"></el-input>--}}
{{--</el-form-item>--}}
<el-form-item label="预计入账时间">
<el-date-picker
v-model="recently_search_info.time"
type="daterange"
align="right"
unlink-panels
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="clickSearch('recently')">查询</el-button>
</el-form-item>
</el-form>
<!--表单-->
<el-table :data="recently_list" style="width: 100%">
<el-table-column align="center" prop="id" label="ID" width="80"></el-table-column>
<el-table-column align="center" prop="member" label="用户信息" width="230">
<template slot-scope="scope">
<div class="user">
<div class="user-avatar">
<img class="avatar-image" :src="scope.row.member.avatar_image || ''" />
</div>
<div class="user-info">
<div class="user-nickname">昵称:[[scope.row.member.nickname || '']]</div>
<div class="user-status">ID[[scope.row.member.uid || '']]</div>
</div>
</div>
</div>
</td>
<td style="text-align:center;">
{{ $item['goods']['title'] }}<br />
{{ $item['order']['order_sn'] }}
</td>
<td style="text-align:center;">{{ $item['quarter'] }}季度第{{ $item['month'] }}个月</td>
<td style="text-align:center;">
{{--状态0=冻结中1=待结算,2=已结算3=已失效4=已退款(失效)--}}
@switch($item['status'])
@case(0)<span class="label label-default">冻结中</span>@break
@case(1)<span class="label label-primary">待结算</span>@break
@case(2)<span class="label label-success">已结算</span>@break
@case(3)<span class="label label-danger">已失效</span>@break
@case(4)<span class="label label-danger">已退款</span>@break
@endswitch
</td>
<td style="text-align:center;">{{ $item['expect_thaw_time'] ?? '-' }}<br />{{ $item['reality_thaw_time'] ?? '-' }}</td>
<td style="text-align:center;">{{ $item['money'] ?? 0 }}</td>
<td style="text-align:center;">
{{--领取后是否需要复购0=不需要1=需要--}}
@switch($item['is_repurchase'])
@case(0)<span class="label label-default">不需要</span>@break
@case(1)<span class="label label-success">需要</span>@break
@endswitch
</td>
<td style="text-align:center;">{{ $item['created_at'] }}</td>
</tr>
@endforeach
</tbody>
</table>
{!! $pager !!}
</template>
</el-table-column>
<el-table-column align="center" label="订单商品" width="200">
<template slot-scope="scope">
[[ scope.row.goods.title ]]<br />
[[ scope.row.order.order_sn ]]
</template>
</el-table-column>
<el-table-column align="center" label="季度月度" width="150">
<template slot-scope="scope">
[[ scope.row.quarter ]]季,第[[ scope.row.month ]]
</template>
</el-table-column>
<el-table-column align="center" label="预计入账时间" width="180">
<template slot-scope="scope">
[[ scope.row.expect_thaw_time ]]<br />
<span class="distance">[[ computeTimeDistance(scope.row.expect_thaw_time) ]]</span>
</template>
</el-table-column>
<el-table-column align="center" prop="money" label="入账金额" width="150"></el-table-column>
<el-table-column align="center" label="状态" width="100">
<template slot-scope="scope">
{{--状态0=冻结中1=待结算,2=已结算3=已失效4=已退款(失效)--}}
<el-tag v-if="scope.row.status == 0" type="info" disable-transitions>冻结中</el-tag>
<el-tag v-else-if="scope.row.status == 1" type="warning" disable-transitions>待结算</el-tag>
<el-tag v-else-if="scope.row.status == 2" type="success" disable-transitions>已结算</el-tag>
<el-tag v-else-if="scope.row.status == 3" type="danger" disable-transitions>已失效</el-tag>
<el-tag v-else-if="scope.row.status == 4" type="danger" disable-transitions>已退款</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="created_at" label="操作">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0 && scope.row.month == 7" type="primary" size="small" @click="changeMoney(scope.row, 'recently')">
变更入账金额
</el-button>
</template>
</el-table-column>
</el-table>
<!--分页-->
<el-pagination
v-if="recently_total_page > 1"
background
layout="prev, pager, next"
:page-count="recently_total_page"
:current-page="recently_page"
@current-change="changePage($event, 'recently')"
></el-pagination>
</el-tab-pane>
</el-tabs>
</div>
</div>
{{--明细弹框--}}
<el-dialog title="查看明细" :visible.sync="see_details" @close="seeDetailsPopupClose" width="1200px">
<template>
<!--搜索-->
<el-form :inline="true" :model="see_search_list">
<el-form-item label="状态">
{{--状态0=冻结中1=待结算,2=已结算3=已失效4=已退款(失效)--}}
<el-select v-model="see_search_list.status" placeholder="全部">
<el-option label="冻结中" value="0"></el-option>
<el-option label="待结算" value="1"></el-option>
<el-option label="已结算" value="2"></el-option>
<el-option label="已失效" value="3"></el-option>
{{--<el-option label="已退款" value="4"></el-option>--}}
</el-select>
</el-form-item>
<el-form-item label="季度" placeholder="请输入需要查询的季度">
<el-input v-model="see_search_list.quarter"></el-input>
</el-form-item>
<el-form-item label="月度" placeholder="请输入需要查询的月度">
<el-input v-model="see_search_list.month"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="clickSearch('details')">查询</el-button>
</el-form-item>
</el-form>
<!--表单-->
<el-table :data="see_list" style="width: 100%">
<el-table-column align="center" prop="id" label="ID" width="80"></el-table-column>
<el-table-column align="center" label="季度月度" width="150">
<template slot-scope="scope">
[[ scope.row.quarter ]]季,第[[ scope.row.month ]]
</template>
</el-table-column>
<el-table-column align="center" prop="expect_thaw_time" label="预计入账时间" width="180"></el-table-column>
<el-table-column align="center" prop="reality_thaw_time" label="实际入账时间" width="180"></el-table-column>
<el-table-column align="center" prop="money" label="入账金额" width="150"></el-table-column>
<el-table-column align="center" label="状态" width="100">
<template slot-scope="scope">
{{--状态0=冻结中1=待结算,2=已结算3=已失效4=已退款(失效)--}}
<el-tag v-if="scope.row.status == 0" type="info" disable-transitions>冻结中</el-tag>
<el-tag v-else-if="scope.row.status == 1" type="warning" disable-transitions>待结算</el-tag>
<el-tag v-else-if="scope.row.status == 2" type="success" disable-transitions>已结算</el-tag>
<el-tag v-else-if="scope.row.status == 3" type="danger" disable-transitions>已失效</el-tag>
<el-tag v-else-if="scope.row.status == 4" type="danger" disable-transitions>已退款</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="复购" width="120">
<template slot-scope="scope">
{{--状态0=冻结中1=待结算,2=已结算3=已失效4=已退款(失效)--}}
<div v-if="scope.row.is_repurchase == 1">需要复购</div>
<div v-else>不需要复购</div>
</template>
</el-table-column>
<el-table-column align="center" prop="created_at" label="操作">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0 && scope.row.month == 7" type="primary" size="small" @click="changeMoney(scope.row, 'details')">
变更入账金额
</el-button>
</template>
</el-table-column>
</el-table>
<!--分页-->
<el-pagination
v-if="see_total_page > 1"
background
layout="prev, pager, next"
:page-count="see_total_page"
:current-page="see_page"
@current-change="changePage($event, 'details')"
></el-pagination>
</template>
</el-dialog>
</div>
<script type="text/javascript">
new Vue({
el: '#mainContent',
delimiters: ['[[', ']]'],
name: 'rebate',
data() {
return {
activeName: '_list',
// 基础列表
page: 1,
total_page: 1,
list: [],
search_info: {
uid: '',
nickname: '',
order_id: '',
goods_id: '',
quarter: '',
month: '',
},
// 临期充值
recently_page: 1,
recently_total_page: 1,
recently_list: [],
recently_search_info: {
uid: '',
nickname: '',
order_id: '',
goods_id: '',
month: 7,
status: 0,
time: '',
},
// 查看明细
see_details: false,
see_page: 1,
see_total_page: 1,
see_list: [],
see_search_list: {
goods_id: "",
order_id: ""
},
pickerOptions: {
shortcuts: [{
text: '今天',
onClick(picker) {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth(); // 注意月份从0开始
const day = now.getDate();
// 设置今天开始时间为00:00:00
const start = new Date(year, month, day, 0, 0, 0);
// 设置今天结束时间为23:59:59
const end = new Date(year, month, day, 23, 59, 59);
picker.$emit('pick', [start, end]);
}
}, {
text: '未来7天',
onClick(picker) {
const start = new Date();
const end = new Date();
end.setDate(end.getDate() + 7); // 在当前日期基础上增加7天
picker.$emit('pick', [start, end]);
}
}, {
text: '未来30天',
onClick(picker) {
const start = new Date();
const end = new Date();
end.setDate(end.getDate() + 30);
picker.$emit('pick', [start, end]);
}
}]
}
}
},
watch:{
"activeName"(value){
if(value == 'recently') this.recentlyList();
else this.getData();
}
},
mounted () {
this.getData();
},
methods: {
// 基础信息 - 获取数据
getData(){
let _this = this;
let loading = _this.showLoading();
// 请求获取数据
$.ajax({
url: "{!! yzWebUrl('plugin.rebate.admin.index.index') !!}",
type: "post",
data: {
page: _this.page,
search: _this.search_info,
},
success: function(result) {
let data = result.data;
if(parseInt(result.result) === 1){
// 处理数据
_this.list = data.data;
_this.total_page = data.last_page;
}
loading.close();
}
});
},
// 基础信息 - 查看明细
seeInfo(goods_id, order_id){
this.see_page = 1;
this.see_search_list.goods_id = goods_id;
this.see_search_list.order_id = order_id;
this.getList();
},
// 查看明细 - 获取列表
getList(){
let _this = this;
let loading = _this.showLoading();
$.ajax({
url: "{!! yzWebUrl('plugin.rebate.admin.index.detail') !!}",
type: "post",
data: {
page: _this.see_page,
search: _this.see_search_list
},
success: function(result) {
loading.close(0);
let data = result.data;
if(parseInt(result.result) === 1){
// 处理数据
_this.see_list = data.data;
_this.see_total_page = data.last_page;
_this.see_details = true;
}
}
});
},
// 查看明细 - 关闭弹框
seeDetailsPopupClose(){
this.see_details = false;
this.see_search_list = {};
},
// 临期充值 - 获取列表
recentlyList(){
let _this = this;
let loading = _this.showLoading();
let search = Object.assign({}, _this.recently_search_info || {});
if(Object.values(search['time'] || {}).length >= 2){
search.time[0] = Math.floor(new Date(search.time[0]).getTime() / 1000);
search.time[1] = Math.floor(new Date(search.time[1]).getTime() / 1000);
}
$.ajax({
url: "{!! yzWebUrl('plugin.rebate.admin.index.detail') !!}",
type: "post",
data: {
page: _this.recently_page,
search: search
},
success: function(result) {
loading.close(0);
let data = result.data;
if(parseInt(result.result) === 1){
// 处理数据
_this.recently_list = data.data;
_this.recently_total_page = data.last_page;
}
}
});
},
// 数据分页
changePage(val, type){
if(type == '_list'){
this.page = val;
this.getData();
}else if(type == 'details'){
this.see_page = val;
this.getList();
}else if(type == 'recently'){
this.recently_page = val;
this.recentlyList();
}
},
// 相关搜索
clickSearch(type){
if(type == '_list'){
this.page = 1;
this.getData();
}else if(type == 'details'){
this.see_page = 1;
this.getList();
}else if(type == 'recently'){
this.recently_page = 1;
this.recentlyList();
}
},
// 修改入账金额
changeMoney(info, type){
let _this = this;
_this.$prompt('当前入账金额:' + info.money, '请输入新入账金额', {
confirmButtonText: '确定修改',
cancelButtonText: '取消修改',
inputType: 'number',
}).then(({ value }) => {
let newMoney = Number(value) > 0 ? Number(value) : 0;
let msg = `确定将当前月入账金额由${info.money}元修改为${newMoney}元?`;
_this.$confirm(msg, '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
$.ajax({
url: "{!! yzWebUrl('plugin.rebate.admin.index.updateMoney') !!}",
type: "post",
data: {
id: info.id,
new_money: newMoney
},
success: function(result) {
if(type == 'recently'){
_this.recentlyList();
}else{
_this.getData();
_this.getList();
}
}
});
}).catch(() => {});
}).catch(() => {});
},
// 显示加载动画
showLoading(){
return this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
},
// 计算时间距离
computeTimeDistance(expect_thaw_time){
const now = new Date().getTime() / 1000;
const expectThawTime = new Date(expect_thaw_time).getTime() / 1000;
let diff = Number(expectThawTime) - Number(now);
let diffDay = Math.floor(diff / 86400);
if(diffDay > 0) return `${diffDay} 天后入账`;
else return '24小时内入账';
}
},
})
</script>
@endsection