Преглед на файлове

1、修改收发货界面

shenjj преди 7 години
родител
ревизия
50135284f0

+ 29 - 11
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_delivery_ctrl.js

@@ -130,13 +130,17 @@ define(['app/app'], function(app) {
         };
 
         var getInvoiceFPurchase = function () {
-            return InvoiceFPurchase.tobeshippedByInvoiceid({ids: $stateParams.ids}, function(data) {
-                $scope.checkinvoice = data[0];
+            return Purchase.findPurchaseByPurchaseId({purchaseId: $stateParams.ids}, function(data) {
+                $scope.checkinvoice = data.data;
                 // Purchase.getOrderIdByPurchaseId({purchaseId:$scope.checkinvoice.sourceid},function(result) {
                 //     $scope.checkinvoice.orderId = result.data;
                 // });
-                $scope.checkinvoice.jsonSpAddress = angular.fromJson($scope.checkinvoice.jsonSpAddress);
+                $scope.checkinvoice.jsonSpAddress = angular.fromJson($scope.checkinvoice.jsonAddress);
                 $scope.checkinvoice.jsonSpAddress.area = $scope.checkinvoice.jsonSpAddress.area.replace(/,/g,' ');
+                $scope.checkinvoice.purchaseDetails.forEach(function(item) {
+                    item.sendCount = ''
+                    item.shipQty = item.shipQty || 0
+                })
                 $scope.checkinvoice.show = false;
                 if ($scope.checkinvoice.jsonRule){
                     $scope.rule = angular.fromJson($scope.checkinvoice.jsonRule);
@@ -358,10 +362,15 @@ define(['app/app'], function(app) {
         };
 
         $scope.saveCheck = function() {
-            if(!$scope.checkinvoice || angular.equals(angular.toJson($scope.checkinvoice), "{}")) {
+            // if(!$scope.checkinvoice || angular.equals(angular.toJson($scope.checkinvoice), "{}")) {
+            //     toaster.pop("info", "提示", "出货单信息为空,不能保存,请返回出货单管理界面");
+            //     return ;
+            // }
+
+            if(!$scope.checkinvoice) {
                 toaster.pop("info", "提示", "出货单信息为空,不能保存,请返回出货单管理界面");
                 return ;
-            }
+              }
 
             if(!$scope.jsonSdAddress || angular.equals({}, $scope.jsonSdAddress)) {
                 toaster.pop("info", "提示", "发货地址不能为空,请返回出货单管理界面");
@@ -410,6 +419,14 @@ define(['app/app'], function(app) {
                 sendInfo.logisticsInfo.companyName = $scope.logistics.companyName;
                 sendInfo.logisticsInfo.number = $scope.logistics.number;
             }
+            var _obj = {}
+            for (var i = 0; i < $scope.checkinvoice.purchaseDetails.length; i++) {
+                if (Math.abs($scope.checkinvoice.purchaseDetails[i].sendCount) > 0) {
+                  var _id = $scope.checkinvoice.purchaseDetails[i].id
+                  _obj[_id] = $scope.checkinvoice.purchaseDetails[i].sendCount
+                }
+            }
+            sendInfo.map = _obj
             // if($scope.checkinvoice.deliveryType == 'logistics') {
             //     sendInfo.deliveryType = 'logistics';
             //     sendInfo.logisticsInfo = {};
@@ -424,7 +441,7 @@ define(['app/app'], function(app) {
             // }
             sendInfo.jsonSdAddress = angular.toJson($scope.jsonSdAddress);
             InvoiceFPurchase.saveInvoiceFPurchase({id : $scope.checkinvoice.id}, sendInfo, function(data) {
-                toaster.pop("success", "信息", "发货成功");
+
                 // TODO 这边要停5秒钟之后,在跳转到出货单管理界面
                 /*var fromPage = window.sessionStorage.getItem("orderAdmin");
                  if(fromPage == "invoiceProofing") {
@@ -433,7 +450,8 @@ define(['app/app'], function(app) {
                  $state.go('invoice');
                  }*/
                 // TODO huxz 跳转到订单管理页面
-                $state.go('vendor_order');
+              if (data.success) {toaster.pop("success", "信息", "发货成功");$state.go('vendor_order');}
+              else { toaster.pop("error", data.message); }
             }, function(response) {
                 toaster.pop('error', '错误', response.data);
             });
@@ -707,12 +725,12 @@ define(['app/app'], function(app) {
         // 修改本次发货
         $scope.isSendCount = 0
         // todo 已发货信息到时候需要根据当前对象获取信息
-        $scope.ChangeSendCount = function(details, val) {
-            if (val > details.number - $scope.isSendCount) {
+        $scope.ChangeSendCount = function(details, val, ind) {
+            if (val > details.number - details.shipQty) {
                 toaster.pop('warning', '提示', '本次发货数量不能大于已够数量')
-                val =  details.number - $scope.isSendCount
+                val = details.number - details.shipQty
             }
-            $scope.mockModal = val
+            $scope.checkinvoice.purchaseDetails[ind].sendCount = val
         }
     }]);
 

+ 8 - 7
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -453,13 +453,14 @@ define(['app/app'], function (app) {
                             // 填写物流信息
                             $state.go("vendor_delivery", {ids: enIdFilter(purchase.inid)});
                         } else {
-                            Purchase.tobeshiped({id: purchase.id}, function (data) {
-                                toaster.pop('success', '转出货单成功');
-                                // 填写物流信息
-                                $state.go("vendor_delivery", {ids: enIdFilter(data.inId)});
-                            }, function (response) {
-                                toaster.pop('error', '失败', '转出货单失败' + response.data);
-                            });
+                            $state.go("vendor_delivery", {ids: enIdFilter(purchase.purchaseid)})
+                            // Purchase.tobeshiped({id: purchase.id}, function (data) {
+                            //     toaster.pop('success', '转出货单成功');
+                            //     // 填写物流信息
+                            //     $state.go("vendor_delivery", {ids: enIdFilter(data.inId)});
+                            // }, function (response) {
+                            //     toaster.pop('error', '失败', '转出货单失败' + response.data);
+                            // });
                         }
                     } else {
                         purchase.showGotoSettle = true;

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

@@ -1021,7 +1021,7 @@
                               </a>
                                 <div ng-if="order.status == 404">
 																	<!--ng-click="ensureAccept(order)"-->
-                                    <a href="user#/transfer/{{order.orderid | EncryptionFilter}}" class="operate-height"  style="display: block;">
+                                    <a href="user#/order/detail/{{order.orderid | EncryptionFilter}}" class="operate-height"  style="display: block;">
                                         <em class="order-operation">收货入库</em>
                                     </a>
                                     <div class="clock-mind">

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

@@ -381,8 +381,8 @@
 						<span class="wd01">单价</span>
 						<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 class="order-company">
 						<span style="white-space: nowrap; width: 100%; text-align: left; line-height: 50px; position: relative;">
@@ -456,16 +456,22 @@
 							<span class="wd01 red" ng-bind="detail.ensurePrice | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
 							<!--物料编码-->
 							<span class="wd01" style="line-height: 18px;">
-								<em ng-if="!detail.goodsnumber">&nbsp;</em>
-								<div class="text-area" ng-if="detail.goodsnumber">
-									<i ng-bind="detail.goodsnumber">金石为开取数据五块钱叫稍微亲上加亲</i>
-								</div>
+								<!--<em ng-if="!detail.goodsnumber">&nbsp;</em>-->
+								<!--<div class="text-area" ng-if="detail.goodsnumber">-->
+									<!--<i ng-bind="detail.goodsnumber">金石为开取数据五块钱叫稍微亲上加亲</i>-->
+								<!--</div>-->
+								<div class="text-area">
+                  <i >80</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>
-								</div>
+								<!--<em ng-if="!detail.remark">&nbsp;</em>-->
+								<!--<div class="text-area" ng-if="detail.remark">-->
+									<!--<i ng-bind="detail.remark">金石为开取数据五块钱叫稍微亲上加亲</i>-->
+								<!--</div>-->
+								<div class="text-area">
+                  <i>80</i>
+                </div>
 							</span>
 						</dd>
 					</div>

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

@@ -740,7 +740,7 @@
             </span>
           </dd>
           <div ng-class="{'limit-3': !open}" style="width: 100%; margin: 0 auto; overflow: hidden;">
-            <dd class="oder_l" ng-repeat="detail in checkinvoice.invoiceFPurchaseDetails">
+            <dd class="oder_l" ng-repeat="detail in checkinvoice.purchaseDetails">
               <span class="wd02">
                 <a href="store/{{detail.storeid}}/{{::detail.batchCode}}" target="_blank">
                   <img ng-src="{{detail.img ? detail.img : 'static/img/store/common/default.png'}}" />
@@ -775,7 +775,7 @@
                 <!--<input type="text" ng-model="mockModal" ng-blur="Change" />-->
                 <!--<em ng-if="!detail.goodsnumber">&nbsp;</em>-->
                 <div class="text-area">
-                  <i >80</i>
+                  <i >{{detail.shipQty}}</i>
                 </div>
               </span>
               <span class="wd01" style="line-height: 18px;">
@@ -784,18 +784,18 @@
                 <!--<div class="text-area" ng-if="detail.remark">-->
                   <!--<i ng-bind="detail.remark">金石为开取数据五块钱叫稍微亲上加亲</i>-->
                 <!--</div>-->
-                <input class="sendInput" type="text" ng-model="mockModal" ng-blur="ChangeSendCount(detail, mockModal)" />
+                <input class="sendInput" type="text" ng-model="details.sendCount" ng-blur="ChangeSendCount(detail, details.sendCount, $index)" />
               </span>
             </dd>
           </div>
-          <div class="open-more row" ng-class="{'none': checkinvoice.invoiceFPurchaseDetails.length <= 3}">
+          <div class="open-more row" ng-class="{'none': checkinvoice.purchaseDetails.length <= 3}">
             <a href="javascript:void(0)" ng-click="open=!open" ng-class="{'active': open}">
               <em ng-bind="open ? '收起' : '查看所有产品'"></em>
               <i class="fa fa-angle-up" ng-if="open"></i>
               <i class="fa fa-angle-down" ng-if="!open"></i>
             </a>
           </div>
-          <dd class="oder-remark" ng-class="{'length3': checkinvoice.invoiceFPurchaseDetails.length > 3}">
+          <dd class="oder-remark" ng-class="{'length3': checkinvoice.purchaseDetails.length > 3}">
             <span style="width: 100%; padding-left: 20px;">
               <em>订单备注:</em>
               <i class="fl" ng-bind="checkinvoice.infpuRemark || '无'">用便宜的物流最好!</i>