<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showDiv == 1">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单号"/>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.orderStatus" placeholder="订单状态">
                        <i-option value="0">待付款</i-option>
                        <i-option value="101">订单已取消</i-option>
                        <i-option value="102">订单已删除</i-option>
                        <i-option value="201">订单已付款</i-option>
                        <i-option value="300">订单已发货</i-option>
                        <i-option value="301">用户确认收货</i-option>
                        <i-option value="401">退款</i-option>
                        <!--<i-option value="402">完成</i-option>-->
                    </i-select>
                </i-col>
                <!--<i-col span="4">
                    <i-select v-model="q.orderType">
                        <i-option value="1">普通订单</i-option>
                        <i-option value="2">团购订单</i-option>
                    </i-select>
                </i-col>-->
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            #if($shiro.hasPermission("order:wxMicropayPay"))
            <div class="buttons-group">
                <i-button type="error" @click="showInputAuthCode">微信付款</i-button>
            </div>
            #end
            #if($shiro.hasPermission("order:confirmPay"))
            <div class="buttons-group">
                <i-button type="error" @click="confirm">现金付款</i-button>
            </div>
            #end
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="showDiv == 2">
        <p slot="title" style="height: auto">{{title}}</p>
        <Tabs>
            <Tab-Pane label="订单信息" name="name1">
                <i-form ref="formValidate" :model="order" :label-width="100">
                    <Form-item label="订单号" prop="orderSn">
                        <i-input v-model="order.orderSn" readonly/>
                    </Form-item>
                    <Form-item label="会员" prop="userName">
                        <i-input v-model="order.userName" readonly/>
                    </Form-item>
                    <Form-item label="订单业务类型" prop="orderBizType" >
                        <i-select v-model="order.orderBizType" filterable placeholder="订单业务类型"
                                  label-in-value disabled>
                            <i-option v-for="macro in macros" :value="macro.value" :key="macro.id">{{macro.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                    <Form-item label="订单状态" prop="orderStatus" readonly>
                        <Radio-group v-model="order.orderStatus">
                            <Radio label="0" disabled>
                                <span>待付款</span>
                            </Radio>
                            <Radio label="101" disabled>
                                <span>订单已取消</span>
                            </Radio>
                            <Radio label="102" disabled>
                                <span>订单已删除</span>
                            </Radio>
                            <Radio label="201" disabled>
                                <span>订单已付款</span>
                            </Radio>
                            <Radio label="300" disabled>
                                <span>订单已发货</span>
                            </Radio>
                            <Radio label="301" disabled>
                                <span>用户确认收货</span>
                            </Radio>
                            <Radio label="401" disabled>
                                <span>退款</span>
                            </Radio>
                            <Radio label="402" disabled>
                                <span>完成</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <!--<Form-item label="发货状态" prop="shippingStatus">-->
                        <!--<Radio-group v-model="order.shippingStatus">-->
                            <!--<Radio label="0" disabled>-->
                                <!--<span>待发货</span>-->
                            <!--</Radio>-->
                            <!--<Radio label="1" disabled>-->
                                <!--<span>已发货</span>-->
                            <!--</Radio>-->
                            <!--<Radio label="2" disabled>-->
                                <!--<span>已收货</span>-->
                            <!--</Radio>-->
                            <!--<Radio label="4" disabled>-->
                                <!--<span>退货</span>-->
                            <!--</Radio>-->
                        <!--</Radio-group>-->
                    <!--</Form-item>-->
                    <Form-item label="付款状态" prop="payStatus">
                        <Radio-group v-model="order.payStatus">
                            <Radio label="0" disabled>
                                <span>待付款</span>
                            </Radio>
                            <Radio label="1" disabled>
                                <span>付款中</span>
                            </Radio>
                            <Radio label="2" disabled>
                                <span>已付款</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <!--<Form-item label="收货人" prop="consignee">-->
                        <!--<i-input v-model="order.consignee" readonly/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="收货地址" prop="address">-->
                        <!--<i-input v-model="order.address" readonly/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="联系电话" prop="mobile">-->
                        <!--<i-input v-model="order.mobile" readonly/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="客户留言" prop="postscript">-->
                        <!--<i-input v-model="order.postscript" readonly/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="快递公司" prop="shippingName">-->
                        <!--<i-input v-model="order.shippingName" readonly/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="配送单号" prop="shippingNo">-->
                        <!--<i-input v-model="order.shippingNo" readonly/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="配送费用" prop="shippingFee">-->
                        <!--<i-input v-model="order.shippingFee" readonly/>-->
                    <!--</Form-item>-->
                    <Form-item label="实际支付" prop="actualPrice">
                        <i-input v-model="order.actualPrice" readonly/>
                    </Form-item>
                    <Form-item label="订单总价" prop="orderPrice">
                        <i-input v-model="order.orderPrice" readonly/>
                    </Form-item>
                    <Form-item label="商品总价" prop="goodsPrice">
                        <i-input v-model="order.goodsPrice" readonly/>
                    </Form-item>
                    <Form-item label="下单时间" prop="addTime">
                        <Date-picker format="yyyy-MM-dd HH:mm:ss" v-model="order.addTime" placeholder="使用时间" readonly/>
                    </Form-item>
                    <!--<Form-item label="付款时间" prop="payTime">-->
                        <!--<Date-picker format="yyyy-MM-dd HH:mm:ss" v-model="order.payTime" placeholder="使用时间" readonly/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="配送费用" prop="freightPrice">-->
                        <!--<i-input v-model="order.freightPrice" readonly/>-->
                    <!--</Form-item>-->
                    <Form-item>
                        <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                        返回</i-button>
                    </Form-item>
                </i-form>
            </Tab-Pane>
            <Tab-Pane label="商品" name="name2">
                <table class="table">
                    <tr>
                        <td style="text-align: left; width: 600px; font-weight: bold;" colspan="2">商品</td>
                        <td style="text-align: center; width: 240px; font-weight: bold;">小计</td>
                        <td style="text-align: center; width: 240px; font-weight: bold;">优惠抵扣金额（元）</td>
                        <td style="text-align: center; width: 240px; font-weight: bold;">应收金额（元）</td>
                        <td style="text-align: center; width: 240px; font-weight: bold;">实收金额（元）</td>
                    </tr>
                    <tr v-for="(item,index) in orderGoodsList">
                        <td width="120px">
                            <img :src="item.listPicUrl" width="100px" height="100px" />
                        </td>
                        <td>
                            <p style="line-height: 30px;">{{item.goodsName}}</p>
                            <p style="line-height: 30px;">数量：{{item.number}}</p>
                            <p style="line-height: 30px;">单价：￥{{item.retailPrice}}</p>
                            <p style="line-height: 30px;">SKU：{{item.sku}}</p>
                        </td>
                        <td align="center">￥{{item.number * item.retailPrice}}</td>
                        <td align="center">-</td>
                        <td align="center">-</td>
                        <td align="center">-</td>
                    </tr>
                    <tr>
                        <td align="left" style="font-weight: bold;">运费</td>
                        <td align="center">-</td>
                        <td align="center">-</td>
                        <td align="center">-</td>
                        <td align="center">￥{{order.freightPrice}}</td>
                        <td align="center">-</td>
                    </tr>
                    <tr>
                        <td align="left" colspan="2" style="font-weight: bold;">总计</td>
                        <td align="center">￥{{order.orderPrice}}</td>
                        <td align="center">￥{{order.couponPrice}}</td>
                        <td align="center">￥{{order.actualPrice}}</td>
                        <td align="center" v-show="order.payStatus == 0">未付款</td>
                        <td align="center" v-show="order.payStatus == 1">付款中</td>
                        <td align="center" v-show="order.payStatus == 2 || order.payStatus == 4">￥{{order.actualPrice}}</td>
                    </tr>
                </table>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
            </Tab-Pane>
            <Tab-Pane label="支付记录" name="name3">
                <table class="table">
                    <tr>
                        <td style="text-align: left; width: 240px; font-weight: bold;">支付编号</td>
                        <td style="text-align: center; width: 240px; font-weight: bold;">支付金额（分）</td>
                        <td style="text-align: center; width: 240px; font-weight: bold;">交易状态</td>
                        <td style="text-align: center; width: 600px; font-weight: bold;">描述</td>
                    </tr>
                    <tr v-for="(item,index) in payRecordList">
                        <td align="left">{{item.outTradeNoWX}}</td>
                        <td align="center">{{item.totalFee}}</td>
                        <td align="center" v-show="item.tradeState == 'SUCCESS'">支付成功</td>
                        <td align="center" v-show="item.tradeState == 'REFUND'">转入退款</td>
                        <td align="center" v-show="item.tradeState == 'NOTPAY'">未支付</td>
                        <td align="center" v-show="item.tradeState == 'CLOSED'">已关闭</td>
                        <td align="center" v-show="item.tradeState == 'REVOKED'">已撤销</td>
                        <td align="center" v-show="item.tradeState == 'USERPAYING'">用户支付中</td>
                        <td align="center" v-show="item.tradeState == 'PAYERROR'">支付失败</td>
                        <td align="center">{{item.errCodeDes}}</td>
                    </tr>
                </table>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
            </Tab-Pane>
        </Tabs>
    </Card>

    <Card v-show="showDiv == 5">
        <p slot="title">退款</p>
        <i-form :model="order" :label-width="100">
            <Form-item label="退款金额" prop="refundMoney">
                <i-input v-model="refundMoney" placeholder="退款金额"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="refundUpdate">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
            </Form-item>
        </i-form>
    </Card>

</div>
<script src="${rc.contextPath}/js/shop/offilineOrderList.js?_${date.systemTime}"></script>
</body>
</html>