提交代码

pull/1/head
胡锐 2 years ago
parent b396a61fc3
commit 38babbd3d9
  1. 138
      src/app/admin/merchant-store/gas-station-list/gas-station-list.component.html
  2. 3
      src/app/admin/merchant-store/gas-station-list/gas-station-list.component.scss
  3. 25
      src/app/admin/merchant-store/gas-station-list/gas-station-list.component.spec.ts
  4. 134
      src/app/admin/merchant-store/gas-station-list/gas-station-list.component.ts
  5. 2
      src/app/admin/merchant-store/merchant-store-routing.module.ts
  6. 3
      src/app/admin/merchant-store/merchant-store.module.ts
  7. 26
      src/app/services/index.service.ts
  8. 8
      src/environments/environment.ts

@ -0,0 +1,138 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<nz-spin [nzSpinning]="loadingObject.spinning" nzTip="{{loadingObject.msg}}">
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<!-- <div nz-col nzSpan="8" *ngIf="roleType == 5 && adminFlag == 1">
<nz-form-item>
<nz-form-label [nzSpan]="8">所属部门</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="orgId">
<nz-option *ngFor="let item of orgArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>-->
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">油站名称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="gasName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">预存类型</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="prestoreType">
<nz-option nzValue="0" nzLabel="非预存"></nz-option>
<nz-option nzValue="1" nzLabel="预存"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">预警状态</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="amountsEarlyWarningStatus">
<nz-option nzValue="0" nzLabel="正常"></nz-option>
<nz-option nzValue="1" nzLabel="余额预警"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
</div>
<!--数组表格 -->
<nz-table #basicTable
[nzData]="dataObject.list"
[nzTotal]="dataObject.total"
[nzFrontPagination]="false"
[nzLoading]="tableLoading"
[nzPageIndex]="whereObject.pageNum"
(nzPageIndexChange)="requestData($event)"
[nzScroll]="{ x: '1100px'}">
<thead>
<tr>
<th nzWidth="60px">序号</th>
<th nzWidth="150px">所在公司</th>
<th nzWidth="140px">所在商户</th>
<th nzWidth="200px">油站名称</th>
<th nzWidth="90px">预存类型</th>
<th nzWidth="90px">账户余额</th>
<th nzWidth="90px">预警余额</th>
<th nzWidth="90px">预警状态</th>
<th nzWidth="100px">油站编号</th>
<th nzWidth="150px">油站地址</th>
<th nzWidth="110px">创建时间</th>
<th nzWidth="110px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index" style="{{data.amountsEarlyWarningStatus?'color: #aa1111;':''}}">
<td>{{i+1}}</td>
<td>{{data.companyName}}</td>
<td>{{data.storeMerName}}</td>
<td>{{data.storeName}}</td>
<td>{{data.storePrestoreType? '预存' : '非预存'}}</td>
<td>{{data.amounts?'¥'+data.amounts:'无'}}</td>
<td>{{data.amountsEarlyWarning?'¥'+data.amountsEarlyWarning:'无'}}</td>
<td>
<span *ngIf="data.amountsEarlyWarningStatus == null"></span>
<span *ngIf="data.amountsEarlyWarningStatus == 0">正常</span>
<span *ngIf="data.amountsEarlyWarningStatus == 1">余额预警</span>
</td>
<td>{{data.storeKey}}</td>
<td>{{data.storeAddress}}</td>
<td>{{data.storeCreateTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight="0px" class="table-td-operation">
<a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item (click)="showEarlyWarningModal(data)">余额预警</li>
</ul>
</nz-dropdown-menu>
</td>
</tr>
</tbody>
</nz-table>
</div>
</nz-spin>
<nz-modal [(nzVisible)]="amountsEarlyWarningModal" nzTitle="设置账户余额预警" (nzOnCancel)="closeEarlyWarningModal()" [nzFooter]="null">
<form nz-form [formGroup]="amountsEarlyWarningFrom">
<nz-form-item>
<nz-form-label [nzSpan]="6">预警余额</nz-form-label>
<nz-form-control [nzSpan]="14" nzExtra="预警余额设置为0,代表不需要预警">
<nz-input-number nz-input formControlName="earlyWarning" [nzMin]="0" [nzMax]="99999999" [nzStep]="1" [nzPrecision]="2"></nz-input-number>
</nz-form-control>
</nz-form-item>
</form>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitEarlyWarning()">确定</button>
</div>
</nz-modal>

@ -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<GasStationListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ GasStationListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(GasStationListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -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;
}
}

@ -5,6 +5,7 @@ import {StoreEditComponent} from './store-edit/store-edit.component';
import {StoreDetailComponent} from './store-detail/store-detail.component'; import {StoreDetailComponent} from './store-detail/store-detail.component';
import {OliComponent} from './oli/oli.component'; import {OliComponent} from './oli/oli.component';
import {OliGunComponent} from './oli-gun/oli-gun.component'; import {OliGunComponent} from './oli-gun/oli-gun.component';
import {GasStationListComponent} from './gas-station-list/gas-station-list.component';
const routes: Routes = [ const routes: Routes = [
@ -13,6 +14,7 @@ const routes: Routes = [
{ path: 'store-detail', component: StoreDetailComponent }, { path: 'store-detail', component: StoreDetailComponent },
{ path: 'oil', component: OliComponent }, { path: 'oil', component: OliComponent },
{ path: 'oil_gun', component: OliGunComponent }, { path: 'oil_gun', component: OliGunComponent },
{ path: 'gas-station-list', component: GasStationListComponent },
]; ];
@NgModule({ @NgModule({

@ -12,10 +12,11 @@ import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import { OliComponent } from './oli/oli.component'; import { OliComponent } from './oli/oli.component';
import { OliGunComponent } from './oli-gun/oli-gun.component'; import { OliGunComponent } from './oli-gun/oli-gun.component';
import {AppCommonModule} from "../../app-common.module"; import {AppCommonModule} from "../../app-common.module";
import { GasStationListComponent } from './gas-station-list/gas-station-list.component';
@NgModule({ @NgModule({
declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent, OliComponent, OliGunComponent], declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent, OliComponent, OliGunComponent, GasStationListComponent],
imports: [ imports: [
CommonModule, CommonModule,
MerchantStoreRoutingModule, MerchantStoreRoutingModule,

@ -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 * @Author Sum1Dream
* @methodName queryCompanyAccountInfo2JD * @methodName queryCompanyAccountInfo2JD

@ -4,10 +4,10 @@
export const environment = { export const environment = {
production: false, production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'http://localhost:9302/filesystem/', imageUrl: 'http://localhost:9302/filesystem/',
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) // baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsg.dctpay.com/filesystem/', // imageUrl: 'https://hsg.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
}; };

Loading…
Cancel
Save