|  |  |  | 
|---|
|  |  |  | <th data-checkbox="true"></th> | 
|---|
|  |  |  | <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> | 
|---|
|  |  |  | <th data-align="center" data-width="195px" data-field="id" data-formatter="buidOperate">操作</th> | 
|---|
|  |  |  | <th data-field="userName">客户姓名</th> | 
|---|
|  |  |  | <th data-field="userTel">客户电话</th> | 
|---|
|  |  |  | <th data-field="storeName">店铺名称</th> | 
|---|
|  |  |  | <th data-field="orderStatus" data-formatter="buildOrderStatus">订单状态</th> | 
|---|
|  |  |  | <th data-field="orderTime" data-formatter="MGrid.getTime">下单时间</th> | 
|---|
|  |  |  | <th data-field="userName">客户</th> | 
|---|
|  |  |  | <th data-field="details" data-formatter="buildDetails">购买商品</th> | 
|---|
|  |  |  | <!--<th data-field="purchaseQuantity">购买件数</th>--> | 
|---|
|  |  |  | <th data-field="deliveryInfo.receiveAddress" data-formatter="buildLogistics">收货信息</th> | 
|---|
|  |  |  | <th data-field="orderStatus" data-formatter="buildOrderStatus">订单状态</th> | 
|---|
|  |  |  | <th data-field="deliveryInfo.waybillNo" data-formatter="buildDelivery">物流信息</th> | 
|---|
|  |  |  | <th data-field="orderTime" data-formatter="MGrid.getTime">下单时间</th> | 
|---|
|  |  |  | <th data-field="orderMoney">订单金额</th> | 
|---|
|  |  |  | <th data-field="discountAmount">优惠总金额</th> | 
|---|
|  |  |  | <th data-field="shippingMethod"  data-formatter="buildShippingMethod" >配送方式</th> | 
|---|
|  |  |  | <!--<th data-field="orderType" data-formatter="orderTypeFormatter">订单类型</th>--> | 
|---|
|  |  |  | <th data-field="orderNo">订单编号</th> | 
|---|
|  |  |  | <!--<th data-field="applyStatus" data-formatter="applyStatusFormatter">是否已提现</th>--> | 
|---|
|  |  |  | <th data-field="shippingMethod"  data-formatter="buildShippingMethod" >配送方式</th> | 
|---|
|  |  |  | <th data-field="storeName">店铺名称</th> | 
|---|
|  |  |  | </tr> | 
|---|
|  |  |  | </thead> | 
|---|
|  |  |  | </table> | 
|---|
|  |  |  | 
|---|
|  |  |  | return details; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 发货信息 | 
|---|
|  |  |  | function buildLogistics(value, row, index) { | 
|---|
|  |  |  | return (row.userName==null?"":row.userName)+" <br/>"+ (row.userTel==null?"":row.userTel) +" <br/>"+value  ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 物流信息 | 
|---|
|  |  |  | function buildDelivery(value, row, index) { | 
|---|
|  |  |  | return (row.deliveryInfo.logisticsCompanyCode==null?"":"快递编码:"+row.deliveryInfo.logisticsCompanyCode) | 
|---|
|  |  |  | +" <br/>"+ (row.deliveryInfo.logisticsCompany==null?"":"快递名称:"+row.deliveryInfo.logisticsCompany) | 
|---|
|  |  |  | +" <br/>"+(value==null?"":"快递单号:"+value)  ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function buildOrderStatus(value, row, index) { | 
|---|
|  |  |  | if (value == 1) { | 
|---|
|  |  |  | 
|---|
|  |  |  | + '操作 <span class="caret"></span>' + '</button>' | 
|---|
|  |  |  | + '<ul class="dropdown-menu" role="menu">' | 
|---|
|  |  |  | + btns[0].replace('VALUE', value) | 
|---|
|  |  |  | if (row.deliveryInfo.waybillNo != null && typeof row.deliveryInfo.waybillNo != 'undefined' && row.deliveryInfo.waybillNo != '') { | 
|---|
|  |  |  | html += btns[3].replace('orderId',row.id).replace('waybillNo',row.deliveryInfo.waybillNo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (row.orderStatus == 2) { | 
|---|
|  |  |  | html += btns[1].replace('VALUE', value) | 
|---|
|  |  |  | html += btns[1].replace('VALUE', value); | 
|---|
|  |  |  | html += btns[4].replace('orderId',row.id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (row.orderStatus == 3) { | 
|---|
|  |  |  | html += btns[2].replace('VALUE', value) | 
|---|
|  |  |  | html += btns[2].replace('VALUE', value); | 
|---|
|  |  |  | html += btns[4].replace('orderId',row.id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | html += '</ul>' + '</div>'; | 
|---|
|  |  |  | return html; | 
|---|
|  |  |  | 
|---|
|  |  |  | content: [basePath + '/admin/shopOrder/editForm?id=' + id] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查看物流信息 | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | function showLogisticsInfo(orderId,waybillNo){ | 
|---|
|  |  |  | if(waybillNo == '' || waybillNo == null){ | 
|---|
|  |  |  | layer.msg("订单还未发货,暂无物流信息", { | 
|---|
|  |  |  | icon : 2, | 
|---|
|  |  |  | time : 2000 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type : 2, | 
|---|
|  |  |  | title : "查看物流信息", | 
|---|
|  |  |  | area : [ MUI.SIZE_L, '500px' ], | 
|---|
|  |  |  | maxmin : true, | 
|---|
|  |  |  | content : [ basePath+'/admin/redirect/shop/shopLogisticsInfo-list?orderId=' + orderId] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 编辑物流信息 | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | function editDeliveryInfo(orderId){ | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type : 2, | 
|---|
|  |  |  | title : "编辑物流信息", | 
|---|
|  |  |  | area : [ MUI.SIZE_L, '500px' ], | 
|---|
|  |  |  | maxmin : true, | 
|---|
|  |  |  | content : [ basePath + '/admin/shopDeliveryInfo/editDeliveryInfoForm?orderId=' + orderId] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //修改订单为发货 | 
|---|
|  |  |  | 
|---|
|  |  |  | btns[0] = '<li><a href="javascript:void(0)" onClick="openEdit(\'VALUE\')" title="编辑">编辑</a></li>' | 
|---|
|  |  |  | btns[1] = '<li><a href="javascript:void(0)" onClick="openSendPackage(\'VALUE\')" title="开始发货">开始发货</a></li>' | 
|---|
|  |  |  | btns[2] = '<li><a href="javascript:void(0)" onClick="openSendPackageOver(\'VALUE\')" title="配送完成">配送完成</a></li>' | 
|---|
|  |  |  | btns[3] = '<li><a href="javascript:void(0)" onclick="showLogisticsInfo(\'orderId\',\'waybillNo\')" title="查看物流">查看物流</a></li>' | 
|---|
|  |  |  | btns[4] = '<li><a href="javascript:void(0)" onclick="editDeliveryInfo(\'orderId\')" title="编辑快递">编辑快递</a></li>' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|