returngoods.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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_warning{
  35. color: #fff;
  36. background-color: #f39c12 !important;
  37. border-color: #e08e0b !important;
  38. }
  39. .btn-xs {
  40. padding: 1px 5px;
  41. font-size: 12px;
  42. line-height: 1.5;
  43. border-radius: 3px;
  44. }
  45. </style>
  46. <body>
  47. <div class="warp">
  48. <div class="fixed">
  49. <form >
  50. <ul class="search">
  51. <li>订单号:<input value="{$orderinfo}" name="orderinfo" type="text" ></li>
  52. <li>编号:<input value="" name="number" type="text" ></li>
  53. <li>退货单:<input value="" name="back_no" type="text" ></li>
  54. <li>
  55. 店铺:
  56. <select name="shop" class="select">
  57. <option value="">选择店铺</option>
  58. {loop $shop_list as $key=>$val}
  59. <option value="{$key}">{$val}</option>
  60. {/loop}
  61. </select>
  62. </li>
  63. <li>
  64. 状态:
  65. <select name="status" class="select">
  66. <option value="">选择状态</option>
  67. {loop $status_list as $key=>$val}
  68. <option value="{$key}">{$val}</option>
  69. {/loop}
  70. </select>
  71. </li>
  72. <li>
  73. 售后类型:
  74. <select name="back_status" class="select">
  75. <option value="">选择售后类型</option>
  76. {loop $back_status_list as $key=>$val}
  77. <option value="{$key}">{$val}</option>
  78. {/loop}
  79. </select>
  80. </li>
  81. <li>
  82. 登记时间:
  83. <input id="ktime" value="{date('Y-m-d',time()-10*24*3600)} 0:00" name="ktime" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})">
  84. 至&nbsp;&nbsp;&nbsp;&nbsp;
  85. <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'})">
  86. </li>
  87. <li>
  88. 原因一级分类:
  89. <select name="cate_one" class="select" style="width:150px;" onchange="changeCateOne(this)">
  90. <option value="">请选择</option>
  91. {loop $cate_one_list as $key=>$val}
  92. <option value="{$key}">{$val}</option>
  93. {/loop}
  94. </select>
  95. </li>
  96. <li>
  97. 原因二级分类:
  98. <select name="cate_two" style="width:150px;" class="select cate_two">
  99. <option value="">请选择</option>
  100. </select>
  101. </li>
  102. <li><span>确 定</span></li>
  103. </ul>
  104. </form>
  105. <div class="control">
  106. <!-- <a href="javascript:void(0);" class="window btn btn-success" data-h="/returngoods/add/1100000573" data-t="售后登记 - 添加">添 加</a> -->
  107. <a href="javascript:void(0);" class="check">删 除</a>
  108. <a href="javascript:void(0);" class="btn btn_warning btn-xs" onclick="excelexport()">按条件导出</a>
  109. </div>
  110. <table class="datatitle data" border="0" style="border-collapse:collapse;">
  111. <tr>
  112. <td>
  113. <label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label>
  114. </td>
  115. <td>订单号</td>
  116. <td>店铺</td>
  117. <td>编号</td>
  118. <td>状态</td>
  119. <td>登记原因</td>
  120. <td>备注信息</td>
  121. <td>售后类型</td>
  122. <td>重发订单编号</td>
  123. <td>退款金额</td>
  124. <td>登记人</td>
  125. <td>登记时间</td>
  126. <td>操作</td>
  127. </tr>
  128. </table>
  129. </div>
  130. <table class="datatext data" border="0" style="border-collapse:collapse;">
  131. </table>
  132. <div class="bomf"></div>
  133. </div>
  134. <div class="ts"><p class="tsn"></p></div>
  135. <div class="systemwindow">
  136. <div>
  137. <p></p>
  138. <p><font class="button">确 定</font><font class="esc">取 消</font></p>
  139. </div>
  140. </div>
  141. <script>
  142. var dataurl = "/returngoods";
  143. // var editurl = "/returngoods/edit/";
  144. // var editdj = 3;
  145. // var editt = "售后登记 - 修改";
  146. var customon = 1;
  147. function custom(){
  148. $(".data tr").each(function() {
  149. $(this).find('td:eq(0)').css("width","1%");
  150. $(this).find('td:eq(1)').css("width","7%");
  151. $(this).find('td:eq(2)').css("width","7%");
  152. $(this).find('td:eq(3)').css("width","6%");
  153. $(this).find('td:eq(4)').css("width","4%");
  154. $(this).find('td:eq(5)').css("width","10%");
  155. $(this).find('td:eq(6)').css("width","22%");
  156. $(this).find('td:eq(7)').css("width","4%");
  157. $(this).find('td:eq(8)').css("width","7%");
  158. $(this).find('td:eq(9)').css("width","5%");
  159. $(this).find('td:eq(10)').css("width","5%");
  160. $(this).find('td:eq(11)').css("width","5%");
  161. // $(this).find('td:eq(11)').css("width","5%");
  162. });}
  163. function changeCateOne(that){
  164. let json_str = '{$cate_two_list}';
  165. let cate_two_list = JSON.parse(json_str);
  166. let cate_one_val = $(that).val();
  167. let str = '';
  168. str += '<option value="">请选择</option>';
  169. if(cate_one_val){
  170. if(cate_two_list[cate_one_val]){
  171. for(let key in cate_two_list[cate_one_val]){
  172. str += '<option value="'+key+'">'+cate_two_list[cate_one_val][key]+'</option>';
  173. }
  174. }else{
  175. console.log("数据不存在")
  176. }
  177. }
  178. $(".cate_two").html(str);
  179. }
  180. function cancel(that){
  181. layx.load('loadId','取消中',{shadable:0.6});
  182. let id = $(that).data("id");
  183. let type = $(that).data("type");
  184. $.ajax({
  185. url:"/returngoods/cancel",
  186. data:"review="+type+"&id="+id,
  187. type:"post",
  188. dataType:"json",
  189. success:function(a){
  190. layx.destroy('loadId');
  191. if (a && a.success) {
  192. $(".ts p").html(a.msg);
  193. $(".ts").fadeIn();
  194. setTimeout('searchspan(2)', 900);
  195. }
  196. if (a && !a.success) {
  197. $(".ts p").html(a.msg);
  198. $(".ts").fadeIn();
  199. }
  200. }
  201. })
  202. }
  203. function huifu(that){
  204. layx.load('loadId','恢复中',{shadable:0.6});
  205. let id = $(that).data("id");
  206. let type = $(that).data("type");
  207. $.ajax({
  208. url:"/returngoods/huifu",
  209. data:"review="+type+"&id="+id,
  210. type:"post",
  211. dataType:"json",
  212. success:function(a){
  213. layx.destroy('loadId');
  214. if (a && a.success) {
  215. $(".ts p").html(a.msg);
  216. $(".ts").fadeIn();
  217. setTimeout('searchspan(2)', 900);
  218. }
  219. if (a && !a.success) {
  220. $(".ts p").html(a.msg);
  221. $(".ts").fadeIn();
  222. }
  223. }
  224. })
  225. }
  226. //快递发送
  227. function expressSend(that){
  228. layx.load('loadId','恢复中',{shadable:0.6});
  229. let id = $(that).data("id");
  230. let type = $(that).data("type");
  231. $.ajax({
  232. url:"/returngoods/do_first_phase/"+id+"/7",
  233. data:{},
  234. type:"post",
  235. dataType:"json",
  236. success:function(a){
  237. layx.destroy('loadId');
  238. if (a && a.success) {
  239. $(".ts p").html(a.msg);
  240. $(".ts").fadeIn();
  241. setTimeout('searchspan(2)', 900);
  242. }
  243. if (a && !a.success) {
  244. $(".ts p").html(a.msg);
  245. $(".ts").fadeIn();
  246. }
  247. }
  248. })
  249. }
  250. //登记完结
  251. function finish(that){
  252. layx.load('loadId','请求中',{shadable:0.6});
  253. let id = $(that).data("id");
  254. let type = $(that).data("type");
  255. $.ajax({
  256. url:"/returngoods/do_first_phase/"+id+"/8",
  257. data:{},
  258. type:"post",
  259. dataType:"json",
  260. success:function(a){
  261. layx.destroy('loadId');
  262. if (a && a.success) {
  263. $(".ts p").html(a.msg);
  264. $(".ts").fadeIn();
  265. setTimeout('searchspan(2)', 900);
  266. }
  267. if (a && !a.success) {
  268. $(".ts p").html(a.msg);
  269. $(".ts").fadeIn();
  270. }
  271. }
  272. })
  273. }
  274. function excelexport(){
  275. layx.load('loadId','请求中',{shadable:0.6});
  276. // return console.log($("form").serialize())
  277. $.post("/returngoodsexcel/excel",$("form").serialize(),function(a){
  278. layx.destroy('loadId');
  279. if (a && a.success) {
  280. if (a.data.length > 0){
  281. $(".ts p").html(a.msg);
  282. $(".ts").fadeIn();
  283. explortExcel(a.data,"退货单列表.xlsx")
  284. }else{
  285. $(".ts p").html("没有数据");
  286. $(".ts").fadeIn();
  287. }
  288. }else{
  289. $(".ts p").html(a.msg);
  290. $(".ts").fadeIn();
  291. }
  292. },'json')
  293. }
  294. function explortExcel(data,filename){
  295. let sheet = XLSX.utils.json_to_sheet(data)
  296. let workbook = XLSX.utils.book_new();
  297. XLSX.utils.book_append_sheet(workbook, sheet, "Sheet1");
  298. XLSX.writeFile(workbook, filename);
  299. }
  300. $(".datatext").on('mouseover mouseout',".method",function(event) {
  301. if (event.type === "mouseover") {
  302. $(this).parent().parent("td").append('<font style="position: absolute;right:10px;z-index: 1;border-radius:3px;border: 1px solid #39F;padding:0 10px;background-color: #FFF;box-shadow: rgba(0, 0, 0, 0.3) 1px 1px 24px;">'+$(this).data("t")+'</font>');
  303. }else if(event.type == "mouseout"){
  304. $(this).parent().siblings("font").remove();
  305. }
  306. });
  307. //记录重发单的信息
  308. function recordCf(that){
  309. let rid = $(that).data("id")
  310. layx.html('no-icon', '<span style="font-size:18px;padding-left:10px">重发单编号</span>', layx.multiLine(function() {
  311. /*
  312. <style type="text/css">
  313. p{
  314. padding:10px;
  315. }
  316. .order_no {width:98%;margin:0px;height:90px}
  317. </style>
  318. <p><textarea class='order_no' name="order_no" style="border: 1px solid #000" placeholder="请输入重发的订单编号" ></textarea></p>
  319. */
  320. }), {
  321. minMenu: false,
  322. closeMenu: false,
  323. movable: false,
  324. shadable: true,
  325. width: 300,
  326. height: 50,
  327. statusBar: true,
  328. buttons: [
  329. {
  330. label: '取消',
  331. callback: function(id, button, event) {
  332. layx.destroy(id);
  333. },
  334. style: 'color:#000;font-size:16px;'
  335. },
  336. {
  337. label: '提交',
  338. callback: function(id, button, event) {
  339. let order_no = $(".order_no").val()
  340. layx.destroy(id);
  341. layx.load('loadId','提交中,请稍后',{shadable:0.6});
  342. $.post("/returngoods/recordbyno",{
  343. id:rid,
  344. re_number:order_no
  345. },function(a){
  346. layx.destroy('loadId');
  347. console.log(a)
  348. console.log(a.msg)
  349. console.log(a.success)
  350. if (a && a.success) {
  351. $(".systemwindow div p:eq(0)").html(a.msg);
  352. $(".systemwindow div p:eq(1)").html("<font onclick='doCheck()'>确 定</font>");
  353. $(".systemwindow").show();
  354. }else{
  355. $(".systemwindow div p:eq(0)").text(a.msg);
  356. $(".systemwindow div p:eq(1)").html("<p><font onclick='doCheck()'>确 定</font></p>");
  357. $(".systemwindow").show();
  358. }
  359. },'json')
  360. },
  361. style: 'color:#000;font-size:16px;'
  362. }
  363. ]
  364. });
  365. }
  366. function doCheck(){
  367. $(".systemwindow").hide();
  368. setTimeout('searchspan(2)', 500);
  369. }
  370. </script>
  371. <script type="text/javascript" src="{$theme}js/excel/xlxs.js" ></script>
  372. <script type="text/javascript" src="{$theme}js/laydate.js"></script>
  373. {Template footer}