解决冲突

This commit is contained in:
wangshiming
2022-04-27 13:45:00 +08:00
parent f0afe10ec1
commit 5a429bafdf
11 changed files with 61 additions and 77 deletions

View File

@ -49,7 +49,6 @@ import { BannerComponentsAddComponent } from './knowledge/banner/components/add/
import { PersonalPartnerDetailComponent } from './partner-list/components/personal-partner-detail/personal-partner-detail.component';
import { ParterAdviceFeedbackListComponent } from './advice-feedback/components/list/list.component';
import { ParterAdviceFeedbackDetailComponent } from './advice-feedback/components/feedback-detail/feedback-detail.component';
import { PartnerSystemConfigComponent } from './system-config/components/config/config.component';
const routes: Routes = [
{
@ -153,12 +152,6 @@ const routes: Routes = [
{ path: 'record/detail/:id', component: PartnerRecordedDetailComponent }
]
},
{
path: 'config',
children: [
{ path: '', component: PartnerSystemConfigComponent },
]
},
{
path: 'knowledge',
children: [

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-09 14:34:55
* @LastEditors : Shiming
* @LastEditTime : 2022-04-20 15:45:20
* @LastEditTime : 2022-04-27 11:28:31
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\partner.module.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -63,7 +63,6 @@ import { ParterAdviceFeedbackListComponent } from './advice-feedback/components/
import { ParterAdviceFeedbackDetailComponent } from './advice-feedback/components/feedback-detail/feedback-detail.component';
import { ParterRebateManageMentAddPartnerListComponent } from './rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component';
import { ChannelLogModalComponent } from './partner-list/components/channel-log-modal/channel-log-modal.component';
import { PartnerSystemConfigComponent } from './system-config/components/config/config.component';
const COMPONENTS: any[] = [
PartnerBusinessStatisticsIndexComponent,
@ -117,7 +116,6 @@ const COMPONENTS: any[] = [
ParterAdviceFeedbackDetailComponent,
ParterRebateManageMentAddPartnerListComponent,
ChannelLogModalComponent,
PartnerSystemConfigComponent
];
@NgModule({

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-24 20:09:49
* @LastEditors : Shiming
* @LastEditTime : 2022-04-26 20:44:56
* @LastEditTime : 2022-04-27 13:38:57
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -102,7 +102,7 @@
style="max-width: 400px; min-width: 200px; margin-left: 40px"
rows="4"
nz-input
[(ngModel)]="remarke"
[(ngModel)]="remark"
></textarea>
</sv>
</sv-container>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-21 09:26:45
* @LastEditors : Shiming
* @LastEditTime : 2022-04-26 21:06:50
* @LastEditTime : 2022-04-27 13:44:19
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -23,7 +23,7 @@ import { ParterRebateManageMentAddPartnerListComponent } from '../add-partnerlis
})
export class ParterRebateManageMentAddComponent implements OnInit {
@ViewChild('table') table!: any;
titleText :string= '新增';
titleText: string = '新增';
tabelData: any;
tabelType: any;
formData: any;
@ -31,7 +31,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
hiden: boolean = false;
configName: string = '';
partnerType: string = '';
remarke: string = '';
remark: string = '';
accountingRate: Number = 0;
priority: string = '';
partnerPeopleList: any = [];
@ -50,7 +50,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
private modal: NzModalService,
public shipperservice: ShipperBaseService
) {}
columns: STColumn[] =[]
columns: STColumn[] = [];
initSF(data?: any) {
this.schema1 = {
properties: {
@ -59,7 +59,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
title: '',
disabled: this.hiden,
ui: {
widget: 'tinymce',
loadingTip: 'loading...',
config: {
@ -70,7 +69,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
}
}
};
this.columns= [
this.columns = [
{
title: '合伙人名称',
index: 'enterpriseName',
@ -88,8 +87,8 @@ export class ParterRebateManageMentAddComponent implements OnInit {
{
text: '移除',
click: _record => this.delete(_record),
iif: ()=> {
return !this.hiden
iif: () => {
return !this.hiden;
},
acl: { ability: ['AbnormalAppear-reply'] }
}
@ -98,9 +97,9 @@ export class ParterRebateManageMentAddComponent implements OnInit {
];
}
ngOnInit() {
if(this.ar.snapshot?.queryParams?.id) {
this.titleText= '查看'
this.hiden= true
if (this.ar.snapshot?.queryParams?.id) {
this.titleText = '查看';
this.hiden = true;
this.initSF();
this.initData(this.ar.snapshot?.queryParams?.id);
}
@ -144,27 +143,34 @@ export class ParterRebateManageMentAddComponent implements OnInit {
});
}
save() {
console.log(this.configName);
// if(!this.configName) {
// this.service.msgSrv.warning('请输入配置名称!');
// return
// }
// if(!this.accountingRate) {
// this.service.msgSrv.warning('请输入固定结算费率!');
// return
// }
// if(!this.partnerType) {
// this.service.msgSrv.warning('请选择合伙人范围!');
// return
// }
// if(this.partnerType == '3' && this.partnerPeopleList?.length == 0) {
// this.service.msgSrv.warning('请选择合伙人!');
// return
// }
if(!this.configName) {
this.service.msgSrv.warning('请输入配置名称!');
return
}
if(!this.accountingRate) {
this.service.msgSrv.warning('请输入固定结算费率!');
return
}
if(!this.partnerType) {
this.service.msgSrv.warning('请选择合伙人范围!');
return
}
if(this.partnerType == '3' && this.partnerPeopleList?.length == 0) {
this.service.msgSrv.warning('请选择合伙人!');
return
}
let real = false;
this.table.data.forEach((element: any) => {
console.log(element);
if (element.startAmount > element.endAmount) {
real = true;
return;
}
});
if (real) {
this.service.msgSrv.warning('初始业务量不能超过到达业务量!');
return;
}
const params = {
accountingRate: this.accountingRate,
configName: this.configName,
@ -173,19 +179,19 @@ export class ParterRebateManageMentAddComponent implements OnInit {
priority: this.priority, // 优先级
partnerIds: this.partnerId,
ruleDescription: this.sf.value.ruleDescription,
remarke: this.remarke,
remark: this.remark,
partnerType: this.partnerType
};
// this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => {
// if (res) {
// this.service.msgSrv.success('新增成功!');
// this.router.navigate(['/partner/rebate/setting']);
// }
// });
this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => {
if (res) {
this.service.msgSrv.success('新增成功!');
this.router.navigate(['/partner/rebate/setting']);
}
});
}
initData(id:string) {
this.service.request(this.service.$api_get_getPartnerRebateConfigInfo, {id: id}).subscribe((res: any) => {
if(res) {
initData(id: string) {
this.service.request(this.service.$api_get_getPartnerRebateConfigInfo, { id: id }).subscribe((res: any) => {
if (res) {
this.configName = res?.configName;
this.accountingRate = res?.accountingRate;
this.accountingRate = res?.accountingRate;
@ -194,10 +200,10 @@ export class ParterRebateManageMentAddComponent implements OnInit {
this.partnerType = res?.partnerType + '';
this.partnerPeopleList = res?.partnerListVOs;
this.priority = res?.priority + '';
this.formData = {ruleDescription: res?.ruleDescription};
this.remarke = res.remark;
this.formData = { ruleDescription: res?.ruleDescription };
this.remark = res.remark;
}
})
});
}
changePartner(value: any) {
if (value == '3') {
@ -206,5 +212,4 @@ export class ParterRebateManageMentAddComponent implements OnInit {
this.addStatus = false;
}
}
}

View File

@ -1,121 +0,0 @@
<nz-card>
<div nz-row [nzGutter]="8">
<div nz-col nzSpan="20" style="overflow: scroll">
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab === 0">
<h3 style="font-weight: 600">提现手续费配置</h3>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="125" [se-container]="1">
<se label="个人提现手续费" style="margin:15px 0 0 0">
<div>
按照提现金额收取
<nz-input-number [(ngModel)]="personValue" [nzMin]="0" [nzMax]="100" [nzPrecision]="2" [nzStep]="0.01"></nz-input-number>
<span> %手续费 </span>
</div>
</se>
<se label="企业提现手续费" style="margin:15px 0 0 0;">
<div>
按照提现金额收取
<nz-input-number
[(ngModel)]="enterpriseValue"
[nzMin]="0"
[nzMax]="100"
[nzPrecision]="2"
[nzStep]="0.01"
></nz-input-number>
<span> %手续费 </span>
</div>
</se>
</div>
</div>
<h3 style="font-weight: 600;margin:15px 0 0 0;" class="mb-md">合伙人提现配置</h3>
<div nz-row nzGutter="8" class="audit">
<div nz-col nzSpan="24" se-container>
<se label="提现审核" style="margin:15px 0 0 0;">
<nz-radio-group [(ngModel)]="auditValue">
<label nz-radio [nzValue]="false" class="mt-sm">关闭</label>
<label nz-radio [nzValue]="true" class="mt-sm">开启</label>
</nz-radio-group>
</se>
<se label="审核时间" style="margin:15px 0 0 0;">
<div se-container [se-container]="1" style="margin-left: 0px">
<nz-radio-group style="display: block" [(ngModel)]="auditTime" (ngModelChange)="changeAuto(auditTime)">
<label nz-radio [nzValue]="1" class="mt-sm">全天</label>
<label nz-radio [nzValue]="2" class="mt-sm">自定义</label>
</nz-radio-group>
</div>
</se>
<div style="margin-left: 200px">
<ng-container *ngTemplateOutlet="auditTimes"> </ng-container>
</div>
</div>
</div>
<h3 style="font-weight: 600;margin:15px 0 0 0;" class="mb-md">客户定义配置</h3>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24">
<span>客户</span>
<nz-input-number style="margin: 0 10px; " [(ngModel)]="personValue" [nzMin]="0" [nzMax]="3000" [nzPrecision]="2" [nzStep]="0.1"></nz-input-number>
<span>天内没有交易订单的视为“沉默客户”</span>
</div>
<div nz-col nzSpan="24" style="margin-top: 10px;">
<span>客户</span>
<nz-input-number style="margin: 0 10px; " [(ngModel)]="personValue" [nzMin]="0" [nzMax]="3000" [nzPrecision]="2" [nzStep]="0.1"></nz-input-number>
<span>天内没有交易订单的视为“流失客户”</span>
</div>
<div nz-col nzSpan="24">
<span style="color: #797979; font-size: 14px;">说明:交易订单指从司机已接单开始的订单。</span>
</div>
</div>
</nz-card>
<div class="mb-md save-btn">
<button class="ml-lg" nz-button nzSize="large" nzType="primary">保存</button>
<button class="ml-lg" nz-button nzSize="large">取消</button>
</div>
</div>
</div>
</nz-card>
<ng-template #auditTimes let-data="data" let-title="title">
<div *ngIf="auditTimeStatus" >
<div style="display: flex">
<nz-radio-group [(ngModel)]="everyDay" (ngModelChange)="everyDayChange(everyDay)" style="display: block">
<label nz-radio [nzValue]="1" class="mt-sm"
>每天<span *ngIf="TimeStatus" style="margin-left: 30px; color: #0200ff; cursor: pointer" (click)="addEvery()">添加时间段</span></label
>
</nz-radio-group>
<br />
<div *ngIf="TimeStatus">
<div *ngFor="let item of everyDayData; let i = index">
<div style="margin-top: 15px;">
<input type="time" [(ngModel)]="item.startTime" placeHolder="开始时间" style="margin-left: 23px" />
<label class="ml-sm mr-sm"> --</label>
<input type="time" [(ngModel)]="item.endTime" placeHolder="结束时间" style="margin-left: 0" class="mr-xl" />
<label class="ml-sm mr-sm" style=" color: #0200ff; cursor: pointer" *ngIf="i !== 0" (click)="delEvery(i)">删除</label>
</div>
</div>
</div>
</div>
<div >
<nz-radio-group [(ngModel)]="MonthDay" (ngModelChange)="MonthDayChange(MonthDay)" style="display: block">
<label nz-radio [nzValue]="2" class="mt-sm"
>每周<span *ngIf="!TimeStatus" style="margin-left: 30px; color: #0200ff; cursor: pointer" (click)="addMonth()">添加星期</span></label
>
</nz-radio-group>
<div *ngIf="!TimeStatus">
<div *ngFor="let item of MonthDayData; let i = index">
<nz-checkbox-group style="margin-top: 15px;" [(ngModel)]="item.month" (ngModelChange)="changeMonth(item.month)"></nz-checkbox-group>
<br />
<div *ngFor="let ite of item.Times; let ii = index">
<div style="margin-top: 15px;">
<input type="time" [(ngModel)]="ite.startTime" placeHolder="开始时间" style="margin-left: 23px" />
<label class="ml-sm mr-sm"> --</label>
<input type="time" [(ngModel)]="ite.endTime" placeHolder="结束时间" style="margin-left: 0" class="mr-xl" />
<label class="ml-sm mr-sm" style=" color: #0200ff; cursor: pointer" (click)="addMonthEvery(i)">添加时间段</label>
<label *ngIf="ii !== 0" class="ml-sm mr-sm" style=" color: #0200ff; cursor: pointer" (click)="delMonth(i,ii)">删除</label>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>

View File

@ -1,25 +0,0 @@
:host {
::ng-deep {
.card-height {
min-height: 600px;
}
.save-btn {
width : 100%;
text-align: right;
}
.block-radio {
display : flex;
min-height : 32px;
}
input {
width : 100px;
margin-left: 10px;
}
.audit .ant-form-item-label{
width: 81px !important;
}
}
}

View File

@ -1,329 +0,0 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { SFComponent, SFSchema, SFUploadWidgetSchema } from '@delon/form';
import { NzUploadFile } from 'ng-zorro-antd/upload';
import { Observable, Observer, of } from 'rxjs';
import { ConfigService } from '../../services/config.service';
import { apiConf } from '@conf/api.conf';
const IMAGECONFIG = {
previewFile: (file: NzUploadFile) => of(file.url),
action: apiConf.waterFileUpload,
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
fileSize: 5120,
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
name: 'multipartFile',
multiple: false,
listType: 'picture-card'
} as SFUploadWidgetSchema;
@Component({
selector: 'app-parterl-config',
templateUrl: './config.component.html',
styleUrls: ['./config.component.less']
})
export class PartnerSystemConfigComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('sf2', { static: false }) sf2!: SFComponent;
formDate: any = {
isAudit: false,
isEveryDay: false,
isEveryWeek: false
};
personValue!: number;
enterpriseValue!: number;
auditValue!: number;
auditTime!: any;
auditTimeStatus: boolean = false
everyDay: boolean = false
MonthDay: boolean = false
time: Date | null = null;
defaultOpenValue = new Date(0, 0, 0, 0, 0, 0);
tabs = [
{
name: '基础配置'
},
{
name: '分享配置'
}
];
selectedTab = 0;
TimeStatus: boolean = true
everyDayData: Array<any> =[];
MonthDayData: any = [
{month: [
{ label: '周一', value: '周一', },
{ label: '周二', value: '周二' },
{ label: '周三', value: '周三' },
{ label: '周四', value: '周四' },
{ label: '周五', value: '周五' },
{ label: '周六', value: '周六' },
{ label: '周日', value: '周日' }
], Times:[ {
startTime: [],
endTime: [],
}]}
]
checkOptionsOne = [
{ label: '周一', value: '周一', checked: true },
{ label: '周二', value: '周二' },
{ label: '周三', value: '周三' },
{ label: '周四', value: '周四' },
{ label: '周五', value: '周五' },
{ label: '周六', value: '周六' },
{ label: '周日', value: '周日' }
];
i: any;
schema!: SFSchema;
schema2!: SFSchema;
// IMAGECONFIG = {
// widget: 'upload',
// action: `/scm/cms/cms/upload/multipartFile/fileModel`,
// limit: 1,
// limitFileCount: 1,
// resReName: 'url',
// urlReName: 'url',
// data: {
// appId: this.service.envSrv.getEnvironment().appId
// },
// multiple: false,
// listType: 'picture-card',
// showRequired: true
// };
constructor(private service: ConfigService) {}
ngOnInit() {
this.initSF();
this.everyDayData = [
{
startTime: '',
endTime: '',
}
]
}
addEvery() {
this.everyDayData.push(
{
startTime: [],
endTime: [],
}
)
}
delEvery(index: number) {
this.everyDayData.splice(index, 1)
}
addMonthEvery(value: any) {
this.MonthDayData[value].Times.push(
{
startTime: '',
endTime: ''
}
)
}
addMonth() {
this.MonthDayData.push(
{month: [
{ label: '周一', value: '周一', },
{ label: '周二', value: '周二' },
{ label: '周三', value: '周三' },
{ label: '周四', value: '周四' },
{ label: '周五', value: '周五' },
{ label: '周六', value: '周六' },
{ label: '周日', value: '周日' }
], Times:[{
startTime: '',
endTime: ''
}]}
)
}
delMonth(value: number,index: number) {
this.MonthDayData[value].Times.splice(index, 1)
}
changeType(type: number): void {
this.selectedTab = type;
}
changeMonth(type: any): void {
console.log(type);
console.log( this.MonthDayData);
}
everyDayChange(type: any): void {
console.log(type);
if(type) {
this.MonthDay = false
this.TimeStatus = true
}
}
MonthDayChange(type: any): void {
console.log(type);
if(type) {
this.everyDay = false
this.TimeStatus = false
}
}
initSF() {
this.schema = {
properties: {
roadTransportPhoto: { title: '', type: 'string', ui: { hidden: true } },
roadTransportPhotoWatermark: {
type: 'string',
title: '分享海报',
ui: {
...IMAGECONFIG,
descriptionI18n: '支持JPG、PNG格式文件小于2M建议尺寸 750px* 1624 px。',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/roadTransportPhoto', args.fileList[0].response.data.fullFilePath);
}
},
} as SFUploadWidgetSchema
},
share: { title: '', type: 'string', ui: { hidden: true } },
shareWatermark: {
type: 'string',
title: '分享图',
ui: {
...IMAGECONFIG,
descriptionI18n: '支持JPG、PNG格式文件小于2M 建议尺寸 856px * 688px。',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/share', args.fileList[0].response.data.fullFilePath);
}
},
} as SFUploadWidgetSchema
},
take: { title: '', type: 'string', ui: { hidden: true } },
takeWatermark: {
type: 'string',
title: '受邀海报',
ui: {
...IMAGECONFIG,
descriptionI18n: '支持JPG、PNG格式文件小于2M建议尺寸 750px* 1624 px。',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/take', args.fileList[0].response.data.fullFilePath);
}
},
} as SFUploadWidgetSchema
},
complianceRemark: {
title: '分享文案',
type: 'string',
maxLength: 50,
ui: {
placeholder: '请不要超过50个字',
widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 }
}
}
},
required: ['roadTransportPhotoWatermark', 'shareWatermark', 'takeWatermark', 'complianceRemark']
};
this.schema2 = {
properties: {
roadTransportPhoto: { title: '', type: 'string', ui: { hidden: true } },
roadTransportPhotoWatermark: {
type: 'string',
title: '分享海报',
ui: {
...IMAGECONFIG,
descriptionI18n: '支持JPG、PNG格式文件小于2M建议尺寸750px* 1624 px。',
change: args => {
if (args.type === 'success') {
this.sf2.setValue('/roadTransportPhoto', args.fileList[0].response.data.fullFilePath);
}
},
} as SFUploadWidgetSchema
},
share: { title: '', type: 'string', ui: { hidden: true } },
shareWatermark: {
type: 'string',
title: '分享图',
ui: {
...IMAGECONFIG,
descriptionI18n: '支持JPG、PNG格式文件小于2M建议尺寸 856px * 688px。',
change: args => {
if (args.type === 'success') {
this.sf2.setValue('/share', args.fileList[0].response.data.fullFilePath);
}
},
} as SFUploadWidgetSchema
},
take: { title: '', type: 'string', ui: { hidden: true } },
takeWatermark: {
type: 'string',
title: '受邀海报',
ui: {
...IMAGECONFIG,
descriptionI18n: '支持JPG、PNG格式文件小于2M建议尺寸750px* 1624 px。',
change: args => {
if (args.type === 'success') {
this.sf2.setValue('/take', args.fileList[0].response.data.fullFilePath);
}
},
} as SFUploadWidgetSchema
},
complianceRemark: {
title: '分享文案',
type: 'string',
maxLength: 50,
ui: {
placeholder: '请不要超过50个字',
widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 }
}
}
},
required: ['roadTransportPhotoWatermark', 'shareWatermark', 'takeWatermark', 'complianceRemark']
};
}
private uploadBefore = (file: any, fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt1M = file.size / 1024 / 1024 < 2;
const fileType = 'image/png,image/jpeg';
if (fileType.indexOf(file.type) === -1) {
this.service.msgSrv.warning('图片格式不正确!');
observer.complete();
return;
}
if (!isLt1M) {
// this.service.msgSrv.warning('图片需小于1M');
this.service.msgSrv.warning('图片大小超过2M!');
observer.complete();
return;
}
observer.next(isLt1M);
observer.complete();
});
};
changeAuto(value: any) {
console.log(value);
if(value == '2') {
this.auditTimeStatus = true
} else {
this.auditTimeStatus = false
}
}
private getImageModel(args: any, key: any) {
return [
{
uid: key,
name: 'LOGO',
status: 'done',
url: args.fileList[0].response.url,
response: {
url: args.fileList[0].response.url
}
}
];
}
}

View File

@ -1,12 +0,0 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@Injectable({
providedIn: 'root',
})
export class ConfigService extends BaseService {
constructor(public injector: Injector) {
super(injector);
}
}