diff --git a/src/api/materialsStation/auth.js b/src/api/materialsStation/auth.js index c4cae60f..44f3a90d 100644 --- a/src/api/materialsStation/auth.js +++ b/src/api/materialsStation/auth.js @@ -72,7 +72,13 @@ export function getAuthInfo(data) { }) } - +export function getBusinessFormByCode(data) { + return request({ + url: '/material/leaseTask/getBusinessFormByCode', + method: 'get', + params: data + }) +} // 获取装卸单列表 diff --git a/src/views/material/back/component/dialogFormByCq.vue b/src/views/material/back/component/dialogFormByCq.vue index 5a52dd8f..0a21d92c 100644 --- a/src/views/material/back/component/dialogFormByCq.vue +++ b/src/views/material/back/component/dialogFormByCq.vue @@ -88,13 +88,17 @@
审核人:
-
+
@@ -202,13 +206,17 @@
审核人:
-
+
diff --git a/src/views/material/materialStation/authorize/index.vue b/src/views/material/materialStation/authorize/index.vue index f04d893d..98beb282 100644 --- a/src/views/material/materialStation/authorize/index.vue +++ b/src/views/material/materialStation/authorize/index.vue @@ -363,12 +363,13 @@ {{ viewForm.authorizationFile.name }} - ({{ formatFileSize(viewForm.authorizationFile.size) }}) - + ({{ formatFileSize(viewForm.authorizationFile.size) }}) +
+ @@ -396,16 +397,36 @@ - - - - - + +
+ +
+ +
+ +
+ +
+ +
+ +
+ 关闭 + 下载 +
+
+
@@ -434,13 +455,14 @@ v-if="authorizeData.detailsList[0].signName" :src="authorizeData.detailsList[0].signName" alt="" - width="100px" - height="50px;" - style="margin-right: 10px" + width="120px" + height="120px" + style="vertical-align: middle;" :style="{ transform: authorizeData.detailsList[0].signType == 0 ? 'rotate(-90deg)' : 'none' }" />
+
委托单位:{{ authorizeData.leaseUnit }}
授权人:{{ authorizeData.userName }}
@@ -456,6 +478,140 @@
+
@@ -475,11 +631,12 @@ import { getTeamList, sumbitAuthData, uploadIdCard, - getAuthInfo + getAuthInfo, getBusinessFormByCode } from '@/api/materialsStation/auth' import { getToken } from '@/utils/auth' import { validateIdCard } from '@/utils/bonus' import vueEasyPrint from 'vue-easy-print' +import {getLeaseTask} from "@/api/business"; export default { components: { vueEasyPrint }, name: 'IdCardUploadComponent', @@ -513,15 +670,10 @@ export default { }, //新增弹窗 open: false, - dialogForm: { - maTypeName: null, - maTypeId: null, - typeId: null, - supplierId: null, - qrNum: null, - remark: null - }, - + previewVisible: false, + previewUrl: '', + previewTitle: '', + previewType: '', // 'image', 'pdf', 'office' fileList: [], uploadList: [], // 上传参数 @@ -587,6 +739,19 @@ export default { children: 'children' }, uploadParseUrl: process.env.VUE_APP_BASE_API + '/material/authorize/parseWord', + //业务联系单 + dialogForm: { + proName: '', // 项目名称 + code: '' // 业务单号 + }, + dialogColumns: [ + { label: '名称', prop: 'maTypeName', width: '150px' }, + { label: '规格', prop: 'typeName', width: '150px' }, + { label: '单位', prop: 'unitName', width: '60px' }, + { label: '数量', prop: 'preNum', width: '60px' }, + { label: '备注', prop: 'remark', width: '' } + ], + dialogList: [] } }, created() { @@ -775,12 +940,6 @@ export default { this.queryParams.taskStatus = '' this.handleQuery() }, - checkNum() { - this.dialogForm.qrNum = Number(String(this.dialogForm.qrNum).replace(/[^\d]/g, '')) - if (this.dialogForm.qrNum <= 1) { - this.dialogForm.qrNum = 1 - } - }, // 列表复选框 handleSelectionChange(validSelection) { // 只存储未授权项目的ID @@ -1035,28 +1194,53 @@ export default { }, // 预览文件 previewFile(file) { - // if (!file || !file.url) return - // - // const ext = file.name.split('.').pop().toLowerCase() - // console.log(ext) - // - // if (ext === 'pdf') { - // this.previewPDF(file.url) - // } else if (['jpg', 'jpeg', 'png', 'gif'].includes(ext)) { - // // 图片直接使用el-image预览 - // this.$alert(``, file.name, { - // dangerouslyUseHTMLString: true, - // customClass: 'image-preview-modal' - // }) - // } else { - // this.$message.warning('不支持预览此文件类型') - // } + if (!file || !file.url) return; + + const ext = file.name.split('.').pop().toLowerCase(); + console.log(ext); + + if (ext === 'pdf') { + this.previewPDF(file.url); + } else if (['jpg', 'jpeg', 'png', 'gif'].includes(ext)) { + // 图片预览 + this.previewImage(file.url); + } else if (ext === 'docx') { + // 直接下载 DOCX 文件 + this.downloadFile(file.url); + } else { + this.$message.warning('不支持预览此文件类型'); + } }, - // 预览PDF文件 previewPDF(url) { - // 方案2: 直接使用iframe (简单但依赖浏览器PDF插件) - this.pdfViewerUrl = url - this.pdfPreviewVisible = true + // 打开 PDF 文件 + window.open(url, '_blank'); + }, + previewImage(url) { + // 创建新窗口 + const imgWindow = window.open('', '_blank'); + + // 设置新窗口内容 + imgWindow.document.write(` + + + 图片预览 + + + + 图片预览 + + + `); + }, + downloadFile(url) { + // 直接下载 DOCX 文件 + const link = document.createElement('a'); + link.href = url; + link.download = url.split('/').pop(); // 自动获取文件名 + link.click(); }, // 格式化文件大小 formatFileSize(bytes) { @@ -1145,6 +1329,16 @@ export default { const date = new Date() const time = `${date.getFullYear()} 年 ${date.getMonth() + 1} 月 ${date.getDate()} 日` this.authorizeData.createTime = res.data.createTime ? this.formatTime(res.data.createTime) : time + + const params2 = { + businessCode: row.code + } + const res2 = await getBusinessFormByCode(params2) + this.dialogForm = { + ...res2.data.leaseApplyInfo, + } + this.dialogList = res2.data.leaseApplyDetailsList + this.authorizeVisible = true } catch (error) { console.log('🚀 ~ handleAuthorize ~ error:', error) @@ -1333,6 +1527,13 @@ export default { // 清空识别结果(可选) // this.materialReceivers = []; }, + // 处理时间格式 2021-09-01 转换为 2021年09月01日 + handleTimeFormat(time) { + if (time) { + return time.replace(/-/g, '年').replace(/-/g, '月') + '日' + } + return '' + }, } } diff --git a/src/views/materialsStation/equipment/totalReturnRecord/dialogFormByClz.vue b/src/views/materialsStation/equipment/totalReturnRecord/dialogFormByClz.vue index 5b0b2bdc..8c723565 100644 --- a/src/views/materialsStation/equipment/totalReturnRecord/dialogFormByClz.vue +++ b/src/views/materialsStation/equipment/totalReturnRecord/dialogFormByClz.vue @@ -88,13 +88,17 @@
审核人:
-
+
@@ -202,13 +206,17 @@
审核人:
-
+
@@ -373,9 +381,9 @@ export default { maxWidth: '1400' }) - } + } + - } }