e
This commit is contained in:
@ -7,5 +7,5 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button nz-button type="button" (click)="close()">取消</button>
|
||||
<button nz-button type="button" nzType="primary" (click)="sure()" [disabled]="!sf.valid">保存</button>
|
||||
<button nz-button type="button" nzType="primary" (click)="configType===3?configAction():sure()" [disabled]="!sf.valid">保存</button>
|
||||
</div>
|
||||
@ -114,6 +114,29 @@ export class CartConfigActionModalComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
configAction() {
|
||||
if (this.i.id === 0) {
|
||||
const params: any = {
|
||||
configFullKey: 'ban.goods.name',
|
||||
name: this.sf.value.itemValue
|
||||
};
|
||||
this.service.request(this.service.$api_add_config_item, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('保存成功!');
|
||||
this.modal.close(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const params: any = { ...this.sf.value, ...this.i, configFullKey: 'ban.goods.name', name: this.sf.value.itemValue };
|
||||
this.service.request(this.service.$api_update_config_item, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('保存成功!');
|
||||
this.modal.close(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modal.destroy();
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
[button]="'none'"></sf>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="8" nzOffset="1">
|
||||
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
|
||||
<button nz-button nzType="primary" [nzLoading]="loading" (click)="st?.load(1)">查询</button>
|
||||
<button nz-button (click)="resetSF()">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -25,6 +25,7 @@
|
||||
<button nz-button nzType="primary" (click)="configAction()">新增</button>
|
||||
</div>
|
||||
</div>
|
||||
<st #st [data]="service.$api_get_dict_page" [columns]="columns" [req]="{ params: reqParams }"
|
||||
[loading]="service.http.loading" [scroll]="{ y: '370px' }"></st>
|
||||
<st #st [data]="tabType === 3?service.$api_get_config_item_page:service.$api_get_dict_page" [columns]="columns"
|
||||
[req]="{process: beforeReq }" [res]="{ process: afterRes }" [loading]="loading"
|
||||
[scroll]="{ y: '370px' }"></st>
|
||||
</nz-card>
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STComponent, STColumn, STChange } from '@delon/abc/st';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { SystemService } from '../../services/system.service';
|
||||
@ -8,7 +8,8 @@ import { CartConfigActionModalComponent } from './cart-config-action-modal/cart-
|
||||
@Component({
|
||||
selector: 'app-cart-config',
|
||||
templateUrl: './cart-config.component.html',
|
||||
styleUrls: ['./cart-config.component.less']
|
||||
styleUrls: ['./cart-config.component.less'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class CartConfigComponent implements OnInit {
|
||||
@ViewChild('st', { static: true })
|
||||
@ -109,7 +110,12 @@ export class CartConfigComponent implements OnInit {
|
||||
}
|
||||
];
|
||||
|
||||
get reqParams() {
|
||||
loading = true;
|
||||
constructor(public service: SystemService, private nzModalService: NzModalService, private cdr: ChangeDetectorRef) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
let params = {};
|
||||
switch (this.tabType) {
|
||||
case 1:
|
||||
@ -119,45 +125,44 @@ export class CartConfigComponent implements OnInit {
|
||||
Object.assign(params, { dictKey: 'car:length', itemValue: this.sf?.value.params2 });
|
||||
break;
|
||||
case 3:
|
||||
Object.assign(params, { dictKey: 'ban.goods.name', itemValue: this.sf?.value.params3 });
|
||||
Object.assign(params, { configFullKey: 'ban.goods.name', itemValue: this.sf?.value.params3 });
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return { ...params };
|
||||
}
|
||||
Object.assign(requestOptions.body, params);
|
||||
this.loading = true;
|
||||
return requestOptions;
|
||||
};
|
||||
|
||||
constructor(public service: SystemService, private nzModalService: NzModalService) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
afterRes = (data: any[], rawData?: any) => {
|
||||
this.loading = false;
|
||||
return data;
|
||||
};
|
||||
|
||||
// 切换Tab
|
||||
changeTab(item: any) {
|
||||
this.tabType = item.type;
|
||||
this.sf?.setValue('/tabType', item.type);
|
||||
this.sf?.reset();
|
||||
setTimeout(() => {
|
||||
this.tabs.forEach(i => (i.isActived = false));
|
||||
item.isActived = !item.isActived;
|
||||
// this.tabs.forEach(i => (i.isActived = false));
|
||||
// item.isActived = !item.isActived;
|
||||
this.st.load(1);
|
||||
this.st.resetColumns();
|
||||
}, 500);
|
||||
// this.cdr.detectChanges();
|
||||
}
|
||||
|
||||
configAction(item?: any) {
|
||||
console.log(item)
|
||||
console.log(this.tabType)
|
||||
const modal = this.nzModalService.create({
|
||||
nzContent: CartConfigActionModalComponent,
|
||||
nzComponentParams: item
|
||||
? { i: { ...item }, configType: this.tabType }
|
||||
: { i: { id: 0 }, configType: this.tabType },
|
||||
nzComponentParams: item ? { i: { ...item }, configType: this.tabType } : { i: { id: 0 }, configType: this.tabType },
|
||||
nzFooter: null
|
||||
});
|
||||
modal.afterClose.subscribe(res => {
|
||||
if (res) {
|
||||
this.st.load();
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -168,10 +173,12 @@ export class CartConfigComponent implements OnInit {
|
||||
nzClosable: false,
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => {
|
||||
this.service.request(this.service.$api_delete_dict_by_ids, [item.id]).subscribe(res => {
|
||||
this.service
|
||||
.request(this.tabType === 3 ? this.service.$api_remove_config_item : this.service.$api_delete_dict_by_ids, [item.id])
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('删除配置成功');
|
||||
this.st.load();
|
||||
this.st.load(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ export class GoodsNameConfigComponent implements OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* 货物类型操作
|
||||
* 货物名称操作
|
||||
* @param item
|
||||
*/
|
||||
typeItemAction(item?: any) {
|
||||
|
||||
@ -83,6 +83,7 @@ export class FreightComponentsListComponent implements OnInit {
|
||||
roleId: item.id,
|
||||
ctfId: item.unifiedSocialCreditCode,
|
||||
clientName: item.enterpriseName,
|
||||
projectId: item.mainProjectId,
|
||||
ltdId: item.networkTransporter
|
||||
}
|
||||
},
|
||||
|
||||
@ -28,10 +28,10 @@ export class AccountDetailComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
ltdId: item.ltdId,
|
||||
ltdId: item.ltdId || this.params.ltdId,
|
||||
roleId: item.roleId,
|
||||
projectId: item.projectId,
|
||||
enterpriseId: item.enterpriseId,
|
||||
projectId: item.projectId || this.params.projectId,
|
||||
enterpriseId: item.enterpriseId || this.params.roleId,
|
||||
ctfId: this.params.ctfId,
|
||||
clientName: this.params.clientName,
|
||||
roleName: this.params.clientName
|
||||
|
||||
Reference in New Issue
Block a user