|
|
|
@ -14,6 +14,7 @@ import {MerchantService} from '../../../../services/merchant.service'; |
|
|
|
|
import {OrderOilService} from '../../../../services/order/order-oil.service'; |
|
|
|
|
import {OrderManageService} from '../../../../services/order/order-manage.service'; |
|
|
|
|
import {ActivatedRoute} from '@angular/router'; |
|
|
|
|
import {OrderService} from '../../../../services/order.service'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-order-oil-list', |
|
|
|
@ -66,6 +67,12 @@ export class OrderOilListComponent implements OnInit { |
|
|
|
|
// 退款按钮权限
|
|
|
|
|
REFUND_OIL_BTN = false; |
|
|
|
|
|
|
|
|
|
printDataObject = { |
|
|
|
|
orderNo: null, |
|
|
|
|
printData: null |
|
|
|
|
}; |
|
|
|
|
printModal = false; |
|
|
|
|
|
|
|
|
|
constructor(private modal: NzModalService, |
|
|
|
|
private message: NzMessageService, |
|
|
|
|
private commonsService: CommonsService, |
|
|
|
@ -73,6 +80,7 @@ export class OrderOilListComponent implements OnInit { |
|
|
|
|
private merchantService: MerchantService, |
|
|
|
|
private store: LocalStorageService, |
|
|
|
|
private orderManageService: OrderManageService, |
|
|
|
|
private orderService: OrderService, |
|
|
|
|
private orderOilService: OrderOilService, |
|
|
|
|
private tyAgentService: TyAgentService, |
|
|
|
|
private tySalesmanService: TySalesmanService, |
|
|
|
@ -456,4 +464,136 @@ export class OrderOilListComponent implements OnInit { |
|
|
|
|
this.refundRecordModal = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showPrintModal(orderNo: string, data: PrintData) { |
|
|
|
|
this.printDataObject.orderNo = orderNo; |
|
|
|
|
this.printDataObject.printData = data; |
|
|
|
|
this.printModal = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cloudPrint() { |
|
|
|
|
this.orderService.print(this.printDataObject.orderNo, 2, dataBack => { |
|
|
|
|
if (dataBack['return_code'] === '000000') { |
|
|
|
|
this.modal.success({ |
|
|
|
|
nzTitle: '提示', |
|
|
|
|
nzContent: '操作成功', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
showPrintDiv() { |
|
|
|
|
const data = this.printDataObject.printData; |
|
|
|
|
data['createTime'] = new Date(data['createTime']).toLocaleString(); |
|
|
|
|
this.printDiv(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
printDiv(data: object) { |
|
|
|
|
const headstr = '<html><head><title>打印小票</title></head><body>'; |
|
|
|
|
const footstr = '</body>'; |
|
|
|
|
const newstr = '<div id="div_print" style="font-size: 16px;">\n' + |
|
|
|
|
' <div style="float: left;margin-bottom: 150px;">\n' + |
|
|
|
|
' <div style="line-height: 30px; color:#000;">\n' + |
|
|
|
|
' <span style="font-size: 13px;float: left;width: 100%;">' + data['storeName'] + '</span>\n' + |
|
|
|
|
' <span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(客户存根)</span>\n' + |
|
|
|
|
' </div>\n' + |
|
|
|
|
' <table style="width: 100%;">\n' + |
|
|
|
|
' <tbody>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">流水号:<span>' + data['orderNo'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">时间:<span>' + data['createTime'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">来源:<span>嗨森逛</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">油枪:<span>' + data['gasGunNo'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">油品:<span>' + data['gasOilNo'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">升数:<span>' + data['gasOilLiters'] + '升</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">实际加油升数以油站加油机为准!</td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>\n' + |
|
|
|
|
' <tr><td style="font-size: 30px;color: black">¥' + data['gasRefuelPrice'] + '元</td></tr>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr><td style="float: left;font-size: xx-small;color: black;margin-left: 25px;">开心又省钱; 来”嗨森逛“</td></tr>\n' + |
|
|
|
|
' </tbody>\n' + |
|
|
|
|
' </table>\n' + |
|
|
|
|
' </div>\n' + |
|
|
|
|
' <div style="float: left;margin-bottom: 50px;">\n' + |
|
|
|
|
' <div style="line-height: 30px; color:#000;">\n' + |
|
|
|
|
' <span style="font-size: 13px;float: left;width: 100%;">' + data['storeName'] + '</span>\n' + |
|
|
|
|
' <span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(收银员存根)</span>\n' + |
|
|
|
|
' </div>\n' + |
|
|
|
|
' <table style="width: 100%;">\n' + |
|
|
|
|
' <tbody>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">流水号:<span>' + data['orderNo'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">时间:<span>' + data['createTime'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">来源:<span>嗨森逛</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">油枪:<span>' + data['gasGunNo'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">油品:<span>' + data['gasOilNo'] + '</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">升数:<span>' + data['gasOilLiters'] + '升</span></td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr>\n' + |
|
|
|
|
' <td style="font-size: xx-small;color: black;">实际加油升数以油站加油机为准!</td>\n' + |
|
|
|
|
' </tr>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>\n' + |
|
|
|
|
' <tr><td style="font-size: 30px;color: black">¥' + data['gasRefuelPrice'] + '元</td></tr>\n' + |
|
|
|
|
' <tr><td style="font-size: xx-small;color: black;">-------------------------------------------</td></tr>\n' + |
|
|
|
|
' <tr><td style="float: left;font-size: xx-small;color: black;margin-left: 25px;">开心又省钱; 来”嗨森逛“</td></tr>\n' + |
|
|
|
|
' </tbody>\n' + |
|
|
|
|
' </table>\n' + |
|
|
|
|
' </div>\n' + |
|
|
|
|
'</div>'; |
|
|
|
|
// const oldstr = document.body.innerHTML;
|
|
|
|
|
// document.body.innerHTML = headstr + newstr + footstr;
|
|
|
|
|
const newWindow = window.open('', ''); |
|
|
|
|
newWindow.document.write(headstr + newstr + footstr); |
|
|
|
|
newWindow.print(); |
|
|
|
|
newWindow.close(); |
|
|
|
|
// document.body.innerHTML = oldstr;
|
|
|
|
|
// location.reload();
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class PrintData { |
|
|
|
|
// 油站名称
|
|
|
|
|
gasName = ''; |
|
|
|
|
// 订单号
|
|
|
|
|
orderNo = ''; |
|
|
|
|
// 下单时间
|
|
|
|
|
createTime = ''; |
|
|
|
|
// 油品
|
|
|
|
|
gasOilNo = ''; |
|
|
|
|
// 加油抢号
|
|
|
|
|
gasGunNo = ''; |
|
|
|
|
// 加油升数
|
|
|
|
|
gasOilLiters = 0; |
|
|
|
|
// 加油金额
|
|
|
|
|
oilPrice = 0; |
|
|
|
|
} |
|
|
|
|