<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="!detail&&showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="12">
                    <div style="display: inline-block;">
                        <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单号"/>
                    </div>
                    <div style="display: inline-block;width: 200px;">
                        <i-select v-model="q.orderStatus" placeholder="请选择订单状态">
                            <i-option value=" ">全部订单</i-option>
                            <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="1">订单已发货</i-option>
                            <i-option value="2">订单已收货</i-option>
                            <!-- <i-option value="401">退款(未发货)</i-option> -->
                            <!-- <i-option value="402">退款(已收货)</i-option> -->
                            <i-option value="501">完成</i-option>
                        </i-select>
                    </div>
                    <div style="display: inline-block;width: 200px;">
                        <i-select v-model="q.brandId" placeholder="请选择VR场景">
                            <i-option value=" ">全部</i-option>
                            <i-option v-for="(item,i) in brands" :key="i" :value="item.id">{{item.name}}</i-option>
                        </i-select>
                    </div>
                    <div style="display: inline-block;">
                        <i-button @click="query">查询</i-button>
                    </div>
                </i-col>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("order:exports"))
                <i-button v-if="(localStorage.getItem('userExpTime') > Date.now() && JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] !=8)|| (localStorage.getItem('userExpTime') == 'null' &&JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] !=8)" type="info" @click="exports">导出</i-button>
                #end
                #if($shiro.hasPermission("order:sendGoods"))
                <i-button v-if="(localStorage.getItem('userExpTime') > Date.now() && JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] !=8)|| (localStorage.getItem('userExpTime') == 'null' &&JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] !=8)" type="warning" @click="sendGoods">发货</i-button>
                #end
                #if($shiro.hasPermission("order:confirm"))
                <i-button v-if="(localStorage.getItem('userExpTime') > Date.now() && JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] !=8)|| (localStorage.getItem('userExpTime') == 'null' &&JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] !=8)" type="error" @click="confirm">确认收货</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList&&!detail">
        <p slot="title">{{title}}</p>
        <i-form :model="order" :label-width="100">
            <div style="width: 100%;">
                <Form-item label="快递公司" prop="shippingId">
                    <div class="c-winput">
                        <i-select v-model="order.shippingId" filterable>
                            <i-option v-for="shipping in shippings" :value="shipping.id" :key="shipping.id">{{shipping.name}}
                            </i-option>
                        </i-select>
                    </div>
                </Form-item>
                <Form-item label="快递单号" prop="shippingNo">
                    <div class="c-winput">
                        <i-input v-model="order.shippingNo" placeholder="快递单号"/>
                    </div>
                </Form-item>
                <Form-item>
                    <i-button type="primary" @click="saveOrUpdate">提交</i-button>
                    <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                    返回</i-button>
                </Form-item>
            </div>
        </i-form>
    </Card>

    <Card v-show="detail">
        <p slot="title" style="height: auto">
            {{title}}
            <i-button type="warning" @click="reload" style="margin-left: 8px;float: right;"/>
            返回</i-button>
        </p>
        <i-form ref="formValidate" :model="order" :label-width="80">
            <div style="width: 100%;">
                <Form-item label="订单号:" prop="orderSn">
                    {{order.orderSn}}
                    <!-- <i-input v-model="" readonly/> -->
                </Form-item>
                <Form-item label="会员昵称:" prop="nickName">
                    {{order.nickName}}
                    <!-- <i-input v-model="order.nickName" readonly/> -->
                </Form-item>
                <Form-item label="订单类型:" prop="orderType">
                    <div class="c-winput">
                        <i-select v-model="order.orderType" disabled>
                            <i-option value="1">普通订单</i-option>
                            <i-option value="2">团购订单</i-option>
                            <i-option value="3">砍价订单</i-option>
                            <i-option value="4">立即购买</i-option>
                        </i-select>
                    </div>
                </Form-item>
                <Form-item label="订单状态:" prop="orderStatus" readonly>
                    <span>{{orderStatusStr[order.orderStatus]||'-'}}</span>
                </Form-item>
                <Form-item label="发货状态:" prop="shippingStatus">
                    <span>{{shippingStatusStr[order.shippingStatus]||'-'}}</span>
                </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="goodsList">
                    <div v-if="order.goodsList" class="order-detail">
                        <div class="order-item" v-if="order.goodsList" v-for="(item,idx) in order.goodsList" :key="idx">
                            <img :src="item.listPicUrl" alt="">
                            <div class="order-info">
                                <p>{{item.goodsName}}</p>
                                <p>{{item.goodsSpecifitionNameValue}}</p>
                                <p class="order-price">
                                    <span>￥{{item.retailPrice}}</span>
                                    <span>x{{item.number}}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div v-else>暂无商品信息</div>
                </Form-item>
                <Form-item label="收货人:" prop="consignee">
                    {{order.consignee}}
                    <!-- <i-input v-model="order.consignee" readonly/> -->
                </Form-item>
                <Form-item label="收货地址:" prop="address">
                    {{order.address}}
                    <!-- <i-input v-model="order.address" readonly/> -->
                </Form-item>
                <Form-item label="联系电话:" prop="mobile">
                    {{order.mobile}}
                    <!-- <i-input v-model="order.mobile" readonly/> -->
                </Form-item>
                <Form-item label="快递公司:" prop="shippingName">
                    {{order.shippingName}}
                    <!-- <i-input v-model="order.shippingName" readonly/> -->
                </Form-item>
                <Form-item label="快递单号:" prop="shippingNo">
                    {{order.shippingNo}}
                    <!-- <i-input v-model="order.shippingNo" readonly/> -->
                </Form-item>
                <Form-item label="物流信息:" prop="logistics">
                    <Timeline style="background-color: #fafafa;" v-if="order.logistics">
                        <TimelineItem v-if="order.logistics" v-for="(item,idx) in order.logistics.list" :key="idx">
                            <p>{{item.time}}</p>
                            <p style="padding-left: 5px;" >{{item.status}}</p>
                        </TimelineItem>
                    </Timeline>
                    <div v-else>暂无物流信息</div>
                </Form-item>
                <Form-item label="付款方:" prop="payName">
                    {{order.payName}}
                    <!-- <i-input v-model="order.payName" readonly/> -->
                </Form-item>
                <Form-item label="快递费用:" prop="shippingFee">
                    {{order.freightPrice}}
                    <!-- <i-input v-model="order.shippingFee" readonly/> -->
                </Form-item>
                <Form-item label="实际支付:" prop="actualPrice">
                    {{order.actualPrice}}
                    <!-- <i-input v-model="order.actualPrice" readonly/> -->
                </Form-item>
                <Form-item label="订单总价:" prop="orderPrice">
                    {{order.orderPrice}}
                    <!-- <i-input v-model="order.orderPrice" readonly/> -->
                </Form-item>
                <Form-item label="商品总价:" prop="goodsPrice">
                    {{order.goodsPrice}}
                    <!-- <i-input v-model="order.goodsPrice" readonly/> -->
                </Form-item>
                <Form-item label="下单时间:" prop="addTime">
                    {{transDate(order.addTime, 'yyyy-MM-dd')}}

                    <!-- <Date-picker v-model="order.addTime" placeholder="使用时间" readonly/> -->
                </Form-item>
                <Form-item label="付款时间:" prop="payTime">
                    {{transDate(order.payTime, 'yyyy-MM-dd')}}
                    <!-- <Date-picker 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> -->
            </div>
        </i-form>
    </Card>

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