소스 검색

时间选择问题

@dongkboy 2 년 전
부모
커밋
80139a20cb
1개의 변경된 파일과 19개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      src/views/AgreementManage/CarInsurance/AgreementEntry.vue

+ 19 - 0
src/views/AgreementManage/CarInsurance/AgreementEntry.vue

@@ -703,6 +703,7 @@
                 <el-date-picker
                   v-model="underwritingRulesForm.rulesEndDate"
                   type="date"
+                  @change="rulesEndDateChange"
                   placeholder="选择日期">
                 </el-date-picker>
               </el-form-item>
@@ -2655,6 +2656,24 @@ export default {
     cleanEndDate() {
       this.productCostForm.costsEndDate = null;
     },
+    rulesEndDateChange(){
+      let tempStartDate = this.underwritingRulesForm.rulesStartDate;
+      let tempEndDate = this.underwritingRulesForm.rulesEndDate;
+      if (!tempStartDate) {
+        this.underwritingRulesForm.rulesEndDate = null;
+        this.$message({
+          message: "请先选择规则起期!",
+          type: "error",
+        });
+      }
+      if (!this.validateEndDate(tempStartDate, tempEndDate)) {
+        this.underwritingRulesForm.rulesEndDate = null;
+        this.$message({
+          message: "规则止期不能小于规则起期!",
+          type: "error",
+        });
+      }
+    },
     //改变费用止期时,校验必须先填费用起期
     checkStartDate() {
       let tempStartDate = this.productCostForm.costsStartDate;