reportexamine.html 16 KB

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