Browse Source

出入库数据接口

wangcz 7 years ago
parent
commit
bd9626d43a

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

@@ -10,7 +10,6 @@ define([ 'app/app' ], function(app) {
         $scope.storage_tab = $stateParams.storage_tab? $stateParams.storage_tab : 'inBound';
         $scope.storage_tab = $stateParams.storage_tab? $stateParams.storage_tab : 'inBound';
         $scope.countData = 10;
         $scope.countData = 10;
         $scope.userInfo = $rootScope.userInfo || {}
         $scope.userInfo = $rootScope.userInfo || {}
-        $stateParams.ids ? $scope.hasIds = true : $scope.hasIds = false;
         console.log($stateParams)
         console.log($stateParams)
 
 
         //数字的正则表达式
         //数字的正则表达式
@@ -99,7 +98,7 @@ define([ 'app/app' ], function(app) {
                 })
                 })
             } else {
             } else {
                 for (var i = 0; i< $scope.countData; i++) {
                 for (var i = 0; i< $scope.countData; i++) {
-                    $scope.otherData.push({qty: '', id: i, price: '', key: '', show: false, productId: ''})
+                    $scope.otherData.push({qty: '', id: '', price: '', key: '', show: false, newId: true})
                 }
                 }
             }
             }
         }
         }
@@ -269,17 +268,17 @@ define([ 'app/app' ], function(app) {
             type.pbranden = key.pbranden;
             type.pbranden = key.pbranden;
             type.kind = key.kind;
             type.kind = key.kind;
             type.spec = key.spec;
             type.spec = key.spec;
-            type.productId = key.id;
+            type.id = key.id;
         };
         };
 
 
         $scope.addOneTable = function (type) {
         $scope.addOneTable = function (type) {
             if(type === 'clear') {
             if(type === 'clear') {
                 initOtherData()
                 initOtherData()
             } else if(type === 'one') {
             } else if(type === 'one') {
-                $scope.otherData.push({qty: '', id: i, price: '', key: '', show: false, productId: ''});
+                $scope.otherData.push({qty: '', id: '', price: '', key: '', show: false, newId: true});
             } else if(type === 'ten') {
             } else if(type === 'ten') {
                 for (var i = 0; i< 10; i++) {
                 for (var i = 0; i< 10; i++) {
-                    $scope.otherData.push({qty: '', id: i, price: '', key: '', show: false, productId: ''})
+                    $scope.otherData.push({qty: '', id: '', price: '', key: '', show: false, newId: true})
                 }
                 }
             }
             }
         };
         };
@@ -297,8 +296,8 @@ define([ 'app/app' ], function(app) {
                 return false
                 return false
             }
             }
             angular.forEach($scope.otherData, function(val) {
             angular.forEach($scope.otherData, function(val) {
-                if(val.productId) {
-                    $scope.othenParam.detail.push({productId: val.productId, qty: 323, price: 4234})
+                if(val.id) {
+                    $scope.othenParam.detail.push({productId: val.id, qty: 323, price: 4234})
                 }
                 }
             })
             })
             Goods.saveOtherProductData({storage_tab: $scope.storage_tab, enName: $scope.othenParam.enName}, $scope.othenParam.detail, function(data) {
             Goods.saveOtherProductData({storage_tab: $scope.storage_tab, enName: $scope.othenParam.enName}, $scope.othenParam.detail, function(data) {

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

@@ -1328,8 +1328,8 @@
                             <tr ng-repeat="(index, item) in otherData">
                             <tr ng-repeat="(index, item) in otherData">
                                 <td ng-bind="index + 1"></td>
                                 <td ng-bind="index + 1"></td>
                                 <td>
                                 <td>
-                                    <span ng-if="hasIds" ng-bind="item.pcmpcode || '-'" title="{{item.pcmpcode}}"></span>
-                                    <div class="down-form" ng-if="!hasIds">
+                                    <span ng-if="!item.newId" ng-bind="item.pcmpcode || '-'" title="{{item.pcmpcode}}"></span>
+                                    <div class="down-form" ng-if="item.newId">
                                         <input type="text" class="form-control" ng-model="item.key" ng-change="onChange(item)">
                                         <input type="text" class="form-control" ng-model="item.key" ng-change="onChange(item)">
                                         <div ng-show="item.show" class="down-key" ng-mouseenter="item.show = true">
                                         <div ng-show="item.show" class="down-key" ng-mouseenter="item.show = true">
                                             <ul class="list-unstyled">
                                             <ul class="list-unstyled">
@@ -1339,6 +1339,9 @@
                                                     <span ng-bind="list.kind || '-'" title="{{list.kind}}"></span>
                                                     <span ng-bind="list.kind || '-'" title="{{list.kind}}"></span>
                                                     <span ng-bind="list.spec || '-'" title="{{list.spec}}"></span>
                                                     <span ng-bind="list.spec || '-'" title="{{list.spec}}"></span>
                                                 </li>
                                                 </li>
+                                                <li ng-if="listData.length <= 0">
+                                                    <div>没的找到与“{{item.key}}”产品信息</div>
+                                                </li>
                                             </ul>
                                             </ul>
                                         </div>
                                         </div>
                                     </div>
                                     </div>