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 { + /* 打印内容的样式 */ + } +}