张同海 2 years ago
commit d04de91853

@ -607,4 +607,11 @@ export function BookingOrderPrintTemplateList(parameter) {
params: parameter params: parameter
}) })
} }
//
export function LetterYardPdf(parameter) {
return axios({
url: '/BookingOrder/LetterYardPdf',
method: 'get',
params: parameter
})
}

@ -1040,7 +1040,7 @@ export default {
// - start // - start
getVoynoinner(name = '') { getVoynoinner(name = '') {
console.log('暂无接口', name, this.voynoinnerData, this.voynoinnerDataArr) // console.log('', name, this.voynoinnerData, this.voynoinnerDataArr)
}, },
voynoinnerSelect(value) { voynoinnerSelect(value) {
this.details.voynoinner = value this.details.voynoinner = value
@ -1053,7 +1053,7 @@ export default {
// 线 - start // 线 - start
getLanename(name = '') { getLanename(name = '') {
console.log('暂无接口', name, this.lanenameData, this.lanenameDataArr) // console.log('', name, this.lanenameData, this.lanenameDataArr)
}, },
lanenameSelect(value) { lanenameSelect(value) {
this.details.lanename = value this.details.lanename = value
@ -1301,6 +1301,9 @@ export default {
.table-no-data { .table-no-data {
text-align: center; text-align: center;
} }
/deep/ .date-box{
padding-top: 7px;
}
// .ant-calendar-picker-input{ // .ant-calendar-picker-input{
// padding: 0 4px; // padding: 0 4px;

@ -35,6 +35,7 @@
<a-textarea <a-textarea
id="shipper-scroll" id="shipper-scroll"
:defaultValue="details.shipper" :defaultValue="details.shipper"
v-model="showShipper"
:auto-size="{ minRows: 2, maxRows: 5 }" :auto-size="{ minRows: 2, maxRows: 5 }"
style="height: 100px" style="height: 100px"
@blur="textareaChange($event, 'shipper')" @blur="textareaChange($event, 'shipper')"
@ -74,6 +75,7 @@
<a-textarea <a-textarea
id="consignee-scroll" id="consignee-scroll"
:defaultValue="details.consignee" :defaultValue="details.consignee"
v-model="showConsignee"
:auto-size="{ minRows: 2, maxRows: 5 }" :auto-size="{ minRows: 2, maxRows: 5 }"
style="height: 100px" style="height: 100px"
@blur="textareaChange($event, 'consignee')" @blur="textareaChange($event, 'consignee')"
@ -113,6 +115,7 @@
:defaultValue="details.notifyparty" :defaultValue="details.notifyparty"
:auto-size="{ minRows: 2, maxRows: 5 }" :auto-size="{ minRows: 2, maxRows: 5 }"
style="height: 100px" style="height: 100px"
v-model="showNotifier"
@blur="textareaChange($event, 'notifyparty')" @blur="textareaChange($event, 'notifyparty')"
/> />
<div <div
@ -702,7 +705,10 @@ export default {
modelName: '', modelName: '',
yardType: '', yardType: '',
yardVisible: false, yardVisible: false,
customerModelconfirm: false customerModelconfirm: false,
showShipper: '',
showConsignee: '',
showNotifier: ''
} }
}, },
watch: { watch: {
@ -727,7 +733,7 @@ export default {
if (this.shipperData) { if (this.shipperData) {
const arr = [] const arr = []
this.shipperData.map((item, index) => { this.shipperData.map((item, index) => {
if (!arr.includes(item.title)) { if (item.title && !arr.includes(item.title)) {
arr.push(item.title) arr.push(item.title)
} }
}) })
@ -740,7 +746,7 @@ export default {
if (this.consigneeData) { if (this.consigneeData) {
const arr = [] const arr = []
this.consigneeData.map((item, index) => { this.consigneeData.map((item, index) => {
if (!arr.includes(item.title)) { if (item.title && !arr.includes(item.title)) {
arr.push(item.title) arr.push(item.title)
} }
}) })
@ -753,7 +759,7 @@ export default {
if (this.notifyData) { if (this.notifyData) {
const arr = [] const arr = []
this.notifyData.map((item, index) => { this.notifyData.map((item, index) => {
if (!arr.includes(item.title)) { if (item.title && !arr.includes(item.title)) {
arr.push(item.title) arr.push(item.title)
} }
}) })
@ -983,6 +989,8 @@ export default {
this.shippername = value this.shippername = value
const index = this.shipperDataArr.indexOf(value) const index = this.shipperDataArr.indexOf(value)
this.details.shipper = this.shipperData[index].content this.details.shipper = this.shipperData[index].content
this.showShipper = this.details.shipper
this.$forceUpdate()
}, },
shipperChange(value) { shipperChange(value) {
this.getTemplate(value, 'shipper') this.getTemplate(value, 'shipper')
@ -992,6 +1000,7 @@ export default {
this.consigneename = value this.consigneename = value
const index = this.consigneeDataArr.indexOf(value) const index = this.consigneeDataArr.indexOf(value)
this.details.consignee = this.consigneeData[index].content this.details.consignee = this.consigneeData[index].content
this.showConsignee = this.details.consignee
}, },
consigneeChange(value) { consigneeChange(value) {
this.getTemplate(value, 'consignee') this.getTemplate(value, 'consignee')
@ -1001,6 +1010,7 @@ export default {
this.notifypartyname = value this.notifypartyname = value
const index = this.notifyDataArr.indexOf(value) const index = this.notifyDataArr.indexOf(value)
this.details.notifyparty = this.notifyData[index].content this.details.notifyparty = this.notifyData[index].content
this.showNotifier = this.details.notifyparty
}, },
notifyChange(value) { notifyChange(value) {
this.getTemplate(value, 'notify') this.getTemplate(value, 'notify')
@ -1058,7 +1068,6 @@ export default {
.then(res => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
this[`${type}Data`] = res.data this[`${type}Data`] = res.data
console.log('== 装货港/收货地 ==', type, this[`${type}Data`])
this.$forceUpdate() this.$forceUpdate()
} }
}) })
@ -1405,7 +1414,6 @@ export default {
}, },
textareaChange (e, type) { textareaChange (e, type) {
this.details[type] = e.target.value this.details[type] = e.target.value
console.log(type, this.details[type])
} }
} }
} }

@ -413,6 +413,10 @@
<a-button type="primary" @click="removeModel" :loading="DelLoading" v-if="['initCabin'].includes(modelType)"> <a-button type="primary" @click="removeModel" :loading="DelLoading" v-if="['initCabin'].includes(modelType)">
删除 删除
</a-button> </a-button>
<template v-if="modelType === 'initCabin'"></template>
<a-button type="primary" @click="downLoadFile(2)" :loading="downLoadLoading">EXCEL</a-button>
<a-button type="primary" @click="downLoadFile(1)" :loading="downLoadLoading">PDF</a-button>
<a-button type="primary" @click="downLoadFile(3)" :loading="downLoadLoading">PDF</a-button>
</template> </template>
</template> </template>
</a-modal> </a-modal>
@ -511,7 +515,8 @@ import {
BookingOrderOcrGetText, BookingOrderOcrGetText,
BookingOrderPrintTemplateList, BookingOrderPrintTemplateList,
DownloadBookingOrClosingEDI, DownloadBookingOrClosingEDI,
DeleteLetterYard DeleteLetterYard,
LetterYardPdf
} from '@/api/modular/main/BookingLedger' } from '@/api/modular/main/BookingLedger'
export default { export default {
@ -601,7 +606,8 @@ export default {
BCvData: [], BCvData: [],
Rdata: '', Rdata: '',
scale: '1.5', scale: '1.5',
PrintType: '1' PrintType: '1',
downLoadLoading: false
} }
}, },
mounted() { mounted() {
@ -1238,6 +1244,31 @@ export default {
}, },
addChild() { addChild() {
this.$emit('addSedList') this.$emit('addSedList')
},
downLoadFile(type) {
this.downLoadLoading = true
LetterYardPdf({
bookingId: this.id,
type: type
})
.then(res => {
this.downLoadLoading = false
this.pdfUrl = window.URL.createObjectURL(new Blob([res], { type: 'application/pdf;charset=utf-8' }))
const fname = '放舱打印' //
const link = document.createElement('a')
link.href = this.pdfUrl
link.setAttribute('download', fname)
document.body.appendChild(link)
link.click()
if (res.message) {
this.$message.error(res.message)
}
})
.catch(() => {
this.downLoadLoading = false
this.$message.destroy()
this.$message.success({ content: '下载失败' })
})
} }
} }
} }

@ -4,12 +4,47 @@
<div class="btn-list more-view"> <div class="btn-list more-view">
<button @click="copyFun"><span class="iconfont icon-fuzhi1"></span>复制</button> <button @click="copyFun"><span class="iconfont icon-fuzhi1"></span>复制</button>
<button @click="saveFun"><span class="iconfont icon-icon_baocun"></span>保存</button> <button @click="saveFun"><span class="iconfont icon-icon_baocun"></span>保存</button>
<button><span class="iconfont icon-printing"></span></button> <button><span class="iconfont icon-printing" @click="FSnhowPrintModal"></span></button>
</div> </div>
</a-card> </a-card>
<!-- 打印弹窗 start -->
<a-modal width="50vw" :maskClosable="false" v-model="PrintModalVisible" title="打印">
<template slot="footer"> <span></span> </template>
<div class="PrintMain">
<div class="PrintTitle">
<p>默认打印格式为<span>pdf</span>,如需其他格式请选择</p>
<p>
打印格式
<a-radio-group v-model="PrintType" name="radioGroup">
<a-radio value="1">pdf</a-radio>
<a-radio value="2">xlsx</a-radio>
<a-radio value="3">docx</a-radio>
</a-radio-group>
</p>
</div>
<a-row class="PrintMainBox">
<a-col
v-for="(item, index) in templateType"
:key="item.typeCode"
@click="FnCilckTemplateType(item.typeCode)"
class="items"
:span="11"
:offset="index % 2 == 0 ? 0 : 1"
>
<span>·</span>{{ item.typeName }}
</a-col>
</a-row>
</div>
</a-modal>
<!-- 打印弹窗 end -->
</div> </div>
</template> </template>
<script> <script>
import {
BookingOrderPrintTemplateList,
BookingOrderPrint,
BookingOrderDownloadPrint
} from '@/api/modular/main/BookingLedger'
export default { export default {
props: { props: {
details: { details: {
@ -21,10 +56,18 @@ export default {
}, },
data() { data() {
return { return {
id: this.$route.query.id id: this.$route.query.id,
PrintModalVisible: false,
templateType: [],
PrintType: '1'
} }
}, },
mounted() {}, mounted() {
BookingOrderPrintTemplateList().then(res => {
console.log(res.data)
this.templateType = res.data
})
},
methods: { methods: {
refreshPage() { refreshPage() {
this.$emit('refresh') this.$emit('refresh')
@ -38,7 +81,52 @@ export default {
}, },
copyFun() { copyFun() {
this.$emit('copy') this.$emit('copy')
} },
FSnhowPrintModal() {
this.PrintModalVisible = true
debugger
},
FnCilckTemplateType(typeCode) {
this.$message.success(`搜索文件中...`)
BookingOrderPrint({ typeCode, bookingId: this.id, type: this.PrintType })
.then(res => {
if (!res.success) {
this.$message.error(res.message)
} else {
this.$message.success(`预览打印文件 ${res.data} 中...`)
let PrintType = 'pdf'
switch (this.PrintType) {
case '1':
PrintType = 'pdf'
break
case '2':
PrintType = 'xlsx'
break
default:
PrintType = 'docx'
break
}
BookingOrderDownloadPrint({ fileName: res.data }).then(res2 => {
const blob = new Blob([res2], { type: `application/${PrintType};chartset=UTF-8` })
if (this.PrintType == '1') {
window.open(URL.createObjectURL(blob), '_blank')
} else {
const link = document.createElement('a')
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
link.download = res.data
document.body.appendChild(link)
link.click()
URL.revokeObjectURL(link.href) // URL
document.body.removeChild(link)
}
})
}
})
.catch(err => {
console.log(err)
})
},
} }
} }
</script> </script>

Loading…
Cancel
Save