问题修复
This commit is contained in:
parent
fe5d3f0885
commit
7dd1754362
|
|
@ -695,8 +695,13 @@ const handleViewWord = async (index: any) => {
|
|||
})
|
||||
return
|
||||
}
|
||||
let isDays = true
|
||||
|
||||
cardList.value[index].devInfoVoList.map((e: any) => {
|
||||
if (e.rentBeginTime == '' || e.rentEndTime == '') {
|
||||
isDays = false
|
||||
return
|
||||
}
|
||||
if (e.isChecked) {
|
||||
detailsList.push({
|
||||
rentBeginTime: e.rentBeginTime + ' ' + '00:00:00',
|
||||
|
|
@ -711,6 +716,14 @@ const handleViewWord = async (index: any) => {
|
|||
cost = cost + e.num * e.days * e.dayLeasePrice
|
||||
}
|
||||
})
|
||||
if (!isDays) {
|
||||
ElMessage({
|
||||
showClose: false,
|
||||
message: '请选择租期',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
const queryParams = {
|
||||
companyName: localStorage.getItem('currentCompanyName'),
|
||||
czcompanyName: companyName,
|
||||
|
|
@ -721,30 +734,33 @@ const handleViewWord = async (index: any) => {
|
|||
}
|
||||
|
||||
console.log('查询参数', queryParams)
|
||||
const res: any = await getBookCarAgreementApi(queryParams)
|
||||
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
wordUrl.value = res.data.url
|
||||
} else {
|
||||
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
|
||||
}
|
||||
console.log('🚀 ~ handleViewWord ~ wordUrl.value:', wordUrl.value)
|
||||
dialogFormVisibleSettleWord.value = true
|
||||
try {
|
||||
const res: any = await getBookCarAgreementApi(queryParams)
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
wordUrl.value = res.data.url
|
||||
} else {
|
||||
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
|
||||
}
|
||||
console.log('🚀 ~ handleViewWord ~ wordUrl.value:', wordUrl.value)
|
||||
dialogFormVisibleSettleWord.value = true
|
||||
|
||||
settleWordTitle.value = '租赁服务合同'
|
||||
setTimeout(() => {
|
||||
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
|
||||
//传递要预览的文件地址即可
|
||||
myDocxPreviewer
|
||||
.preview(wordUrl.value)
|
||||
.then((res) => {
|
||||
console.log('预览完成')
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log('1111', wordUrl.value)
|
||||
console.log('预览失败', e)
|
||||
})
|
||||
}, 1000)
|
||||
settleWordTitle.value = '租赁服务合同'
|
||||
setTimeout(() => {
|
||||
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
|
||||
//传递要预览的文件地址即可
|
||||
myDocxPreviewer
|
||||
.preview(wordUrl.value)
|
||||
.then((res) => {
|
||||
console.log('预览完成')
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log('1111', wordUrl.value)
|
||||
console.log('预览失败', e)
|
||||
})
|
||||
}, 1000)
|
||||
} catch (error) {
|
||||
console.log('error', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 下载合同为 Word 文件
|
||||
|
|
|
|||
|
|
@ -530,7 +530,13 @@ const handleViewWord = async (index: any) => {
|
|||
return
|
||||
}
|
||||
|
||||
let isDays = true
|
||||
|
||||
orderList.value.map((e: any) => {
|
||||
if (e.rentBeginTime == '' || e.rentEndTime == '') {
|
||||
isDays = false
|
||||
return
|
||||
}
|
||||
detailsList.push({
|
||||
rentBeginTime: e.rentBeginTime + ' ' + '00:00:00',
|
||||
rentEndTime: e.rentEndTime + ' ' + '23:59:59',
|
||||
|
|
@ -543,6 +549,14 @@ const handleViewWord = async (index: any) => {
|
|||
})
|
||||
cost = cost + e.num * e.days * e.dayLeasePrice
|
||||
})
|
||||
if (!isDays) {
|
||||
ElMessage({
|
||||
showClose: false,
|
||||
message: '请选择租期',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
const queryParams = {
|
||||
companyName: localStorage.getItem('currentCompanyName'),
|
||||
czcompanyName: companyName,
|
||||
|
|
@ -553,24 +567,28 @@ const handleViewWord = async (index: any) => {
|
|||
}
|
||||
|
||||
console.log('查询参数', queryParams)
|
||||
const res: any = await getBookCarAgreementApi(queryParams)
|
||||
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
wordUrl.value = res.data.url
|
||||
} else {
|
||||
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
|
||||
}
|
||||
dialogFormVisibleSettleWord.value = true
|
||||
try {
|
||||
const res: any = await getBookCarAgreementApi(queryParams)
|
||||
|
||||
settleWordTitle.value = '租赁服务合同'
|
||||
setTimeout(() => {
|
||||
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
|
||||
//传递要预览的文件地址即可
|
||||
myDocxPreviewer
|
||||
.preview(wordUrl.value)
|
||||
.then((res) => {})
|
||||
.catch((e) => {})
|
||||
}, 1000)
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
wordUrl.value = res.data.url
|
||||
} else {
|
||||
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
|
||||
}
|
||||
dialogFormVisibleSettleWord.value = true
|
||||
|
||||
settleWordTitle.value = '租赁服务合同'
|
||||
setTimeout(() => {
|
||||
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
|
||||
//传递要预览的文件地址即可
|
||||
myDocxPreviewer
|
||||
.preview(wordUrl.value)
|
||||
.then((res) => {})
|
||||
.catch((e) => {})
|
||||
}, 1000)
|
||||
} catch (error) {
|
||||
console.log('error', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 下载合同为 Word 文件
|
||||
|
|
|
|||
|
|
@ -503,8 +503,9 @@ const getLeaseListData = async () => {
|
|||
}
|
||||
|
||||
const getAreaData = async () => {
|
||||
const res: any = await getAreaApi()
|
||||
const res: any = await getAreaApi(0)
|
||||
areaList.value = res.data
|
||||
console.log('🚀 ~ getAreaData ~ res.data:', res.data)
|
||||
}
|
||||
|
||||
// 重置
|
||||
|
|
@ -636,7 +637,7 @@ const onChangeClass = (val: any) => {
|
|||
onMounted(() => {
|
||||
getClassAndCompanyData()
|
||||
getLeaseListData()
|
||||
getAreaData()
|
||||
// getAreaData()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue