|
|
|
@ -487,6 +487,38 @@
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-spin>
|
|
|
|
|
<a-modal :zIndex="1005" width="50vw" :maskClosable="false" v-model="PrintModalVisible" title="打印">
|
|
|
|
|
<template slot="footer"> <span></span> </template>
|
|
|
|
|
<a-spin tip="数据加载中..." :spinning="spinning">
|
|
|
|
|
<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 value="4">精确打印</a-radio>
|
|
|
|
|
</a-radio-group>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a-row class="PrintMainBox">
|
|
|
|
|
<a-col
|
|
|
|
|
v-for="(item, index) in templateType"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
@click="FnCilckTemplateType(item.id)"
|
|
|
|
|
class="items"
|
|
|
|
|
:span="11"
|
|
|
|
|
:offset="index % 2 == 0 ? 0 : 1"
|
|
|
|
|
>
|
|
|
|
|
<span>·</span>{{ item.displayName }}
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
|
</a-spin>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- </a-modal> -->
|
|
|
|
@ -510,7 +542,8 @@ import {
|
|
|
|
|
TaskManageTruckSave,
|
|
|
|
|
TaskManageTruckPrint,
|
|
|
|
|
TaskManageTruckCancelDispatch,
|
|
|
|
|
TaskManageTruckSendDispatchBatch
|
|
|
|
|
TaskManageTruckSendDispatchBatch,
|
|
|
|
|
BookingTruckPrintTemplateWithHistoryList
|
|
|
|
|
} from '@/api/modular/main/SendCar'
|
|
|
|
|
import { GetCtn } from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
|
|
|
|
@ -518,7 +551,12 @@ import { merge, values } from 'xe-utils'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
templateType: [],
|
|
|
|
|
PrintType: '1',
|
|
|
|
|
spinning: false,
|
|
|
|
|
PrintModalVisible: false,
|
|
|
|
|
isGuaJi: false,
|
|
|
|
|
taskPKId: null,
|
|
|
|
|
id: null,
|
|
|
|
|
type: null,
|
|
|
|
|
BookingId: null,
|
|
|
|
@ -623,39 +661,123 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
$route: {
|
|
|
|
|
'$route.query': {
|
|
|
|
|
// $route: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
deep: true,
|
|
|
|
|
handler(To, from) {
|
|
|
|
|
console.log(To.path)
|
|
|
|
|
if (To.path == '/SendCarAdd') {
|
|
|
|
|
if (
|
|
|
|
|
this.id == this.$route.query.id &&
|
|
|
|
|
this.type == this.$route.query.type &&
|
|
|
|
|
this.BookingId == this.$route.query.BookingId &&
|
|
|
|
|
this.taskPKId == this.$route.query.taskPKId
|
|
|
|
|
) {
|
|
|
|
|
console.log(
|
|
|
|
|
this.id,
|
|
|
|
|
this.$route.query.id,
|
|
|
|
|
this.type,
|
|
|
|
|
this.$route.query.type,
|
|
|
|
|
this.BookingId,
|
|
|
|
|
this.$route.query.BookingId
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
console.log(To)
|
|
|
|
|
// if (To.path == '/SendCarAdd') {
|
|
|
|
|
// if (
|
|
|
|
|
// this.id == this.$route.query.id &&
|
|
|
|
|
// this.type == this.$route.query.type &&
|
|
|
|
|
// this.BookingId == this.$route.query.BookingId &&
|
|
|
|
|
// this.taskPKId == this.$route.query.taskPKId
|
|
|
|
|
// ) {
|
|
|
|
|
// console.log(
|
|
|
|
|
// this.id,
|
|
|
|
|
// this.$route.query.id,
|
|
|
|
|
// this.type,
|
|
|
|
|
// this.$route.query.type,
|
|
|
|
|
// this.BookingId,
|
|
|
|
|
// this.$route.query.BookingId
|
|
|
|
|
// )
|
|
|
|
|
// } else {
|
|
|
|
|
console.log(To.type)
|
|
|
|
|
if (To.type) {
|
|
|
|
|
this.taskPKId = this.$route.query.taskPKId
|
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
|
this.type = this.$route.query.type
|
|
|
|
|
this.BookingId = this.$route.query.BookingId
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
PrintType(newdata, oldData) {
|
|
|
|
|
let printType = newdata == 4 ? 20 : 10
|
|
|
|
|
let print = oldData == 4 ? 20 : 10
|
|
|
|
|
if (printType != print) {
|
|
|
|
|
this.GetPrintData('truckBill', printType)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
GetPrintData(cateCode, printType) {
|
|
|
|
|
let Data = {
|
|
|
|
|
cateCode,
|
|
|
|
|
printType
|
|
|
|
|
}
|
|
|
|
|
this.spinning = true
|
|
|
|
|
BookingTruckPrintTemplateWithHistoryList(Data).then(res => {
|
|
|
|
|
this.templateType = res.data
|
|
|
|
|
this.spinning = false
|
|
|
|
|
this.PrintModalVisible = true
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 打印
|
|
|
|
|
FnCilckTemplateType(templateId) {
|
|
|
|
|
this.$message.success(`搜索文件中...`)
|
|
|
|
|
let printType = this.PrintType == 4 ? 20 : 10
|
|
|
|
|
if (this.taskPKId) {
|
|
|
|
|
TaskManageTruckPrint({ pkId: this.WebData.pK_ID }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('打印成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`打印失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
BookingTruckPrint({
|
|
|
|
|
id: this.WebData.id,
|
|
|
|
|
templateId,
|
|
|
|
|
cateCode: 'truckBill',
|
|
|
|
|
type: this.PrintType,
|
|
|
|
|
printType
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (!res.success) {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
} else {
|
|
|
|
|
// this.$message.success(res.data)
|
|
|
|
|
if (this.PrintType == 1) {
|
|
|
|
|
window.open(` ${process.env.VUE_APP_API_BASE_URL}/BookingOrder/ViewPrintPdf/${res.data}`, '_blank')
|
|
|
|
|
} else {
|
|
|
|
|
window.open(
|
|
|
|
|
` ${process.env.VUE_APP_API_BASE_URL}/BookingOrder/downloadPrint?filename=${res.data}`,
|
|
|
|
|
'_blank'
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// BookingOrderPrintOrder({
|
|
|
|
|
// templateId,
|
|
|
|
|
// bookingId: this.id,
|
|
|
|
|
// cateCode: 'truckBill',
|
|
|
|
|
// type: this.PrintType,
|
|
|
|
|
// printType
|
|
|
|
|
// })
|
|
|
|
|
// .then(res => {
|
|
|
|
|
// if (!res.success) {
|
|
|
|
|
// this.$message.error(res.message)
|
|
|
|
|
// } else {
|
|
|
|
|
// // this.$message.success(res.data)
|
|
|
|
|
// if (this.PrintType == 1) {
|
|
|
|
|
// window.open(` ${process.env.VUE_APP_API_BASE_URL}/BookingOrder/ViewPrintPdf/${res.data}`, '_blank')
|
|
|
|
|
// } else {
|
|
|
|
|
// window.open(
|
|
|
|
|
// ` ${process.env.VUE_APP_API_BASE_URL}/BookingOrder/downloadPrint?filename=${res.data}`,
|
|
|
|
|
// '_blank'
|
|
|
|
|
// )
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// .catch(err => {
|
|
|
|
|
// console.log(err)
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
// 调度派车
|
|
|
|
|
FnSendCar() {
|
|
|
|
|
TaskManageTruckSendDispatchBatch([this.WebData.pK_ID]).then(res => {
|
|
|
|
@ -743,23 +865,31 @@ export default {
|
|
|
|
|
return Rdata
|
|
|
|
|
},
|
|
|
|
|
FnPrint() {
|
|
|
|
|
if (this.taskPKId) {
|
|
|
|
|
TaskManageTruckPrint({ pkId: this.WebData.pK_ID }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('打印成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`打印失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
let printType = ''
|
|
|
|
|
if (this.PrintType == 4) {
|
|
|
|
|
printType = 20
|
|
|
|
|
} else {
|
|
|
|
|
BookingTruckPrint({ id: this.WebData.id }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('打印成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`打印失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
printType = 10
|
|
|
|
|
}
|
|
|
|
|
this.PrintType = '1'
|
|
|
|
|
this.GetPrintData('truckBill', printType)
|
|
|
|
|
// if (this.taskPKId) {
|
|
|
|
|
// TaskManageTruckPrint({ pkId: this.WebData.pK_ID }).then(res => {
|
|
|
|
|
// if (res.data.succ) {
|
|
|
|
|
// this.$message.success('打印成功')
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$message.error(`打印失败,${res.data.msg}`)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// } else {
|
|
|
|
|
// BookingTruckPrint({ id: this.WebData.id }).then(res => {
|
|
|
|
|
// if (res.data.succ) {
|
|
|
|
|
// this.$message.success('打印成功')
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$message.error(`打印失败,${res.data.msg}`)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
FnCancel() {
|
|
|
|
|
BookingTruckCancel({ id: this.WebData.id }).then(res => {
|
|
|
|
@ -853,10 +983,10 @@ export default {
|
|
|
|
|
|
|
|
|
|
// this.$data = this.$options.data()
|
|
|
|
|
|
|
|
|
|
DjyCustomerQuerytDjyCustomerInfo({ queryType: 'fleet' }).then(res => {
|
|
|
|
|
this.truckIdData = res.data
|
|
|
|
|
this.AlltruckIdData = res.data
|
|
|
|
|
})
|
|
|
|
|
// DjyCustomerQuerytDjyCustomerInfo({ queryType: 'fleet' }).then(res => {
|
|
|
|
|
// this.truckIdData = res.data
|
|
|
|
|
// this.AlltruckIdData = res.data
|
|
|
|
|
// })
|
|
|
|
|
commondbYardlist().then(res => {
|
|
|
|
|
this.inYardIDData = res.data
|
|
|
|
|
this.yardidData = res.data
|
|
|
|
@ -903,6 +1033,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
Changeyardcontract(e) {
|
|
|
|
|
if (!this.yardcontractaData) {
|
|
|
|
|
this.yardcontractaData = []
|
|
|
|
|
}
|
|
|
|
|
this.yardcontractaData.forEach(item => {
|
|
|
|
|
if (item.id == e) {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
@ -922,7 +1055,7 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}, 100)
|
|
|
|
|
DjyCustomerQuerytDjyCustomerInfo({ queryItem: e }).then(res => {
|
|
|
|
|
if (res.data[0]) {
|
|
|
|
|
if (res.data[0] && res.data[0].contacts) {
|
|
|
|
|
this.inYardContactData = res.data[0].contacts
|
|
|
|
|
if (res.data[0].contacts.length) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -943,7 +1076,7 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}, 100)
|
|
|
|
|
DjyCustomerQuerytDjyCustomerInfo({ queryItem: e }).then(res => {
|
|
|
|
|
if (res.data[0]) {
|
|
|
|
|
if (res.data[0] && res.data[0].contacts) {
|
|
|
|
|
this.yardcontractaData = res.data[0].contacts
|
|
|
|
|
if (res.data[0].contacts.length) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -1152,6 +1285,9 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
@import url('../BookingLedger/detail/style/operationArea.less');
|
|
|
|
|
</style>
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
.SendCarMain {
|
|
|
|
|
display: flex;
|
|
|
|
|