fix bug
This commit is contained in:
@ -1,38 +1,30 @@
|
||||
<!--
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-03-28 14:53:52
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-28 17:03:21
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add-partnerlist\\add-partnerlist.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
<nz-card>
|
||||
<div nz-row nzGutter="8">
|
||||
<!-- 查询字段小于或等于3个时,不显示伸缩按钮 -->
|
||||
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
|
||||
<div nz-col nzSpan="24" >
|
||||
<sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="false"
|
||||
(formSubmit)="search()" (formReset)="resetSF()"></sf>
|
||||
</div>
|
||||
|
||||
<!-- 查询字段大于3个时,根据展开状态调整布局 -->
|
||||
<ng-container *ngIf="queryFieldCount > 4">
|
||||
<div nz-col [nzSpan]="_$expand ? 24 : 18">
|
||||
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
|
||||
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="false" (click)="search()" acl
|
||||
[acl-ability]="['AbnormalAppear-serach']">查询</button>
|
||||
<button nz-button (click)="resetSF()" acl [acl-ability]="['AbnormalAppear-reset']">重置</button>
|
||||
<button nz-button nzType="link" (click)="expandToggle()">
|
||||
{{ !_$expand ? '展开' : '收起' }}
|
||||
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
|
||||
</button>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
<nz-card class="content-box">
|
||||
<st #st [data]="service.$api_get_rebateConfig" [columns]="columns"
|
||||
<st #st [data]="service.$api_get_partner_page " [columns]="columns"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
|
||||
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="false"
|
||||
[scroll]="{ x: '2000px' }">
|
||||
[scroll]="{ x: '1000' }">
|
||||
</st>
|
||||
<ng-template #extraTemplate>
|
||||
<button *ngIf="selectedIndex===0" (click)="batchReply()" nz-button nzType="primary" acl
|
||||
[acl-ability]="['AbnormalAppear-batchReply']">批量回复</button>
|
||||
</ng-template>
|
||||
</nz-card>
|
||||
|
||||
@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild, Type } from '@angular/core';
|
||||
import { STComponent, STColumn, STChange } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { RebateManagementService } from '../../../services/rebate-management.service';
|
||||
@ -32,45 +32,30 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
|
||||
|
||||
columns: STColumn[] = [
|
||||
{ title: '', type: 'checkbox', width: '50px', className: 'text-center' },
|
||||
{ title: '异常编号', index: 'exceptionCode', width: '140px', className: 'text-left', },
|
||||
{ title: '订单号', index: 'billCode', width: '160px', className: 'text-left', },
|
||||
{ title: '装货地', index: 'loadingAddressArr', width: '220px', className: 'text-left', },
|
||||
{ title: '卸货地', index: 'unloadingAddressArr', width: '220px', className: 'text-left', },
|
||||
{ title: '承运司机', index: 'driver', width: '180px', className: 'text-left', },
|
||||
{ title: '异常信息', index: 'exceptionContent', width: '100px', className: 'text-left', },
|
||||
{ title: '异常图片', render: 'exceptionCertificateFirstFilePath', width: '150px', className: 'text-left', },
|
||||
{ title: '上报时间', index: 'createTime', width: '140px', className: 'text-left', },
|
||||
{
|
||||
title: '操作', index: 'createTime', width: '90px', className: 'text-left',
|
||||
title: '合伙人名称',
|
||||
index: 'enterpriseName',
|
||||
width: 180,
|
||||
format: item => (item.partnerType ? `${item.enterpriseName || item.contactName}` : '')
|
||||
},
|
||||
{ title: '联系人', index: 'contactName', width: 150, format: item => (item.partnerType ? `${item.contactName}` : '') },
|
||||
{ title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 },
|
||||
{ title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } },
|
||||
{
|
||||
title: '操作', width: '90px', fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
text: '回复',
|
||||
click: _record => this.reply(_record),
|
||||
text: '添加',
|
||||
click: _record => this.add(_record),
|
||||
acl: { ability: ['AbnormalAppear-reply'] }
|
||||
},
|
||||
]
|
||||
},
|
||||
];
|
||||
columns2: STColumn[] = [
|
||||
{ title: '异常编号', index: 'exceptionCode', width: '140px', className: 'text-left' },
|
||||
{ title: '订单号', index: 'billCode', width: '160px', className: 'text-left' },
|
||||
{ title: '装货地', index: 'loadingAddressArr', width: '220px', className: 'text-left' },
|
||||
{ title: '卸货地', index: 'unloadingAddressArr', width: '220px', className: 'text-left' },
|
||||
{ title: '承运司机', index: 'driver', width: '180px', className: 'text-left' },
|
||||
{ title: '异常信息', index: 'exceptionContent', width: '100px', className: 'text-left' },
|
||||
{ title: '异常图片', render: 'exceptionCertificateFirstFilePath', width: '150px', className: 'text-left' },
|
||||
{ title: '上报时间', index: 'createTime', width: '140px', className: 'text-left' },
|
||||
{ title: '回复内容', index: 'replyContent', width: '150px', className: 'text-left' },
|
||||
{ title: '回复人', index: 'replyAppUserName', width: '90px', className: 'text-left' },
|
||||
{ title: '回复时间', index: 'replyTime', width: '140px', className: 'text-left' },
|
||||
];
|
||||
|
||||
get reqParams() {
|
||||
let params: any = { ...this.sf?.value };
|
||||
if (params.reportingTime) {
|
||||
const reportingTime = { start: this.sf?.value?.reportingTime?.[0], end: this.sf?.value?.reportingTime?.[1] }
|
||||
params.reportingTime = reportingTime;
|
||||
}
|
||||
// signStatus固定传20 代表签约完成
|
||||
let params: any = { ...this.sf?.value,signStatus: 20 };
|
||||
return params;
|
||||
}
|
||||
|
||||
@ -80,93 +65,46 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
public service: RebateManagementService,
|
||||
private nzModalService: NzModalService,
|
||||
public shipperSrv: ShipperBaseService,
|
||||
private modal: NzModalService,
|
||||
private modals: NzModalRef,
|
||||
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF()
|
||||
}
|
||||
|
||||
/**
|
||||
* 伸缩查询条件
|
||||
*/
|
||||
expandToggle(): void {
|
||||
this._$expand = !this._$expand;
|
||||
this.sf?.setValue('/_$expand', this._$expand);
|
||||
}
|
||||
/**
|
||||
* 查询字段个数
|
||||
*/
|
||||
get queryFieldCount(): number {
|
||||
return Object.keys(this.schema?.properties || {}).length;
|
||||
}
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
_$expand: { type: 'boolean', ui: { hidden: true } },
|
||||
exceptionCode: {
|
||||
enterpriseName: {
|
||||
type: 'string',
|
||||
title: '异常编号',
|
||||
ui: { placeholder: '请输入' }
|
||||
title: '合伙人名称'
|
||||
},
|
||||
billCode: {
|
||||
type: 'string',
|
||||
title: '订单号',
|
||||
ui: {
|
||||
placeholder: '最多100个订单,空号隔开',
|
||||
}
|
||||
},
|
||||
exceptionType: {
|
||||
title: '异常类型',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
containsAllLabel: true,
|
||||
params: { dictKey: 'exception:report:type' },
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
driverName: {
|
||||
title: '承运司机',
|
||||
partnerType: {
|
||||
type: 'string',
|
||||
title: '类型',
|
||||
enum: [
|
||||
{ value: '', label: '全部' },
|
||||
{ value: 1, label: '企业' },
|
||||
{ value: 2, label: '个人' }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
}
|
||||
},
|
||||
default: ''
|
||||
},
|
||||
carNo: {
|
||||
title: '车牌号',
|
||||
type: 'string',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
}
|
||||
}
|
||||
},
|
||||
reportingTime: {
|
||||
title: '上报时间',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'date',
|
||||
mode: 'range',
|
||||
format: 'yyyy-MM-dd',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
}
|
||||
} as SFDateWidgetSchema
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
|
||||
}
|
||||
|
||||
search() {
|
||||
if (this.selectedIndex === 0) {
|
||||
this.st?.load(1)
|
||||
}
|
||||
}
|
||||
|
||||
selectedIndexChange(event: any) {
|
||||
@ -181,22 +119,10 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
|
||||
this.sf.reset();
|
||||
}
|
||||
// 回复操作
|
||||
reply(item: any) {
|
||||
// const modalRef = this.modal.create({
|
||||
// nzTitle: '回复',
|
||||
// nzWidth: 700,
|
||||
// nzContent: AbnormalReplyComponent,
|
||||
// nzComponentParams: {
|
||||
// i: item
|
||||
// },
|
||||
// nzFooter: null
|
||||
// });
|
||||
// modalRef.afterClose.subscribe((res) => {
|
||||
// if (res) {
|
||||
// this.resetSF;
|
||||
// this.st.load();
|
||||
// }
|
||||
// });
|
||||
add(item: any) {
|
||||
console.log(item);
|
||||
this.modals.destroy(item)
|
||||
|
||||
}
|
||||
// 批量回复操作
|
||||
batchReply() {
|
||||
@ -204,17 +130,6 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
|
||||
// this.service.msgSrv.warning('请勾选数据!')
|
||||
// return;
|
||||
// }
|
||||
// const modalRef = this.modal.create({
|
||||
// nzTitle: '批量回复',
|
||||
// nzContent: AbnormalreplyBatchComponent,
|
||||
// nzComponentParams: {
|
||||
// selectedRows: this.selectedRows
|
||||
// },
|
||||
// nzFooter: null
|
||||
// });
|
||||
// modalRef.afterClose.subscribe(() => {
|
||||
// this.resetSF;
|
||||
// this.st.load();
|
||||
// });
|
||||
this.modals.destroy(this.selectedRows)
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-02-24 20:09:49
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-28 15:39:27
|
||||
* @LastEditTime : 2022-03-28 19:46:23
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
@ -14,26 +14,34 @@
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<sv-container col="1">
|
||||
<sv label="配置名称"> <input style="max-width: 400px;" nz-input placeholder="请输入" [(ngModel)]="setValue" /></sv>
|
||||
<sv label="配置名称"> <input style="max-width: 400px;" nz-input placeholder="请输入" [(ngModel)]="configName" /></sv>
|
||||
<sv-title>固定结算费率配置</sv-title>
|
||||
<sv label="固定结算费率"> <nz-input-number [(ngModel)]="toFixedValue" [nzPrecision]="precision" nzPlaceHolder="请输入"></nz-input-number> %</sv>
|
||||
<sv label="固定结算费率"> <nz-input-number [(ngModel)]="accountingRate" [nzPrecision]="precision" nzPlaceHolder="请输入"></nz-input-number> %</sv>
|
||||
<sv-title>业务量和管理费比例配置</sv-title>
|
||||
<sv label="选择配置类型">
|
||||
<nz-radio-group [(ngModel)]="radioValue">
|
||||
<label nz-radio nzValue="A">按全部等级配置</label>
|
||||
<label nz-radio nzValue="B">按不同等级配置</label>
|
||||
<nz-radio-group [(ngModel)]="configType">
|
||||
<label nz-radio nzValue="1">按全部等级配置</label>
|
||||
<label nz-radio nzValue="2">按不同等级配置</label>
|
||||
</nz-radio-group>
|
||||
</sv>
|
||||
<sv col="1">
|
||||
<app-rebate-table></app-rebate-table>
|
||||
|
||||
<app-rebate-table ></app-rebate-table>
|
||||
</sv>
|
||||
<sv-title>关联合伙人配置</sv-title>
|
||||
<sv label="合伙人选择">
|
||||
<nz-select ngModel="lucy" style="max-width: 400px; min-width: 200px;">
|
||||
<!-- <nz-select ngModel="lucy" style="max-width: 400px; min-width: 200px;">
|
||||
<nz-option nzValue="jack" nzLabel="Jack"></nz-option>
|
||||
<nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
|
||||
</nz-select>
|
||||
<span (click)="add()">添加</span>
|
||||
</nz-select> -->
|
||||
<input *ngIf="peopleStatus" nz-input disabled style=" max-width: 200px;" placeholder="请添加" [(ngModel)]="partnerPeople" />
|
||||
<span style="color: #0000FF;" (click)="add()">添加</span>
|
||||
<st *ngIf="!peopleStatus" #st [data]="partnerPeopleList" [columns]="columns"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' } }"
|
||||
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100] }" [loading]="false"
|
||||
[scroll]="{ x: '1000' }">
|
||||
</st>
|
||||
</sv>
|
||||
<sv label="优先级" col="1">
|
||||
<nz-select ngModel="lucy" style="max-width: 400px; min-width: 200px;">
|
||||
@ -49,17 +57,11 @@
|
||||
<textarea style="max-width: 400px; min-width: 200px;" rows="4" nz-input [(ngModel)]="inputValue"></textarea>
|
||||
</sv>
|
||||
</sv-container>
|
||||
<div>
|
||||
<button>返回</button>
|
||||
<button>提交</button>
|
||||
</div>
|
||||
<div class="align-center" style="margin-top: 15px;">
|
||||
<button nz-button nzType="primary" (click)="goBack()">取消</button>
|
||||
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submit()"
|
||||
acl [acl-ability]="['SUPPLY-VEHICLE-AMEND-submitChange']">提交</button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<div class="align-center">
|
||||
<button nz-button nzType="primary" (click)="goBack()">取消</button>
|
||||
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submit()"
|
||||
acl [acl-ability]="['SUPPLY-VEHICLE-AMEND-submitChange']">提交</button
|
||||
>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
@ -7,4 +7,10 @@
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
.align-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-03-21 09:26:45
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-28 14:45:41
|
||||
* @LastEditTime : 2022-03-28 19:47:56
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -17,17 +17,23 @@ import { processSingleSort, ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { RebateManagementService } from '../../../services/rebate-management.service';
|
||||
import { ParterRebateManageMentAddPartnerListComponent } from '../add-partnerlist/add-partnerlist.component';
|
||||
import { inRange } from '@delon/util';
|
||||
@Component({
|
||||
selector: 'app-parter-channel-rebate-management-add',
|
||||
styleUrls: ['./add.component.less'],
|
||||
templateUrl: './add.component.html'
|
||||
})
|
||||
export class ParterRebateManageMentAddComponent implements OnInit {
|
||||
setValue: string = '';
|
||||
toFixedValue: Number = 2;
|
||||
radioValue = 'A';
|
||||
configName: string = '';
|
||||
accountingRate: Number = 2;
|
||||
partnerPeople: any;
|
||||
partnerPeopleList: any;
|
||||
peopleStatus: boolean = true;
|
||||
configType = '1';
|
||||
precision = 2;
|
||||
inputValue = '';
|
||||
@ViewChild('st', { static: true })
|
||||
st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
schema1!: SFSchema;
|
||||
constructor(
|
||||
@ -37,6 +43,27 @@ export class ParterRebateManageMentAddComponent implements OnInit {
|
||||
private modal: NzModalService,
|
||||
public shipperservice: ShipperBaseService
|
||||
) {}
|
||||
columns: STColumn[] = [
|
||||
{
|
||||
title: '合伙人名称',
|
||||
index: 'enterpriseName',
|
||||
width: 180,
|
||||
format: item => (item.partnerType ? `${item.enterpriseName || item.contactName}` : '')
|
||||
},
|
||||
{ title: '联系人', index: 'contactName', width: 150, format: item => (item.partnerType ? `${item.contactName}` : '') },
|
||||
{ title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 },
|
||||
{ title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } },
|
||||
{
|
||||
title: '操作', width: '90px', fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
text: '移除',
|
||||
click: _record => this.delete(_record),
|
||||
acl: { ability: ['AbnormalAppear-reply'] }
|
||||
},
|
||||
]
|
||||
},
|
||||
];
|
||||
initSF(data?: any) {
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
@ -63,21 +90,46 @@ export class ParterRebateManageMentAddComponent implements OnInit {
|
||||
window.history.go(-1);
|
||||
}
|
||||
/**
|
||||
*申请退款
|
||||
*合伙人选择
|
||||
*/
|
||||
add(item?: any) {
|
||||
const modalRef = this.modal.create({
|
||||
nzTitle: '申请退款',
|
||||
nzTitle: '合伙人选择',
|
||||
nzWidth: 1000,
|
||||
nzContent: ParterRebateManageMentAddPartnerListComponent,
|
||||
nzComponentParams: {
|
||||
i: item,
|
||||
},
|
||||
nzFooter: null
|
||||
});
|
||||
modalRef.afterClose.subscribe((res: boolean) => {
|
||||
modalRef.afterClose.subscribe((res: any) => {
|
||||
if (res) {
|
||||
|
||||
console.log(Array.isArray(res));
|
||||
console.log(res);
|
||||
if(Array.isArray(res)) {
|
||||
this.partnerPeopleList = res;
|
||||
this.peopleStatus = false
|
||||
} else {
|
||||
this.partnerPeople = res?.enterpriseName;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
delete(item: any) {
|
||||
console.log(item);
|
||||
}
|
||||
save () {
|
||||
const params = {
|
||||
accountingRate: this.accountingRate,
|
||||
configName: this.configName,
|
||||
configType: this.configType,
|
||||
rebateConfigLineDTO: {}
|
||||
}
|
||||
this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => {
|
||||
if(res) {
|
||||
console.log(res);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
configAction() {
|
||||
this.router.navigate(['/partner/rebate/setting/add', ''])
|
||||
this.router.navigate(['/partner/rebate/setting/add/', 1])
|
||||
}
|
||||
/**
|
||||
* 重置表单
|
||||
|
||||
@ -19,6 +19,10 @@ export class RebateManagementService extends BaseService {
|
||||
public $api_get_listCompliancePage = '/api/sdc/billRiskOperate/listRiskPage';
|
||||
// 查询返佣配置表
|
||||
public $api_get_rebateConfig = '/api/mdc/rebateConfig/list/page';
|
||||
// 保存返佣配置表
|
||||
public $api_save_rebateConfig = '/api/mdc/rebateConfig/save';
|
||||
// 查询合伙人信息-分页
|
||||
public $api_get_partner_page = '/api/mdc/partner/list/page';
|
||||
constructor(public injector: Injector) {
|
||||
super(injector);
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-01-25 20:18:52
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-21 14:14:06
|
||||
* @LastEditTime : 2022-03-28 20:26:30
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\rebate-table\\rebate-table.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
@ -37,7 +37,7 @@
|
||||
</td>
|
||||
<td nzWidth="220px" nzAlign="center" >
|
||||
<div >
|
||||
<nz-select ngModel="lucy">
|
||||
<nz-select ngModel="gradeConfigId">
|
||||
<nz-option nzValue="jack" nzLabel="Jack154654564654"></nz-option>
|
||||
<nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
|
||||
</nz-select>
|
||||
@ -46,7 +46,7 @@
|
||||
<td nzWidth="220px" nzAlign="center" >
|
||||
<div style=" margin-left: 26%">
|
||||
<nz-input-group nzPrefix="=">
|
||||
<nz-input-number [(ngModel)]="item.baserebateRate" [nzMin]="0" nzSize="small"
|
||||
<nz-input-number [(ngModel)]="item.startAmount" [nzMin]="0" nzSize="small" (ngModelChange)="changeendAmount($event,i)"
|
||||
>
|
||||
</nz-input-number>
|
||||
</nz-input-group>
|
||||
@ -56,7 +56,7 @@
|
||||
<td nzWidth="220px" nzAlign="center" >
|
||||
<div style=" margin-left: 26%">
|
||||
<nz-input-group nzPrefix="<">
|
||||
<nz-input-number [(ngModel)]="item.blanketrebateRate" [nzMin]="0" nzSize="small" >
|
||||
<nz-input-number [(ngModel)]="item.endAmount" [nzMin]="0" nzSize="small" >
|
||||
</nz-input-number>
|
||||
</nz-input-group>
|
||||
</div>
|
||||
@ -64,7 +64,7 @@
|
||||
<td nzWidth="220px" nzAlign="center" >
|
||||
<div style=" margin-left: 26%">
|
||||
<nz-input-group [nzAddOnAfter]="addOnAfterTemplate2">
|
||||
<nz-input-number [(ngModel)]="item.baserebateRate" [nzMin]="0" nzSize="small"
|
||||
<nz-input-number [(ngModel)]="item.managementFeeRatio" [nzMin]="0" nzSize="small"
|
||||
>
|
||||
</nz-input-number>
|
||||
</nz-input-group>
|
||||
|
||||
@ -10,7 +10,14 @@ import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
styleUrls: ['./rebate-table.component.less']
|
||||
})
|
||||
export class RebateTableComponent implements OnInit {
|
||||
data: any[] = [];
|
||||
data: any[] = [
|
||||
{
|
||||
gradeConfigId: '',
|
||||
startAmount: 0,
|
||||
endAmount: 0,
|
||||
managementFeeRatio: 0,
|
||||
}
|
||||
];
|
||||
headers: any[] = [];
|
||||
formatterDollar = (value: number): string => `${value}`;
|
||||
changeSub = new Subject<string>();
|
||||
@ -18,70 +25,57 @@ export class RebateTableComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadData();
|
||||
this.changeEndKmAction();
|
||||
this.changeendAmountAction();
|
||||
}
|
||||
|
||||
loadData() {
|
||||
this.service.request('/api/mdc/cuc/insuranceConfig/list').subscribe(res => {
|
||||
if (res) {
|
||||
console.log(res);
|
||||
this.data = res;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
});
|
||||
this.service.request('/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys', [
|
||||
"rebate.config.minrebatePrice"
|
||||
]).subscribe(res => {
|
||||
if (res) {
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
// this.service.request('/api/mdc/cuc/insuranceConfig/list').subscribe(res => {
|
||||
// if (res) {
|
||||
// console.log(res);
|
||||
// this.data = res;
|
||||
// this.cdr.detectChanges();
|
||||
// }
|
||||
// });
|
||||
// this.service.request('/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys', [
|
||||
// "rebate.config.minrebatePrice"
|
||||
// ]).subscribe(res => {
|
||||
// if (res) {
|
||||
// console.log(res);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改结束车长
|
||||
* @param event 车长
|
||||
* @param i 下标
|
||||
*/
|
||||
changeEndLength(event: any, i: number) {
|
||||
if (event <= this.headers[i].startLength) {
|
||||
this.headers[i].endLength = this.headers[i].startLength + 1;
|
||||
this.changeNextStartLength(event, i + 1);
|
||||
return;
|
||||
}
|
||||
this.headers[i].endLength = event;
|
||||
this.changeNextStartLength(event, i + 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改结束公里数
|
||||
* @param event 车长
|
||||
* @param i 下标
|
||||
*/
|
||||
changeEndKm(event: any, i: number) {
|
||||
changeendAmount(event: any, i: number) {
|
||||
if (event) {
|
||||
console.log(event);
|
||||
|
||||
this.changeSub.next(`${event},${i}`);
|
||||
}
|
||||
}
|
||||
changeEndKmAction() {
|
||||
changeendAmountAction() {
|
||||
this.changeSub.pipe(debounceTime(500)).subscribe((res: string) => {
|
||||
if (res) {
|
||||
const paras = res.split(',');
|
||||
const num = Number(paras[0]);
|
||||
const i = Number(paras[1]);
|
||||
|
||||
if (num <= this.data[i].startKm) {
|
||||
this.data[i].endKm = null;
|
||||
if (num <= this.data[i].startAmount) {
|
||||
this.data[i].endAmount = null;
|
||||
setTimeout(() => {
|
||||
this.data[i].endKm = this.data[i].startKm + 1 ;
|
||||
this.data[i].endAmount = this.data[i].startAmount + 1 ;
|
||||
}, 0);
|
||||
this.changeNextStartKm(this.data[i].startKm + 1, i + 1);
|
||||
this.changeNextstartAmount(this.data[i].startAmount + 1, i + 1);
|
||||
return;
|
||||
}
|
||||
this.data[i].endKm = num;
|
||||
this.changeNextStartKm(num, i + 1);
|
||||
this.data[i].endAmount = num;
|
||||
this.changeNextstartAmount(num, i + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -90,14 +84,14 @@ export class RebateTableComponent implements OnInit {
|
||||
console.log(this.data);
|
||||
|
||||
const tem = this.data[this.data?.length - 1];
|
||||
if (tem && tem.endKm) {
|
||||
if (tem) {
|
||||
this.data.push({
|
||||
endKm: '',
|
||||
startKm: tem.endKm
|
||||
gradeConfigId: '',
|
||||
startAmount: 0,
|
||||
endAmount: 0,
|
||||
managementFeeRatio: 0,
|
||||
});
|
||||
this.data = [...this.data];
|
||||
} else {
|
||||
this.service.msgSrv.warning('请填写完整公里数');
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,32 +119,18 @@ export class RebateTableComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 遍历同步后置位车长
|
||||
* @param event 车长
|
||||
* @param i 下标
|
||||
*/
|
||||
private changeNextStartLength(event: number, i: number) {
|
||||
if (this.headers[i]) {
|
||||
this.headers[i].startLength = event;
|
||||
if (this.headers[i].endLength <= event) {
|
||||
this.headers[i].endLength = this.headers[i].startLength + 0.5;
|
||||
this.changeNextStartLength(event + 0.5, i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 遍历同步后置位公里数
|
||||
* @param event 车长
|
||||
* @param i 下标
|
||||
*/
|
||||
private changeNextStartKm(event: number, i: number) {
|
||||
private changeNextstartAmount(event: number, i: number) {
|
||||
if (this.data[i]) {
|
||||
this.data[i].startKm = event;
|
||||
if (this.data[i].endKm <= event) {
|
||||
this.data[i].endKm = this.data[i].startKm + 1;
|
||||
this.changeNextStartKm(event + 1, i + 1);
|
||||
this.data[i].startAmount = event;
|
||||
if (this.data[i].endAmount <= event) {
|
||||
this.data[i].endAmount = this.data[i].startAmount + 1;
|
||||
this.changeNextstartAmount(event + 1, i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user