reportlist.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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="reportlist-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="comjobsid" lay-search>
  9. <option value="">全部招聘信息(可搜索)</option>
  10. {volist name="comjobslist" 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="agentid" lay-search>
  20. <option value="">全部代理门店(可搜索)</option>
  21. <option value="0">未报备</option>
  22. {volist name="agentlist" id="vo"}
  23. <option value="{$vo['id']}">{$vo['title']}</option>
  24. {/volist}
  25. </select>
  26. </div>
  27. </div>
  28. <div class="layui-inline">
  29. <label class="layui-form-label">状态</label>
  30. <div class="layui-input-block">
  31. <select name="status">
  32. <option value="">全部状态</option>
  33. {volist name="statusarr" id="vo" key="k"}
  34. <option value="{$k}">{$vo}</option>
  35. {/volist}
  36. </select>
  37. </div>
  38. </div>
  39. <div class="layui-form-item">
  40. <div class="layui-inline">
  41. <label class="layui-form-label">日期范围</label>
  42. <div class="layui-input-inline">
  43. <input type="text" class="layui-input" id="test6" placeholder=" ~ ">
  44. </div>
  45. </div>
  46. <div class="layui-inline">
  47. <button class="layui-btn" lay-submit lay-filter="reportlist-search-btn">
  48. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  49. </button>
  50. <button class="layui-btn" lay-submit lay-filter="reportlist-export-btn">
  51. 导出
  52. </button>
  53. <!-- <button class="layui-btn" lay-submit lay-filter="reportlist-repeat-btn">-->
  54. <!-- 重复-->
  55. <!-- </button>-->
  56. </div>
  57. </div>
  58. </div>
  59. <div class="layui-card-body">
  60. <div class="layui-form layui-form-pane" lay-filter="reportlist-setstatus" style="padding-bottom: 0px;">
  61. <div class="layui-form-item">
  62. <div class="layui-inline" id="refundbox"> </div>
  63. <div class="layui-inline">
  64. <label class="layui-form-label">状态</label>
  65. <div class="layui-input-inline">
  66. <select name="setstatus" lay-filter="setstatus">
  67. <option value="">选择状态</option>
  68. {volist name="statusarr" id="vo" key="k"}
  69. <option value="{$k}">{$vo}</option>
  70. {/volist}
  71. </select>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <table id="reportlist-table" lay-filter="reportlist-table"></table>
  77. <script type="text/html" id="statusTpl">
  78. {{# if(d.status_text === '待审核'){ }}
  79. <span style="background: #F581B1;">{{ d.status_text }}</span>
  80. {{# } else { }}
  81. {{ d.status_text }}
  82. {{# } }}
  83. </script>
  84. <script type="text/html" id="tabletoolbar">
  85. <div class="layui-btn-container">
  86. <button class="layui-btn layui-btn-sm" lay-event="batchdel">批量删除</button>
  87. <button class="layui-btn layui-btn-sm" lay-event="setstatus">批量修改状态</button>
  88. <button class="layui-btn layui-btn-sm" lay-event="add">添加报备信息</button>
  89. </div>
  90. </script>
  91. <script type="text/html" id="setTpl">
  92. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
  93. <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
  94. </script>
  95. </div>
  96. </div>
  97. </div>
  98. <script>
  99. layui.config({
  100. base: '/static/echoui/' //静态资源所在路径
  101. }).extend({
  102. index: 'lib/index' //主入口模块
  103. }).use(['index', 'form', 'set', 'table', 'selectN', 'selectM','laydate'], function() {
  104. var $ = layui.$,
  105. setter = layui.setter,
  106. admin = layui.admin,
  107. form = layui.form,
  108. table = layui.table,
  109. selectN = layui.selectN,
  110. selectM = layui.selectM;
  111. var laydate = layui.laydate;
  112. var date6;
  113. form.render();
  114. //日期范围
  115. laydate.render({
  116. elem: '#test6'
  117. ,range: '~'
  118. ,done: function(value, date, endDate){
  119. date6 = value;
  120. }
  121. });
  122. table.render({
  123. elem: '#reportlist-table',
  124. url: setter.baseAdminUrl + 'comjobsreport/listreport',
  125. height: 'full-20',
  126. cols: [
  127. [
  128. { type: 'checkbox', fixed: 'left' },
  129. { field: 'id', width: 80, title: '表ID', sort: true },
  130. { field: 'status_text', title: '状态', minWidth: 100 ,templet: '#statusTpl',},
  131. { field: 'realname', title: '姓名', minWidth: 100 },
  132. { field: 'mobile', title: '手机号', minWidth: 120 },
  133. { field: 'idcard', title: '身份证号', minWidth: 200 },
  134. { field: 'arrivetime', title: '预计到达时间', minWidth: 170 },
  135. { field: 'remark', title: '报名备注', minWidth: 170, hide: true },
  136. { field: 'comjobsid', title: '招聘订单', minWidth: 200, toolbar: '<div>{{d.comjobs!=null ? d.comjobs.title : ""}}</div>' },
  137. { field: 'comjobsid', title: '招聘企业', minWidth: 200, hide: true, toolbar: '<div>{{d.comjobs.company!=null ? d.comjobs.company.title : ""}}</div>' },
  138. { field: 'agenttitle', title: '代理门店', minWidth: 200, templet: '<div>{{d.agent!=null ? d.agent.title : ""}}</div>' },
  139. { field: 'brokerid', title: '职业顾问', width: 150, templet: '<div>{{d.broker!=null ? d.broker.title : ""}}</div>', hide: true },
  140. { field: 'createtime', title: '报备时间', width: 170 },
  141. { title: '操作', width: 230, align: 'center', fixed: 'right', toolbar: '#setTpl' }
  142. ]
  143. ],
  144. page: true,
  145. limit: 50,
  146. toolbar: '#tabletoolbar',
  147. cellMinWidth: 200,
  148. text: '对不起,加载出现异常!'
  149. });
  150. // 批量设置
  151. var comjobslist = {$comjobslist|raw};
  152. var comjobsid = 0;
  153. var comtype = "";
  154. var comprice = "";
  155. var comremark = "";
  156. var setstatus = "";
  157. form.on('select(setstatus)', function(data){
  158. setstatus = data.value;
  159. });
  160. form.on('select(comjobsid)', function(data){
  161. $('#retdetailsbox').html("");
  162. for(var i=0;i<comjobslist.length;i++){
  163. if (data.value==comjobslist[i].id){
  164. var refund = comjobslist[i].comjobsRefund;
  165. var html = ""
  166. for(var reti=0;reti<refund.length;reti++){
  167. html += '<input type="radio" lay-filter="reportrefund" name="reportrefund" data-type="'+refund[reti].reftype+'" data-price="'+refund[reti].refprice+'" data-remark="'+refund[reti].refremark+'" value="'+reti+'" title="'+refund[reti].reftype +"【"+ refund[reti].agentGroups.title+'】" />';
  168. }
  169. $('#refundbox').html(html);
  170. }
  171. }
  172. comjobsid = data.value;
  173. comtype = "";
  174. comprice = "";
  175. comremark = "";
  176. form.render();
  177. });
  178. form.on('radio(reportrefund)',function (obj) {
  179. comtype = $(this).data('type');
  180. comprice = $(this).data('price');
  181. comremark = $(this).data('remark');
  182. });
  183. form.on('submit(reportlist-search-btn)', function(data) {
  184. table.reload('reportlist-table', {
  185. where: data.field,
  186. page: {
  187. curr: 1
  188. }
  189. });
  190. });
  191. form.on('submit(reportlist-export-btn)', function(data) {
  192. var url = setter.baseAdminUrl + 'comjobsreport/exportreport?';
  193. for (var item in data.field) {
  194. url = url + '&' + item + '=' + data.field[item];
  195. }
  196. window.location.href = url;
  197. });
  198. form.on('submit(reportlist-repeat-btn)', function(data) {
  199. table.reload('reportlist-table', {
  200. where: {date6:date6,repeat:1},
  201. page: {
  202. curr: 1
  203. }
  204. });
  205. });
  206. //头工具栏事件
  207. table.on('toolbar(reportlist-table)', function(obj) {
  208. var checkStatus = table.checkStatus(obj.config.id);
  209. switch (obj.event) {
  210. case 'batchdel':
  211. var checkData = checkStatus.data;
  212. if (checkData.length === 0) {
  213. return layer.msg('请选择数据');
  214. }
  215. var idarr = [];
  216. for (var i = 0; i < checkData.length; i++) {
  217. idarr.push(checkData[i].id);
  218. }
  219. layer.confirm('删除后不可恢复,确定删除此报备记录吗?', function(index) {
  220. admin.req({
  221. url: setter.baseAdminUrl + 'comjobsreport/delreport',
  222. data: {
  223. idarr: idarr
  224. },
  225. done: function(res) {
  226. table.reload('reportlist-table');
  227. layer.msg('已删除');
  228. }
  229. });
  230. });
  231. break;
  232. case 'setcomtype':
  233. if (comjobsid==0 || comtype==""){
  234. return layer.msg('请选择返费模式');
  235. }
  236. var checkData = checkStatus.data;
  237. if (checkData.length === 0) {
  238. return layer.msg('请选择数据');
  239. }
  240. var idarr = [];
  241. for (var i = 0; i < checkData.length; i++) {
  242. idarr.push(checkData[i].id);
  243. }
  244. layer.confirm('确定要批量修改所选报备记录返费模式吗?', function(index) {
  245. admin.req({
  246. url: setter.baseAdminUrl + 'comjobsreport/setComtype',
  247. data: {
  248. idarr: idarr,
  249. comjobsid: comjobsid,
  250. comtype: comtype,
  251. comprice: comprice,
  252. comremark: comremark
  253. },
  254. done: function(res) {
  255. table.reload('reportlist-table');
  256. layer.msg('已批量修改');
  257. }
  258. });
  259. });
  260. break;
  261. case 'setstatus':
  262. if (setstatus==""){
  263. return layer.msg('请选择状态');
  264. }
  265. var checkData = checkStatus.data;
  266. if (checkData.length === 0) {
  267. return layer.msg('请选择数据');
  268. }
  269. var idarr = [];
  270. for (var i = 0; i < checkData.length; i++) {
  271. idarr.push(checkData[i].id);
  272. }
  273. layer.confirm('确定要批量修改所选报备记录状态吗?', function(index) {
  274. admin.req({
  275. url: setter.baseAdminUrl + 'comjobsreport/setStatus',
  276. data: {
  277. idarr: idarr,
  278. status: setstatus
  279. },
  280. done: function(res) {
  281. table.reload('reportlist-table');
  282. layer.msg('已批量修改');
  283. }
  284. });
  285. });
  286. break;
  287. case 'add':
  288. var index = layer.open({
  289. type: 2,
  290. title: '添加报备信息',
  291. content: 'reportform.html?id=0',
  292. maxmin: true,
  293. area: ['550px', '550px']
  294. });
  295. layer.full(index);
  296. break;
  297. case 'batch':
  298. var index = layer.open({
  299. type: 2,
  300. title: '批量导入报备信息',
  301. content: 'reportimport.html',
  302. maxmin: true,
  303. area: ['550px', '550px']
  304. });
  305. layer.full(index);
  306. break;
  307. };
  308. });
  309. table.on('tool(reportlist-table)', function(obj) {
  310. var data = obj.data;
  311. if (obj.event === 'del') {
  312. layer.confirm('确定删除此报备记录吗?', function(index) {
  313. admin.req({
  314. url: setter.baseAdminUrl + 'comjobsreport/delreport',
  315. data: {
  316. idarr: [data.id]
  317. },
  318. done: function(res) {
  319. obj.del();
  320. layer.msg('已删除');
  321. }
  322. });
  323. layer.close(index);
  324. });
  325. } else if (obj.event === 'edit') {
  326. var index = layer.open({
  327. type: 2,
  328. title: '编辑报备信息',
  329. content: 'reportform.html?id=' + data.id,
  330. maxmin: true,
  331. area: ['750px', '480px']
  332. });
  333. layer.full(index);
  334. }
  335. });
  336. });
  337. </script>