|
|
@@ -0,0 +1,430 @@
|
|
|
+
|
|
|
+{layout name="layout1" /}
|
|
|
+<style>
|
|
|
+ .layui-table-cell {
|
|
|
+ height:auto;
|
|
|
+ }
|
|
|
+ .goods-content>div:not(:last-of-type) {
|
|
|
+ bwithdrawal-bottom:1px solid #DCDCDC;
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|
|
|
+
|
|
|
+<div class="wrapper">
|
|
|
+ <div class="layui-card">
|
|
|
+ <div class="layui-card-body">
|
|
|
+ <div class="layui-collapse like-layui-collapse" lay-accordion="" style="bwithdrawal:1px dashed #c4c4c4">
|
|
|
+ <div class="layui-colla-item">
|
|
|
+ <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
|
|
|
+ <div class="layui-colla-content layui-show">
|
|
|
+ <p>*分红池资金流水记录。</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-tab layui-tab-card" lay-filter="tab-all">
|
|
|
+
|
|
|
+ <div class="layui-card-body layui-form">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <div class="layui-row">
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="layui-form-label">分红池余额:</label>
|
|
|
+ </div>
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="layui-form-label" style="color:orangered;text-align: left;">{$dividend_cash}</label>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="layui-form-label">变动类型:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <select name="change_type" id="change_type">
|
|
|
+ <option value="">全部</option>
|
|
|
+ <option value="1">增加</option>
|
|
|
+ <option value="2">减少</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="layui-form-label">记录时间:</label>
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <input type="text" name="start_time" class="layui-input" id="start_time"
|
|
|
+ placeholder="" autocomplete="off">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
|
|
|
+ <label class="layui-form-mid">至</label>
|
|
|
+ </div>
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <input type="text" name="end_time" class="layui-input" id="end_time"
|
|
|
+ placeholder="" autocomplete="off">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-inline">
|
|
|
+ <div class="layui-btn-group">
|
|
|
+ <button type="button" id="today" day="1" class="layui-btn layui-btn-sm layui-btn-normal day">今天</button>
|
|
|
+ <button type="button" day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
|
|
|
+ <button type="button" day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
|
|
|
+ <button type="button" day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-inline">
|
|
|
+ <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
|
|
|
+ lay-filter="withdrawal-search">查询
|
|
|
+ </button>
|
|
|
+ <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
|
|
|
+ lay-filter="withdrawal-clear-search">重置
|
|
|
+ </button>
|
|
|
+ <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
|
|
|
+ lay-filter="data-export">导出
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-tab-item layui-show">
|
|
|
+ <div class="layui-card">
|
|
|
+ <div class="layui-card-body">
|
|
|
+ <table id="withdrawal-lists" lay-filter="withdrawal-lists"></table>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+ layui.config({
|
|
|
+ version:"{$front_version}",
|
|
|
+ base: '/static/lib/' //静态资源所在路径
|
|
|
+ }).use(['form'], function(){
|
|
|
+ var $ = layui.$
|
|
|
+ , form = layui.form
|
|
|
+ , table = layui.table
|
|
|
+ , element = layui.element
|
|
|
+ , laydate = layui.laydate;
|
|
|
+
|
|
|
+ //图片放大
|
|
|
+ $(document).on('click', '.image-show', function () {
|
|
|
+ var src = $(this).attr('src');
|
|
|
+ like.showImg(src,600);
|
|
|
+ });
|
|
|
+
|
|
|
+ //监听搜索
|
|
|
+ form.on('submit(withdrawal-search)', function (data) {
|
|
|
+ var field = data.field;
|
|
|
+ //执行重载
|
|
|
+ table.reload('withdrawal-lists', {
|
|
|
+ where: field,
|
|
|
+ page: {
|
|
|
+ curr: 1
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ //清空查询
|
|
|
+ form.on('submit(withdrawal-clear-search)', function () {
|
|
|
+ $('#change_type').val('');
|
|
|
+ $('#start_time').val('{$today[0]}');
|
|
|
+ $('#end_time').val('{$today[1]}');
|
|
|
+ $('#today').trigger("click");
|
|
|
+ form.render('select');
|
|
|
+ //刷新列表
|
|
|
+ table.reload('withdrawal-lists', {
|
|
|
+ where: [],
|
|
|
+ page: {
|
|
|
+ curr: 1
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 导出
|
|
|
+ form.on('submit(data-export)', function (data) {
|
|
|
+ var field = data.field;
|
|
|
+ like.ajax({
|
|
|
+ url: '{:url("finance.dividend/cashExport")}'
|
|
|
+ , data: field
|
|
|
+ , type: 'get'
|
|
|
+ , success: function (res) {
|
|
|
+ if (res.code == 1) {
|
|
|
+ window.location.href = res.data.url;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ //日期时间范围
|
|
|
+ laydate.render({
|
|
|
+ elem: '#start_time'
|
|
|
+ , type: 'datetime'
|
|
|
+ ,theme: '#1E9FFF'
|
|
|
+ , value: "{$today[0]}"
|
|
|
+ });
|
|
|
+
|
|
|
+ laydate.render({
|
|
|
+ elem: '#end_time'
|
|
|
+ , type: 'datetime'
|
|
|
+ ,theme: '#1E9FFF'
|
|
|
+ ,value: "{$today[1]}"
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ //获取列表
|
|
|
+ getList('');
|
|
|
+ //切换列表
|
|
|
+ element.on('tab(tab-all)', function (data) {
|
|
|
+ $('#change_type').val('');
|
|
|
+ $('#start_time').val('{$today[0]}');
|
|
|
+ $('#end_time').val('{$today[1]}');
|
|
|
+ $('#today').trigger("click");
|
|
|
+ form.render('select');
|
|
|
+ var type = $(this).attr('data-type');
|
|
|
+ getList(type);
|
|
|
+ if (type !== ''){
|
|
|
+ $('.withdrawal_status').hide();
|
|
|
+ }else {
|
|
|
+ $('.withdrawal_status').show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ function getList(type) {
|
|
|
+ table.render({
|
|
|
+ elem: '#withdrawal-lists'
|
|
|
+ , url: '{:url("finance.dividend/dividend_cash")}'
|
|
|
+ , cols: [[
|
|
|
+ {field: 'id', title: 'ID', align: 'center',width:80}
|
|
|
+ , {field: 'change_type_desc', title: '变动类型', align: 'center',width:180}
|
|
|
+ , {field: 'change_money', title: '变动金额', align: 'center',width:180}
|
|
|
+ , {field: 'total_money', title: '剩余金额', align: 'center',width:180}
|
|
|
+ , {field: 'order_sn', title: '来源单号', align: 'center',width:210}
|
|
|
+ , {field: 'remark', title: '备注', align: 'center'}
|
|
|
+ , {field: 'create_time', title: '记录时间', align: 'center',width:205}
|
|
|
+ ]]
|
|
|
+ , page: true
|
|
|
+ , text: {none: '暂无数据!'}
|
|
|
+ ,response: {
|
|
|
+ statusCode: 1
|
|
|
+ }
|
|
|
+ , parseData: function (res) {
|
|
|
+ return {
|
|
|
+ "code": res.code,
|
|
|
+ "msg": res.msg,
|
|
|
+ "count": res.data.count,
|
|
|
+ "data": res.data.lists,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ ,done: function(res, curr, count){
|
|
|
+ // 解决操作栏因为内容过多换行问题
|
|
|
+ $(".layui-table-main tr").each(function (index, val) {
|
|
|
+ $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
|
|
|
+ $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //监听工具条
|
|
|
+ table.on('tool(withdrawal-lists)', function (obj) {
|
|
|
+ var id = obj.data.id;
|
|
|
+ if(obj.event === 'detail'){
|
|
|
+ layer.open({
|
|
|
+ type: 2
|
|
|
+ ,title: '订单详情'
|
|
|
+ ,content: '{:url("withdrawal.withdrawal/detail")}?id='+id
|
|
|
+ ,area: ['90%', '90%']
|
|
|
+ ,yes: function(index, layero){
|
|
|
+ table.reload('withdrawal-lists');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //删除订单
|
|
|
+ if(obj.event === 'del'){
|
|
|
+ layer.confirm('删除后订单将消失,确认删除订单吗?', {
|
|
|
+ btn: ['确认','取消'] //按钮
|
|
|
+ }, function(){
|
|
|
+ like.ajax({
|
|
|
+ url: '{:url("withdrawal.withdrawal/del")}'
|
|
|
+ , data: {'withdrawal_id': id}
|
|
|
+ , type: 'post'
|
|
|
+ , success: function (res) {
|
|
|
+ if (res.code == 1) {
|
|
|
+ layui.layer.msg(res.msg, {
|
|
|
+ offset: '15px'
|
|
|
+ , icon: 1
|
|
|
+ , time: 1100
|
|
|
+ },function () {
|
|
|
+ table.reload('withdrawal-lists');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //取消订单
|
|
|
+ if(obj.event === 'cancel'){
|
|
|
+ layer.confirm('确认取消订单吗?', {
|
|
|
+ btn: ['确认','取消'] //按钮
|
|
|
+ }, function(){
|
|
|
+ like.ajax({
|
|
|
+ url: '{:url("withdrawal.withdrawal/cancel")}'
|
|
|
+ , data: {'withdrawal_id': id}
|
|
|
+ , type: 'post'
|
|
|
+ , success: function (res) {
|
|
|
+ if (res.code == 1) {
|
|
|
+ layui.layer.msg(res.msg, {
|
|
|
+ offset: '15px'
|
|
|
+ , icon: 1
|
|
|
+ , time: 1100
|
|
|
+ },function () {
|
|
|
+ table.reload('withdrawal-lists');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //发货
|
|
|
+ if(obj.event === 'delivery'){
|
|
|
+ layer.open({
|
|
|
+ type: 2
|
|
|
+ ,title: '订单发货'
|
|
|
+ ,content: '{:url("withdrawal.withdrawal/delivery")}?id='+id
|
|
|
+ ,area: ['90%', '90%']
|
|
|
+ ,yes: function(index, layero){
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //物流信息
|
|
|
+ if(obj.event === 'express'){
|
|
|
+ layer.open({
|
|
|
+ type: 2
|
|
|
+ ,title: '订单发货'
|
|
|
+ ,content: '{:url("withdrawal.withdrawal/express")}?id='+id
|
|
|
+ ,area: ['90%', '90%']
|
|
|
+ ,yes: function(index, layero){
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //确认收货
|
|
|
+ if(obj.event === 'confirm'){
|
|
|
+ layer.confirm('确认订单商家已收货吗?', {
|
|
|
+ btn: ['确认','取消'] //按钮
|
|
|
+ }, function(){
|
|
|
+ like.ajax({
|
|
|
+ url: '{:url("withdrawal.withdrawal/confirm")}'
|
|
|
+ , data: {'withdrawal_id': id}
|
|
|
+ , type: 'post'
|
|
|
+ , success: function (res) {
|
|
|
+ if (res.code == 1) {
|
|
|
+ layui.layer.msg(res.msg, {
|
|
|
+ offset: '15px'
|
|
|
+ , icon: 1
|
|
|
+ , time: 1100
|
|
|
+ },function () {
|
|
|
+ table.reload('withdrawal-lists');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //商家备注
|
|
|
+ if(obj.event === 'remarks') {
|
|
|
+
|
|
|
+ like.ajax({
|
|
|
+ url: '{:url("withdrawal.withdrawal/remarks")}'
|
|
|
+ , data: {'id': id}
|
|
|
+ , type: 'get'
|
|
|
+ , success: function (res) {
|
|
|
+ if (res.code === 1) {
|
|
|
+ layer.prompt({title: '备注信息', formType: 2, value: res.data.withdrawal_remarks}, function(value, index){
|
|
|
+ layer.close(index);
|
|
|
+ like.ajax({
|
|
|
+ url: '{:url("withdrawal.withdrawal/remarks")}'
|
|
|
+ , data: {'id': id, "withdrawal_remarks": value }
|
|
|
+ , type: 'post'
|
|
|
+ , success: function (res) {
|
|
|
+ if (res.code === 1) {
|
|
|
+ layui.layer.msg(res.msg, {
|
|
|
+ offset: '15px'
|
|
|
+ , icon: 1
|
|
|
+ , time: 1100
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(obj.event ==='print'){
|
|
|
+ layer.confirm('确定要打印订单吗?', function(index){
|
|
|
+ like.ajax({
|
|
|
+ url:'{:url("withdrawal.withdrawal/withdrawalPrint")}',
|
|
|
+ data:{id:id},
|
|
|
+ type:"post",
|
|
|
+ success:function(res)
|
|
|
+ {
|
|
|
+ if(res.code == 1)
|
|
|
+ {
|
|
|
+ layui.layer.msg(res.msg, {
|
|
|
+ offset: '15px'
|
|
|
+ , icon: 1
|
|
|
+ , time: 1100
|
|
|
+ });
|
|
|
+ layer.close(index); //关闭弹层
|
|
|
+ table.reload('printer-lists'); //数据刷新
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ layer.close(index);
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.day').click(function(){
|
|
|
+ $('.day').removeClass('layui-btn-normal');
|
|
|
+ $('.day').removeClass('layui-btn-primary');
|
|
|
+ $('.day').addClass('layui-btn-primary');
|
|
|
+ $(this).removeClass('layui-btn-primary');
|
|
|
+ $(this).addClass('layui-btn-normal');
|
|
|
+ var day = $(this).attr('day');
|
|
|
+ switch (day) {
|
|
|
+ case '-1':
|
|
|
+ $('#start_time').val('{$yesterday[0]}');
|
|
|
+ $('#end_time').val('{$yesterday[1]}');
|
|
|
+ break;
|
|
|
+ case '1':
|
|
|
+ $('#start_time').val('{$today[0]}');
|
|
|
+ $('#end_time').val('{$today[1]}');
|
|
|
+ break;
|
|
|
+ case '7':
|
|
|
+ $('#start_time').val('{$days_ago7[0]}');
|
|
|
+ $('#end_time').val('{$days_ago7[1]}');
|
|
|
+ break;
|
|
|
+ case '30':
|
|
|
+ $('#start_time').val('{$days_ago30[0]}');
|
|
|
+ $('#end_time').val('{$days_ago30[1]}');
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|