Hwt 3 years ago
parent
commit
5eebe36ab6

+ 25 - 17
operationSupport/src/views/payService/propertyFee/stepPage/temporary.vue

@@ -81,6 +81,7 @@
     <el-form-item
       label="用量"
       v-if="formData.chargeType == 2 || formData.chargeType == 3"
+      prop="quantity"
     >
       <el-input v-model="formData.quantity"></el-input>
     </el-form-item>
@@ -110,7 +111,8 @@ export default {
         landlady: [this.$valid.selectRequired('房东')],
         building: [this.$valid.selectRequired('楼栋')],
         chargeType: [this.$valid.selectRequired('充值方式')],
-        chargeStartTime: [this.$valid.selectRequired('收费时间')]
+        chargeStartTime: [this.$valid.selectRequired('收费时间')],
+        quantity: [this.$valid.inputRequired('用量')],
       }
     };
   },
@@ -119,22 +121,28 @@ export default {
     submit () {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          var loading = this.$loading();
-          this.$http
-            .post('/czc-charge/charge/bill/create', this.formData)
-            .then(({ status, msg }) => {
-              if (status == 0) {
-                this.$message.success(msg);
-                this.params.callback();
-                this.$emit('close');
-              } else {
-                this.$message.error(msg);
-              }
-              loading.close();
-            })
-            .catch(() => {
-              loading.close();
-            });
+          if (Number(this.formData.quantity) >= 1) {
+            var loading = this.$loading();
+            this.$http
+              .post('/czc-charge/charge/bill/create', this.formData)
+              .then(({ status, msg }) => {
+                if (status == 0) {
+                  this.$message.success(msg);
+                  this.params.callback();
+                  this.$emit('close');
+                } else {
+                  this.$message.error(msg);
+                }
+                loading.close();
+              })
+              .catch(() => {
+                loading.close();
+              });
+          } else {
+            this.$message.error('请重新输入用量');
+            this.formData.quantity = ''
+          }
+
         }
       });
     },