fix bug
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { EAEnvironmentService } from '@shared';
|
||||
import { EAEnvironmentService, ShipperBaseService } from '@shared';
|
||||
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
|
||||
import format from 'date-fns/format';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
@ -19,8 +19,9 @@ import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
})
|
||||
export class EditPartnerComponentsAddComponent implements OnInit {
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
record: any = {};
|
||||
i: any;
|
||||
sts: any;
|
||||
rows: any;
|
||||
schema: SFSchema = {};
|
||||
detailData: any = {}
|
||||
ui: SFUISchema = {};
|
||||
@ -33,14 +34,18 @@ export class EditPartnerComponentsAddComponent implements OnInit {
|
||||
public service: UsermanageService,
|
||||
private envSrv: EAEnvironmentService,
|
||||
private modal: NzModalRef,
|
||||
public shipperservice: ShipperBaseService
|
||||
) { }
|
||||
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initDetailData()
|
||||
if(this.sts == '2') {
|
||||
this.initDetailData()
|
||||
}
|
||||
this.initSF();
|
||||
}
|
||||
initDetailData() {
|
||||
|
||||
const params = {
|
||||
id: this.i.id
|
||||
}
|
||||
@ -55,18 +60,40 @@ export class EditPartnerComponentsAddComponent implements OnInit {
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
channelId: {
|
||||
// channelId: {
|
||||
// type: 'string',
|
||||
// title: '合伙人修改为',
|
||||
// ui: {
|
||||
// widget: 'radio',
|
||||
// showRequired: true,
|
||||
// } as SFRadioWidgetSchema,
|
||||
// enum: [
|
||||
// { label: '全部可见', value: 1 },
|
||||
// { label: '合伙人可见', value: 2 },
|
||||
// { label: '销售渠道可见', value: 3 },
|
||||
// ],
|
||||
// },
|
||||
enterpriceIds: {
|
||||
type: 'string',
|
||||
title: '合伙人修改为',
|
||||
ui: {
|
||||
widget: 'radio',
|
||||
showRequired: true,
|
||||
} as SFRadioWidgetSchema,
|
||||
enum: [
|
||||
{ label: '全部可见', value: 1 },
|
||||
{ label: '合伙人可见', value: 2 },
|
||||
{ label: '销售渠道可见', value: 3 },
|
||||
],
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
},
|
||||
asyncData: () => this.shipperservice.getNetworkenterpriceIds()
|
||||
}
|
||||
},
|
||||
settStartTime: {
|
||||
title: '结算起算日期',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd', visibleIf: {
|
||||
_$expand: (value: boolean) => value,
|
||||
},
|
||||
} as SFDateWidgetSchema,
|
||||
},
|
||||
remark: {
|
||||
type: 'string',
|
||||
@ -87,7 +114,8 @@ export class EditPartnerComponentsAddComponent implements OnInit {
|
||||
} as SFRadioWidgetSchema,
|
||||
enum: [
|
||||
{ label: '修改成功后立即生效', value: 1 },
|
||||
{ label: 'CRM流程审核通过后生效', value: 2 }
|
||||
{ label: 'CRM流程审核后生效', value: 2 },
|
||||
{ label: 'CRM流程审核通过后生效', value: 3 }
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-01-12 10:52:50
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-02-11 15:08:47
|
||||
* @LastEditTime : 2022-04-24 17:13:51
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\freight\\list\\list.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
@ -33,7 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<nz-card [nzExtra]="extraTemplate" >
|
||||
<!-- 数据列表 -->
|
||||
<!-- [data]="service.$api_get_supplier_page" -->
|
||||
|
||||
@ -72,4 +72,10 @@
|
||||
</se>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #extraTemplate>
|
||||
<div>
|
||||
<button nz-button nzType="primary" (click)="editPartner()" acl [acl-ability]="['ORDER-RISK-batchAudit']"> 修改合伙人 </button>
|
||||
<button nz-button nzType="primary" (click)="editSale()" acl [acl-ability]="['ORDER-RISK-batchAudit']"> 修改渠道销售 </button>
|
||||
</div>
|
||||
</ng-template>
|
||||
@ -125,13 +125,30 @@ export class FreightComponentsListComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
editPartner(record: any) {
|
||||
get selectedRows() {
|
||||
return this.st?.list.filter(item => item.checked) || [];
|
||||
}
|
||||
editPartner(record?: any) {
|
||||
let status = 1
|
||||
if(record) {
|
||||
status = 2
|
||||
}
|
||||
if (this.selectedRows.length <= 0 && !record) {
|
||||
this.service.msgSrv.error('请选择订单!');
|
||||
return;
|
||||
}
|
||||
let params: any[] = [];
|
||||
this.selectedRows.forEach(item => {
|
||||
params.push(item.id);
|
||||
});
|
||||
const modalRef = this.modal.create({
|
||||
nzTitle: '修改合伙人',
|
||||
nzContent: EditPartnerComponentsAddComponent,
|
||||
nzWidth: 800,
|
||||
nzComponentParams: {
|
||||
i: record
|
||||
i: record,
|
||||
sts: status,
|
||||
rows: params
|
||||
},
|
||||
nzFooter: null
|
||||
});
|
||||
@ -141,7 +158,7 @@ export class FreightComponentsListComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
editSale(record: any) {
|
||||
editSale(record?: any) {
|
||||
const modalRef = this.modal.create({
|
||||
nzTitle: '修改渠道销售',
|
||||
nzContent: EditSaleComponentsAddComponent,
|
||||
@ -380,7 +397,7 @@ export class FreightComponentsListComponent implements OnInit {
|
||||
|
||||
initST() {
|
||||
this.columns = [
|
||||
// { title: '', type: 'checkbox', className: 'text-center' },
|
||||
{ title: '', type: 'checkbox', className: 'text-center' },
|
||||
{ title: '企业名称', render: 'enterpriseName', width: 350 },
|
||||
{ title: '统一社会信用代码', className: 'text-center', render: 'unifiedSocialCreditCode', width: 200 },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user