liyg 2 년 전
부모
커밋
3a33e4b677
2개의 변경된 파일43개의 추가작업 그리고 1개의 파일을 삭제
  1. 20 0
      src/views/statisticalReport/components/Ship_dynamic_table.vue
  2. 23 1
      src/views/statisticalReport/components/tableItem.vue

+ 20 - 0
src/views/statisticalReport/components/Ship_dynamic_table.vue

@@ -220,6 +220,26 @@ export default {
                   right: { style: 'thin' }
               }
             }
+            //库存三列特殊对待
+            if(table_book.Sheets.Sheet1[key].t=='s' && table_book.Sheets.Sheet1[key].v && (table_book.Sheets.Sheet1[key].v.includes('下游港口库存') || table_book.Sheets.Sheet1[key].v.includes('万港库存') || table_book.Sheets.Sheet1[key].v.includes('在途货物'))){
+              
+              table_book.Sheets.Sheet1[key].s = {
+              font:{
+                name:"宋体",
+                sz:10
+              },
+              alignment: {
+                vertical: 'center',
+                wrapText: true,
+              },
+              border: { 
+                  top: { style: 'thin' },
+                  bottom: { style: 'thin' },
+                  left: { style: 'thin' },
+                  right: { style: 'thin' }
+              }
+            }
+            }
           }
        })
        //表头字体重新设置

+ 23 - 1
src/views/statisticalReport/components/tableItem.vue

@@ -579,9 +579,31 @@ export default {
         one: spanOneArr
       }
     },
+    flitterData1(arr) {
+      var spanOneArr = []
+      let concatOne = 0
+      arr.forEach((item, index) => {
+        if (index === 0) {
+          spanOneArr.push(1)
+        } else {
+          // name 修改
+          if (item.materialType === arr[index - 1].materialType) {
+            // 第一列需合并相同内容的判断条件
+            spanOneArr[concatOne] += 1
+            spanOneArr.push(0)
+          } else {
+            spanOneArr.push(1)
+            concatOne = index
+          }
+        }
+      })
+      return {
+        one: spanOneArr
+      }
+    },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
       if (columnIndex === 0) {
-        const _row = this.flitterData(this.tableData).one[rowIndex]
+        const _row = this.flitterData1(this.tableData).one[rowIndex]
         const _col = _row > 0 ? 1 : 0
         return {
           rowspan: _row,