提交代码

pull/1/head
胡锐 2 years ago
parent a1a6241df6
commit 818f6039d8
  1. 2
      src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts
  2. 36
      src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html
  3. 110
      src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts
  4. 4
      src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts
  5. 140
      src/app/admin/merchant-store/oli/oli.component.html
  6. 15
      src/app/admin/merchant-store/oli/oli.component.ts
  7. 6
      src/app/admin/order/oil-station-order/oil-station-order.component.ts
  8. 4
      src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts

@ -336,7 +336,7 @@ export class GasClassGroupTaskComponent implements OnInit {
let newstr = '<div id="div_print" style="font-size: 16px;">\n' +
' <div style="float: left;margin-bottom: 50px;">\n' +
' <div style="line-height: 30px; color:#000;">\n' +
' <span style="font-size: 13px;float: left;width: 100%;margin-left: 90px;">'+data['classNum']+'班结流水</span>\n' +
' <span style="font-size: 13px;float: left;width: 100%;margin-left: 65px;">'+data['classNum']+'班结流水(补打)</span>\n' +
' </div>\n' +
' <table style="width: 100%;">\n' +
' <tbody>\n' +

@ -8,10 +8,10 @@
<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-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 formControlName="priceType" [nzPlaceHolder]="'请选择价格类型'" (ngModelChange)="selectPriceType($event)">
<nz-option *ngFor="let item of priceTypeArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
@ -19,10 +19,10 @@
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>价格类型</nz-form-label>
<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 formControlName="oilNo" [nzPlaceHolder]="'请选择油号'" (ngModelChange)="selectOilNo($event)">
<nz-option *ngFor="let item of oilNoArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
@ -50,11 +50,31 @@
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24" *ngIf="dataFrom.value.priceType == 2 || dataFrom.value.priceType == 4">
<nz-form-item>
<nz-form-label [nzSpan]="8">国标价</nz-form-label>
<nz-form-control [nzSpan]="8">
<nz-input-number formControlName="priceOfficial" [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-label [nzSpan]="8" nzRequired>执行价格</nz-form-label>
<nz-form-control [nzSpan]="8">
<nz-input-group nzAddOnAfter="元">
<nz-input-number formControlName="price" [nzMin]="0" [nzMax]="999" [nzStep]="1" [nzPrecision]="2" (ngModelChange)="priceChange($event)"></nz-input-number>
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24" *ngIf="dataFrom.value.priceType == 4">
<nz-form-item>
<nz-form-label [nzSpan]="8">直降后油站价</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-input-number formControlName="gasPrice" [nzMin]="0" [nzMax]="999" [nzStep]="1" [nzPrecision]="2"></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>

@ -6,6 +6,8 @@ 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";
import {OilPriceOfficialService} from '../../../services/oil-price/oil-price-official.service';
import {data} from 'jquery';
@Component({
selector: 'app-oil-price-task-edit',
@ -26,6 +28,7 @@ export class OilPriceTaskEditComponent implements OnInit {
constructor(private formBuilder: FormBuilder,
private modal: NzModalService,
private oilPriceTaskService: OilPriceTaskService,
private oilPriceOfficialService: OilPriceOfficialService,
private activatedRoute: ActivatedRoute,
private commonsService: CommonsService,
private localStorageService: LocalStorageService , // 请求缓存
@ -36,7 +39,9 @@ export class OilPriceTaskEditComponent implements OnInit {
ngOnInit(): void {
this.dataFrom = this.formBuilder.group({
oilNo: ['92', [Validators.required]],
oilNo: [null, [Validators.required]],
priceOfficial: [{ value: 0, disabled: true}, [Validators.required]],
gasPrice: [{ value: 0, disabled: true}, [Validators.required]],
priceType: [null, [Validators.required]],
price: [0, [Validators.required]],
executionType: ['1', [Validators.required]],
@ -50,7 +55,7 @@ export class OilPriceTaskEditComponent implements OnInit {
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
this.priceTypeArray.push({ codeValue: 1, codeName: '国标价' });
this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' });
this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度'});
this.priceTypeArray.push({ codeValue: 3, codeName: '平台优惠'});
// 获取全部省级地区
this.commonsService.getProvinceList(data => {
@ -63,10 +68,10 @@ export class OilPriceTaskEditComponent implements OnInit {
// 分公司
} else if (this.secUserObjectType === 1) {
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
// 价格类型 1. 国标价 2. 油站价 3. 平台优惠 4. 油站直降
this.priceTypeArray.push({ codeValue: 1, codeName: '国标价' });
this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' });
this.priceTypeArray.push({ codeValue: 3, 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'] });
@ -78,7 +83,6 @@ export class OilPriceTaskEditComponent implements OnInit {
// 商户
} 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'];
@ -87,7 +91,7 @@ export class OilPriceTaskEditComponent implements OnInit {
// 加油站
} else if (this.secUserObjectType === 3) {
this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' });
this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度' });
this.priceTypeArray.push({ codeValue: 4, codeName: '油站直降' });
this.dataFrom.patchValue({ merStoreIdArray: [ this.localStorageService.get(ADMIN_INFO_OBJECT)['merchantStore']['id'] ] });
}
@ -99,7 +103,7 @@ export class OilPriceTaskEditComponent implements OnInit {
}
/**
*
*
*/
submitFrom() {
for (const i in this.dataFrom.controls) {
@ -114,18 +118,56 @@ export class OilPriceTaskEditComponent implements OnInit {
return;
}
if (this.dataFrom.value.priceType == 1) {
this.modal.confirm({
nzTitle: '确定将国标价调整为'+this.dataFrom.controls.price.value +'元吗?',
nzOkText: '确定',
nzOnOk: () => this.submitData(),
nzCancelText: '取消',
});
} else if (this.dataFrom.value.priceType == 2) {
this.modal.confirm({
nzTitle: '确定将油站价调整为'+this.dataFrom.controls.price.value +'元吗?',
nzOkText: '确定',
nzOnOk: () => this.submitData(),
nzCancelText: '取消',
});
} else if (this.dataFrom.value.priceType == 3) {
this.modal.confirm({
nzTitle: '确定已选择的加油站,补贴'+this.dataFrom.controls.price.value +'元吗?',
nzOkText: '确定',
nzOnOk: () => this.submitData(),
nzCancelText: '取消',
});
} else if (this.dataFrom.value.priceType == 4) {
this.modal.confirm({
nzTitle: '确定油站价直降'+this.dataFrom.controls.price.value +'元吗?<br>直降后的油站价'+this.dataFrom.controls.gasPrice.value+"元",
nzOkText: '确定',
nzOnOk: () => this.submitData(),
nzCancelText: '取消',
});
}
}
/**
*
*/
submitData() {
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,
});
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({
@ -157,4 +199,42 @@ export class OilPriceTaskEditComponent implements OnInit {
});
}
/**
*
* @param type
*/
selectPriceType(type: number) {
if (type == 4) {
this.priceChange(0);
}
}
/**
*
* @param oilNo
*/
selectOilNo(oilNo: number) {
if (this.secUserObjectType === 3) {
this.oilPriceOfficialService.getOilPriceOfficialDetail(this.localStorageService.get(ADMIN_INFO_OBJECT)['merchantStore']['regionId'], oilNo, data => {
if (data['return_code'] === '000000') {
if (data['return_data'] != null) {
this.dataFrom.patchValue({ priceOfficial: data['return_data']['priceOfficial'],
gasPrice: data['return_data']['priceOfficial']});
this.priceChange(0);
}
}
});
}
}
/**
*
* @param price
*/
priceChange(price: number) {
if (this.dataFrom.value.priceType == 4) {
let price = parseFloat((this.dataFrom.controls.priceOfficial.value - this.dataFrom.controls.price.value).toFixed(2));
this.dataFrom.patchValue({gasPrice: price})
}
}
}

@ -66,10 +66,10 @@ export class OilPriceTaskListComponent implements OnInit {
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
this.priceTypeArray.push({codeValue: 1, codeName: '国标价'});
this.priceTypeArray.push({codeValue: 2, codeName: '油站价'});
this.priceTypeArray.push({codeValue: 3, codeName: '优惠幅度'});
this.priceTypeArray.push({codeValue: 3, codeName: '平台优惠'});
} else {
this.priceTypeArray.push({codeValue: 2, codeName: '油站价'});
this.priceTypeArray.push({codeValue: 3, codeName: '优惠幅度'});
this.priceTypeArray.push({codeValue: 4, codeName: '油站直降'});
}
this.requestData(1);
}

@ -6,12 +6,13 @@
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="isVisible = true">编辑</button>
<button nz-button nzType="primary" class="right-btn" (click)="isVisible = true">添加油号</button>
</div>
<nz-table
class="table"
#ajaxTable
nzBordered
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
@ -24,14 +25,19 @@
(nzPageSizeChange)="getRequest(false , {})">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">油品类型</th>
<th nzWidth="80px">油品</th>
<th nzWidth="80px">国标价</th>
<th nzWidth="100px">油站价</th>
<th nzWidth="100px">优惠价</th>
<th nzWidth="100px">优惠幅度</th>
<th nzWidth="160px" nzRight="0px">操作</th>
<th rowspan="2" nzWidth="80px">编号</th>
<th rowspan="2" nzWidth="110px">油号类型</th>
<th rowspan="2" nzWidth="100px">油号</th>
<th rowspan="2" nzWidth="110px">国标价</th>
<th rowspan="2" nzWidth="110px">油站直降</th>
<th rowspan="2" nzWidth="110px">油站价</th>
<th colspan="2" nzWidth="110px">平台补贴</th>
<th rowspan="2" nzWidth="100px">终端价</th>
<th rowspan="2" nzWidth="150px" nzRight="0px">操作</th>
</tr>
<tr>
<th nzWidth="60px">价格</th>
<th nzWidth="60px">折扣</th>
</tr>
</thead>
<tbody>
@ -39,14 +45,16 @@
<td>{{i + 1}}</td>
<td>{{data.oilTypeName}}</td>
<td>{{data.oilNoName}}</td>
<td>{{data.priceOfficial == null ? '暂无' : '¥' + data.priceOfficial}}</td>
<td>{{data.priceGun == null ? '暂无' : '¥' + data.priceGun}}</td>
<td>{{data.priceVip == null ? '暂无' : '¥' + data.priceVip}}</td>
<td>{{data.preferentialMargin == null ? '暂无' : '¥' + data.preferentialMargin}}</td>
<td>{{data.priceOfficial == null ? '暂无' : '¥ ' + data.priceOfficial}}</td>
<td>{{data.gasStationDrop == null ? '暂无' : '¥ ' + data.gasStationDrop}}</td>
<td>{{data.priceGun == null ? '暂无' : '¥ ' + data.priceGun}}</td>
<td>{{'¥' + data.preferentialMargin}}</td>
<td>{{(data.ext1 == 100?' 无': (data.ext1 + ' 折'))}}</td>
<td>{{data.priceVip == null ? '暂无' : '¥ ' + data.priceVip}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getGunNoListByOilPrice(data.id)">查看油枪</a>
<a (click)="getGunNoListByOilPrice(data.id)">油枪列表</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getGasOilPrice(data.id)">配置油枪</a>
<a (click)="getGasOilPrice(data.id)">添加油枪</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDelete(data.oilNo)">删除</a>
</td>
@ -54,72 +62,37 @@
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="编辑油品" (nzOnCancel)="isVisible = false" (nzOnOk)="editGasOilPrice()"
nzWidth="700px">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">油品</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select [(ngModel)]="oilNo" nzAllowClear (ngModelChange)="getOilPriceDetail($event)"
nzPlaceHolder="请选择油品">
<nz-option *ngFor="let item of gasOilType" [nzValue]="item.codeValue"
nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="添加油号" (nzOnCancel)="isVisible = false" [nzFooter]="null" nzWidth="350px">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>油号</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select [(ngModel)]="oilNo" nzAllowClear (ngModelChange)="getOilPriceDetail($event)" nzPlaceHolder="请选择油号">
<nz-option *ngFor="let item of gasOilType" [nzValue]="item.codeValue" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<div style="width: 100%;text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="editGasOilPrice()">确定</button>
</div>
<form nz-form [formGroup]="validateForm" class="login-form">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">油枪价</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="priceGun" placeholder="请输入油枪价..."/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">优惠幅度</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-input-number
style="width: 300px"
formControlName="preferentialMargin"
[nzMin]="0"
[nzMax]="100"
[nzPrecision]="2"
nzPrecisionMode="cut"
nzPlaceHolder="请输入优惠幅度!"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="oilGunVisible" nzTitle="油枪列表" (nzOnCancel)="oilGunVisible = false" nzWidth="900px" (nzOnOk)="oilGunVisible= false">
<nz-modal [(nzVisible)]="oilGunVisible" nzTitle="油枪列表" (nzOnCancel)="oilGunVisible = false" [nzFooter]="null" nzWidth="500px" (nzOnOk)="oilGunVisible= false">
<nz-table #errorStudentTable [nzData]="oilGunList">
<thead>
<tr>
<th nzWidth="80px">序号</th>
<th nzWidth="150px"></th>
<th nzWidth="150px">油号类型</th>
<th nzWidth="150px">油号</th>
<th nzWidth="60px">序号</th>
<th nzWidth="100px">油号类型</th>
<th nzWidth="80px">油号</th>
<th nzWidth="80px">油枪号</th>
<th nzWidth="80px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{ i + 1}}</td>
<td>{{data.gunNo}}</td>
<td>{{data.oilTypeName}}</td>
<td>{{data.oilNo}}</td>
<td>{{data.oilNo+'#'}}</td>
<td>{{data.gunNo}}</td>
<td>
<a (click)="delGunNo(data.id)">删除</a>
</td>
@ -128,22 +101,21 @@
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="oilVisible" nzTitle="配置油枪" (nzOnCancel)="oilVisible = false" (nzOnOk)="addGasOilPrice()">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">油枪号</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-input-number
style="width: 300px"
[(ngModel)]="gunNo"
[nzMin]="1"
[nzMax]="10000"
nzPlaceHolder="请输入油枪号!"
></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>
<nz-modal [(nzVisible)]="oilVisible" nzTitle="添加油枪" (nzOnCancel)="oilVisible = false" [nzFooter]="null" nzWidth="350px">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>油枪号</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-input-number
style="width: 100%"
[(ngModel)]="gunNo"
[nzMin]="1"
[nzMax]="10000"
nzPlaceHolder="请输入油枪号"
></nz-input-number>
</nz-form-control>
</nz-form-item>
<div style="width: 100%;text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="addGasOilPrice()">确定</button>
</div>
</nz-modal>

@ -114,25 +114,12 @@ export class OliComponent implements OnInit {
this.message.error('请选择油品!');
return;
}
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
if (this.validateForm.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
}
if (this.validateForm.value.preferentialMargin == null) {
this.validateForm.value.preferentialMargin = 0;
}
this.validateForm.value.oilNo = this.oilNo;
this.merchantStore.editGasOilPrice(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.isVisible = false;
this.getRequest(true, {});
this.message.success('编辑成功');
this.message.success('添加成功');
} else {
this.message.warning(data['return_msg']);
}

@ -250,7 +250,7 @@ export class OilStationOrderComponent implements OnInit {
const newstr = '<div id="div_print" style="font-size: 16px;">\n' +
' <div style="float: left;margin-bottom: 50px;">\n' +
' <div style="line-height: 30px; color:#000;">\n' +
' <span style="font-size: 13px;float: left;width: 100%;">' + data['gasName'] + '</span>\n' +
' <span style="font-size: 13px;float: left;width: 100%;text-align: center;">'+data['gasName']+(data['printStatus']?'(补打)':'') + '</span>\n' +
' <span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(收银员存根)</span>\n' +
' </div>\n' +
' <table style="width: 100%;">\n' +
@ -273,10 +273,10 @@ export class OilStationOrderComponent implements OnInit {
' <td style="font-size: xx-small;color: black;">来源:<span>嗨森逛</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: xx-small;color: black;">油枪:<span>' + data['gasGunNo'] + '</span></td>\n' +
' <td style="font-size: xx-small;color: black;">油枪:<span>' + data['gasGunNo'] + '</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: xx-small;color: black;">油品:<span>' + data['gasOilNo'] + '</span></td>\n' +
' <td style="font-size: xx-small;color: black;">油品:<span>' + data['gasOilNo'] + '#</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: xx-small;color: black;">升数:<span>' + data['gasOilLiters'] + '升</span></td>\n' +

@ -12,7 +12,9 @@ export class OilPriceTaskPriceTypePipe implements PipeTransform {
case 2:
return '油站价';
case 3:
return '优惠幅度';
return '平台优惠';
case 4:
return '油站直降';
}
}

Loading…
Cancel
Save