diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html index 46b8fcef..43dd586c 100644 --- a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html @@ -1,7 +1,7 @@ + + + + +
+ +
+ +
+ + + +
+ +
+
+ + + + +
+
+
+
+ + + +
+
+ +
+
+ + +
+ 客户 + 供应商 +
+
+
+
+ + + + + + + + + + + diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.less b/src/app/routes/sys-setting/components/close-account/close-account.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.ts b/src/app/routes/sys-setting/components/close-account/close-account.component.ts new file mode 100644 index 00000000..9bba5e3d --- /dev/null +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.ts @@ -0,0 +1,249 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-close-account', + templateUrl: './close-account.component.html', + styleUrls: ['./close-account.component.less'] +}) +export class CloseAccountComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editText = ''; + formData :any; + isVisible = false; + edit = false; + editId = false; + + columns: STColumn[] = [ + { title: '结算客户名称', index: 'customerName' }, + { title: '结算客户编码', index: 'customerCode' }, + { title: '网络货运人', index: 'networkTransporterName' }, + { title: '货主名称', index: 'enterpriseName' }, + { title: '客户编码', index: 'crmCustomerCode' }, + { title: '供应商编码', index: 'crmSupplierCode' }, + { + title: '操作', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item, 2) + }, + ] + } + ]; + + selectedRows: any[] = []; + + get reqParams (){ + return { + ...this.sf?.value, + }}; + + constructor( + public service: SystemService, + private nzModalService: NzModalService, + public service2: ShipperBaseService, + ) {} + + ngOnInit(): void { + this.initSF() + this.initSFFre() + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF(){ + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + customerName: { + type: 'string', + title: '结算客户名称', + ui: { placeholder: '请输入' } + }, + customerShortName: { + type: 'string', + title: '结算客户编码', + ui: { placeholder: '请输入' } + }, + networkTransporterId: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'select', + asyncData: () => this.service2.getNetworkFreightForwarder(), + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + enterpriseName: { + type: 'string', + title: '货主名称', + ui: { placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value + } } + }, + crmSupplierCode: { + type: 'string', + title: '供应商编码', + ui: { placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value + } } + }, + } + + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + customerName: { + type: 'string', + title: '结算客户名称', + ui: { placeholder: '请输入' } + }, + customerCode: { + type: 'string', + title: '结算客户编码', + ui: { placeholder: '请输入' } + }, + networkTransporterId: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'select', + asyncData: () => this.service2.getNetworkFreightForwarder(), + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + enterpriseId: { + title: '货主', + type: 'string', + maxLength: 30, + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + onSearch: (q: any) => { + console.log(q) + if (!!q) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + } as SFSelectWidgetSchema, + }, + }, + required: ['customerName', 'customerCode', 'networkTransporterId', 'enterpriseId'] + }; +this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; +} + roleAction(value: any,item?: any) { + if(item === 1) { + this.edit = false; + this.editText = '新增'; + } else { + this.service.request(this.service.$api_settlementCustomer_get, {id: value.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.formData = res; + } + }) + this.edit = true; + this.editId = value.id; + this.editText = '编辑'; + } + this.isVisible = true; + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + handleCancel() { + this.isVisible = false + } + + handleOK() { + console.log(this.sfFre.value) + if(!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!') + return + } + const params ={ + ...this.sfFre.value + } + if(this.editId) { + params.id = this.editId + } + this.service.request(this.service.$api_settlementCustomer_save, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } else { + this.service.msgSrv.warning(res?.msg) + + } + }) + } +} diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.html b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html index f262ec00..ea55c8e2 100644 --- a/src/app/routes/sys-setting/components/network-freight/network-freight.component.html +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html @@ -1,7 +1,7 @@ +
+
-
- + + + +
+ +
+
+ + -
-
+ + + + - -
-
- -
-
- -
\ No newline at end of file + [loading]="service.http.loading" [scroll]="{ y: '370px' }" (change)="stChange($event)"> + + + + + + + + + + + + + diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts index ff673d4e..cc081c8a 100644 --- a/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { STComponent, STColumn, STChange } from '@delon/abc/st'; -import { SFComponent, SFSchema } from '@delon/form'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; import { NzModalService } from 'ng-zorro-antd/modal'; import { SystemService } from '../../services/system.service'; @@ -12,52 +12,56 @@ import { SystemService } from '../../services/system.service'; export class NetworkFreightComponent implements OnInit { @ViewChild('st', { static: true }) st!: STComponent; - @ViewChild('sf', { static: false }) - sf!: SFComponent; - - url = `/rule?_allow_anonymous=true`; - - searchSchema: SFSchema = { - properties: { - receiveName: { - type: 'string', - title: '角色名称', - ui: { placeholder: '请输入' } - } - } - }; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + formData :any; + isVisible = false; + edit = false; + editId = false; columns: STColumn[] = [ - { title: '角色名称', index: 'no' }, - { title: '角色描述', index: 'description' }, - { title: '创建人手机号', index: 'description' }, - { - title: '创建时间', - index: 'updatedAt', - type: 'date' - }, + { title: '公司名称', index: 'enterpriseName' }, + { title: '纳税人识别号', index: 'taxCode' }, + { title: '发票税率', index: 'invoiceTaxRate' }, + { title: '电子发票账号', index: 'electronicInvoiceAccount' }, + { title: 'ETC账号', index: 'etcAccount' }, + { title: '电子合同账号', index: 'electronicContractAccount' }, + { title: '开户行', index: 'bankName' }, + { title: '虚拟账户', index: 'virtualAccount' }, + { title: '附加费比例', index: 'surchargeRate', format: (item: any) => {return item.surchargeRate + '%'} }, { title: '操作', buttons: [ { - text: '编辑', - click: item => this.roleAction(item) + text: '财务设置', + click: item => this.roleAction(item, 2) }, { - text: '删除', - click: item => this.deleteAction(item) - } + text: '合同设置', + click: item => this.roleAction(item, 2) + }, ] } ]; selectedRows: any[] = []; - reqParams = { pageIndex: 1, pageSize: 10 }; + get reqParams (){ + return { + ...this.sf?.value, + }}; constructor(public service: SystemService, private nzModalService: NzModalService) {} - ngOnInit(): void {} + ngOnInit(): void { + this.initSF() + this.initSFFre() + } stChange(e: STChange): void { switch (e.type) { @@ -69,17 +73,83 @@ export class NetworkFreightComponent implements OnInit { break; } } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF(){ + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + enterpriseName: { + type: 'string', + title: '公司名称', + ui: { placeholder: '请输入' } + }, + taxCode: { + type: 'string', + title: '纳税人识别号', + ui: { placeholder: '请输入' } + }, + } + + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + enterpriseName: { + type: 'string', + title: '公司名称', + ui: { placeholder: '请输入' } + }, + taxCode: { + type: 'string', + title: '纳税人识别号', + ui: { placeholder: '请输入' } + }, + customerCode: { + type: 'string', + title: '税收分类编码', + ui: { placeholder: '请输入' } + }, + invoiceTaxRate: { + type: 'string', + title: '发票税率', + ui: { placeholder: '请输入' } + }, + surchargeRate: { + type: 'string', + title: '附加费比例', + ui: { placeholder: '请输入' } + }, + + }, + required: ['enterpriseName', 'taxCode', 'customerType', 'invoiceTaxRate', 'surchargeRate'] + }; +this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; +} + roleAction(value: any,item?: any) { - roleAction(item?: any) { - const modal = this.nzModalService.create({ - // nzContent: SettingRoleEditComponent, - nzWidth: 900, - nzComponentParams: item ? { i: { ...item } } : { i: { id: 0 } }, - nzFooter: null - }); - modal.afterClose.subscribe(res => { - this.st.load(); - }); + this.service.request(this.service.$api_get_crmCustomer, {id: value.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.formData = res; + } + }) + this.edit = true; + this.editId = value.id; + this.isVisible = true; } deleteAction(item?: any) { @@ -97,4 +167,31 @@ export class NetworkFreightComponent implements OnInit { resetSF() { this.sf.reset(); } + handleCancel() { + this.isVisible = false + } + + handleOK() { + console.log(this.sfFre.value) + if(!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!') + return + } + const params ={ + ...this.sfFre.value + } + if(this.editId) { + params.id = this.editId + } + this.service.request(this.service.$api_save_crmCustomer, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } else { + this.service.msgSrv.warning(res?.msg) + + } + }) + } } diff --git a/src/app/routes/sys-setting/services/system.service.ts b/src/app/routes/sys-setting/services/system.service.ts index 6b033ae5..10f1fd65 100644 --- a/src/app/routes/sys-setting/services/system.service.ts +++ b/src/app/routes/sys-setting/services/system.service.ts @@ -1,8 +1,8 @@ /* * @Author: your name * @Date: 2021-12-20 17:18:43 - * @LastEditTime: 2021-12-27 09:30:39 - * @LastEditors: your name + * @LastEditTime: 2021-12-27 14:09:14 + * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: \tms-obc-web\src\app\routes\sys-setting\services\system.service.ts */ @@ -55,6 +55,31 @@ export class SystemService extends BaseService { // 获取某个应用的所有菜单 $api_getAllFunctionInfoByAppId: string = '/api/mdc/cuc/functionInfo/getAllFunctionInfoByAppId'; + + // 查询网络货运信息表 + $api_networkTransporter_page = '/api/mdc/networkTransporter/list/page'; + // 获取网络货运信息表(id) + $api_get_networkTransporter = '/api/mdc/networkTransporter/get'; + // 批量获取网络货运信息 + $api_findNetworkTransporterByIds = '/api/mdc/networkTransporter/findNetworkTransporterByIds'; + // 查找所有网络货运信息(下拉) + $api_networkTransporter_findAll = '/api/mdc/networkTransporter/findAll'; + // 删除网络货运信息表 + $api_networkTransporter_deletebatch = '/api/mdc/networkTransporter/deletebatch'; + // 保存网络货运信息表 + $api_networkTransporter_save = '/api/mdc/networkTransporter/save'; + + // 查询结算客户表 + $api_settlementCustomer_page = '/api/mdc/settlementCustomer/list/page'; + // 获取结算客户表 + $api_settlementCustomer_get = '/api/mdc/settlementCustomer/get'; + // 保存结算客户表 + $api_settlementCustomer_save = '/api/mdc/settlementCustomer/save'; + // 删除结算客户表 + $api_settlementCustomer_deletebatch = '/api/mdc/settlementCustomer/deletebatch'; + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + $api_getRoleTemplateInfo: string = ''; $api_getFunctionButtonInfo: string = ''; $api_getFunctionDataInfo: string = ''; diff --git a/src/app/routes/sys-setting/sys-setting-routing.module.ts b/src/app/routes/sys-setting/sys-setting-routing.module.ts index 79edd1a9..6faf0bba 100644 --- a/src/app/routes/sys-setting/sys-setting-routing.module.ts +++ b/src/app/routes/sys-setting/sys-setting-routing.module.ts @@ -1,8 +1,8 @@ /* * @Author: your name * @Date: 2021-12-03 15:23:05 - * @LastEditTime: 2021-12-24 15:57:37 - * @LastEditors: your name + * @LastEditTime: 2021-12-27 11:11:12 + * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: \tms-obc-web\src\app\routes\sys-setting\sys-setting-routing.module.ts */ @@ -13,6 +13,7 @@ import { AuditReasonConfigComponent } from './components/audit-reason-config/aud import { BasicConfigComponent } from './components/basic-config/basic-config.component'; import { BasicSettingComponent } from './components/basic-setting/basic-setting.component'; import { CartConfigComponent } from './components/cart-config/cart-config.component'; +import { CloseAccountComponent } from './components/close-account/close-account.component'; import { CrmManagementComponent } from './components/crm-management/crm-management.component'; import { GoodsNameConfigComponent } from './components/goods-name-config/goods-name-config.component'; import { NetworkFreightComponent } from './components/network-freight/network-freight.component'; @@ -38,6 +39,7 @@ const routes: Routes = [ { path: 'goods-name-config', component: GoodsNameConfigComponent }, { path: 'crm-management', component: CrmManagementComponent }, { path: 'network-freight', component: NetworkFreightComponent }, + { path: 'close-account', component: CloseAccountComponent }, ]; @NgModule({ diff --git a/src/app/routes/sys-setting/sys-setting.module.ts b/src/app/routes/sys-setting/sys-setting.module.ts index df0ce016..281188d1 100644 --- a/src/app/routes/sys-setting/sys-setting.module.ts +++ b/src/app/routes/sys-setting/sys-setting.module.ts @@ -23,6 +23,7 @@ import { SettingMenuComponent } from './components/role-management/menu/menu.com import { GoodsNameConfigComponent } from './components/goods-name-config/goods-name-config.component'; import { CrmManagementComponent } from './components/crm-management/crm-management.component'; import { NetworkFreightComponent } from './components/network-freight/network-freight.component'; +import { CloseAccountComponent } from './components/close-account/close-account.component'; const COMPONENTS = [ StaffManagementComponent, @@ -38,7 +39,8 @@ const COMPONENTS = [ SystemConfigComponent, GoodsNameConfigComponent, CrmManagementComponent, - NetworkFreightComponent + NetworkFreightComponent, + CloseAccountComponent ]; const NOTROUTECOMPONENTS = [ BuyerTranspowerComponent, diff --git a/src/app/shared/services/business/shipper-base.service.ts b/src/app/shared/services/business/shipper-base.service.ts index 4817a318..1084f725 100644 --- a/src/app/shared/services/business/shipper-base.service.ts +++ b/src/app/shared/services/business/shipper-base.service.ts @@ -9,7 +9,7 @@ export class ShipperBaseService extends BaseService { $api_get_carless_carrier = ``; // 获取承运人 $api_get_enterprise_project = `/api/mdc/cuc/enterpriseProject/getEnterpriseProjectList `; // 所属项目列表 $api_get_staff_list = `/api/mdc/cuc/userApp/getStaffList`; //查询企业项目员工列表(录单员) - $api_get_network_freight_forwarder = ``; // 获取网络货运人 + $api_get_network_freight_forwarder = `/api/mdc/networkTransporter/findAll`; // 获取网络货运人 constructor(public injector: Injector) { @@ -92,8 +92,8 @@ export class ShipperBaseService extends BaseService { } const list = res.map(((item: any) => { return { - label: item.name, - value: item.userId + label: item.enterpriseName, + value: item.id } })) const obj = [{ value: '', label: '全部' }]; diff --git a/src/assets/images/usercenter/彩色-箭头-向右-1.png b/src/assets/images/usercenter/彩色-箭头-向右-1.png new file mode 100644 index 00000000..885163b1 Binary files /dev/null and b/src/assets/images/usercenter/彩色-箭头-向右-1.png differ diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index 5b7ce168..f48b0a8c 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -409,6 +409,10 @@ "text": "CRM客户管理", "link": "/system/crm-management" }, + { + "text": "结算客户管理", + "link": "/system/close-account" + }, { "text": "网络货运人", "link": "/system/network-freight"