张同海 2 years ago
commit bc1afe93e6

@ -512,3 +512,23 @@ export function BookingOrderContactPage(parameter) {
params: parameter
})
}
/**
* 下载附件
* @params id
*/
export function BookingOrderGetFile(parameter) {
return axios({
url: '/BookingOrder/GetFile',
method: 'get',
params: parameter
})
}
export function BookingOrderDownload(parameter) {
return axios({
url: '/BookingOrder/Download',
method: 'get',
params: parameter
})
}

@ -228,7 +228,7 @@ export default {
<a-select
show-search
value={row['weightype']}
placeholder="请输入箱型"
placeholder="请输入称重方式"
option-filter-prop="children"
style="width: 120px"
on-change={val => {

@ -22,7 +22,7 @@
<a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('shipper')"
>保存</a-button
>
<div class="right">
<div class="right" >
<span class="btn-circle" @click="spliceMore('shipper')">*</span>
<span class="btn" @click="changeCode(35, 'shipper')">35</span>
<span class="btn" @click="changeCode(40, 'shipper')">40</span>
@ -31,12 +31,13 @@
</div>
<div class="bottom">
<a-textarea
id="shipper-scroll"
v-model="details.shipper"
placeholder="请输入内容"
:auto-size="{ minRows: 2, maxRows: 6 }"
style="height: 130px"
/>
<div class="line-count" v-if="Object.keys(details).length > 1 && details.shipper.length > 1">
<div class="line-count" id="shipper-scroll-right" v-if="Object.keys(details).length > 1 && details.shipper.length > 1">
<div v-for="(num, index) in details.shipper.split('\n')" :key="index">{{ num.length }}</div>
</div>
</div>
@ -65,12 +66,13 @@
</div>
<div class="bottom">
<a-textarea
id="consignee-scroll"
v-model="details.consignee"
placeholder="请输入内容"
:auto-size="{ minRows: 2, maxRows: 6 }"
style="height: 130px"
/>
<div class="line-count" v-if="Object.keys(details).length > 1 && details.consignee.length > 1">
<div class="line-count" id="consignee-scroll-right" v-if="Object.keys(details).length > 1 && details.consignee.length > 1">
<div v-for="(num, index) in details.consignee.split('\n')" :key="index">{{ num.length }}</div>
</div>
</div>
@ -99,12 +101,13 @@
</div>
<div class="bottom">
<a-textarea
id="notifyparty-scroll"
v-model="details.notifyparty"
placeholder="请输入内容"
:auto-size="{ minRows: 2, maxRows: 6 }"
style="height: 130px"
/>
<div class="line-count" v-if="Object.keys(details).length > 1 && details.notifyparty.length > 1">
<div class="line-count" id="notifyparty-scroll-right" v-if="Object.keys(details).length > 1 && details.notifyparty.length > 1">
<div v-for="(num, index) in details.notifyparty.split('\n')" :key="index">{{ num.length }}</div>
</div>
</div>
@ -866,6 +869,20 @@ export default {
created() {
this.init()
},
mounted () {
const shipperScroll = document.getElementById('shipper-scroll')
shipperScroll.addEventListener('scroll', () => {
document.getElementById('shipper-scroll-right').scrollTop = shipperScroll.scrollTop
})
const consigneeScroll = document.getElementById('consignee-scroll')
consigneeScroll.addEventListener('scroll', () => {
document.getElementById('consignee-scroll-right').scrollTop = consigneeScroll.scrollTop
})
const notifypartyScroll = document.getElementById('notifyparty-scroll')
notifypartyScroll.addEventListener('scroll', () => {
document.getElementById('notifyparty-scroll-right').scrollTop = notifypartyScroll.scrollTop
})
},
methods: {
// ========== ==========
changeYard(type) {
@ -1456,6 +1473,11 @@ export default {
.line-count {
width: 24px;
padding-top: 10px;
height: 130px;
overflow: auto;
&::-webkit-scrollbar {
display: none;
}
// max-height: 192px;
// overflow-y: auto;
div {

@ -516,6 +516,7 @@ export default {
this.$message.success(`搜索文件中...`)
BookingOrderPrint({ typeCode, bookingId: this.id })
.then(res => {
debugger
console.log(res)
if (!res.success) {
this.$message.error(res.message)

@ -68,7 +68,7 @@
<i class="iconfont icon-file-word" v-else></i>
{{ file.fileName }}
</span>
<span class="right"><i class="iconfont icon-yulan"></i><i class="iconfont icon-arrow-"></i></span>
<span class="right"><i class="iconfont icon-yulan" @click="getFileFun(file)"></i><i class="iconfont icon-arrow-"></i></span>
</div>
<div class="bottom">
<span><i class="iconfont icon-leixing"></i>{{ file.typeName }}</span>
@ -206,7 +206,7 @@
</div>
</template>
<script>
import { GetRemark, AddRemark, GetFile, GetBookingLog, GetLog, AddFile } from '@/api/modular/main/BookingLedger'
import { GetRemark, AddRemark, GetFile, GetBookingLog, GetLog, AddFile, BookingOrderGetFile, BookingOrderDownload } from '@/api/modular/main/BookingLedger'
export default {
name: '',
@ -384,6 +384,33 @@ export default {
this.$message.error(err.message)
})
},
getFileFun (data) {
BookingOrderGetFile({ id: data.id })
.then(res => {
console.log(res)
if (!res.success) {
this.$message.error(res.message)
} else {
this.$message.success(`下载打印文件 ${data.fileName} 中...`)
BookingOrderDownload({ id: res.data }).then(res2 => {
const blob = new Blob([res2], { type: 'application/pdf;chartset=UTF-8' })
const exportName = data.fileName
const link = document.createElement('a')
link.download = exportName
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
link.setAttribute('download', exportName)
document.body.appendChild(link)
link.click()
URL.revokeObjectURL(link.href)
document.body.removeChild(link)
})
}
})
.catch(err => {
console.log(err)
})
},
// - end
//

Loading…
Cancel
Save