|
@@ -402,6 +402,10 @@
|
|
|
// console.log(jsonString)
|
|
|
this.form.url = jsonString;
|
|
|
|
|
|
+ console.log('保存url')
|
|
|
+ console.log(jsonString)
|
|
|
+ console.log('保存url结束')
|
|
|
+
|
|
|
}
|
|
|
|
|
|
let report = new window.Stimulsoft.Report.StiReport();
|
|
@@ -411,120 +415,250 @@
|
|
|
|
|
|
|
|
|
console.log("从 url 报表");
|
|
|
+ console.log(url)
|
|
|
+ console.log("结束");
|
|
|
if (url) {
|
|
|
report.load(url)
|
|
|
}
|
|
|
|
|
|
// 加载文件
|
|
|
- if (this.id) {
|
|
|
- billsDetail(this.id).then(res => {
|
|
|
- var data = res.data.data
|
|
|
- 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'
|
|
|
- }
|
|
|
+ // if (this.id) {
|
|
|
+ // billsDetail(this.id).then(res => {
|
|
|
+ // var data = res.data.data
|
|
|
+ // 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
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // var dataSet = new Stimulsoft.System.Data.DataSet(
|
|
|
+ // 'reportData'
|
|
|
+ // )
|
|
|
+ // dataSet.readJson(data)
|
|
|
+ // report.regData('reportData', 'reportData', dataSet)
|
|
|
+ // // 从模版和数据加载报表
|
|
|
+ // // loadReport(report, '', {})
|
|
|
+ //
|
|
|
+ // designer.report = report
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ let data = [
|
|
|
+ {
|
|
|
+ billNo: 'JOB NO',
|
|
|
+ billDate: 'DATE',
|
|
|
+ operatorName: 'OP',
|
|
|
+ bookingNo: 'bookingNo',
|
|
|
+ mblno: 'ob/l no',
|
|
|
+ carrierCnName: 'CARRIER',
|
|
|
+ polCnName: 'POL',
|
|
|
+ vesselCnName: 'vsl/voy',
|
|
|
+ voyageNo: 'vsl/voy',
|
|
|
+ podCnName: 'POD',
|
|
|
+ cyCnName: 'DEPOT',
|
|
|
+ etd: 'etd/eta',
|
|
|
+ eta: 'etd/eta',
|
|
|
+ mpaymode: 'freight / freight',
|
|
|
+ volume: '箱型箱量',
|
|
|
+
|
|
|
+ hblno: 'hb/l no',
|
|
|
+ srcType: 'analysis1',
|
|
|
+ srcCnName: 'analysis2',
|
|
|
+ corpCnName: 'analysis3',
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ feeCnNameData: 'fee list1',
|
|
|
+ usd: 'usd',
|
|
|
+ rmb: 'rmb',
|
|
|
+ tr: '税',
|
|
|
+ corpCnName: 'customer',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ feeCnNameData: 'fee list2',
|
|
|
+ usd: 'usd',
|
|
|
+ rmb: 'rmb',
|
|
|
+ tr: '税',
|
|
|
+ corpCnName: 'customer',
|
|
|
+ },
|
|
|
+ ]
|
|
|
+
|
|
|
+ }, {
|
|
|
+ billNo: 'JOB NO',
|
|
|
+ billDate: 'DATE',
|
|
|
+ operatorName: 'OP',
|
|
|
+ bookingNo: 'bookingNo',
|
|
|
+ mblno: 'ob/l no',
|
|
|
+ carrierCnName: 'CARRIER',
|
|
|
+ polCnName: 'POL',
|
|
|
+ vesselCnName: 'vsl/voy',
|
|
|
+ voyageNo: 'vsl/voy',
|
|
|
+ podCnName: 'POD',
|
|
|
+ cyCnName: 'DEPOT',
|
|
|
+ etd: 'etd/eta',
|
|
|
+ eta: 'etd/eta',
|
|
|
+ mpaymode: 'freight / freight',
|
|
|
+ volume: '箱型箱量',
|
|
|
+
|
|
|
+ hblno: 'hb/l no',
|
|
|
+ srcType: 'analysis1',
|
|
|
+ srcCnName: 'analysis2',
|
|
|
+ corpCnName: 'analysis3',
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ feeCnNameData: 'fee list',
|
|
|
+ usd: 'usd',
|
|
|
+ rmb: 'rmb',
|
|
|
+ tr: '税',
|
|
|
+ corpCnName: 'customer',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ feeCnNameData: 'fee list',
|
|
|
+ usd: 'usd',
|
|
|
+ rmb: 'rmb',
|
|
|
+ tr: '税',
|
|
|
+ corpCnName: 'customer',
|
|
|
+ },
|
|
|
+ ]
|
|
|
+
|
|
|
+ }, {
|
|
|
+ billNo: 'JOB NO',
|
|
|
+ billDate: 'DATE',
|
|
|
+ operatorName: 'OP',
|
|
|
+ bookingNo: 'bookingNo',
|
|
|
+ mblno: 'ob/l no',
|
|
|
+ carrierCnName: 'CARRIER',
|
|
|
+ polCnName: 'POL',
|
|
|
+ vesselCnName: 'vsl/voy',
|
|
|
+ voyageNo: 'vsl/voy',
|
|
|
+ podCnName: 'POD',
|
|
|
+ cyCnName: 'DEPOT',
|
|
|
+ etd: 'etd/eta',
|
|
|
+ eta: 'etd/eta',
|
|
|
+ mpaymode: 'freight / freight',
|
|
|
+ volume: '箱型箱量',
|
|
|
+
|
|
|
+ hblno: 'hb/l no',
|
|
|
+ srcType: 'analysis1',
|
|
|
+ srcCnName: 'analysis2',
|
|
|
+ corpCnName: 'analysis3',
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ feeCnNameData: 'fee list',
|
|
|
+ usd: 'usd',
|
|
|
+ rmb: 'rmb',
|
|
|
+ tr: '税',
|
|
|
+ corpCnName: 'customer',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ feeCnNameData: 'fee list',
|
|
|
+ usd: 'usd',
|
|
|
+ rmb: 'rmb',
|
|
|
+ tr: '税',
|
|
|
+ corpCnName: 'customer',
|
|
|
+ },
|
|
|
+ ]
|
|
|
|
|
|
- // 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
|
|
|
- }
|
|
|
- }
|
|
|
- var dataSet = new Stimulsoft.System.Data.DataSet(
|
|
|
- 'reportData'
|
|
|
- )
|
|
|
- dataSet.readJson(data)
|
|
|
- report.regData('reportData', 'reportData', dataSet)
|
|
|
- // 从模版和数据加载报表
|
|
|
- // loadReport(report, '', {})
|
|
|
+ var dataSet = new Stimulsoft.System.Data.DataSet(
|
|
|
+ 'reportData'
|
|
|
+ )
|
|
|
+ dataSet.readJson(data)
|
|
|
+ report.regData('reportData', 'reportData', dataSet)
|
|
|
+ // 从模版和数据加载报表
|
|
|
+ // loadReport(report, '', {})
|
|
|
|
|
|
- designer.report = report
|
|
|
- })
|
|
|
- }
|
|
|
+ designer.report = report
|
|
|
|
|
|
this.designer=designer
|
|
|
|