Prechádzať zdrojové kódy

Merge branch 'dev' of http://git.echepei.com/tubao/Smart_platform_ui into dev

Qukatie 2 rokov pred
rodič
commit
c85930294e

+ 28 - 0
src/main.js

@@ -275,6 +275,34 @@ Vue.directive("input-limit", {
               e.target.dispatchEvent(new Event("input"))
             }
           }
+          if (binding.value == 5) {
+            if (wins_0.test(e.target.value.toString().replace(/\d+\.(\d*)/, '$1'))) {
+              remainder = true
+            }
+            if ((e.target.value.split('.')).length - 1 > 1) {
+              points = true
+            }
+            if (e.target.value.toString().split(".")[1] != undefined) {
+              if (e.target.value.toString().split(".")[1].length > 5) {
+                lengths = true
+              }
+            }
+            if (e.target.value.toString().indexOf(".") != -1) {
+              no_int = false
+            } else {
+              no_int = true
+            }
+            if (wins_1.test(e.target.value) || lengths || points || remainder) {
+              if (!no_int) {
+                e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
+                  '$#$', '.').substring(0, e.target.value.indexOf(
+                    ".") + 6)
+              } else {
+                e.target.value = e.target.value.replace(wins_0, "")
+              }
+              e.target.dispatchEvent(new Event("input"))
+            }
+          }
         }
       }, 0)
     })

+ 2 - 2
src/views/basicData/productInformation/detailsPageEdit.vue

@@ -32,10 +32,10 @@
             </el-select>
           </template>
           <template slot="cntrVolumn">
-            <el-input v-input-limit="2" v-model="form.cntrVolumn" clearable placeholder="请输入 箱立方"></el-input>
+            <el-input v-input-limit="5" v-model="form.cntrVolumn" clearable placeholder="请输入 箱立方"></el-input>
           </template>
           <template slot="cartonWeight">
-            <el-input v-input-limit="2" v-model="form.cartonWeight" clearable placeholder="请输入 箱重量">
+            <el-input v-input-limit="5" v-model="form.cartonWeight" clearable placeholder="请输入 箱重量">
               <template slot="append">kg</template>
             </el-input>
           </template>