123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- {Template header}
- <style>
- .btn {
- display: inline-block;
- padding: 6px 12px;
- margin-bottom: 0;
- font-size: 14px;
- font-weight: 400;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- }
- .btn-success {
- color: #fff !important;
- background-color: #5cb85c !important;
- border-color: #4cae4c;
- }
- .btn-info {
- color: #fff;
- background-color: #5bc0de;
- border-color: #46b8da;
- }
- .btn_warning{
- color: #fff;
- background-color: #f39c12 !important;
- border-color: #e08e0b !important;
- }
- .btn-xs {
- padding: 1px 5px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
- }
-
- </style>
- <body>
- <div class="warp">
- <div class="fixed">
- <form >
- <ul class="search">
- <li>
- 店铺:
- <select name="shop" class="select">
- <option value="">选择店铺</option>
- {loop $shop_list as $key=>$val}
- <option value="{$key}">{$val}</option>
- {/loop}
- </select>
- </li>
- <li>
- 售后处理类型:
- <select name="back_status" class="select">
- <option value="">选择售后处理类型</option>
- {loop $back_status_list as $key=>$val}
- <option value="{$key}">{$val}</option>
- {/loop}
- </select>
- </li>
- <li>
- 原因一级分类:
- <select name="cate_one" class="select" style="width:150px;" onchange="changeCateOne(this)">
- <option value="">请选择</option>
- {loop $cate_one_list as $key=>$val}
- <option value="{$key}">{$val}</option>
- {/loop}
- </select>
- </li>
- <li>
- 原因二级分类:
- <select name="cate_two" style="width:150px;" class="select cate_two">
- <option value="">请选择</option>
-
- </select>
- </li>
- <li>
- 状态:
- <select name="status" class="select">
- <option value="">选择状态</option>
- {loop $status_list as $key=>$val}
- <option value="{$key}">{$val}</option>
- {/loop}
- </select>
- </li>
- <li>登记人:<input value="" name="recorder" type="text" ></li>
- <br/>
- <li>订单号:<input value="{$orderinfo}" name="orderinfo" type="text" ></li>
- <li>编号:<input value="" name="number" type="text" ></li>
- <li>重发订单编号:<input value="" name="back_no" type="text" ></li>
- <li>
- 登记时间:
- <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'})">
- 至
- <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'})">
- </li>
- <!-- <li>
- 原因一级分类:
- <select name="cate_one" class="select" style="width:150px;" onchange="changeCateOne(this)">
- <option value="">请选择</option>
- {loop $cate_one_list as $key=>$val}
- <option value="{$key}">{$val}</option>
- {/loop}
- </select>
- </li>
- <li>
- 原因二级分类:
- <select name="cate_two" style="width:150px;" class="select cate_two">
- <option value="">请选择</option>
-
- </select>
- </li> -->
- <li><span>确 定</span></li>
- </ul>
- </form>
- <div class="control">
-
- <!-- <a href="javascript:void(0);" class="window btn btn-success" data-h="/returngoods/add/1100000573" data-t="售后登记 - 添加">添 加</a> -->
- <a href="javascript:void(0);" style="font-size: 15px;" class="check">删 除</a>
- <a href="javascript:void(0);" style="font-size: 15px;background-color: #f39c12;" onclick="excelexport()">按条件导出</a>
- </div>
- <table class="datatitle data" border="0" style="border-collapse:collapse;">
- <tr>
- <td>
- <label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label>
- </td>
- <td>店铺</td>
- <td>订单号</td>
- <td>编号</td>
- <td>登记原因</td>
- <td>备注信息</td>
- <td>售后处理类型</td>
- <td>重发订单编号</td>
- <td>退款金额</td>
- <td>状态</td>
- <td>登记人</td>
- <td>登记时间</td>
- <td>操作</td>
- </tr>
- </table>
- </div>
- <table class="datatext data" border="0" style="border-collapse:collapse;">
- </table>
- <div class="bomf"></div>
- </div>
- <div class="ts"><p class="tsn"></p></div>
- <div class="systemwindow">
- <div>
- <p></p>
- <p><font class="button">确 定</font><font class="esc">取 消</font></p>
- </div>
- </div>
- <script>
- var dataurl = "/returngoods";
- // var editurl = "/returngoods/edit/";
- // var editdj = 3;
- // var editt = "售后登记 - 修改";
- var customon = 1;
- function custom(){
- $(".data tr").each(function() {
- $(this).find('td:eq(0)').css("width","1%");
- $(this).find('td:eq(1)').css("width","7%");
- $(this).find('td:eq(2)').css("width","7%");
- $(this).find('td:eq(3)').css("width","7%");
- $(this).find('td:eq(4)').css("width","9%");
- $(this).find('td:eq(5)').css("width","22%");
- $(this).find('td:eq(6)').css("width","10%");
- $(this).find('td:eq(7)').css("width","7%");
- $(this).find('td:eq(8)').css("width","5%");
- $(this).find('td:eq(9)').css("width","5%");
- $(this).find('td:eq(10)').css("width","5%");
- $(this).find('td:eq(11)').css("width","5%");
- // $(this).find('td:eq(11)').css("width","5%");
- });}
- function changeCateOne(that){
- let json_str = '{$cate_two_list}';
- let cate_two_list = JSON.parse(json_str);
- let cate_one_val = $(that).val();
- let str = '';
- str += '<option value="">请选择</option>';
- if(cate_one_val){
- if(cate_two_list[cate_one_val]){
- for(let key in cate_two_list[cate_one_val]){
- str += '<option value="'+key+'">'+cate_two_list[cate_one_val][key]+'</option>';
- }
- }else{
- console.log("数据不存在")
- }
- }
- $(".cate_two").html(str);
-
- }
- function cancel(that){
- layx.load('loadId','取消中',{shadable:0.6});
- let id = $(that).data("id");
- let type = $(that).data("type");
- $.ajax({
- url:"/returngoods/cancel",
- data:"review="+type+"&id="+id,
- type:"post",
- dataType:"json",
- success:function(a){
- layx.destroy('loadId');
- if (a && a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- setTimeout('searchspan(2)', 900);
- }
- if (a && !a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
-
- }
- }
- })
- }
- function huifu(that){
- layx.load('loadId','恢复中',{shadable:0.6});
- let id = $(that).data("id");
- let type = $(that).data("type");
- $.ajax({
- url:"/returngoods/huifu",
- data:"review="+type+"&id="+id,
- type:"post",
- dataType:"json",
- success:function(a){
- layx.destroy('loadId');
- if (a && a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- setTimeout('searchspan(2)', 900);
- }
- if (a && !a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
-
- }
- }
- })
- }
- //快递发送
- function expressSend(that){
- layx.load('loadId','恢复中',{shadable:0.6});
- let id = $(that).data("id");
- let type = $(that).data("type");
- $.ajax({
- url:"/returngoods/do_first_phase/"+id+"/7",
- data:{},
- type:"post",
- dataType:"json",
- success:function(a){
- layx.destroy('loadId');
- if (a && a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- setTimeout('searchspan(2)', 900);
- }
- if (a && !a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
-
- }
- }
- })
- }
- //登记完结
- function finish(that){
- layx.load('loadId','请求中',{shadable:0.6});
- let id = $(that).data("id");
- let type = $(that).data("type");
- $.ajax({
- url:"/returngoods/do_first_phase/"+id+"/8",
- data:{},
- type:"post",
- dataType:"json",
- success:function(a){
- layx.destroy('loadId');
- if (a && a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- setTimeout('searchspan(2)', 900);
- }
- if (a && !a.success) {
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
-
- }
- }
- })
- }
- function excelexport(){
- layx.load('loadId','请求中',{shadable:0.6});
- // return console.log($("form").serialize())
-
- let select_list = [];
- $("input[name=check]").each(function(){
- if($(this).prop('checked')){
- select_list.push($(this).val())
- }
- })
- let form_data = $("form").serialize();
- if(select_list.length > 0){
- form_data = {sid:select_list}
- }
- $.post("/returngoodsexcel/excel",form_data,function(a){
- layx.destroy('loadId');
- if (a && a.success) {
- if (a.data.length > 0){
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- const now = new Date();
- const dateString = now.toISOString().split('T')[0];
- const [year, month, day] = dateString.split('-');
- let filename = "售后登记清单"+year+month+day+".xlsx";
- explortExcel(a.data,filename)
- }else{
- $(".ts p").html("没有数据");
- $(".ts").fadeIn();
- }
- }else{
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- }
- },'json')
- }
- function getCellWidth(value) {
- // 判断是否为null或undefined
- if (value == null) {
- return 10;
- } else if (/.*[\u4e00-\u9fa5]+.*$/.test(value)) {
- // 中文的长度
- const chineseLength = value.match(/[\u4e00-\u9fa5]/g).length;
- // 其他不是中文的长度
- const otherLength = value.length - chineseLength;
- return chineseLength * 2.1 + otherLength * 1.1;
- } else {
- return value.toString().length * 1.1;
- /* 另一种方案
- value = value.toString()
- return value.replace(/[\u0391-\uFFE5]/g, 'aa').length
- */
- }
- }
- function explortExcel(data,filename){
-
- let sheet = XLSX.utils.json_to_sheet(data)
-
- sheet['!cols'] = [
- //订单号
- {
- wch:20,
- },
- //订单编码
- {
- wch:20,
- },
- //店铺名称
- {
- wch:18,
- },
- //状态
- {
- wch:15,
- },
- //登记原因
- {
- wch:25,
- },
- //备注信息
- {
- wch:35,
- },
- //售后处理类型
- {
- wch:15,
- },
- //重发单号
- {
- wch:20,
- },
- //退款金额
- {
- wch:10,
- },
- //登记人
- {
- wch:10,
- },
- //登记时间
- {
- wch:21,
- },
- //仓库品名
- {
- wch:35,
- },
- //快递方式
- {
- wch:14,
- },
- //运单号
- {
- wch:23,
- },
- //出库时间
- {
- wch:21,
- }
-
- ];
- let workbook = XLSX.utils.book_new();
-
- XLSX.utils.book_append_sheet(workbook, sheet, "Sheet1");
- XLSX.writeFile(workbook, filename);
- }
- $(".datatext").on('mouseover mouseout',".method",function(event) {
- if (event.type === "mouseover") {
- $(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>');
- }else if(event.type == "mouseout"){
- $(this).parent().siblings("font").remove();
- }
- });
- //记录重发单的信息
- function recordCf(that){
- let rid = $(that).data("id")
- layx.html('no-icon', '<span style="font-size:18px;padding-left:10px">重发单编号</span>', layx.multiLine(function() {
- /*
- <style type="text/css">
- p{
- padding:10px;
- }
- .order_no {width:98%;margin:0px;height:90px}
- </style>
- <p><textarea class='order_no' name="order_no" style="border: 1px solid #000" placeholder="请输入重发的订单编号" ></textarea></p>
- */
- }), {
- minMenu: false,
- closeMenu: false,
- movable: false,
- shadable: true,
- width: 300,
- height: 50,
- statusBar: true,
- buttons: [
- {
- label: '取消',
- callback: function(id, button, event) {
- layx.destroy(id);
- },
- style: 'color:#000;font-size:16px;'
- },
- {
- label: '提交',
- callback: function(id, button, event) {
- let order_no = $(".order_no").val()
- layx.destroy(id);
-
- layx.load('loadId','提交中,请稍后',{shadable:0.6});
- $.post("/returngoods/recordbyno",{
- id:rid,
- re_number:order_no
- },function(a){
- layx.destroy('loadId');
- console.log(a)
- console.log(a.msg)
- console.log(a.success)
- if (a && a.success) {
- $(".systemwindow div p:eq(0)").html(a.msg);
- $(".systemwindow div p:eq(1)").html("<font onclick='doCheck()'>确 定</font>");
- $(".systemwindow").show();
- }else{
- $(".systemwindow div p:eq(0)").text(a.msg);
- $(".systemwindow div p:eq(1)").html("<p><font onclick='doCheck()'>确 定</font></p>");
- $(".systemwindow").show();
- }
- },'json')
-
- },
- style: 'color:#000;font-size:16px;'
- }
- ]
- });
- }
- function doCheck(){
- $(".systemwindow").hide();
- setTimeout('searchspan(2)', 500);
- }
- </script>
- <script type="text/javascript" src="{$theme}js/excel/xlxs.js" ></script>
- <script type="text/javascript" src="{$theme}js/laydate.js"></script>
- {Template footer}
|