audit.html 3.66 KB
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>Yoho!Buy运营平台</title>
    <script src="/ufoPlatform/js/include.js?version=6.9.3"></script>
    <style>
        .sub-info th{
            font-size: 16px;
            text-align: right;
            width: 30%;
        }
        .sub-info td{
            font-size: 16px;
            width: 70%;
        }
    </style>
</head>
<body class="easyui-layout">
<div region="north" style="height:90px;">
    <script>
        document.write(addHead('商品管理', '卖家自主尺码申请'));
    </script>
</div>

<div id="businessDiv" region="center">
	<table id="businessTable" class="sub-info" frame="void" width="80%" cellpadding="16" align="center">
	  <tr>
	    <th>品牌</th>
	    <td id="brandName"></td>
	  </tr>
	  <tr>
	    <th>商品名称</th>
	    <td id="productName"></td>
	  </tr>
	  <tr>
	    <th>SKN</th>
	    <td id="productId"></td>
	  </tr>
	  <tr>
	    <th>货号</th>
	    <td id="productCode"></td>
	  </tr>
	  <tr>
	    <th>申请尺码</th>
	    <td id="applySizeName"></td>
	  </tr>
	  <tr>
	    <th>出售中尺码</th>
	    <td id="sellingSizeName"></td>
	  </tr>
	  <tr>
	    <th>申请人UID</th>
	    <td id="applyUid"></td>
	  </tr>
	</table>
	<div id="btnList" style="text-align:center;">
	  <a id="rejectBtn" class="btn-long" style="background-color: rgba(217, 0, 27, 1);">不通过</a>
	  <a id="passBtn" class="btn-long" style="background-color: rgba(2, 125, 180, 1);">已添加尺码并审核通过</a>
	</div>
	<br>
	<br>
</div>
<script>
$(function() {
	var param=window.location.search;
	var id = getQueryString(param, "id");
	
	getDetailInfo(id);
	
	$("#rejectBtn").linkbutton({
        text: "不通过",
        iconCls: "icon-ok",
        onClick: function () {
        	updateAudit(id, 2);
        }
    });
	$("#passBtn").linkbutton({
        text: "审核通过并添加尺码",
        iconCls: "icon-ok",
        onClick: function () {
        	updateAudit(id, 1);
        }
    });
	
});

function updateAudit(id, status){
	$.post(contextPath + "/selfSize/updateAuditInfoById", {
		id : id,
		status : status
    }, function(data) {
        if (data.code == 200) {
        	document.getElementById("btnList").style.display= "none";
            window.self.$.messager.show({
                title : "提示",
                msg : "审核成功!"
            });
        }else {
        	window.self.$.messager.alert("失败", "失败!", "error");
        }
    });
}

function getDetailInfo(id){
    var form = new FormData();
	form.append("id", id);
    
    //发送请求
	$.ajax({
	     type: "POST",
         url: contextPath + '/selfSize/getDetailById',
         data: form,
         async: false,
         cache: false,
         contentType: false,
         processData: false,
         dataType: 'json',
         success: function (result) {
             if(result.code == 200) {
            	 $("#brandName").html(replacexss(result.data.brandName));
            	 $("#productName").html(replacexss(result.data.productName));
            	 $("#productId").html(result.data.productId);
            	 $("#productCode").html(result.data.productCode);
            	 $("#applySizeName").html(result.data.applySizeName);
            	 $("#sellingSizeName").html(result.data.sellingSizeName);
            	 $("#applyUid").html(result.data.applyUid);
             }
             else {
                 $.messager.alert("失败", result.message, "error");
             }
         }
     }); 
}

function getQueryString(paraPart,name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = paraPart.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}

</script>
</body>
</html>