Browse Source

处理采购入库确认接口

wangcz 7 years ago
parent
commit
627564fb34

+ 19 - 19
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -121,27 +121,27 @@ define([ 'app/app' ], function(app) {
 				});
 			};
 
-      var Ajax={
-        get: function(url, fn) {
-          // XMLHttpRequest对象用于在后台与服务器交换数据
-          var xhr = new XMLHttpRequest();
-          xhr.open('GET', url, false);
-          xhr.onreadystatechange = function() {
-            // readyState == 4说明请求已完成
-            if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) {
-              // 从服务器获得数据
-              fn.call(this, xhr.responseText);
-            }
-          };
-          xhr.send();
-        }
-      }
-			// 是否已经登录
+		  var Ajax={
+			get: function(url, fn) {
+			  // XMLHttpRequest对象用于在后台与服务器交换数据
+			  var xhr = new XMLHttpRequest();
+			  xhr.open('GET', url, false);
+			  xhr.onreadystatechange = function() {
+				// readyState == 4说明请求已完成
+				if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) {
+				  // 从服务器获得数据
+				  fn.call(this, xhr.responseText);
+				}
+			  };
+			  xhr.send();
+			}
+		  }
+      		// 是否已经登录
 			$scope.isAuthed = AuthenticationService.isAuthed();
 			$scope.userInfo = {};
-      Ajax.get('/user/authentication',function(data) {
-        $scope.userInfo = data
-      })
+		  Ajax.get('/user/authentication',function(data) {
+			$scope.userInfo = data
+		  })
 			// 获取已登录的用户信息
 			var getAuthentication = function() {
 				return AuthenticationService.getAuthentication().success(function(data) {

+ 11 - 5
src/main/webapp/resources/js/common/query/goods.js

@@ -297,11 +297,6 @@ define([ 'ngResource' ], function() {
 				url: 'CommodityInOutbound/page',
 				method: 'GET'
 			},
-            // 采购入库销售出库列表
-            getOrderData: {
-                url: 'CommodityInOutbound/page',
-                method: 'GET'
-            },
 
 		    // 库存管理其它出入库,根据联想词得到产品库数据
             getKeywordToProductId : {
@@ -314,6 +309,17 @@ define([ 'ngResource' ], function() {
 				url: 'CommodityInOutbound/:storage_tab/other?enName=:enName',
 				method: 'POST'
 			},
+            // 采购入库接口
+            getByEnterpriseData: {
+                url : 'trade/invoice/enterprise/inbound',
+                method: 'GET'
+            },
+            // 采购入库确认入库接口
+            getByEnterpriseId: {
+                url : 'trade/order/signReceive',
+                method: 'PUT',
+                params : { _status : 'ensureaccept' }
+            },
             // 销售出库接口对应销售订单的待发货
             getByStatusAndInternal: {
                 url : 'trade/purchase/status/createtime',

+ 21 - 6
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_storageCtrl.js

@@ -19,7 +19,7 @@ define([ 'app/app' ], function(app) {
         $scope.handleLink = [
             {name: '查看入库记录', tab: 'inBound', id: 0},
             {name: '其它入库', tab: 'inBound', id: 1},
-            // {name: '采购入库', tab: 'inBound', id: 2},
+            {name: '采购入库', tab: 'inBound', id: 2},
             {name: '查看出库记录', tab: 'outBound', id: 0},
             {name: '其它出库', tab: 'outBound', id: 1},
             {name: '销售出库', tab: 'outBound', id: 2}];
@@ -197,7 +197,7 @@ define([ 'app/app' ], function(app) {
                 return 'getLoadStorageData'
             } else if($scope.handleItem === 2) {
                 if($scope.storage_tab === 'inBound') {
-                    return 'getOrderData'
+                    return 'getByEnterpriseData'
                 } else {
                     return 'getByStatusAndInternal'
                 }
@@ -215,13 +215,15 @@ define([ 'app/app' ], function(app) {
                     if($scope.keyword){
                         param.keyword = $scope.keyword
                     }
+                    if($scope.handleItem === 0) {
+                        param.type = $scope.type;
+                    }
                     if($scope.storage_tab === 'outBound' && $scope.handleItem === 2) {
                         param.sorting = {"createtime":"DESC"};
                         param.status = '502-406';
                         param.startMils = $scope.startDate ? $scope.startDate.getTime() : null;
                         param.endMils = $scope.endDate ? $scope.endDate.getTime() : null;
                     } else {
-                        param.type = $scope.type;
                         param.fromDate = $scope.startDate ? $scope.startDate.getTime() : null;
                         param.toDate = $scope.endDate ? $scope.endDate.getTime() : null;
                     }
@@ -459,9 +461,14 @@ define([ 'app/app' ], function(app) {
             details.sendCount = val
         };
 
-        // 销售出库确认发货
-        $scope.saveOtherCheck = function (data) {
-            console.log(data, 'data')
+        var inSaveOtherCheck = function(type) {
+            console.log(type, 'type')
+            Goods.getByEnterpriseId({invoiceId: type.invoiceid}, null, function(data) {
+                console.log('data', data, type.invoiceId)
+            })
+        };
+
+        var outSaveOtherCheck = function (data) {
             if(!$scope.jsonSdAddress || angular.equals({}, $scope.jsonSdAddress)) {
                 toaster.pop("info", "提示", "发货地址不能为空,请前往物流管理新增发货地址");
                 return ;
@@ -512,6 +519,14 @@ define([ 'app/app' ], function(app) {
             });
         };
 
+        // 采购入库与销售出库确认发货
+        $scope.saveOtherCheck = function (data, tab) {
+            if (tab === 'inBound') {
+                inSaveOtherCheck(data);
+            } else {
+                outSaveOtherCheck(data);
+            }
+        };
 
         //获取登录的信息
         var getAuthentication = function () {

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

@@ -1375,12 +1375,12 @@
                 <tr>
                     <td>系统自动生成</td>
                     <td><span ng-bind="item.purchaseid" title="{{item.purchaseid}}"></span></td>
-                    <td><span ng-bind="item.buyentername || item.buyername" title="{{item.buyentername || item.buyername}}"></span></td>
+                    <td><span ng-bind="item.buyentername || item.buyerentername || item.buyername" title="{{item.buyentername || item.buyerentername || item.buyername}}"></span></td>
                     <td ng-bind="storage_tab === 'outBound' ? '销售出库' : '采购入库'">腌肉入库</td>
                     <td><span ng-bind="item.sellername" title="{{item.sellername}}"></span></td>
                     <td ng-bind="item.createtime | date: 'yyyy-MM-dd'"></td>
-                    <td ng-if="!item.seleted"><a class="btn-click" ng-click="item.seleted = !item.seleted;unfoldClick(storageList, item)" ng-bind="storage_tab === 'inPut' ? '收货入库' : '发货出库'"></a></td>
-                    <td ng-if="item.seleted"><a class="btn-click" ng-click="saveOtherCheck(item)">确定</a><a class="btn-click" ng-click="item.seleted = !item.seleted">取消</a></td>
+                    <td ng-if="!item.seleted"><a class="btn-click" ng-click="item.seleted = !item.seleted;unfoldClick(storageList, item)" ng-bind="storage_tab === 'inBound' ? '收货入库' : '发货出库'"></a></td>
+                    <td ng-if="item.seleted"><a class="btn-click" ng-click="saveOtherCheck(item, storage_tab)">确定</a><a class="btn-click" ng-click="item.seleted = !item.seleted">取消</a></td>
                 </tr>
                 <tr ng-if="item.seleted && storage_tab === 'outBound'">
                     <td colspan="7" style="background:#f5f5f5;">
@@ -1409,6 +1409,17 @@
                         </div>
                     </td>
                 </tr>
+                <tr ng-if="item.seleted && storage_tab === 'inBound' && item.logistics">
+                    <td colspan="7" style="background:#f5f5f5;">
+                        <div class="logistics-info">
+                            <span>物流公司 :&nbsp;</span>
+                            <span class="input-ul" ng-bind="item.logistics.companyName"></span>
+                            <span>物流单号 :&nbsp;</span>
+                            <span style="margin-right: 20px;" ng-bind="item.logistics.number">
+                            </span>
+                        </div>
+                    </td>
+                </tr>
                 <tr ng-show="item.seleted">
                     <td colspan="7">
                         <div class="sub-table-head">
@@ -1429,7 +1440,20 @@
                             </table>
                         </div>
                         <div style="max-height:300px;overflow-y: auto;">
-                            <table class="wanted-sub-tab table">
+                            <!--采购入库数据-->
+                            <table class="wanted-sub-tab table" ng-if="storage_tab === 'inBound'">
+                                <tr ng-repeat="list in item.invoiceDetails">
+                                    <td width="60" ng-bind="$index + 1"></td>
+                                    <td width="150"><span ng-bind="list.cmpCode || '-'" title="{{list.cmpCode}}"></span></td>
+                                    <td width="110"><span ng-bind="list.brandNameEn || '-'" title="{{list.brandNameEn}}"></span></td>
+                                    <td><span ng-bind="list.kiName || '-'" title="{{list.kiName}}"></span></td>
+                                    <td width="180"><span ng-bind="list.spec || '-'" title="{{list.spec}}"></span></td>
+                                    <td width="100"><span ng-bind="list.qty || '-'" title="{{list.qty}}"></span></td>
+                                    <td width="80"><span ng-bind="list.price || '-'" title="{{list.price}}"></span></td>
+                                </tr>
+                            </table>
+                            <!--销售出库数据-->
+                            <table class="wanted-sub-tab table" ng-if="storage_tab === 'outBound'">
                                 <tr ng-repeat="list in item.purchaseDetails">
                                     <td width="60" ng-bind="$index + 1"></td>
                                     <td width="150"><span ng-bind="list.batchCode || '-'" title="{{list.batchCode}}"></span></td>
@@ -1440,7 +1464,7 @@
                                     <td width="100" ng-if="storage_tab === 'outBound'"><span ng-bind="list.shipQty || '-'" title="{{list.shipQty}}"></span></td>
                                     <td width="100">
                                         <span ng-if="list.number === list.shipQty">-</span>
-                                        <input type="text" ng-pattern="/^[1-9]\d*$/" ng-model="list.sendCount" ng-blur="ChangeSendCount(list, list.sendCount)" ng-if="list.number !== list.shipQty" class="form-control">
+                                        <input type="text" ng-pattern="/^[1-9]\d*$/" ng-model="list.sendCount" ng-blur="ontChangeSendCount(list, list.sendCount)" ng-if="list.number !== list.shipQty" class="form-control">
                                     </td>
                                     <td width="80"><span ng-bind="list.price || '-'" title="{{list.price}}"></span></td>
                                 </tr>