Browse Source

处理卖家中心的订单详情页面

wangcz 7 years ago
parent
commit
d83b6fa9d8

+ 69 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_detail.js

@@ -7,6 +7,9 @@ define(['app/app'], function(app) {
 		$scope.purchaseId = $stateParams.purchaseId;
 		$scope.open = false;
 		document.title = '订单详情-优软商城';
+        $scope.CheckId = 'autoMonth0'; // 当前发货点选择按钮
+        $scope.ChooseItem = '';// 当前选择发货单
+
 		// 记录状态激活信息
 		$scope.steps = {
 			step1 : false,
@@ -22,6 +25,57 @@ define(['app/app'], function(app) {
 		/**********************************************************************
 		 * 初始化
 		 **********************************************************************/
+        // 获取当前收货单所对应的物品信息
+        function getReceiveInfo() {
+            if(!$scope.ChooseItem) {
+                return;
+            }
+            Order.getSendOrderInfo(
+                {id: $scope.purchase.id, invoiceid: $scope.ChooseItem}, {},
+                function (data) {
+                    var params = {};
+                    // $scope.orderStatus = true
+
+                    if (data.data.status === 404 || data.data.signReceive) {
+                        $scope.orderStatus = true
+                    } else {
+                        $scope.orderStatus = false
+                    }
+                    var _data = data.data.invoiceDetails
+                    var _details = $scope.purchase.purchaseDetails
+                    $scope.purchase.logistics = data.data.logistics
+                    $scope.logistics = data.data.logistics
+                    for (var j = 0; j < _data.length; j++) {
+                        for (var k = 0; k < _details.length; k++) {
+                            if (_data[j].purchaseDetailId === _details[k].id) {
+                                _details[k].receiveCount = _data[j].qty
+                            }
+                        }
+                    }
+                    params.companyName = $scope.logistics.companyName;
+                    KdnLogistics.kdnQueryCompany({companyName:$scope.logistics.companyName}, function(response){
+                        console.log(response);
+                        if (response.code){
+                            $scope.canShowInfo = true;
+                        }else{
+                            $scope.canShowInfo = false;
+                        }
+                    },function (ex) {
+                        $scope.canShowInfo = false;
+                    });
+                    params.logisticsCode = $scope.logistics.number;
+                    KdnLogistics.kdnQuery(params, {}, function(response){
+                        if(!response.errorInfo) {
+                            $scope.logisticsInfo = eval ("(" + response.traces + ")");
+                            if($scope.logisticsInfo.length != 0) {
+                                $scope.hasInfo = true;
+                            }
+                        }
+                    }, function(err){
+                        toaster.pop('info', err.data);
+                    });
+                })
+        }
 
 		/**
 		 * 处理错误信息
@@ -442,7 +496,14 @@ define(['app/app'], function(app) {
 			1303 : '上门自提'
 		};
 
-
+		// 设置当前选择的发货单
+        $scope.ChooseSendGoodsItem = function(item, ind, e) {
+            e.stopPropagation()
+            e.preventDefault()
+            $scope.CheckId = 'autoMonth' + ind;
+            $scope.ChooseItem = item;
+            getReceiveInfo();
+        }
 
 		// 检测采购单编号ID是否存在,如果不存在跳转卖家中心首页
 		$scope.updatePurchase = function () {
@@ -461,6 +522,13 @@ define(['app/app'], function(app) {
 				}else {
 					$scope.installmentBox = false
 				}
+                $scope.sendGoodsList = []
+                if ($scope.purchase.inids) {
+                    $scope.sendGoodsList = $scope.purchase.inids.split(',')
+                }
+                // $scope.acceptGoods = $scope.order.signReceive
+                $scope.ChooseItem = $scope.sendGoodsList.length > 0 ? $scope.sendGoodsList[0] : ''
+                getReceiveInfo();
 				$scope.purchase.purchaseHistory = angular.fromJson($scope.purchase.statushistory);
 				$scope.purchase.currentTotal = $scope.purchase.price + $scope.purchase.fare;
 				if ($scope.purchase.jsonRule){

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/order_detail.html

@@ -597,8 +597,8 @@
 								<!-- 本次收货 -->
 								<div class="text-area">
 									<i ng-if="orderStatus">{{detail.receiveCount}}</i>
-                  <i ng-if="!orderStatus">-</i>
-                </div>
+								  <i ng-if="!orderStatus">-</i>
+								</div>
 							</span>
 						</dd>
 					</div>

+ 18 - 11
src/main/webapp/resources/view/vendor/forstore/purchase_detail.html

@@ -17,7 +17,7 @@
 		width: 14%;
 	}
 	#oder-detail .oder_xq_list dl span.wd01{
-		width: 13%;
+		width: 12%;
 	}
 	#oder-detail .oder_xq_list dl span.wd02{
 		width: 25%;
@@ -462,7 +462,7 @@
 
 		<!-- 订单信息 -->
 		<div class="logistics_list01 clearfix" style="margin-bottom: 10px;">
-			<div class="log_menu">
+			<div class="log_menu" style="border-bottom: #e8e8e8 1px solid;">
 				<span style="white-space: nowrap; width: 50%; text-align: left; line-height: 50px; position:relative;border:none;height:auto;">
 					订单信息 <a style="margin: 0 10px"></a>卖家:
 							<i style="min-width: 270px; display: inline-block">
@@ -509,10 +509,10 @@
 							<!--<em><font style="color: #333; margin-left: 20px">订单状态:</font>{{purchase.status | purchaseStatus}}</em>-->
 						<!--</b>-->
 					<!--</span>-->
-					<span ng-if="purchase.status != 602 && purchase.status != 603 && purchase.status != 604 && purchase.status != 605 && purchase.status != 606 && purchase.status != 315">
+					<span style="border:none;" ng-if="purchase.status != 602 && purchase.status != 603 && purchase.status != 604 && purchase.status != 605 && purchase.status != 606 && purchase.status != 315">
 						<b>订单号:{{purchase.orderid}}<em style="margin-left: 25px;"><font style="color: #333;">订单状态:</font>{{purchase.status | purchaseStatus}}</em></b>
 					</span>
-					<span ng-if="purchase.status == 602 || purchase.status == 603 || purchase.status == 604 || purchase.status == 605 || purchase.status == 606 || purchase.status == 315">
+					<span style="border:none;" ng-if="purchase.status == 602 || purchase.status == 603 || purchase.status == 604 || purchase.status == 605 || purchase.status == 606 || purchase.status == 315">
 					<i class="f14">订单号:{{purchase.orderid}}</i>
 					<b style="display:inline-block;line-height: 25px;padding-top:10px;vertical-align:top;">
 						<em><font class="color999">订单状态:</font>{{purchase.status | purchaseStatus}}</em>
@@ -565,7 +565,8 @@
 						<span style="width: 10%;">数量</span>
 						<span class="wd01">小计</span>
 						<!--<span class="wd01">物料编码</span>-->
-						<span class="wd01">备注</span>
+						<span class="wd01">已发货PCS</span>
+						<span class="wd01">本次发货PCS</span>
 					</dt>
 					<!--<dd>-->
 					<!--<span style="width: 100%; text-align: left; padding-left: 20px;" class="ng-binding"><img src="static/img/user/images/shop_home01.png">{{purchase.buyentername}}</span>-->
@@ -605,8 +606,8 @@
 							</em>
 						</span>
 							<span style="width: 10%;" ng-bind="detail.number">100</span>
-							<span style="overflow: hidden;white-space: nowrap;width: 15%;    text-overflow: ellipsis;" ng-show="!isChange" class="wd01 red" ng-bind="detail.taxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName" title="{{detail.taxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName}}"></span>
-							<span style="overflow: hidden;white-space: nowrap;width: 15%;    text-overflow: ellipsis;s" ng-show="isChange" class="wd01 red" ng-bind="detail.detailTotal | formateNumber : 6 | currencySysmbol : detail.currencyName" title="{{detail.detailTotal | formateNumber : 6 | currencySysmbol : detail.currencyName}}"></span>
+							<span style="overflow: hidden;white-space: nowrap;width: 12%;text-overflow: ellipsis;" ng-show="!isChange" class="wd01 red" ng-bind="detail.taxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName" title="{{detail.taxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName}}"></span>
+							<span style="overflow: hidden;white-space: nowrap;width: 12%;text-overflow: ellipsis;" ng-show="isChange" class="wd01 red" ng-bind="detail.detailTotal | formateNumber : 6 | currencySysmbol : detail.currencyName" title="{{detail.detailTotal | formateNumber : 6 | currencySysmbol : detail.currencyName}}"></span>
 							<!--物料编码-->
 							<!--<span class="wd01" style="line-height: 18px;">-->
 								<!--<em ng-if="!detail.goodsnumber">&nbsp;</em>-->
@@ -614,10 +615,16 @@
 									<!--<i ng-bind="detail.goodsnumber">金石为开取数据五块钱叫稍微亲上加亲</i>-->
 								<!--</div>-->
 							<!--</span>-->
-							<span class="wd01" style="line-height: 18px;">
-								<em ng-if="!detail.remark">&nbsp;</em>
-								<div class="text-area" ng-if="detail.remark">
-									<i ng-bind="detail.remark">金石为开取数据五块钱叫稍微亲上加亲</i>
+							<span class="wd01" ng-bind="detail.shipQty || '-'">
+								<em ng-if="!detail.shipQty">-</em>
+								<div class="text-area" ng-if="detail.shipQty">
+									<i ng-bind="detail.shipQty">金石为开取数据五块钱叫稍微亲上加亲</i>
+								</div>
+							</span>
+							<span class="wd01" ng-bind="detail.receiveCount || '-'">
+								<em ng-if="!detail.receiveCount">-</em>
+								<div class="text-area" ng-if="detail.receiveCount">
+									<i ng-bind="detail.receiveCount">金石为开取数据五块钱叫稍微亲上加亲</i>
 								</div>
 							</span>
 						</dd>