|
|
|
@ -183,9 +183,9 @@
|
|
|
|
|
>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check">完成</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check">打印</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check">发送派车</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check">撤销派车</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check" @click="FnPrint">打印</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check" @click="FnSendCar">派车</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check">取消派车</a-button>
|
|
|
|
|
<template v-if="taskType === 'BC'">
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
title="确定批量下载当前选择项?"
|
|
|
|
@ -417,7 +417,38 @@
|
|
|
|
|
<a-button @click="handlePaperCalcCancel">关闭</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<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>
|
|
|
|
|
<!-- <a-alert
|
|
|
|
|
v-if="showdownLoadErr"
|
|
|
|
|
class="downLoad-err-alert"
|
|
|
|
@ -448,13 +479,31 @@ import {
|
|
|
|
|
DownloadOriginalTask,
|
|
|
|
|
ManualReCompareBC
|
|
|
|
|
} from '@/api/modular/main/TaskmanageList'
|
|
|
|
|
import {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId,
|
|
|
|
|
TaskManageTruckPrintTemplateWithHistoryList,
|
|
|
|
|
TaskManageTruckPrint
|
|
|
|
|
} from '@/api/modular/main/SendCar'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'TaskmanageList',
|
|
|
|
|
components: {
|
|
|
|
|
XCard
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
PrintType(newdata, oldData) {
|
|
|
|
|
let printType = newdata == 4 ? 20 : 10
|
|
|
|
|
let print = oldData == 4 ? 20 : 10
|
|
|
|
|
if (printType != print) {
|
|
|
|
|
this.GetPrintData('truckBill', printType)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
templateType: [],
|
|
|
|
|
PrintType: '1',
|
|
|
|
|
spinning: false,
|
|
|
|
|
PrintModalVisible: false,
|
|
|
|
|
levelTop: [],
|
|
|
|
|
activeTopKey: '',
|
|
|
|
|
levelNextAll: [],
|
|
|
|
@ -558,6 +607,119 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
// 打印
|
|
|
|
|
FnCilckTemplateType(templateId) {
|
|
|
|
|
this.$message.success(`搜索文件中...`)
|
|
|
|
|
let printType = this.PrintType == 4 ? 20 : 10
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: this.pkIdArr[0] })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
TaskManageTruckPrint({
|
|
|
|
|
taskPKId: res.data.ext.pK_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'
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
GetPrintData(cateCode, printType) {
|
|
|
|
|
let Data = {
|
|
|
|
|
cateCode,
|
|
|
|
|
printType
|
|
|
|
|
}
|
|
|
|
|
this.spinning = true
|
|
|
|
|
|
|
|
|
|
TaskManageTruckPrintTemplateWithHistoryList(Data).then(res => {
|
|
|
|
|
this.templateType = res.data
|
|
|
|
|
this.spinning = false
|
|
|
|
|
this.PrintModalVisible = true
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
FnPrint() {
|
|
|
|
|
const select = this.$refs.xGrid.getCheckboxRecords()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.pkId
|
|
|
|
|
})
|
|
|
|
|
if (pkIdArr.length != 1) {
|
|
|
|
|
this.$message.error('请仅选择一条数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
this.pkIdArr = pkIdArr
|
|
|
|
|
let printType = ''
|
|
|
|
|
if (this.PrintType == 4) {
|
|
|
|
|
printType = 20
|
|
|
|
|
} else {
|
|
|
|
|
printType = 10
|
|
|
|
|
}
|
|
|
|
|
this.PrintType = '1'
|
|
|
|
|
this.GetPrintData('truckBill', printType)
|
|
|
|
|
},
|
|
|
|
|
FnSendCar() {
|
|
|
|
|
const select = this.$refs.xGrid.getCheckboxRecords()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.pkId
|
|
|
|
|
})
|
|
|
|
|
if (pkIdArr.length === 0) {
|
|
|
|
|
this.$message.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
pkIdArr.forEach(item => {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: this.pkIdArr[0] })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
// TaskManageTruckPrint({
|
|
|
|
|
// taskPKId: res.data.ext.pK_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'
|
|
|
|
|
// )
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onSelect(selectedKeys, info) {
|
|
|
|
|
console.log('selected', selectedKeys, info)
|
|
|
|
|
if (selectedKeys.length === 0) {
|
|
|
|
@ -1382,4 +1544,46 @@ export default {
|
|
|
|
|
// height: auto;
|
|
|
|
|
// margin-left: -250px;
|
|
|
|
|
// }
|
|
|
|
|
.PrintMain {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
|
|
.PrintTitle {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
background: #f7f8fe;
|
|
|
|
|
border: 1px dashed #cdcdcd;
|
|
|
|
|
p {
|
|
|
|
|
margin: 0;
|
|
|
|
|
&:nth-child(2) {
|
|
|
|
|
margin-left: 35px;
|
|
|
|
|
}
|
|
|
|
|
span {
|
|
|
|
|
color: #ff6646;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.PrintMainBox {
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-height: 50vh;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
.items {
|
|
|
|
|
padding-left: 1rem;
|
|
|
|
|
height: 2.5rem;
|
|
|
|
|
line-height: 2.5rem;
|
|
|
|
|
border-bottom: 1px solid #ebebeb;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
&:hover {
|
|
|
|
|
color: #2f54eb;
|
|
|
|
|
}
|
|
|
|
|
span {
|
|
|
|
|
font-weight: bolder;
|
|
|
|
|
margin-right: 0.6rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|