打印导出工单(前端)
This commit is contained in:
parent
32241a7d73
commit
f73f87119d
@ -46,6 +46,15 @@ export function setTicketsPaid(data){
|
||||
})
|
||||
}
|
||||
|
||||
// 打印导出
|
||||
export function setTicketsPrint(data){
|
||||
return request({
|
||||
url: preUrl + "/print",
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增客户、车辆信息
|
||||
export function updateCustomerAndCar(data){
|
||||
return request({
|
||||
|
@ -115,6 +115,10 @@
|
||||
@click="handleVoid(scope.row)"
|
||||
>作废
|
||||
</el-button>
|
||||
<el-button v-if="TicketType !== 'tv'" size="mini" type="text" icon="el-icon-print"
|
||||
@click="handlePrint(scope.row)"
|
||||
>打印
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -145,7 +149,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {setTicketsVoid, setTicketsPaid} 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 {
|
||||
@ -196,6 +200,31 @@ 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 doPrint(data) {
|
||||
try {
|
||||
await setTicketsPrint(data)
|
||||
this.$modal.msgSuccess("导出打印成功")
|
||||
this.$emit("setPrint")
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
|
||||
handlePaid(row) {
|
||||
this.$prompt('结算备注', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
|
Loading…
Reference in New Issue
Block a user