diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html new file mode 100644 index 0000000..1c858b1 --- /dev/null +++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html @@ -0,0 +1,122 @@ + + + + + +
+
+
+
+ + 代理公司 + + + + +
+
+ + 代理商 + + + + +
+
+ + 业务员 + + + + +
+
+ + 订单号 + + + + +
+
+ + 加油站 + + + + +
+
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+
+ + + + + + 代理公司 + 代理商 + 业务员 + 加油站 + 订单号 + 支付类型 + 加油金额 + 优惠金额 + 实付金额 + 油号 + 枪号 + 平台枪价 + 团油枪价 + 创建时间 + 支付时间 + 操作 + + + + + {{data.orgName}} + {{data.agentName}} + {{data.salesmanName}} + {{data.goodsName}} + {{data.orderNo}} + {{data.payType}} + {{data.totalPrice}}元 + {{data.deductionPrice}}元 + {{data.payRealPrice}}元 + {{data.gasOilNo}} + {{data.gasGunNo}}号 + {{data.platformPrice}}元 + {{data.gasPriceGun}}元 + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + 操作列表 + +
    +
  • 暂无操作
  • +
+
+ + + +
+
diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.scss b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.spec.ts b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.spec.ts new file mode 100644 index 0000000..4b7d163 --- /dev/null +++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TyOrderListComponent } from './ty-order-list.component'; + +describe('TyOrderListComponent', () => { + let component: TyOrderListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TyOrderListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TyOrderListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts new file mode 100644 index 0000000..9fe5b42 --- /dev/null +++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts @@ -0,0 +1,75 @@ +import { Component, OnInit } from '@angular/core'; +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 {TyAgentOilStationService} from '../../../../services/ty-agent-oil-station.service'; +import {ADMIN_INFO_OBJECT} from "../../../../services/local-storage.namespace"; +import {LocalStorageService} from "../../../../services/local-storage.service"; + +@Component({ + selector: 'app-ty-order-list', + templateUrl: './ty-order-list.component.html', + styleUrls: ['./ty-order-list.component.scss'] +}) +export class TyOrderListComponent implements OnInit { + roleType; + adminFlag; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private tyAgentOilStationService: TyAgentOilStationService, + 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({ + orderNo: [null], + goodsName: [null], + orgName: [null], + agentName: [null], + salesmanName: [null], + }); + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.tyAgentOilStationService.getOrderList(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(); + } +} diff --git a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.html b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.html index f212319..ccc0bb2 100644 --- a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.html +++ b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.html @@ -27,7 +27,7 @@ 分配代理公司 - + @@ -46,7 +46,7 @@ 分配代理商 - + @@ -65,7 +65,7 @@ 分配业务员 - + @@ -114,8 +114,8 @@ - 地区 加油站ID + 地区 加油站名称 加油站地址 代理公司 @@ -132,8 +132,8 @@ [nzDisabled]="data.disabled" (nzCheckedChange)="checkedChange(data, $event)" > - {{data.regionName}} {{data.storeKey}} + {{data.regionName}} {{data.storeName}} {{data.address}} {{data.organizationName?data.organizationName:'未分配'}} @@ -143,6 +143,8 @@ 操作列表
    +
  • 优惠配置
  • +
  • 暂无操作
@@ -204,4 +206,30 @@ + + +
+
+ {{item.oilNoName}} +
+
+ + +
+
+ (最低折扣价 {{item.lowPrice}} 折) +
+
+
+ +
+
diff --git a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.spec.ts b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.spec.ts index 527d49a..e343a3d 100644 --- a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.spec.ts +++ b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.spec.ts @@ -1,6 +1,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { PetrolStationManageComponent } from './petrol-station-manage.component'; +import { PetrolStationManageComponent } from './petrol-station-manage'; describe('PetrolStationManageComponent', () => { let component: PetrolStationManageComponent; diff --git a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.ts b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts similarity index 89% rename from src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.ts rename to src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts index 1201dca..5c92767 100644 --- a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.ts +++ b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts @@ -6,8 +6,9 @@ import {TyAgentOilStationService} from '../../../services/ty-agent-oil-station.s import {Validators} from '@angular/forms'; import {OrganizationService} from "../../../services/organization.service"; import {LocalStorageService} from "../../../services/local-storage.service"; -import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; import {TySalesmanService} from "../../../services/ty-salesman.service"; +import {TyAgentPriceService} from "../../../services/ty-agent-price.service"; @Component({ selector: 'app-petrol-station-manage', @@ -44,9 +45,16 @@ export class PetrolStationManageComponent implements OnInit { assignSalesmanModal = false; assignSalesmanForm: FormGroup; + discountConfigModal = false; + discountConfigData: PetrolStationManage[] = []; + + formatterPercent = (value: number) => `${value} 折`; + parserPercent = (value: string) => value.replace(' 折', ''); + constructor(private modal: NzModalService, private message: NzMessageService, private tyAgentService: TyAgentService, + private tyAgentPriceService: TyAgentPriceService, private tySalesmanService: TySalesmanService, private organizationService: OrganizationService, private tyAgentOilStationService: TyAgentOilStationService, @@ -539,6 +547,57 @@ export class PetrolStationManageComponent implements OnInit { }); } + /** + * 弹出优惠配置模态框 + */ + showDiscountConfigModal(oilStationId: number) { + this.tyAgentPriceService.getOilStationPrice(oilStationId, data => { + if (data['return_code'] === '000000') { + this.discountConfigData = data['return_data']; + this.discountConfigModal = true; + } else { + this.modal.warning({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + + /** + * 关闭优惠配置模态框 + */ + closeDiscountConfigModal() { + this.discountConfigModal = false; + } + + /** + * 提交分配业务员 + */ + submitDiscountConfig() { + if (this.discountConfigData.length === 0) { + this.modal.warning({ + nzTitle: '提示', + nzContent: '没有配置优惠数据' + }); + } + this.tyAgentPriceService.editPrice(this.discountConfigData, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '保存成功', + }); + this.closeDiscountConfigModal(); + } else { + this.loadingObject.spinning = false; + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + /** * 全选 * @param data @@ -581,3 +640,12 @@ export class PetrolStationManageComponent implements OnInit { } } + +export class PetrolStationManage { + oilStationId: number; + lowPrice: number; + oilNo: string; + oilNoName: string; + priceRate: number; +} + diff --git a/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts b/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts index ee57d83..f7ccb27 100644 --- a/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts +++ b/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts @@ -4,7 +4,8 @@ import {TyAgentListComponent} from './ty-agent/ty-agent-list/ty-agent-list.compo import {TyAgentEditComponent} from './ty-agent/ty-agent-edit/ty-agent-edit.component'; import {TySalesmanListComponent} from './ty-salesman/ty-salesman-list/ty-salesman-list.component'; import {TySalesmanEditComponent} from './ty-salesman/ty-salesman-edit/ty-salesman-edit.component'; -import {PetrolStationManageComponent} from './petrol-station-manage/petrol-station-manage.component'; +import {PetrolStationManageComponent} from './petrol-station-manage/petrol-station-manage'; +import {TyOrderListComponent} from './order/ty-order-list/ty-order-list.component'; const routes: Routes = [ { path: 'agent-edit', component: TyAgentEditComponent }, @@ -12,6 +13,7 @@ const routes: Routes = [ { path: 'salesman-list', component: TySalesmanListComponent }, { path: 'salesman-edit', component: TySalesmanEditComponent }, { path: 'petrol-station', component: PetrolStationManageComponent }, + { path: 'order-list', component: TyOrderListComponent }, ]; @NgModule({ diff --git a/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts b/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts index 8f3394a..cc6de6b 100644 --- a/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts +++ b/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { TuanyouAgentRoutingModule } from './tuanyou-agent-routing.module'; -import { PetrolStationManageComponent } from './petrol-station-manage/petrol-station-manage.component'; +import { PetrolStationManageComponent } from './petrol-station-manage/petrol-station-manage'; import {NgZorroAntdModule} from 'ng-zorro-antd'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; @@ -12,9 +12,10 @@ import {AppCommonModule} from '../../app-common.module'; import { TySalesmanListComponent } from './ty-salesman/ty-salesman-list/ty-salesman-list.component'; import { TySalesmanEditComponent } from './ty-salesman/ty-salesman-edit/ty-salesman-edit.component'; import { OrderStComponent } from './order-st/order-st.component'; +import { TyOrderListComponent } from './order/ty-order-list/ty-order-list.component'; @NgModule({ - declarations: [PetrolStationManageComponent, TyAgentListComponent, TyAgentEditComponent, TySalesmanListComponent, TySalesmanEditComponent, OrderStComponent], + declarations: [PetrolStationManageComponent, TyAgentListComponent, TyAgentEditComponent, TySalesmanListComponent, TySalesmanEditComponent, OrderStComponent, TyOrderListComponent], imports: [ CommonModule, TuanyouAgentRoutingModule, diff --git a/src/app/admin/tuanyou-agent/ty-agent/ty-agent-edit/ty-agent-edit.component.html b/src/app/admin/tuanyou-agent/ty-agent/ty-agent-edit/ty-agent-edit.component.html index a035ae9..afca6ec 100644 --- a/src/app/admin/tuanyou-agent/ty-agent/ty-agent-edit/ty-agent-edit.component.html +++ b/src/app/admin/tuanyou-agent/ty-agent/ty-agent-edit/ty-agent-edit.component.html @@ -34,7 +34,7 @@ 联系电话 - + diff --git a/src/app/admin/tuanyou-agent/ty-salesman/ty-salesman-edit/ty-salesman-edit.component.html b/src/app/admin/tuanyou-agent/ty-salesman/ty-salesman-edit/ty-salesman-edit.component.html index eff8683..366248e 100644 --- a/src/app/admin/tuanyou-agent/ty-salesman/ty-salesman-edit/ty-salesman-edit.component.html +++ b/src/app/admin/tuanyou-agent/ty-salesman/ty-salesman-edit/ty-salesman-edit.component.html @@ -25,7 +25,7 @@ 联系电话 - + diff --git a/src/app/services/ty-agent-oil-station.service.ts b/src/app/services/ty-agent-oil-station.service.ts index 1569123..6ca0e28 100644 --- a/src/app/services/ty-agent-oil-station.service.ts +++ b/src/app/services/ty-agent-oil-station.service.ts @@ -89,4 +89,15 @@ export class TyAgentOilStationService { }); } + /** + * 查询订单列表 + * @param paramObject 参数 + * @param callBack + */ + getOrderList(paramObject: object, callBack) { + this.http.get(environment.baseUrl + 'tyAgentOilStation/getOrderList?' + this.common.getWhereCondition(paramObject)).subscribe(data => { + callBack(data); + }); + } + } diff --git a/src/app/services/ty-agent-price.service.ts b/src/app/services/ty-agent-price.service.ts new file mode 100644 index 0000000..2b10df0 --- /dev/null +++ b/src/app/services/ty-agent-price.service.ts @@ -0,0 +1,37 @@ +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 TyAgentPriceService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 编辑价格 + * @param paramObject 参数 + * @param callBack + */ + editPrice(paramObject: object, callBack) { + this.http.post(environment.baseUrl + 'tyAgentPrice/editPrice', paramObject).subscribe(data => { + callBack(data); + }); + } + + /** + * 油站价格 + * @param paramObject 参数 + * @param callBack + */ + getOilStationPrice(oilStationId: number, callBack) { + this.http.get(environment.baseUrl + 'tyAgentPrice/getOilStationPrice?oilStationId=' + oilStationId).subscribe(data => { + callBack(data); + }); + } +}