detail.blade.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. @extends('admin/layout')
  2. @section('content')
  3. <body class="gray-bg">
  4. <div class="wrapper wrapper-content animated fadeInRight">
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <div class="ibox float-e-margins">
  8. {{--<div class="ibox-title"></div>--}}
  9. <div class="ibox-content">
  10. {{--<form class="form-inline" id="searchForm">--}}
  11. {{--<div class="form-group">--}}
  12. {{--<div class="input-group">--}}
  13. {{--<span class="input-group-addon"><i class="fa fa-calendar"></i></span>--}}
  14. {{--<input type="text" title="开始时间" class="form-control lay-datetime" id="start_at"--}}
  15. {{--name="start_at">--}}
  16. {{--</div>--}}
  17. {{--</div>--}}
  18. {{-----}}
  19. {{--<div class="form-group">--}}
  20. {{--<div class="input-group">--}}
  21. {{--<span class="input-group-addon"><i class="fa fa-calendar"></i></span>--}}
  22. {{--<input type="text" title="结束时间" class="form-control lay-datetime" id="end_at"--}}
  23. {{--name="end_at">--}}
  24. {{--</div>--}}
  25. {{--</div>--}}
  26. {{--<div class="form-group" style="margin-top: 5px;">--}}
  27. {{--<div class="input-group">--}}
  28. {{--<input type="text" placeholder="请输入关键词" class="input-md form-control" name="keyword"--}}
  29. {{--id="keyword">--}}
  30. {{--<span class="input-group-btn">--}}
  31. {{--<button type="button" class="btn btn-md btn-primary"--}}
  32. {{--onclick="units.search()"> 搜索</button>--}}
  33. {{--<button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"--}}
  34. {{--name="resetBtn"> 重置</button>--}}
  35. {{--<button type="button" class="btn btn-md btn-warning" style="margin-left: 10px"--}}
  36. {{--onclick="units.settle()">结算</button>--}}
  37. {{--</span>--}}
  38. {{--</div>--}}
  39. {{--</div>--}}
  40. {{--</form>--}}
  41. {{--<hr>--}}
  42. <div class="table-responsive">
  43. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </body>
  51. @endsection
  52. @section('footer')
  53. <script>
  54. var units = {
  55. search: function () {
  56. tips.selectPage();
  57. },
  58. getIdsBySelections: function () {
  59. var selections = $("#table").bootstrapTable('getSelections');
  60. var ids = [];
  61. $.each(selections, function (inx, val) {
  62. ids = ids.concat(val.ids);
  63. });
  64. return ids;
  65. },
  66. edit: function (id) {
  67. var title = '添加';
  68. if (id > 0) {
  69. title = '编辑';
  70. }
  71. layer.open({
  72. type: 2,
  73. content: ['/admin/lading-bills/' + id],
  74. area: ['100%', '100%'],
  75. title: title
  76. });
  77. },
  78. settle: function () {
  79. var ids = units.getIdsBySelections();
  80. if (ids.length === 0) {
  81. layer.alert('请先选择您所要操作的对象', {icon: 0});
  82. return;
  83. }
  84. layer.confirm('您确定要进行结算吗?', {icon: 3, title: '删除信息'}, function () {
  85. tips.ajax({url: '/admin/finances/settle', type: 'put', data: {ids: ids}});
  86. tips.tableRefresh('#table');
  87. });
  88. }
  89. };
  90. var config = {};
  91. var ladingBillIds = JSON.parse('{{json_encode($ladingBillIds)}}');
  92. var params = '?';
  93. $.each(ladingBillIds, function (inx, val) {
  94. params += 'ladingBillIds[]=' + val + '&';
  95. });
  96. config.url = '/admin/finances/detail'+params;
  97. config.columns = [ //字段
  98. {
  99. title: '序号', align: 'center', formatter: function (value, item, index) {
  100. return index + 1;
  101. }
  102. },
  103. {title: '名称', field: 'title', align: 'center'},
  104. {title: '金额', field: 'amount', align: 'center'},
  105. {title: '结算金额', field: 'settle_amount', align: 'center'},
  106. {title: '关联项目', field: 'relate_site', align: 'center'},
  107. {title: '创建时间', field: 'created_at', align: 'center'},
  108. {
  109. visible: false, field: 'ids'
  110. }
  111. // {
  112. // title: '操作', field: 'id', align: 'center',
  113. // formatter: function (value, row) {
  114. // return (
  115. // '<button onclick="units.detail(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>查看</button>&nbsp;'
  116. // );
  117. // }
  118. // }
  119. ];
  120. tips.bootstrapTable(config);
  121. </script>
  122. @endsection