wfg 1 年之前
父节点
当前提交
612b99868a

文件差异内容过多而无法显示
+ 0 - 7
public/reports/stimulsoft/scripts/stimulsoft.designer.pack.js


文件差异内容过多而无法显示
+ 0 - 6
public/reports/stimulsoft/scripts/stimulsoft.reports.pack.js


文件差异内容过多而无法显示
+ 0 - 7
public/reports/stimulsoft/scripts/stimulsoft.viewer.pack.js


+ 149 - 99
src/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue

@@ -361,8 +361,123 @@
     },
     methods: {
       // 设计报表
+      processRptData(data){
+        let res=[], feeCenterList=[]
+        if(Array.isArray(data)){
+        data.forEach(row=> {
+          console.log('row.feeCenterList', row.feeCenterList)
+
+          if(row.hasOwnProperty('feeCenterList')) {
+            if(Array.isArray(row.feeCenterList)){
+              feeCenterList=feeCenterList.concat(row.feeCenterList)
+            }
+            delete row.feeCenterList
+          }
+
+          if (row.hshipperDetails) {
+            var consignerIndex2 = row.hshipperDetails.indexOf('\n')
+            for (let i = 0; i < 4; i++) {
+              consignerIndex2 = row.hshipperDetails.indexOf('\n', consignerIndex2 + 1);
+            }
+            if (consignerIndex2 != -1) {
+              var hshipperDetails = row.hshipperDetails.substring(consignerIndex2 + 2, row.hshipperDetails.length)
+              row.hshipperDetails = row.hshipperDetails.substring(0, consignerIndex2) + ' *'
+              row.commodityDescr += '\n*' + hshipperDetails
+            }
+          }
+
+          if (row.hconsigneeDetails) {
+            var consigneeIndex2 = row.hconsigneeDetails.indexOf('\n')
+            for (let i = 0; i < 3; i++) {
+              consigneeIndex2 = row.hconsigneeDetails.indexOf('\n', consigneeIndex2 + 1);
+            }
+            if (consigneeIndex2 != -1) {
+              var hconsigneeDetails = row.hconsigneeDetails.substring(consigneeIndex2 + 2, row.hconsigneeDetails.length)
+              row.hconsigneeDetails = row.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
+              row.commodityDescr += '\n**' + hconsigneeDetails
+            }
+          }
+
+          if (row.hnotifyDetails) {
+            var notifierIndex2 = row.hnotifyDetails.indexOf('\n')
+            for (let i = 0; i < 3; i++) {
+              notifierIndex2 = row.hnotifyDetails.indexOf('\n', notifierIndex2 + 1);
+            }
+            if (notifierIndex2 != -1) {
+              var hnotifyDetails = row.hnotifyDetails.substring(notifierIndex2 + 2, row.hnotifyDetails.length)
+              row.hnotifyDetails = row.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
+              row.commodityDescr += '\n***' + hnotifyDetails
+            }
+          }
+
+          // 处理箱号
+          if (this.isPrintTheBoxNumber) {
+            row.commodityDescr += '\n.\n.\n'
+          }
+
+          // PLACE & DATE OF ISSUE
+          row.placeAndDateOfIssue = ''
+          if (row.issueAt) {
+            row.placeAndDateOfIssue += row.issueAt
+          }
+          if (row.issueDate) {
+            let date = new Date(row.issueDate.replace(/-/g, '/'));
+            let yyyy = date.getFullYear();
+            let mmmm = date.toDateString().split(" ")[1]
+            let dd = date.getDate()
+            row.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
+          }
+
+          // Total number of containers or packages received by the Carriers
+          if (row.preContainersList) {
+            let boxMap = new Map();
+            for (let boxQuantity of row.preContainersList) {
+              if (boxMap.get(boxQuantity.cntrTypeCode)) {
+                let v = boxMap.get(boxQuantity.cntrTypeCode)
+                boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
+              } else {
+                boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
+              }
+            }
+            let boxs = ''
+            boxMap.forEach(function (value, key, map) {
+              boxs += value + 'x' + key + ', '
+            })
+            boxs = boxs.substring(0, boxs.length - 2)
+
+            row.boxQuantity = boxs + ' CONTAINER(S) ONLY'
+          }
+
+          // Number of original B/Ls
+          if (row.numberOfObl) {
+            row.numberOfObl += ' (' + row.numberOfOblDigit + ')'
+          }
+
+          if (row.commodityDescr) {
+            var descriptionIndex2 = row.commodityDescr.indexOf('\n')
+            for (let i = 0; i < 19; i++) {
+              descriptionIndex2 = row.commodityDescr.indexOf('\n', descriptionIndex2 + 1);
+            }
+            if (descriptionIndex2 != -1) {
+              row.pageOne = 'Page : 1 of 2'
+              row.pageTwo = 'Page : 2 of 2'
+              var extraLongText = row.commodityDescr.substring(descriptionIndex2 + 2, row.commodityDescr.length)
+              row.commodityDescr = row.commodityDescr.substring(0, descriptionIndex2)
+              row.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
+              row.extraLongText = extraLongText
+            }
+          }
+
+          res.push(row)
+        })
+
+        }
+
+        return {bills: res, feeCenterList: feeCenterList}
+      },
       async reportDesignButton(url) {
             Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
+
             // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
             Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile( '/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
             Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml' )
@@ -400,6 +515,18 @@
                 return
               var jsonString = e.report.saveToJsonString()
               // console.log(jsonString)
+              var rpt = JSON.parse(jsonString)
+              if (rpt.hasOwnProperty('Dictionary')){
+                // console.log(rpt.Dictionary.Relations)
+                // rpt.Dictionary.Relations = {}
+                var dic=JSON.parse(JSON.stringify(rpt.Dictionary))
+                delete rpt.Dictionary
+                rpt.Dictionary=dic
+              }else{
+                console.log('no rpt.Dictionary')
+              }
+              jsonString=JSON.stringify(rpt)
+
               this.form.url = jsonString;
 
               console.log('保存url')
@@ -418,7 +545,17 @@
             console.log(url)
         console.log("结束");
             if (url) {
-              report.load(url)
+              var rpt = JSON.parse(url)
+              if (rpt.hasOwnProperty('Dictionary')){
+                // console.log(rpt.Dictionary.Relations)
+                 delete rpt.Dictionary.Relations
+                var dic=JSON.parse(JSON.stringify(rpt.Dictionary))
+                // delete rpt.Dictionary
+                rpt.Dictionary=dic
+              }else{
+                console.log('no rpt.Dictionary')
+              }
+              report.load(JSON.stringify(rpt))
             }
 
             // 加载文件
@@ -670,11 +807,14 @@
           })
           // 获取的数据赋值
           let data = res.data.data.data
+           let rptData = this.processRptData(data)
+
+        console.log(rptData)
 
               var dataSet = new Stimulsoft.System.Data.DataSet(
                 'reportData'
               )
-              dataSet.readJson(data)
+              dataSet.readJson(rptData)
               report.regData('reportData', 'reportData', dataSet)
               // 从模版和数据加载报表
               // loadReport(report, '', {})
@@ -732,7 +872,8 @@
           // 加载文件
           console.log("从url加载报表");
           // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
-          report.load(url)
+          var rpt=JSON.parse(url)
+          report.load(JSON.stringify(rpt))
 
 
           // 获取报表数据
@@ -752,7 +893,7 @@
                   reportCode:row.code,
                   groupCode:row.groupCode,
               }).then(res => {
-              var data = res.data.data.data
+              let data = res.data.data.data
 
               // console.log('hshipperDetails')
               // console.log(data.hshipperDetails, 'hshipperDetails')
@@ -760,109 +901,18 @@
               // var aaa = data.hshipperDetails.split('\n')
               // console.log(aaa)
 
-              data.pageOne = 'Page : 1 of 1'
+              // data.pageOne = 'Page : 1 of 1'
               // 处理超长数据
-              if (data.hshipperDetails) {
-                var consignerIndex2 = data.hshipperDetails.indexOf( '\n' )
-                for (let i = 0; i < 4; i++) {
-                  consignerIndex2 = data.hshipperDetails.indexOf( '\n', consignerIndex2 + 1 );
-                }
-                if (consignerIndex2 != -1) {
-                  var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
-                  data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
-                  data.commodityDescr += '\n*' + hshipperDetails
-                }
-              }
-
-              if (data.hconsigneeDetails) {
-                var consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n' )
-                for (let i = 0; i < 3; i++) {
-                  consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n', consigneeIndex2 + 1 );
-                }
-                if (consigneeIndex2 != -1) {
-                  var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
-                  data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
-                  data.commodityDescr += '\n**' + hconsigneeDetails
-                }
-              }
-
-              if (data.hnotifyDetails) {
-                var notifierIndex2 = data.hnotifyDetails.indexOf( '\n' )
-                for (let i = 0; i < 3; i++) {
-                  notifierIndex2 = data.hnotifyDetails.indexOf( '\n', notifierIndex2 + 1 );
-                }
-                if (notifierIndex2 != -1) {
-                  var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
-                  data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
-                  data.commodityDescr += '\n***' + hnotifyDetails
-                }
-              }
-
-              // 处理箱号
-              if (this.isPrintTheBoxNumber) {
-                data.commodityDescr += '\n.\n.\n'
-              }
-
-              // PLACE & DATE OF ISSUE
-              data.placeAndDateOfIssue = ''
-              if (data.issueAt) {
-                data.placeAndDateOfIssue += data.issueAt
-              }
-              if (data.issueDate) {
-                let date = new Date(data.issueDate.replace(/-/g,'/'));
-                let yyyy = date.getFullYear();
-                let mmmm = date.toDateString().split(" ")[1]
-                let dd = date.getDate()
-                data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
-              }
-
-              // Total number of containers or packages received by the Carriers
-              if (data.preContainersList) {
-                let boxMap = new Map();
-                for (let boxQuantity of data.preContainersList) {
-                  if (boxMap.get(boxQuantity.cntrTypeCode)) {
-                    let v = boxMap.get(boxQuantity.cntrTypeCode)
-                    boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
-                  } else {
-                    boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
-                  }
-                }
-                let boxs = ''
-                boxMap.forEach(function (value, key, map) {
-                  boxs += value + 'x' + key + ', '
-                })
-                boxs = boxs.substring(0, boxs.length - 2)
-
-                data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
-              }
-
-              // Number of original B/Ls
-              if (data.numberOfObl) {
-                data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
-              }
-
-              if (data.commodityDescr) {
-                var descriptionIndex2 = data.commodityDescr.indexOf( '\n' )
-                for (let i = 0; i < 19; i++) {
-                  descriptionIndex2 = data.commodityDescr.indexOf( '\n', descriptionIndex2 + 1 );
-                }
-                if (descriptionIndex2 != -1) {
-                  data.pageOne = 'Page : 1 of 2'
-                  data.pageTwo = 'Page : 2 of 2'
-                  var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
-                  data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
-                  data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
-                  data.extraLongText = extraLongText
-                }
-              }
 
               // console.log(data.hshipperDetails, 'hshipperDetails2')
 
+                let rptData = this.processRptData(data)
+                console.log(rptData)
 
               var dataSet = new Stimulsoft.System.Data.DataSet(
                 'reportData'
               )
-              dataSet.readJson(data)
+              dataSet.readJson(rptData)
               report.regData('reportData', 'reportData', dataSet)
             // 从模版和数据加载报表
             // loadReport(report, '', {})

部分文件因为文件数量过多而无法显示