Ver Fonte

提交代码

zyf há 2 anos atrás
pai
commit
94f7d7ec83

+ 1 - 1
config/index.js

@@ -74,7 +74,7 @@ let proxyTable = {
   '/api/v1': {
     target: 'http://172.16.33.166:80',
     //target: 'http://localhost:8080',
-    // target: "http://192.168.1.101:8080",
+    // target: 'http://192.168.1.102:8080',
     ws: true,
     pathRewrite: {
       '^/api/v1': '/api/v1'

+ 91 - 6
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -145,7 +145,8 @@
           width="160px"
           align="center"
           column-key="consigneeName"
-          :filters="filters1"
+          :filters="filterConsigneeList"
+          :filter-method="filterConsignee"
           sortable
           show-overflow-tooltip
         >
@@ -162,9 +163,11 @@
           prop="carrierName"
           label="承运商"
           align="center"
-          width="60px"
+          width="80px"
           sortable
           show-overflow-tooltip
+          :filters="filterCarrierList"
+          :filter-method="filterCarrier"
         >
         </el-table-column>
         <el-table-column
@@ -175,6 +178,8 @@
           width="90px"
           sortable
           show-overflow-tooltip
+          :filters="filterCapacityList"
+          :filter-method="filterCapacity"
         >
         </el-table-column>
         <el-table-column
@@ -184,6 +189,8 @@
           width="150px"
           sortable
           show-overflow-tooltip
+          :filters="filtermaterialNameList"
+          :filter-method="filtermaterialName"
         >
         </el-table-column>
         <el-table-column
@@ -764,6 +771,7 @@ import { sjTime, isVehicleNumber } from '@/utils/sharedJsFile'
 import { getCookie } from '@/utils/util.js'
 import PathView from './mapTest.vue'
 import currentLocation from './currentLocation.vue'
+import newNoticeVue from '../../../sale/components/dilNotice/newNotice.vue'
 export default {
   components: {
     PathView,
@@ -827,7 +835,7 @@ export default {
       carrierList: [],
       tableData: [],
       //筛选条件1(客户)
-      filters1:[],
+      filters1: [],
       spanArr: [],
       pos: 0,
       //需要合并列的名称
@@ -840,7 +848,9 @@ export default {
         '司机电话',
         '运输订单号',
         '签收地址',
+        '签收时间',
         '抵达地址',
+        '抵达时间',
         '出厂时间',
         '进厂时间',
         '运单状态',
@@ -922,7 +932,11 @@ export default {
         'xiaoshouyewuyuan',
         'zidonghuabu'
       ],
-      isShowOperate: false
+      isShowOperate: false,
+      filterConsigneeList: [],
+      filterCarrierList: [],
+      filterCapacityList: [],
+      filtermaterialNameList: []
     }
   },
   created() {
@@ -931,6 +945,16 @@ export default {
     }
     this.getSteelReport()
   },
+  watch: {
+    tableData: {
+      handler(oldVal, newVal) {
+        this.filterListChange()
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  computed: {},
   mounted() {
     this.$nextTick(() => {
       window.onresize = () => {
@@ -945,6 +969,67 @@ export default {
   },
   computed: {},
   methods: {
+    //控制筛选数组变化
+    filterListChange() {
+      let consigneeNameList = this.tableData.map(e => {
+        return e.consigneeName
+      })
+      let carrierNameList = this.tableData
+        .map(e => {
+          return e.carrierName
+        })
+        .filter(e => {
+          return e != null
+        })
+      let capacityList = this.tableData
+        .map(e => {
+          return e.capacityNo
+        })
+        .filter(e => {
+          return e != null
+        })
+      let materialNameList = this.tableData
+        .map(e => {
+          return e.materialName
+        })
+        .filter(e => {
+          return e != null
+        })
+
+      Array.from(new Set(consigneeNameList)).forEach(e => {
+        let map = {}
+        map.text = e
+        map.value = e
+        this.filterConsigneeList.push(map)
+      })
+      Array.from(new Set(carrierNameList)).forEach(e => {
+        let map = {}
+        map.text = e
+        map.value = e
+        this.filterCarrierList.push(map)
+      })
+      Array.from(new Set(capacityList)).forEach(e => {
+        let map = {}
+        map.text = e
+        map.value = e
+        this.filterCapacityList.push(map)
+      })
+      Array.from(new Set(materialNameList)).forEach(e => {
+        let map = {}
+        map.text = e
+        map.value = e
+        this.filtermaterialNameList.push(map)
+      })
+    },
+    filterConsignee(value, row) {
+      return row.consigneeName === value
+    },
+    filterCarrier(value, row) {
+      return row.carrierName === value
+    },
+    filterCapacity(value, row) {
+      return row.capacityNo === value
+    },
     cellStyle({ row, column, rowIndex, columnIndex }) {
       if (
         column.property == 'arrivalAddress' ||
@@ -1876,8 +1961,8 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
-          this.filters1=res.data.data.consigneeName
-          console.log("客户数据")
+          this.filters1 = res.data.data.consigneeName
+          console.log('客户数据')
           console.log(res.data.data.consigneeName)
           this.getSpanArr(res.data.data)
           loading.close()