record.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {extend name="../../base/view/common/base" /}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <div class="p-page">
  5. <form class="layui-form gg-form-bar border-x border-t" id="barsearchform">
  6. <div class="layui-input-inline" style="width:175px;">
  7. <input type="text" class="layui-input" id="diff_time" placeholder="选择回款时间区间" readonly name="diff_time">
  8. </div>
  9. <div class="layui-input-inline" style="width:150px">
  10. <input type="hidden" name="tab" value="0"/>
  11. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="table-search"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
  12. <button type="reset" class="layui-btn layui-btn-reset" lay-filter="table-reset">清空</button>
  13. </div>
  14. </form>
  15. <table class="layui-hide" id="test" lay-filter="test"></table>
  16. </div>
  17. <script type="text/html" id="toolbarDemo">
  18. <div class="layui-btn-container">
  19. <h3 class="h3-title" style="height:32px;">回款列表</h3>
  20. </div>
  21. </script>
  22. {/block}
  23. <!-- /主体 -->
  24. <!-- 脚本 -->
  25. {block name="script"}
  26. <script>
  27. const moduleInit = ['tool','tablePlus','laydatePlus'];
  28. function gouguInit() {
  29. var table = layui.tablePlus, tool = layui.tool, laydatePlus = layui.laydatePlus, element = layui.element;
  30. //tab切换
  31. element.on('tab(tab)', function(data){
  32. $('[name="tab"]').val(data.index);
  33. $("#barsearchform")[0].reset();
  34. layui.pageTable.reload({where:{tab:data.index},page:{curr:1}});
  35. return false;
  36. });
  37. //日期范围
  38. var diff_time = new laydatePlus({'target':'diff_time'});
  39. layui.pageTable = table.render({
  40. elem: "#test"
  41. ,toolbar: "#toolbarDemo"
  42. ,url: "/finance/income/record"
  43. ,page: true
  44. ,limit: 20
  45. ,cellMinWidth: 80
  46. ,height: 'full-114'
  47. ,cellMinWidth: 80
  48. ,page: true //开启分页
  49. ,limit: 20
  50. ,totalRow: true
  51. ,cols: [
  52. [
  53. {
  54. field: 'id',
  55. title: 'ID号',
  56. align: 'center',
  57. width: 80,
  58. totalRowText: '<div style="text-align:right">合计</div>'
  59. },{
  60. field: 'amount',
  61. title: '回款金额(元)',
  62. style: 'color:#16b777',
  63. align: 'right',
  64. width: 120,
  65. totalRow: function (d) {return d.TOTAL_ROW.amount}
  66. },{
  67. field: 'enter_time',
  68. title: '回款时间',
  69. align: 'center',
  70. width: 110
  71. },{
  72. field: 'remarks',
  73. title: '回款备注'
  74. },{
  75. field: 'admin_name',
  76. title: '登记人',
  77. align: 'center',
  78. width: 90
  79. },{
  80. field: 'create_time',
  81. title: '登记时间',
  82. align: 'center',
  83. width: 150
  84. },{
  85. field: 'code',
  86. title: '关联发票号',
  87. align: 'center',
  88. width: 150
  89. },{
  90. field: 'right',
  91. fixed: 'right',
  92. title: '操作',
  93. width: 90,
  94. align: 'center',
  95. templet:function(d){
  96. var html='<span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">回款详情</span>';
  97. return html;
  98. }
  99. }
  100. ]
  101. ]
  102. });
  103. //监听行工具事件
  104. table.on('tool(test)', function(obj) {
  105. var data = obj.data;
  106. if (obj.event === 'view') {
  107. tool.side("/finance/income/view?id="+data.invoice_id);
  108. return;
  109. }
  110. });
  111. }
  112. </script>
  113. {/block}
  114. <!-- /脚本 -->