|
|
|
@ -1335,31 +1335,7 @@ function removeFun() {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 完成
|
|
|
|
|
function submitFun() {
|
|
|
|
|
const select = getSelectRows()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
if (pkIdArr.length === 0) {
|
|
|
|
|
createMessage.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
CompleteTask(pkIdArr)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
createMessage.success('已完成任务')
|
|
|
|
|
bcFileFlag.value = true
|
|
|
|
|
bcFile.value = res.data
|
|
|
|
|
reload()
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handlePull() {
|
|
|
|
|
const select = getSelectRows()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
@ -1398,32 +1374,7 @@ function downloadFun() {
|
|
|
|
|
this.downloadTaskAttach(item, name)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function downloadTaskAttach(id, name) {
|
|
|
|
|
DownloadTaskAttach({
|
|
|
|
|
taskPKId: id,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.message) {
|
|
|
|
|
// this.showdownLoadErr = true
|
|
|
|
|
this.downLoadErrTip = `${name}下载失败:${res.message}`
|
|
|
|
|
|
|
|
|
|
message.error(`${name}下载失败:${res.message}`, 0)
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const blob = new Blob([res], { type: `application/pdf;chartset=UTF-8` })
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
link.style.display = 'none'
|
|
|
|
|
link.href = URL.createObjectURL(blob)
|
|
|
|
|
link.download = name
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
link.click()
|
|
|
|
|
URL.revokeObjectURL(link.href) // 释放URL对象
|
|
|
|
|
document.body.removeChild(link)
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 重新比对
|
|
|
|
|
function reComparisonFun() {
|
|
|
|
|
// 未找到接口
|
|
|
|
@ -1474,117 +1425,7 @@ function SendEmailFun() {
|
|
|
|
|
this.sendEmailVisible = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 打印
|
|
|
|
|
function FnCilckTemplateType(templateId) {
|
|
|
|
|
createMessage.success(`搜索文件中...`)
|
|
|
|
|
const printType = this.PrintType == 4 ? 20 : 10
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: this.pkIdArr[0] })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
TaskManageTruckPrint({
|
|
|
|
|
taskPKId: res.data.ext.id,
|
|
|
|
|
templateId,
|
|
|
|
|
cateCode: 'truckBill',
|
|
|
|
|
type: this.PrintType,
|
|
|
|
|
printType,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (!res.succeeded) {
|
|
|
|
|
createMessage.error(res.message)
|
|
|
|
|
} else {
|
|
|
|
|
// createMessage.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 {
|
|
|
|
|
createMessage.error(`${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function GetPrintData(cateCode, printType) {
|
|
|
|
|
const Data = {
|
|
|
|
|
cateCode,
|
|
|
|
|
printType,
|
|
|
|
|
}
|
|
|
|
|
this.spinning = true
|
|
|
|
|
|
|
|
|
|
TaskManageTruckPrintTemplateWithHistoryList(Data).then((res) => {
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
if (res.data.length == 1) {
|
|
|
|
|
this.FnCilckTemplateType(res.data[0].id)
|
|
|
|
|
} else {
|
|
|
|
|
this.templateType = res.data
|
|
|
|
|
this.spinning = false
|
|
|
|
|
this.PrintModalVisible = true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function FnPrint() {
|
|
|
|
|
const select = getSelectRows()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
if (pkIdArr.length != 1) {
|
|
|
|
|
createMessage.error('请仅选择一条数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
this.pkIdArr = pkIdArr
|
|
|
|
|
let printType = ''
|
|
|
|
|
if (this.PrintType == 4) {
|
|
|
|
|
printType = 20
|
|
|
|
|
} else {
|
|
|
|
|
printType = 10
|
|
|
|
|
}
|
|
|
|
|
this.PrintType = '1'
|
|
|
|
|
this.GetPrintData('truckBill', printType)
|
|
|
|
|
}
|
|
|
|
|
function FnSendCar() {
|
|
|
|
|
const select = getSelectRows()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
if (pkIdArr.length === 0) {
|
|
|
|
|
createMessage.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
TaskManageTruckSendDispatchBatchByTask(pkIdArr).then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
createMessage.success('派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function CancelSendCar() {
|
|
|
|
|
const select = getSelectRows()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
if (pkIdArr.length === 0) {
|
|
|
|
|
createMessage.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
TaskManageTruckCancelDispatchBatchByTask(pkIdArr).then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
createMessage.success('取消派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error(`取消派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 页数计算
|
|
|
|
|
function laraPaperCalc() {
|
|
|
|
@ -1611,9 +1452,7 @@ function laraPaperCalc() {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function handlePaperCalcCancel() {
|
|
|
|
|
this.paperCalcVisible = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function rowClassName(record, index) {
|
|
|
|
|
return 'active-row'
|
|
|
|
|
}
|
|
|
|
|