|
|
|
@ -725,7 +725,7 @@
|
|
|
|
|
<!-- 打印弹窗 start -->
|
|
|
|
|
<a-modal
|
|
|
|
|
:zIndex="1005"
|
|
|
|
|
width="50vw"
|
|
|
|
|
width="35vw"
|
|
|
|
|
:maskClosable="false"
|
|
|
|
|
v-model:visible="PrintModalVisible"
|
|
|
|
|
title="打印"
|
|
|
|
@ -738,19 +738,28 @@
|
|
|
|
|
<TableAction
|
|
|
|
|
:actions="[
|
|
|
|
|
{
|
|
|
|
|
icon: 'clarity:note-edit-line',
|
|
|
|
|
icon: 'ant-design:file-pdf-outlined',
|
|
|
|
|
tooltip: 'pdf',
|
|
|
|
|
onClick: FnCilckTemplateType.bind(null, record),
|
|
|
|
|
onClick: FnCilckTemplateType.bind(null, {
|
|
|
|
|
templateId: record.id,
|
|
|
|
|
printType: 1,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: 'clarity:note-edit-line',
|
|
|
|
|
tooltip: 'xlsx',
|
|
|
|
|
onClick: FnCilckTemplateType.bind(null, record),
|
|
|
|
|
icon: 'ant-design:file-excel-outlined',
|
|
|
|
|
tooltip: 'excel',
|
|
|
|
|
onClick: FnCilckTemplateType.bind(null, {
|
|
|
|
|
templateId: record.id,
|
|
|
|
|
printType: 2,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: 'clarity:note-edit-line',
|
|
|
|
|
tooltip: 'docx',
|
|
|
|
|
onClick: FnCilckTemplateType.bind(null, record),
|
|
|
|
|
icon: 'ant-design:file-word-outlined',
|
|
|
|
|
tooltip: 'word',
|
|
|
|
|
onClick: FnCilckTemplateType.bind(null, {
|
|
|
|
|
templateId: record.id,
|
|
|
|
|
printType: 3,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
@ -978,7 +987,6 @@
|
|
|
|
|
handleSearchInfoFn: () => {
|
|
|
|
|
let Arr: any = []
|
|
|
|
|
var data = getForm().getFieldsValue()
|
|
|
|
|
console.log(data)
|
|
|
|
|
if (data.templateName == '') {
|
|
|
|
|
GetPrintData()
|
|
|
|
|
} else {
|
|
|
|
@ -989,13 +997,13 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
console.log(Arr)
|
|
|
|
|
dataSource.value = Arr
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
maxHeight: 400,
|
|
|
|
|
columns,
|
|
|
|
|
formConfig: {
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
labelWidth: 100,
|
|
|
|
|
schemas: searchFormSchema,
|
|
|
|
|
},
|
|
|
|
|
// 空值分页
|
|
|
|
@ -1030,12 +1038,11 @@
|
|
|
|
|
dataSource.value = [...res.data]
|
|
|
|
|
}
|
|
|
|
|
// 打印方法
|
|
|
|
|
function FnCilckTemplateType(templateId) {
|
|
|
|
|
console.log(templateId)
|
|
|
|
|
|
|
|
|
|
function FnCilckTemplateType({ templateId, printType }) {
|
|
|
|
|
notification.success({ message: '搜索文件中...', duration: 3 })
|
|
|
|
|
GetOpenJsonPrintInfo({
|
|
|
|
|
templateId,
|
|
|
|
|
printType,
|
|
|
|
|
jsonDataStr:
|
|
|
|
|
'{"GID":"52fc4ecf-5c88-49a8-aa1f-08da84ccc2d3","BILLTYPE":false,"TRUCKNO":"鲁A789","BoxWeigth":10540,"BoxCode":"A124","BoxCode2":null,"ISTwoBox":false,"CORPID":null,"CreateDate":"2023-12-22T09:55:43.0332931+08:00","CreateID":null,"Creator":null,"TURNOVERDATE":"2023-12-22T09:55:43.0333166+08:00","Modifier":null,"ModifyDate":null,"ModifyID":null,"REMARK":null}',
|
|
|
|
|
})
|
|
|
|
@ -1043,40 +1050,43 @@
|
|
|
|
|
if (!res.succeeded) {
|
|
|
|
|
notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
} else {
|
|
|
|
|
// 1.pdf; 2.xlsx; 3.doc
|
|
|
|
|
let base64ToBlob = (code) => {
|
|
|
|
|
code = code.replace(/[\n\r]/g, '') // 检查base64字符串是否符合base64编码
|
|
|
|
|
// atob() 方法用于解码使用 base-64 编码的字符串。
|
|
|
|
|
const raw = window.atob(code)
|
|
|
|
|
const rawLength = raw.length
|
|
|
|
|
const uInt8Array = new Uint8Array(rawLength)
|
|
|
|
|
for (let i = 0; i < rawLength; ++i) {
|
|
|
|
|
// 将解码后的逐个字符转换成Unicode序号,放入Unit8Array数组
|
|
|
|
|
uInt8Array[i] = raw.charCodeAt(i)
|
|
|
|
|
}
|
|
|
|
|
// 通过Blob将Uint8Array数组转换成pdf类型的文件对象
|
|
|
|
|
let type = ''
|
|
|
|
|
switch (res.data.printType) {
|
|
|
|
|
case '2':
|
|
|
|
|
type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
|
|
break
|
|
|
|
|
case '3':
|
|
|
|
|
type = 'application/msword'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
type = 'application/pdf'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
return new Blob([uInt8Array], { type })
|
|
|
|
|
}
|
|
|
|
|
// // 1.pdf; 2.excel; 3.word
|
|
|
|
|
// let base64ToBlob = (code) => {
|
|
|
|
|
// code = code.replace(/[\n\r]/g, '') // 检查base64字符串是否符合base64编码
|
|
|
|
|
// // atob() 方法用于解码使用 base-64 编码的字符串。
|
|
|
|
|
// const raw = window.atob(code)
|
|
|
|
|
// const rawLength = raw.length
|
|
|
|
|
// const uInt8Array = new Uint8Array(rawLength)
|
|
|
|
|
// for (let i = 0; i < rawLength; ++i) {
|
|
|
|
|
// // 将解码后的逐个字符转换成Unicode序号,放入Unit8Array数组
|
|
|
|
|
// uInt8Array[i] = raw.charCodeAt(i)
|
|
|
|
|
// }
|
|
|
|
|
// // 通过Blob将Uint8Array数组转换成pdf类型的文件对象
|
|
|
|
|
// let type = ''
|
|
|
|
|
// switch (res.data.printType) {
|
|
|
|
|
// case '2':
|
|
|
|
|
// type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
|
|
// break
|
|
|
|
|
// case '3':
|
|
|
|
|
// type = 'application/msword'
|
|
|
|
|
// break
|
|
|
|
|
// default:
|
|
|
|
|
// type = 'application/pdf'
|
|
|
|
|
// break
|
|
|
|
|
// }
|
|
|
|
|
// return new Blob([uInt8Array], { type })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const blob = base64ToBlob(res.data.printData)
|
|
|
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
|
|
|
|
window.navigator.msSaveOrOpenBlob(blob)
|
|
|
|
|
} else {
|
|
|
|
|
const fileURL = URL.createObjectURL(blob)
|
|
|
|
|
window.open(fileURL) //打开ppf文件
|
|
|
|
|
}
|
|
|
|
|
// const blob = base64ToBlob(res.data.printData)
|
|
|
|
|
// ''
|
|
|
|
|
// if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
|
|
|
|
// window.navigator.msSaveOrOpenBlob(blob)
|
|
|
|
|
// } else {
|
|
|
|
|
// const fileURL = URL.createObjectURL(blob)
|
|
|
|
|
// window.open(fileURL) //打开ppf文件
|
|
|
|
|
// }
|
|
|
|
|
let fileURL = `http://60.209.125.238:3009/PrintTempFile/${res.data}`
|
|
|
|
|
window.open(fileURL)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
@ -1144,13 +1154,11 @@
|
|
|
|
|
// getYardlist()
|
|
|
|
|
}
|
|
|
|
|
if (type === 'initCabin') {
|
|
|
|
|
console.log('放舱')
|
|
|
|
|
getLetterYard()
|
|
|
|
|
// BookingOrderPrintTemplateWithHistoryList({
|
|
|
|
|
// cateCode: 'fangcang',
|
|
|
|
|
// printType: 10,
|
|
|
|
|
// }).then((res) => {
|
|
|
|
|
// console.log(res.data)
|
|
|
|
|
// initCabinSendData.value = res.data
|
|
|
|
|
// })
|
|
|
|
|
} else if (type === 'ladingBill') {
|
|
|
|
@ -1288,8 +1296,6 @@
|
|
|
|
|
}
|
|
|
|
|
// 订阅运踪
|
|
|
|
|
function traceSend() {
|
|
|
|
|
console.log(props.details.yard, props.details.yardId, traceValue.value.includes('1'))
|
|
|
|
|
|
|
|
|
|
if (!traceValue.value) {
|
|
|
|
|
notification.error({ message: '请选择订阅内容', duration: 3 })
|
|
|
|
|
return false
|
|
|
|
@ -1543,7 +1549,6 @@
|
|
|
|
|
}
|
|
|
|
|
function FnGoSendCar() {
|
|
|
|
|
BookingTruckGetTruckListByBooking({ bookingId: id.value }).then((res) => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
router.push({
|
|
|
|
|
name: 'SendCarAdd',
|
|
|
|
|
query: {
|
|
|
|
@ -1554,7 +1559,6 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function FnGoExpress() {
|
|
|
|
|
console.log(id.value)
|
|
|
|
|
router.push({
|
|
|
|
|
name: 'ExpressModuleDetails',
|
|
|
|
|
query: {
|
|
|
|
|