Browse Source

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang 1 year ago
parent
commit
88d667b007
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/views/appoint/components/saleContract/transportPrice.vue

+ 12 - 1
src/views/appoint/components/saleContract/transportPrice.vue

@@ -776,7 +776,10 @@ export default {
         let j = cols.length - 1
         let j = cols.length - 1
         let priceCol = null
         let priceCol = null
         let tonnageCol = null
         let tonnageCol = null
+        let carrierCol = null
         for (j = cols.length - 1; j > 0; j--) {
         for (j = cols.length - 1; j > 0; j--) {
+          console.log(workbook.Sheets[workbook.SheetNames[0]][cols[j] + (index)]);
+          console.log(workbook.Sheets[workbook.SheetNames[0]][cols[j] + (index + 1)]);
           if (
           if (
             workbook.Sheets[workbook.SheetNames[0]][cols[j] + (index + 1)] &&
             workbook.Sheets[workbook.SheetNames[0]][cols[j] + (index + 1)] &&
             priceCol == null &&
             priceCol == null &&
@@ -795,10 +798,18 @@ export default {
                 .v == '吨公里\r\n(元/吨.km)')
                 .v == '吨公里\r\n(元/吨.km)')
           ) {
           ) {
             tonnageCol = cols[j]
             tonnageCol = cols[j]
+          }else if(
+            workbook.Sheets[workbook.SheetNames[0]][cols[j] + (index)] &&
+            carrierCol == null &&
+            (workbook.Sheets[workbook.SheetNames[0]][cols[j] + (index)].v ==
+              '承运单位')
+          ){
+            carrierCol = cols[j]
           }
           }
         }
         }
         console.log('最新单价列数:' + priceCol)
         console.log('最新单价列数:' + priceCol)
         console.log('最新单价吨公里:' + tonnageCol)
         console.log('最新单价吨公里:' + tonnageCol)
+        console.log('承运单位:' + carrierCol)
         //读取表格
         //读取表格
         for (let i = index + 2; i <= rows.length + 1; i++) {
         for (let i = index + 2; i <= rows.length + 1; i++) {
           let temp = {
           let temp = {
@@ -847,7 +858,7 @@ export default {
           //承运商
           //承运商
           try {
           try {
             temp.carrierName =
             temp.carrierName =
-              workbook.Sheets[workbook.SheetNames[0]]['O' + i].v
+              workbook.Sheets[workbook.SheetNames[0]][carrierCol + i].v
           } catch (error) {}
           } catch (error) {}
           //单价
           //单价
           try {
           try {