From 94cee27e1c145fef0bd8902533c63fa4a26e1d7b Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Mon, 13 Nov 2023 19:34:26 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../merchant-list.component.html | 16 ++++--
.../merchant-list/merchant-list.component.ts | 50 +++++++++++++++----
2 files changed, 51 insertions(+), 15 deletions(-)
diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.html b/src/app/admin/merchant/merchant-list/merchant-list.component.html
index f97087e..9c433e5 100644
--- a/src/app/admin/merchant/merchant-list/merchant-list.component.html
+++ b/src/app/admin/merchant/merchant-list/merchant-list.component.html
@@ -118,7 +118,7 @@
余额充值记录
- 商户平台配置
+ 商户平台配置
@@ -203,10 +203,11 @@
+
+
+
+
+
+
+
diff --git a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts
index f114ef9..4eedd59 100644
--- a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts
+++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts
@@ -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 = '打印小票';
+ const footstr = '';
+ const newstr = '\n' +
+ '
\n' +
+ '
\n' +
+ ' ' + data['storeName'] + '\n' +
+ ' (客户存根)\n' +
+ '
\n' +
+ '
\n' +
+ ' \n' +
+ ' ------------------------------------------- |
\n' +
+ ' \n' +
+ ' 流水号:' + data['orderNo'] + ' | \n' +
+ '
\n' +
+ ' ------------------------------------------- |
\n' +
+ ' \n' +
+ ' 时间:' + data['createTime'] + ' | \n' +
+ '
\n' +
+ ' \n' +
+ ' 来源:嗨森逛 | \n' +
+ '
\n' +
+ ' \n' +
+ ' 油枪:' + data['gasGunNo'] + ' | \n' +
+ '
\n' +
+ ' \n' +
+ ' 油品:' + data['gasOilNo'] + ' | \n' +
+ '
\n' +
+ ' \n' +
+ ' 升数:' + data['gasOilLiters'] + '升 | \n' +
+ '
\n' +
+ ' \n' +
+ ' 实际加油升数以油站加油机为准! | \n' +
+ '
\n' +
+ ' ------------------------------------------- |
\n' +
+ ' 加油金额 |
\n' +
+ ' ¥' + data['gasRefuelPrice'] + '元 |
\n' +
+ ' ------------------------------------------- |
\n' +
+ ' 开心又省钱; 来”嗨森逛“ |
\n' +
+ ' \n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ ' ' + data['storeName'] + '\n' +
+ ' (收银员存根)\n' +
+ '
\n' +
+ '
\n' +
+ ' \n' +
+ ' ------------------------------------------- |
\n' +
+ ' \n' +
+ ' 流水号:' + data['orderNo'] + ' | \n' +
+ '
\n' +
+ ' ------------------------------------------- |
\n' +
+ ' \n' +
+ ' 时间:' + data['createTime'] + ' | \n' +
+ '
\n' +
+ ' \n' +
+ ' 来源:嗨森逛 | \n' +
+ '
\n' +
+ ' \n' +
+ ' 油枪:' + data['gasGunNo'] + ' | \n' +
+ '
\n' +
+ ' \n' +
+ ' 油品:' + data['gasOilNo'] + ' | \n' +
+ '
\n' +
+ ' \n' +
+ ' 升数:' + data['gasOilLiters'] + '升 | \n' +
+ '
\n' +
+ ' \n' +
+ ' 实际加油升数以油站加油机为准! | \n' +
+ '
\n' +
+ ' ------------------------------------------- |
\n' +
+ ' 加油金额 |
\n' +
+ ' ¥' + data['gasRefuelPrice'] + '元 |
\n' +
+ ' ------------------------------------------- |
\n' +
+ ' 开心又省钱; 来”嗨森逛“ |
\n' +
+ ' \n' +
+ '
\n' +
+ '
\n' +
+ '
';
+ // 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;
}
diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts
index 3ea3e41..97d1495 100644
--- a/src/app/services/order.service.ts
+++ b/src/app/services/order.service.ts
@@ -22,7 +22,7 @@ export class OrderService {
* @param callBack 回调
*/
public print(orderId: number, printType: number, callBack) {
- this.http.get(environment.baseUrl + 'highOrder/print?orderId=' + orderId + '&printType=' + printType).subscribe(data => {
+ this.http.get(environment.baseUrl + 'highOrder/print?orderNo=' + orderId + '&printType=' + printType).subscribe(data => {
callBack(data);
});
}
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index fc4bf0d..3661fbd 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -4,7 +4,7 @@
export const environment = {
production: false,
- baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
+ baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址)
// baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// baseUrl: 'https://hsg.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址)