From 10aeb9ff75f04f42c46dcf6938f03805649ce9b3 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Wed, 30 Jul 2025 01:27:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=8D=B8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/materialsStation/auth.js | 8 + src/views/business/handlingOrder/index.vue | 434 ++++++++++++++++++++- 2 files changed, 422 insertions(+), 20 deletions(-) diff --git a/src/api/materialsStation/auth.js b/src/api/materialsStation/auth.js index c2820888..4e840898 100644 --- a/src/api/materialsStation/auth.js +++ b/src/api/materialsStation/auth.js @@ -91,3 +91,11 @@ export function uploadSort(data) { data: data }) } + +export function getSort(data) { + return request({ + url: '/material/back_apply_info/getSort', + method: 'post', + data: data + }) +} diff --git a/src/views/business/handlingOrder/index.vue b/src/views/business/handlingOrder/index.vue index 8d23c5a4..0968d30f 100644 --- a/src/views/business/handlingOrder/index.vue +++ b/src/views/business/handlingOrder/index.vue @@ -1,17 +1,17 @@ @@ -99,12 +234,13 @@ import { getTeamList, sumbitAuthData, uploadIdCard, - getAuthInfo, getHandlingOrderList, uploadSort + getAuthInfo, getHandlingOrderList, uploadSort, getSort } from '@/api/materialsStation/auth' import { getToken } from '@/utils/auth' import { validateIdCard } from '@/utils/bonus' import vueEasyPrint from 'vue-easy-print' import {acceptInnerVerifyer} from "@/api/purchase/goodsAccept"; +import printJS from "print-js"; export default { components: { vueEasyPrint }, name: 'IdCardUploadComponent', @@ -167,7 +303,33 @@ export default { detailsList: [], userName: '', createTime: '' - } + }, + + previewDialogVisible: false, + currentPreviewImage: null, + currentTicketData: { + timeType:'', + type: '', + proName: '', + carCode: '', + linkMan: '', + phone: '', + reserveDate: '', + sort:'' + }, + loadingDialogVisible: false, + loadingTicketData: { + timeType:'', + type: '', + proName: '', + carCode: '', + linkMan: '', + phone: '', + reserveDate: '', + sort:'' + }, + timeType:'', + sort:'' } }, created() { @@ -198,8 +360,8 @@ export default { this.loading = true const params = { keyWord: this.queryParams.keyWord, - // startTime: this.queryParams.time && this.queryParams.time[0], - // endTime: this.queryParams.time && this.queryParams.time[1], + startTime: this.queryParams.time && this.queryParams.time[0], + endTime: this.queryParams.time && this.queryParams.time[1], pageSize: this.queryParams.pageSize, pageNum: this.queryParams.pageNum } @@ -219,7 +381,8 @@ export default { confirmAction() { const param = { id: this.viewForm.id, - sort: this.viewForm.sort + sort: this.viewForm.sort, + timeType: this.timeType } uploadSort(param).then(response => { if (response.code === 200) { @@ -250,6 +413,17 @@ export default { this.viewDialogVisible = true this.viewForm.sort = row.sort // 可选:将原排号显示在输入框中 this.viewForm.id = row.id // 保存当前行的 id + + const params = { + type:'' + } + getSort(params).then(response => { + console.log(response.data) + this.timeType=response.data.timeType, + this.viewForm.sort=response.data.sort + }) + + }, // 转换时间格式 formatTime(time) { @@ -259,10 +433,230 @@ export default { const day = date.getDate() return `${year} 年 ${month} 月 ${day} 日` }, + dialogView(row) { + if (row.type === '卸' && row.sort !== null) { + this.showUnloadingTicket(row); + } else if (row.type === '装' && row.sort !== null) { + this.showLoadingTicket(row); + } + }, +// 显示卸货单 + showUnloadingTicket(row) { + this.currentTicketData = { + timeType:row.timeType, + sort: row.sort, + proName: row.proName, + carCode: row.carCode, + linkMan: row.linkMan, + phone: row.phone, + reserveDate: row.reserveDate + }; + this.currentPreviewImage = null; // 确保不使用图片预览 + this.previewDialogVisible = true; + }, + printTicket() { + // 创建一个打印专用的样式 + const printStyle = ` + .unloading-ticket { + width: 100%; + max-width: 500px; + margin: 0 auto; + padding: 20px; + } + .ticket-table { + width: 100%; + border-collapse: collapse; + } + .ticket-table td { + padding: 10px; + border: 1px solid #ddd; + } + .ticket-table td:first-child { + font-weight: bold; + background-color: #f5f5f5; + } + h2 { + text-align: center; + } + `; + + printJS({ + printable: 'unloading-ticket', + type: 'html', + targetStyles: ['*'], + scanStyles: false, + style: printStyle, + onPrintDialogClose: () => { + // 打印对话框关闭后的回调 + } + }); + }, + // 显示装货单 + showLoadingTicket(row) { + this.loadingTicketData = { + timeType:row.timeType, + sort: row.sort, + proName: row.proName, + carCode: row.carCode, + linkMan: row.linkMan, + phone: row.phone, + reserveDate: row.reserveDate + }; + this.currentPreviewImage = null; // 确保不使用图片预览 + this.loadingDialogVisible = true; + }, + loadingPrintTicket() { + // 创建一个打印专用的样式 + const printStyle = ` + .loading-ticket { + width: 100%; + max-width: 500px; + margin: 0 auto; + padding: 20px; + } + .loading-ticket-table { + width: 100%; + border-collapse: collapse; + } + .loading-ticket-table td { + padding: 10px; + border: 1px solid #ddd; + } + .loading-ticket-table td:first-child { + font-weight: bold; + background-color: #f5f5f5; + } + h2 { + text-align: center; + } + `; + + printJS({ + printable: 'loading-ticket', + type: 'html', + targetStyles: ['*'], + scanStyles: false, + style: printStyle, + onPrintDialogClose: () => { + // 打印对话框关闭后的回调 + } + }); + }, } }