luobang преди 2 години
родител
ревизия
9fb22dd17e
променени са 3 файла, в които са добавени 94 реда и са изтрити 26 реда
  1. 1 1
      build/utils.js
  2. 1 1
      config/index.js
  3. 92 24
      src/views/queue/components/qmsEnFacotory/queueFStart.vue

+ 1 - 1
build/utils.js

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

+ 1 - 1
config/index.js

@@ -73,7 +73,7 @@ let proxyTable = {
   // 所有数据的请求域名地址r
   '/api/v1': {
     target: 'http://172.16.33.166:80',
-    //target: 'http://localhost:8080',
+    // target: 'http://localhost:8080',
     // target: 'http://192.168.1.104:8080',
     ws: true,
     pathRewrite: {

+ 92 - 24
src/views/queue/components/qmsEnFacotory/queueFStart.vue

@@ -184,13 +184,13 @@
         <el-tab-pane label="两拼车辆排队链表" name="fourth">
           <el-table
             :data="tableData2"
-            :span-method="objectSpanMethod"
+            :span-method="objectSpanMethod1"
             border
             style="width: 100%; margin-top: 20px"
-            @selection-change="handleSelectionChange"
+            @selection-change="handleSelectionChangeSpelling"
             :row-key="getRowKey"
             max-height="500px"
-            ref="spellData"
+            ref="twoSpellData"
           >
             <el-table-column
               type="selection"
@@ -263,7 +263,7 @@
             :span-method="objectSpanMethod"
             border
             style="width: 100%; margin-top: 20px"
-            @selection-change="handleSelectionChange"
+            @selection-change="handleSelectionChangeSpelling"
             :row-key="getRowKey"
             max-height="500px"
             ref="spellData"
@@ -373,10 +373,11 @@ export default {
       activeName: 'first',
       tableData: [],
       tableData1: [],
-      tableData2:[],
+      tableData2: [],
       tableData3: [],
       //存放每一行记录的合并数
       spanArr: [],
+      spanArr1: [],
       maplist: [],
       id: null,
       option: [],
@@ -445,7 +446,7 @@ export default {
           this.getSpellingArray()
         } else {
           this.$message({
-            message: '撤失败',
+            message: '撤失败',
             type: 'error',
             duration: 2000,
             center: true,
@@ -509,7 +510,7 @@ export default {
     },
     selectInitSplleing(row) {
       if (this.maplist.length == 0) {
-        if (row.ROW_ID == 1) {
+        if (row.group + 1 == 1) {
           return true
         } else {
           return false
@@ -517,7 +518,7 @@ export default {
       } else {
         if (
           this.maplist.some(e => {
-            return e.ROW_ID == row.ROW_ID || e.ROW_ID + 1 == row.ROW_ID
+            return e.group == row.group || e.group + 1 == row.group
           })
         ) {
           return true
@@ -569,19 +570,19 @@ export default {
           .then(res => {
             this.tableData1 = res.data.data
           })
-      } else if(this.activeName ==second){
+      } else if (this.activeName == second) {
         this.axios
           .post('/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1', map)
           .then(res => {
             this.tableData = res.data.data
             this.getSpanArr(this.tableData)
           })
-      }else if (this.activeName == fourth){
+      } else if (this.activeName == fourth) {
         this.axios
           .post('/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2', map)
           .then(res => {
             this.tableData2 = res.data.data
-            this.getSpanArr(this.tableData2)
+            this.getSpanArr1(this.tableData2)
           })
       }
       this.table1 = false
@@ -601,19 +602,39 @@ export default {
           this.spanArr.push(1)
           this.pos = 0
           data[i].group = i
-          data[i].ROW_ID = i + 1
         } else {
           // 判断当前元素与上一个元素是否相同
           if (data[i].resultTotalId === data[i - 1].resultTotalId) {
             this.spanArr[this.pos] += 1
             this.spanArr.push(0)
             data[i].group = data[i - 1].group
-            data[i].ROW_ID = data[i - 1].ROW_ID
           } else {
             this.spanArr.push(1)
             this.pos = i
             data[i].group = data[i - 1].group + 1
-            data[i].ROW_ID = data[i - 1].ROW_ID + 1
+          }
+        }
+      }
+    },
+    //记录每一行的合并数
+    getSpanArr1(data) {
+      //每次调用方法初始化
+      this.spanArr1 = []
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr1.push(1)
+          this.pos = 0
+          data[i].group = i
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          if (data[i].resultTotalId === data[i - 1].resultTotalId) {
+            this.spanArr1[this.pos] += 1
+            this.spanArr1.push(0)
+            data[i].group = data[i - 1].group
+          } else {
+            this.spanArr1.push(1)
+            this.pos = i
+            data[i].group = data[i - 1].group + 1
           }
         }
       }
@@ -640,6 +661,28 @@ export default {
         }
       }
     },
+    objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
+      if (
+        columnIndex === 0 ||
+        columnIndex === 1 ||
+        columnIndex === 2 ||
+        columnIndex === 3 ||
+        columnIndex === 4 ||
+        columnIndex === 10 ||
+        columnIndex === 11 ||
+        columnIndex === 12 ||
+        columnIndex === 13 ||
+        columnIndex === 14 ||
+        columnIndex === 15
+      ) {
+        const _row = this.spanArr1[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
+      }
+    },
     handleClick() {
       this.redDotNum = null
       this.totalQueueNum = null
@@ -649,7 +692,7 @@ export default {
         this.getNoSpellingArray()
       } else if (this.activeName == 'second') {
         this.getSpellingArray()
-      }else if (this.activeName == 'fourth'){
+      } else if (this.activeName == 'fourth') {
         this.getSpellingArrayTwo()
       } else {
         this.getStoreArray()
@@ -681,13 +724,13 @@ export default {
       this.axios
         .post(
           '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
-          new Date()
+            new Date()
         )
         .then(res => {
           this.tableData2 = res.data.data
           this.isQueryCapacity = null
           console.log(this.tableData2)
-          this.getSpanArr(this.tableData2)
+          this.getSpanArr1(this.tableData2)
         })
     },
     getStoreArray() {
@@ -710,7 +753,7 @@ export default {
             this.tableData1 = res.data.data
           })
         console.log('wzxxx')
-      } else if (this.activeName == second){
+      } else if (this.activeName == second) {
         this.axios
           .post(
             '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=' +
@@ -723,24 +766,25 @@ export default {
             this.tableData = res.data.data
             this.getSpanArr(this.tableData)
           })
-      }else if (this.activeName ==fourth){
+      } else if (this.activeName == fourth) {
         this.axios
           .post(
             '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
-            new Date() +
-            '&capacityNumber=' +
-            this.capacityNo
+              new Date() +
+              '&capacityNumber=' +
+              this.capacityNo
           )
           .then(res => {
             this.isQueryCapacity = 1
             this.tableData2 = res.data.data
-            this.getSpanArr(this.tableData2)
+            this.getSpanArr1(this.tableData2)
           })
       }
     },
     handleSelectionChange(selection) {
       this.maplist = []
       this.maplist = selection
+      console.log(selection)
       for (let i = 0; i < this.maplist.length; i++) {
         if (i + 1 < this.maplist.length) {
           if (this.maplist[i].ROW_ID + 1 != this.maplist[i + 1].ROW_ID) {
@@ -756,7 +800,28 @@ export default {
         })
       ) {
         this.$refs.mutiData.clearSelection()
+      }
+    },
+    handleSelectionChangeSpelling(selection) {
+      this.maplist = []
+      this.maplist = selection
+      console.log(selection)
+      for (let i = 0; i < this.maplist.length; i++) {
+        if (i + 1 < this.maplist.length) {
+          if (this.maplist[i].group + 1 != this.maplist[i + 1].group) {
+            this.$refs.spellData.clearSelection()
+            this.$refs.twoSpellData.clearSelection()
+          }
+        }
+      }
+      // 限制只取第一个去掉
+      if (
+        !this.maplist.some(e => {
+          return e.group == 0
+        })
+      ) {
         this.$refs.spellData.clearSelection()
+        this.$refs.twoSpellData.clearSelection()
       }
     },
     updateBill(scope) {
@@ -828,7 +893,7 @@ export default {
       if (this.activeName == 'first') {
         map.mapList = this.maplist
       }
-      console.log("勾选的数据")
+      console.log('勾选的数据')
       console.log(map)
       this.axios.post('/api/v1/qms/allowEnFactory', map).then(res => {
         if (res.data.code == '200') {
@@ -842,6 +907,7 @@ export default {
           this.maplist = []
           this.$refs.mutiData.clearSelection()
           this.$refs.spellData.clearSelection()
+          this.$refs.twoSpellData.clearSelection()
           this.getNoSpellingArray()
           this.getSpellingArray()
           this.getStoreArray()
@@ -861,6 +927,8 @@ export default {
           })
           this.maplist = []
           this.$refs.mutiData.clearSelection()
+          this.$refs.spellData.clearSelection()
+          this.$refs.twoSpellData.clearSelection()
           this.getNoSpellingArray()
           this.getSpellingArray()
           this.getStoreArray()