| <!DOCTYPE HTML> | 
| <html xmlns:th="http://www.thymeleaf.org"> | 
| <head> | 
| <meta charset="utf-8"> | 
| <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
| <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
| <meta name="viewport" | 
|     content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> | 
| <meta http-equiv="Cache-Control" content="no-siteapp" /> | 
| <!-- 本框架基本脚本和样式 --> | 
| <script type="text/javascript" | 
|     th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
| <script type="text/javascript" | 
|     th:src="@{/js/systools/MBase.js}"></script> | 
| </head> | 
| <style> | 
|   | 
|     .form-head .col-md-8{ | 
|         width: 100%!important;} | 
|     .input-group{ | 
|         display: flex!important; | 
|         align-items: center; | 
|         padding: 35px 0; | 
|         margin-left: -13px; | 
|     } | 
|     .btn-group-sm>.btn, .btn-sm{ | 
|         margin-right: 8px; | 
|     } | 
|     table tr:last-child{border-bottom: 1px solid #ddd} | 
|     table tr:first-child{border-top: 1px solid #ddd} | 
|     td{text-align: center; | 
|         border-left: 1px solid #ddd;border-right: 1px solid #ddd} | 
|     th{text-align: center; | 
|         border-top: 1px solid #ddd; | 
|         border-left: 1px solid #ddd; | 
|         border-right: 1px solid #ddd;} | 
|     .pd-10{padding: 0;margin: 50px 10px} | 
| </style> | 
| <body > | 
| <div class="ibox-content"> | 
|         <form class="form-horizontal" id="dataform" onsubmit="javascript:return false;"> | 
|             <input autocomplete="off"   type="hidden" name="tokenUrl" th:value="${tokenUrl}"> | 
|             <input autocomplete="off"   type="hidden" name="token" th:value="${token}"> | 
|             <input autocomplete="off"   type="hidden" name="id" th:value="${obj.id}"> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">退款编号 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="refundNo" | 
|                     ignore="ignore" readonly="readonly" | 
|                     th:value="${obj.refundNo}"nullmsg="退款编号不能为空"> | 
|             </div> | 
|             <label class="col-sm-2 control-label">用户名称 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="nickName" | 
|                        ignore="ignore" readonly="readonly" | 
|                        th:value="${obj.nickName}"nullmsg="用户名称不能为空"> | 
|             </div> | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">订单编号 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="orderNo" | 
|                        ignore="ignore" readonly="readonly" | 
|                        th:value="${obj.orderNo}"nullmsg="订单编号不能为空"> | 
|             </div> | 
|             <label class="col-sm-2 control-label">退款原因 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="refundCause" | 
|                     ignore="ignore" readonly="readonly" | 
|                     th:value="${obj.refundCause}"nullmsg="退款原因不能为空"> | 
|             </div> | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">退款金额 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="refundMoney" | 
|                        dataType="/^\d*\.?\d+$/" | 
|                        errormsg="仅支持数字" | 
|                     th:value="${obj.refundMoney}"nullmsg="退款金额不能为空"> | 
|             </div> | 
|             <label class="col-sm-2 control-label">退款类型 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <select th:field="${obj.refundType}" class="form-control select2 " size="1" | 
|                         name="refundType" disabled="disabled" | 
|                         id="refundType" style="width: 100%"> | 
|                     <option value="1" th:selected="${obj.refundType == '1'}">退款</option> | 
|                     <option value="2" th:selected="${obj.refundType == '2'}">退货退款</option> | 
|                     </option> | 
|   | 
|                 </select> | 
|             </div> | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">申请时间 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="applyTime" | 
|                        ignore="ignore" readonly="readonly" | 
|                        th:value="${#dates.format(obj.applyTime, 'yyyy-MM-dd')}" | 
|                        nullmsg="申请时间不能为空"> | 
|             </div> | 
|             <label class="col-sm-2 control-label">申请退款状态 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <select th:field="${obj.refundStatus}" class="form-control select2 " size="1" | 
|                         name="refundStatus" disabled="disabled" | 
|                         id="refundStatus" style="width: 100%"> | 
|                     <option value="1" th:selected="${obj.refundStatus == '1'}">退款成功</option> | 
|                     <option value="2" th:selected="${obj.refundStatus == '2'}">退款失败</option> | 
|                     <option value="3" th:selected="${obj.refundStatus == '3'}">处理中</option> | 
|                     <option value="4" th:selected="${obj.refundStatus == '4'}">用户已取消</option> | 
|                     <option value="5" th:selected="${obj.refundStatus == '5'}">等待用户填写物流单号</option> | 
|                     </option> | 
|   | 
|                 </select> | 
|             </div> | 
|   | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">退款说明 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="remarks" | 
|                        ignore="ignore" readonly="readonly" | 
|                        th:value="${obj.remarks}"nullmsg="备注不能为空"> | 
|             </div> | 
|             <label class="col-sm-2 control-label">退款审核 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <select th:field="${obj.auditStatus}" class="form-control select2 " size="1" | 
|                         name="auditStatus" disabled="disabled" | 
|                         id="auditStatus" style="width: 100%"> | 
|                     <option value="1" th:selected="${obj.auditStatus == '1'}">未审核</option> | 
|                     <option value="2" th:selected="${obj.auditStatus == '2'}">审核通过</option> | 
|                     <option value="3" th:selected="${obj.auditStatus == '3'}">审核不通过</option> | 
|                     </option> | 
|   | 
|                 </select> | 
|             </div> | 
|   | 
|         </div> | 
|         <div id="divReason" class="form-group"> | 
|             <label class="col-sm-2 control-label">退款总金额 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="discountAmount" | 
|                        dataType="/^\d*\.?\d+$/" | 
|                        errormsg="仅支持数字" | 
|                        th:value="${obj.refundMoney}"nullmsg="退款金额不能为空"> | 
|             </div> | 
|             <label class="col-sm-2 control-label">拒绝退款理由 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" id="reason" name="refundRefuseReason" | 
|                        th:value="${obj.refundRefuseReason}" nullmsg="拒绝退款理由不能为空"> | 
|             </div> | 
|         </div> | 
|   | 
|             <div class="pd-10"> | 
|                 <div class="row"> | 
|                     <table id="mgrid" class="table table-hover table-striped"> | 
|                         <thead> | 
|                         <tr> | 
|                             <!--<th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th>--> | 
|                             <!--<th data-field="refundNo" data-align="center">退款编号</th>--> | 
|                             <!--<th  data-align="center">退款编号</th>--> | 
|                             <!--<th  data-align="center">退款原因</th>--> | 
|                             <!--<th  data-align="center">退款金额</th>--> | 
|                             <!--<th  data-align="center">订单编号</th>--> | 
|                             <th  data-align="center">产品名称</th> | 
|                             <th  data-align="center">订单金额</th> | 
|                             <th  data-align="center">商品单价</th> | 
|                             <th  data-align="center">购买数量</th> | 
|                             <th  data-align="center">商品总价</th> | 
|                             <th  data-align="center">规格名称</th> | 
|                             <th  data-align="center">邮费</th> | 
|                         </tr> | 
|                         <tr th:each="info,infoStat : ${objDetails}"> | 
|                             <!--<td th:text="${info.refundNo}"></td>--> | 
|                             <!--<td th:text="${info.refundCause}"></td>--> | 
|                             <!--<td th:text="${info.refundMoney}"></td>--> | 
|                             <!--<td th:text="${info.orderNo}"></td>--> | 
|                             <td th:text="${info.title}"></td> | 
|                             <td th:text="${info.orderMoney}"></td> | 
|                             <td th:text="${info.price}"></td> | 
|                             <td th:text="${info.count}"></td> | 
|                             <td th:text="${info.totalPrice}"></td> | 
|                             <td th:text="${info.skuName}"></td> | 
|                             <td th:text="${info.postage}"></td> | 
|                         </tr> | 
|                         </thead> | 
|                     </table> | 
|                 </div> | 
|             </div> | 
|   | 
|   | 
|         <div id="divAudit" class="form-group " style="display: none"> | 
|             <div class="col-sm-12 text-center"> | 
|                 <a href="javascript:;" onclick="myForm.submit()" | 
|                     class="btn btn-success radius"><i class="fa fa-check"></i>  确认退款</a>     | 
|                 <a id="refuse" class="btn btn-danger radius" href="javascript:;" onclick="submit()" ><i class="fa fa-close"></i> 拒绝</a> | 
|             </div> | 
|         </div> | 
|   | 
|         <div id="divRetundType" class="form-group " style="display: none"> | 
|             <div class="col-sm-12 text-center"> | 
|                 <a href="javascript:;" onclick="agreeRefund()" | 
|                    class="btn btn-success radius"><i class="fa fa-check"></i>  同意退款</a>     <a | 
|                     class="btn btn-danger radius" href="javascript:;" onclick="submit()" ><i class="fa fa-close"></i> 拒绝</a> | 
|             </div> | 
|         </div> | 
|     </form> | 
|     </div> | 
| </body> | 
| <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> | 
| <script th:inline="javascript"> | 
|     MTools.autoFullSelect(); | 
|     $(".select2").select2(); | 
|     /*<![CDATA[*/ | 
|     var obj=/*[[${obj}]]*/ | 
|     /*]]>*/ | 
|   | 
|     /*if (obj.auditStatus==2) { | 
|         $("input[type='radio'][name='auditStatus']").get(0).checked=true; | 
|     }else{ | 
|         $("input[type='radio'][name='auditStatus']").get(1).checked=true; | 
|     }*/ | 
|   | 
|     $(function(){ | 
|         /*$(":radio").click(function(){ | 
|             if($(this).val() == 3){ | 
|                 $("#divReason").show(); | 
|                 $("#reason").attr("dataType","*"); | 
|                 //$("#divReason").attr("nullmsg","拒绝退款理由不能为空"); | 
|             }else{ | 
|                 $("#divReason").hide(); | 
|                 $("#reason").removeAttr("dataType","*"); | 
|             } | 
|         });*/ | 
|         if(obj.refundType == 1 || obj.refundStatus == 5){ | 
|             $("#divAudit").show(); | 
|         }else{ | 
|             $("#divRetundType").show(); | 
|         } | 
|   | 
|         /*$("#refuse").click(function(){ | 
|             alert(obj.id); | 
|   | 
|                 $("#divReason").show(); | 
|                 $("#reason").attr("dataType","*"); | 
|                 //$("#divReason").attr("nullmsg","拒绝退款理由不能为空"); | 
|   | 
|         })*/ | 
|   | 
|     }); | 
|   | 
|     function submit() { | 
|         //$("#divReason").show(); | 
|         if($("#reason").val() == ""){ | 
|             layer.msg("请输入拒绝理由",{ | 
|                 icon : 2, | 
|                 time : 2000 | 
|             }); | 
|             return false; | 
|         } | 
|         var id = obj.id; | 
|         var refundRefuseReason = $("#reason").val(); | 
|         $.ajax({ | 
|             type : "post", | 
|             url : basePath +"/admin/shopRefundRecord/refundRefuse", | 
|             data : { | 
|                 id : id, | 
|                 refundRefuseReason : refundRefuseReason | 
|             }, | 
|   | 
|             success : function(result) { | 
|                 if(result.info){ | 
|                     //alert(JSON.stringify(result)+"测试result.info+show"); | 
|                     layer.closeAll('loading'); | 
|                     layer.msg(result.info, { | 
|                         icon : 1,time:1000 | 
|                     },function(inindex) { | 
|                                 // 关闭提示层 | 
|                                 layer.close(inindex); | 
|                                 // 自定义刷新回调 | 
|                                 if (myForm.initParam.afterSubmit) { | 
|                                     myForm.initParam.afterSubmit(); | 
|                                 } | 
|                                 // 关闭iframe层 | 
|                                 if (myForm.initParam.isAutoClose | 
|                                         && myForm.initParam.layerIndex) { | 
|                                     parent.layer.close(myForm.initParam.layerIndex); | 
|                                 } | 
|                             } | 
|                     ); | 
|                 } | 
|             }, | 
|             error : function(XMLHttpRequest, textStatus, errorThrown) { | 
|                 layer.closeAll('loading'); | 
|                 layer.msg("请求遇到问题-错误编号:" + XMLHttpRequest.status, { | 
|                     icon : 2 | 
|                 }); | 
|   | 
|             }, | 
|         }); | 
|     } | 
|   | 
|     function agreeRefund() { | 
|         var id = obj.id; | 
|         $.ajax({ | 
|             type : "post", | 
|             url : basePath +"/admin/shopRefundRecord/agreeRefund", | 
|             data : { | 
|                 id : id | 
|             }, | 
|   | 
|             success : function(result) { | 
|                 if(result.info){ | 
|                     //alert(JSON.stringify(result)+"测试result.info+show"); | 
|                     layer.closeAll('loading'); | 
|                     layer.msg(result.info, { | 
|                                 icon : 1,time:1000 | 
|                             },function(inindex) { | 
|                                 // 关闭提示层 | 
|                                 layer.close(inindex); | 
|                                 // 自定义刷新回调 | 
|                                 if (myForm.initParam.afterSubmit) { | 
|                                     myForm.initParam.afterSubmit(); | 
|                                 } | 
|                                 // 关闭iframe层 | 
|                                 if (myForm.initParam.isAutoClose | 
|                                         && myForm.initParam.layerIndex) { | 
|                                     parent.layer.close(myForm.initParam.layerIndex); | 
|                                 } | 
|                             } | 
|                     ); | 
|                 } | 
|             }, | 
|             error : function(XMLHttpRequest, textStatus, errorThrown) { | 
|                 layer.closeAll('loading'); | 
|                 layer.msg("请求遇到问题-错误编号:" + XMLHttpRequest.status, { | 
|                     icon : 2 | 
|                 }); | 
|   | 
|             }, | 
|         }); | 
|   | 
|   | 
|     } | 
|   | 
|     var invokeUrl=basePath+"/admin/shopRefundRecord/addShopRefundRecord"; | 
|     if(obj.id!=null){ | 
|        invokeUrl = basePath+"/admin/shopRefundRecord/modifyShopRefundRecord"; | 
|     } | 
|     var myForm=MForm.initForm({ | 
|         beforeSubmit:function(){ | 
|             $("#refundStatus").removeAttr("disabled"); | 
|         }, | 
|         invokeUrl:invokeUrl, | 
|         afterSubmit:function(){ | 
|             parent.myGrid.serchData(); | 
|             $("#refundStatus").attr("disabled",true); | 
|         }, | 
|     }); | 
|   | 
| </script> | 
| </body> | 
| </html> |