From f5da08f165fc1e09fb0fe64023b9ea33ec4d768e Mon Sep 17 00:00:00 2001 From: bonus <1203338439@qq.com> Date: Tue, 3 Dec 2024 17:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=80=E6=96=99=E5=8D=95?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/back/index.js | 8 ++++ src/api/ma/base.js | 2 + .../back/component/dialogFormByCq.vue | 38 ++++++++++++------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/api/back/index.js b/src/api/back/index.js index d27b6c20..0acf871a 100644 --- a/src/api/back/index.js +++ b/src/api/back/index.js @@ -98,3 +98,11 @@ export function getMachineById(query) { }) } +// 更新打印状态 +export function updatePrintStatus(id) { + return request({ + url: '/material/back_apply_info/editPrint', + method: 'post', + data: {id: id}, + }) +} \ No newline at end of file diff --git a/src/api/ma/base.js b/src/api/ma/base.js index b27a734f..063314ed 100644 --- a/src/api/ma/base.js +++ b/src/api/ma/base.js @@ -105,3 +105,5 @@ export function getProjectList(query) { }) } + + diff --git a/src/views/material/back/component/dialogFormByCq.vue b/src/views/material/back/component/dialogFormByCq.vue index 008ba045..80b46b7c 100644 --- a/src/views/material/back/component/dialogFormByCq.vue +++ b/src/views/material/back/component/dialogFormByCq.vue @@ -145,6 +145,7 @@ import vueEasyPrint from 'vue-easy-print'; import { getBackApplyInfo, + updatePrintStatus, } from '@/api/back/index.js' // import { getViewByApply,materialReturnNoteByApply } from "@/api/claimAndRefund/return.js" export default { @@ -201,7 +202,7 @@ export default { // let params = { // id: this.rowObj.id, // } - console.log(this.rowObj) + getBackApplyInfo(this.rowObj.id).then(res => { console.log(res) this.tableData = res.data.backApplyDetailsList @@ -213,6 +214,17 @@ export default { }, print() { this.$refs.printRef.print(); + console.log(this.rowObj) + updatePrintStatus(this.rowObj.id).then(response => { + if (response.code === 200) { + //this.$modal.msgSuccess("打印成功"); + // 如果需要刷新列表 + this.$emit('refresh'); + } + }).catch(() => { + this.$modal.msgError("打印状态更新失败"); + }); + }, checkDetail(row) { this.title = '查看' @@ -221,19 +233,8 @@ export default { }, remarksPrint() { this.$refs.remarksPrintRef.print(); - } - - // submit() { - // this.$refs["dynamicValidateForm"].validate(valid => { - // console.log("valid", valid); - // if (valid) { - // console.log("11111"); - // this.cancel(); - // } else { - // return false; - // } - // }); - // } + }, + } }; @@ -268,4 +269,13 @@ export default { font-size: 18px; } } +@media print { + .no-print { + display: none; + } + + .print-content { + /* 打印内容的样式 */ + } +}