parent
3ad0e4032e
commit
2c1cbc4273
@ -0,0 +1,64 @@ |
||||
<form nz-form [formGroup]="searchForm" class="search_form"> |
||||
<div nz-row [nzGutter]="24"> |
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzNoColon]="true"></nz-form-label> |
||||
<nz-form-control> |
||||
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="showEditModal()">创建油枪号</button> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
<nz-table #basicTable |
||||
[nzScroll]="{ x: '1000' }" |
||||
[nzBordered]="true" |
||||
[nzShowPagination]="false" |
||||
[nzFrontPagination]="false" |
||||
[nzShowQuickJumper]="false" |
||||
[nzShowTotal]="totalTemplate" |
||||
[nzTotal]="tableData.length" |
||||
[nzData]="tableData" > |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="60px">油品类型</th> |
||||
<th nzWidth="60px">油号</th> |
||||
<th nzWidth="80px">油枪号</th> |
||||
<th nzWidth="80px">创建时间</th> |
||||
<th nzRight nzWidth="60px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data"> |
||||
<td>{{data.oilTypeName}}</td> |
||||
<td>{{data.oilNoName}}</td> |
||||
<td>{{data.gunNo}}</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td nzRight> |
||||
<button nz-button nzType="link" (click)="del(data)" [nzSize]="'small'" >删除</button> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
||||
</nz-table> |
||||
|
||||
<nz-modal [(nzVisible)]="editDataModal" |
||||
[nzWidth]="500" |
||||
nzTitle="创建油枪号" |
||||
[nzFooter]="null" |
||||
(nzOnCancel)="closeEditModal()"> |
||||
<ng-container *nzModalContent> |
||||
<form nz-form [formGroup]="editDataForm"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>油枪号</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<input nz-input formControlName="gunNo" placeholder="请输入"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'"> |
||||
<button nz-button nzType="primary" (click)="submitData()" class="submit-btn">创建</button> |
||||
</div> |
||||
</form> |
||||
</ng-container> |
||||
</nz-modal> |
@ -0,0 +1,3 @@ |
||||
nz-input-number { |
||||
width: 100%; |
||||
} |
@ -0,0 +1,210 @@ |
||||
import {Component, Input, OnInit} from '@angular/core'; |
||||
import {DatePipe, NgForOf, NgIf} from "@angular/common"; |
||||
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; |
||||
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; |
||||
import {NzButtonComponent} from "ng-zorro-antd/button"; |
||||
import { |
||||
NzCellFixedDirective, |
||||
NzTableCellDirective, |
||||
NzTableComponent, NzTableModule, |
||||
NzTbodyComponent, NzTheadComponent, |
||||
NzThMeasureDirective, NzTrDirective |
||||
} from "ng-zorro-antd/table"; |
||||
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
||||
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
||||
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; |
||||
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; |
||||
import {NzIconDirective} from "ng-zorro-antd/icon"; |
||||
import {NzInputDirective} from "ng-zorro-antd/input"; |
||||
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; |
||||
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
||||
import {NzModalModule, NzModalService} from "ng-zorro-antd/modal"; |
||||
import {NzFlexDirective} from "ng-zorro-antd/flex"; |
||||
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; |
||||
import {NzUploadComponent} from "ng-zorro-antd/upload"; |
||||
import {NzAvatarModule} from "ng-zorro-antd/avatar"; |
||||
import {NzImageModule} from "ng-zorro-antd/image"; |
||||
import {NzSwitchComponent} from "ng-zorro-antd/switch"; |
||||
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; |
||||
import {NzInputNumberModule} from "ng-zorro-antd/input-number"; |
||||
import {WeekPipe} from "../../../pipes/common/week.pipe"; |
||||
import {NzTypographyComponent} from "ng-zorro-antd/typography"; |
||||
import {RouterLink} from "@angular/router"; |
||||
import {NzMessageService} from "ng-zorro-antd/message"; |
||||
import {BrowserStorageService} from "../../../utils/localStorage.service"; |
||||
import {OilGunNoService} from "../../../services/mer-oil-price/oil-gun-no.service"; |
||||
import {OilPriceService} from "../../../services/mer-oil-price/oil-price.service"; |
||||
import {CommonService} from "../../../services/common/common.service"; |
||||
import {DATA} from "../../../data/login/localStorage.namespace"; |
||||
import {NzEmptyModule} from "ng-zorro-antd/empty"; |
||||
|
||||
@Component({ |
||||
selector: 'app-oil-no-config', |
||||
standalone: true, |
||||
imports: [ |
||||
DatePipe, |
||||
DictionaryPipe, |
||||
FormsModule, |
||||
NgForOf, |
||||
NgIf, |
||||
NzButtonComponent, |
||||
NzCellFixedDirective, |
||||
NzColDirective, |
||||
NzDividerComponent, |
||||
NzDropDownADirective, |
||||
NzDropDownDirective, |
||||
NzDropdownMenuComponent, |
||||
NzFormControlComponent, |
||||
NzFormDirective, |
||||
NzFormItemComponent, |
||||
NzFormLabelComponent, |
||||
NzIconDirective, |
||||
NzInputDirective, |
||||
NzMenuDirective, |
||||
NzMenuItemComponent, |
||||
NzOptionComponent, |
||||
NzRowDirective, |
||||
NzSelectComponent, |
||||
NzTableCellDirective, |
||||
NzTableComponent, |
||||
NzTbodyComponent, |
||||
NzThMeasureDirective, |
||||
NzTheadComponent, |
||||
NzTrDirective, |
||||
ReactiveFormsModule, |
||||
NzTableModule, |
||||
NzModalModule, |
||||
NzFlexDirective, |
||||
NzDescriptionsModule, |
||||
NzUploadComponent, |
||||
NzAvatarModule, |
||||
NzImageModule, |
||||
NzSwitchComponent, |
||||
NzDatePickerComponent, |
||||
NzInputNumberModule, |
||||
WeekPipe, |
||||
NzTypographyComponent, |
||||
RouterLink, |
||||
], |
||||
templateUrl: './oil-no-config.component.html', |
||||
styleUrl: './oil-no-config.component.less' |
||||
}) |
||||
export class OilNoConfigComponent implements OnInit { |
||||
// 表单数据
|
||||
tableData: any = []; |
||||
// 搜索表单
|
||||
searchForm: FormGroup; |
||||
// 油号
|
||||
oilNoArray = new DictionaryPipe().getDictionaryList('OIL_NO'); |
||||
// 商户号
|
||||
@Input() merNo: any; |
||||
// 油号
|
||||
@Input() oilNo: any; |
||||
// 编辑数据表单
|
||||
editDataForm: FormGroup; |
||||
editDataModal = false; |
||||
|
||||
constructor(private fb: NonNullableFormBuilder, |
||||
private message: NzMessageService, |
||||
private storage: BrowserStorageService, |
||||
private oilGunNoService: OilGunNoService, |
||||
private commonService: CommonService, |
||||
private modal: NzModalService) { |
||||
this.searchForm = this.fb.group({ |
||||
merNo: [null], |
||||
oilNo: [null], |
||||
}); |
||||
this.editDataForm = this.fb.group({ |
||||
merNo: [null], |
||||
oilNo: [null], |
||||
gunNo: [null, Validators.required], |
||||
}); |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
if (this.merNo == null) { |
||||
this.merNo = this.storage.get(DATA)['merchant']['merNo']; |
||||
} |
||||
this.searchForm.controls['merNo'].setValue(this.merNo); |
||||
this.searchForm.controls['oilNo'].setValue(this.oilNo); |
||||
// 查询数据
|
||||
this.queryData(); |
||||
} |
||||
|
||||
/** |
||||
* 获取数据 |
||||
*/ |
||||
queryData() { |
||||
this.searchForm.value.time = new Date().getTime(); |
||||
this.searchForm.value.pageNum = 1; |
||||
this.searchForm.value.pageSize = 100; |
||||
this.oilGunNoService.queryGunNoList(this.searchForm.value, (data: any) => { |
||||
if (data['return_code'] == '000000') { |
||||
this.tableData = data['return_data']; |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 打开编辑模态框 |
||||
*/ |
||||
showEditModal() { |
||||
this.editDataModal = true; |
||||
} |
||||
|
||||
/** |
||||
* 提交数据 |
||||
*/ |
||||
submitData() { |
||||
this.editDataForm.controls['merNo'].setValue(this.merNo); |
||||
this.editDataForm.controls['oilNo'].setValue(this.oilNo); |
||||
if (this.editDataForm.valid) { |
||||
this.oilGunNoService.createOilGunNo(this.editDataForm.value, (data: any) => { |
||||
if (data['return_code'] == '000000') { |
||||
this.message.create('success', '操作成功'); |
||||
// 刷新数据
|
||||
this.queryData(); |
||||
// 关闭弹窗
|
||||
this.closeEditModal(); |
||||
} else { |
||||
this.message.create('error', data['return_msg']); |
||||
} |
||||
}); |
||||
} else { |
||||
Object.values(this.editDataForm.controls).forEach(control => { |
||||
if (control.invalid) { |
||||
control.markAsDirty(); |
||||
control.updateValueAndValidity({ onlySelf: true }); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 关闭编辑任务模态框 |
||||
*/ |
||||
closeEditModal() { |
||||
this.editDataForm.reset(); |
||||
this.editDataModal = false; |
||||
} |
||||
|
||||
/** |
||||
* 删除油号 |
||||
* @param oilNo |
||||
*/ |
||||
del(data: any) { |
||||
this.modal.confirm({ |
||||
nzTitle: '提醒', |
||||
nzContent: '确定删除'+data.gunNo+'号枪吗?', |
||||
nzOnOk: () => this.oilGunNoService.delete({'gunNoId': data.id }, (data: any) => { |
||||
if (data['return_code'] == '000000') { |
||||
this.message.create('success', '操作成功'); |
||||
// 刷新数据
|
||||
this.queryData(); |
||||
} else { |
||||
this.message.create('error', data['return_msg']); |
||||
} |
||||
}) |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,120 @@ |
||||
<form nz-form [formGroup]="searchForm" class="search_form"> |
||||
<div nz-row [nzGutter]="24"> |
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label>油号</nz-form-label> |
||||
<nz-form-control> |
||||
<nz-select formControlName="oilNo" [nzPlaceHolder]="'请选择'"> |
||||
<nz-option *ngFor="let item of oilNoArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzNoColon]="true"></nz-form-label> |
||||
<nz-form-control> |
||||
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="searchFormSubmit()">查询</button> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
<nz-table #basicTable |
||||
[nzScroll]="{ x: '1200' }" |
||||
[nzBordered]="true" |
||||
[nzShowPagination]="false" |
||||
[nzFrontPagination]="false" |
||||
[nzShowQuickJumper]="false" |
||||
[nzShowTotal]="totalTemplate" |
||||
[nzTotal]="tableData.length" |
||||
[nzData]="tableData" > |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="100px">日期</th> |
||||
<th nzWidth="100px">油号</th> |
||||
<th nzWidth="100px">国标价</th> |
||||
<th nzWidth="100px">油枪价</th> |
||||
<th nzWidth="100px">优惠价</th> |
||||
<th nzWidth="100px">更新时间</th> |
||||
<th nzRight nzWidth="50px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data"> |
||||
<td style="{{today == data.weeks?'color: red':''}}"> |
||||
{{data.weeks | week}} {{today == data.weeks?'(今日)':''}} |
||||
</td> |
||||
<td>{{data.oilNoName}}</td> |
||||
<td>{{data.priceOfficial}}</td> |
||||
<td>{{data.priceGun}}</td> |
||||
<td>{{data.priceVip}}</td> |
||||
<td>{{data.updateTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td nzRight> |
||||
<button nz-button nzType="link" (click)="showEditModal(data)" [nzSize]="'small'" >修改</button> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
||||
</nz-table> |
||||
|
||||
<nz-modal [(nzVisible)]="editDataModal" |
||||
[nzWidth]="500" |
||||
nzTitle="修改价格" |
||||
[nzFooter]="null" |
||||
(nzOnCancel)="closeEditModal()"> |
||||
<ng-container *nzModalContent> |
||||
<form nz-form [formGroup]="editDataForm"> |
||||
|
||||
<nz-form-item> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24">日期</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-select formControlName="week" [nzPlaceHolder]="'请选择'"> |
||||
<nz-option nzValue="1" nzLabel="星期一"></nz-option> |
||||
<nz-option nzValue="2" nzLabel="星期二"></nz-option> |
||||
<nz-option nzValue="3" nzLabel="星期三"></nz-option> |
||||
<nz-option nzValue="4" nzLabel="星期四"></nz-option> |
||||
<nz-option nzValue="5" nzLabel="星期五"></nz-option> |
||||
<nz-option nzValue="6" nzLabel="星期六"></nz-option> |
||||
<nz-option nzValue="7" nzLabel="星期日"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<nz-form-item> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24">油品</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-select formControlName="oilNo" nzAllowClear [nzPlaceHolder]="'请选择'"> |
||||
<nz-option *ngFor="let item of oilNoArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<nz-form-item> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>国标价</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-input-number formControlName="priceOfficial" [nzMin]="0" [nzMax]="99" [nzStep]="1" [nzPrecision]="2" [nzPlaceHolder]="'国标价'"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<nz-form-item> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>油枪价</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-input-number formControlName="priceGun" [nzMin]="0" [nzMax]="99" [nzStep]="1" [nzPrecision]="2" [nzPlaceHolder]="'油枪价'"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<nz-form-item> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>优惠价</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-input-number formControlName="priceVip" [nzMin]="0" [nzMax]="99" [nzStep]="1" [nzPrecision]="2" [nzPlaceHolder]="'优惠价'"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'"> |
||||
<button nz-button nzType="primary" (click)="submitData()" class="submit-btn">保存</button> |
||||
</div> |
||||
</form> |
||||
</ng-container> |
||||
</nz-modal> |
@ -0,0 +1,3 @@ |
||||
nz-input-number { |
||||
width: 100%; |
||||
} |
@ -0,0 +1,206 @@ |
||||
import { Component } from '@angular/core'; |
||||
import {DatePipe, NgForOf, NgIf} from "@angular/common"; |
||||
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; |
||||
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; |
||||
import {NzButtonComponent} from "ng-zorro-antd/button"; |
||||
import { |
||||
NzCellFixedDirective, |
||||
NzTableCellDirective, |
||||
NzTableComponent, NzTableModule, |
||||
NzTbodyComponent, NzTheadComponent, |
||||
NzThMeasureDirective, NzTrDirective |
||||
} from "ng-zorro-antd/table"; |
||||
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
||||
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
||||
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; |
||||
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; |
||||
import {NzIconDirective} from "ng-zorro-antd/icon"; |
||||
import {NzInputDirective} from "ng-zorro-antd/input"; |
||||
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; |
||||
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
||||
import {NzModalModule, NzModalService} from "ng-zorro-antd/modal"; |
||||
import {NzFlexDirective} from "ng-zorro-antd/flex"; |
||||
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; |
||||
import {NzUploadComponent} from "ng-zorro-antd/upload"; |
||||
import {NzAvatarModule} from "ng-zorro-antd/avatar"; |
||||
import {NzImageModule} from "ng-zorro-antd/image"; |
||||
import {NzSwitchComponent} from "ng-zorro-antd/switch"; |
||||
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; |
||||
import {NzInputNumberModule} from "ng-zorro-antd/input-number"; |
||||
import {WeekPipe} from "../../../pipes/common/week.pipe"; |
||||
import {NzMessageService} from "ng-zorro-antd/message"; |
||||
import {BrowserStorageService} from "../../../utils/localStorage.service"; |
||||
import {GasOilPriceWeekService} from "../../../services/mer-oil-price/gas-oil-price-week.service"; |
||||
import {CommonService} from "../../../services/common/common.service"; |
||||
import {DATA} from "../../../data/login/localStorage.namespace"; |
||||
import {ActivatedRoute} from "@angular/router"; |
||||
|
||||
@Component({ |
||||
selector: 'app-oil-price-config', |
||||
standalone: true, |
||||
imports: [ |
||||
DatePipe, |
||||
DictionaryPipe, |
||||
FormsModule, |
||||
NgForOf, |
||||
NgIf, |
||||
NzButtonComponent, |
||||
NzCellFixedDirective, |
||||
NzColDirective, |
||||
NzDividerComponent, |
||||
NzDropDownADirective, |
||||
NzDropDownDirective, |
||||
NzDropdownMenuComponent, |
||||
NzFormControlComponent, |
||||
NzFormDirective, |
||||
NzFormItemComponent, |
||||
NzFormLabelComponent, |
||||
NzIconDirective, |
||||
NzInputDirective, |
||||
NzMenuDirective, |
||||
NzMenuItemComponent, |
||||
NzOptionComponent, |
||||
NzRowDirective, |
||||
NzSelectComponent, |
||||
NzTableCellDirective, |
||||
NzTableComponent, |
||||
NzTbodyComponent, |
||||
NzThMeasureDirective, |
||||
NzTheadComponent, |
||||
NzTrDirective, |
||||
ReactiveFormsModule, |
||||
NzTableModule, |
||||
NzModalModule, |
||||
NzFlexDirective, |
||||
NzDescriptionsModule, |
||||
NzUploadComponent, |
||||
NzAvatarModule, |
||||
NzImageModule, |
||||
NzSwitchComponent, |
||||
NzDatePickerComponent, |
||||
NzInputNumberModule, |
||||
WeekPipe |
||||
], |
||||
templateUrl: './oil-price-config.component.html', |
||||
styleUrl: './oil-price-config.component.less' |
||||
}) |
||||
export class OilPriceConfigComponent { |
||||
// 表单数据
|
||||
tableData: any = []; |
||||
// 搜索表单
|
||||
searchForm: FormGroup; |
||||
// 油号
|
||||
oilNoArray = new DictionaryPipe().getDictionaryList('OIL_NO'); |
||||
// 商户号
|
||||
merNo = null; |
||||
// 编辑数据表单
|
||||
editDataForm: FormGroup; |
||||
editDataModal = false; |
||||
|
||||
// 当前日期
|
||||
today:number = new Date().getDay(); |
||||
constructor(private fb: NonNullableFormBuilder, |
||||
private message: NzMessageService, |
||||
private storage: BrowserStorageService, |
||||
private gasOilPriceWeekService: GasOilPriceWeekService, |
||||
private commonService: CommonService, |
||||
private modal: NzModalService, |
||||
private activatedRoute: ActivatedRoute) { |
||||
|
||||
this.merNo = this.storage.get(DATA)['merchant']['merNo']; |
||||
// 初始化搜索框
|
||||
this.searchForm = this.fb.group({ |
||||
merNo: [this.merNo], |
||||
oilNo: [this.oilNoArray[0].codeValue], |
||||
}); |
||||
|
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
// 接收到路由参数
|
||||
if (queryParams['oilNo'] != null) { |
||||
this.searchForm.controls['oilNo'].setValue(queryParams['oilNo']); |
||||
} |
||||
}); |
||||
|
||||
this.editDataForm = this.fb.group({ |
||||
id: [null, [Validators.required]], |
||||
week: [null], |
||||
oilNo: [null], |
||||
priceOfficial: [null, [Validators.required]], |
||||
priceGun: [null, [Validators.required]], |
||||
priceVip: [null, [Validators.required]], |
||||
}); |
||||
// 查询数据
|
||||
this.queryData(); |
||||
} |
||||
|
||||
/** |
||||
* 获取数据 |
||||
*/ |
||||
queryData() { |
||||
this.searchForm.value.time = new Date().getTime(); |
||||
this.gasOilPriceWeekService.getPriceList(this.searchForm.value, (data: any) => { |
||||
if (data['return_code'] == '000000') { |
||||
this.tableData = data['return_data']; |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 搜索表单提交 |
||||
*/ |
||||
searchFormSubmit(): void { |
||||
this.queryData(); |
||||
} |
||||
|
||||
/** |
||||
* 搜索表单重置 |
||||
*/ |
||||
searchFormReset(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
/** |
||||
* 打开编辑模态框 |
||||
*/ |
||||
showEditModal(data: any) { |
||||
data['week'] = String(data['weeks']); |
||||
this.editDataForm.patchValue(data); |
||||
this.editDataForm.controls['week'].disable(); |
||||
this.editDataForm.controls['oilNo'].disable(); |
||||
this.editDataModal = true; |
||||
} |
||||
|
||||
/** |
||||
* 提交数据 |
||||
*/ |
||||
submitData() { |
||||
if (this.editDataForm.valid) { |
||||
this.gasOilPriceWeekService.updatePrice(this.editDataForm.value, (data: any) => { |
||||
if (data['return_code'] == '000000') { |
||||
this.message.create('success', '操作成功'); |
||||
// 刷新数据
|
||||
this.queryData(); |
||||
// 关闭弹窗
|
||||
this.closeEditModal(); |
||||
} else { |
||||
this.message.create('error', data['return_msg']); |
||||
} |
||||
}); |
||||
} else { |
||||
Object.values(this.editDataForm.controls).forEach(control => { |
||||
if (control.invalid) { |
||||
control.markAsDirty(); |
||||
control.updateValueAndValidity({ onlySelf: true }); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 关闭编辑任务模态框 |
||||
*/ |
||||
closeEditModal() { |
||||
this.editDataForm.reset(); |
||||
this.editDataModal = false; |
||||
} |
||||
} |
@ -0,0 +1,32 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'orderSettleLedgerStatus', |
||||
standalone: true |
||||
}) |
||||
export class OrderSettleLedgerStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): any { |
||||
switch (value) { |
||||
case 0: |
||||
return '待处理'; |
||||
case 1: |
||||
return '分账完成'; |
||||
case 2: |
||||
return '处理中'; |
||||
case 3: |
||||
return '已受理'; |
||||
case 4: |
||||
return '分账失败'; |
||||
case 5: |
||||
return '撤销中'; |
||||
case 6: |
||||
return '撤销成功'; |
||||
case 7: |
||||
return '撤销失败'; |
||||
default: |
||||
return '未知状态' |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,61 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {environment} from "../../../environments/environment"; |
||||
import {ObjectData} from "../../utils/objectData.service"; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class OilGunNoService { |
||||
|
||||
constructor(private http: HttpClient) { } |
||||
|
||||
/** |
||||
* 创建油品枪号 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public createOilGunNo(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.post(environment.baseUrl + 'gasOilGunNo/createOilGunNo', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除抢号 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public delete(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.post(environment.baseUrl + 'gasOilGunNo/delete', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询油品详情 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public queryOilDetail(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.get(environment.baseUrl + 'gasOilGunNo/queryOilDetail?'+ObjectData.objectByString(params)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询油品列表 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public queryGunNoList(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.get(environment.baseUrl + 'gasOilGunNo/queryGunNoList?'+ObjectData.objectByString(params)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,85 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {environment} from "../../../environments/environment"; |
||||
import {ObjectData} from "../../utils/objectData.service"; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class OilPriceService { |
||||
|
||||
constructor(private http: HttpClient) { } |
||||
|
||||
/** |
||||
* 创建油品 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public createOil(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.post(environment.baseUrl + 'gasOilPrice/createOil', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 恢复 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public restore(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.post(environment.baseUrl + 'gasOilPrice/restore', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用油品 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public disable(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.post(environment.baseUrl + 'gasOilPrice/disable', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除油品 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public delete(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.post(environment.baseUrl + 'gasOilPrice/delete', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询油品详情 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public queryOilDetail(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.get(environment.baseUrl + 'gasOilPrice/queryOilDetail?'+ObjectData.objectByString(params)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询油品列表 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public queryOilList(params: any, callBack:any) { |
||||
params.time = new Date().getTime(); |
||||
this.http.get(environment.baseUrl + 'gasOilPrice/queryOilList?'+ObjectData.objectByString(params)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,42 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {environment} from "../../../environments/environment"; |
||||
import {ObjectData} from "../../utils/objectData.service"; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class OrderSettleService { |
||||
constructor(private http: HttpClient) { } |
||||
|
||||
/** |
||||
* 查询订单结算详情 |
||||
* @param param |
||||
* @param callBack |
||||
*/ |
||||
public getDetailByOrderNo(orderNo: string, callBack:any) { |
||||
let param = { |
||||
orderNo: orderNo, |
||||
dt: new Date().getTime() |
||||
} |
||||
this.http.get(environment.baseUrl + 'orderSettle/getDetailByOrderNo?'+ObjectData.objectByString(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单结算详情 |
||||
* @param param |
||||
* @param callBack |
||||
*/ |
||||
public revokeLedger(orderNo: string, callBack:any) { |
||||
let param = { |
||||
orderNo: orderNo, |
||||
dt: new Date().getTime() |
||||
} |
||||
this.http.post(environment.baseUrl + 'orderSettle/revokeLedger', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue