Browse Source

修改单个物料导入input blur和click问题

shenjj 7 years ago
parent
commit
5634dd7b27

+ 9 - 12
src/main/webapp/resources/js/vendor/controllers/forstore/single_entry.js

@@ -202,21 +202,18 @@ define(['app/app', 'jquery-uploadify'], function(app) {
      * @param name    型号名称
      */
     $scope.RegulonCodeBlur = function(name) {
-      if (name === '') {
-        $scope.Regul.CodeList = []
-      } else {
-        $scope.Regul.pcmpcode = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].code || name
-        $scope.Regul.CodeList = []
-      }
+      setTimeout(function() {
+        if (name === '') {
+          $scope.Regul.CodeList = []
+        } else {
+          $scope.Regul.pcmpcode = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].code || name
+          $scope.Regul.CodeList = []
+        }
+      }, 0)
     }
     $scope.setCode = function(code, index) {
-      if (index === undefined) {
         $scope.Regul.pcmpcode = code
         $scope.Regul.CodeList = []
-      } else {
-        $scope.replaceMaterialList[index].ptrCmpcode = code;
-        $scope.setShowSimilarCodeList(false, index);
-      }
     }
 
     $scope.getSimilarCode = function(keyword, index) {
@@ -272,7 +269,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
 
     $scope.setReserve = function(num) {
-      if (num.indexOf('.') > -1) {
+      if (num && num.indexOf('.') > -1) {
         toaster.pop('warning', '提示', '库存数量不能存在小数点')
         $scope.Regul.reserve = 1
       } else {

+ 6 - 4
src/main/webapp/resources/view/vendor/forstore/single_entry.html

@@ -178,11 +178,12 @@
           <div class="fl name">
             <span class="red">*</span>品牌:
           </div>
+          <!--ng-blur="RegulonBrandBlur(Regul.pbranden)"-->
           <div class="fl input" style="position: relative">
             <input type="text"
                    ng-change="onBrandChange(Regul.pbranden)"
                    placeholder="请输入品牌名称"
-                   ng-blur="RegulonBrandBlur(Regul.pbranden)"
+
                    ng-model="Regul.pbranden"
                    class="form-control inputText" maxlength="25" ng-class="objError.pbranden ? 'danger' : '' "/>
             <ul class="listUl" ng-show="Regul.BrandList.value.length > 0">
@@ -211,15 +212,16 @@
             <span class="red">*</span>型号:
           </div>
           <div class="fl input" style="position: relative;">
+            <!--ng-blur="RegulonCodeBlur(Regul.pcmpcode)"-->
             <input type="text"
                    ng-change="onCodeChange(Regul.pcmpcode)"
                    placeholder="请输入型号"
-                   ng-blur="RegulonCodeBlur(Regul.pcmpcode)"
+
                    ng-model="Regul.pcmpcode"
                    ng-class="objError.pcmpcode ? 'danger' : '' "
                    class="form-control inputText" maxlength="100"/>
             <ul class="listUl" ng-show="Regul.CodeList.value.length > 0">
-              <li ng-repeat="item in Regul.CodeList.value" ng-click="setCode(item.nameEn)">
+              <li ng-repeat="item in Regul.CodeList.value" ng-click="setCode(item.code)">
                 {{item.code}}
               </li>
             </ul>
@@ -278,7 +280,7 @@
         </div>
         <div class="clearfix w50 fl list">
           <div class="fl name">
-            成本单价({{storeInfo.enType === 'MAINLAND' ? '¥' : '$'}}):
+            成本单价({{(!storeInfo.enType || storeInfo.enType === 'MAINLAND') ? '¥' : '$'}}):
           </div>
           <div class="fl input">
             <!-- 可编辑状态 oninput="if(value.length>6)value=value.slice(0,6)" -->