|
@@ -21,7 +21,7 @@
|
|
|
@on-load="onLoad">
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
<el-link type="primary" :disabled="scope.row.status == 1"
|
|
|
- @click="handleReportPreview(scope.row.url,scope.row)">预览报表</el-link>
|
|
|
+ @click="reportsGetReportDatafun(scope.row.url,scope.row)">预览报表</el-link>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<reportContainer ref="reportContainer"></reportContainer>
|
|
@@ -508,9 +508,18 @@
|
|
|
()=>{},
|
|
|
)
|
|
|
},
|
|
|
+ // 打印报表获取数据
|
|
|
+ reportsGetReportDatafun(url,row){
|
|
|
+ reportsGetReportData({
|
|
|
+ billId:this.id,
|
|
|
+ reportCode:row.classifyCode,
|
|
|
+ groupCode:row.groupCode,
|
|
|
+ }).then(res=>{
|
|
|
+ this.handleReportPreview(url,res.data.data.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 预览报表
|
|
|
handleReportPreview(url,row){
|
|
|
- console.log(row,698)
|
|
|
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')
|
|
@@ -553,150 +562,120 @@
|
|
|
|
|
|
|
|
|
// 获取报表数据
|
|
|
- // const res = await reportsGetReportData({
|
|
|
- // billId:this.id,
|
|
|
- // reportCode:this.form.code,
|
|
|
- // groupCode:this.form.groupCode,
|
|
|
- // })
|
|
|
- // // 获取的数据赋值
|
|
|
- // let data = res.data.data.data
|
|
|
-
|
|
|
- // 加载数据
|
|
|
- if (this.id) {
|
|
|
- // billsDetail(this.id).then(res => {
|
|
|
- reportsGetReportData({
|
|
|
- billId:this.id,
|
|
|
- reportCode:row.code,
|
|
|
- groupCode:row.groupCode,
|
|
|
- }).then(res => {
|
|
|
- var data = res.data.data.data.map((item,index)=>{
|
|
|
- item.index = index
|
|
|
- item.feeCenterList.forEach(ite=>{
|
|
|
- ite.ppid = index
|
|
|
- })
|
|
|
- return item
|
|
|
- })
|
|
|
- console.log(data,762)
|
|
|
- // console.log(data.hshipperDetails, 'hshipperDetails')
|
|
|
-
|
|
|
- // var aaa = data.hshipperDetails.split('\n')
|
|
|
- // console.log(aaa)
|
|
|
-
|
|
|
- data.pageOne = 'Page : 1 of 1'
|
|
|
- // 处理超长数据
|
|
|
- if (data.hshipperDetails) {
|
|
|
- var consignerIndex2 = data.hshipperDetails.indexOf( '\n' )
|
|
|
- for (let i = 0; i < 4; i++) {
|
|
|
+ var data = row
|
|
|
+ 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) {
|
|
|
+ }
|
|
|
+ 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++) {
|
|
|
+ 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) {
|
|
|
+ }
|
|
|
+ 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++) {
|
|
|
+ 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) {
|
|
|
+ }
|
|
|
+ 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'
|
|
|
- }
|
|
|
+ // 处理箱号
|
|
|
+ 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
|
|
|
- }
|
|
|
+ // 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) {
|
|
|
+ // 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)
|
|
|
+ let v = boxMap.get(boxQuantity.cntrTypeCode)
|
|
|
+ boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
|
|
|
} else {
|
|
|
- boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
|
|
|
+ boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
|
|
|
}
|
|
|
- }
|
|
|
- let boxs = ''
|
|
|
- boxMap.forEach(function (value, key, map) {
|
|
|
+ }
|
|
|
+ let boxs = ''
|
|
|
+ boxMap.forEach(function (value, key, map) {
|
|
|
boxs += value + 'x' + key + ', '
|
|
|
- })
|
|
|
- boxs = boxs.substring(0, boxs.length - 2)
|
|
|
+ })
|
|
|
+ boxs = boxs.substring(0, boxs.length - 2)
|
|
|
|
|
|
- data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
|
|
|
- }
|
|
|
+ data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
|
|
|
+ }
|
|
|
|
|
|
- // Number of original B/Ls
|
|
|
- if (data.numberOfObl) {
|
|
|
- data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
|
|
|
- }
|
|
|
+ // 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++) {
|
|
|
+ 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) {
|
|
|
+ }
|
|
|
+ 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')
|
|
|
+ // console.log(data.hshipperDetails, 'hshipperDetails2')
|
|
|
|
|
|
|
|
|
- // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
|
|
|
- var dataSet = new Stimulsoft.System.Data.DataSet(
|
|
|
- 'reportData'
|
|
|
- )
|
|
|
+ // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
|
|
|
+ var dataSet = new Stimulsoft.System.Data.DataSet(
|
|
|
+ 'reportData'
|
|
|
+ )
|
|
|
|
|
|
- dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
|
|
|
- // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
|
|
|
- // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
|
|
|
- report.regData('reportData', 'reportData', dataSet)
|
|
|
- // 从模版和数据加载报表
|
|
|
- // loadReport(report, '', {})
|
|
|
+ dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
|
|
|
+ // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
|
|
|
+ // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
|
|
|
+ report.regData('reportData', 'reportData', dataSet)
|
|
|
+ // 从模版和数据加载报表
|
|
|
+ // loadReport(report, '', {})
|
|
|
|
|
|
- // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
|
|
|
- viewer.report = report;
|
|
|
- })
|
|
|
- }
|
|
|
+ // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
|
|
|
+ viewer.report = report;
|
|
|
|
|
|
|
|
|
this.$refs.reportContainer.showContainer(
|