|
|
@ -70,6 +70,7 @@
|
|
|
|
GetOpenJsonPrintInfo,
|
|
|
|
GetOpenJsonPrintInfo,
|
|
|
|
GetOpenSqlPrintInfo,
|
|
|
|
GetOpenSqlPrintInfo,
|
|
|
|
} from '/@/views/operation/seaexport/api/BookingLedger.js'
|
|
|
|
} from '/@/views/operation/seaexport/api/BookingLedger.js'
|
|
|
|
|
|
|
|
import { GetList, GetPrintInfo } from '../CostEntry/api'
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
const props = defineProps({
|
|
|
|
const props = defineProps({
|
|
|
@ -124,7 +125,10 @@
|
|
|
|
// 组件初始化接口 (接收打印的数据list)
|
|
|
|
// 组件初始化接口 (接收打印的数据list)
|
|
|
|
const ids = ref()
|
|
|
|
const ids = ref()
|
|
|
|
const printModalRef = ref('')
|
|
|
|
const printModalRef = ref('')
|
|
|
|
|
|
|
|
// 传入的打印数据
|
|
|
|
|
|
|
|
const printData = ref([])
|
|
|
|
const init = (v) => {
|
|
|
|
const init = (v) => {
|
|
|
|
|
|
|
|
printData.value = v
|
|
|
|
visible.value = true
|
|
|
|
visible.value = true
|
|
|
|
if (v) {
|
|
|
|
if (v) {
|
|
|
|
// 储存选中的ids
|
|
|
|
// 储存选中的ids
|
|
|
@ -145,17 +149,17 @@
|
|
|
|
ConditionalList: [
|
|
|
|
ConditionalList: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Key: 1,
|
|
|
|
Key: 1,
|
|
|
|
Value: { FieldName: 'carrierId', FieldValue: props.cid, ConditionalType: 0 },
|
|
|
|
Value: { FieldName: 'carrierId', FieldValue: props.cid, ConditionalType: 0 }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Key: 1,
|
|
|
|
Key: 1,
|
|
|
|
Value: { FieldName: 'carrierId', FieldValue: 0, ConditionalType: 11 },
|
|
|
|
Value: { FieldName: 'carrierId', FieldValue: 0, ConditionalType: 11 }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
|
|
|
]
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
|
|
|
]
|
|
|
|
},
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
// if (temCodes.length) {
|
|
|
|
// if (temCodes.length) {
|
|
|
|
// const ConditionalList = {
|
|
|
|
// const ConditionalList = {
|
|
|
@ -211,63 +215,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
// 跳转打印
|
|
|
|
// 跳转打印
|
|
|
|
const toPrint = (item, type) => {
|
|
|
|
const toPrint = (item, type) => {
|
|
|
|
if (item.isUseDataSource) {
|
|
|
|
// 如果是业务联系单并且没有传入打印数据,在主单页面打印
|
|
|
|
const userStore = useUserStore()
|
|
|
|
if (item.templateCode == 'BOOKING' && !printData.value) {
|
|
|
|
const postData = {
|
|
|
|
const postData = {
|
|
|
|
printType: type,
|
|
|
|
pageCondition: {
|
|
|
|
templateId: item.id,
|
|
|
|
pageIndex: 1,
|
|
|
|
paramJsonStr: props.paramJsonStr,
|
|
|
|
pageSize: 1000,
|
|
|
|
templateCode: item.templateCode,
|
|
|
|
sortConditions: [],
|
|
|
|
tenantId: userStore.getUserInfo.tenantId,
|
|
|
|
},
|
|
|
|
|
|
|
|
queryCondition: JSON.stringify([
|
|
|
|
|
|
|
|
{ FieldName: 'BusinessId', FieldValue: props.bookingData.id, ConditionalType: 1 },
|
|
|
|
|
|
|
|
]),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 费用打印:paramJsonStr 需要传窜中的费用的id集合
|
|
|
|
GetList(postData).then((res) => {
|
|
|
|
if (item.templateCode == 'fee') {
|
|
|
|
const ids = res.data.map(item => {
|
|
|
|
postData.paramJsonStr = JSON.stringify({ ids: ids.value })
|
|
|
|
return item.id
|
|
|
|
}
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
|
|
GetOpenSqlPrintInfo(postData)
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}`
|
|
|
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
|
|
|
// window.open(fileURL)
|
|
|
|
|
|
|
|
printModalRef.value.init(fileURL, res.data)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
createMessage.error(res.message)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
GetPrintInfo({ businessType: 1, ids, id: props.bookingData.id }).then(res => {
|
|
|
|
loading.value = false
|
|
|
|
const postData = {
|
|
|
|
|
|
|
|
jsonDataStr: JSON.stringify(res.data.details) || '',
|
|
|
|
|
|
|
|
printType: type,
|
|
|
|
|
|
|
|
templateId: item.id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
|
|
GetOpenJsonPrintInfo(postData)
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}`
|
|
|
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
|
|
|
printModalRef.value.init(fileURL, res.data)
|
|
|
|
|
|
|
|
// window.open(fileURL)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
createMessage.error(res.message)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const postData = {
|
|
|
|
if (item.isUseDataSource) {
|
|
|
|
jsonDataStr: jsonDataStr.value || '',
|
|
|
|
const userStore = useUserStore()
|
|
|
|
printType: type,
|
|
|
|
const postData = {
|
|
|
|
templateId: item.id,
|
|
|
|
printType: type,
|
|
|
|
}
|
|
|
|
templateId: item.id,
|
|
|
|
loading.value = true
|
|
|
|
paramJsonStr: props.paramJsonStr,
|
|
|
|
GetOpenJsonPrintInfo(postData)
|
|
|
|
templateCode: item.templateCode,
|
|
|
|
.then((res) => {
|
|
|
|
tenantId: userStore.getUserInfo.tenantId,
|
|
|
|
loading.value = false
|
|
|
|
}
|
|
|
|
if (res.succeeded) {
|
|
|
|
// 费用打印:paramJsonStr 需要传窜中的费用的id集合
|
|
|
|
let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}`
|
|
|
|
if (item.templateCode == 'fee') {
|
|
|
|
if (type == 1) {
|
|
|
|
postData.paramJsonStr = JSON.stringify({ ids: ids.value })
|
|
|
|
printModalRef.value.init(fileURL, res.data)
|
|
|
|
}
|
|
|
|
// window.open(fileURL)
|
|
|
|
loading.value = true
|
|
|
|
|
|
|
|
GetOpenSqlPrintInfo(postData)
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}`
|
|
|
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
|
|
|
// window.open(fileURL)
|
|
|
|
|
|
|
|
printModalRef.value.init(fileURL, res.data)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank')
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank')
|
|
|
|
createMessage.error(res.message)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
})
|
|
|
|
createMessage.error(res.message)
|
|
|
|
.catch(() => {
|
|
|
|
}
|
|
|
|
loading.value = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
} else {
|
|
|
|
loading.value = false
|
|
|
|
const postData = {
|
|
|
|
})
|
|
|
|
jsonDataStr: jsonDataStr.value || '',
|
|
|
|
|
|
|
|
printType: type,
|
|
|
|
|
|
|
|
templateId: item.id,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
|
|
GetOpenJsonPrintInfo(postData)
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}`
|
|
|
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
|
|
|
printModalRef.value.init(fileURL, res.data)
|
|
|
|
|
|
|
|
// window.open(fileURL)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
createMessage.error(res.message)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|