orderDetail.html 15.6 KB
<!DOCTYPE html>
<div id="main" region="center" style="height:900px;">
    <div id="tt" class="easyui-tabs" style="height:900px;">
        <div title="订单信息" style="padding:20px;display:none;height:900px;">
            <h2>卖家信息</h2>
            <div style="margin-top: 20px;margin-left: 30px">
                <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab1">
                    <tr>
                        <td>姓名:<span id="showUserName"></span></td>
                        <td>UID:<span id="showUid"></span></td>
                        <td>绑定手机号:<span id="showMobile"></span></td>
                        <td>发货单号:<span id="showExpressNumber"></span></td>
                        <td>发货时间:<span id="showDeliverTimeStr"></span></td>
                    </tr>

                    <tr>
                        <td>寄回地址:<span id="showBackAddress"></span></td>
                        <td>详细地址:<span id="showBackAddressDetail"></span></td>
                        <td>寄回手机号:<span id="showBackMobile"></span></td>
                        <td>邮政编码:<span id="showEx"></span></td>
                        <td>身份信息:<span id="showUserDegree"></span></td>
                    </tr>
                </table>
            </div>
            <br/><br/><br/>
            <h2>商品信息</h2>
            <div style="margin-top: 20px;margin-left: 30px">
                <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab2">
                    <tr>
                        <td>申请数量:<span id="showCount"></span></td>
                        <td>实到数量:<span id="showReceiveCount"></span></td>
                        <td>鉴定通过:<span id="showAppraiseOkCount"></span></td>
                        <td>鉴定为假:<span id="showAppraiseBadCount"></span></td>
                        <td>质检不通过:<span id="showAppraiseFaultCount"></span></td>
                        <td>无法鉴定:<span id="showNoAppraiseCount"></span></td>
                    </tr>
                </table>
            </div>
            <br/><br/><br/>
            <h2>订单信息</h2>
            <div style="margin-top: 20px;margin-left: 30px;height:400px;">
                <table id="orderDetailTable"></table>
            </div>
        </div>
        <div title="物流信息" style="overflow:auto;padding:20px;display:none;">
            <h2>卖家发货物流</h2>
            <hr>
            <table id="sellerExpressTable"></table>
            <h2>平台发货物流/平台寄回物流</h2>
            <hr>
            <table id="platformExpressTable"></table>
        </div>
        <div title="操作记录" style="overflow:auto;padding:20px;display:none;">
            <hr>
            <table id="operateRecordTable"></table>
        </div>
    </div>
</div>
<script>

    $(function () {

        $('#tt').tabs({
            border: false,
            onSelect: function (title, index) {
                if (index == 1) {
                    getExpressList(orderCode)
                }
                if (index == 2) {
                    getOperateRecord(orderCode)
                }
            }
        });

        // 隐藏域赋值
        $.post(contextPath + "/appraiseOrder/detailInfo", {
            orderCode: orderCode,
            uid : uid
        }, function (result) {
            if (result.code == 200) {
                var data = result.data;
                $("#showDeliverTimeStr").text(data.deliverTimeStr);
                $("#showExpressNumber").text(data.expressNumber);
                $("#showUserName").text(data.userName);
                $("#showUid").text(data.uid);
                $("#showMobile").text(data.mobile);
                $("#showBackAddress").text(data.backAddress);
                $("#showBackAddressDetail").text(data.backAddressDetail);
                $("#showBackMobile").text(data.backMobile);
                $("#showUserDegree").text(data.userDegree);
                $("#showCount").text(data.count);
                $("#showReceiveCount").text(data.receiveCount);
                $("#showAppraiseOkCount").text(data.appraiseOkCount);
                $("#showAppraiseBadCount").text(data.appraiseBadCount);
                $("#showAppraiseFaultCount").text(data.appraiseFaultCount);
                $("#showNoAppraiseCount").text(data.noAppraiseCount);
                $.parser.parse($("#trade").parent());
            }
        });

        $("#orderDetailTable").myDatagrid({
            fit: true,
            fitColumns: true,
            nowrap: false,
            url: contextPath + "/appraiseOrder/detailList",
            method: 'POST',
            queryParams:{
                orderCode: orderCode
            },
            loadFilter: function (data) {
                var temp = defaultLoadFilter(data);
                temp.rows = temp.list;
                return temp;
            },
            columns: [[{
                title: "子订单编号",
                field: "orderCode",
                width: 110,
                align: "center"
            }, {
                title: "商品图片",
                field: "imageUrl",
                width: 80,
                align: "center",
                formatter: function (value, rowData) {
                    return '<img id="productImage" height="78px" width="78px" src="'+value+'" />';
                }
            }, {
                title: "商品名称",
                field: "productName",
                width: 100,
                align: "center"
            }, {
                title: "货号",
                field: "productCode",
                width: 80,
                align: "center"
            }, {
                title: "颜色",
                field: "colorName",
                width: 50,
                align: "center"
            }, {
                title: "尺码",
                field: "sizeName",
                width: 50,
                align: "center"
            }, {
                title: "7天均价",
                field: "avgPrice7Day",
                width: 40,
                align: "center"
            }, {
                title: "保证金",
                field: "amount",
                width: 100,
                align: "center",
                formatter: function (value, rowData) {
                    var str = "缴纳保证金:" + rowData.amount;
                    str += "<br/>退回保证金:" + rowData.backAmount;
                    str += "<br/>扣除保证金:" + rowData.usedAmount;
                    return str;
                }
            },{
                title: "费用",
                field: "fee",
                width: 60,
                align: "center",
                formatter: function (value, rowData) {
                    var str = "包装费:" + rowData.packageFee;
                    str += "<br/>鉴定费:" + rowData.appraiseFee;
                    str += "<br/>仓储费:" + rowData.storageManagementFee;
                    return str;
                }
            },{
                title: "状态",
                field: "statusStr",
                width: 60,
                align: "center"
            },{
                title: "操作",
                field: "operations",
                width: 80,
                align: "center",
                formatter: function (value, rowData) {
                    var str = "<a role='viewOp' dataId='" + rowData.orderCode + "'  style='margin-left:10px;background-color: #5bc0de'>操作记录</a>";
                    str += "<br/><a role='viewEx' dataId='" + rowData.orderCode + "'  style='margin-left:10px;background-color: #5bc0de'>物流</a>";
                    if(rowData.status == "2") {
                        str = "<br/><a role='cancel' dataId='" + rowData.orderCode + "'  style='margin-left:10px;background-color: #5bc0de'>取消订单</a>";
                    }
                    return str;
                }
            }]],
            cache: false,
            pagination: true,
            pageSize: 10,
            pageList: [10],
            idField: "id",
            singleSelect: false,
            checkOnSelect: false,
            onLoadSuccess: function () {
                $(this).myDatagrid("getPanel").find("a[role='viewOp']").linkbutton({
                    iconCls: "icon-edit",
                    onClick: function () {
                        orderCode = $(this).attr("dataId");
                        getOperateRecord(orderCode);
                        $('#tt').tabs('select',"操作记录");
                    }
                });
                $(this).myDatagrid("getPanel").find("a[role='viewEx']").linkbutton({
                    iconCls: "icon-edit",
                    onClick: function () {
                        orderCode = $(this).attr("dataId");
                        getExpressList(orderCode);
                        $('#tt').tabs('select',"物流信息");
                    }
                });
                $(this).myDatagrid("getPanel").find("a[role='cancel']").linkbutton({
                    iconCls: "icon-edit",
                    onClick: function () {
                        orderCode = $(this).attr("dataId");
                        $.messager.confirm('取消订单确认','确认取消该订单?',function(r){
                            if (r){
                                $.post(contextPath + "/appraiseOrder/cancelOrder", {
                                    orderCode : orderCode
                                }, function(data) {
                                    if (data.code == 200) {
                                        window.self.$.messager.show({
                                            title : "提示",
                                            msg : "取消订单成功!"
                                        });
                                        $("#orderDetailTable").datagrid('reload');
                                    }else {
                                        window.self.$.messager.alert("失败", data.message, "error");
                                    }
                                });
                            }
                        });
                    }
                });
            }
        });
        function getOperateRecord(orderCode){
            $("#operateRecordTable").myDatagrid({
                fit: false,
                fitColumns: true,
                striped: true,
                rownumbers:true,
                url: contextPath + "/buyerOrder/queryOperateRecordList",
                method: 'POST',
                queryParams: {
                    orderCode: orderCode
                },
                loadFilter: function (data) {
                    var temp = defaultLoadFilter(data);
                    temp=null==temp?[]:temp;
                    temp.rows = temp.list;
                    return temp;
                },

                columns: [[{
                    title: "操作日志",
                    field: "typeStr",
                    width: 20,
                    align: "center"
                }, {
                    title: "操作人",
                    field: "userName",
                    width: 20,
                    align: "center"
                }, {
                    title: "处理时间",
                    field: "updateTimeStr",
                    width: 20,
                    align: "center"
                }]],
                cache: false,
                pagination: false,
                idField: "id",
                singleSelect: true,
                onLoadSuccess: function (data) {
                    if (data.total == 0) {
                        $(this).datagrid('appendRow', { type: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'type', colspan: 3 })
                    }
                }
            });
        }

        function getExpressList(orderCode) {
            $("#sellerExpressTable").datagrid({
                fit: false,
                fitColumns: true,
                striped: true,
                rownumbers:true,
                url: contextPath + "/buyerOrder/queryExpressList",
                method: 'POST',
                queryParams: {
                    orderCode: pOrderCode,
                    expressTypeStr: "1"
                },
                loadFilter: function (data) {
                    var temp = defaultLoadFilter(data);
                    temp=null==temp?[]:temp;
                    temp.rows = temp.list;
                    return temp;
                },

                columns: [[{
                    title: "物流公司",
                    field: "expressCompanyName",
                    width: 20,
                    align: "center"
                }, {
                    title: "快递单号",
                    field: "waybillCode",
                    width: 20,
                    align: "center"
                }, {
                    title: "处理时间",
                    field: "createTimeStr",
                    width: 20,
                    align: "center"
                }, {
                    title: "处理内容",
                    field: "acceptRemark",
                    width: 30,
                    align: "center"
                }]],
                cache: false,
                pagination: false,
                idField: "id",
                singleSelect: true,
                onLoadSuccess: function (data) {
                    if (data.total == 0) {
                        $(this).datagrid('appendRow', { expressCompanyName: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'expressCompanyName', colspan: 4 })
                    }
                }
            });

            $("#platformExpressTable").myDatagrid({
                fit: false,
                fitColumns: true,
                striped: true,
                rownumbers:true,
                url: contextPath + "/buyerOrder/queryExpressList",
                method: 'POST',
                queryParams: {
                    orderCode: orderCode,
                    expressTypeStr: "2,3,4"
                },
                loadFilter: function (data) {
                    var temp = defaultLoadFilter(data);
                    temp=null==temp?[]:temp;
                    temp.rows = temp.list;
                    return temp;
                },

                columns: [[{
                    title: "物流公司",
                    field: "expressCompanyName",
                    width: 20,
                    align: "center"
                }, {
                    title: "快递单号",
                    field: "waybillCode",
                    width: 20,
                    align: "center"
                }, {
                    title: "处理时间",
                    field: "createTimeStr",
                    width: 20,
                    align: "center"
                }, {
                    title: "处理内容",
                    field: "acceptRemark",
                    width: 30,
                    align: "center"
                }]],
                cache: false,
                pagination: false,
                idField: "id",
                singleSelect: true,
                onLoadSuccess: function (data) {
                    if (data.total == 0) {
                        $(this).datagrid('appendRow', { expressCompanyName: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'expressCompanyName', colspan: 4 })
                    }
                }
            });
        }
    });
</script>