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..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 @@ -109,11 +109,10 @@ export class StoreEditComponent implements OnInit { return; } } - 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.validateForm.value.prestoreType === '0') { + if (this.validateForm.value.splitAccountNo == null || this.validateForm.value.splitRate == null) { + this.message.error('必填项不能为空'); + return; } } if (this.editFlag) { @@ -145,6 +144,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 = []; 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/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..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 @@
+
+ + 油站 + + + + + + +
订单号 @@ -76,7 +86,7 @@ (nzPageSizeChange)="getRequest(false , searchForm.value)"> - 编号 + 编号 订单号 油站名称 类型 @@ -89,8 +99,8 @@ 支付金额 优惠金额 创建时间 - 状态 - 操作 + 状态 + 操作 @@ -110,9 +120,15 @@ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.status | orderCouponStatus}} - 详情 - - 退款 + 打印小票 + 已打印({{data.printNum+'次'}}) + 操作列表 + + + @@ -153,3 +169,144 @@ + + 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..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 @@ -10,7 +10,8 @@ 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'; +import {MerchantStoreService} from "../../../services/merchant-store.service"; @Component({ selector: 'app-oil-station-order', @@ -36,6 +37,9 @@ export class OilStationOrderComponent implements OnInit { refundContent: string; roleType: number; secUser: object; + + gasArray = []; + constructor( private form: FormBuilder, private order: OrderService, @@ -45,6 +49,8 @@ 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 ) { @@ -52,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( @@ -65,6 +78,7 @@ export class OilStationOrderComponent implements OnInit { public init(): void { this.searchForm = this.form.group({ + storeId: [null], orderNo: [null], status: [null], createTime: [null], @@ -152,4 +166,122 @@ export class OilStationOrderComponent implements OnInit { } }); } + + 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' + + '
\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' + + '
'; + // 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/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/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); + }); + } +} 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 8ebb4f1..0f97376 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 },