|
@@ -111,7 +111,7 @@
|
|
|
|
|
|
<!-- 操作 -->
|
|
|
<span slot="operationSlot" slot-scope="text, record">
|
|
|
- <a @click="settlementExinvoicePrint(record)" style="color:green;">结汇发票打印</a>
|
|
|
+ <a @click="handleExportXls(record)" style="color:green;">结汇发票打印</a>
|
|
|
<a-divider type="vertical" />
|
|
|
|
|
|
<a-dropdown>
|
|
@@ -148,6 +148,8 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
import moment from 'moment'
|
|
|
|
|
|
+import { downFile } from '@/api/manage'
|
|
|
+
|
|
|
import addBookDrawer from '@views/book/addBookDrawer.vue'
|
|
|
import detailsBookDrawer from '@views/book/detailsBookDrawer.vue'
|
|
|
import editBookDrawer from '@views/book/editBookDrawer.vue'
|
|
@@ -310,18 +312,31 @@ export default {
|
|
|
|
|
|
// -----------------------------------
|
|
|
// 结汇发票打印
|
|
|
- settlementExinvoicePrint(record) {
|
|
|
+ handleExportXls(record) {
|
|
|
+
|
|
|
var exinvoiceArr = ['报关信息-发票','报关信息-报关单']
|
|
|
+
|
|
|
exinvoiceArr.map(item =>{
|
|
|
- settlement({id:record.id,testName:item}).then(res => {
|
|
|
- if(res.success){
|
|
|
- this.$message.success('导出成功成功')
|
|
|
- }else {
|
|
|
- this.$message.error(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
+ downFile('/syShippingOrder/syShippingOrder/syShippingOrderPrint',{id:record.id,testName:'报关信息-发票'}).then(data => {
|
|
|
+ if (!data) {
|
|
|
+ this.$message.warning('文件下载失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), '报关信息-发票' + '.xlsx')
|
|
|
+ } else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', '报关信息-发票' + '.xlsx')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
+ }
|
|
|
+ })
|
|
|
+})
|
|
|
},
|
|
|
// 上传附件
|
|
|
accessoryUpload() {},
|