Ver Fonte

Merge branch 'dev' of http://www.baoxianzhanggui.com:8090/sxzgd/vue-insagent-pc into dev

lihongxiao há 2 anos atrás
pai
commit
7379aac289

+ 1 - 1
src/components/Form/retrievalForm.vue

@@ -82,7 +82,7 @@ export default {
   },
   created() {
     this.fields.forEach((field) => {
-      if (field.type === 'date' && !this.formData[field.list]) {
+      if (field.label === '报价时间' && !this.formData[field.list]) {
         this.$set(this.formData, field.list, [this.currentDate, this.currentDate]);
         this.$set(this.formData, field.name[0], this.currentDate);
         this.$set(this.formData, field.name[1],this.currentDate );

+ 15 - 14
src/views/AgreementManage/CarInsurance/AgreementEntry.vue

@@ -119,7 +119,7 @@
         <el-table-column prop="validStatus" label="是否有效" align="center">
           <template slot-scope="scope">
             <span :style="{ color: scope.row.validStatus == '1' ? '#67c23a' : '#909399' }">{{
-              scope.row.validStatus == 1 ? "有效":"无效" }}</span>
+              scope.row.validStatus == 1 ? "有效" : "无效" }}</span>
           </template>
         </el-table-column>
         <el-table-column prop="modifiedBy" label="修改人" align="center" width="130"></el-table-column>
@@ -478,8 +478,7 @@
             <el-col :span="10">
               <el-form-item label="费用止期" prop="costsEndDate">
                 <el-date-picker style="width: 100%" v-model="productCostForm.costsEndDate" type="datetime"
-                  placeholder="选择费用结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions1"
-                  @change="checkStartDate">
+                  placeholder="选择费用结束日期" value-format="yyyy-MM-dd HH:mm:ss" @change="checkStartDate">
                 </el-date-picker>
               </el-form-item>
             </el-col>
@@ -2025,12 +2024,6 @@ export default {
         disabledDate: this.disabledDate,
       };
     },
-
-    pickerOptions1() {
-      return {
-        disabledDate: this.disabledDate1,
-      };
-    },
   },
   created() {
     this.peopleid = Cookies.get("user");
@@ -2064,7 +2057,7 @@ export default {
     this.$api.insCompany.gainTopList("1").then((res) => {
       this.prodInsurance = res.data;
     });
-    this.$api.dept.findDeptTree("9","").then((res) => {
+    this.$api.dept.findDeptTree("9", "").then((res) => {
       this.treedata = res.data;
     });
     this.$api.insCompany.shutdown().then((res) => {
@@ -2605,6 +2598,7 @@ export default {
     //改变费用止期时,校验必须先填费用起期
     checkStartDate() {
       let tempStartDate = this.productCostForm.costsStartDate;
+      let tempEndDate = this.productCostForm.costsEndDate;
       if (!tempStartDate) {
         this.productCostForm.costsEndDate = null;
         this.$message({
@@ -2612,6 +2606,13 @@ export default {
           type: "error",
         });
       }
+      if(!this.validateEndDate(tempStartDate,tempEndDate)){
+        this.productCostForm.costsEndDate = null;
+        this.$message({
+          message: "费用止期不能小于/等于费用起期!",
+          type: "error",
+        });
+      }
     },
 
     disabledDate(time) {
@@ -2619,10 +2620,10 @@ export default {
         return time.getTime() < Date.now() - 8.64e7;
       }
     },
-    disabledDate1(time) {
-      let datetime = this.productCostForm.costsStartDate;
-      const disabledTime = new Date(datetime).getTime() + 8.64e7;
-      return time.getTime() < disabledTime;
+    validateEndDate(startDateStr, endDateStr) {
+      const startDate = new Date(startDateStr);
+      const endDate = new Date(endDateStr);
+      return endDate.getTime() > startDate.getTime();
     },
 
     //请求类型change