Browse Source

保存合同

drew 6 years ago
parent
commit
430ccec3de
1 changed files with 30 additions and 22 deletions
  1. 30 22
      src/main/vue/src/views/sale/ContractEdit.vue

+ 30 - 22
src/main/vue/src/views/sale/ContractEdit.vue

@@ -516,13 +516,18 @@ export default {
                 PayType: [
                     {
                         validator: (rule, value, callback) => {
-                            if (isNaN(Number(this.formData.bet))) {
-                                callback(new Error('请输入押几'));
-                                return;
-                            }
-                            if (isNaN(Number(this.formData.pay))) {
-                                callback(new Error('请输入付几'));
-                                return;
+                            if (
+                                this.formData.checkInType === 'TEAM' ||
+                                this.formData.checkInType === 'SCATTERED_BEDS'
+                            ) {
+                                if (isNaN(Number(this.formData.bet))) {
+                                    callback(new Error('请输入押几'));
+                                    return;
+                                }
+                                if (isNaN(Number(this.formData.pay))) {
+                                    callback(new Error('请输入付几'));
+                                    return;
+                                }
                             }
                             callback();
                         }
@@ -708,21 +713,24 @@ export default {
                 this.$message.error('请输入合同结束时间');
                 return;
             }
-            if (isNaN(Number(this.formData.bet))) {
-                this.$message.error('请输入押几');
-                return;
-            }
-            if (isNaN(Number(this.formData.pay))) {
-                this.$message.error('请输入付几');
-                return;
-            }
-            if (!this.formData.advancePayment) {
-                this.$message.error('请输入提前几天收款');
-                return;
-            }
-            if (!this.formData.advancePayment) {
-                this.$message.error('请输入提前几天收款');
-                return;
+            if (this.formData.checkInType === 'TEAM' || this.formData.checkInType === 'SCATTERED_BEDS') {
+                if (isNaN(Number(this.formData.bet))) {
+                    this.$message.error('请输入押几');
+                    return;
+                }
+                if (isNaN(Number(this.formData.pay))) {
+                    this.$message.error('请输入付几');
+                    return;
+                }
+                if (!this.formData.advancePayment) {
+                    this.$message.error('请输入提前几天收款');
+                    return;
+                }
+            } else {
+                if (isNaN(Number(this.formData.flowBet))) {
+                    this.$message.error('请输入押金');
+                    return;
+                }
             }
             if (this.formData.contractBeginTime > this.formData.contractEndTime) {
                 this.$message.error('合同结束时间必须大于开始时间');