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 @@
    - 第三方平台 - - + 第三方平台 + + + @@ -225,6 +226,13 @@ + + 商户KEY + + + + + 是否分账 diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.ts b/src/app/admin/merchant/merchant-list/merchant-list.component.ts index 6560669..b0c17c1 100644 --- a/src/app/admin/merchant/merchant-list/merchant-list.component.ts +++ b/src/app/admin/merchant/merchant-list/merchant-list.component.ts @@ -73,6 +73,7 @@ export class MerchantListComponent implements OnInit { platformType: ['1', [Validators.required]], platformMerName: [null, [Validators.required]], platformMerNumber: [null, [Validators.required]], + platformMerKey: [null], profitSharingStatus: ['false', [Validators.required]], profitSharingRatio: [null], profitSharingReceiversNumber: [null], @@ -260,21 +261,48 @@ export class MerchantListComponent implements OnInit { } - showTripartitePlatformModal(merId: number) { - this.tripartitePlatformService.getDetail(merId, 1, data => { - if (data['return_data'] != null) { - data['return_data']['platformType'] = String(data['return_data']['platformType']); - data['return_data']['profitSharingStatus'] = String(data['return_data']['profitSharingStatus']); - this.tripartitePlatformForm.patchValue(data['return_data']); - } else { - this.tripartitePlatformForm.patchValue( { merId: merId, platformType: '1', profitSharingStatus: 'false' }); - } - }); + showTripartitePlatformModal(merId: number, platformType: number) { + this.getPlatformDetail(merId, platformType); this.tripartitePlatformModal = true; } + getPlatformDetail(merId: number, platformType: number) { + if (merId != null) { + this.tripartitePlatformService.getDetail(merId, platformType, data => { + if (data['return_data'] != null) { + const dataObj = data['return_data']; + this.tripartitePlatformForm.controls['merId'].setValue(dataObj['merId']); + this.tripartitePlatformForm.controls['platformMerName'].setValue(dataObj['platformMerName']); + this.tripartitePlatformForm.controls['platformMerNumber'].setValue(dataObj['platformMerNumber']); + this.tripartitePlatformForm.controls['platformMerKey'].setValue(dataObj['platformMerKey']); + this.tripartitePlatformForm.controls['profitSharingStatus'].setValue(String(dataObj['profitSharingStatus'])); + this.tripartitePlatformForm.controls['profitSharingRatio'].setValue(dataObj['profitSharingRatio']); + this.tripartitePlatformForm.controls['profitSharingReceiversNumber'].setValue(dataObj['profitSharingReceiversNumber']); + this.tripartitePlatformForm.controls['profitSharingReceiversName'].setValue(dataObj['profitSharingReceiversName']); + } else { + this.tripartitePlatformForm.controls['merId'].setValue(merId); + this.tripartitePlatformForm.controls['platformMerName'].setValue(null); + this.tripartitePlatformForm.controls['platformMerNumber'].setValue(null); + this.tripartitePlatformForm.controls['platformMerKey'].setValue(null); + this.tripartitePlatformForm.controls['profitSharingStatus'].setValue('false'); + this.tripartitePlatformForm.controls['profitSharingRatio'].setValue(null); + this.tripartitePlatformForm.controls['profitSharingReceiversNumber'].setValue(null); + this.tripartitePlatformForm.controls['profitSharingReceiversName'].setValue(null); + } + }); + } + } + closeTripartitePlatformModal() { - this.tripartitePlatformForm.reset(); + this.tripartitePlatformForm.controls['merId'].setValue(null); + this.tripartitePlatformForm.controls['platformMerName'].setValue(null); + this.tripartitePlatformForm.controls['platformMerNumber'].setValue(null); + this.tripartitePlatformForm.controls['platformType'].setValue(String(1)); + this.tripartitePlatformForm.controls['platformMerKey'].setValue(null); + this.tripartitePlatformForm.controls['profitSharingStatus'].setValue('false'); + this.tripartitePlatformForm.controls['profitSharingRatio'].setValue(null); + this.tripartitePlatformForm.controls['profitSharingReceiversNumber'].setValue(null); + this.tripartitePlatformForm.controls['profitSharingReceiversName'].setValue(null); this.tripartitePlatformModal = false; } From c392dbeb6d58d9bab0c774145ac2790b2f37a8c1 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 15 Nov 2023 15:30:56 +0800 Subject: [PATCH 2/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 --- .../gas-class-group-task.component.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts b/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts index 5e552dd..2cea44e 100644 --- a/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts +++ b/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts @@ -85,17 +85,19 @@ export class GasClassGroupTaskComponent implements OnInit { * 请求数据 */ requestData(pageNum) { - this.tableLoading = true; - this.whereObject['pageNum'] = pageNum; - this.whereObject['pageSize'] = 10; - this.gasClassGroupTaskService.getClassGroupTaskList(this.whereObject, data => { - if (data['return_code'] === '000000') { - this.dataObject = data['return_data']; - } else { - this.modal.error(data['return_msg']); - } - this.tableLoading = false; - }); + if (pageNum != null) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.gasClassGroupTaskService.getClassGroupTaskList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } } /** From a3c925de4cc3c326bd07bdc18e9c45ecafe7a9cc Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 17 Nov 2023 19:00:27 +0800 Subject: [PATCH 3/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 --- .../order-oil-list.component.html | 159 ++++++++++++++++++ .../order-oil-list.component.ts | 140 +++++++++++++++ src/app/services/order.service.ts | 2 +- src/environments/environment.ts | 2 +- 4 files changed, 301 insertions(+), 2 deletions(-) diff --git a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html index f8eb180..b0f1ee9 100644 --- a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html +++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html @@ -299,6 +299,7 @@
    • 交易详情
    • 交易退款
    • +
    • 打印小票
    • 退款记录
    @@ -488,3 +489,161 @@ + + + + + + + + + + + + + + + + + + + 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' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '
    -------------------------------------------
    流水号:' + data['orderNo'] + '
    -------------------------------------------
    时间:' + data['createTime'] + '
    来源:嗨森逛
    油枪:' + data['gasGunNo'] + '
    油品:' + data['gasOilNo'] + '
    升数:' + data['gasOilLiters'] + '升
    实际加油升数以油站加油机为准!
    -------------------------------------------
    加油金额
    ¥' + data['gasRefuelPrice'] + '元
    -------------------------------------------
    开心又省钱; 来”嗨森逛“
    \n' + + '
    \n' + + '
    \n' + + '
    \n' + + ' ' + data['storeName'] + '\n' + + ' (收银员存根)\n' + + '
    \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '
    -------------------------------------------
    流水号:' + data['orderNo'] + '
    -------------------------------------------
    时间:' + data['createTime'] + '
    来源:嗨森逛
    油枪:' + data['gasGunNo'] + '
    油品:' + data['gasOilNo'] + '
    升数:' + data['gasOilLiters'] + '升
    实际加油升数以油站加油机为准!
    -------------------------------------------
    加油金额
    ¥' + data['gasRefuelPrice'] + '元
    -------------------------------------------
    开心又省钱; 来”嗨森逛“
    \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/', // 正式环境服务器地址(请求数据地址)