snatchlist.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <div class="layui-fluid">
  2. <div class="layui-card">
  3. <div class="layui-form layui-form-pane layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-demand-demandlist-search">
  4. <div class="layui-form-item">
  5. <div class="layui-inline">
  6. <label class="layui-form-label">抢单者</label>
  7. <div class="layui-input-block">
  8. <select name="workerid" lay-search>
  9. <option value="">全部企业(可搜索)</option>
  10. {volist name="workerlist" id="vo"}
  11. <option value="{$vo['id']}">{$vo['title']}</option>
  12. {/volist}
  13. </select>
  14. </div>
  15. </div>
  16. <div class="layui-inline">
  17. <label class="layui-form-label">状态</label>
  18. <div class="layui-input-block">
  19. <select name="status">
  20. <option value="">全部状态</option>
  21. <option value="1">待审核</option>
  22. <option value="2">审核通过</option>
  23. <option value="3">已完成</option>
  24. </select>
  25. </div>
  26. </div>
  27. <div class="layui-inline">
  28. <button class="layui-btn" lay-submit lay-filter="LAY-demand-demandlist-btn">
  29. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  30. </button>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="layui-card-body">
  35. <table id="LAY-demand-demandlist-table" lay-filter="LAY-demand-demandlist-table"></table>
  36. <script type="text/html" id="selectStatus">
  37. <select name="status" lay-filter="status" data-value=""></select>
  38. </script>
  39. <script type="text/html" id="setTpl">
  40. {{# if(d.status == 1){ }}
  41. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="checkpass"><i class="layui-icon layui-icon-edit"></i>审核通过</a>
  42. <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="checkreject"><i class="layui-icon layui-icon-delete"></i>审核不通过</a>
  43. {{# } }}
  44. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail"><i class="layui-icon layui-icon-read"></i>订单详情</a>
  45. </script>
  46. </div>
  47. </div>
  48. </div>
  49. <script>
  50. layui.config({
  51. base: '/static/echoui/' //静态资源所在路径
  52. }).extend({
  53. index: 'lib/index' //主入口模块
  54. }).use(['index', 'form','admin', 'set', 'table'], function() {
  55. var $ = layui.$,
  56. setter = layui.setter,
  57. admin = layui.admin,
  58. form = layui.form,
  59. table = layui.table;
  60. form.render();
  61. table.render({
  62. elem: '#LAY-demand-demandlist-table',
  63. height: 'full-20',
  64. url: setter.baseAdminUrl + 'demand/snatchlist',
  65. cols: [
  66. [
  67. { field: 'id', width: 80, title: '表ID', sort: true },
  68. { field: 'worker', title: '抢单者', width: 200, toolbar: '<div>{{d.worker.title}}</div>' },
  69. { field: 'worker', title: '发单者', width: 200, toolbar: '<div>{{d.demand.worker.title}}</div>' },
  70. { field: 'demand', title: '岗位标题', minWidth: 200, toolbar: '<div>{{d.demand.title}}</div>' },
  71. { field: 'demand', title: '联系电话', width: 120, toolbar: '<div>{{d.demand.telephone}}</div>' },
  72. { field: 'num', title: '招聘人数', width: 100 },
  73. { field: 'status_text', title: '状态', width: 100 },
  74. { field: 'createtime', title: '接单时间', width: 180 },
  75. { title: '操作', width: 300, align: 'center', fixed: 'right', toolbar: '#setTpl' }
  76. ]
  77. ],
  78. page: true,
  79. limit: 50,
  80. toolbar: true,
  81. cellMinWidth: 150,
  82. text: '对不起,加载出现异常!'
  83. });
  84. form.on('submit(LAY-demand-demandlist-btn)', function(data) {
  85. table.reload('LAY-demand-demandlist-table', {
  86. where: data.field,
  87. page: {
  88. curr: 1
  89. }
  90. });
  91. });
  92. table.on('tool(LAY-demand-demandlist-table)', function(obj) {
  93. var data = obj.data;
  94. if (obj.event === 'detail') {
  95. var index = layer.open({
  96. type: 2,
  97. title: '订单信息',
  98. content: 'demanddetail.html?id=' + data.demand_id,
  99. maxmin: true,
  100. area: ['750px', '480px']
  101. });
  102. layer.full(index);
  103. } else if (obj.event === 'checkpass') {
  104. layer.confirm('确定审核通过此订单信息吗?', function(index) {
  105. admin.req({
  106. url: setter.baseAdminUrl + 'demand/snatchstatus',
  107. data: {
  108. id: data.id,
  109. status: 2,
  110. },
  111. done: function(res) {
  112. obj.del();
  113. layer.msg('审核成功');
  114. }
  115. });
  116. table.reload('LAY-demand-demandlist-table');
  117. });
  118. } else if (obj.event === 'checkreject') {
  119. layer.confirm('确定拒绝此订单信息吗?', function(index) {
  120. admin.req({
  121. url: setter.baseAdminUrl + 'demand/snatchstatus',
  122. data: {
  123. id: data.id,
  124. status: 3,
  125. },
  126. done: function(res) {
  127. obj.del();
  128. layer.msg('审核成功');
  129. }
  130. });
  131. table.reload('LAY-demand-demandlist-table');
  132. });
  133. }
  134. });
  135. });
  136. </script>