diff --git a/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.html b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.html new file mode 100644 index 0000000..6e12a5e --- /dev/null +++ b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.html @@ -0,0 +1,138 @@ + + + + + + +
+
+
+ + +
+ + 油站名称 + + + + +
+ +
+ + 预存类型 + + + + + + + +
+ +
+ + 预警状态 + + + + + + + +
+ +
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+
+ + + + + + 序号 + 所在公司 + 所在商户 + 油站名称 + 预存类型 + 账户余额 + 预警余额 + 预警状态 + 油站编号 + 油站地址 + 创建时间 + 操作 + + + + + {{i+1}} + {{data.companyName}} + {{data.storeMerName}} + {{data.storeName}} + {{data.storePrestoreType? '预存' : '非预存'}} + {{data.amounts?'¥'+data.amounts:'无'}} + {{data.amountsEarlyWarning?'¥'+data.amountsEarlyWarning:'无'}} + + + 正常 + 余额预警 + + {{data.storeKey}} + {{data.storeAddress}} + {{data.storeCreateTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + 操作列表 + +
    +
  • 余额预警
  • +
+
+ + + +
+
+
+ + +
+ + 预警余额 + + + + +
+
+ +
+
diff --git a/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.scss b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.scss new file mode 100644 index 0000000..90447c4 --- /dev/null +++ b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.scss @@ -0,0 +1,3 @@ +nz-input-number { + width: 100%; +} diff --git a/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.spec.ts b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.spec.ts new file mode 100644 index 0000000..40b46aa --- /dev/null +++ b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GasStationListComponent } from './gas-station-list.component'; + +describe('GasStationListComponent', () => { + let component: GasStationListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ GasStationListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GasStationListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.ts b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.ts new file mode 100644 index 0000000..e3cc237 --- /dev/null +++ b/src/app/admin/merchant-store/gas-station-list/gas-station-list.component.ts @@ -0,0 +1,134 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {CompanyAccountService} from '../../../services/company-account.service'; +import {Router} from '_@angular_router@9.0.7@@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {IndexService} from '../../../services/index.service'; +import {Validators} from '@angular/forms'; +import {MerchantStoreService} from "../../../services/merchant-store.service"; + +@Component({ + selector: 'app-gas-station-list', + templateUrl: './gas-station-list.component.html', + styleUrls: ['./gas-station-list.component.scss'] +}) +export class GasStationListComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + amountsEarlyWarningFrom: FormGroup; + amountsEarlyWarningModal = false; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private indexService: IndexService, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + ngOnInit(): void { + this.searchForm = this.form.group({ + companyId: [null], + merId: [null], + gasName: [null], + prestoreType: [null], + amountsEarlyWarningStatus: [null], + }); + + this.amountsEarlyWarningFrom = this.form.group({ + storeId: [null, [Validators.required]], + earlyWarning: [null, [Validators.required]], + }); + + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.indexService.getGasSelfBuiltStationList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + this.whereObject = whereObject; + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + showEarlyWarningModal(gasObject: object) { + this.amountsEarlyWarningModal = true; + this.amountsEarlyWarningFrom.patchValue({ storeId: gasObject['storeId'], earlyWarning: gasObject['amountsEarlyWarning']}); + } + + submitEarlyWarning() { + for (const i in this.amountsEarlyWarningFrom.controls) { + this.amountsEarlyWarningFrom.controls[i].markAsDirty(); + this.amountsEarlyWarningFrom.controls[i].updateValueAndValidity(); + } + if (this.amountsEarlyWarningFrom.status == null || this.amountsEarlyWarningFrom.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + + this.indexService.setAmountsEarlyWarning(this.amountsEarlyWarningFrom.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '设置成功', + }); + this.requestData(this.whereObject['pageNum']); + this.closeEarlyWarningModal(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + + closeEarlyWarningModal() { + this.amountsEarlyWarningModal = false; + } +} 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 7f0d1b4..39dd49d 100644 --- a/src/app/admin/merchant-store/merchant-store-routing.module.ts +++ b/src/app/admin/merchant-store/merchant-store-routing.module.ts @@ -5,6 +5,7 @@ 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'; +import {GasStationListComponent} from './gas-station-list/gas-station-list.component'; const routes: Routes = [ @@ -13,6 +14,7 @@ const routes: Routes = [ { path: 'store-detail', component: StoreDetailComponent }, { path: 'oil', component: OliComponent }, { path: 'oil_gun', component: OliGunComponent }, + { path: 'gas-station-list', component: GasStationListComponent }, ]; @NgModule({ diff --git a/src/app/admin/merchant-store/merchant-store.module.ts b/src/app/admin/merchant-store/merchant-store.module.ts index e7b5e11..0a30f65 100644 --- a/src/app/admin/merchant-store/merchant-store.module.ts +++ b/src/app/admin/merchant-store/merchant-store.module.ts @@ -12,10 +12,11 @@ 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"; +import { GasStationListComponent } from './gas-station-list/gas-station-list.component'; @NgModule({ - declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent, OliComponent, OliGunComponent], + declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent, OliComponent, OliGunComponent, GasStationListComponent], imports: [ CommonModule, MerchantStoreRoutingModule, diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts index 7377d43..02b1817 100644 --- a/src/app/services/index.service.ts +++ b/src/app/services/index.service.ts @@ -66,6 +66,32 @@ export class IndexService { }); } + /** + * @Author Sum1Dream + * @methodName addHLTBalance + * @Description // 新增余额 + * @Date 12:12 下午 2022/1/10 + * @Param + */ + public getGasSelfBuiltStationList(params: object, callBack) { + this.http.get(environment.baseUrl + 'highGas/getGasSelfBuiltStationList?' + this.common.getWhereCondition(params)).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName addHLTBalance + * @Description // 新增余额 + * @Date 12:12 下午 2022/1/10 + * @Param + */ + public setAmountsEarlyWarning(params: object, callBack) { + this.http.post(environment.baseUrl + 'merStoreAccount/setAmountsEarlyWarning', params).subscribe(data => { + callBack(data); + }); + } + /** * @Author Sum1Dream * @methodName queryCompanyAccountInfo2JD diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 5a795b3..cc5edd5 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=', };