diff --git a/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts b/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts index 053c6ab..5e552dd 100644 --- a/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts +++ b/src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts @@ -336,7 +336,7 @@ export class GasClassGroupTaskComponent implements OnInit { let newstr = '
\n' + '
\n' + '
\n' + - ' '+data['classNum']+'班结流水\n' + + ' '+data['classNum']+'班结流水(补打)\n' + '
\n' + ' \n' + ' \n' + diff --git a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html index c00c3a7..c679846 100644 --- a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html +++ b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html @@ -8,10 +8,10 @@
- 油号 + 价格类型 - - + + @@ -19,10 +19,10 @@
- 价格类型 + 油号 - - + + @@ -50,11 +50,31 @@
+
+ + 国标价 + + + + +
+
- 执行价格(¥) + 执行价格 + + + + + + +
+ +
+ + 直降后油站价 - +
diff --git a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts index 10eb277..9befb57 100644 --- a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts +++ b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts @@ -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 +'元吗?
直降后的油站价'+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}) + } + } + } diff --git a/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts index 9f3e895..3734cce 100644 --- a/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts +++ b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts @@ -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); } diff --git a/src/app/admin/merchant-store/oli/oli.component.html b/src/app/admin/merchant-store/oli/oli.component.html index fb3e56c..e8bd3d9 100644 --- a/src/app/admin/merchant-store/oli/oli.component.html +++ b/src/app/admin/merchant-store/oli/oli.component.html @@ -6,12 +6,13 @@
共计 {{total}} 条数据
- +
- - - - - - - - + + + + + + + + + + + + + @@ -39,14 +45,16 @@ - - - - + + + + + + @@ -54,72 +62,37 @@ - -
-
- - 油品 - - - - - - -
+ + + 油号 + + + + + + +
+
- -
-
- - 油枪价 - - - - -
-
- - 优惠幅度 - - - - -
-
- -
- +
- - - - + + + + - - + + @@ -128,22 +101,21 @@ - -
-
- - 油枪号 - - - - -
+ + + 油枪号 + + + + +
+
diff --git a/src/app/admin/merchant-store/oli/oli.component.ts b/src/app/admin/merchant-store/oli/oli.component.ts index 77a83da..060f578 100644 --- a/src/app/admin/merchant-store/oli/oli.component.ts +++ b/src/app/admin/merchant-store/oli/oli.component.ts @@ -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']); } diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts index 158e2ab..ebae251 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.ts +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts @@ -250,7 +250,7 @@ export class OilStationOrderComponent implements OnInit { const newstr = '
\n' + '
\n' + '
\n' + - ' ' + data['gasName'] + '\n' + + ' '+data['gasName']+(data['printStatus']?'(补打)':'') + '\n' + ' (收银员存根)\n' + '
\n' + '
编号油品类型油品国标价油站价优惠价优惠幅度操作编号油号类型油号国标价油站直降油站价平台补贴终端价操作
价格折扣
{{i + 1}} {{data.oilTypeName}} {{data.oilNoName}}{{data.priceOfficial == null ? '暂无' : '¥' + data.priceOfficial}}{{data.priceGun == null ? '暂无' : '¥' + data.priceGun}}{{data.priceVip == null ? '暂无' : '¥' + data.priceVip}}{{data.preferentialMargin == null ? '暂无' : '¥' + data.preferentialMargin}}{{data.priceOfficial == null ? '暂无' : '¥ ' + data.priceOfficial}}{{data.gasStationDrop == null ? '暂无' : '¥ ' + data.gasStationDrop}}{{data.priceGun == null ? '暂无' : '¥ ' + data.priceGun}}{{'¥' + data.preferentialMargin}}{{(data.ext1 == 100?' 无': (data.ext1 + ' 折'))}}{{data.priceVip == null ? '暂无' : '¥ ' + data.priceVip}} - 查看油枪 + 油枪列表 - 配置油枪 + 添加油枪 删除
序号油枪号油号类型油号序号油号类型油号油枪号 操作
{{ i + 1}}{{data.gunNo}} {{data.oilTypeName}}{{data.oilNo}}{{data.oilNo+'#'}}{{data.gunNo}} 删除
\n' + @@ -273,10 +273,10 @@ export class OilStationOrderComponent implements OnInit { ' \n' + ' \n' + ' \n' + - ' \n' + + ' \n' + ' \n' + ' \n' + - ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + diff --git a/src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts b/src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts index 2d988f3..562c38d 100644 --- a/src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts +++ b/src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts @@ -12,7 +12,9 @@ export class OilPriceTaskPriceTypePipe implements PipeTransform { case 2: return '油站价'; case 3: - return '优惠幅度'; + return '平台优惠'; + case 4: + return '油站直降'; } }
来源:嗨森逛
油枪:' + data['gasGunNo'] + '油枪:' + data['gasGunNo'] + '号
油品:' + data['gasOilNo'] + '油品:' + data['gasOilNo'] + '#
升数:' + data['gasOilLiters'] + '升