Explorar el Código

按时间查询无效以及重置失败bug

Guos hace 2 semanas
padre
commit
889c2a3be4
Se han modificado 2 ficheros con 33 adiciones y 23 borrados
  1. 17 21
      src/views/crm/customer/index.vue
  2. 16 2
      src/views/crm/customer/line.vue

+ 17 - 21
src/views/crm/customer/index.vue

@@ -63,7 +63,7 @@
           v-model="dateRange"
           type="daterange"
           value-format="yyyy-MM-dd"
-          start-placeholder="开始日期" end-placeholder="结束日期"
+          start-placeholder="开始日期" end-placeholder="结束日期" @change="handleScheduleTimeChange"
            >
         </el-date-picker>
       </el-form-item>
@@ -405,7 +405,9 @@ export default {
         companyId: null,
         isLine: null,
         source: null,
-        tags: null
+        tags: null,
+        beginTime: null,
+        endTime: null,
       },
       // 表单参数
       form: {},
@@ -449,6 +451,15 @@ export default {
     this.getList();
   },
   methods: {
+    handleScheduleTimeChange(val) {
+      if (val) {
+        this.queryParams.beginTime = val[0];
+        this.queryParams.endTime = val[1];
+      } else {
+        this.queryParams.beginTime = null;
+        this.queryParams.endTime = null;
+      }
+    },
     handleEditSource(){
       this.source.open=true;
       var that=this;
@@ -498,25 +509,6 @@ export default {
           this.citys=res.data;
         })
     },
-    handleClose(tag) {
-        this.tags.splice(this.tags.indexOf(tag), 1);
-        this.form.tags=this.tags.toString();
-    },
-    showInput() {
-      this.inputVisible = true;
-      this.$nextTick(_ => {
-        this.$refs.saveTagInput.$refs.input.focus();
-      });
-    },
-    handleInputConfirm() {
-      let inputValue = this.inputValue;
-      if (inputValue) {
-        this.tags.push(inputValue);
-      }
-      this.inputVisible = false;
-      this.inputValue = '';
-      this.form.tags=this.tags.toString();
-    },
     handleShow(row){
       var that=this;
       that.show.open=true;
@@ -602,7 +594,11 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.beginTime = null;
+      this.queryParams.endTime = null;
+      this.dateRange = null;
       this.resetForm("queryForm");
+      //this.$forceUpdate(); // 强制更新视图
       this.handleQuery();
     },
     // 多选框选中数据

+ 16 - 2
src/views/crm/customer/line.vue

@@ -43,7 +43,7 @@
           v-model="dateRange"
           type="daterange"
           value-format="yyyy-MM-dd"
-          start-placeholder="开始日期" end-placeholder="结束日期"
+          start-placeholder="开始日期" end-placeholder="结束日期"  @change="handleScheduleTimeChange"
            >
         </el-date-picker>
       </el-form-item>
@@ -426,7 +426,9 @@ export default {
         companyId: null,
         isLine: null,
         source: null,
-        tags: null
+        tags: null,
+        beginTime: null,
+        endTime: null,
       },
       // 表单参数
       form: {
@@ -465,6 +467,15 @@ export default {
     this.getList();
   },
   methods: {
+    handleScheduleTimeChange(val) {
+      if (val) {
+        this.queryParams.beginTime = val[0];
+        this.queryParams.endTime = val[1];
+      } else {
+        this.queryParams.beginTime = null;
+        this.queryParams.endTime = null;
+      }
+    },
     handleAssignList(){
       this.assignList.open=true;
       var that=this;
@@ -583,6 +594,9 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.beginTime = null;
+      this.queryParams.endTime = null;
+      this.dateRange = null;
       this.resetForm("queryForm");
       this.handleQuery();
     },