From 2dbcbb6fac08599038478832176fec04c03bea2f Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 17 Feb 2022 19:59:20 +0800 Subject: [PATCH] edit --- proxy.conf.js | 2 +- .../freight-config.component.html | 23 ++++ .../freight-config.component.ts | 129 ++++++++++++++++++ .../freight/list/new/new.component.html | 5 +- .../usercenter/services/usercenter.service.ts | 3 + .../usercenter/usercenter-routing.module.ts | 5 + .../routes/usercenter/usercenter.module.ts | 4 +- .../dynamic-setting-h5.component.ts | 7 - 8 files changed, 167 insertions(+), 11 deletions(-) create mode 100644 src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html create mode 100644 src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts diff --git a/proxy.conf.js b/proxy.conf.js index 31995def..822b7622 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -20,7 +20,7 @@ module.exports = { // } '//api': { target: { - host: 'tms-api-test.eascs.com', + host: 'tms-api-dev.eascs.com', protocol: 'https:', port: 443 }, diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html new file mode 100644 index 00000000..86543345 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html @@ -0,0 +1,23 @@ + + + +
+
+ +
+
+ + + +
+
+
+ + + + + \ 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 new file mode 100644 index 00000000..c79373fa --- /dev/null +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts @@ -0,0 +1,129 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent, STRequestOptions, STData } from '@delon/abc/st'; +import { SFUISchema, SFSchema, SFComponent } from '@delon/form'; +import { ShipperBaseService, DynamicSettingModalComponent } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; +import { UsermanageService } from '../../../services/usercenter.service'; + +@Component({ + selector: 'app-freight-config', + templateUrl: './freight-config.component.html', + styleUrls: ['../../../../commom/less/box.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; + + constructor(public service: UsermanageService, private modal: NzModalService, public shipperservice: ShipperBaseService) {} + + ngOnInit() { + this.initST(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { listSource: 1 }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + settingAction(item?: any) { + this.modal.create({ + nzTitle: '配置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '2', + businessId: item.id + }, + nzFooter: null + }); + } + + exportList() { + const params = {}; + if (this.sf) { + Object.assign(params, { + ...this.sf.value + }); + } + this.service.downloadFile(this.service.$api_export_enterprise, params); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.reload(); + } + + private initSF(): SFSchema { + return { + properties: { + enterpriseName: { + title: '企业名称', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false + } + }, + networkTransporter: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + } + } + }; + } + + initST(): STColumn[] { + return [ + // { title: '', type: 'checkbox', className: 'text-center' }, + { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, + { title: '网络货运人', className: 'text-center', index: 'netTranName' }, + { title: '合同单费率', className: 'text-center', index: 'contractSurchargeRatio' }, + { title: '货源单费率', className: 'text-center', index: 'goodsSurchargeRatio' }, + { + title: '合同单业务量(元)', + index: 'contractQuota', + width: 100, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.contractQuota }) } + }, + { + title: '货源单业务量(元)', + index: 'goodsQuota', + width: 100, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.goodsQuota }) } + }, + { + title: '操作', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '配置', + click: item => this.settingAction(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/usercenter/components/freight/list/new/new.component.html b/src/app/routes/usercenter/components/freight/list/new/new.component.html index 919fb92d..ccc6cf71 100644 --- a/src/app/routes/usercenter/components/freight/list/new/new.component.html +++ b/src/app/routes/usercenter/components/freight/list/new/new.component.html @@ -52,7 +52,7 @@ -
+
请上传该企业授权您成为本系统企业管理员的文件的高清照片,需加盖公司印章
上传后系统会自动识别并填写
@@ -88,7 +88,8 @@
- +
\ No newline at end of file diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index 422cb328..fd6d7fda 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -33,6 +33,9 @@ export class UsermanageService extends ShipperBaseService { // 企业审核 $api_audit_freight = '/api/mdc/cuc/enterpriseInfo/operate/audit'; + // 查询货主配置列表 + $api_freight_config_page = '/api/mdc/cuc/enterpriseInfo/operate/list/configPage'; + // 货主员工列表(运营后台) $api_get_user_list = '/api/mdc/cuc/userApp/getShipperUserList'; // 冻结或恢复员工 diff --git a/src/app/routes/usercenter/usercenter-routing.module.ts b/src/app/routes/usercenter/usercenter-routing.module.ts index 79362b3e..9780fd51 100644 --- a/src/app/routes/usercenter/usercenter-routing.module.ts +++ b/src/app/routes/usercenter/usercenter-routing.module.ts @@ -14,6 +14,7 @@ import { UserCenterComponentsDriverDetailComponent } from './components/driver/d import { UserCenterComponentsDriverComponent } from './components/driver/driver.component'; import { FreightComponentsEnterpriseAuditComponent } from './components/freight/enterprise-audit/enterprise-audit.component'; import { FreightComponentsEnterpriseAuditViewComponent } from './components/freight/enterprise-audit/view/view.component'; +import { FreightConfigComponent } from './components/freight/freight-config/freight-config.component'; import { FreightComponentsListDetailComponent } from './components/freight/list/detail/detail.component'; import { FreightComponentsListComponent } from './components/freight/list/list.component'; @@ -41,6 +42,10 @@ const routes: Routes = [ component: FreightComponentsEnterpriseAuditComponent, data: { guard: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-list', 'USERCENTER-FREIGHT-ENTERPRISE-adminList'] } } }, + { + path: 'freight/config', + component: FreightConfigComponent, + }, { path: 'freight/user', component: FreightComponentsUserComponent, data: { guard: { ability: ['USERCENTER-FREIGHT-USER-list'] } } }, { path: 'freight/user/view/:id', diff --git a/src/app/routes/usercenter/usercenter.module.ts b/src/app/routes/usercenter/usercenter.module.ts index b79e4650..dcfb7d1e 100644 --- a/src/app/routes/usercenter/usercenter.module.ts +++ b/src/app/routes/usercenter/usercenter.module.ts @@ -24,6 +24,7 @@ import { AuditAdminComponent } from './components/freight/enterprise-audit/audit import { CaptainDetailComponent } from './components/driver/captain/captain-detail/captain-detail.component'; import { CarSettleAddDriverComponent } from './components/driver/add-driver/add-driver.component'; import { CtcCaptatinAddComponent } from './components/driver/captain/add/add.component'; +import { FreightConfigComponent } from './components/freight/freight-config/freight-config.component'; const COMPONENTS = [ FreightComponentsListComponent, @@ -40,7 +41,8 @@ const COMPONENTS = [ CaptainDetailComponent, AuditAdminComponent, CarSettleAddDriverComponent, - CtcCaptatinAddComponent + CtcCaptatinAddComponent, + FreightConfigComponent ]; @NgModule({ diff --git a/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts b/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts index 02f85d91..bf0ace43 100644 --- a/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts +++ b/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts @@ -10,7 +10,6 @@ */ import { Component, OnInit, EventEmitter, Input, Output } from '@angular/core'; import { BaseService } from '@shared'; -import { NzUploadChangeParam } from 'ng-zorro-antd/upload'; const JSONTYPE = new Set([5, 6, 9]); @Component({ @@ -41,13 +40,10 @@ export class DynamicSettingH5Component implements OnInit { constructor(public service: BaseService) {} ngOnInit() { - console.log(this.tabs); } changeType(type: any): void { this.selectedTab = type; - console.log(type); - this.selectedEvent.emit(this.selectedTab); } @@ -55,10 +51,8 @@ export class DynamicSettingH5Component implements OnInit { if (this.configList?.length < 0) { return; } - console.log(this.configList); let params = [...this.configList]; params = params.map((item: any) => { - console.log(item); if (item.itemType == 9) { const files = item.itemValue?.map(({ response, name }: any) => ({ url:response?.data?.fullFilePath, name })); return { @@ -77,7 +71,6 @@ export class DynamicSettingH5Component implements OnInit { itemData: item.itemData ? JSON.stringify(item.itemData) : null }; }); - console.log(params); this.saveEvent.emit(params); } }