提交代码

pull/1/head
胡锐 3 years ago
parent 33b64fdeec
commit d5369747d6
  1. 122
      src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html
  2. 0
      src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.scss
  3. 25
      src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.spec.ts
  4. 75
      src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts
  5. 38
      src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.html
  6. 2
      src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.spec.ts
  7. 70
      src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts
  8. 4
      src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts
  9. 5
      src/app/admin/tuanyou-agent/tuanyou-agent.module.ts
  10. 2
      src/app/admin/tuanyou-agent/ty-agent/ty-agent-edit/ty-agent-edit.component.html
  11. 2
      src/app/admin/tuanyou-agent/ty-salesman/ty-salesman-edit/ty-salesman-edit.component.html
  12. 11
      src/app/services/ty-agent-oil-station.service.ts
  13. 37
      src/app/services/ty-agent-price.service.ts

@ -0,0 +1,122 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8" *ngIf="adminFlag == 1 && roleType == 5">
<nz-form-item>
<nz-form-label [nzSpan]="8">代理公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="orgName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 5">
<nz-form-item>
<nz-form-label [nzSpan]="8">代理商</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="agentName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 8 || roleType == 5">
<nz-form-item>
<nz-form-label [nzSpan]="8">业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="salesmanName" />
</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="orderNo" />
</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="goodsName" />
</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">
</div>
<!--数组表格 -->
<nz-table #basicTable
[nzData]="dataObject.list"
[nzTotal]="dataObject.total"
[nzFrontPagination]="false"
[nzLoading]="tableLoading"
[nzPageIndex]="whereObject.pageNum"
(nzPageIndexChange)="requestData($event)"
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
<th nzWidth="100px" *ngIf="adminFlag == 1 && roleType == 5">代理公司</th>
<th nzWidth="100px" *ngIf="roleType == 5">代理商</th>
<th nzWidth="100px" *ngIf="roleType == 8 || roleType == 5">业务员</th>
<th nzWidth="200px">加油站</th>
<th nzWidth="200px">订单号</th>
<th nzWidth="100px">支付类型</th>
<th nzWidth="100px">加油金额</th>
<th nzWidth="100px">优惠金额</th>
<th nzWidth="100px">实付金额</th>
<th nzWidth="80px">油号</th>
<th nzWidth="80px">枪号</th>
<th nzWidth="100px">平台枪价</th>
<th nzWidth="100px">团油枪价</th>
<th nzWidth="170px">创建时间</th>
<th nzWidth="170px">支付时间</th>
<th nzWidth="110px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td *ngIf="adminFlag == 1 && roleType == 5">{{data.orgName}}</td>
<td *ngIf="roleType == 5">{{data.agentName}}</td>
<td *ngIf="roleType == 8 || roleType == 5">{{data.salesmanName}}</td>
<td>{{data.goodsName}}</td>
<td>{{data.orderNo}}</td>
<td>{{data.payType}}</td>
<td>{{data.totalPrice}}元</td>
<td>{{data.deductionPrice}}元</td>
<td>{{data.payRealPrice}}元</td>
<td>{{data.gasOilNo}}</td>
<td>{{data.gasGunNo}}号</td>
<td>{{data.platformPrice}}元</td>
<td>{{data.gasPriceGun}}元</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.payTime | 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 nzDisabled>暂无操作</li>
</ul>
</nz-dropdown-menu>
</td>
</tr>
</tbody>
</nz-table>
</div>

@ -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<TyOrderListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TyOrderListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TyOrderListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -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();
}
}

@ -27,7 +27,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="8">分配代理公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select ngModel="lucy" nzAllowClear formControlName="isAssignOrgId">
<nz-select nzAllowClear formControlName="isAssignOrgId">
<nz-option nzValue="true" nzLabel="是"></nz-option>
<nz-option nzValue="false" nzLabel="否"></nz-option>
</nz-select>
@ -46,7 +46,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="8">分配代理商</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select ngModel="lucy" nzAllowClear formControlName="isAssignTyAgent">
<nz-select nzAllowClear formControlName="isAssignTyAgent">
<nz-option nzValue="true" nzLabel="是"></nz-option>
<nz-option nzValue="false" nzLabel="否"></nz-option>
</nz-select>
@ -65,7 +65,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="8">分配业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select ngModel="lucy" nzAllowClear formControlName="isAssignTySalesman">
<nz-select nzAllowClear formControlName="isAssignTySalesman">
<nz-option nzValue="true" nzLabel="是"></nz-option>
<nz-option nzValue="false" nzLabel="否"></nz-option>
</nz-select>
@ -114,8 +114,8 @@
<thead>
<tr>
<th nzWidth="50px" [(nzChecked)]="allChecked" [nzShowCheckbox]="true" (nzCheckedChange)="onAllChecked($event)"></th>
<th nzWidth="70px">地区</th>
<th nzWidth="90px">加油站ID</th>
<th nzWidth="70px">地区</th>
<th nzWidth="130px">加油站名称</th>
<th nzWidth="130px">加油站地址</th>
<th nzWidth="100px">代理公司</th>
@ -132,8 +132,8 @@
[nzDisabled]="data.disabled"
(nzCheckedChange)="checkedChange(data, $event)"
></td>
<td>{{data.regionName}}</td>
<td>{{data.storeKey}}</td>
<td>{{data.regionName}}</td>
<td>{{data.storeName}}</td>
<td>{{data.address}}</td>
<td>{{data.organizationName?data.organizationName:'未分配'}}</td>
@ -143,6 +143,8 @@
<a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li *ngIf="roleType == 8 || roleType == 9" nz-menu-item (click)="showDiscountConfigModal(data.storeId)">优惠配置</li>
<li *ngIf="roleType == 5" nz-menu-item nzDisabled>暂无操作</li>
</ul>
</nz-dropdown-menu>
</td>
@ -204,4 +206,30 @@
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="discountConfigModal" nzTitle="优惠配置" (nzOnCancel)="closeDiscountConfigModal()" nzWidth="350px" [nzBodyStyle]="{ padding: '10px 24px 24px 24px' }" [nzFooter]="null">
<div nz-row *ngFor="let item of discountConfigData" style="margin-top: 10px;">
<div nz-col [nzSpan]="3" style="margin-top: 5px;">
{{item.oilNoName}}
</div>
<div nz-col [nzSpan]="10">
<nz-input-number
[(ngModel)]="item.priceRate"
[nzMin]="item.lowPrice"
[nzMax]="100"
[nzStep]="1"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
[nzPrecision]="2"
style="width: 100%;" >
</nz-input-number>
</div>
<div nz-col [nzSpan]="11" style="margin-top: 5px;">
<span nz-typography nzType="warning">(最低折扣价 {{item.lowPrice}} 折)</span>
</div>
</div>
<div style="text-align: center;">
<button nz-button nzType="primary" style="margin-top: 15px;width: 150px;" (click)="submitDiscountConfig()">保存</button>
</div>
</nz-modal>
</nz-spin>

@ -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;

@ -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;
}

@ -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({

@ -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,

@ -34,7 +34,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>联系电话</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input type="text" formControlName="agentPhone" placeholder="请输入联系电话" />
<input nz-input type="text" formControlName="agentPhone" [maxLength]="11" placeholder="请输入联系电话" />
</nz-form-control>
</nz-form-item>
</div>

@ -25,7 +25,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>联系电话</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input type="text" formControlName="salesmanPhone" placeholder="请输入联系电话" />
<input nz-input type="text" formControlName="salesmanPhone" [maxLength]="11" placeholder="请输入联系电话" />
</nz-form-control>
</nz-form-item>
</div>

@ -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);
});
}
}

@ -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);
});
}
}
Loading…
Cancel
Save