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({
|
return request({
|
||||||
url: preUrl + "/print",
|
url: preUrl + "/print/" + id,
|
||||||
method: 'post',
|
method: 'get'
|
||||||
data
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus"/>
|
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||||
>查看
|
>查看
|
||||||
@ -115,7 +115,7 @@
|
|||||||
@click="handleVoid(scope.row)"
|
@click="handleVoid(scope.row)"
|
||||||
>作废
|
>作废
|
||||||
</el-button>
|
</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)"
|
@click="handlePrint(scope.row)"
|
||||||
>打印
|
>打印
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -149,7 +149,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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";
|
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -200,22 +200,14 @@ export default {
|
|||||||
} catch {
|
} catch {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
async handlePrint(row) {
|
* 打印
|
||||||
//console.log('Handling print for:', row);
|
*/
|
||||||
this.$confirm('确认打印吗?', '提示', {
|
async handlePrint(row) {
|
||||||
confirmButtonText: '确定',
|
// window.location.href = process.env.VUE_APP_BASE_API + '/admin-api/repair/tickets/print/'+row.id;
|
||||||
cancelButtonText: '取消',
|
window.open(process.env.VUE_APP_BASE_API + '/admin-api/repair/tickets/print/'+row.id)
|
||||||
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 doPrint(data) {
|
async doPrint(data) {
|
||||||
try {
|
try {
|
||||||
await setTicketsPrint(data)
|
await setTicketsPrint(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user