|
@@ -7,6 +7,12 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
+ <el-button size="small" style="margin-right: 8px"
|
|
|
+ :loading="saveLoading" :disabled="!form.id" @click="previewreportfun" >预 览
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" style="margin-right: 8px"
|
|
|
+ :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true" >报表设计
|
|
|
+ </el-button>
|
|
|
<el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id" v-if="form.status == 3"
|
|
|
:loading="saveLoading" @click="revokeFinInvoicesApprovefun">撤销
|
|
|
</el-button>
|
|
@@ -534,6 +540,33 @@
|
|
|
</el-card>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!--设计报表弹窗-->
|
|
|
+ <el-dialog append-to-body title="设计报表" class="el-dialogDeep" :visible.sync="DesignreportDialog" width="70%"
|
|
|
+ :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
|
|
|
+ <reports :id="form.id" :assemblyForm="form" businessValue="FPSQ"></reports>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!--预览-->
|
|
|
+ <el-dialog
|
|
|
+ title="打印"
|
|
|
+ :visible.sync="selectPrintingDialog"
|
|
|
+ append-to-body
|
|
|
+ width="70%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-dialog-drag>
|
|
|
+ <div>
|
|
|
+ <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="selectPrintingDialog = false;">取 消</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!--报表组件-->
|
|
|
+ <reportContainer ref="reportContainer"></reportContainer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -556,11 +589,17 @@ import {
|
|
|
} from "@/api/iosBasicData/fininvoices";
|
|
|
import {getWorkDicts} from "@/api/system/dictbiz";
|
|
|
import {getCurrentDate} from "@/util/date";
|
|
|
+import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
|
|
|
+import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
|
|
|
+import {getList as getreportsList, reportsGetReportData} from "@/api/iosBasicData/reports";
|
|
|
+import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
|
|
|
|
|
|
export default {
|
|
|
- components:{ SearchQuery, fininvoicesitems,fininvoiceitemdetail},
|
|
|
+ components:{reportContainer, reportformsList, reports, SearchQuery, fininvoicesitems,fininvoiceitemdetail},
|
|
|
data() {
|
|
|
return {
|
|
|
+ DesignreportDialog:false, // 设计报表弹窗
|
|
|
+ selectPrintingDialog:false, // 预览报表
|
|
|
invoiceAmountCNY:0, // 费用明细开票金额输入框CNY
|
|
|
invoiceAmountUSD:0, // 费用明细开票金额输入框USD
|
|
|
statusType:false, // 是否已经提交
|
|
@@ -652,6 +691,46 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ // 打印
|
|
|
+ reportRadio(val){
|
|
|
+ // 获取报表数据
|
|
|
+ reportsGetReportData({
|
|
|
+ billId:this.form.id,
|
|
|
+ reportCode:val.classifyCode,
|
|
|
+ groupCode:val.groupCode,
|
|
|
+ type:'FPSQ'
|
|
|
+ }).then(res=>{
|
|
|
+ this.handleReportPreview(val.url,res.data.data.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 报表预览
|
|
|
+ previewreportfun(){
|
|
|
+ getreportsList(1,10,{
|
|
|
+ businessType:'FPSQ',
|
|
|
+ // classifyCode:'结算中心',
|
|
|
+ // groupCode:'付费结算'
|
|
|
+ }).then(res=>{
|
|
|
+ if (res.data.data.records.length == 1){
|
|
|
+ this.reportRadio(res.data.data.records[0])
|
|
|
+ }else {
|
|
|
+ this.saveLoading = true
|
|
|
+ this.selectPrintingDialog = true
|
|
|
+ this.saveLoading = false
|
|
|
+ let page = {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ }
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$refs.reportformsList.onLoad(page,{
|
|
|
+ businessType:'FPSQ',
|
|
|
+ // classifyCode:'结算中心',
|
|
|
+ // groupCode:'付费结算'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 开票明细编辑完成保存
|
|
|
invoiceSavefun(row){
|
|
|
row.amountRate = this.form.taxRate
|
|
@@ -1258,6 +1337,231 @@ export default {
|
|
|
this.serverData = res.data.data;
|
|
|
})
|
|
|
},
|
|
|
+ // 预览报表
|
|
|
+ handleReportPreview(url,data){
|
|
|
+ console.log(url,1670)
|
|
|
+ console.log(data,1671)
|
|
|
+ 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' )
|
|
|
+ // 工具栏
|
|
|
+ var options = new Stimulsoft.Viewer.StiViewerOptions()
|
|
|
+ options.height = '100%'
|
|
|
+ options.appearance.scrollbarsMode = true // 滚动条模式
|
|
|
+ options.toolbar.showDesignButton = false // 显示设计按钮
|
|
|
+ options.toolbar.showAboutButton = false // 显示关于按钮
|
|
|
+ options.toolbar.showResourcesButton = false // 显示资源按钮
|
|
|
+ options.toolbar.showFullScreenButton = false // 显示全屏按钮
|
|
|
+ options.toolbar.showOpenButton = false // 显示打开按钮
|
|
|
+ options.appearance.showTooltips = false // 显示工具提示
|
|
|
+ options.appearance.showDialogsHelp = false // 显示对话框帮助
|
|
|
+ options.exports.showExportToDocument = false // 显示导出到文档
|
|
|
+ options.toolbar.showParametersButton = true // 显示参数按钮
|
|
|
+ options.appearance.bookmarksPrint = true // 书签打印
|
|
|
+ // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
|
|
|
+
|
|
|
+ // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
|
|
|
+ // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
|
|
|
+ // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
|
|
|
+ options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
|
|
|
+ // htmlRenderMode html渲染模式
|
|
|
+ options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
|
|
|
+ // 是创建一个 Stimulsoft 报表查看器的实例的代码
|
|
|
+ let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
|
|
|
+
|
|
|
+ // 报表
|
|
|
+ console.log("创建一个报表实例");
|
|
|
+ console.log()
|
|
|
+ let report = new window.Stimulsoft.Report.StiReport();
|
|
|
+
|
|
|
+ // 加载文件
|
|
|
+ console.log("从url加载报表");
|
|
|
+ // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
|
|
|
+ report.load(url)
|
|
|
+
|
|
|
+ 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')
|
|
|
+
|
|
|
+ // 创建一个 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, '', {})
|
|
|
+
|
|
|
+ // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
|
|
|
+ viewer.report = report;
|
|
|
+
|
|
|
+ this.$refs.reportContainer.showContainer(
|
|
|
+ ()=> {
|
|
|
+ setTimeout(() => {
|
|
|
+ viewer.renderHtml('reportContainer')
|
|
|
+ this.createViewerButtons(viewer)
|
|
|
+ }, 50)
|
|
|
+ },
|
|
|
+ ()=>{
|
|
|
+ },
|
|
|
+ )
|
|
|
+ console.log("加载成功完成!");
|
|
|
+ },
|
|
|
+ createViewerButtons (viewer){
|
|
|
+ viewer.jsObject.collections.images['myClose.png'] =
|
|
|
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
|
|
|
+ const closeBtn = viewer.jsObject.SmallButton(
|
|
|
+ 'closeBtn',
|
|
|
+ '关闭',
|
|
|
+ 'myClose.png'
|
|
|
+ )
|
|
|
+ // 增加打印弹窗配置
|
|
|
+ const printBtn = viewer.jsObject.SmallButton(
|
|
|
+ 'printBtn',
|
|
|
+ '打印报表',
|
|
|
+ 'myClose.png'
|
|
|
+ )
|
|
|
+ // console.log(viewer.jsObject.print(),'1013')
|
|
|
+ // 获取 关闭按钮的dom元素位置
|
|
|
+ const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
|
|
|
+ const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
|
|
|
+ const userButtonCell = buttonsTable.rows[0].insertCell(0)
|
|
|
+ // 获取打印按钮的位置
|
|
|
+ const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
|
|
|
+ const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
|
|
|
+
|
|
|
+
|
|
|
+ userButtonPrint.addEventListener("click", (event)=>{
|
|
|
+ console.log("打印点击");
|
|
|
+ // event.preventDefault()
|
|
|
+ });
|
|
|
+ userButtonPrint.addEventListener("mouseover", (event) => {
|
|
|
+ console.log("移入打印按钮");
|
|
|
+ console.log(event,1035)
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ userButtonCell.className = 'stiJsViewerClearAllStyles'
|
|
|
+ userButtonCell.appendChild(closeBtn) // 添加关闭节点
|
|
|
+
|
|
|
+ // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
|
|
|
+
|
|
|
+
|
|
|
+ let that=this
|
|
|
+ // 关闭按钮的监听点击
|
|
|
+ closeBtn.action = function() {
|
|
|
+ console.log(that.$refs.ReportContainer,'1022')
|
|
|
+ if (that.$refs.reportContainer)
|
|
|
+ that.$refs.reportContainer.hideContainer()
|
|
|
+ }
|
|
|
+
|
|
|
+ // // // 打印按钮监听
|
|
|
+ // printBtn.action = (e)=>{
|
|
|
+ // console.log('打印')
|
|
|
+ // window.print()
|
|
|
+ // }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
|
|
|
},
|
|
|
}
|