Ver Fonte

需求变更临时收款水电必填用量

Shannon_mu há 2 anos atrás
pai
commit
3725eee924

+ 21 - 7
operationSupport/src/views/payService/propertyFee/stepPage/temporary.vue

@@ -17,8 +17,8 @@
             >
             </el-date-picker>
         </el-form-item>
-        <el-form-item label="用量" v-if="formData.chargeType == 2 || formData.chargeType == 3">
-            <el-input v-model="formData.quantity"></el-input>
+        <el-form-item label="用量" prop="quantity" v-if="formData.chargeType == 2 || formData.chargeType == 3">
+            <el-input v-model="formData.quantity" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
         </el-form-item>
     </el-form>
 </template>
@@ -32,15 +32,29 @@ export default {
                 strategyId: '',
                 assetsType: 1,
                 chargeType: '',
-                chargeStartTime: '2021-09',
-                chargeEndTime: '2021-09',
-                quantity:'',
+                chargeStartTime: '',
+                chargeEndTime: '',
+                quantity: ''
             },
             times: [],
             selectData: [],
             formRules: {
                 chargeType: [this.$valid.selectRequired('充值方式')],
-                chargeStartTime: [this.$valid.selectRequired('收费时间')]
+                chargeStartTime: [this.$valid.selectRequired('收费时间')],
+                quantity: this.$valid.custome({
+                    validator(rule, value, cb) {
+                        const rl = rule;
+                        if (!value) {
+                            rl.message = '请输入用量';
+                            cb(new Error());
+                        } else if (value == 0) {
+                            rl.message = '用量必须大于0';
+                            cb(new Error());
+                        } else {
+                            cb();
+                        }
+                    }
+                })
             }
         };
     },
@@ -78,7 +92,7 @@ export default {
         },
         getSelect() {
             this.$http
-                .get('/sc-charge/scChargeStrategy/page?pageNum=1&pageSize=100&communityId='+this.params.communityId)
+                .get('/sc-charge/scChargeStrategy/page?pageNum=1&pageSize=100&communityId=' + this.params.communityId)
                 .then(({ data, status, msg }) => {
                     this.selectData = data.list;
                 })