diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html index e1e56e16..3fe41c1e 100644 --- a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html @@ -2,7 +2,7 @@
- -

货主提现设置

+ +

{{selectedTab?.name}}

- - - - - - - - - - - + + + + + + + + + + + + + + + + + + + -- + + + + + + + + + + + + + + + + + + +
- -

路桥发票设置

-
-
- - - - - - - -

开启自动申请后,运单完成卸货后会自动根据运单信息申请ETC发票。

-
-
-
-
- - -

风险单监控

-
-
- - - - - - - - - - -

当前时间与计划时间对比,允许如上合理范围内执行不报异常,差异在范围外则报异常

-
- - - - - - - - - - -

当前时间与计划时间对比,允许如上合理范围内执行不报异常,差异在范围外则报异常

-
- - - - - - - - - - -

签收量与装运量对比,允许如上合理范围内损耗不报异常,差异在范围外则报异常

-
- - - - - - - - - - -

装货地和发货地、签收地和收货地距离对比,允许如上合理范围内执行不报异常,差异在范围外则报异常

-
-
-
-
- +
diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.less b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.less index c5cbb76e..8e398b39 100644 --- a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.less +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.less @@ -10,13 +10,18 @@ } .block-radio { - display : flex; - min-height : 32px; + display : flex; + min-height: 32px; } input { width : 100px; margin-left: 10px; } + + .ant-form-item-control-input-content { + display: flex; + } } + } \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts index fcaf3dd5..3115e98d 100644 --- a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { dateTimePickerUtil } from '@delon/util'; import { SystemService } from '../../services/system.service'; @Component({ @@ -8,102 +9,65 @@ import { SystemService } from '../../services/system.service'; styleUrls: ['./basic-setting.component.less'] }) export class BasicSettingComponent implements OnInit { - formDate: any = { - isAudit: false, - isEveryDay: false, - isEveryWeek: false - }; - tabs = [ - { - name: '货主提现设置' - }, - { - name: '司机提现设置' - }, - { - name: '路桥发票设置' - }, - { - name: '风险单监控' - } - ]; - selectedTab = 0; + tabs: any[] = []; + selectedTab: any = null; - checkOptionsOne = [ - { label: '周一', value: '周一', checked: true }, - { label: '周二', value: '周二' }, - { label: '周三', value: '周三' }, - { label: '周四', value: '周四' }, - { label: '周五', value: '周五' }, - { label: '周六', value: '周六' }, - { label: '周日', value: '周日' } - ]; - - configList: any = [ - { - configId: '1475393700370898945', - itemKey: 'goods.name.config.type.3.3', - itemType: 1, - itemValue: '{"data":false,"type":"radio","trueLable":"开启","falseLable":"关闭"}', - name: '货主是否可以设置车队长', - parentId: '0', - remark: '' - }, - { - configId: '1475393700370898945', - itemKey: 'goods.name.config.type.3.4', - itemType: 1, - itemValue: '{"data":false,"type":"radio","trueLable":"开启","falseLable":"关闭"}', - name: '货主企业四要素校验开关', - parentId: '0', - remark: '' - }, - { - configId: '1475393700370898945', - itemKey: 'goods.name.config.type.3.5', - itemType: 1, - itemValue: '{"data":false,"type":"radio","trueLable":"开启","falseLable":"关闭"}', - name: '货主提现功能开关', - parentId: '0', - remark: '' - }, - { - configId: '1475393700370898945', - itemKey: 'goods.name.config.type.3.5', - itemType: 1, - itemValue: '{"data":"","type":"input","afterLable":"%"}', - name: '货主费率配置', - parentId: '0', - remark: '' - }, - { - configId: '1475393700370898945', - itemKey: 'goods.name.config.type.3.5', - itemType: 1, - itemValue: '{"data":"5","type":"input","afterLable":"次"}', - name: '单个用户每天最大发送短信次数', - parentId: '0', - remark: '' - }, - { - configId: '1475393700370898945', - itemKey: 'goods.name.config.type.3.5', - itemType: 1, - itemValue: '{"data":true,"type":"radio","trueLable":"开启","falseLable":"关闭","isCustom":true}', - name: '合同单权限', - parentId: '0', - remark: '' - } - ]; + configList: any = []; constructor(private service: SystemService) {} ngOnInit() { - this.configList = this.configList.map((item: any) => ({ ...item, itemValue: JSON.parse(item.itemValue) })); + this.getTypeList(); } - changeType(type: number): void { + getTypeList() { + this.service.request(this.service.$api_get_config_tree, { configFullKey: 'sys.config' }).subscribe((res: Array) => { + if (res?.length > 0) { + const typeData = res.find(config => config.configFullKey === 'sys.config'); + if (typeData) { + this.tabs = typeData.children; + this.selectedTab = typeData.children[0]; + this.getConfigList(this.selectedTab.id); + } + } + }); + } + + getConfigList(id: string) { + this.service.request(this.service.$api_get_config_by_parent_id, { id }).subscribe((res: Array) => { + if (res?.length > 0) { + res = res.map(item => ({ + ...item, + remark: item.remark ? JSON.parse(item.remark) : null, + itemValue: item.itemValue ? JSON.parse(item.itemValue) : item.itemValue + })); + this.configList = res; + console.log(res); + } else { + this.configList = []; + } + }); + } + + changeType(type: any): void { this.selectedTab = type; - console.log(type); + this.getConfigList(this.selectedTab.id); + } + + saveAction() { + if (this.configList?.length < 0) { + return; + } + const params = this.configList.map((item: any) => ({ + ...item, + remark: item.remark ? JSON.stringify(item.remark) : null, + itemValue: item.itemValue ? JSON.stringify(item.itemValue) : null + })); + this.service.request(this.service.$api_update_config_batch, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改配置成功'); + this.getConfigList(this.selectedTab.id); + } + }); } } diff --git a/src/app/routes/sys-setting/services/system.service.ts b/src/app/routes/sys-setting/services/system.service.ts index 32d1f4fa..993a3c30 100644 --- a/src/app/routes/sys-setting/services/system.service.ts +++ b/src/app/routes/sys-setting/services/system.service.ts @@ -101,6 +101,8 @@ export class SystemService extends BaseService { // 根据FullKey获取系统子配置(树) public $api_get_config_tree = '/api/mdc/pbc/sysConfig/getSysConfigTreeByParentFullKey'; + // 查找系统配置项列表 + public $api_get_config_by_parent_id = '/api/mdc/pbc/sysConfigItem/findSysConfigItemBySysConfigId'; // 新增系统配置 public $api_add_config = '/api/mdc/pbc/sysConfig/save'; // 更新系统配置 @@ -115,6 +117,8 @@ export class SystemService extends BaseService { public $api_add_config_item = '/api/mdc/pbc/sysConfigItem/save'; // 更新系统配置项 public $api_update_config_item = '/api/mdc/pbc/sysConfigItem/update'; + // 批量更新系统配置项 + public $api_update_config_batch = '/api/mdc/pbc/sysConfigItem/updateBatch'; // 更新系统配置项排序 public $api_update_config_item_sort = '/api/mdc/pbc/sysConfigItem/updateSort'; // 删除系统配置项