Merge branch 'dev' of http://139.159.177.244:3000/yuanye/high-web into dev
* 'dev' of http://139.159.177.244:3000/yuanye/high-web: 提交代码 提交代码pull/1/head
commit
cd492ecc72
@ -0,0 +1,17 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
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 = [ |
||||
{ path: 'official-list', component: OilPriceOfficialListComponent }, |
||||
{ path: 'task-list', component: OilPriceTaskListComponent }, |
||||
{ path: 'task-edit', component: OilPriceTaskEditComponent } |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class GasOilPriceRoutingModule { } |
@ -0,0 +1,28 @@ |
||||
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'; |
||||
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({ |
||||
declarations: [OilPriceOfficialListComponent, OilPriceTaskListComponent, OilPriceTaskEditComponent], |
||||
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(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,90 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<div class="inner-content"> |
||||
<div class="main"> |
||||
<form nz-form [formGroup]="dataFrom"> |
||||
<div nz-row> |
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>油号</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-select 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 class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>价格类型</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-select formControlName="priceType" [nzPlaceHolder]="'请选择价格类型'"> |
||||
<nz-option *ngFor="let item of priceTypeArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col class="gutter-row" [nzSpan]="24" *ngIf="dataFrom.value.priceType == 1"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>执行地区</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-select formControlName="regionId" nzShowSearch [nzPlaceHolder]="'设置执行地区'"> |
||||
<nz-option *ngFor="let item of regionArray" nzLabel="{{item.regionName}}" nzValue="{{item.regionId}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col class="gutter-row" [nzSpan]="24" *ngIf="(secUserObjectType == 0 || secUserObjectType == 1 || secUserObjectType == 2) && (dataFrom.value.priceType == 2 || dataFrom.value.priceType == 3)"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>加油站</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-select formControlName="merStoreIdArray" nzMode="multiple" [nzPlaceHolder]="'请选择加油站'"> |
||||
<nz-option *ngFor="let item of gasArray" nzLabel="{{'【' + item.storeKey + '】' + item.storeName}}" nzValue="{{item.id}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>执行价格(¥)</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-input-number formControlName="price" [nzMin]="0" [nzMax]="999" [nzStep]="1" [nzPrecision]="2"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>执行方式</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-radio-group formControlName="executionType"> |
||||
<label nz-radio nzValue="1">立刻执行</label> |
||||
<label nz-radio nzValue="2">定时执行</label> |
||||
</nz-radio-group> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col class="gutter-row" [nzSpan]="24" *ngIf="dataFrom.value.executionType == 2"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>执行时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-date-picker formControlName="startTime" nzFormat="yyyy-MM-dd HH:mm:ss" nzShowTime [nzPlaceHolder]="'设置执行时间'"></nz-date-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div class="btn-div"> |
||||
<button class="btn-post" nz-button nzType="primary" (click)="submitFrom()" [nzLoading]="btnLoading" nzBlock>保存</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
@ -0,0 +1,13 @@ |
||||
.btn-div { |
||||
width: 100%; |
||||
text-align: center; |
||||
} |
||||
.btn-post { |
||||
width: 25%; |
||||
} |
||||
nz-input-number { |
||||
width: 100%; |
||||
} |
||||
nz-date-picker { |
||||
width: 100%; |
||||
} |
@ -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,160 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {ActivatedRoute, Router} from '_@angular_router@9.0.7@@angular/router'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
import {OilPriceTaskService} from '../../../services/oil-price/oil-price-task.service'; |
||||
import {LocalStorageService} from "../../../services/local-storage.service"; |
||||
import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; |
||||
|
||||
@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 { |
||||
dataFrom: FormGroup; |
||||
btnLoading = false; |
||||
|
||||
oilNoArray = []; |
||||
priceTypeArray = []; |
||||
regionArray = []; |
||||
gasArray = []; |
||||
|
||||
secUserObjectType: number; |
||||
|
||||
constructor(private formBuilder: FormBuilder, |
||||
private modal: NzModalService, |
||||
private oilPriceTaskService: OilPriceTaskService, |
||||
private activatedRoute: ActivatedRoute, |
||||
private commonsService: CommonsService, |
||||
private localStorageService: LocalStorageService , // 请求缓存
|
||||
private router: Router) { |
||||
this.secUserObjectType = Number(this.localStorageService.get(ADMIN_INFO_OBJECT)['secUser']['objectType']); |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
|
||||
this.dataFrom = this.formBuilder.group({ |
||||
oilNo: ['92', [Validators.required]], |
||||
priceType: [null, [Validators.required]], |
||||
price: [0, [Validators.required]], |
||||
executionType: ['1', [Validators.required]], |
||||
startTime: [null], |
||||
regionId: [null], |
||||
merStoreIdArray: [[]], |
||||
}); |
||||
|
||||
// 管理员
|
||||
if (this.secUserObjectType === 0) { |
||||
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
|
||||
this.priceTypeArray.push({ codeValue: 1, codeName: '国标价' }); |
||||
this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); |
||||
this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度'}); |
||||
|
||||
// 获取全部省级地区
|
||||
this.commonsService.getProvinceList(data => { |
||||
this.regionArray = data['return_data']; |
||||
}); |
||||
|
||||
this.commonsService.getGasSelectList( data => { |
||||
this.gasArray = data['return_data']; |
||||
}); |
||||
|
||||
// 分公司
|
||||
} else if (this.secUserObjectType === 1) { |
||||
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
|
||||
this.priceTypeArray.push({ codeValue: 1, codeName: '国标价' }); |
||||
this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); |
||||
this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度'}); |
||||
|
||||
this.regionArray.push({ regionId: this.localStorageService.get(ADMIN_INFO_OBJECT)['bsCompany']['regionId'], |
||||
regionName: this.localStorageService.get(ADMIN_INFO_OBJECT)['bsCompany']['regionName'] }); |
||||
|
||||
this.commonsService.getGasSelectList( data => { |
||||
this.gasArray = data['return_data']; |
||||
}); |
||||
|
||||
// 商户
|
||||
} else if (this.secUserObjectType === 2) { |
||||
this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); |
||||
this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度' }); |
||||
|
||||
this.commonsService.getGasSelectList( data => { |
||||
this.gasArray = data['return_data']; |
||||
}); |
||||
|
||||
// 加油站
|
||||
} else if (this.secUserObjectType === 3) { |
||||
this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); |
||||
this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度' }); |
||||
|
||||
this.dataFrom.patchValue({ merStoreIdArray: [ this.localStorageService.get(ADMIN_INFO_OBJECT)['merchantStore']['id'] ] }); |
||||
} |
||||
|
||||
this.commonsService.getDictionary('GAS_OIL_TYPE', data => { |
||||
this.oilNoArray = data['return_data']; |
||||
}); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 提交 |
||||
*/ |
||||
submitFrom() { |
||||
for (const i in this.dataFrom.controls) { |
||||
this.dataFrom.controls[i].markAsDirty(); |
||||
this.dataFrom.controls[i].updateValueAndValidity(); |
||||
} |
||||
if (this.dataFrom.status == null || this.dataFrom.status !== 'VALID') { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzContent: '请规范填写所有的必填项信息', |
||||
}); |
||||
return; |
||||
} |
||||
|
||||
const dataFromValue = this.dataFrom.value; |
||||
const dataArray = []; |
||||
|
||||
if (dataFromValue.priceType === '1') { |
||||
dataArray.push({ |
||||
regionId: dataFromValue.regionId, |
||||
oilNo: dataFromValue.oilNo, |
||||
priceType: dataFromValue.priceType, |
||||
price: dataFromValue.price, |
||||
executionType: dataFromValue.executionType, |
||||
startTime: dataFromValue.startTime, |
||||
}); |
||||
} else { |
||||
for (const storeId of this.dataFrom.value.merStoreIdArray) { |
||||
dataArray.push({ |
||||
merStoreId: storeId, |
||||
oilNo: dataFromValue.oilNo, |
||||
priceType: dataFromValue.priceType, |
||||
price: dataFromValue.price, |
||||
executionType: dataFromValue.executionType, |
||||
startTime: dataFromValue.startTime, |
||||
}); |
||||
} |
||||
} |
||||
|
||||
this.btnLoading = true; |
||||
this.oilPriceTaskService.batchAddTask(dataArray, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.modal.success({ |
||||
nzTitle: '提示', |
||||
nzContent: '添加成功', |
||||
nzOnOk: () => this.router.navigateByUrl('admin/gas-oil-price/task-list') |
||||
}); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
this.btnLoading = false; |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,169 @@ |
||||
<!-- 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="this.secUserObjectType !== 3"> |
||||
<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" *ngIf="this.secUserObjectType !== 3"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">油站编号</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="merStoreKey" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col nzSpan="8" *ngIf="this.secUserObjectType !== 3"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">油站名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="merStoreName" /> |
||||
</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 nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">价格类型</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-select nzAllowClear formControlName="priceType"> |
||||
<nz-option *ngFor="let item of priceTypeArray" 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="executionType"> |
||||
<nz-option nzLabel="立刻执行" nzValue="1"></nz-option> |
||||
<nz-option nzLabel="定时执行" nzValue="2"></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="status"> |
||||
<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" *ngIf="this.secUserObjectType !== 3">区域名称</th> |
||||
<th nzWidth="100px" *ngIf="this.secUserObjectType !== 3">油站编号</th> |
||||
<th nzWidth="200px" *ngIf="this.secUserObjectType !== 3">油站名称</th> |
||||
<th nzWidth="80px">油品号</th> |
||||
<th nzWidth="90px">油品类型</th> |
||||
<th nzWidth="90px">价格类型</th> |
||||
<th nzWidth="90px">执行价格</th> |
||||
<th nzWidth="90px">执行方式</th> |
||||
<th nzWidth="160px">执行时间</th> |
||||
<th nzWidth="90px">任务状态</th> |
||||
<th nzWidth="160px">创建时间</th> |
||||
<th nzWidth="120px">创建人</th> |
||||
<th nzWidth="110px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td *ngIf="this.secUserObjectType !== 3">{{data.regionName}}</td> |
||||
<td *ngIf="this.secUserObjectType !== 3">{{data.merStoreKey?data.merStoreKey:'无'}}</td> |
||||
<td *ngIf="this.secUserObjectType !== 3">{{data.merStoreName?data.merStoreName:'无'}}</td> |
||||
<td>{{data.oilNo}}</td> |
||||
<td>{{data.oilTypeName}}</td> |
||||
<td>{{data.priceType | oilPriceTaskPriceType}}</td> |
||||
<td>¥{{data.price}}</td> |
||||
<td>{{data.executionType | oilPriceTaskExecutionType}}</td> |
||||
<td>{{data.startTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.status | oilPriceTaskStatus}}</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.opUserName}}</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 *ngIf="data.status == 1" (click)="showDelConfirm(data.id)"><a>删除任务</a></li> |
||||
<li nz-menu-item *ngIf="data.status != 1" 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 { 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,140 @@ |
||||
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 {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 = []; |
||||
priceTypeArray = []; |
||||
secUserObjectType: number; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, |
||||
private oilPriceTaskService: OilPriceTaskService, |
||||
private localStorageService: LocalStorageService , // 请求缓存
|
||||
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); |
||||
this.secUserObjectType = Number(this.localStorageService.get(ADMIN_INFO_OBJECT)['secUser']['objectType']); |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.searchForm = this.form.group({ |
||||
regionName: [null], |
||||
merStoreKey: [null], |
||||
merStoreName: [null], |
||||
oilNo: [null], |
||||
oilType: [null], |
||||
priceType: [null], |
||||
executionType: [null], |
||||
status: [null], |
||||
}); |
||||
|
||||
this.commonsService.getDictionary('GAS_OIL_TYPE', data => { |
||||
this.oilNoArray = data['return_data']; |
||||
}); |
||||
|
||||
// 管理员 、分公司
|
||||
if (this.secUserObjectType === 0 || this.secUserObjectType === 1) { |
||||
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
|
||||
this.priceTypeArray.push({codeValue: 1, codeName: '国标价'}); |
||||
this.priceTypeArray.push({codeValue: 2, codeName: '油站价'}); |
||||
this.priceTypeArray.push({codeValue: 3, codeName: '优惠幅度'}); |
||||
} else { |
||||
this.priceTypeArray.push({codeValue: 2, codeName: '油站价'}); |
||||
this.priceTypeArray.push({codeValue: 3, codeName: '优惠幅度'}); |
||||
} |
||||
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'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,45 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<div class="inner-content"> |
||||
<div class="main"> |
||||
<form nz-form [formGroup]="staffFrom"> |
||||
<div nz-row> |
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>职位类型</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<nz-select nzAllowClear formControlName="positionType"> |
||||
<nz-option *ngFor="let item of positionTypeArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>员工名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<input nz-input type="text" formControlName="name" placeholder="请输入员工名称" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8" nzRequired>员工电话</nz-form-label> |
||||
<nz-form-control [nzSpan]="8"> |
||||
<input nz-input type="text" formControlName="telephone" [maxLength]="11" placeholder="请输入员工电话" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div class="btn-div"> |
||||
<button class="btn-post" nz-button nzType="primary" (click)="submitFrom()" [nzLoading]="btnLoading" nzBlock>保存</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
@ -0,0 +1,7 @@ |
||||
.btn-div { |
||||
width: 100%; |
||||
text-align: center; |
||||
} |
||||
.btn-post { |
||||
width: 25%; |
||||
} |
@ -0,0 +1,25 @@ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { GasStaffEditComponent } from './gas-staff-edit.component'; |
||||
|
||||
describe('GasStaffEditComponent', () => { |
||||
let component: GasStaffEditComponent; |
||||
let fixture: ComponentFixture<GasStaffEditComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ GasStaffEditComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(GasStaffEditComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,116 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {ActivatedRoute, Router} from '_@angular_router@9.0.7@@angular/router'; |
||||
import {GasStaffService} from '../../../services/gas-staff.service'; |
||||
import {CommonsService} from "../../../services/commons.service"; |
||||
import {ValidatorsService} from "../../../services/validators.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-gas-staff-edit', |
||||
templateUrl: './gas-staff-edit.component.html', |
||||
styleUrls: ['./gas-staff-edit.component.scss'] |
||||
}) |
||||
export class GasStaffEditComponent implements OnInit { |
||||
|
||||
staffFrom: FormGroup; |
||||
btnLoading = false; |
||||
|
||||
positionTypeArray = []; |
||||
|
||||
constructor(private formBuilder: FormBuilder, |
||||
private modal: NzModalService, |
||||
private gasStaffService: GasStaffService, |
||||
private activatedRoute: ActivatedRoute, |
||||
private commonsService: CommonsService, |
||||
private router: Router) { } |
||||
|
||||
ngOnInit(): void { |
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams['id'] != null) { |
||||
this.getDetail(queryParams['id']); |
||||
} |
||||
}); |
||||
|
||||
this.commonsService.getDictionary('GAS_STAFF_POSITION_TYPE', data => { |
||||
this.positionTypeArray = data['return_data']; |
||||
}); |
||||
|
||||
this.staffFrom = this.formBuilder.group({ |
||||
id: [null], |
||||
positionType: ['1', [Validators.required]], |
||||
name: [null, [Validators.required]], |
||||
telephone: [null, [Validators.required, ValidatorsService.mobile]], |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param id |
||||
*/ |
||||
getDetail(id: number) { |
||||
this.gasStaffService.getStaffDetail(id, data => { |
||||
if (data['return_code'] === '000000') { |
||||
data['return_data']['positionType'] = String(data['return_data']['positionType']); |
||||
this.staffFrom.patchValue(data['return_data']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 提交 |
||||
*/ |
||||
submitFrom() { |
||||
for (const i in this.staffFrom.controls) { |
||||
this.staffFrom.controls[i].markAsDirty(); |
||||
this.staffFrom.controls[i].updateValueAndValidity(); |
||||
} |
||||
if (this.staffFrom.status == null || this.staffFrom.status !== 'VALID') { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzContent: '请规范填写所有的必填项信息', |
||||
}); |
||||
return; |
||||
} |
||||
|
||||
this.btnLoading = true; |
||||
if (this.staffFrom.value.id == null) { |
||||
this.gasStaffService.addStaff(this.staffFrom.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.modal.success({ |
||||
nzTitle: '提示', |
||||
nzContent: '添加成功', |
||||
nzOnOk: () => this.router.navigateByUrl('admin/gas-staff/list') |
||||
}); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
this.btnLoading = false; |
||||
}); |
||||
} else { |
||||
this.gasStaffService.updateStaff(this.staffFrom.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.modal.success({ |
||||
nzTitle: '提示', |
||||
nzContent: '修改成功', |
||||
nzOnOk: () => this.router.navigateByUrl('admin/gas-staff/list') |
||||
}); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
this.btnLoading = false; |
||||
}); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,116 @@ |
||||
<!-- 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"> |
||||
<nz-select nzAllowClear formControlName="positionType"> |
||||
<nz-option *ngFor="let item of positionTypeArray" 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"> |
||||
<input nz-input formControlName="name" /> |
||||
</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="telephone" /> |
||||
</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="status"> |
||||
<nz-option nzValue="1" nzLabel="正常"></nz-option> |
||||
<nz-option nzValue="2" 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"> |
||||
<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="140px">创建时间</th> |
||||
<th nzWidth="140px">修改时间</th> |
||||
<th nzWidth="110px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.positionName}}</td> |
||||
<td>{{data.name}}</td> |
||||
<td>{{data.telephone}}</td> |
||||
<td>{{data.status | gasStaffStatus}}</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.updateTime | 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 [routerLink]="['/admin/gas-staff/edit']" [queryParams]="{ id: data.id}"><a>修改</a></li> |
||||
<li nz-menu-item (click)="showDisabledConfirm(data.id)" *ngIf="data.status == 1" ><a>禁用</a></li> |
||||
<li nz-menu-item (click)="showRecoverConfirm(data.id)" *ngIf="data.status == 2" ><a>恢复</a></li> |
||||
<li nz-menu-item (click)="showDelConfirm(data.id)"><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 { GasStaffListComponent } from './gas-staff-list.component'; |
||||
|
||||
describe('GasStaffListComponent', () => { |
||||
let component: GasStaffListComponent; |
||||
let fixture: ComponentFixture<GasStaffListComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ GasStaffListComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(GasStaffListComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,184 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup, Validators} 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 {OrganizationService} from '../../../services/organization.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 {GasStaffService} from '../../../services/gas-staff.service'; |
||||
import {CommonsService} from "../../../services/commons.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-gas-staff-list', |
||||
templateUrl: './gas-staff-list.component.html', |
||||
styleUrls: ['./gas-staff-list.component.scss'] |
||||
}) |
||||
export class GasStaffListComponent implements OnInit { |
||||
FILE_URL = environment.imageUrl; |
||||
roleType; |
||||
adminFlag; |
||||
loadingObject = { |
||||
spinning: false, |
||||
msg: '加载中' |
||||
}; |
||||
|
||||
dataObject: any = {}; |
||||
tableLoading = true; |
||||
searchForm: FormGroup; |
||||
pageNum: number; |
||||
whereObject: any = {}; |
||||
|
||||
positionTypeArray = []; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, |
||||
private gasStaffService: GasStaffService, |
||||
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({ |
||||
name: [null], |
||||
telephone: [null], |
||||
positionType: [null], |
||||
status: [null], |
||||
}); |
||||
|
||||
this.commonsService.getDictionary('GAS_STAFF_POSITION_TYPE', data => { |
||||
this.positionTypeArray = data['return_data']; |
||||
}); |
||||
|
||||
this.requestData(1); |
||||
} |
||||
|
||||
/** |
||||
* 请求数据 |
||||
*/ |
||||
requestData(pageNum) { |
||||
this.tableLoading = true; |
||||
this.whereObject['pageNum'] = pageNum; |
||||
this.whereObject['pageSize'] = 10; |
||||
this.gasStaffService.getStaffList(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(); |
||||
} |
||||
|
||||
/** |
||||
* 弹出删除对话框 |
||||
*/ |
||||
showDisabledConfirm(id: number): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否禁用该员工', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.disabledData(id) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用数据 |
||||
*/ |
||||
disabledData(id: number) { |
||||
this.gasStaffService.disabled({ staffId: id }, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 弹出恢复对话框 |
||||
*/ |
||||
showRecoverConfirm(id: number): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否恢复该员工状态', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.recoverData(id) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 恢复数据 |
||||
*/ |
||||
recoverData(id: number) { |
||||
this.gasStaffService.recover({ staffId: id }, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 弹出删除对话框 |
||||
*/ |
||||
showDelConfirm(id: number): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否删除该员工', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.delData(id) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除数据 |
||||
*/ |
||||
delData(id: number) { |
||||
this.gasStaffService.delStaff({ staffId: id }, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import {GasStaffListComponent} from './gas-staff-list/gas-staff-list.component'; |
||||
import {GasStaffEditComponent} from './gas-staff-edit/gas-staff-edit.component'; |
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'list', component: GasStaffListComponent}, |
||||
{ path: 'edit', component: GasStaffEditComponent}, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class GasStaffRoutingModule { } |
@ -0,0 +1,27 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { CommonModule } from '@angular/common'; |
||||
|
||||
import { GasStaffRoutingModule } from './gas-staff-routing.module'; |
||||
import { GasStaffListComponent } from './gas-staff-list/gas-staff-list.component'; |
||||
import { GasStaffEditComponent } from './gas-staff-edit/gas-staff-edit.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: [GasStaffListComponent, GasStaffEditComponent], |
||||
imports: [ |
||||
CommonModule, |
||||
GasStaffRoutingModule, |
||||
NgZorroAntdModule, |
||||
ReactiveFormsModule, |
||||
FormsModule, |
||||
BreadcrumbModule, |
||||
AppCommonModule, |
||||
NgxEchartsModule, |
||||
] |
||||
}) |
||||
export class GasStaffModule { } |
@ -0,0 +1,21 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'chlidRechargeStatus' |
||||
}) |
||||
export class ChlidRechargeStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 101: |
||||
return '充值成功'; |
||||
case 102: |
||||
return '充值中'; |
||||
case 103: |
||||
return '充值失败'; |
||||
case 104: |
||||
return '未充值'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,17 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'oilPriceTaskExecutionType' |
||||
}) |
||||
export class OilPriceTaskExecutionTypePipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '立刻执行'; |
||||
case 2: |
||||
return '定时执行'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'oilPriceTaskPriceType' |
||||
}) |
||||
export class OilPriceTaskPriceTypePipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '国标价'; |
||||
case 2: |
||||
return '油站价'; |
||||
case 3: |
||||
return '优惠幅度'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,17 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'oilPriceTaskStatus' |
||||
}) |
||||
export class OilPriceTaskStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '等待中'; |
||||
case 2: |
||||
return '已执行'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'gasStaffStatus' |
||||
}) |
||||
export class GasStaffStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 0: |
||||
return '删除'; |
||||
case 1: |
||||
return '正常'; |
||||
case 2: |
||||
return '已禁用'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'payStatus' |
||||
}) |
||||
export class PayStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 101: |
||||
return '待支付'; |
||||
case 102: |
||||
return '已支付'; |
||||
case 100: |
||||
return '已完成'; |
||||
case 104: |
||||
return '已取消'; |
||||
case 105: |
||||
return '已退款'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,21 +1,26 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
import {Pipe, PipeTransform} from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'rechargePayType' |
||||
name: 'rechargePayType' |
||||
}) |
||||
export class RechargePayTypePipe implements PipeTransform { |
||||
|
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '微信'; |
||||
case 2: |
||||
return '工会卡'; |
||||
case 3: |
||||
return '积分'; |
||||
case 4: |
||||
return '银联'; |
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '支付宝'; |
||||
case 2: |
||||
return '微信'; |
||||
case 3: |
||||
return '汇联通工会卡'; |
||||
case 4: |
||||
return '银联'; |
||||
case 5: |
||||
return '银联分期'; |
||||
case null: |
||||
return '积分抵扣'; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
@ -0,0 +1,19 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'priceStatus' |
||||
}) |
||||
export class PriceStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '上线中'; |
||||
case 2: |
||||
return '已售空'; |
||||
case 3: |
||||
return '编辑中'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
import {Pipe, PipeTransform} from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'rechargePlatform' |
||||
}) |
||||
export class RechargePlatformPipe implements PipeTransform { |
||||
|
||||
transform(value: string): unknown { |
||||
const array = value.split('-'); |
||||
let string = ''; |
||||
for (const i of array) { |
||||
if (Number(i) === 1) { |
||||
string = string + '尖椒,'; |
||||
} |
||||
if (Number(i) === 2) { |
||||
string = string + '龙阅,'; |
||||
} |
||||
|
||||
} |
||||
return string.substring(0 , string.length - 1); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,99 @@ |
||||
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 GasStaffService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 禁用油品 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public addStaff(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasStaff/addGasStaff', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用油品 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public updateStaff(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasStaff/updateGasStaff', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public disabled(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasStaff/disabled', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 恢复 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public recover(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasStaff/recover', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public delStaff(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasStaff/delStaff', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用油品 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getStaffDetail(staffId: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'gasStaff/getStaffDetail?staffId=' + staffId).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用油品 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getStaffList(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'gasStaff/getStaffList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,28 @@ |
||||
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 MerAmountService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 充值 |
||||
* |
||||
* @param params 上传对象 |
||||
* @param callBack 回调 |
||||
* @return data 返回结果 |
||||
*/ |
||||
public recharge(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'merAccount/recharge', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
@ -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); |
||||
}); |
||||
} |
||||
|
||||
} |
@ -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); |
||||
}); |
||||
} |
||||
} |
@ -1,251 +1,263 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {Injectable} from '@angular/core'; |
||||
import {HttpClient} from '@angular/common/http'; |
||||
import {CommonsService} from './commons.service'; |
||||
import {environment} from '../../environments/environment'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
providedIn: 'root' |
||||
}) |
||||
export class RechargeService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { |
||||
} |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getListOutRechargePrice(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargePrice/getListOutRechargePrice?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName deletePrice |
||||
* @Description //上下架
|
||||
* @Date 15:03 2021/8/12 |
||||
* @Param mod |
||||
**/ |
||||
public onAndOffShelves(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargePrice/onAndOffShelves?id=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* |
||||
* @param params 上传对象 |
||||
* @param callBack 回调 |
||||
* @return data 返回结果 |
||||
*/ |
||||
public insertPrice(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'outRechargePrice/insertPrice', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改卡券 |
||||
* |
||||
* @param params 上传对象 |
||||
* @param callBack 回调 |
||||
* @return data 返回结果 |
||||
*/ |
||||
public updatePrice(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'outRechargePrice/updatePrice', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id查询详情 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public findById(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargePrice/findById?id=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id查询详情 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public deletePrice(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargePrice/deletePrice?id=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getOrderList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据id查询详情 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getOrderById(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderById?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id完成订单 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getMobileRechargeByOrderId(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getMobileRechargeByOrderId?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id完成退款 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public orderToRefund(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/orderToRefund?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName orderToRefundPre |
||||
* @Description // 预约订单退款
|
||||
* @Date 11:17 上午 2021/11/23 |
||||
* @Param [id: number, callBack] |
||||
*/ |
||||
public orderToRefundPre(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'highOrderPre/orderToRefund?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 申请退款 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public postRefund(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'highRefundAudit/insertRefundAudit', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询充值订单数量 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public countOrder(callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/countOrder').subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getOrderCountList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 到处订单统计 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportOrderListCount(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 到处订单统计 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportOrderList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getUserCountList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getUserCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 到处订单统计 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportUserOrderListCount(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/exportUserOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取渠道商获取关联商品 |
||||
* |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getMemberGoods(callBack) { |
||||
this.http.get(environment.baseUrl + 'telApi/getMemberGoods').subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { |
||||
} |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getListOutRechargePrice(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargePrice/getListOutRechargePrice?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName editPriceStatus |
||||
* @Description // 修改价格状态
|
||||
* @Date 15:03 2021/8/12 |
||||
* @Param mod |
||||
**/ |
||||
public editPriceStatus(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'outRechargePrice/editPriceStatus', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* |
||||
* @param params 上传对象 |
||||
* @param callBack 回调 |
||||
* @return data 返回结果 |
||||
*/ |
||||
public insertPrice(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'outRechargePrice/insertPrice', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改卡券 |
||||
* |
||||
* @param params 上传对象 |
||||
* @param callBack 回调 |
||||
* @return data 返回结果 |
||||
*/ |
||||
public updatePrice(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'outRechargePrice/updatePrice', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id查询详情 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public findById(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargePrice/findById?id=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id查询详情 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public deletePrice(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargePrice/deletePrice?id=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getOrderList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据id查询详情 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getOrderById(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderById?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id完成订单 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getMobileRechargeByOrderId(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getMobileRechargeByOrderId?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id完成退款 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public orderToRefund(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/orderToRefund?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName orderToRefundPre |
||||
* @Description // 预约订单退款
|
||||
* @Date 11:17 上午 2021/11/23 |
||||
* @Param [id: number, callBack] |
||||
*/ |
||||
public orderToRefundPre(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'highOrderPre/orderToRefund?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 申请退款 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public postRefund(params: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'highRefundAudit/insertRefundAudit', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询充值订单数量 |
||||
* |
||||
* @param id id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public countOrder(callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/countOrder').subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getOrderCountList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 到处订单统计 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportOrderListCount(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 到处订单统计 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportOrderList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getUserCountList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getUserCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 到处订单统计 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportUserOrderListCount(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/exportUserOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取渠道商获取关联商品 |
||||
* |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getMemberGoods(callBack) { |
||||
this.http.get(environment.baseUrl + 'telApi/getMemberGoods').subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName orderToRefundPre |
||||
* @Description // 预约订单退款
|
||||
* @Date 11:17 上午 2021/11/23 |
||||
* @Param [id: number, callBack] |
||||
*/ |
||||
public getChildOrder(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'outRechargeOrder/getChildOrder?orderId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
||||
|
Loading…
Reference in new issue