-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts
index 24a3af95..bc94a1e2 100644
--- a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts
+++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts
@@ -1,6 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
-import { STColumn, STComponent, STRequestOptions, STData } from '@delon/abc/st';
+import { STColumn, STComponent, STRequestOptions, STData, STChange } from '@delon/abc/st';
import { SFUISchema, SFSchema, SFComponent, SFDateWidgetSchema } from '@delon/form';
import { ShipperBaseService, DynamicSettingModalComponent } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
@@ -10,34 +10,60 @@ import { UsermanageService } from '../../../services/usercenter.service';
@Component({
selector: 'app-freight-config',
templateUrl: './freight-config.component.html',
- styleUrls: ['../../../../commom/less/box.less']
+ styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less']
})
export class FreightConfigComponent implements OnInit {
schema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
+ selectedRows: any[] = [];
+
+ @ViewChild('IWModal', { static: false })
+ IWModal!: any;
+ @ViewChild('roleModal', { static: false })
+ roleModal!: any;
+ ltdId: any = [];
+ roles: any = [];
+ networkTransporter = null;
+ roleId = null;
_$expand = false;
constructor(public service: UsermanageService, private modal: NzModalService, public shipperservice: ShipperBaseService) {}
ngOnInit() {
this.initST();
+ this.loadltdId();
+ this.loadRoles();
}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { listSource: 1 });
- if (this.sf) {
+ console.log(1);
+
+ if (this.sf?.value) {
Object.assign(requestOptions.body, {
- ...this.sf.value,
- createTime: {
- start: this.sf?.value.effectiveDate[0],
- end: this.sf?.value.effectiveDate[1]
- }
+ ...this.sf.value
});
+ if (this.sf?.value.createTime) {
+ Object.assign(requestOptions.body, {
+ createTime: {
+ start: this.sf?.value.createTime[0],
+ end: this.sf?.value.createTime[1]
+ }
+ });
+ }
}
return requestOptions;
};
+ stChange(e: STChange): void {
+ switch (e.type) {
+ case 'checkbox':
+ this.selectedRows = e.checkbox!;
+ break;
+ }
+ }
+
settingAction(item?: any) {
const modal = this.modal.create({
nzTitle: '配置',
@@ -48,20 +74,20 @@ export class FreightConfigComponent implements OnInit {
businessId: item.id,
formatTypeList: (item: any[]) => [
...item,
- // {
- // name: '权限配置',
- // items: [
- // {
- // configType: 1,
- // itemType: 999
- // }
- // ]
- // },
{
- name: '费率变更记录',
+ name: '权限配置',
+ configType: 1,
+ items: [
+ {
+ itemType: 999
+ }
+ ]
+ },
+ {
+ name: '费率变更记录',
+ configType: 2,
items: [
{
- configType: 2,
itemType: 999
}
]
@@ -77,6 +103,68 @@ export class FreightConfigComponent implements OnInit {
});
}
+ editRoleBatch() {
+ if (this.selectedRows?.length <= 0) {
+ this.service.msgSrv.warning('请选择企业');
+ return;
+ }
+ this.roleId = null;
+ const modal = this.modal.create({
+ nzTitle: '修改角色',
+ nzContent: this.roleModal,
+ nzOnOk: () => {
+ if (!this.roleId) {
+ return false;
+ }
+ this.service
+ .request(this.service.$api_update_enter_role_batch, {
+ enterpriseIdList: this.selectedRows.map(i => i.id),
+ roleId: this.roleId
+ })
+ .subscribe((res: Array
) => {
+ if (res) {
+ this.service.msgSrv.success('修改成功');
+ this.st.load(1);
+ modal.destroy();
+ }
+ });
+ return false;
+ }
+ });
+ }
+
+ editIWBatch() {
+ if (this.selectedRows?.length <= 0) {
+ this.service.msgSrv.warning('请选择企业');
+ return;
+ }
+ this.networkTransporter = null;
+ const modal = this.modal.create({
+ nzTitle: '修改网络货运人',
+ nzContent: this.IWModal,
+ nzOnOk: () => {
+ if (!this.networkTransporter) {
+ return false;
+ }
+ this.service
+ .request(this.service.$api_update_enter_newowork_batch, {
+ enterpriseIdList: this.selectedRows.map(i => i.id),
+ networkTransporterId: this.networkTransporter
+ })
+ .subscribe((res: Array) => {
+ if (res && res.length === 0) {
+ this.service.msgSrv.success('修改成功');
+ this.st.load(1);
+ modal.destroy();
+ } else {
+ this.service.msgSrv.error(`企业${res?.join(',')}修改失败`);
+ }
+ });
+ return false;
+ }
+ });
+ }
+
exportList() {
const params = {};
if (this.sf) {
@@ -86,10 +174,25 @@ export class FreightConfigComponent implements OnInit {
}
this.service.downloadFile(this.service.$api_export_enterprise, params);
}
+ loadltdId() {
+ this.service.getNetworkFreightForwarder().subscribe(res => {
+ if (res) {
+ this.ltdId = res;
+ }
+ });
+ }
+ loadRoles() {
+ this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => {
+ if (res) {
+ this.roles = res;
+ }
+ });
+ }
+
/**
* 伸缩查询条件
*/
- expandToggle(): void {
+ expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
@@ -139,28 +242,29 @@ export class FreightConfigComponent implements OnInit {
showRequired: false,
visibleIf: {
_$expand: (value: boolean) => value
- },
+ }
}
},
- effectiveDate: {
+ createTime: {
title: '注册时间',
type: 'string',
ui: {
- widget: 'date',
- mode: 'range',
+ widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
+ placeholder: '请选择',
+ nzShowTime: true,
visibleIf: {
- _$expand: (value: boolean) => value,
- },
- allowClear: true,
- } as SFDateWidgetSchema,
- },
+ _$expand: (value: boolean) => value
+ }
+ } as SFDateWidgetSchema
+ }
}
};
}
initST(): STColumn[] {
return [
+ { title: '', index: 'key', type: 'checkbox' },
{ title: '企业名称', className: 'text-center', index: 'enterpriseName', width: 350 },
{ title: '网络货运人', className: 'text-center', index: 'netTranName', width: 160 },
{
@@ -180,7 +284,7 @@ export class FreightConfigComponent implements OnInit {
{
title: '合同单业务量(元)',
index: 'contractQuota',
- width: 140,
+ width: 160,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.contractQuota }) }
@@ -188,7 +292,7 @@ export class FreightConfigComponent implements OnInit {
{
title: '货源单业务量(元)',
index: 'goodsQuota',
- width: 140,
+ width: 160,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.goodsQuota }) }
@@ -197,7 +301,7 @@ export class FreightConfigComponent implements OnInit {
title: '注册时间',
index: 'createTime',
width: 180,
- className: 'text-right',
+ className: 'text-right'
},
{
title: '操作',
diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.html b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html
index bd30936e..3247d6c7 100644
--- a/src/app/routes/usercenter/components/freight/list/detail/detail.component.html
+++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html
@@ -123,6 +123,9 @@
+
四要素验证: