From 8cfbe6cf2ba64dfd351b82b1c3eb97072fc36bfa Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Fri, 27 May 2022 09:23:34 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../gas-oil-price-routing.module.ts | 14 +++
.../gas-oil-price/gas-oil-price.module.ts | 26 +++++
.../oil-price-official-list.component.html | 100 ++++++++++++++++++
.../oil-price-official-list.component.scss | 0
.../oil-price-official-list.component.spec.ts | 25 +++++
.../oil-price-official-list.component.ts | 91 ++++++++++++++++
src/app/app-routing.module.ts | 5 +
.../oil-price/oil-price-official.service.ts | 53 ++++++++++
8 files changed, 314 insertions(+)
create mode 100644 src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts
create mode 100644 src/app/admin/gas-oil-price/gas-oil-price.module.ts
create mode 100644 src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html
create mode 100644 src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.scss
create mode 100644 src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts
create mode 100644 src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts
create mode 100644 src/app/services/oil-price/oil-price-official.service.ts
diff --git a/src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts b/src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts
new file mode 100644
index 0000000..38a18b6
--- /dev/null
+++ b/src/app/admin/gas-oil-price/gas-oil-price-routing.module.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 { }
diff --git a/src/app/admin/gas-oil-price/gas-oil-price.module.ts b/src/app/admin/gas-oil-price/gas-oil-price.module.ts
new file mode 100644
index 0000000..4422682
--- /dev/null
+++ b/src/app/admin/gas-oil-price/gas-oil-price.module.ts
@@ -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 { }
diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html
new file mode 100644
index 0000000..cd2af9d
--- /dev/null
+++ b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
共计 {{dataObject.total?dataObject.total:0}} 条数据
+
+
+
+
+
+
+
+
+ 序号 |
+ 区域名称 |
+ 国标价 |
+ 油品号 |
+ 油品类型 |
+ 操作 |
+
+
+
+
+ {{i+1}} |
+ {{data.regionName}} |
+ {{data.priceOfficial}} |
+ {{data.oilNo}} |
+ {{data.oilTypeName}} |
+
+ 操作列表
+
+
+
+ |
+
+
+
+
+
+
diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.scss b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts
new file mode 100644
index 0000000..a90f1a4
--- /dev/null
+++ b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts
@@ -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;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OilPriceOfficialListComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(OilPriceOfficialListComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts
new file mode 100644
index 0000000..4eea6fc
--- /dev/null
+++ b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts
@@ -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();
+ }
+
+}
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 4bf8856..30b8329 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -122,6 +122,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/gas-staff/gas-staff.module').then(m => m.GasStaffModule),
canActivate: [InitGuardService]
},
+ {
+ path: 'gas-oil-price',
+ loadChildren: () => import('./admin/gas-oil-price/gas-oil-price.module').then(m => m.GasOilPriceModule),
+ canActivate: [InitGuardService]
+ },
],
},
];
diff --git a/src/app/services/oil-price/oil-price-official.service.ts b/src/app/services/oil-price/oil-price-official.service.ts
new file mode 100644
index 0000000..be7f713
--- /dev/null
+++ b/src/app/services/oil-price/oil-price-official.service.ts
@@ -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);
+ });
+ }
+
+}