This commit is contained in:
hongchao 2024-12-17 17:41:42 +08:00
commit 8480ef8734
3 changed files with 77 additions and 70 deletions

7
components.d.ts vendored
View File

@ -8,11 +8,16 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElForm: typeof import('element-plus/es')['ElForm']
@ -20,7 +25,6 @@ declare module 'vue' {
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
@ -30,7 +34,6 @@ declare module 'vue' {
ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']

View File

@ -3,7 +3,13 @@ import { ref } from 'vue'
import PagingComponent from 'components/PagingComponent/index.vue'
import Empty from 'components/Empty/index.vue'
import { useRouter } from 'vue-router'
import { getOrderListApi, passApi, failApi, confirmPriceApi, getContractDetailApi, } from 'http/api/usercenter/seekorder'
import {
getOrderListApi,
passApi,
failApi,
confirmPriceApi,
getContractDetailApi,
} from 'http/api/usercenter/seekorder'
import TitleTip from 'components/TitleTip/index.vue'
import { getOverhaulApi } from 'http/api/rent-termination/index'
import uploadComponent from 'components/uploadComponent/index.vue'
@ -13,8 +19,8 @@ import { useStore } from 'store/user'
import type { FormInstance } from 'element-plus'
const store = useStore()
import { mainStore } from 'store/main'
import jsPreviewDocx from "@js-preview/docx";
import "@js-preview/docx/lib/index.css";
import jsPreviewDocx from '@js-preview/docx'
import '@js-preview/docx/lib/index.css'
const store2 = mainStore()
const overhaulDetails = ref<any>({})
@ -322,11 +328,11 @@ const tableData4: any = ref([
},
])
const wordUrl = ref("")
const wordUrl = ref('')
const settleWordTitle = ref('')
const dialogFormVisibleSettleWord: any = ref(false)
//
const handleViewWord = async(index: Number, row: any) => {
const handleViewWord = async (index: Number, row: any) => {
settleWordTitle.value = '租赁协议'
moneyParams1.value = {
/* 设备状态 */
@ -339,29 +345,27 @@ const handleViewWord = async(index: Number, row: any) => {
const res: any = await getContractDetailApi({ orderId })
// cardList.value = res.rows
//
wordUrl.value = res.data.url
wordUrl.value = res.data.url
dialogFormVisibleSettleWord.value = true
dialogFormVisibleSettleWord.value = true
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);
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)
}
// Word
const downloadContract = () => {
window.location.href = wordUrl.value;
window.location.href = wordUrl.value
}
const confirmFail = async (index: number) => {
@ -652,7 +656,9 @@ const costSubmit = () => {
</el-row>
<el-row>
<el-col :span="4"> 租期 </el-col>
<el-col :span="18"> {{ goods.days }}{{ ' ' + '天' }} </el-col>
<el-col :span="8"> {{ goods.days }}{{ ' ' + '天' }} </el-col>
<el-col :span="4"> 编号 </el-col>
<el-col :span="8"> {{ goods.code }} </el-col>
</el-row>
<el-row>
<el-col :span="4"> 租金 </el-col>
@ -757,7 +763,7 @@ const costSubmit = () => {
>
订单详情
</el-button>
<el-button @click="handleViewWord(j,item)" type="primary" size="small">
<el-button @click="handleViewWord(j, item)" type="primary" size="small">
租赁协议
</el-button>
@ -1319,17 +1325,17 @@ const costSubmit = () => {
:close-on-click-modal="false"
>
<!-- <div style="display: flex; justify-content: center"> -->
<!-- <img src="@/assets/img/zuLin.png" style="width: 100%; height: 600px" /> -->
<!-- <img src="@/assets/img/zuLin.png" style="width: 100%; height: 600px" /> -->
<!-- </div> -->
<div style="display: flex; justify-content: flex-end;margin-bottom: 10px;">
<span class="dialog-footer" >
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
> </el-button
>
<el-button @click="downloadContract" type="success"> 下载 </el-button>
</span>
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px">
<span class="dialog-footer">
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
> </el-button
>
<el-button @click="downloadContract" type="success"> 下载 </el-button>
</span>
</div>
<div id ="mmm" style="height:600px;"></div>
<div id="mmm" style="height: 600px"></div>
</el-dialog>
</template>

View File

@ -18,8 +18,8 @@ import type { FormInstance } from 'element-plus'
import { useStore } from 'store/user'
const store = useStore()
import { mainStore } from 'store/main'
import jsPreviewDocx from "@js-preview/docx";
import "@js-preview/docx/lib/index.css";
import jsPreviewDocx from '@js-preview/docx'
import '@js-preview/docx/lib/index.css'
const store2 = mainStore()
/* ***
****
@ -629,23 +629,21 @@ const handleViewWord = async (index: Number, row: any) => {
const res: any = await getContractDetailApi({ orderId })
// cardList.value = res.rows
//
wordUrl.value = res.data.url
wordUrl.value = res.data.url
dialogFormVisibleSettleWord.value = true
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);
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)
}
const contract = ref({
@ -656,12 +654,10 @@ const contract = ref({
// Word
const downloadContract = () => {
window.location.href = wordUrl.value;
window.location.href = wordUrl.value
}
const wordUrl = ref("")
const wordUrl = ref('')
</script>
<template>
@ -827,13 +823,13 @@ const wordUrl = ref("")
style="border-bottom: 1px solid #ccc; margin-bottom: 10px"
class="order-title-info"
>
<el-col :span="8">
<el-col :span="8">
<span> 出租方姓名 </span>
<span> {{item.sellerName}} </span>
<span> {{ item.sellerName }} </span>
</el-col>
<el-col :span="8">
<span> 承租方姓名 </span>
<span> {{item.buyerName}} </span>
<span> {{ item.buyerName }} </span>
</el-col>
<el-col :span="8">
<span> 承租方所属单位 </span>
@ -873,7 +869,9 @@ const wordUrl = ref("")
</el-row>
<el-row>
<el-col :span="4"> 租期 </el-col>
<el-col :span="18"> {{ goods.days }}{{ ' ' + '天' }} </el-col>
<el-col :span="8"> {{ goods.days }}{{ ' ' + '天' }} </el-col>
<el-col :span="4"> 编号 </el-col>
<el-col :span="8"> {{ goods.code }} </el-col>
</el-row>
<el-row>
<el-col :span="4"> 租金 </el-col>
@ -1886,17 +1884,17 @@ const wordUrl = ref("")
:close-on-click-modal="false"
>
<!-- <div style="display: flex; justify-content: center"> -->
<!-- <img src="@/assets/img/zuLin.png" style="width: 100%; height: 600px" /> -->
<!-- <img src="@/assets/img/zuLin.png" style="width: 100%; height: 600px" /> -->
<!-- </div> -->
<div style="display: flex; justify-content: flex-end;margin-bottom: 10px;">
<span class="dialog-footer" >
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
> </el-button
>
<el-button @click="downloadContract" type="success"> 下载 </el-button>
</span>
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px">
<span class="dialog-footer">
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
> </el-button
>
<el-button @click="downloadContract" type="success"> 下载 </el-button>
</span>
</div>
<div id ="mmm" style="height:600px;"></div>
<div id="mmm" style="height: 600px"></div>
</el-dialog>
</template>
@ -2279,8 +2277,8 @@ const wordUrl = ref("")
}
}
}
#mmm{
width:100%;
#mmm {
width: 100%;
height: 500px;
}
</style>