浏览代码

处理BUG

wangcz 7 年之前
父节点
当前提交
a02cf4d3b9

+ 12 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_storageCtrl.js

@@ -1,7 +1,7 @@
 define([ 'app/app' ], function(app) {
     'use strict';
     app.register.controller('vendor_storageCtrl', ['$scope', '$rootScope', '$stateParams', 'BaseService', 'Goods', 'KdnLogistics', '$modal', 'toaster', 'Loading', 'AuthenticationService', '$q', '$upload', '$http', 'ngTableParams', 'InvoiceFPurchase', 'ShippingAddress', 'Enterprise', function ($scope, $rootScope, $stateParams, BaseService, Goods, KdnLogistics, $modal, toaster, Loading, AuthenticationService, $q, $upload, $http, ngTableParams, InvoiceFPurchase, ShippingAddress, Enterprise) {
-        $rootScope.active = 'vendor_storage';
+        $rootScope.active = 'vendor_material';
         $scope.keyword = '';
         $scope.type = '';
         $scope.tab = 'storage';
@@ -344,7 +344,8 @@ define([ 'app/app' ], function(app) {
             type.id = key.id;
             type.qty = ($scope.storage_tab === 'outBound' ? key.erpReserve : '');
             type.price = key.price;
-            if((!type.erpReserve || type.erpReserve === 0) && $scope.storage_tab === 'outBound'){
+            type.erpReserve = key.erpReserve;
+            if((type.erpReserve <= 0) && $scope.storage_tab === 'outBound'){
                 toaster.pop('info', '提示', '该型号在产品库中库存数量为0,不能出库!');
             }
         };
@@ -371,12 +372,14 @@ define([ 'app/app' ], function(app) {
             var flag = 0;
             angular.forEach($scope.otherData, function(val) {
                 if(val.id) {
-                    if(!val.erpReserve || val.erpReserve === 0 && $scope.storage_tab === 'outBound'){
+                    if((val.erpReserve <= 0) && $scope.storage_tab === 'outBound'){
                         flag = 1
-                    } else if(val.erpReserve < val.qty) {
+                    } else if((val.erpReserve < val.qty) && $scope.storage_tab === 'outBound') {
                         flag = 2
                     } else if(val.qty && val.price) {
                         $scope.othenParam.detail.push({productId: val.id, qty: Number(val.qty), price: Number(val.price)});
+                    } else {
+                        flag = 3
                     }
                 }
             })
@@ -388,6 +391,10 @@ define([ 'app/app' ], function(app) {
                 toaster.pop('info', '提示', '出库量数量不能大于库存数!');
                 return;
             }
+            if(flag === 3) {
+                toaster.pop('info', '提示', '请填写数量和单价!');
+                return;
+            }
             if($scope.othenParam.detail.length <= 0) {
                 toaster.pop('info', '提示', '至少填写一条数据!');
                 return;
@@ -396,6 +403,7 @@ define([ 'app/app' ], function(app) {
                 if(data.code === 1) {
                     toaster.pop('success', '申请成功!');
                     initOtherData();
+                    $scope.toggleType(0);
                 }
             }, function(res) {
                 toaster.pop('error', '申请失败,请检查再试')

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

@@ -1380,7 +1380,7 @@
                 <tbody ng-if="handleItem === 2" ng-repeat="item in storageList" ng-class="{'toggle-mode': item.seleted}">
                 <tr>
                     <td>系统自动生成</td>
-                    <td ng-if="storage_tab === 'outBound'"><span ng-bind="item.purchaseid || '-'" title="{{item.purchaseid}}"></span></td>
+                    <td ng-if="storage_tab === 'outBound'"><span ng-bind="item.orderid || '-'" title="{{item.orderid}}"></span></td>
                     <td ng-if="storage_tab === 'inBound'"><span ng-bind="item.invoiceid || '-'" title="{{item.invoiceid}}"></span></td>
                     <td><span ng-bind="item.buyentername || item.buyerentername || item.buyername" title="{{item.buyentername || item.buyerentername || item.buyername}}"></span></td>
                     <td ng-bind="item.createtime | date: 'yyyy-MM-dd'"></td>
@@ -1390,7 +1390,7 @@
                 <tr ng-if="item.seleted && storage_tab === 'outBound'">
                     <td colspan="5" style="background:#f5f5f5;">
                         <div class="logistics-info">
-                            <span style="margin-right:150px;">所属订单:<span ng-bind="item.associateOrderid || '-'"></span></span>
+                            <span style="margin-right:150px;">所属订单:<span ng-bind="item.orderid || '-'"></span></span>
                             <span>物流公司 :&nbsp;</span>
                             <span class="input-ul">
                                 <input id="logistics-input" type="text" class="form-control select-adder" ng-focus="getItemFocus()"