提交代码

pull/1/head
胡锐 3 years ago
parent 8934655228
commit e5807e0df2
  1. 7
      src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts
  2. 14
      src/app/admin/gas-oil-price/gas-oil-price.module.ts
  3. 1
      src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html
  4. 0
      src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.scss
  5. 25
      src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.spec.ts
  6. 15
      src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts
  7. 99
      src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.html
  8. 0
      src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.scss
  9. 25
      src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.spec.ts
  10. 122
      src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts
  11. 16
      src/app/admin/index/index/index.component.html
  12. 64
      src/app/services/oil-price/oil-price-task.service.ts

@ -1,10 +1,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {OilPriceOfficialListComponent} from './oil-price-official-list/oil-price-official-list.component'; import {OilPriceOfficialListComponent} from './oil-price-official-list/oil-price-official-list.component';
import {OilPriceTaskListComponent} from './oil-price-task-list/oil-price-task-list.component';
import {OilPriceTaskEditComponent} from './oil-price-task-edit/oil-price-task-edit.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'official-list', component: OilPriceOfficialListComponent} { path: 'official-list', component: OilPriceOfficialListComponent },
{ path: 'task-list', component: OilPriceTaskListComponent },
{ path: 'task-edit', component: OilPriceTaskEditComponent }
]; ];
@NgModule({ @NgModule({

@ -3,15 +3,17 @@ import { CommonModule } from '@angular/common';
import { GasOilPriceRoutingModule } from './gas-oil-price-routing.module'; import { GasOilPriceRoutingModule } from './gas-oil-price-routing.module';
import { OilPriceOfficialListComponent } from './oil-price-official-list/oil-price-official-list.component'; 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 {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from "_@angular_forms@9.0.7@@angular/forms"; import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms';
import {BreadcrumbModule} from "../../common/breadcrumb/breadcrumb.module"; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {AppCommonModule} from "../../app-common.module"; import {AppCommonModule} from '../../app-common.module';
import {NgxEchartsModule} from "_ngx-echarts@4.2.2@ngx-echarts"; import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts';
import { OilPriceTaskListComponent } from './oil-price-task-list/oil-price-task-list.component';
import { OilPriceTaskEditComponent } from './oil-price-task-edit/oil-price-task-edit.component';
@NgModule({ @NgModule({
declarations: [OilPriceOfficialListComponent], declarations: [OilPriceOfficialListComponent, OilPriceTaskListComponent, OilPriceTaskEditComponent],
imports: [ imports: [
CommonModule, CommonModule,
GasOilPriceRoutingModule, GasOilPriceRoutingModule,

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

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-oil-price-task-edit',
templateUrl: './oil-price-task-edit.component.html',
styleUrls: ['./oil-price-task-edit.component.scss']
})
export class OilPriceTaskEditComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

@ -0,0 +1,99 @@
<!-- 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-oil-price/task-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>
</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 { OilPriceTaskListComponent } from './oil-price-task-list.component';
describe('OilPriceTaskListComponent', () => {
let component: OilPriceTaskListComponent;
let fixture: ComponentFixture<OilPriceTaskListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OilPriceTaskListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OilPriceTaskListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,122 @@
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 {OilPriceOfficialService} from '../../../services/oil-price/oil-price-official.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 {OilPriceTaskService} from "../../../services/oil-price/oil-price-task.service";
@Component({
selector: 'app-oil-price-task-list',
templateUrl: './oil-price-task-list.component.html',
styleUrls: ['./oil-price-task-list.component.scss']
})
export class OilPriceTaskListComponent 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 oilPriceTaskService: OilPriceTaskService,
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.oilPriceTaskService.getTaskList(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();
}
/**
*
*/
showDelConfirm(id: number): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否删除任务?任务一旦被删除,不会执行。',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
nzOnOk: () => this.delData(id)
});
}
/**
*
*/
delData(id: number) {
this.oilPriceTaskService.delTask(id, data => {
if (data['return_code'] === '000000') {
this.requestData(this.whereObject['pageNum']);
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg']
});
}
});
}
}

@ -20,22 +20,22 @@
<nz-card nzTitle="历史加油订单"> <nz-card nzTitle="历史加油订单">
<nz-row [nzGutter]="16"> <nz-row [nzGutter]="16">
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.totalPrice ? gasCountData.history.totalPrice : 0" [nzTitle]="'加油总金额'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.history.totalPrice ? gasCountData.history.totalPrice : 0" [nzTitle]="'订单总金额'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.totalCount ? gasCountData.history.totalCount : 0" [nzTitle]="'加油总数量'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.history.totalCount ? gasCountData.history.totalCount : 0" [nzTitle]="'订单笔数'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.incomePrice ? gasCountData.history.incomePrice : 0" [nzTitle]="'加油金额'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.history.incomePrice ? gasCountData.history.incomePrice : 0" [nzTitle]="'加油金额'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.incomeCount ? gasCountData.history.incomeCount : 0" [nzTitle]="'加油数'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.history.incomeCount ? gasCountData.history.incomeCount : 0" [nzTitle]="'加油'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.refundPrice ? gasCountData.history.refundPrice : 0" [nzTitle]="'退款金额'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.history.refundPrice ? gasCountData.history.refundPrice : 0" [nzTitle]="'退款金额'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.refundCount ? gasCountData.history.refundCount : 0" [nzTitle]="'退款数'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.history.refundCount ? gasCountData.history.refundCount : 0" [nzTitle]="'退款'"></nz-statistic>
</nz-col> </nz-col>
</nz-row> </nz-row>
</nz-card> </nz-card>
@ -43,22 +43,22 @@
<nz-card nzTitle="今日加油订单"> <nz-card nzTitle="今日加油订单">
<nz-row [nzGutter]="16"> <nz-row [nzGutter]="16">
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.totalPrice ? gasCountData.today.totalPrice : 0" [nzTitle]="'加油总金额'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.today.totalPrice ? gasCountData.today.totalPrice : 0" [nzTitle]="'订单总金额'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.totalCount ? gasCountData.today.totalCount : 0" [nzTitle]="'加油总数量'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.today.totalCount ? gasCountData.today.totalCount : 0" [nzTitle]="'订单笔数'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.incomePrice ? gasCountData.today.incomePrice : 0" [nzTitle]="'加油金额'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.today.incomePrice ? gasCountData.today.incomePrice : 0" [nzTitle]="'加油金额'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.incomeCount ? gasCountData.today.incomeCount : 0" [nzTitle]="'加油数'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.today.incomeCount ? gasCountData.today.incomeCount : 0" [nzTitle]="'加油'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.refundPrice ? gasCountData.today.refundPrice : 0" [nzTitle]="'退款金额'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.today.refundPrice ? gasCountData.today.refundPrice : 0" [nzTitle]="'退款金额'"></nz-statistic>
</nz-col> </nz-col>
<nz-col [nzSpan]="4"> <nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.refundCount ? gasCountData.today.refundCount : 0" [nzTitle]="'退款数'"></nz-statistic> <nz-statistic [nzValue]="gasCountData.today.refundCount ? gasCountData.today.refundCount : 0" [nzTitle]="'退款'"></nz-statistic>
</nz-col> </nz-col>
</nz-row> </nz-row>
</nz-card> </nz-card>

@ -0,0 +1,64 @@
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 OilPriceTaskService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param paramsObject
* @param callBack
*/
public batchAddTask(paramsObject: object, callBack) {
this.http.post(environment.baseUrl + 'gasOilPriceTask/batchAddTask', paramsObject).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param id id
* @param callBack
*/
public delTask(id: number, callBack) {
this.http.post(environment.baseUrl + 'gasOilPriceTask/delTask', { taskId: id }).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getTaskDetail(id: number, callBack) {
this.http.get(environment.baseUrl + 'gasOilPriceTask/getTaskDetail?taskId=' + id).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getTaskList(param: object, callBack) {
this.http.get(environment.baseUrl + 'gasOilPriceTask/getTaskList?' + this.common.getWhereCondition(param)).subscribe(data => {
callBack(data);
});
}
}
Loading…
Cancel
Save