Przeglądaj źródła

修改支持表格数据分页之后查询不出来的情况

huk 3 lat temu
rodzic
commit
e023e69d0a

+ 2 - 2
build/utils.js

@@ -15,8 +15,8 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // ['index','appoint','configManager','homepage','inward','queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-let devModules = ['all'];
-// let devModules = ['index','statisticalReport','TMS','RMS'];
+// let devModules = ['all'];
+let devModules = ['index','statisticalReport','TMS','RMS'];
 if (pathSrc.indexOf('node_modules') > -1) {
     devModules = require('../../../cors.js').devModules;
 }

+ 49 - 38
src/components/DilCommonUI/packages/table/src/table.js

@@ -27,7 +27,6 @@ export default {
   created() {
     this.dataCurrentPage = this.currentPage;
     this.dataPageSize = this.pageSize;
-    console.log(this)
     this.requestData();
   },
   mounted() {
@@ -45,7 +44,6 @@ export default {
       if (options) {
         pageNum = options.pageNum;
         pageSize = options.pageSize;
-        
       }
       
       if (this.requestUrl) {
@@ -56,45 +54,57 @@ export default {
         } else {
           url = this.requestUrl;
         }
-        // 处理请求地址逻辑
-
-        if (
-          !this.dataTotal ||
-          (this.dataCurrentPage - 1) * this.dataPageSize < this.dataTotal
-        ) {
-          // 判断是否需要在请求体中放入参数
-          if(this.requestQuery){
-            console.log(" 判断是否需要在请求体中放入参数")
-            this.dataRequestQuery=this.requestQuery;
-            // console.log(this.dataRequestQuery.resultBreakId)
+        // 判断是否需要在请求体中放入参数
+        if(this.requestQuery){
+          this.dataRequestQuery=this.requestQuery;
+          // console.log(this.dataRequestQuery.resultBreakId)
+        }
+        let data = undefined;
+        for (const key in this.dataRequestQuery) {
+          const val = this.dataRequestQuery[key];
+          console.log(val)
+          if (val||val==0) {
+            if (!data) data = {};
+            data[key] = val;
           }
-          let data = undefined;
-          for (const key in this.dataRequestQuery) {
-            const val = this.dataRequestQuery[key];
-            console.log(val)
-            if (val||val==0) {
-              if (!data) data = {};
-              data[key] = val;
+        }
+        // 发送请求
+        if(this.isKuang){
+          this.axios
+          .post(url, data, {
+            // 请求地址 中
+            params: {
+              pageNum: 1,
+              pageSize: pageSize || this.dataPageSize
             }
-          }
-          // 发送请求
+          })
+          .then(response => {
+            let d = response.data.data;
+            this.dataTabel = d.list;
+            this.dataTotal = d.total;
+            //执行成功的回调
+            this.$emit('func',response.data.data);
+            this.refreshColumnData(d.columnData);
+            this.isShow = true;
+          });
+        }else{
           this.axios
-            .post(url, data, {
-              // 请求地址 中
-              params: {
-                pageNum: pageNum || this.dataCurrentPage,
-                pageSize: pageSize || this.dataPageSize
-              }
-            })
-            .then(response => {
-              let d = response.data.data;
-              this.dataTabel = d.list;
-              this.dataTotal = d.total;
-              //执行成功的回调
-              this.$emit('func',response.data.data);
-              this.refreshColumnData(d.columnData);
-              this.isShow = true;
-            });
+          .post(url, data, {
+            // 请求地址 中
+            params: {
+              pageNum: pageNum || this.dataCurrentPage,
+              pageSize: pageSize || this.dataPageSize
+            }
+          })
+          .then(response => {
+            let d = response.data.data;
+            this.dataTabel = d.list;
+            this.dataTotal = d.total;
+            //执行成功的回调
+            this.$emit('func',response.data.data);
+            this.refreshColumnData(d.columnData);
+            this.isShow = true;
+          });
         }
       } else {
         console.warn("requestUrl 参数不能为 null");
@@ -285,6 +295,7 @@ export default {
     requestQuery: {
       deep: true,
       handler(val, oldVal) {
+        console.log(val,"val22222222222222222222222")
         let q = this.dataRequestQuery;
         for (const key in val) {
           q[key] = val[key] ? val[key] : undefined;

+ 1 - 1
src/components/DilCommonUI/packages/table/src/table.vue

@@ -116,7 +116,7 @@ export default {
   name: "DilTable",
   extends: table,
   props: {
-    isChang:{
+    isKuang:{
       default:false,
     },
     // 请求地址

+ 72 - 59
src/views/TMS/components/importedFuel/transportReserveRanAdd.vue

@@ -130,40 +130,52 @@
           <i class="el-icon-search"></i>查询
         </el-button>
       </div>
-      <div v-show="onDrawerNumber == 1">
+      <div v-if="onDrawerNumber == 1">
         <dilTable
           v-bind.sync="frist"
           @radio-change="currentRadioChange1"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
-      <div v-show="onDrawerNumber == 2">
+      <div v-else-if="onDrawerNumber == 2">
         <dilTable
           v-bind.sync="secend"
           @radio-change="currentRadioChange2"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
-      <div v-show="onDrawerNumber == 3">
+      <div v-else-if="onDrawerNumber == 3">
         <dilTable
           v-bind.sync="third"
           @selection-change="currentRadioChange3"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
-      <div v-show="onDrawerNumber == 4">
+      <div v-else-if="onDrawerNumber == 4">
         <dilTable
           v-bind.sync="unloadPoint"
           @radio-change="currentRadioChange4"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
-      <div v-show="onDrawerNumber == 5">
+      <div v-else-if="onDrawerNumber == 5">
         <dilTable
           v-bind.sync="line"
           @radio-change="currentRadioChange5"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
-      <div v-show="onDrawerNumber == 6">
+      <div v-else-if="onDrawerNumber == 6">
         <dilTable
           v-bind.sync="purchaseOrder"
           @radio-change="currentRadioChange6"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
     </el-drawer>
@@ -181,6 +193,7 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      isKuang:false,
       //采购订单号
       purchaseOrderNo:'',
       isMoreTrips:false,
@@ -247,7 +260,7 @@ export default {
       direction: "rtl",
       input: "",
       frist: {
-        requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
+        requestUrl: "",
         selectionType: "radio",
         mapList1: [],
       },
@@ -336,72 +349,72 @@ export default {
         });
       }
     },
+    func(res){
+      console.log(res);
+      this.isKuang = false;
+    },
     onclick() {
-      if (this.onDrawerNumber == 1) {
-        this.frist.requestUrl =
-          "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
-          this.input;
-      } else if (this.onDrawerNumber == 2) {
-        this.secend.requestUrl =
-          "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
-          this.materialId +
-          "&index=" +
-          this.input;
-      } else if (this.onDrawerNumber == 3) {
-        //判断是否是承运商查询车辆
-        if (getCookie("orgCode") == "chengyunshang") {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            getCookie("userId") +
-            "&index=" +
-            this.input;
-        } else {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            null +
-            "&index=" +
-            this.input;
+      this.isKuang = true;
+      if(this.input){
+        if (this.onDrawerNumber == 1) {
+          this.frist.requestUrl = "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" + this.input;
+        } else if (this.onDrawerNumber == 2) {
+          this.secend.requestUrl = "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" + this.materialId + "&index=" + this.input;
+        } else if (this.onDrawerNumber == 3) {
+          //判断是否是承运商查询车辆
+          if (getCookie("orgCode") == "chengyunshang") {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + getCookie("userId") + "&index=" + this.input;
+          } else {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null + "&index=" + this.input;
+          }
+        } else if (this.onDrawerNumber == 4) {
+          this.unloadPoint.requestUrl =  "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.input;
+        } else if (this.onDrawerNumber == 5) {
+          this.line.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
+        }else if (this.onDrawerNumber == 6) {
+          this.purchaseOrder.requestUrl = "/api/v1/ams/getPurchaseOrderList?apiId=81&con=" + this.input+"&i="+new Date();
+        }
+      }else{
+        if (this.onDrawerNumber == 1) {
+          this.frist.requestUrl = "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050"
+        } else if (this.onDrawerNumber == 2) {
+          this.secend.requestUrl = "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" + this.materialId;
+        } else if (this.onDrawerNumber == 3) {
+          //判断是否是承运商查询车辆
+          if (getCookie("orgCode") == "chengyunshang") {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + getCookie("userId");
+          } else {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null;
+          }
+        } else if (this.onDrawerNumber == 4) {
+          this.unloadPoint.requestUrl =  "/api/v1/uc/getUnloadingMesByLike?apiId=374";
+        } else if (this.onDrawerNumber == 5) {
+          this.line.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3";
+        }else if (this.onDrawerNumber == 6) {
+          this.purchaseOrder.requestUrl = "/api/v1/ams/getPurchaseOrderList?apiId=81";
         }
-      } else if (this.onDrawerNumber == 4) {
-        this.unloadPoint.requestUrl =
-          "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.input;
-      } else if (this.onDrawerNumber == 5) {
-        this.option.requestUrl =
-          "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
-      }else if (this.onDrawerNumber == 6) {
-        console.log("caig")
-        this.purchaseOrder.requestUrl =
-          "/api/v1/ams/getPurchaseOrderList?apiId=81&con=" + this.input+"&i="+new Date();
       }
     },
     ondrawer(num) {
-      this.drawer = true;
       this.onDrawerNumber = num;
-      if (num == 2) {
-        this.secend.requestUrl =
-          "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
-          this.materialId;
+      this.drawer = true;
+      if(num == 1){
+        this.frist.requestUrl = "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050"
+      }else if (num == 2) {
+        this.secend.requestUrl = "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" + this.materialId;
       } else if (num == 3) {
         //判断是否是承运商查询车辆
         if (getCookie("orgCode") == "chengyunshang") {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            getCookie("userId") +
-            "&i=" + new Date();
+          this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + getCookie("userId") + "&i=" + new Date();
         } else {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            null  + "&i=" + new Date();
+          this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null  + "&i=" + new Date();
         }
       } else if (num == 4) {
-        this.unloadPoint.requestUrl =
-          "/api/v1/uc/getUnloadingMesByLike?apiId=374&i=" + new Date();
+        this.unloadPoint.requestUrl = "/api/v1/uc/getUnloadingMesByLike?apiId=374&i=" + new Date();
       } else if (num == 5) {
-        this.option.requestUrl =
-          "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&i=" + new Date();
+        this.line.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&i=" + new Date();
       }else if (num == 6) {
-        this.purchaseOrder.requestUrl =
-        "/api/v1/ams/getPurchaseOrderList?apiId=81&i=" + new Date();
+        this.purchaseOrder.requestUrl = "/api/v1/ams/getPurchaseOrderList?apiId=81&i=" + new Date();
       }
     },
     // 返回

+ 61 - 45
src/views/TMS/components/purchaseChemicalMaterials/transportationReservationAdd.vue

@@ -134,36 +134,48 @@
         <dilTable
           v-bind.sync="frist"
           @radio-change="currentRadioChange1"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
       <div v-show="onDrawerNumber == 2">
         <dilTable
           v-bind.sync="secend"
           @radio-change="currentRadioChange2"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
       <div v-show="onDrawerNumber == 3">
         <dilTable
           v-bind.sync="third"
           @selection-change="currentRadioChange3"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
       <div v-show="onDrawerNumber == 4">
         <dilTable
           v-bind.sync="unloadPoint"
           @radio-change="currentRadioChange4"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
       <div v-show="onDrawerNumber == 5">
         <dilTable
           v-bind.sync="line"
           @radio-change="currentRadioChange5"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
       <div v-show="onDrawerNumber == 6">
         <dilTable
           v-bind.sync="purchaseOrder"
           @radio-change="currentRadioChange6"
+          :isKuang="isKuang"
+          @func="func"
         ></dilTable>
       </div>
     </el-drawer>
@@ -181,6 +193,7 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      isKuang:false,
       //采购订单号
       purchaseOrderNo:'',
       isMoreTrips:false,
@@ -337,61 +350,60 @@ export default {
       }
     },
     onclick() {
-      if (this.onDrawerNumber == 1) {
-        this.frist.requestUrl =
-          "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
-          this.input;
-      } else if (this.onDrawerNumber == 2) {
-        this.secend.requestUrl =
-          "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
-          this.materialId +
-          "&index=" +
-          this.input;
-      } else if (this.onDrawerNumber == 3) {
-        //判断是否是承运商查询车辆
-        if (getCookie("orgCode") == "chengyunshang") {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            getCookie("userId") +
-            "&index=" +
-            this.input;
-        } else {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            null +
-            "&index=" +
-            this.input;
+      this.isKuang = true;
+      if(this.input){
+        if (this.onDrawerNumber == 1) {
+          this.frist.requestUrl = "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" + this.input;
+        } else if (this.onDrawerNumber == 2) {
+          this.secend.requestUrl = "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" + this.materialId + "&index=" + this.input;
+        } else if (this.onDrawerNumber == 3) {
+          //判断是否是承运商查询车辆
+          if (getCookie("orgCode") == "chengyunshang") {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + getCookie("userId") + "&index=" + this.input;
+          } else {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null + "&index=" + this.input;
+          }
+        } else if (this.onDrawerNumber == 4) {
+          this.unloadPoint.requestUrl = "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.input;
+        } else if (this.onDrawerNumber == 5) {
+          this.option.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
+        }else if (this.onDrawerNumber == 6) {
+          this.purchaseOrder.requestUrl = "/api/v1/ams/getPurchaseOrderList?apiId=81&con=" + this.input+"&i="+new Date();
+        }
+      }else{
+        if (this.onDrawerNumber == 1) {
+          this.frist.requestUrl = "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&i="+new Date();
+        } else if (this.onDrawerNumber == 2) {
+          this.secend.requestUrl = "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" + this.materialId+"&i="+new Date();
+        } else if (this.onDrawerNumber == 3) {
+          //判断是否是承运商查询车辆
+          if (getCookie("orgCode") == "chengyunshang") {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + getCookie("userId")+"&i="+new Date();
+          } else {
+            this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null+"&i="+new Date();
+          }
+        } else if (this.onDrawerNumber == 4) {
+          this.unloadPoint.requestUrl = "/api/v1/uc/getUnloadingMesByLike?apiId=374&i="+new Date();
+        } else if (this.onDrawerNumber == 5) {
+          this.option.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&i="+new Date();
+        }else if (this.onDrawerNumber == 6) {
+          this.purchaseOrder.requestUrl = "/api/v1/ams/getPurchaseOrderList?apiId=81&i="+new Date();
         }
-      } else if (this.onDrawerNumber == 4) {
-        this.unloadPoint.requestUrl =
-          "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.input;
-      } else if (this.onDrawerNumber == 5) {
-        this.option.requestUrl =
-          "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
-      }else if (this.onDrawerNumber == 6) {
-        console.log("caig")
-        this.purchaseOrder.requestUrl =
-          "/api/v1/ams/getPurchaseOrderList?apiId=81&con=" + this.input+"&i="+new Date();
       }
     },
     ondrawer(num) {
       this.drawer = true;
       this.onDrawerNumber = num;
-      if (num == 2) {
-        this.secend.requestUrl =
-          "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
-          this.materialId;
+      if(num == 1){
+        this.frist.requestUrl = "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" + this.input;
+      }else if (num == 2) {
+        this.secend.requestUrl = "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" + this.materialId;
       } else if (num == 3) {
         //判断是否是承运商查询车辆
         if (getCookie("orgCode") == "chengyunshang") {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            getCookie("userId") +
-            "&i=" + new Date();
+          this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + getCookie("userId") + "&i=" + new Date();
         } else {
-          this.third.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
-            null  + "&i=" + new Date();
+          this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null  + "&i=" + new Date();
         }
       } else if (num == 4) {
         this.unloadPoint.requestUrl = "/api/v1/uc/getUnloadingMesByLike?apiId=374&i=" + new Date();
@@ -431,6 +443,10 @@ export default {
       this.selectionList = [];
       this.selectionList = selection;
     },
+    func(res){
+      console.log(res)
+      this.isKuang = false;
+    },
     // 确认
     onClickConfirm() {
       var state = 0;