提交代码

pull/1/head
胡锐 3 years ago
parent ab505d03de
commit 8cfbe6cf2b
  1. 14
      src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts
  2. 26
      src/app/admin/gas-oil-price/gas-oil-price.module.ts
  3. 100
      src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html
  4. 0
      src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.scss
  5. 25
      src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts
  6. 91
      src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts
  7. 5
      src/app/app-routing.module.ts
  8. 53
      src/app/services/oil-price/oil-price-official.service.ts

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {OilPriceOfficialListComponent} from './oil-price-official-list/oil-price-official-list.component';
const routes: Routes = [
{ path: 'official-list', component: OilPriceOfficialListComponent}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class GasOilPriceRoutingModule { }

@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { GasOilPriceRoutingModule } from './gas-oil-price-routing.module';
import { OilPriceOfficialListComponent } from './oil-price-official-list/oil-price-official-list.component';
import {NgZorroAntdModule} from "_ng-zorro-antd@9.3.0@ng-zorro-antd";
import {FormsModule, ReactiveFormsModule} from "_@angular_forms@9.0.7@@angular/forms";
import {BreadcrumbModule} from "../../common/breadcrumb/breadcrumb.module";
import {AppCommonModule} from "../../app-common.module";
import {NgxEchartsModule} from "_ngx-echarts@4.2.2@ngx-echarts";
@NgModule({
declarations: [OilPriceOfficialListComponent],
imports: [
CommonModule,
GasOilPriceRoutingModule,
NgZorroAntdModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule,
AppCommonModule,
NgxEchartsModule,
]
})
export class GasOilPriceModule { }

@ -0,0 +1,100 @@
<!-- 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">
<nz-form-item>
<nz-form-label [nzSpan]="8">区域名称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="regionName" />
</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 nzAllowClear formControlName="oilNo">
<nz-option *ngFor="let item of oilNoArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></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 nzAllowClear formControlName="oilType">
<nz-option nzLabel="汽油" nzValue="1"></nz-option>
<nz-option nzLabel="柴油" nzValue="2"></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">
<!-- <button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/gas-staff/edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>增加员工</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="100px">区域名称</th>
<th nzWidth="100px">国标价</th>
<th nzWidth="100px">油品号</th>
<th nzWidth="100px">油品类型</th>
<th nzWidth="80px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{i+1}}</td>
<td>{{data.regionName}}</td>
<td>{{data.priceOfficial}}</td>
<td>{{data.oilNo}}</td>
<td>{{data.oilTypeName}}</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 ><a>修改</a></li>-->
<li nz-menu-item nzDisabled>暂无</li>
</ul>
</nz-dropdown-menu>
</td>
</tr>
</tbody>
</nz-table>
</div>
</nz-spin>

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { OilPriceOfficialListComponent } from './oil-price-official-list.component';
describe('OilPriceOfficialListComponent', () => {
let component: OilPriceOfficialListComponent;
let fixture: ComponentFixture<OilPriceOfficialListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OilPriceOfficialListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OilPriceOfficialListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,91 @@
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 {CommonsService} from '../../../services/commons.service';
import {Router} from '_@angular_router@9.0.7@@angular/router';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {OilPriceOfficialService} from '../../../services/oil-price/oil-price-official.service';
@Component({
selector: 'app-oil-price-official-list',
templateUrl: './oil-price-official-list.component.html',
styleUrls: ['./oil-price-official-list.component.scss']
})
export class OilPriceOfficialListComponent implements OnInit {
FILE_URL = environment.imageUrl;
roleType;
adminFlag;
loadingObject = {
spinning: false,
msg: '加载中'
};
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
oilNoArray = [];
constructor(private modal: NzModalService,
private message: NzMessageService,
private store: LocalStorageService,
private oilPriceOfficialService: OilPriceOfficialService,
private commonsService: CommonsService,
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({
regionName: [null],
oilNo: [null],
oilType: [null],
});
this.commonsService.getDictionary('GAS_OIL_TYPE', data => {
this.oilNoArray = data['return_data'];
});
this.requestData(1);
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.oilPriceOfficialService.getOilPriceOfficialList(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();
}
}

@ -122,6 +122,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/gas-staff/gas-staff.module').then(m => m.GasStaffModule), loadChildren: () => import('./admin/gas-staff/gas-staff.module').then(m => m.GasStaffModule),
canActivate: [InitGuardService] canActivate: [InitGuardService]
}, },
{
path: 'gas-oil-price',
loadChildren: () => import('./admin/gas-oil-price/gas-oil-price.module').then(m => m.GasOilPriceModule),
canActivate: [InitGuardService]
},
], ],
}, },
]; ];

@ -0,0 +1,53 @@
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 OilPriceOfficialService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param paramsObject
* @param callBack
*/
public updateOilPriceOfficial(paramsObject: object, callBack) {
this.http.post(environment.baseUrl + 'gasOilPriceOfficial/updateOilPriceOfficial', paramsObject).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getOilPriceOfficialList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'gasOilPriceOfficial/getOilPriceOfficialList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getOilPriceOfficialDetail(regionId: number, oilNo: number, callBack) {
this.http.get(environment.baseUrl + 'gasOilPriceOfficial/getOilPriceOfficialDetail?regionId=' + regionId + '&oilNo=' + oilNo).subscribe(data => {
callBack(data);
});
}
}
Loading…
Cancel
Save