From ce9300e22e531565014ec8d399d56ea390b4ef0e Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 19 May 2022 13:45:24 +0800 Subject: [PATCH] 1 --- .../refund-audit/refund-audit.component.ts | 1 - .../discount-edit/discount-edit.component.ts | 1 + src/app/admin/index/index-routing.module.ts | 4 +- src/app/admin/index/index.module.ts | 3 +- .../admin/index/index/index.component.html | 33 +- src/app/admin/index/index/index.component.ts | 60 +++- .../merchant-store-routing.module.ts | 4 + .../merchant-store/merchant-store.module.ts | 24 +- .../store-detail/store-detail.component.html | 13 +- .../store-detail/store-detail.component.ts | 65 ++-- .../store-edit/store-edit.component.html | 279 +++++++++------ .../store-edit/store-edit.component.ts | 33 +- .../store-list/store-list.component.html | 23 +- .../store-list/store-list.component.ts | 332 ++++++++++-------- .../merchant-detail.component.html | 11 + .../merchant-detail.component.ts | 59 ++-- src/app/app-common.module.ts | 2 + src/app/services/index.service.ts | 55 +++ src/app/services/merchant-store.service.ts | 87 +++++ 19 files changed, 735 insertions(+), 354 deletions(-) diff --git a/src/app/admin/audit/refund-audit/refund-audit.component.ts b/src/app/admin/audit/refund-audit/refund-audit.component.ts index f741b8c..cd299d9 100644 --- a/src/app/admin/audit/refund-audit/refund-audit.component.ts +++ b/src/app/admin/audit/refund-audit/refund-audit.component.ts @@ -116,7 +116,6 @@ export class RefundAuditComponent implements OnInit { if (refundSource === 1) { this.recharge.getOrderById(id , data => { if (data['return_code'] === '000000') { - console.log(data); this.data = data['return_data']; } else { this.message.error(data['return_msg']); diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.ts b/src/app/admin/discount/discount-edit/discount-edit.component.ts index 8a8d5d6..18c6f28 100644 --- a/src/app/admin/discount/discount-edit/discount-edit.component.ts +++ b/src/app/admin/discount/discount-edit/discount-edit.component.ts @@ -33,6 +33,7 @@ export class DiscountEditComponent implements OnInit { WEB_SERVE_URL = environment.baseUrl; previewImage: string | undefined = ''; previewVisible = false; + wx: WebSocket; constructor( private fb: FormBuilder, diff --git a/src/app/admin/index/index-routing.module.ts b/src/app/admin/index/index-routing.module.ts index 5f8bf62..74da3ab 100644 --- a/src/app/admin/index/index-routing.module.ts +++ b/src/app/admin/index/index-routing.module.ts @@ -1,10 +1,12 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import {IndexComponent} from './index/index.component'; +import {TestComponent} from './test/test.component'; const routes: Routes = [ - { path: '', component: IndexComponent } + { path: '', component: IndexComponent }, + { path: 'test', component: TestComponent } ]; @NgModule({ diff --git a/src/app/admin/index/index.module.ts b/src/app/admin/index/index.module.ts index 5a685a4..a9c8c0c 100644 --- a/src/app/admin/index/index.module.ts +++ b/src/app/admin/index/index.module.ts @@ -12,10 +12,11 @@ import {RichtextModule} from '../../common/richtext/richtext.module'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; import {AppCommonModule} from '../../app-common.module'; +import { TestComponent } from './test/test.component'; @NgModule({ - declarations: [IndexComponent], + declarations: [IndexComponent, TestComponent], imports: [ CommonModule, SystemRoutingModule, diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html index b6be464..09db79d 100644 --- a/src/app/admin/index/index/index.component.html +++ b/src/app/admin/index/index/index.component.html @@ -7,9 +7,22 @@ +
+
+
+ +

预充值账号

+

余额:{{(balanceData['amounts']).toFixed(2)}}

+

今日收入:{{todayBalanceData['incomePrice'] == null ? '0': todayBalanceData['incomePrice']}}

+

今日收款笔数:{{todayBalanceData['incomeCount'] == null ? '0': todayBalanceData['incomeCount']}}

+

今日退款金额:{{todayBalanceData['refundPrice'] == null ? '0': todayBalanceData['refundPrice']}}

+

今日退款笔数:{{todayBalanceData['incomeCount'] == null ? '0': todayBalanceData['incomeCount']}}

+
+
+
+
-
@@ -139,3 +152,21 @@
+ +
+ +

中石化订单

+

订单数量:{{orderData['count']}}

+

订单总额:{{orderData['orderPrice'] == null ? '0': orderData['orderPrice']}}

+

支付总额:{{orderData['payRealPrice'] == null ? '0': orderData['payRealPrice']}}

+
+
+ +
+ +

中石化订单

+

订单数量:{{orderData['count']}}

+

订单总额:{{orderData['orderPrice'] == null ? '0': orderData['orderPrice']}}

+

支付总额:{{orderData['payRealPrice'] == null ? '0': orderData['payRealPrice']}}

+
+
diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts index c1cc6f1..36cceae 100644 --- a/src/app/admin/index/index/index.component.ts +++ b/src/app/admin/index/index/index.component.ts @@ -4,6 +4,7 @@ import {LocalStorageService} from '../../../services/local-storage.service'; import {IndexService} from '../../../services/index.service'; import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {environment} from '../../../../environments/environment'; +import {Router} from "_@angular_router@9.0.7@@angular/router"; @Component({ @@ -26,27 +27,35 @@ export class IndexComponent implements OnInit { orderData = {}; balanceData = {}; rechargeData = {}; + todayBalanceData = {}; tyBalance; + webSocket: WebSocket; constructor( private store: LocalStorageService, // 数据缓存 private message: NzMessageService, // 信息提示 + private router: Router, private index: IndexService ) { } ngOnInit(): void { + this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; if (this.roleType === 1) { this.getIndexCount(); this.getLineCount(); this.queryCompanyAccountInfo2JD(); } + if (this.roleType === 3) { + this.getAccount(); + this.getAccountRecordList(); + } if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) { this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id; } - if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id === 3) { + if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany'] != null && this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id === 3) { this.code = 60; this.getHLTBalance(); this.orderByIndex(); @@ -230,4 +239,53 @@ export class IndexComponent implements OnInit { }); } + // 查询门店余额 + public getAccount(): void { + this.index.getAccount(data => { + if (data['return_code'] === '000000') { + console.log(data); + this.balanceData = data['return_data']; + this.loading = false; + } else { + this.message.error(data['return_msg']); + } + }); + } + + // 查询门店余额 + public getGasStatistical(): void { + this.index.getGasStatistical(data => { + if (data['return_code'] === '000000') { + console.log(data); + this.todayBalanceData = data['return_data']['today']; + this.loading = false; + } else { + this.message.error(data['return_msg']); + } + }); + } + + // 查询门店账户流失记录 + public getAccountRecordList(): void { + const paramsObject = { + pageNum: 1, + pageSize: 10000 + }; + this.index.getAccountRecordList(paramsObject, data => { + if (data['return_code'] === '000000') { + console.log(data); + } else { + this.message.error(data['return_msg']); + } + }); + } + + public edit(ids) { + this.router.navigate(['/admin/index/test'], { + queryParams: { + id: ids + } + }).then(r => console.log(r)); + } } + diff --git a/src/app/admin/merchant-store/merchant-store-routing.module.ts b/src/app/admin/merchant-store/merchant-store-routing.module.ts index d2468cb..7f0d1b4 100644 --- a/src/app/admin/merchant-store/merchant-store-routing.module.ts +++ b/src/app/admin/merchant-store/merchant-store-routing.module.ts @@ -3,12 +3,16 @@ import { Routes, RouterModule } from '@angular/router'; import {StoreListComponent} from './store-list/store-list.component'; import {StoreEditComponent} from './store-edit/store-edit.component'; import {StoreDetailComponent} from './store-detail/store-detail.component'; +import {OliComponent} from './oli/oli.component'; +import {OliGunComponent} from './oli-gun/oli-gun.component'; const routes: Routes = [ { path: 'store-list', component: StoreListComponent }, { path: 'store-edit', component: StoreEditComponent }, { path: 'store-detail', component: StoreDetailComponent }, + { path: 'oil', component: OliComponent }, + { path: 'oil_gun', component: OliGunComponent }, ]; @NgModule({ diff --git a/src/app/admin/merchant-store/merchant-store.module.ts b/src/app/admin/merchant-store/merchant-store.module.ts index 3603174..e7b5e11 100644 --- a/src/app/admin/merchant-store/merchant-store.module.ts +++ b/src/app/admin/merchant-store/merchant-store.module.ts @@ -9,18 +9,22 @@ import {NgZorroAntdModule} from 'ng-zorro-antd'; import {SeparateModule} from '../../common/separate/separate.module'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import { OliComponent } from './oli/oli.component'; +import { OliGunComponent } from './oli-gun/oli-gun.component'; +import {AppCommonModule} from "../../app-common.module"; @NgModule({ - declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent], - imports: [ - CommonModule, - MerchantStoreRoutingModule, - NgZorroAntdModule, - SeparateModule, - ReactiveFormsModule, - FormsModule, - BreadcrumbModule - ] + declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent, OliComponent, OliGunComponent], + imports: [ + CommonModule, + MerchantStoreRoutingModule, + NgZorroAntdModule, + SeparateModule, + ReactiveFormsModule, + FormsModule, + BreadcrumbModule, + AppCommonModule + ] }) export class MerchantStoreModule { } diff --git a/src/app/admin/merchant-store/store-detail/store-detail.component.html b/src/app/admin/merchant-store/store-detail/store-detail.component.html index 18ed2bc..98eaade 100644 --- a/src/app/admin/merchant-store/store-detail/store-detail.component.html +++ b/src/app/admin/merchant-store/store-detail/store-detail.component.html @@ -1,6 +1,17 @@ + + + + 门店管理 + + + 门店详情 + + + +
- {{data.telephone}} + {{data['secUser'].loginName}} {{data['storeKey']}} {{data.storeName}} {{data.address}} diff --git a/src/app/admin/merchant-store/store-detail/store-detail.component.ts b/src/app/admin/merchant-store/store-detail/store-detail.component.ts index 8f1ac20..6936d92 100644 --- a/src/app/admin/merchant-store/store-detail/store-detail.component.ts +++ b/src/app/admin/merchant-store/store-detail/store-detail.component.ts @@ -1,40 +1,47 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {NzMessageService} from 'ng-zorro-antd'; import {ActivatedRoute} from '@angular/router'; import {MerchantStoreService} from '../../../services/merchant-store.service'; @Component({ - selector: 'app-store-detail', - templateUrl: './store-detail.component.html', - styleUrls: ['./store-detail.component.scss'] + selector: 'app-store-detail', + templateUrl: './store-detail.component.html', + styleUrls: ['./store-detail.component.scss'] }) export class StoreDetailComponent implements OnInit { - data: any = {}; - id: number; - constructor( - private merchantStore: MerchantStoreService, - private message: NzMessageService, // 信息提示 - private activatedRoute: ActivatedRoute, - ) { } - - ngOnInit(): void { - this.activatedRoute.queryParams.subscribe(queryParams => { - if (queryParams.storeId != null) { - this.id = queryParams.storeId; - this.getDetails(queryParams.storeId); - } - }); - } - - // 查询详情 - public getDetails(id: number) { - this.merchantStore.getMerchantStoreById(id , data => { - this.data = data['return_data']; - - }); - } - + data: any = {}; + id: number; + + constructor( + private merchantStore: MerchantStoreService, + private message: NzMessageService, // 信息提示 + private activatedRoute: ActivatedRoute, + ) { + } + + ngOnInit(): void { + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams.storeId != null) { + this.id = queryParams.storeId; + this.getDetails(queryParams.storeId); + } + }); + } + + // 查询详情 + public getDetails(id: number) { + this.merchantStore.getMerchantStoreById(id, data => { + console.log(data); + this.data = data['return_data']; + + }); + } + + // 返回 + getBack() { + history.back(); + } } 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 3e9f81c..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 @@ -10,120 +10,173 @@ -
-
-
- - 登录手机号 - - - - -
-
- - 登录密码 - - - - - - - - - -
-
- - 门店编号 - - - - -
-
- - 门店LOGO - - - -
上传LOGO
-
- - - - - -
-
-
-
- - 门店名称 - - - - -
-
- - 地址维度 - - - - -
-
- - 地址经度 - - - - -
-
- - 门店地址 - - - - -
-
- - 设置定位 - -
-
- - - - - - - -
- -
- -
-
-
-
+
+
+
+ +
+ + +
+ + 门店名称 + + + + +
+
+ + 门店品牌 + + + + + + +
+
+ + 预存类型 + + + + + + + +
+
+ + 门店类型 + + + + + + +
+
+ + 联系人 + + + + +
+
+ + 联系电话 + + + + +
+
+ + 门店照片 + + + +
上传LOGO
+
+ + + + + +
+
+
+ +
+ + 打印机编号 + + + + +
+
+ + 打印机KEY + + + + +
+
+ + 打印机名称 + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + 门店地址 + + + + +
+
+ + 设置定位 + +
+
+ + + + + + + +
+ +
+ +
+
+
+
+
-
-
-
- - +
+
+ + +
-
- + +
+
+
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 372f5d0..32b53e4 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 @@ -6,6 +6,7 @@ import {NzMessageService, NzUploadFile} from 'ng-zorro-antd'; import {ActivatedRoute} from '@angular/router'; import {ValidatorsService} from '../../../services/validators.service'; import {MerchantStoreService} from '../../../services/merchant-store.service'; +import {CommonsService} from "../../../services/commons.service"; declare var AMap: any; // 一定要声明AMap,要不然报错找不到AMap declare var AMapUI: any; @@ -35,15 +36,16 @@ export class StoreEditComponent implements OnInit { WEB_SERVE_URL = environment.baseUrl; previewVisible = false; previewImage: string | undefined = ''; + brandData = []; constructor( private fb: FormBuilder, private merchantStore: MerchantStoreService, private message: NzMessageService, // 信息提示 + private commonsService: CommonsService, private activatedRoute: ActivatedRoute, ) { } - ngOnInit(): void { this.activatedRoute.queryParams.subscribe(queryParams => { if (queryParams.storeId != null) { @@ -55,19 +57,23 @@ export class StoreEditComponent implements OnInit { } }); this.validateForm = this.fb.group({ - telephone: [null, [Validators.required, ValidatorsService.mobile]], - password: [null, [Validators.required, ValidatorsService.minLength(6)]], - storeKey: [null, [Validators.required, ValidatorsService.maxLength(10)]], storeName: [null, [Validators.required]], address: [null, [Validators.required]], + contactName: [null, [Validators.required]], + prestoreType: [null, [Validators.required]], + telephone: [null, [Validators.required]], latitude: [29.553134, [Validators.required]], longitude: [106.565428, [Validators.required]], - status: [null], - companyId: [null], + deviceSn: [null], + deviceKey: [null], + deviceName: [null], regionId: [null], - merchantId: [null], - createTime: [null], - secUser: {}, + brandId: [null], + type: [null], + }); + + this.commonsService.getDictionary('MERCHANT_STORE_BRANCH', data => { + this.brandData = data['return_data']; }); } @@ -103,8 +109,6 @@ export class StoreEditComponent implements OnInit { return; } } - this.validateForm.value['secUser']['telephone'] = this.validateForm.value.telephone; - this.validateForm.value['secUser']['password'] = this.validateForm.value.password; if (this.logoFile.length !== 0) { if (this.logoFile[0]['response'] != null) { this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0]; @@ -138,8 +142,9 @@ export class StoreEditComponent implements OnInit { public getDetails(id) { this.merchantStore.getMerchantStoreById(id, data => { if (data['return_code'] === '000000') { - data['return_data'].telephone = data['return_data'].secUser.loginName; - data['return_data'].password = data['return_data'].secUser.password; + console.log(data); + data['return_data']['brandId'] = String(data['return_data']['brandId']); + data['return_data']['type'] = String(data['return_data']['type']); if (data['return_data']['storeLogo'] != null && data['return_data']['storeLogo'] !== '') { const logo = String(data['return_data']['storeLogo']); const logoArray = []; @@ -164,7 +169,6 @@ export class StoreEditComponent implements OnInit { getMap() { // tslint:disable-next-line:variable-name AMapUI.loadUI(['misc/PositionPicker'], PositionPicker => { - console.log(this.validateForm.value); const map = new AMap.Map('container', { resizeEnable: true, scrollWheel: false, @@ -194,7 +198,6 @@ export class StoreEditComponent implements OnInit { map: map }); positionPicker.on('success', positionResult => { - console.log(positionResult); positionResult['latitude'] = positionResult.position.lat; positionResult['longitude'] = positionResult.position.lng; positionResult['regionId'] = positionResult.regeocode.addressComponent.adcode; diff --git a/src/app/admin/merchant-store/store-list/store-list.component.html b/src/app/admin/merchant-store/store-list/store-list.component.html index 836925b..5bcf915 100644 --- a/src/app/admin/merchant-store/store-list/store-list.component.html +++ b/src/app/admin/merchant-store/store-list/store-list.component.html @@ -75,7 +75,7 @@ 门店名称 门店电话 创建时间 - 操作 + 操作 @@ -87,11 +87,13 @@ {{data.telephone}} {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} - + 编辑 - + 详情 - + 增加余额 + + 删除 @@ -122,3 +124,16 @@ + + +
+
+ + 充值金额 + + + + +
+
+
diff --git a/src/app/admin/merchant-store/store-list/store-list.component.ts b/src/app/admin/merchant-store/store-list/store-list.component.ts index 336dd01..1a19a13 100644 --- a/src/app/admin/merchant-store/store-list/store-list.component.ts +++ b/src/app/admin/merchant-store/store-list/store-list.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {FormBuilder, FormGroup} from '@angular/forms'; import {IconService} from '../../../services/icon.service'; import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd'; @@ -6,170 +6,200 @@ import {ActivatedRoute, Router} from '@angular/router'; import {CommonsService} from '../../../services/commons.service'; import {MerchantStoreService} from '../../../services/merchant-store.service'; import {environment} from '../../../../environments/environment'; +import {IndexService} from '../../../services/index.service'; @Component({ - selector: 'app-store-list', - templateUrl: './store-list.component.html', - styleUrls: ['./store-list.component.scss'] + selector: 'app-store-list', + templateUrl: './store-list.component.html', + styleUrls: ['./store-list.component.scss'] }) export class StoreListComponent implements OnInit { - searchForm: FormGroup; // 搜索框 - requestData = []; // 列表数据 - total: number; // 页码 - pageNum = 1; // 页码 - pageSize = 10; // 条码 - loading = true; - id = null; - name: string; - WEB_SERVE_URL = environment.baseUrl; - importErrorStudentArray = []; - errorStudentVisible = false; - isSpinning = false; - - constructor( - private form: FormBuilder, - private merchantStore: MerchantStoreService, - private iconService: IconService, - private message: NzMessageService, - private router: Router, - private modal: NzModalService, - private activatedRoute: ActivatedRoute, - private common: CommonsService - ) { - } - - ngOnInit(): void { - this.init(); - - } - - public init(): void { - this.activatedRoute.queryParams.subscribe(queryParams => { - if (queryParams.merchantId != null) { - this.id = queryParams.merchantId; - this.name = queryParams.name; - } - }); - this.searchForm = this.form.group({ - storeName: [null], - telephone: [null], - }); - this.getRequest(true, this.searchForm.value); - } - - - // 查询列表 - public getRequest(reset: boolean = false, whereObject: object) { - - this.loading = false; - if (reset) { - this.pageNum = 1; + searchForm: FormGroup; // 搜索框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + id = null; + name: string; + price: string; + WEB_SERVE_URL = environment.baseUrl; + importErrorStudentArray = []; + errorStudentVisible = false; + isVisibleAdd = false; + isSpinning = false; + + constructor( + private form: FormBuilder, + private merchantStore: MerchantStoreService, + private iconService: IconService, + private message: NzMessageService, + private router: Router, + private index: IndexService, + private modal: NzModalService, + private activatedRoute: ActivatedRoute, + private common: CommonsService + ) { } - whereObject['pageNum'] = this.pageNum; - whereObject['pageSize'] = this.pageSize; - if (this.id == null) { - this.merchantStore.getStoreListByMerchant(whereObject, data => { - if (data['return_code'] === '000000') { - this.requestData = data['return_data'].list; - this.total = data['return_data'].total; - } else { - this.message.error(data['return_msg']); + + ngOnInit(): void { + this.init(); + + } + + public init(): void { + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams.merchantId != null) { + this.id = queryParams.merchantId; + this.name = queryParams.name; + } + }); + this.searchForm = this.form.group({ + storeName: [null], + telephone: [null], + }); + this.getRequest(true, this.searchForm.value); + } + + + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { + + this.loading = false; + if (reset) { + this.pageNum = 1; } - }); - } else { - whereObject['merchantId'] = this.id; - this.merchantStore.getStoreListByCompany(whereObject, data => { - if (data['return_code'] === '000000') { - this.requestData = data['return_data'].list; - this.total = data['return_data'].total; + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + if (this.id == null) { + this.merchantStore.getStoreListByMerchant(whereObject, data => { + if (data['return_code'] === '000000') { + this.requestData = data['return_data'].list; + this.total = data['return_data'].total; + } else { + this.message.error(data['return_msg']); + } + }); } else { - this.message.error(data['return_msg']); + whereObject['merchantId'] = this.id; + this.merchantStore.getStoreListByCompany(whereObject, data => { + if (data['return_code'] === '000000') { + this.requestData = data['return_data'].list; + this.total = data['return_data'].total; + } else { + this.message.error(data['return_msg']); + } + }); } - }); + + } + // 重置 + public resetForm(): void { + this.searchForm.reset(); + } - } - - // 重置 - public resetForm(): void { - this.searchForm.reset(); - } - - // 禁用门店 - public getDelete(id): void { - const message = '是否删除门店'; - this.common.showConfirm(message, data => { - if (data) { - this.merchantStore.deleteMerchantStore(id, dataReturn => { - if (dataReturn['return_code'] === '000000') { - this.message.success('操作成功'); - this.getRequest(false , this.searchForm.value); - } else { - this.message.warning(dataReturn['return_msg']); - } + // 禁用门店 + public getDelete(id): void { + const message = '是否删除门店'; + this.common.showConfirm(message, data => { + if (data) { + this.merchantStore.deleteMerchantStore(id, dataReturn => { + if (dataReturn['return_code'] === '000000') { + this.message.success('操作成功'); + this.getRequest(false, this.searchForm.value); + } else { + this.message.warning(dataReturn['return_msg']); + } + }); + } }); - } - }); - } - - // 修改 - public getEdit(id: number): void { - this.router.navigate(['/admin/merchantStore/store-edit'], { - queryParams: { - storeId: id - } - }).then(r => console.log(r)); - } - - // 查看详情 - public getDetail(id: number): void { - this.router.navigate(['/admin/merchantStore/store-detail'], { - queryParams: { - storeId: id - } - }).then(r => console.log(r)); - } - - handleCancelError(): void { - this.errorStudentVisible = false; - } - - handleChange(info: NzUploadChangeParam): void { - this.isSpinning = true; - if (info.file.status !== 'uploading') { - console.log(info.file, info.fileList); } - if (info.file.status === 'done') { - if (info.file.response.return_code === '000000') { - this.loading = false; - this.isSpinning = false; - if (info.file.response.return_data.errorTotal === 0) { - this.message.success('导入成功'); - this.getRequest(true, this.searchForm.value); - } else { - this.modal.warning({ - nzTitle: '提示', - nzOkText: '查看失败数据', - nzContent: '只有部分数据导入成功', - nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data) - }); + + // 修改 + public getEdit(id: number): void { + this.router.navigate(['/admin/merchantStore/store-edit'], { + queryParams: { + storeId: id + } + }).then(r => console.log(r)); + } + + // 查看详情 + public getDetail(id: number): void { + this.router.navigate(['/admin/merchantStore/store-detail'], { + queryParams: { + storeId: id + } + }).then(r => console.log(r)); + } + + handleCancelError(): void { + this.errorStudentVisible = false; + } + + handleChange(info: NzUploadChangeParam): void { + this.isSpinning = true; + if (info.file.status !== 'uploading') { + console.log(info.file, info.fileList); } - } else { - this.isSpinning = false; - this.loading = false; - this.message.error(info.file.response.return_msg); - } - } else if (info.file.status === 'error') { - this.message.error('上传错误'); + if (info.file.status === 'done') { + if (info.file.response.return_code === '000000') { + this.loading = false; + this.isSpinning = false; + if (info.file.response.return_data.errorTotal === 0) { + this.message.success('导入成功'); + this.getRequest(true, this.searchForm.value); + } else { + this.modal.warning({ + nzTitle: '提示', + nzOkText: '查看失败数据', + nzContent: '只有部分数据导入成功', + nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data) + }); + } + } else { + this.isSpinning = false; + this.loading = false; + this.message.error(info.file.response.return_msg); + } + } else if (info.file.status === 'error') { + this.message.error('上传错误'); + } + } + + // 打开模态框 + showErrorStudentModal(data: []) { + this.getRequest(true, this.searchForm.value); + this.importErrorStudentArray = data['errorData']; + this.errorStudentVisible = true; + } + + // 增加余额 + public getRecharge(id): void { + this.id = id; + this.isVisibleAdd = true; + } + + + handleOk(): void { + if (this.price == null) { + this.message.error('请输入充值金额'); + return; + } + const paramsObject = { + storeId: this.id, + amount: this.price + }; + this.index.recharge(paramsObject, data => { + if (data['return_code'] === '000000') { + this.getRequest(false, this.searchForm.value); + this.isVisibleAdd = false; + } else { + this.message.error(data['return_msg']); + } + }); } - } - - // 打开模态框 - showErrorStudentModal(data: []) { - this.getRequest(true, this.searchForm.value); - this.importErrorStudentArray = data['errorData']; - this.errorStudentVisible = true; - } } diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html index 31ec073..96dab30 100644 --- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html +++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html @@ -1,3 +1,14 @@ + + + + 商户管理 + + + 商户详情 + + + +
diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts index dd25626..279914c 100644 --- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts +++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts @@ -1,39 +1,46 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {MerchantService} from '../../../services/merchant.service'; import {NzMessageService} from 'ng-zorro-antd'; import {ActivatedRoute} from '@angular/router'; import {environment} from '../../../../environments/environment'; @Component({ - selector: 'app-merchant-detail', - templateUrl: './merchant-detail.component.html', - styleUrls: ['./merchant-detail.component.scss'] + selector: 'app-merchant-detail', + templateUrl: './merchant-detail.component.html', + styleUrls: ['./merchant-detail.component.scss'] }) export class MerchantDetailComponent implements OnInit { - data: any = {}; - id: number; - FILE_URL = environment.imageUrl; - constructor( - private merchant: MerchantService, - private message: NzMessageService, // 信息提示 - private activatedRoute: ActivatedRoute, - ) { } + data: any = {}; + id: number; + FILE_URL = environment.imageUrl; - ngOnInit(): void { - this.activatedRoute.queryParams.subscribe(queryParams => { - if (queryParams.merchantId != null) { - this.id = queryParams.merchantId; - this.getDetails(queryParams.merchantId); - } - }); - } + constructor( + private merchant: MerchantService, + private message: NzMessageService, // 信息提示 + private activatedRoute: ActivatedRoute, + ) { + } - // 查询详情 - public getDetails(id: number) { - this.merchant.getMerchantById(id , data => { - this.data = data['return_data']; - }); - } + ngOnInit(): void { + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams.merchantId != null) { + this.id = queryParams.merchantId; + this.getDetails(queryParams.merchantId); + } + }); + } + + // 查询详情 + public getDetails(id: number) { + this.merchant.getMerchantById(id, data => { + this.data = data['return_data']; + }); + } + + // 返回 + getBack() { + history.back(); + } } diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 86b5820..43159ee 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -44,6 +44,7 @@ import { OilCardRecordTypePipe, OilCardRecordSourceTypePipe } from './pipes'; import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe"; +import { OilTypePipe } from './pipes/store/oil-type.pipe'; @@ -98,6 +99,7 @@ const PIPES = [ ], declarations: [ ...PIPES, + OilTypePipe, ], diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts index 3e22da1..439c5d3 100644 --- a/src/app/services/index.service.ts +++ b/src/app/services/index.service.ts @@ -53,6 +53,19 @@ export class IndexService { }); } + /** + * @Author Sum1Dream + * @methodName addHLTBalance + * @Description // 新增余额 + * @Date 12:12 下午 2022/1/10 + * @Param + */ + public recharge(params: object, callBack) { + this.http.post(environment.baseUrl + 'merStoreAccount/recharge', params).subscribe(data => { + callBack(data); + }); + } + /** * @Author Sum1Dream * @methodName queryCompanyAccountInfo2JD @@ -124,5 +137,47 @@ export class IndexService { }); } + /** + * @Author Sum1Dream + * @methodName getAccount + * @Description // 查询门店账户 + * @Date 10:00 2022/5/18 + * @Param + */ + + public getAccount(callBack) { + this.http.get(environment.baseUrl + 'merStoreAccount/getAccount').subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName getGasStatistical + * @Description // 查询门店账户 + * @Date 10:00 2022/5/18 + * @Param + */ + public getGasStatistical(callBack) { + this.http.get(environment.baseUrl + 'highGas/getGasStatistical').subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName getAccountRecordList + * @Description // 查询门店账户流失记录 + * @Date 10:00 2022/5/18 + * @Param + */ + + public getAccountRecordList(paramsObject , callBack) { + this.http.get(environment.baseUrl + 'merStoreAccount/getAccountRecordList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + } diff --git a/src/app/services/merchant-store.service.ts b/src/app/services/merchant-store.service.ts index 8c3a479..5854d19 100644 --- a/src/app/services/merchant-store.service.ts +++ b/src/app/services/merchant-store.service.ts @@ -25,6 +25,18 @@ export class MerchantStoreService { }); } + /** + * 查询门店油品列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOilPriceListByStore(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'gasOilPrice/getOilPriceListByStore?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + /** * 超级管理员查询门店列表 * @@ -88,5 +100,80 @@ export class MerchantStoreService { }); } + /** + * 查询油站油品详情 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOilPriceDetail(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'gasOilPrice/getOilPriceDetail?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 编辑油品 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public editGasOilPrice(params: object, callBack) { + this.http.post(environment.baseUrl + 'gasOilPrice/editGasOilPrice', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除油品 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public delOilPrice(params: object, callBack) { + console.log(params); + this.http.post(environment.baseUrl + 'gasOilPrice/delOilPrice', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除油枪 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public delGunNo(params: object, callBack) { + this.http.post(environment.baseUrl + 'gasOilGunNo/delGunNo', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询油站油品油枪 + * + * @param oilPriceId 对象 + * @param callBack 回调 + */ + public getGunNoListByOilPrice(oilPriceId: number, callBack) { + this.http.get(environment.baseUrl + 'gasOilGunNo/getGunNoListByOilPrice?oilPriceId=' + oilPriceId).subscribe(data => { + callBack(data); + }); + } + /** + * 配置油枪号 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public addGasOilPrice(params: object, callBack) { + this.http.post(environment.baseUrl + 'gasOilGunNo/addGasOilPrice', params).subscribe(data => { + callBack(data); + }); + } }