From 110a0c905bf1acb233f372d8441e103e224717de Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 1 Jun 2022 11:21:24 +0800 Subject: [PATCH 1/6] =?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 --- .../store-edit/store-edit.component.html | 16 ++++++++++++++++ .../store-edit/store-edit.component.scss | 4 ++++ .../store-edit/store-edit.component.ts | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.html b/src/app/admin/merchant-store/store-edit/store-edit.component.html index 5777f41..fcbdfde 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.html +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.html @@ -46,6 +46,22 @@ +
+ + 分账商户号 + + + + +
+
+ + 分账比例(%) + + + + +
门店类型 diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.scss b/src/app/admin/merchant-store/store-edit/store-edit.component.scss index 800400d..f8e0222 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.scss +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.scss @@ -5,3 +5,7 @@ button { background-color: #ffffff; } #container {width:800px; height: 500px; } + +nz-input-number { + width: 100%; +} diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.ts b/src/app/admin/merchant-store/store-edit/store-edit.component.ts index 32b53e4..2797ce7 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.ts +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.ts @@ -61,6 +61,9 @@ export class StoreEditComponent implements OnInit { address: [null, [Validators.required]], contactName: [null, [Validators.required]], prestoreType: [null, [Validators.required]], + splitType: [1], + splitAccountNo: [null], + splitRate: [null], telephone: [null, [Validators.required]], latitude: [29.553134, [Validators.required]], longitude: [106.565428, [Validators.required]], @@ -109,6 +112,15 @@ export class StoreEditComponent implements OnInit { return; } } + if (this.validateForm.value.prestoreType === '0') { + if (this.validateForm.value.splitAccountNo == null || this.validateForm.value.splitRate == null) { + this.message.error('必填项不能为空'); + return; + } + this.validateForm.value.splitAccounts = { type: this.validateForm.value.splitType, + accountNo: this.validateForm.value.splitAccountNo, + rate: this.validateForm.value.splitRate }; + } if (this.logoFile.length !== 0) { if (this.logoFile[0]['response'] != null) { this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0]; @@ -116,6 +128,7 @@ export class StoreEditComponent implements OnInit { this.validateForm.value.storeLogo = this.logoFile[0].name; } } + if (this.editFlag) { this.validateForm.value.id = this.id; this.merchantStore.updateMerchantStore(this.validateForm.value, data => { @@ -145,6 +158,7 @@ export class StoreEditComponent implements OnInit { console.log(data); data['return_data']['brandId'] = String(data['return_data']['brandId']); data['return_data']['type'] = String(data['return_data']['type']); + data['return_data']['prestoreType'] = String(data['return_data']['prestoreType']); if (data['return_data']['storeLogo'] != null && data['return_data']['storeLogo'] !== '') { const logo = String(data['return_data']['storeLogo']); const logoArray = []; @@ -157,6 +171,11 @@ export class StoreEditComponent implements OnInit { }); this.logoFile = logoArray; } + if (data['return_data']['splitAccounts'] != null) { + data['return_data']['splitType'] = data['return_data']['splitAccounts']['type']; + data['return_data']['splitAccountNo'] = data['return_data']['splitAccounts']['accountNo']; + data['return_data']['splitRate'] = data['return_data']['splitAccounts']['rate']; + } this.validateForm.patchValue(data['return_data']); this.getMap(); } else { From d1fb8ea5046ce10d00ac5e89b1cff8f76ffd1255 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 1 Jun 2022 15:25:12 +0800 Subject: [PATCH 2/6] =?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 --- .../store-edit/store-edit.component.html | 16 ----- .../store-edit/store-edit.component.ts | 19 ------ .../merchant-list.component.html | 54 ++++++++++++++- .../merchant-list.component.scss | 3 + .../merchant-list/merchant-list.component.ts | 65 ++++++++++++++++++- .../merchant-tripartite-platform.service.ts | 39 +++++++++++ 6 files changed, 157 insertions(+), 39 deletions(-) create mode 100644 src/app/services/merchant-tripartite-platform.service.ts diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.html b/src/app/admin/merchant-store/store-edit/store-edit.component.html index fcbdfde..5777f41 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.html +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.html @@ -46,22 +46,6 @@
-
- - 分账商户号 - - - - -
-
- - 分账比例(%) - - - - -
门店类型 diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.ts b/src/app/admin/merchant-store/store-edit/store-edit.component.ts index 2797ce7..b1404f2 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.ts +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.ts @@ -61,9 +61,6 @@ export class StoreEditComponent implements OnInit { address: [null, [Validators.required]], contactName: [null, [Validators.required]], prestoreType: [null, [Validators.required]], - splitType: [1], - splitAccountNo: [null], - splitRate: [null], telephone: [null, [Validators.required]], latitude: [29.553134, [Validators.required]], longitude: [106.565428, [Validators.required]], @@ -117,18 +114,7 @@ export class StoreEditComponent implements OnInit { this.message.error('必填项不能为空'); return; } - this.validateForm.value.splitAccounts = { type: this.validateForm.value.splitType, - accountNo: this.validateForm.value.splitAccountNo, - rate: this.validateForm.value.splitRate }; } - if (this.logoFile.length !== 0) { - if (this.logoFile[0]['response'] != null) { - this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0]; - } else { - this.validateForm.value.storeLogo = this.logoFile[0].name; - } - } - if (this.editFlag) { this.validateForm.value.id = this.id; this.merchantStore.updateMerchantStore(this.validateForm.value, data => { @@ -171,11 +157,6 @@ export class StoreEditComponent implements OnInit { }); this.logoFile = logoArray; } - if (data['return_data']['splitAccounts'] != null) { - data['return_data']['splitType'] = data['return_data']['splitAccounts']['type']; - data['return_data']['splitAccountNo'] = data['return_data']['splitAccounts']['accountNo']; - data['return_data']['splitRate'] = data['return_data']['splitAccounts']['rate']; - } this.validateForm.patchValue(data['return_data']); this.getMap(); } else { 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 706d723..a49b999 100644 --- a/src/app/admin/merchant/merchant-list/merchant-list.component.html +++ b/src/app/admin/merchant/merchant-list/merchant-list.component.html @@ -80,7 +80,7 @@ 商户电话 创建时间 状态 - 操作 + 操作 @@ -105,6 +105,8 @@ + + @@ -115,7 +117,7 @@ 充值金额 - +
@@ -124,6 +126,54 @@ + +
+ + 第三方平台 + + + + + + + + + 商户名称 + + + + + + + 商户号 + + + + + + + 是否分账 + + + + + + + + + + 是否分账(%) + + + + + +
+ +
+
+
+ diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.scss b/src/app/admin/merchant/merchant-list/merchant-list.component.scss index 8bee3fb..0325db1 100644 --- a/src/app/admin/merchant/merchant-list/merchant-list.component.scss +++ b/src/app/admin/merchant/merchant-list/merchant-list.component.scss @@ -2,3 +2,6 @@ height: 60px; width: 60px; } +nz-input-number { + width: 100%; +} 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 3737264..e7f8f2b 100644 --- a/src/app/admin/merchant/merchant-list/merchant-list.component.ts +++ b/src/app/admin/merchant/merchant-list/merchant-list.component.ts @@ -6,7 +6,8 @@ import {CommonsService} from '../../../services/commons.service'; import {MerchantService} from '../../../services/merchant.service'; import {Router} from '@angular/router'; import {environment} from '../../../../environments/environment'; -import {MerAmountService} from "../../../services/mer-amount.service"; +import {MerAmountService} from '../../../services/mer-amount.service'; +import {MerchantTripartitePlatformService} from '../../../services/merchant-tripartite-platform.service'; @Component({ selector: 'app-merchant-list', @@ -25,12 +26,16 @@ export class MerchantListComponent implements OnInit { rechargeModal = false; rechargeForm: FormGroup; // 充值模态框 + tripartitePlatformModal = false; + tripartitePlatformForm: FormGroup; // 充值模态框 + constructor( private form: FormBuilder, private merchant: MerchantService, private iconService: IconService, private message: NzMessageService, private merAmountService: MerAmountService, + private tripartitePlatformService: MerchantTripartitePlatformService, private router: Router, private common: CommonsService, private modal: NzModalService, @@ -53,6 +58,15 @@ export class MerchantListComponent implements OnInit { merId: [null], amount: [null, [Validators.required]], }); + + this.tripartitePlatformForm = this.form.group({ + merId: [null], + platformType: ['1', [Validators.required]], + platformMerName: [null, [Validators.required]], + platformMerNumber: [null, [Validators.required]], + profitSharingStatus: ['false', [Validators.required]], + profitSharingRatio: [null], + }); this.getRequest(true, this.searchForm.value); } @@ -145,7 +159,7 @@ export class MerchantListComponent implements OnInit { showRechargeModal(merId: number) { - this.rechargeForm.patchValue({ merId: merId}); + this.rechargeForm.patchValue({ merId}); this.rechargeModal = true; } @@ -182,5 +196,52 @@ 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' }); + } + }); + this.tripartitePlatformModal = true; + } + + closeTripartitePlatformModal() { + this.tripartitePlatformForm.reset(); + this.tripartitePlatformModal = false; + } + + submitTripartitePlatform() { + for (const i in this.tripartitePlatformForm.controls) { + this.tripartitePlatformForm.controls[i].markAsDirty(); + this.tripartitePlatformForm.controls[i].updateValueAndValidity(); + } + if (this.tripartitePlatformForm.status == null || this.tripartitePlatformForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + this.tripartitePlatformService.editTripartitePlatform(this.tripartitePlatformForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '保存成功', + }); + this.closeTripartitePlatformModal(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + } diff --git a/src/app/services/merchant-tripartite-platform.service.ts b/src/app/services/merchant-tripartite-platform.service.ts new file mode 100644 index 0000000..58cf088 --- /dev/null +++ b/src/app/services/merchant-tripartite-platform.service.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; +import {CommonsService} from './commons.service'; +import {environment} from '../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class MerchantTripartitePlatformService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 查询商户列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public editTripartitePlatform(paramsObject: object, callBack) { + this.http.post(environment.baseUrl + 'merchantTripartitePlatform/editTripartitePlatform', paramsObject).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询详情 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getDetail(merId: number, platformType: number, callBack) { + this.http.get(environment.baseUrl + 'merchantTripartitePlatform/getDetail?merId=' + merId + '&platformType=' + platformType).subscribe(data => { + callBack(data); + }); + } +} From f5550c81bbde92b9e530b1d82204785020a16913 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 2 Jun 2022 10:50:59 +0800 Subject: [PATCH 3/6] =?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 --- .../oil-station-order.component.html | 97 +++++++++++++++++-- .../oil-station-order.component.ts | 21 ++++ .../ty-order-list.component.html | 22 +++++ .../ty-order-list/ty-order-list.component.ts | 1 + src/environments/environment.ts | 8 +- 5 files changed, 139 insertions(+), 10 deletions(-) diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html index 7686ff5..01f2c81 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.html +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html @@ -76,7 +76,7 @@ (nzPageSizeChange)="getRequest(false , searchForm.value)"> - 编号 + 编号 订单号 油站名称 类型 @@ -89,8 +89,8 @@ 支付金额 优惠金额 创建时间 - 状态 - 操作 + 状态 + 操作 @@ -110,9 +110,14 @@ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.status | orderCouponStatus}} - 详情 - - 退款 + + 操作列表 + + + @@ -153,3 +158,83 @@ + + +
+
油站名称
+
{{printData['gasName']}}
+
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
油站名称
+
{{printData['gasName']}}
+
+
diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts index 4c78b49..0ef5a56 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.ts +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts @@ -36,6 +36,11 @@ export class OilStationOrderComponent implements OnInit { refundContent: string; roleType: number; secUser: object; + + + printModal = false; + printData = {}; + constructor( private form: FormBuilder, private order: OrderService, @@ -152,4 +157,20 @@ export class OilStationOrderComponent implements OnInit { } }); } + + /** + * 打开打印小票模态框 + */ + showPrintModal(data: object) { + this.printData = data; + this.printModal = true; + } + + /** + * 关闭打印小票模态框 + */ + closePrintModal() { + this.printData = {}; + this.printModal = false; + } } diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html index 2d2f6ca..5d7f04d 100644 --- a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html +++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html @@ -72,6 +72,19 @@
+
+ + 订单状态 + + + + + + + + + +
@@ -117,6 +130,8 @@ 团油枪价 创建时间 支付时间 + 订单状态 + 退款时间 操作 @@ -139,6 +154,13 @@ {{data.gasPriceGun}}元 {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} {{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + 已完成 + 已退款 + 退款中 + 退款驳回 + + {{data.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}} 操作列表 diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts index 38cd5ec..cbc8d58 100644 --- a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts +++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts @@ -53,6 +53,7 @@ export class TyOrderListComponent implements OnInit { salesmanId: [null], memPhone: [null], payTimeArray: [null], + orderStatus: [null], }); this.requestData(1); diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 8ebb4f1..c0bc8fa 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,10 +4,10 @@ export const environment = { production: false, - baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'http://localhost:9302/filesystem/', -/* baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://hsg.dctpay.com/filesystem/',*/ +/* baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'http://localhost:9302/filesystem/',*/ + baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://hsg.dctpay.com/filesystem/', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', }; From e0fd00cc7ad154ad9e897adf2ad00285a9eefc50 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 2 Jun 2022 17:43:45 +0800 Subject: [PATCH 4/6] =?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 --- .../oil-station-order.component.html | 219 +++++++++++------- .../oil-station-order.component.ts | 132 +++++++++-- src/environments/environment.ts | 4 +- tsconfig.json | 3 +- 4 files changed, 260 insertions(+), 98 deletions(-) diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html index 01f2c81..b160fc1 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.html +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html @@ -110,7 +110,7 @@ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.status | orderCouponStatus}} - + 打印小票 操作列表
    @@ -159,82 +159,143 @@ - -
    -
    油站名称
    -
    {{printData['gasName']}}
    + diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts index 0ef5a56..8f56b9f 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.ts +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts @@ -10,7 +10,7 @@ import {MerchantService} from '../../../services/merchant.service'; import {LocalStorageService} from '../../../services/local-storage.service'; import {CommonsService} from '../../../services/commons.service'; import {WebsocketService} from '../../../services/websocket.service'; -import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; @Component({ selector: 'app-oil-station-order', @@ -37,9 +37,15 @@ export class OilStationOrderComponent implements OnInit { roleType: number; secUser: object; - - printModal = false; - printData = {}; + printDataObject: PrintData = { + gasName: '', + orderNo: '', + createTime: '', + gasOilNo: '', + gasGunNo: '', + gasOilLiters: 0, + oilPrice: 0 + }; constructor( private form: FormBuilder, @@ -158,19 +164,113 @@ export class OilStationOrderComponent implements OnInit { }); } - /** - * 打开打印小票模态框 - */ - showPrintModal(data: object) { - this.printData = data; - this.printModal = true; + showPrintDiv(data: PrintData) { + data['createTime'] = new Date(data['createTime']).toLocaleString(); + this.printDiv(data); } - /** - * 关闭打印小票模态框 - */ - closePrintModal() { - this.printData = {}; - this.printModal = false; + printDiv(data: object) { + const headstr = '打印小票'; + const footstr = ''; + const newstr = '
    \n' + + '
    \n' + + '
    \n' + + ' ' + data['gasName'] + '\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['totalPrice'] + '元
    ---------------------------------------------------
    开心又省钱; 来”嗨森逛“
    \n' + + '
    \n' + + '
    \n' + + '
    \n' + + ' ' + data['gasName'] + '\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['totalPrice'] + '元
    ---------------------------------------------------
    开心又省钱; 来”嗨森逛“
    \n' + + '
    \n' + + '
    '; + console.log(newstr); + // const oldstr = document.body.innerHTML; + document.body.innerHTML = headstr + newstr + footstr; + window.print(); + // document.body.innerHTML = oldstr; + location.reload(); + return false; } } + +export class PrintData { + // 油站名称 + gasName = ''; + // 订单号 + orderNo = ''; + // 下单时间 + createTime = ''; + // 油品 + gasOilNo = ''; + // 加油抢号 + gasGunNo = ''; + // 加油升数 + gasOilLiters = 0; + // 加油金额 + oilPrice = 0; +} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index c0bc8fa..ca22a39 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -6,8 +6,8 @@ export const environment = { production: false, /* baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) imageUrl: 'http://localhost:9302/filesystem/',*/ - baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://hsg.dctpay.com/filesystem/', + baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://hsgcs.dctpay.com/filesystem/', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', }; diff --git a/tsconfig.json b/tsconfig.json index 9ddd180..0d19327 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,8 @@ ], "lib": [ "es2018", - "dom" + "dom", + "scripthost" ], "allowSyntheticDefaultImports": true }, From ce0cb0f91b7922ce33e6c2b9f7af8a08b39a7983 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 6 Jun 2022 11:05:16 +0800 Subject: [PATCH 5/6] =?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 --- .../oil-station-order.component.html | 3 +- .../oil-station-order.component.ts | 65 +++++++++++-------- src/app/services/order.service.ts | 13 ++++ src/environments/environment.ts | 8 +-- 4 files changed, 56 insertions(+), 33 deletions(-) diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html index b160fc1..4ab5db6 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.html +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html @@ -110,7 +110,8 @@ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.status | orderCouponStatus}} - 打印小票 + 打印小票 + 已打印({{data.printNum+'次'}}) 操作列表
      diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts index 8f56b9f..ce79676 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.ts +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts @@ -56,6 +56,7 @@ export class OilStationOrderComponent implements OnInit { private router: Router, private company: CompanyService, private merchant: MerchantService, + private orderService: OrderService, private store: LocalStorageService, // 数据请求 private common: CommonsService ) { @@ -164,15 +165,21 @@ export class OilStationOrderComponent implements OnInit { }); } - showPrintDiv(data: PrintData) { + showPrintDiv(orderId: number, data: PrintData) { data['createTime'] = new Date(data['createTime']).toLocaleString(); this.printDiv(data); + + this.orderService.print(orderId, dataBack => { + if (dataBack['return_code'] === '000000') { + this.getRequest(false, this.searchForm.value); + } + }); } printDiv(data: object) { const headstr = '打印小票'; const footstr = ''; - const newstr = '
      \n' + + const newstr = '
      \n' + '
      \n' + '
      \n' + ' ' + data['gasName'] + '\n' + @@ -180,33 +187,33 @@ export class OilStationOrderComponent implements OnInit { '
      \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' + ' \n' + ' \n' + ' \n' + - ' \n' + - ' \n' + + ' \n' + + ' \n' + ' \n' + '
      ---------------------------------------------------
      -------------------------------------------
      流水号:' + data['orderNo'] + '流水号:' + data['orderNo'] + '
      ---------------------------------------------------
      -------------------------------------------
      时间:' + data['createTime'] + '时间:' + data['createTime'] + '
      来源:嗨森逛来源:嗨森逛
      油枪:' + data['gasGunNo'] + '油枪:' + data['gasGunNo'] + '
      油品:' + data['gasOilNo'] + '油品:' + data['gasOilNo'] + '
      升数:' + data['gasOilLiters'] + '升升数:' + data['gasOilLiters'] + '升
      实际加油升数以油站加油机为准!实际加油升数以油站加油机为准!
      加油金额
      ¥' + data['totalPrice'] + '元
      ---------------------------------------------------
      开心又省钱; 来”嗨森逛“
      -------------------------------------------
      开心又省钱; 来”嗨森逛“
      \n' + '
      \n' + @@ -217,43 +224,45 @@ export class OilStationOrderComponent implements OnInit { '
      \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' + ' \n' + ' \n' + ' \n' + - ' \n' + - ' \n' + + ' \n' + + ' \n' + ' \n' + '
      ---------------------------------------------------
      -------------------------------------------
      流水号:' + data['orderNo'] + '流水号:' + data['orderNo'] + '
      ---------------------------------------------------
      -------------------------------------------
      时间:' + data['createTime'] + '时间:' + data['createTime'] + '
      嗨森逛来源:嗨森逛
      油枪:' + data['gasGunNo'] + '油枪:' + data['gasGunNo'] + '
      油品:' + data['gasOilNo'] + '油品:' + data['gasOilNo'] + '
      升数:' + data['gasOilLiters'] + '升升数:' + data['gasOilLiters'] + '升
      实际加油升数以油站加油机为准!实际加油升数以油站加油机为准!
      加油金额
      ¥' + data['totalPrice'] + '元
      ---------------------------------------------------
      开心又省钱; 来”嗨森逛“
      -------------------------------------------
      开心又省钱; 来”嗨森逛“
      \n' + '
      \n' + '
    '; - console.log(newstr); // const oldstr = document.body.innerHTML; - document.body.innerHTML = headstr + newstr + footstr; - window.print(); + // 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(); + // location.reload(); return false; } } diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts index fe68ecf..b6613fc 100644 --- a/src/app/services/order.service.ts +++ b/src/app/services/order.service.ts @@ -14,6 +14,19 @@ export class OrderService { ) { } + /** + * 打印 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public print(orderId: number, callBack) { + this.http.get(environment.baseUrl + 'highOrder/print?orderId=' + orderId).subscribe(data => { + callBack(data); + }); + } + + /** * 查询订单列表 * diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ca22a39..0f97376 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,10 +4,10 @@ export const environment = { production: false, -/* baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'http://localhost:9302/filesystem/',*/ - baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://hsgcs.dctpay.com/filesystem/', + baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'http://localhost:9302/filesystem/', +/* baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://hsgcs.dctpay.com/filesystem/',*/ key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', }; From d7fb86ad154d9f91e95a1700a14db5c5e921eed0 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 6 Jun 2022 15:14:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oil-station-order.component.html | 16 ++++++++++++--- .../oil-station-order.component.ts | 20 ++++++++++--------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html index 4ab5db6..56e9a80 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.html +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html @@ -6,6 +6,16 @@
    +
    + + 油站 + + + + + + +
    订单号 @@ -110,13 +120,13 @@ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.status | orderCouponStatus}} - 打印小票 - 已打印({{data.printNum+'次'}}) + 打印小票 + 已打印({{data.printNum+'次'}}) 操作列表 diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts index ce79676..d91c4da 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.ts +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts @@ -11,6 +11,7 @@ import {LocalStorageService} from '../../../services/local-storage.service'; import {CommonsService} from '../../../services/commons.service'; import {WebsocketService} from '../../../services/websocket.service'; import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {MerchantStoreService} from "../../../services/merchant-store.service"; @Component({ selector: 'app-oil-station-order', @@ -37,15 +38,7 @@ export class OilStationOrderComponent implements OnInit { roleType: number; secUser: object; - printDataObject: PrintData = { - gasName: '', - orderNo: '', - createTime: '', - gasOilNo: '', - gasGunNo: '', - gasOilLiters: 0, - oilPrice: 0 - }; + gasArray = []; constructor( private form: FormBuilder, @@ -56,6 +49,7 @@ export class OilStationOrderComponent implements OnInit { private router: Router, private company: CompanyService, private merchant: MerchantService, + private merchantStoreService: MerchantStoreService, private orderService: OrderService, private store: LocalStorageService, // 数据请求 private common: CommonsService @@ -64,6 +58,13 @@ export class OilStationOrderComponent implements OnInit { ngOnInit(): void { this.secUser = this.store.get(ADMIN_INFO_OBJECT)['secUser']; + if (this.secUser['objectType'] === 2) { + this.merchantStoreService.getStoreListByMerchant({ pageNum: 1, pageSize: 100}, data => { + if (data['return_code'] === '000000') { + this.gasArray = data['return_data']['list']; + } + }); + } this.init(); // 接收消息 this.webSocketService.messageSubject.subscribe( @@ -77,6 +78,7 @@ export class OilStationOrderComponent implements OnInit { public init(): void { this.searchForm = this.form.group({ + storeId: [null], orderNo: [null], status: [null], createTime: [null],