From 560ec46b021fcaee39702866e854c4e0ddc6bace Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 31 Dec 2024 14:53:40 +0800 Subject: [PATCH] =?UTF-8?q?bug=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 2 - env/.env.dev | 4 +- src/components/uploadComponentNew/index.vue | 8 + src/views/cart/index.vue | 17 +- src/views/home/index.vue | 33 +- src/views/order/index.vue | 100 +++- src/views/user/accept-orders/index.vue | 6 +- src/views/user/contract-manage/index.vue | 201 +++---- src/views/user/goodsManagement/index.vue | 552 ++++++++++-------- .../user/lessor/quality-manage/index.vue | 27 +- .../lessor/security-certificate/index.vue | 6 +- 11 files changed, 561 insertions(+), 395 deletions(-) diff --git a/components.d.ts b/components.d.ts index b0bbef1..d3abe98 100644 --- a/components.d.ts +++ b/components.d.ts @@ -29,7 +29,6 @@ declare module 'vue' { ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] - ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] @@ -37,7 +36,6 @@ declare module 'vue' { ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] - ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElProgress: typeof import('element-plus/es')['ElProgress'] diff --git a/env/.env.dev b/env/.env.dev index 5e37dcb..90b71b2 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -9,8 +9,8 @@ VITE_API_URL = '/proxyApi' # VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 # VITE_proxyTarget = 'http://192.168.2.122:28080' # 梁超 -# VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务 -VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务 +VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务 +# VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务 # VITE_proxyTarget = 'http://192.168.2.75:28080' # 盛旭 # VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型) diff --git a/src/components/uploadComponentNew/index.vue b/src/components/uploadComponentNew/index.vue index e714a33..043aae9 100644 --- a/src/components/uploadComponentNew/index.vue +++ b/src/components/uploadComponentNew/index.vue @@ -221,6 +221,7 @@ const beforeUpload = (file: any) => { console.log(props.minLimit, '个数---') const { name = '', size } = file + if (size > props.maxSize * 1024 * 1000) { ElMessage({ type: 'warning', @@ -247,6 +248,13 @@ const beforeUpload = (file: any) => { }) return false } + + const newFile = new File([file], file.name.replace(/#/g, '_'), { + type: file.type, + lastModified: file.lastModified, + }) + + return newFile } const handleExceed = (files: any, fileList: any) => { ElMessage({ diff --git a/src/views/cart/index.vue b/src/views/cart/index.vue index d3d3ebb..8cf18ee 100644 --- a/src/views/cart/index.vue +++ b/src/views/cart/index.vue @@ -179,11 +179,10 @@
我已阅读并同意签署 - - - 《{{ item.companyPersonPhoneKey.companyName }}租赁服务合同》 - + + 《{{ item.companyPersonPhoneKey.companyName }}租赁服务合同》 +
@@ -904,4 +903,14 @@ getReceiptGoodsAddress() width: 100%; height: 500px; } + +.checkbox-container { + display: flex; + align-items: center; +} +.checkbox-container a { + color: #ff4800; + text-decoration: underline; + cursor: pointer; +} diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 7116a88..afe7cae 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -29,29 +29,32 @@ const selectOptionsValue = ref('分类筛选') const loopList = ref([swiper_2, swiper_4, swiper_3]) -getCompanyList() +// getCompanyList() +// getGoodsClassList() // if (userStore.companyList.length === 0) { // getCompanyList() // companyList.value = userStore.companyList // } else { // companyList.value = userStore.companyList // } -if (userStore.goodsClassList.length === 0) { - getGoodsClassList().then(() => { - classList.value = userStore.goodsClassList - }) -} else { - classList.value = userStore.goodsClassList -} - -// // 获取公司名称 -// const getCompanyListData = async () => { -// const res: any = await getCompanyListApi() -// companyList.value = res.data -// console.log('res公司名称', res) +// if (userStore.goodsClassList.length === 0) { +// getGoodsClassList().then(() => { +// classList.value = userStore.goodsClassList +// }) +// } else { +// classList.value = userStore.goodsClassList // } -// getCompanyListData() +// // 获取公司名称 +const getCompanyListData = async () => { + const res: any = await getCompanyListApi() + const result: any = await getGoodsClassListApi() + companyList.value = res.data + classList.value = result.data + // console.log('res公司名称', res) +} + +getCompanyListData() // 点击跳转装备共享大厅 const onSharedHall = (level: number, typeId: any, name: any) => { diff --git a/src/views/order/index.vue b/src/views/order/index.vue index edaa81d..806c6d3 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -189,8 +189,10 @@
我已阅读并同意签署 - 《xxxx公司租赁服务合同》 + + 《{{ orderList[0]?.companyName }}公司租赁服务合同》 +
@@ -222,6 +224,30 @@ + + + + + + +
+
+ + 关 闭 + 下载 + +
+
+
@@ -230,12 +256,15 @@ import Header from '../../components/header/index.vue' import FooterInfo from '../../components/FooterInfo/index.vue' import { ElMessage } from 'element-plus' import { getBookCarDetailByMaId, submitBookCarApi } from '../../http/api/order/index' +import { getBookCarAgreementApi } from 'http/api/cart/index' import CustomDatePickerButton from '../cart/components/date-picker-button.vue' import { getAddressListApi } from 'http/api/address-manage/index' import { getDetail } from 'http/api/equip' import moment from 'moment' import { useRoute, useRouter } from 'vue-router' import { useStore } from '../../store/user' +import jsPreviewDocx from '@js-preview/docx' +import '@js-preview/docx/lib/index.css' const userStore = useStore() const router = useRouter() const route = useRoute() @@ -480,6 +509,68 @@ const onSelectAddress = (address: any) => { } getReceiptGoodsAddress() +const wordUrl = ref() +const dialogFormVisibleSettleWord = ref(false) +const settleWordTitle = ref('') +//租赁服务合同 +const handleViewWord = async (index: any) => { + // 组装参数 + const { companyName, companyId, personPhone } = orderList.value[0] + let cost = 0 + let detailsList: any = [] + + if (orderList.value[0].days < 1) { + ElMessage({ + showClose: false, + message: '请选择租期', + type: 'error', + }) + return + } + + orderList.value.map((e: any) => { + detailsList.push({ + rentBeginTime: e.rentBeginTime + ' ' + '00:00:00', + rentEndTime: e.rentEndTime + ' ' + '23:59:59', + manageType: e.manageType, + days: e.days, + num: e.num, + costs: e.num * e.days * e.dayLeasePrice, + deviceName: e.deviceName, + dayLeasePrice: e.dayLeasePrice, + }) + cost = cost + e.num * e.days * e.dayLeasePrice + }) + const queryParams = { + companyName: localStorage.getItem('currentCompanyName'), + czcompanyName: companyName, + companyId, + cost, + detailsList, + personPhone, + } + + console.log('查询参数', queryParams) + const res: any = await getBookCarAgreementApi(queryParams) + + wordUrl.value = 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) +} + +// 下载合同为 Word 文件 +const submitBtn = () => { + window.location.href = wordUrl.value +}