Explorar el Código

fix:表单搜索项新增字段未重置

snow hace 2 años
padre
commit
6b2a0bc5ec

+ 1 - 0
src/views/reportQuery/productReport/components/table1.vue

@@ -187,6 +187,7 @@ export default {
 
 
       this.parmValue.page = 1;
       this.parmValue.page = 1;
       this.parmValue.sizee = 15;
       this.parmValue.sizee = 15;
+      this.parmValue.spuCode = "";
       this.pageInfo = {
       this.pageInfo = {
         size: 15,
         size: 15,
         curr: 1,
         curr: 1,

+ 1 - 0
src/views/reportQuery/productReport/components/table2.vue

@@ -188,6 +188,7 @@ export default {
 
 
       this.parmValue.page = 1;
       this.parmValue.page = 1;
       this.parmValue.sizee = 15;
       this.parmValue.sizee = 15;
+      this.parmValue.spuCode = ""
       this.pageInfo = {
       this.pageInfo = {
         size: 15,
         size: 15,
         curr: 1,
         curr: 1,

+ 32 - 10
src/views/reportQuery/purchaseReport/components/table6.vue

@@ -47,7 +47,7 @@
                 :placeholder="''"
                 :placeholder="''"
                 :width="'135px'"
                 :width="'135px'"
                 :size="searchSize"
                 :size="searchSize"
-                @timeReturned="time($event,true)"
+                @timeReturned="time($event, true)"
               />
               />
             </el-col>
             </el-col>
             <el-col :span="4" style="width: 66px; float: right">
             <el-col :span="4" style="width: 66px; float: right">
@@ -90,7 +90,12 @@
             </el-col>
             </el-col>
 
 
             <el-col :span="4" style="width: 66px; float: right">
             <el-col :span="4" style="width: 66px; float: right">
-              <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">
+              <el-button
+                type="warning"
+                class="fr"
+                :size="searchSize"
+                @click="restSearch"
+              >
                 重置
                 重置
               </el-button>
               </el-button>
             </el-col>
             </el-col>
@@ -131,8 +136,8 @@ export default {
         companyName: "", //客户名称
         companyName: "", //客户名称
         start_date: "", //起始时间
         start_date: "", //起始时间
         end_date: "", // 结束时间
         end_date: "", // 结束时间
-        start_updatetime:"",
-        end_updatetime:"",
+        start_updatetime: "",
+        end_updatetime: "",
         // is_export:0,//是否导出0/1
         // is_export:0,//是否导出0/1
         page: 1, // 页码
         page: 1, // 页码
         size: 15, // 每页显示条数
         size: 15, // 每页显示条数
@@ -173,7 +178,9 @@ export default {
       // return;
       // return;
       this.loading = true;
       this.loading = true;
 
 
-      const res = await asyncRequest.reportconsultinfobidssumnot(this.parmValue);
+      const res = await asyncRequest.reportconsultinfobidssumnot(
+        this.parmValue
+      );
       if (res && res.code === 0 && res.data) {
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
         this.pageInfo.total = Number(res.data.count);
@@ -195,6 +202,8 @@ export default {
         end_date: "", // 新建结束时间
         end_date: "", // 新建结束时间
         page: 1, // 页码
         page: 1, // 页码
         size: 15, // 每页显示条数
         size: 15, // 每页显示条数
+        start_updatetime:"", //更新起始时间
+        end_updatetime:"" //更新结束时间
         // is_export:0//是否导出0/1
         // is_export:0//是否导出0/1
       };
       };
       // 表格 - 分页
       // 表格 - 分页
@@ -203,13 +212,14 @@ export default {
         curr: 1,
         curr: 1,
         total: 0,
         total: 0,
       };
       };
+      console.log(this.parmValue)
       this.searchList();
       this.searchList();
     },
     },
 
 
     // 时间函数
     // 时间函数
-    async time(e,isUpdate) {
-      const startProp = isUpdate ? 'start_updatetime' : 'start_date'
-      const endProp = isUpdate ? 'end_updatetime' : 'end_date'
+    async time(e, isUpdate) {
+      const startProp = isUpdate ? "start_updatetime" : "start_date";
+      const endProp = isUpdate ? "end_updatetime" : "end_date";
 
 
       this.parmValue[startProp] = e.startTime || "";
       this.parmValue[startProp] = e.startTime || "";
       this.parmValue[endProp] = e.endTime || "";
       this.parmValue[endProp] = e.endTime || "";
@@ -239,8 +249,20 @@ export default {
       // }
       // }
       let start_date = new Date(this.parmValue.start_date).valueOf();
       let start_date = new Date(this.parmValue.start_date).valueOf();
       let end_date = new Date(this.parmValue.end_date).valueOf();
       let end_date = new Date(this.parmValue.end_date).valueOf();
-      let flag = end_date - start_date > 30 * 24 * 60 * 60 * 1000;
-      if (this.parmValue.start_date != "" && this.parmValue.end_date != "") {
+      let start_updatetime = new Date(
+        this.parmValue.start_updatetime
+      ).valueOf();
+      let end_updatetime = new Date(this.parmValue.end_updatetime).valueOf();
+      const delay = 30 * 24 * 60 * 60 * 1000;
+      const flag =
+        end_date - start_date > delay ||
+        end_updatetime - start_updatetime > delay;
+
+      if (
+        (this.parmValue.start_date !== "" && this.parmValue.end_date !== "") ||
+        (this.parmValue.start_updatetime !== "" &&
+          this.parmValue.end_updatetime !== "")
+      ) {
         if (flag) {
         if (flag) {
           this.$message.warning("导出文件的时间区间不能超过30天");
           this.$message.warning("导出文件的时间区间不能超过30天");
           return;
           return;