Browse Source

修改库存管理bug

shenjj 7 years ago
parent
commit
d76b4f84cb

+ 28 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/order_detail_ctrl.js

@@ -16,6 +16,7 @@ define(['app/app'], function(app) {
       Order.getSendOrderInfo(
           {id: $scope.order.id, invoiceid: $scope.ChooseItem}, {},
           function (data) {
+            var params = {};
           	if (data.data.status === 404) {
               $scope.orderStatus = true
 	          } else {
@@ -24,6 +25,8 @@ define(['app/app'], function(app) {
             var _data = data.data.invoiceDetails
             var _details = $scope.order.orderDetails
 	          $scope.order.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].orderDetailId === _details[k].id) {
@@ -31,6 +34,28 @@ define(['app/app'], function(app) {
                 }
               }
             }
+            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);
+            });
           })
     }
     // 记录状态激活信息
@@ -278,7 +303,9 @@ define(['app/app'], function(app) {
 		}
 
 		// 设置当前选择的发货单
-		$scope.ChooseSendGoodsItem = function(item, ind) {
+		$scope.ChooseSendGoodsItem = function(item, ind, e) {
+			e.stopPropagation()
+			e.preventDefault()
 		  $scope.CheckId = 'autoMonth' + ind;
 		  $scope.ChooseItem = item;
 		  getReceiveInfo();

+ 64 - 20
src/main/webapp/resources/js/usercenter/controllers/forstore/query_logistics_ctrl.js

@@ -14,6 +14,46 @@ define(['app/app', 'calendar'], function(app) {
             1302 : '卖家配送',
             1303 : '上门自提'
         };
+      // 设置当前选择的发货单
+      $scope.ChooseSendGoodsItem = function(item, ind, e) {
+        e.stopPropagation()
+        e.preventDefault()
+        $scope.CheckId = 'autoMonth' + ind;
+        $scope.ChooseItem = item;
+        getReceiveInfo();
+      }
+      // 获取当前收货单所对应的物品信息
+      function getReceiveInfo() {
+        Order.getSendOrderInfo(
+            {id: $scope.order.id, invoiceid: $scope.ChooseItem}, {},
+            function (data) {
+              var params = {};
+              $scope.order.logistics = data.data.logistics
+              $scope.logistics = data.data.logistics
+              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);
+              });
+            })
+      }
 
         /**
          *  查询物流信息(接口需要真实运单号)
@@ -34,31 +74,35 @@ define(['app/app', 'calendar'], function(app) {
                 }
                 $scope.order = data[0];
                 $scope.address = JSON.parse($scope.order.jsonAddress);
+                $scope.sendGoodsList = $scope.order.inIds.split(',')
+                  $scope.CheckId = 'autoMonth0';
+                  $scope.ChooseItem = $scope.sendGoodsList[0];
+                    getReceiveInfo()
                 if (!data[0].lgtId) {
                     getOrderStatus($scope.order.status);
                     $scope.logisticsInfo = [];
                     return;
                 }
-                Logistics.findLogisticsById({lgtid: data[0].lgtId}, function(data){
-                    $scope.logistics = data;
-                    var params = {};
-                    params.companyName = $scope.logistics.companyName;
-                    params.logisticsCode = $scope.logistics.number;
-                    KdnLogistics.kdnQuery(params, {}, function(response){
-                        if(!response.errorInfo) {
-                            $scope.logisticsInfo = eval ("(" + response.traces + ")");
-                            statusOfLogistics($scope.logisticsInfo[$scope.logisticsInfo.length - 1].AcceptStation);
-                            $scope.hasInfo = true;
-                        } else {
-                            $scope.logisticsInfo = [];
-                        }
-                    }, function(err){
-                        $scope.logisticsInfo = [];
-                        toaster.pop('info', err.data || '查询物流信息失败,请核对物流公司和运单号');
-                    });
-                }, function(err){
-                    toaster.pop('info', err.data || '根据快递ID查询跟订单相关联的物流信息失败');
-                });
+                // Logistics.findLogisticsById({lgtid: data[0].lgtId}, function(data){
+                //     $scope.logistics = data;
+                //     var params = {};
+                //     params.companyName = $scope.logistics.companyName;
+                //     params.logisticsCode = $scope.logistics.number;
+                //     KdnLogistics.kdnQuery(params, {}, function(response){
+                //         if(!response.errorInfo) {
+                //             $scope.logisticsInfo = eval ("(" + response.traces + ")");
+                //             statusOfLogistics($scope.logisticsInfo[$scope.logisticsInfo.length - 1].AcceptStation);
+                //             $scope.hasInfo = true;
+                //         } else {
+                //             $scope.logisticsInfo = [];
+                //         }
+                //     }, function(err){
+                //         $scope.logisticsInfo = [];
+                //         toaster.pop('info', err.data || '查询物流信息失败,请核对物流公司和运单号');
+                //     });
+                // }, function(err){
+                //     toaster.pop('info', err.data || '根据快递ID查询跟订单相关联的物流信息失败');
+                // });
             }, function(err) {
                 toaster.pop('warning', err.data || '获取订单信息失败。');
             });

+ 10 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -3763,8 +3763,9 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     $scope.productUpOff = {}
     // 编辑上下架
     $scope.dateArea = 'formMe';
+    var _item = null
     $scope.editProductUpOff = function(commodity, index) {
-      if (commodity.erpReserve === '' ||  commodity.minPackQty === 0) {
+      if (commodity.erpReserve === '' ||  commodity.erpReserve === 0) {
         toaster.pop('warning','提示','当前物料库存为0,请先入库')
         return;
       }
@@ -3787,9 +3788,12 @@ define(['app/app', 'jquery-uploadify'], function(app) {
           minBuyQty: $scope.productUpOff.minPackQty || 1,
           prices: [{'start': $scope.productUpOff.minPackQty || 1, rMBPrice: ''}],
         }
+
         // $scope.productAddFragment($scope.productUpOff.goods.prices)
       }
-      $scope.productUpOff.goods.prices[0].start = $scope.productUpOff.minPackQty || 1
+      _item = $scope.productUpOff.goods.prices[0].start
+      // $scope.productUpOff.goods.prices[0].start = $scope.productUpOff.minPackQty || 1
+
       $scope.productUpOff.goods.selfSale = ($scope.storeInfo.uuid != 'undefind' && $scope.productUpOff.goods.storeid == $scope.storeInfo.uuid && $scope.storeInfo.storeName.indexOf('优软测试二') < 0 && $scope.storeInfo.storeName.indexOf('优软商城') < 0) ? 1: 0
       // $scope.productUpOff.dateArea = $scope.productUpOff.goods.selfSale === 1 ? 'formMe' : 'autoMonth' // 自营还是销售
       commodity.dateArea = $scope.productUpOff.goods.selfSale === 1 ? 'formMe' : 'autoMonth' // 自营还是销售
@@ -3801,6 +3805,10 @@ define(['app/app', 'jquery-uploadify'], function(app) {
 
     // 最小起订量修改 梯度1的值等于最小起订量
     $scope.ProductupdateStartNumber = function(productUpOff) {
+      if (parseInt(productUpOff) >= parseInt($scope.productUpOff.goods.prices[0].start)) {
+        $scope.productUpOff.goods.prices[0].start = _item
+        return false
+      }
       $scope.productUpOff.goods.prices[0].start = parseInt(productUpOff)
     }
     // 最小起订量失去焦点

+ 1 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -1006,7 +1006,7 @@
                                   取消订单
                               </a>
                               <a class="operate-height" ng-if="order.paidTimeFromNow > notifySellerShip - 1" style="display: block;position: relative;">
-                                  <em class="order-operation" ng-click="remindShip(order)" ng-class="{true : 'order-operation',false : 'order-operation-disabled'}[order.lastNotiDelivery > notifySellerShip - 1 || !order.lastNotifyDeliveryTime]">提醒发货</em>
+                                  <em class="order-operation" ng-click="remindShip(order)" ng-class="{true : 'order-operation',false : 'order-operation-disabled'}[order.lastNotiDelivery > notifySellerShip - 1 || !order.lastNotifyDeliveryTime]" ng-if="!order.signReceive">提醒发货</em>
                                   <div class="seller-ship-tip">
                                      <img ng-if="order.lastNotiDelivery < notifySellerShip && order.lastNotifyDeliveryTime" src="static/img/common/notice-tip.png" ng-mouseover="order.noticeTip = true" ng-mouseleave="order.noticeTip = false"/>
                                   </div>

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

@@ -294,6 +294,19 @@
 <div class="user_right fr">
 	<!--叮当详情-->
 	<div class="oder_detail" id="oder-detail" >
+		<div class="log_menu" ng-if="!acceptGoods">
+			<div class="sendGoodsList" >
+				<li ng-repeat="item in sendGoodsList">
+					<label class="com-check-radio"   ng-click="ChooseSendGoodsItem(item, $index, $event)">
+						<input type="radio" name="autoMonth" name="date" ng-checked="CheckId === 'autoMonth'+$index">
+						<label style="vertical-align: top"  name="autoMonth" ></label>
+						<div class="clearfix">
+							<div style="color: #666">发货单:</div><div style="color: #333">{{item}}</div>
+						</div>
+					</label>
+				</li>
+			</div>
+		</div>
 		<div ng-if="!acceptGoods">
 			<div class="logistics" ng-if="order.status != 602 && order.status != 603 && order.status != 604 && order.status != 605 && order.status != 606 && order.status != 315" ng-cloak>
 			<ul>
@@ -440,7 +453,7 @@
 
 			<div class="sendGoodsList">
 				<li ng-repeat="item in sendGoodsList">
-					<label class="com-check-radio"   ng-click="ChooseSendGoodsItem(item, $index)">
+					<label class="com-check-radio"   ng-click="ChooseSendGoodsItem(item, $index, $event)">
 						<input type="radio" name="autoMonth" name="date" ng-checked="CheckId === 'autoMonth'+$index">
 						<label style="vertical-align: top"  name="autoMonth" ></label>
 						<div class="clearfix">
@@ -451,6 +464,7 @@
 			</div>
 
 		</div>
+
 		<!-- /end 收入入库抬头 -->
 
 		<!--订单信息-->
@@ -582,7 +596,8 @@
 								<!--</div>-->
 								<!-- 本次收货 -->
 								<div class="text-area">
-                  <i>{{detail.receiveCount || '-'}}</i>
+									<i ng-if="orderStatus">{{detail.receiveCount}}</i>
+                  <i ng-if="!orderStatus">-</i>
                 </div>
 							</span>
 						</dd>
@@ -656,7 +671,7 @@
 			<div style="clear: both"></div>
 		</div>
 		<!--物流信息-->
-		<div ng-if="!acceptGoods">
+		<div>
 		<div class="logistics_list01" ng-if="order.status != 602 && order.status != 603 && order.status != 604 && order.status != 605 && order.status != 606 && order.status != 315">
 			<div class="log_menu">
 				<span>物流信息<em style="color: #666;" ng-if="!logistics.companyName&& noLogisticInfoArray[order.status]">(暂无物流信息)</em>

+ 48 - 0
src/main/webapp/resources/view/usercenter/forstore/query_logistics.html

@@ -186,6 +186,41 @@
     .logistics_list_xq .empty .empty-info i{
         margin-right:5px;
     }
+    .sendGoodsList {
+        padding: 0 25px;
+    }
+    .sendGoodsList:after {
+        clear: both;
+        content: ' ';
+        zoom: 1;
+        display: block;
+        visibility: hidden;
+    }
+    .sendGoodsList li {
+        float: left;
+        width: 50%;
+    }
+    .sendGoodsList li .clearfix {
+        display: inline-block;
+        line-height: 40px;
+    }
+    .sendGoodsList li .clearfix:after {
+        clear: both;
+        content: ' ';
+        zoom: 1;
+        display: block;
+        visibility: hidden;
+    }
+    .sendGoodsList li .clearfix div {
+        float: left;
+        font-size: 14px;
+    }
+    label {
+        margin-bottom: 0px;
+    }
+    .com-check-radio input[type='radio'] + label {
+        top: 14px !important;
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr">
@@ -195,6 +230,19 @@
             <div class="logistics_cter_01">
                 <!--包裹跟踪-->
                 <div class="tab" style="display: inline-block;">
+                    <div class="log_menu">
+                        <div class="sendGoodsList" >
+                            <li ng-repeat="item in sendGoodsList">
+                                <label class="com-check-radio"   ng-click="ChooseSendGoodsItem(item, $index, $event)">
+                                    <input type="radio" name="autoMonth" name="date" ng-checked="CheckId === 'autoMonth'+$index">
+                                    <label style="vertical-align: top"  name="autoMonth" ></label>
+                                    <div class="clearfix">
+                                        <div style="color: #666">发货单:</div><div style="color: #333">{{item}}</div>
+                                    </div>
+                                </label>
+                            </li>
+                        </div>
+                    </div>
                     <div class="log_cter_h" style="position: relative">
                         <span style="margin-right: 0;">订单号:</span>
                         <span style="margin-left: 0; margin-right: 30px;" ng-bind="order.orderid"></span>

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_delivery.html

@@ -767,8 +767,8 @@
                 </em>
               </span>
               <span style="width: 10%;" ng-bind="detail.number">100</span>
-              <span ng-show="!isChange" class="wd01 red" ng-bind="detail.taxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
-              <span ng-show="isChange" class="wd01 red" ng-bind="detail.currentTaxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
+              <span style="white-space: nowrap;overflow: hidden;" 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="white-space: nowrap;overflow: hidden;" ng-show="isChange" class="wd01 red" ng-bind="detail.currentTaxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName" title="{{detail.currentTaxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName}}"></span>
 
               <span class="wd01" style="line-height: 18px;">
                 <!--<textarea placeholder="可填写产品备注!例如物料编号"></textarea>-->

+ 3 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -1172,8 +1172,9 @@
 										</li>
 										<li style="font-size: 14px;color: #333;background: #fff;" class='priceInfoList' ng-repeat="price in material.goods.prices">
 											<span class="fl w50" style="width: 50%;border-right:1px solid #dcdcdc">{{price.start}}+</span>
-											<span class="fl w50" style="width: 50%;overflow: hidden" title="{{price.rMBPrice || price.uSDNTPrice}}">
-												{{!store.enType || store.enType === 'HK' ? '$' : '¥'}}{{price.rMBPrice || price.uSDNTPrice }}</span>
+											<span class="fl w50" style="width: 50%;overflow: hidden" title="{{price.rMBPrice}}">
+												{{!store.enType || store.enType === 'HK' ? '$' : '¥'}}
+												{{price.rMBPrice || price.uSDNTPrice }}</span>
 											<div class="clearfix"></div>
 										</li>
 										<li style="font-size: 14px;color: #333;background: #fff;" class='priceInfoList' ng-if="!material.goods || material.goods.prices.length === 0">