returngoods_check.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. {Template header}
  2. <style>
  3. .btn {
  4. display: inline-block;
  5. padding: 6px 12px;
  6. margin-bottom: 0;
  7. font-size: 14px;
  8. font-weight: 400;
  9. line-height: 1.42857143;
  10. text-align: center;
  11. white-space: nowrap;
  12. vertical-align: middle;
  13. -ms-touch-action: manipulation;
  14. touch-action: manipulation;
  15. cursor: pointer;
  16. -webkit-user-select: none;
  17. -moz-user-select: none;
  18. -ms-user-select: none;
  19. user-select: none;
  20. background-image: none;
  21. border: 1px solid transparent;
  22. border-radius: 4px;
  23. }
  24. .btn-success {
  25. color: #fff !important;
  26. background-color: #5cb85c !important;
  27. border-color: #4cae4c;
  28. }
  29. .btn-info {
  30. color: #fff;
  31. background-color: #5bc0de;
  32. border-color: #46b8da;
  33. }
  34. .btn-xs {
  35. padding: 1px 5px;
  36. font-size: 12px;
  37. line-height: 1.5;
  38. border-radius: 3px;
  39. }
  40. </style>
  41. <body>
  42. <div class="warp">
  43. <div class="fixed">
  44. <form >
  45. <ul class="search">
  46. <li>订单号:<input value="" name="orderinfo" type="text" ></li>
  47. <!-- <li>退货单:<input value="" name="back_no" type="text" ></li> -->
  48. <li>编号:<input value="" name="number" type="text" ></li>
  49. <li>
  50. 店铺:
  51. <select name="shop" class="select">
  52. <option value="">选择店铺</option>
  53. {loop $shop_list as $key=>$val}
  54. <option value="{$key}">{$val}</option>
  55. {/loop}
  56. </select>
  57. </li>
  58. <li>
  59. 状态:
  60. <select name="status" class="select">
  61. <option value="">全部</option>
  62. <option value="20">待审核</option>
  63. </select>
  64. </li>
  65. <li>
  66. 售后类型:
  67. <select name="back_status" class="select">
  68. <option value="">选择售后类型</option>
  69. {loop $back_status_list as $key=>$val}
  70. <option value="{$key}">{$val}</option>
  71. {/loop}
  72. </select>
  73. </li>
  74. <li>
  75. 登记时间:
  76. <input id="ktime" value="{date('Y-m-d',time()-30*24*3600)} 0:00" name="ktime" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})">
  77. 至&nbsp;&nbsp;&nbsp;&nbsp;
  78. <input id="jtime" value="{date('Y-m-d',time()+24*3600)} 0:00" name="jtime" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})">
  79. </li>
  80. <!-- <li>
  81. 原因一级分类:
  82. <select name="cate_one" class="select" style="width:150px;" onchange="changeCateOne(this)">
  83. <option value="">选择原因一级分类</option>
  84. {loop $cate_one_list as $key=>$val}
  85. <option value="{$key}">{$val}</option>
  86. {/loop}
  87. </select>
  88. </li>
  89. <li>
  90. 原因二级分类:
  91. <select name="cate_two" style="width:150px;" class="select cate_two">
  92. <option value="">选择原因二级分类</option>
  93. </select>
  94. </li> -->
  95. <li><span>确 定</span></li>
  96. </ul>
  97. </form>
  98. <div class="control">
  99. <!-- <a href="javascript:void(0);" class="window btn btn-success" data-h="/returngoods/add/1100000573" data-t="售后登记 - 添加">添 加</a>
  100. <a href="javascript:void(0);" class="check">删 除</a> -->
  101. <a href="javascript:void(0);" class="btn btn_warning btn-xs" onclick="excelexport()">按条件导出</a>
  102. </div>
  103. <table class="datatitle data" border="0" style="border-collapse:collapse;">
  104. <tr>
  105. <td>
  106. <label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label>
  107. </td>
  108. <td>订单号</td>
  109. <td>店铺</td>
  110. <td>编号</td>
  111. <td>状态</td>
  112. <td>登记原因</td>
  113. <td>售后类型</td>
  114. <td>重发单号</td>
  115. <td>退款金额</td>
  116. <td>登记时间</td>
  117. <td>操作</td>
  118. </tr>
  119. </table>
  120. </div>
  121. <table class="datatext data" border="0" style="border-collapse:collapse;">
  122. </table>
  123. <div class="bomf"></div>
  124. </div>
  125. <script>
  126. var customon = 1;
  127. function custom(){
  128. $(".data tr").each(function() {
  129. $(this).find('td:eq(0)').css("width","1%");
  130. $(this).find('td:eq(1)').css("width","6%");
  131. $(this).find('td:eq(2)').css("width","5%");
  132. $(this).find('td:eq(3)').css("width","6%");
  133. $(this).find('td:eq(4)').css("width","4%");
  134. $(this).find('td:eq(5)').css("width","10%");
  135. $(this).find('td:eq(6)').css("width","5%");
  136. $(this).find('td:eq(7)').css("width","5%");
  137. $(this).find('td:eq(8)').css("width","5%");
  138. $(this).find('td:eq(9)').css("width","8%");
  139. $(this).find('td:eq(10)').css("width","15%");
  140. });}
  141. var dataurl = "/returngoods/checkdata";
  142. function mastercheck(that){
  143. let select_id = $(that).data("id");
  144. layx.confirm('<span style="font-size:18px">提示</span>','<b style="font-size:18px">确定此单满足审核条件?<b>',null,{
  145. buttons:[
  146. {
  147. label:'确定',
  148. callback:function(id, button, event){
  149. layx.destroy(id);
  150. fuzhushenhe(select_id)
  151. }
  152. },
  153. {
  154. label:'取消',
  155. callback:function(id, button, event){
  156. layx.destroy(id);
  157. }
  158. }
  159. ]
  160. });
  161. }
  162. //辅助审核函数
  163. function fuzhushenhe(id){
  164. $.ajax({
  165. url:"/returngoods/do_first_phase/"+id+"/6",
  166. data:{},
  167. type:"post",
  168. dataType:"json",
  169. success:function(a){
  170. layx.destroy('loadId');
  171. if (a && a.success) {
  172. $(".ts p").html(a.msg);
  173. $(".ts").fadeIn();
  174. setTimeout('searchspan(2)', 900);
  175. }
  176. if (a && !a.success) {
  177. $(".ts p").html(a.msg);
  178. $(".ts").fadeIn();
  179. }
  180. }
  181. })
  182. }
  183. function excelexport(){
  184. layx.load('loadId','请求中',{shadable:0.6});
  185. // return console.log($("form").serialize())
  186. let select_list = [];
  187. $("input[name=check]").each(function(){
  188. if($(this).prop('checked')){
  189. select_list.push($(this).val())
  190. }
  191. })
  192. let form_data = $("form").serialize();
  193. if(select_list.length > 0){
  194. form_data = {sid:select_list}
  195. }
  196. $.post("/returngoodsexcel/checkexcel",form_data,function(a){
  197. layx.destroy('loadId');
  198. if (a && a.success) {
  199. if (a.data.length > 0){
  200. $(".ts p").html(a.msg);
  201. $(".ts").fadeIn();
  202. const now = new Date();
  203. const dateString = now.toISOString().split('T')[0];
  204. const [year, month, day] = dateString.split('-');
  205. let filename = "售后登记清单"+year+month+day+".xlsx";
  206. explortExcel(a.data,filename)
  207. }else{
  208. $(".ts p").html("没有数据");
  209. $(".ts").fadeIn();
  210. }
  211. }else{
  212. $(".ts p").html(a.msg);
  213. $(".ts").fadeIn();
  214. }
  215. },'json')
  216. }
  217. function explortExcel(data,filename){
  218. let sheet = XLSX.utils.json_to_sheet(data)
  219. let workbook = XLSX.utils.book_new();
  220. sheet['!cols'] = [
  221. //订单号
  222. {
  223. wch:20,
  224. },
  225. //订单编码
  226. {
  227. wch:20,
  228. },
  229. //店铺名称
  230. {
  231. wch:18,
  232. },
  233. //状态
  234. {
  235. wch:15,
  236. },
  237. //登记原因
  238. {
  239. wch:25,
  240. },
  241. //售后类型
  242. {
  243. wch:15,
  244. },
  245. //重发单号
  246. {
  247. wch:20,
  248. },
  249. //退款金额
  250. {
  251. wch:10,
  252. },
  253. //登记时间
  254. {
  255. wch:21,
  256. }
  257. ];
  258. XLSX.utils.book_append_sheet(workbook, sheet, "Sheet1");
  259. XLSX.writeFile(workbook, filename);
  260. }
  261. </script>
  262. <script type="text/javascript" src="{$theme}js/excel/xlxs.js" ></script>
  263. <script type="text/javascript" src="{$theme}js/laydate.js"></script>
  264. {Template footer}