1
This commit is contained in:
parent
ff1d7088ef
commit
75c1a042e1
@ -46,12 +46,12 @@ export function setTicketsPaid(data){
|
||||
})
|
||||
}
|
||||
|
||||
// 打印导出
|
||||
export function setTicketsPrint(data){
|
||||
|
||||
export function print(id) {
|
||||
return request({
|
||||
url: preUrl + "/print",
|
||||
method: 'post',
|
||||
data
|
||||
url: preUrl + "/print/" + id,
|
||||
method: 'get'
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@
|
||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="180">
|
||||
<el-table-column label="操作" fixed="right" align="center" width="230">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||
>查看
|
||||
@ -115,7 +115,7 @@
|
||||
@click="handleVoid(scope.row)"
|
||||
>作废
|
||||
</el-button>
|
||||
<el-button v-if="TicketType !== 'tv'" size="mini" type="text" icon="el-icon-print"
|
||||
<el-button size="mini" type="text" icon="el-icon-printer"
|
||||
@click="handlePrint(scope.row)"
|
||||
>打印
|
||||
</el-button>
|
||||
@ -149,7 +149,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { setTicketsVoid, setTicketsPaid, setTicketsPrint } from '@/api/repair/tickets/Tickets'
|
||||
import {setTicketsVoid, setTicketsPaid, setTicketsPrint} from '@/api/repair/tickets/Tickets'
|
||||
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
|
||||
|
||||
export default {
|
||||
@ -200,22 +200,14 @@ export default {
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
|
||||
async handlePrint(row) {
|
||||
//console.log('Handling print for:', row);
|
||||
this.$confirm('确认打印吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
const response = await this.$http.post('/repair/tickets/print', row);
|
||||
console.log('Print request data:', row); // 调试输出请求数据
|
||||
// 处理文件下载或预览
|
||||
const fileUrl = response.data.url; // 假设返回文件的下载链接
|
||||
window.open(fileUrl); // 直接打开文件或下载, 可以根据需求调整
|
||||
}).catch(() => {
|
||||
});
|
||||
/**
|
||||
* 打印
|
||||
*/
|
||||
async handlePrint(row) {
|
||||
// window.location.href = process.env.VUE_APP_BASE_API + '/admin-api/repair/tickets/print/'+row.id;
|
||||
window.open(process.env.VUE_APP_BASE_API + '/admin-api/repair/tickets/print/'+row.id)
|
||||
},
|
||||
|
||||
async doPrint(data) {
|
||||
try {
|
||||
await setTicketsPrint(data)
|
||||
|
Loading…
Reference in New Issue
Block a user