Prechádzať zdrojové kódy

管理后台-座位

panyong 3 rokov pred
rodič
commit
6107acfc8c

+ 1 - 1
htmldev/manage/src/utils/rules.js

@@ -142,7 +142,7 @@ function checkIdNum (rule, value, callback) {
 
 // 整数
 function checkInterNum (rule, value, callback) {
-  const reg = /^[0-9]*[1-9][0-9]*$/
+  const reg = /^[1-9][0-9]*$/
   if (!value) {
     return callback(new Error('请填写整数'))
   } else if (!reg.test(value)) {

+ 6 - 6
htmldev/manage/src/views/business/place/list/details.vue

@@ -27,7 +27,7 @@
             </el-input>
           </el-col>
         </el-form-item>
-        <el-form-item prop="bar_address"
+        <el-form-item prop="a"
                       :rules="formRules.InterNum"
                       label="座位数量:">
           <el-col :span="16">
@@ -36,23 +36,23 @@
                       clearable></el-input>
           </el-col>
         </el-form-item>
-        <el-form-item prop="bar_address"
+        <el-form-item prop="b"
                       :rules="formRules.InterNum"
                       label="单桌人数:">
           <el-col :span="16">
             <el-input v-model="form.b"
                       placeholder="请输入人数"
-                      oninput="value = value.replace(/[^\d]/g, '')"
+                      @input="form.b=form.b.replace(/[^\d]/g, '').replace(/^0*/, '')"
                       clearable></el-input>
           </el-col>
         </el-form-item>
-        <el-form-item prop="bar_address"
-                      :rules="formRules.required"
+        <el-form-item prop="c"
+                      :rules="formRules.numPot2"
                       label="单价:">
           <el-col :span="16">
             <el-input v-model="form.c"
                       placeholder="请输入单价"
-                      oninput="value = value.replace(/[^0-9.]/g, '')"
+                      @input="form.c=form.c.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
                       clearable></el-input>
           </el-col>
         </el-form-item>