<!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="3">
                    <i-select v-model="q.thirdMerchSn" placeholder="第三方商户" filterable label-in-value>
                        <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdMerchSn" :key="thirdMerchant.thirdMerchSn">{{thirdMerchant.thirdPartyMerchName}}</i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.storeId" placeholder="门店" filterable label-in-value>
                        <i-option v-for="store in stores" :value="store.id"
                                  :key="store.id">{{store.storeName}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.supplierThirdId" placeholder="所属供应商三方商户" filterable label-in-value>
                        <i-option v-for="thirdMerchant in supplierThirdMerchantBizList" :value="thirdMerchant.thirdMerchSn" :key="thirdMerchant.thirdMerchSn">{{thirdMerchant.thirdPartyMerchName}}</i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单号"/>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.merchOrderSn" @on-enter="query" placeholder="商户订单号"/>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.sku" @on-enter="query" placeholder="sku"/>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.orderBizType" placeholder="货品业务类型">
                        <i-option v-for="macro in orderBizTypeList" :value="macro.value" :key="macro.id">{{macro.name}}
                        </i-option>
                        <!--<i-option value="402">完成</i-option>-->
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.orderStatus" placeholder="订单状态">
                        <i-option v-for="macro in orderStatusList" :value="macro.value" :key="macro.id">{{macro.name}}
                        </i-option>
                        <!--<i-option value="402">完成</i-option>-->
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.payStatus" placeholder="支付状态">
                        <i-option v-for="macro in payStatusList" :value="macro.value" :key="macro.id">{{macro.name}}
                        </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-col span="3">
                    <Date-picker v-model="q.startTime" placeholder="创建订单开始时间"/>
                </i-col>
                <i-col span="3">
                    <Date-picker v-model="q.endTime" placeholder="创建订单结束时间"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div>
                <div class="buttons-group" style="float: left">
                    #if($shiro.hasPermission("order:export"))
                    <i-button type="primary" @click="exportOrder"><i class="fa fa-cloud-download"></i>&nbsp;导出</i-button>
                    #end
                    #if($shiro.hasPermission("order:getProcess"))
                    <i-button type="success" @click="getProcess">查看清关信息</i-button>
                    #end
                    #if($shiro.hasPermission("order:getLogistics"))
                    <i-button type="warning" @click="getLogistics">查看快递信息</i-button>
                    #end
                    #if($shiro.hasPermission("order:confirm"))
                    <i-button type="error" @click="confirm">确认收货</i-button>
                    #end
                    #if($shiro.hasPermission("shop:comment"))
                    <i-button type="info" @click="openComment">评价</i-button>
                    #end
                    #if($shiro.hasPermission("order:updateExpressInfo"))
                    <i-button type="info" @click="getExpressInfo">修改快递信息</i-button>
                    #end
                    #if($shiro.hasPermission("order:expressUpload"))
                    <i-col style="display: inline-grid;">
                        <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
                                :format="['xls','xlsx']"
                                action="../order/expressUpload">
                            <i-button type="ghost" icon="ios-cloud-upload-outline">订单快递批量导入</i-button>
                        </Upload>
                    </i-col>
                    #end
                    #if($shiro.hasPermission("order:down"))
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="../statics/file/order_express_export_yyyy_mm_dd_v1.0.0.xls">订单快递模板下载</a>&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="../statics/file/epress_data.xls">快递公司简写数据下载</a>
                    #end
                </div>
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="showDiv == 8">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="order" :rules="ruleValidate" :label-width="100">
            <Form-item label="订单号" prop="orderSn">
                <i-input v-model="order.orderSn" placeholder="订单号" readonly="readonly"/>
            </Form-item>
            <Form-item label="快递公司" prop="shippingCode">
                <i-select v-model="order.shippingCode" placeholder="快递公司" filterable label-in-value>
                    <i-option v-for="shipping in shippingList" :value="shipping.code"
                              :key="shipping.code">{{shipping.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="配送单号" prop="shippingNo">
                <i-input v-model="order.shippingNo" placeholder="快递单号"/>
                <i-input v-model="order.id" placeholder="快递单号" hidden/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
            </Form-item>
        </i-form>
    </Card>
    <Card v-show="showDiv == 7">
        <p slot="title">清关信息</p>
        <i-form :label-width="150">
            <!--<Timeline style="margin-left: 100px;">-->
                <!--<Timeline-item>-->
                    <!--<p class="time">订单编号: {{orderProcessRecordEntity.orderSn}}</p>-->
                    <!--<p class="content">下单开始时间:{{orderProcessRecordEntity.addOrderStartTimeStr}}</p>-->
                    <!--<p class="content">下单成功时间:{{orderProcessRecordEntity.addOrderSuccTimeStr}}</p>-->
                    <!--<p class="content">下单状态:{{orderProcessRecordEntity.isAddOrderSend==1?"成功":""}}-->
                        <!--{{orderProcessRecordEntity.isAddOrderSend==0?"失败":""}}-->
                        <!--{{orderProcessRecordEntity.isAddOrderSend==2?"下单中":""}}</p>-->
                <!--</Timeline-item>-->
                <!--<Timeline-item>-->
                    <!--<p class="time">支付单号: {{orderProcessRecordEntity.payTransactionId}}</p>-->
                    <!--<p class="content">支付开始时间:{{orderProcessRecordEntity.payStartTimeStr}}</p>-->
                    <!--<p class="content">支付成功时间:{{orderProcessRecordEntity.paySuccTimeStr}}</p>-->
                <!--</Timeline-item>-->
                <!--<Timeline-item>-->
                    <!--<p class="time">支付单开始时间:{{orderProcessRecordEntity.paymentStartTimeStr}}</p>-->
                    <!--<p class="time">支付单成功时间:{{orderProcessRecordEntity.paymentSuccTimeStr}}</p>-->
                    <!--<p class="content">支付单状态:{{orderProcessRecordEntity.isPaymentSend==1?"成功":""}}-->
                        <!--{{orderProcessRecordEntity.isPaymentSend==0?"失败":""}}-->
                        <!--{{orderProcessRecordEntity.isPaymentSend==2?"下单中":""}}</p>-->
                <!--</Timeline-item>-->
            <!--</Timeline>-->
            <Form-item label="订单编号：" prop="orderSn" style="height: 14px">
                {{orderProcessRecordEntity.orderSn}}
            </Form-item>
            <Form-item label="下单开始时间：" prop="addOrderStartTime" style="height: 14px">
                {{orderProcessRecordEntity.addOrderStartTimeStr}}
            </Form-item>
            <Form-item label="下单成功时间：" prop="addOrderSuccTime" style="height: 14px">
                {{orderProcessRecordEntity.addOrderSuccTimeStr}}
            </Form-item>
            <Form-item label="下单状态：" prop="isAddOrderSend" style="height: 14px">
                <Radio-group v-model="orderProcessRecordEntity.isAddOrderSend">
                    <Radio label="0">
                        <span>失败</span>
                    </Radio>
                    <Radio label="1">
                        <span>成功</span>
                    </Radio>
                    <Radio label="2">
                        <span>下单中</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <div style="padding-top:10px;">
            <Form-item label="支付单号：" prop="payTransactionId" style="margin-top:10px;height: 14px">
                {{orderProcessRecordEntity.payTransactionId}}
            </Form-item>
            <Form-item label="支付开始时间：" prop="payStartTime" style="height: 14px">
                {{orderProcessRecordEntity.payStartTimeStr}}
            </Form-item>
            <Form-item label="支付成功时间：" prop="paySuccTime" style="height: 14px">
                {{orderProcessRecordEntity.paySuccTimeStr}}
            </Form-item>
            </div>

            <div style="padding-top:10px;">
            <Form-item label="海关支付单开始时间：" prop="paymentStartTime" style="margin-top:10px;height: 14px">
                {{orderProcessRecordEntity.paymentStartTimeStr}}
            </Form-item>
            <Form-item label="海关支付单成功时间：" prop="paymentSuccTime" style="height: 14px">
                {{orderProcessRecordEntity.paymentSuccTimeStr}}
            </Form-item>
            <Form-item label="海关支付单状态：" prop="isPaymentSend" style="height: 14px">
                <Radio-group v-model="orderProcessRecordEntity.isPaymentSend">
                    <Radio label="0">
                        <span>失败</span>
                    </Radio>
                    <Radio label="1">
                        <span>成功</span>
                    </Radio>
                    <Radio label="2">
                        <span>支付单申报中</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            </div>

            <div style="padding-top:10px;">
            <Form-item label="电子订单开始时间：" prop="eleOrderStartTime" style="margin-top:10px;height: 14px">
                {{orderProcessRecordEntity.eleOrderStartTimeStr}}
            </Form-item>
            <Form-item label="电子订单成功时间：" prop="eleOrderSuccTime" style="height: 14px">
                {{orderProcessRecordEntity.eleOrderSuccTimeStr}}
            </Form-item>
            <Form-item label="电子订单状态：" prop="isEleOrderSend" style="height: 14px">
                <Radio-group v-model="orderProcessRecordEntity.isEleOrderSend">
                    <Radio label="0">
                        <span>失败</span>
                    </Radio>
                    <Radio label="1">
                        <span>成功</span>
                    </Radio>
                    <Radio label="2">
                        <span>电子订单申报中</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            </div>

            <div style="padding-top:10px;">
            <Form-item label="运单编号：" prop="logisticsNo" style="margin-top:10px;height: 14px">
                {{orderProcessRecordEntity.logisticsNo}}
            </Form-item>
            <Form-item label="运单开始时间：" prop="waybillStartTime" style="height: 14px">
                {{orderProcessRecordEntity.waybillStartTimeStr}}
            </Form-item>
            <Form-item label="运单成功时间：" prop="waybillSuccTime" style="height: 14px">
                {{orderProcessRecordEntity.waybillSuccTimeStr}}
            </Form-item>
            </div>

            <div style="padding-top:10px;">
            <Form-item label="清单编号：" prop="invtNo" style="margin-top:10px;height: 14px">
                {{orderProcessRecordEntity.invtNo}}
            </Form-item>
            <Form-item label="清单开始时间：" prop="customsStartTime" style="height: 14px">
                {{orderProcessRecordEntity.customsStartTimeStr}}
            </Form-item>
            <Form-item label="清单成功时间：" prop="customsSuccTime" style="height: 14px">
                {{orderProcessRecordEntity.customsSuccTimeStr}}
            </Form-item>
            <Form-item label="清关状态：" prop="isCustomsSend" style="height: 14px">
                <Radio-group v-model="orderProcessRecordEntity.isCustomsSend">
                    <Radio label="0">
                        <span>失败</span>
                    </Radio>
                    <Radio label="1">
                        <span>成功</span>
                    </Radio>
                    <Radio label="2">
                        <span>清关中</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            </div>
            <div style="padding-top:10px;">
                <Form-item label="出货开始时间：" prop="shipmentStartTime" style="height: 14px">
                    {{orderProcessRecordEntity.shipmentStartTimeStr}}
                </Form-item>
                <Form-item label="出货成功时间：" prop="shipmentSuccTime" style="height: 14px">
                    {{orderProcessRecordEntity.shipmentSuccTimeStr}}
                </Form-item>
            </div>
            <Form-item label="订单流转信息：" prop="processContent" style="padding-top:10px;">
                <i-input type="textarea" v-model="orderProcessRecordEntity.processContent" readonly placeholder="订单流转信息"/>
            </Form-item>
            <Form-item>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
            </Form-item>
        </i-form>
    </Card>

    <Card v-show="showDiv == 3">
        <p slot="title">{{title}}</p>
        <i-form :label-width="100">
            <Form-item label="快递公司" prop="name">
                <i-select v-model="logisticsInfo.shipperCode" disabled  @on-change="shippingChange" label-in-value filterable >
                    <i-option v-for="item in shippings" :value="item.code" :key="item.code">{{item.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="配送单号" prop="name">
                <i-input v-model="logisticsInfo.logisticCode" placeholder="快递单号"/>
            </Form-item>
            <Timeline style="margin-left: 100px;">
                <Timeline-item v-for="item in logisticsInfo.tracesList">
                    <p class="time">{{item.acceptTime}}</p>
                    <p class="content">{{item.acceptStation}}</p>
                </Timeline-item>
            </Timeline>
            <Form-item>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
            </Form-item>
        </i-form>
    </Card>

    <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">
                        {{order.province}}{{order.city}}{{order.district}}{{order.address}}
                    </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>
                        <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>
                        <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">-</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.fullCutPrice}}</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>
        </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/order.js?_${date.systemTime}"></script>
</body>
</html>