Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2022-02-21 20:43:30 +08:00
16 changed files with 500 additions and 298 deletions

View File

@ -0,0 +1,50 @@
<page-header-wrapper [title]="'退款记录'">
</page-header-wrapper>
<nz-card class="search-box" nzBordered>
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 90,grid: { lg: 8, md: 12, sm: 12, xs: 24,gutter:15 } }}" [compact]="true"
[button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" [class.expend-options]="_$expand"
class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button> 导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card>
<nz-card class="content-box" nzBordered>
<nz-tabset>
<nz-tab nzTitle="全部" (nzClick)="changeRefundStatus()"></nz-tab>
<nz-tab nzTitle="待审核" (nzClick)="changeRefundStatus('1')"></nz-tab>
<nz-tab nzTitle="退款中" (nzClick)="changeRefundStatus('2')"></nz-tab>
<nz-tab nzTitle="退款成功" (nzClick)="changeRefundStatus('3')"></nz-tab>
<nz-tab nzTitle="退款失败" (nzClick)="changeRefundStatus('5')"></nz-tab>
</nz-tabset>
<st #st [data]="service.$api_get_refund_record_page" [columns]="columns" [req]="{ process: beforeReq }"
[loading]="service.http.loading" [scroll]="{ x:'1200px' }">
<ng-template st-row="bankCardNumber" let-item let-index="index" let-column="column">
{{ item.bankName }} <br> {{ item.bankCardNumber }}
</ng-template>
</st>
</nz-card>
<ng-template #auditModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80">
<se [col]="1" label="备注">
<textarea nz-input rows="3" [(ngModel)]="msg" placeholder="通过可以不用填写原因 ,拒绝必须说明原因"
style="width: 325px;margin-left: 14px;"></textarea>
</se>
</div>
</div>
</ng-template>

View File

@ -0,0 +1,292 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { FreightAccountService } from '../../services/freight-account.service';
@Component({
selector: 'app-refund-record',
templateUrl: './refund-record.component.html',
styleUrls: ['../../../commom/less/box.less']
})
export class RefundRecordComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
@ViewChild('auditModal', { static: false })
auditModal!: any;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
_$expand = false;
refundStatus: any = '';
msg = '';
constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {}
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { refundStatus: this.refundStatus || null });
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value,
createTime: {
start: this.sf.value.createTime?.[0] || '',
end: this.sf.value.createTime?.[1] || ''
}
});
}
return requestOptions;
};
changeRefundStatus(status?: string) {
this.refundStatus = status || null;
this.st.load(1);
}
auditAction(item?: any) {
this.msg = '';
const modal = this.nzModalService.create({
nzTitle: '审核',
nzContent: this.auditModal,
nzFooter: [
{
label: '拒绝',
type: 'default',
onClick: () => {
this.service
.request(this.service.$api_disagree_refund_record, {
applicationId: item.id,
remark: this.msg
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success('审核拒绝成功');
modal.destroy(true);
this.st.load(1);
}
});
return false;
}
},
{
label: '通过',
type: 'primary',
onClick: () => {
this.service
.request(this.service.$api_agree_refund_record, {
applicationId: item.id,
remark: this.msg
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success('审核通过成功');
modal.destroy(true);
this.st.load(1);
}
});
return false;
}
}
]
});
}
reApply(item: any) {
const modal = this.nzModalService.warning({
nzTitle: '确定要重新发起退款?',
nzOnOk: () => {
this.service
.request(this.service.$api_rebulid_refund_record, {
applicationId: item.id
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success('发起成功');
modal.destroy(true);
this.st.load(1);
}
});
return false;
}
});
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
private initSF(): SFSchema {
return {
properties: {
expand: {
type: 'boolean',
ui: {
hidden: true
}
},
orderRefundCode: {
type: 'string',
title: '退款单号',
ui: {
placeholder: '请输入'
}
},
refundType: {
type: 'string',
title: '退款类型',
enum: [
{ value: '1', label: '平台退款货主' },
{ value: '2', label: '司机退款平' },
{ value: '3', label: '车队长退款司机' },
{ value: '4', label: '车队长退款平台' }
],
ui: {
widget: 'select',
placeholder: '请选择'
}
},
shipperId: {
type: 'string',
title: '货主',
ui: {
placeholder: '请输入'
}
},
billCode: {
type: 'string',
title: '订单号',
ui: {
visibleIf: {
expand: (value: boolean) => value
},
placeholder: '请输入'
}
},
enterpriseProjectId: {
type: 'string',
title: '所属项目',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getEnterpriseProject(),
visibleIf: {
expand: (value: boolean) => value
}
}
},
resourceId: {
type: 'string',
title: '货源号',
ui: {
visibleIf: {
expand: (value: boolean) => value
},
placeholder: '请输入'
}
},
refundExecuteTime: {
title: '退款时间',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
},
nzShowTime: true
} as SFDateWidgetSchema
},
ltdid: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getNetworkFreightForwarder(),
visibleIf: {
expand: (value: boolean) => value
}
}
},
bankType: {
type: 'string',
title: '银行类型',
ui: {
widget: 'dict-select',
params: { dictKey: 'bankname:type' },
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
}
}
};
}
private initST(): STColumn[] {
return [
{ title: '退款单号', index: 'orderRefundCode', width: 180 },
{ title: '退款类型', index: 'refundType', width: 120 },
{
title: '退款金额',
render: 'refundAmount',
width: 120,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.refundAmount }) }
},
{ title: '退款时间', index: 'applyTime', width: 100 },
{ title: '货主', index: 'shipperId', width: 100 },
{ title: '所属项目', index: 'enterpriseProjectName', width: 140 },
{ title: '支付单', index: 'billRefundPaymentVOS.paymentApplicationCode', width: 100 },
{ title: '订单号', index: 'billCode', width: 100 },
{ title: '货源号', index: 'resourceCode', width: 100 },
{ title: '司机', render: ' driver', width: 100 },
{ title: '收款人', render: 'captain', width: 100 },
{ title: '网络货运人', render: 'ltdName', width: 180 },
{ title: '银行类型', index: 'bankTypeLabel', width: 100 },
{ title: '退款原因', index: 'rejectionCause', width: 150 },
{ title: '失败原因', index: 'failCause', width: 150 },
{
title: '操作',
fixed: 'right',
width: '110px',
buttons: [
{
text: '审核',
iif: item => item.refundStatus === '1',
click: item => this.auditAction(item)
},
{
text: '重新发起',
click: item => this.reApply(item)
}
// {
// text: '关闭',
// click: item => this.router.navigate(['/financial-management/withdrawals-record/detail/' + item.id])
// }
]
}
];
}
}

View File

@ -1,41 +0,0 @@
:host::ng-deep {
.search-box {
.ant-card-body {
padding-bottom: 18px;
}
}
.content-box {
.ant-card-body {
padding-top: 0;
}
}
nz-range-picker {
width: 100%;
}
.ant-tabs-tab-btn {
padding-right: 16px;
padding-left : 16px;
}
.text-truncate {
white-space: normal;
}
}
.expend-options {
margin-top: 0;
}
@media (min-width: 1200px) {
.expend-options {
position : absolute;
right : 0;
bottom : 25px;
max-width: 400px;
}
}

View File

@ -8,7 +8,7 @@ import { FreightAccountService } from '../../services/freight-account.service';
@Component({ @Component({
selector: 'app-withdrawals-record', selector: 'app-withdrawals-record',
templateUrl: './withdrawals-record.component.html', templateUrl: './withdrawals-record.component.html',
styleUrls: ['./withdrawals-record.component.less'] styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less']
}) })
export class WithdrawalsRecordComponent implements OnInit { export class WithdrawalsRecordComponent implements OnInit {
@ViewChild('st', { static: true }) @ViewChild('st', { static: true })

View File

@ -31,6 +31,7 @@ import { PlatformAccountComponent } from './components/platform-account/platform
import { PlatformAccountDetailComponent } from './components/platform-account/platform-account-detail/platform-account-detail.component'; import { PlatformAccountDetailComponent } from './components/platform-account/platform-account-detail/platform-account-detail.component';
import { AdvanceCollectionComponent } from './components/advance-collection/advance-collection.component'; import { AdvanceCollectionComponent } from './components/advance-collection/advance-collection.component';
import { AdvanceCollectionDetailComponent } from './components/advance-collection/advance-collection-detail/advance-collection-detail.component'; import { AdvanceCollectionDetailComponent } from './components/advance-collection/advance-collection-detail/advance-collection-detail.component';
import { RefundRecordComponent } from './components/refund-record/refund-record.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'freight-account', component: FreightAccountComponent, data: { guard: { ability: ['FINANCIAL-FREIGHT-ACOUNT-list'] } } }, { path: 'freight-account', component: FreightAccountComponent, data: { guard: { ability: ['FINANCIAL-FREIGHT-ACOUNT-list'] } } },
@ -42,6 +43,7 @@ const routes: Routes = [
{ path: 'recharge-record', component: RechargeRecordComponent }, { path: 'recharge-record', component: RechargeRecordComponent },
{ path: 'withdrawals-record', component: WithdrawalsRecordComponent }, { path: 'withdrawals-record', component: WithdrawalsRecordComponent },
{ path: 'withdrawals-record/detail/:id', component: WithdrawalsDetailComponent }, { path: 'withdrawals-record/detail/:id', component: WithdrawalsDetailComponent },
{ path: 'refund-record', component: RefundRecordComponent },
{ path: 'voucher-management', component: VoucherManagementComponent }, { path: 'voucher-management', component: VoucherManagementComponent },
{ path: 'voucher-management/detail/:id', component: VoucherDetailComponent }, { path: 'voucher-management/detail/:id', component: VoucherDetailComponent },
{ path: 'voucher-summary', component: VoucherSummaryComponent }, { path: 'voucher-summary', component: VoucherSummaryComponent },

View File

@ -34,6 +34,7 @@ import { PlatformAccountComponent } from './components/platform-account/platform
import { PlatformAccountDetailComponent } from './components/platform-account/platform-account-detail/platform-account-detail.component'; import { PlatformAccountDetailComponent } from './components/platform-account/platform-account-detail/platform-account-detail.component';
import { AdvanceCollectionComponent } from './components/advance-collection/advance-collection.component'; import { AdvanceCollectionComponent } from './components/advance-collection/advance-collection.component';
import { AdvanceCollectionDetailComponent } from './components/advance-collection/advance-collection-detail/advance-collection-detail.component'; import { AdvanceCollectionDetailComponent } from './components/advance-collection/advance-collection-detail/advance-collection-detail.component';
import { RefundRecordComponent } from './components/refund-record/refund-record.component';
const ROUTESCOMPONENTS = [ const ROUTESCOMPONENTS = [
FreightAccountComponent, FreightAccountComponent,
@ -64,7 +65,8 @@ const ROUTESCOMPONENTS = [
VoucherListComponent, VoucherListComponent,
ReceiptOrderDetailComponent, ReceiptOrderDetailComponent,
AdvanceCollectionComponent, AdvanceCollectionComponent,
AdvanceCollectionDetailComponent AdvanceCollectionDetailComponent,
RefundRecordComponent
]; ];
const NOTROUTECOMPONENTS = [DriverAccountDetailComponent, FreightAccountDetailComponent, ClearingModalComponent]; const NOTROUTECOMPONENTS = [DriverAccountDetailComponent, FreightAccountDetailComponent, ClearingModalComponent];

View File

@ -53,6 +53,15 @@ export class FreightAccountService extends ShipperBaseService {
// 拒绝提现 // 拒绝提现
$api_disagree_refund = '/api/fcc/refundApplicationOBC/disagreeRefund'; $api_disagree_refund = '/api/fcc/refundApplicationOBC/disagreeRefund';
// 查询订单退款申请表
$api_get_refund_record_page = '/api/fcc/billRefundApplication/list/page';
// 同意退款
$api_agree_refund_record= '/api/fcc/billRefundApplication/agreeRefund';
// 不同意退款
$api_disagree_refund_record = '/api/fcc/billRefundApplication/disagreeRefund';
// 重新发起
$api_rebulid_refund_record = '/api/fcc/billRefundApplication/rebulid';
// 查询充值信息表 // 查询充值信息表
$api_get_recharge_page = '/api/fcc/rechargeInfo/list/getPageByOperator'; $api_get_recharge_page = '/api/fcc/rechargeInfo/list/getPageByOperator';
// 查询异常入金 // 查询异常入金

View File

@ -35,7 +35,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
isVisible = false; isVisible = false;
freightSchema: SFSchema = {}; freightSchema: SFSchema = {};
auditMany = false; auditMany = false;
resourceStatus: any; resourceStatus: any;
auditID: any; auditID: any;
constructor( constructor(
@ -63,10 +63,9 @@ export class SupplyManagementVehicleComponent implements OnInit {
}; };
} }
afterRes = (data: any[], rawData?: any) => { afterRes = (data: any[], rawData?: any) => {
console.log(data)
return data.map(item => ({ return data.map(item => ({
...item, ...item,
disabled: item.auditStatus !== '1' disabled: item.auditStatus !== '1'
})); }));
}; };
get selectedRows() { get selectedRows() {
@ -89,7 +88,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
maxLength: 50, maxLength: 50,
ui: { ui: {
placeholder: '请输入备注', placeholder: '请输入备注',
widget: 'textarea', widget: 'textarea'
} }
} }
}, },
@ -105,7 +104,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
search() { search() {
this.st?.load(1); this.st?.load(1);
this.getGoodsSourceStatistical() this.getGoodsSourceStatistical();
} }
/** /**
* 伸缩查询条件 * 伸缩查询条件
@ -198,9 +197,9 @@ export class SupplyManagementVehicleComponent implements OnInit {
console.log(value); console.log(value);
console.log(status); console.log(status);
if (status === 2) { if (status === 2) {
if(this.selectedRows.length <= 0) { if (this.selectedRows.length <= 0) {
this.service.msgSrv.error('未选择货源单!'); this.service.msgSrv.error('未选择货源单!');
return return;
} }
let list: any[] = []; let list: any[] = [];
this.selectedRows.forEach(item => { this.selectedRows.forEach(item => {
@ -209,7 +208,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
this.auditID = list; this.auditID = list;
this.auditMany = true; this.auditMany = true;
} else { } else {
this.auditID = value.id this.auditID = value.id;
this.auditMany = false; this.auditMany = false;
} }
this.isVisible = true; this.isVisible = true;
@ -224,19 +223,19 @@ export class SupplyManagementVehicleComponent implements OnInit {
* 审核通过按钮 * 审核通过按钮
*/ */
handleOK(value: any) { handleOK(value: any) {
console.log(this.sfFre.valid) console.log(this.sfFre.valid);
console.log(this.sfFre.value) console.log(this.sfFre.value);
if(this.selectedRows.length <= 0) { if (this.selectedRows.length <= 0) {
const params: any = { const params: any = {
id: this.auditID, id: this.auditID,
remarks: this.sfFre.value.remarks, remarks: this.sfFre.value.remarks
} };
if(value == 1) { if (value == 1) {
params.auditStatus = 2 params.auditStatus = 2;
} else { } else {
params.auditStatus = 3 params.auditStatus = 3;
} }
console.log(params) console.log(params);
this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => {
if (res === true) { if (res === true) {
this.service.msgSrv.success('审核成功!'); this.service.msgSrv.success('审核成功!');
@ -244,18 +243,18 @@ export class SupplyManagementVehicleComponent implements OnInit {
this.st?.reload(); this.st?.reload();
this.getGoodsSourceStatistical(); this.getGoodsSourceStatistical();
} }
}) });
} else { } else {
const params: any = { const params: any = {
ids: this.auditID, ids: this.auditID,
remarks: this.sfFre.value.remarks, remarks: this.sfFre.value.remarks
} };
if(value == 1) { if (value == 1) {
params.auditStatus = 2 params.auditStatus = 2;
} else { } else {
params.auditStatus = 3 params.auditStatus = 3;
} }
console.log(params) console.log(params);
this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => { this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => {
if (res === true) { if (res === true) {
this.service.msgSrv.success('审核成功!'); this.service.msgSrv.success('审核成功!');
@ -263,9 +262,8 @@ export class SupplyManagementVehicleComponent implements OnInit {
this.st?.reload(); this.st?.reload();
this.getGoodsSourceStatistical(); this.getGoodsSourceStatistical();
} }
}) });
} }
} }
/** /**
* 跳转修改货源 * 跳转修改货源
@ -317,7 +315,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
stayQuantity: 0 stayQuantity: 0
}; };
const params: any = Object.assign({}, this.reqParams || {}); const params: any = Object.assign({}, this.reqParams || {});
delete params.resourceStatus delete params.resourceStatus;
this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 1, ...params }).subscribe(res => { this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 1, ...params }).subscribe(res => {
if (res) { if (res) {
console.log(res); console.log(res);
@ -396,7 +394,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
placeholder: '请选择', placeholder: '请选择',
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value _$expand: (value: boolean) => value
}, }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
serviceType: { serviceType: {
@ -422,8 +420,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
params: { dictKey: 'goodresource:audit:status' }, params: { dictKey: 'goodresource:audit:status' },
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value _$expand: (value: boolean) => value
}, }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
enterpriseInfoId: { enterpriseInfoId: {
@ -442,33 +439,33 @@ export class SupplyManagementVehicleComponent implements OnInit {
} }
}; };
} }
// 获取城市列表 // 获取城市列表
getRegionCode(regionCode: any) { getRegionCode(regionCode: any) {
console.log(regionCode); console.log(regionCode);
return this.service return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode }) .request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe( .pipe(
map(res => map(res =>
res.map((item: any) => ({ res.map((item: any) => ({
label: item.projectName, label: item.projectName,
value: item.id value: item.id
})) }))
)
) )
) .subscribe(res => {
.subscribe(res => { this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); // if (this.enterpriseProjectIds) {
// if (this.enterpriseProjectIds) { // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
// this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); // }
// } });
}); }
}
/** /**
* 初始化数据列表 * 初始化数据列表
*/ */
private initST(): STColumn[] { private initST(): STColumn[] {
return [ return [
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
{ {
title: '货源编号', title: '货源编号',
width: '180px', width: '180px',
@ -476,11 +473,12 @@ export class SupplyManagementVehicleComponent implements OnInit {
className: 'text-left', className: 'text-left',
render: 'resourceCode' render: 'resourceCode'
}, },
{ {
title: '货主', title: '货主',
index: 'shipperAppUserName', index: 'shipperAppUserName',
width: '180px', width: '180px',
className: 'text-left' }, className: 'text-left'
},
{ {
title: '项目名称', title: '项目名称',
index: 'enterpriseProjectName', index: 'enterpriseProjectName',
@ -542,7 +540,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
title: '货源状态', title: '货源状态',
className: 'text-left', className: 'text-left',
index: 'resourceStatusLabel', index: 'resourceStatusLabel',
width: '120px', width: '120px'
}, },
{ {
title: '创建时间', title: '创建时间',
@ -574,13 +572,13 @@ export class SupplyManagementVehicleComponent implements OnInit {
text: '货源审核', text: '货源审核',
click: _record => this.audit(_record, 1), click: _record => this.audit(_record, 1),
iif: item => item.auditStatus === '1', iif: item => item.auditStatus === '1',
acl: { ability: ['SUPPLY-INDEX-vehicleBatchAudit'] }, acl: { ability: ['SUPPLY-INDEX-vehicleBatchAudit'] }
}, },
{ {
text: '修改货源', text: '修改货源',
click: _record => this.amend(_record), click: _record => this.amend(_record),
iif: item => item.resourceStatus === '1', iif: item => item.resourceStatus === '1',
acl: { ability: ['SUPPLY-INDEX-vehicleModificationSupply'] }, acl: { ability: ['SUPPLY-INDEX-vehicleModificationSupply'] }
}, },
// { // {
// text: '修改运费', // text: '修改运费',
@ -591,18 +589,18 @@ export class SupplyManagementVehicleComponent implements OnInit {
text: '取消货源', text: '取消货源',
click: _record => this.cancleGoodsSource(_record), click: _record => this.cancleGoodsSource(_record),
iif: item => item.resourceStatus === '1', iif: item => item.resourceStatus === '1',
acl: { ability: ['SUPPLY-INDEX-vehicleCancelSupply'] }, acl: { ability: ['SUPPLY-INDEX-vehicleCancelSupply'] }
}, },
{ {
text: '再下一单', text: '再下一单',
click: _record => this.nextOrder(_record), click: _record => this.nextOrder(_record),
acl: { ability: ['SUPPLY-INDEX-vehiclePlaceOrder'] }, acl: { ability: ['SUPPLY-INDEX-vehiclePlaceOrder'] }
}, },
{ {
text: '重新指派 ', text: '重新指派 ',
click: _record => this.assignedCar(_record), click: _record => this.assignedCar(_record),
iif: item => item.resourceStatus === '1' && item.serviceType === '2', iif: item => item.resourceStatus === '1' && item.serviceType === '2',
acl: { ability: ['SUPPLY-INDEX-vehicleReassign'] }, acl: { ability: ['SUPPLY-INDEX-vehicleReassign'] }
} }
] ]
} }

View File

@ -1,166 +0,0 @@
<nz-card>
<div nz-row [nzGutter]="8">
<div nz-col nzSpan="4">
<ul nz-menu nzMode="inline" class="card-height">
<li nz-menu-item [nzSelected]="idx === 0" (click)="changeType(idx)"
*ngFor="let item of tabs; let idx = index">
{{ item.name }}
</li>
</ul>
</div>
<div nz-col nzSpan="20" style="overflow: scroll">
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab===0 || selectedTab===1">
<h2 style="font-weight: 800;">货主提现设置</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="100">
<se label="提现审核">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl">关闭</label>
<label nz-radio [nzValue]="true" class="ml-xl">开启</label>
</nz-radio-group>
</se>
<se label="审核时间" style="margin-bottom: 0;">
<nz-radio-group [(ngModel)]="formDate.isEveryDay">
<label nz-radio [nzValue]="false" class="ml-xl block-radio">全天</label>
<label nz-radio [nzValue]="true" class="ml-xl block-radio">自定义</label>
</nz-radio-group>
</se>
<se [col]="1">
<nz-radio-group [(ngModel)]="formDate.isEveryWeek">
<label nz-radio [nzValue]="false" class="ml-xxl block-radio">
<div class="d-flex">
每天
<div class="ml-md" style="cursor:default">
<p style="color: #1890ff;cursor: pointer;">添加时间段</p>
<div class="mb-md">
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="开始时间"></nz-time-picker>
--
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="结束时间"></nz-time-picker>
<label style="color: #1890ff;cursor: pointer;" class="ml-md">删除</label>
</div>
</div>
</div>
</label>
<label nz-radio [nzValue]="true" class="ml-xxl block-radio mt-md">
<div class="d-flex">
每周
<div class="ml-md" style="cursor:default">
<p style="color: #1890ff;cursor: pointer;">添加星期</p>
<div class="mb-md">
<nz-checkbox-group [(ngModel)]="checkOptionsOne"></nz-checkbox-group>
</div>
<div>
<div class="mb-md">
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="开始时间">
</nz-time-picker>
--
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="结束时间">
</nz-time-picker>
<label style="color: #1890ff;cursor: pointer;"
class="ml-md">删除</label>
</div>
<p style="color: #1890ff;cursor: pointer;"> 添加时间段</p>
</div>
</div>
</div>
</label>
</nz-radio-group>
</se>
<se label="提现限额">
<div class="d-flex align-items-center ml-xl mb-md">
<label nz-checkbox>每日最多可提现</label>
<nz-input-group nzAddOnAfter="元" style="width: 150px;">
<input type="number" nz-input placeholder="请输入" />
</nz-input-group>
</div>
<div class="d-flex align-items-center ml-xl">
<label nz-checkbox>每月最多可提现</label>
<nz-input-group nzAddOnAfter="元" style="width: 150px;">
<input type="number" nz-input placeholder="请输入" />
</nz-input-group>
</div>
</se>
</div>
</div>
</nz-card>
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab===2">
<h2 style="font-weight: 800;">路桥发票设置</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="100">
<se label="发票申请" style="margin-bottom: 0;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl">手动申请</label>
<label nz-radio [nzValue]="true" class="ml-xl">自动申请</label>
</nz-radio-group>
</se>
<se>
<p class="ml-xl" style="color: #7e7c7c;">开启自动申请后运单完成卸货后会自动根据运单信息申请ETC发票。</p>
</se>
</div>
</div>
</nz-card>
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab===3">
<h2 style="font-weight: 800;">风险单监控</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="180">
<se [col]="1" label="早/晚于计划出发时间" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="小时" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">当前时间与计划时间对比,允许如上合理范围内执行不报异常,差异在范围外则报异常</p>
</se>
<se [col]="1" label="早/晚于计划到达时间" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="小时" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">当前时间与计划时间对比,允许如上合理范围内执行不报异常,差异在范围外则报异常</p>
</se>
<se [col]="1" label="损耗量" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="%" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">签收量与装运量对比,允许如上合理范围内损耗不报异常,差异在范围外则报异常</p>
</se>
<se [col]="1" label="装货/卸货地距离范围" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="KM" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">装货地和发货地、签收地和收货地距离对比,允许如上合理范围内执行不报异常,差异在范围外则报异常</p>
</se>
</div>
</div>
</nz-card>
<div class="mb-md save-btn">
<button class="ml-lg" nz-button nzSize="large" nzType="primary">保存</button>
</div>
</div>
</div>
</nz-card>

View File

@ -41,7 +41,28 @@ export class FreightConfigComponent implements OnInit {
nzWidth: 900, nzWidth: 900,
nzComponentParams: { nzComponentParams: {
extendType: '2', extendType: '2',
businessId: item.id businessId: item.id,
formatTypeList: (item: any[]) => [
...item,
{
name: '权限配置',
items: [
{
configType: 1,
itemType: 999
}
]
},
{
name: '费率变更记录',
items: [
{
configType: 2,
itemType: 999
}
]
}
]
}, },
nzFooter: null nzFooter: null
}); });

View File

@ -203,11 +203,11 @@ export class FreightComponentsListComponent implements OnInit {
// this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } }); // this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } });
} }
}, },
{ // {
acl: { ability: ['USERCENTER-FREIGHT-LIST-basicSetting'] }, // acl: { ability: ['USERCENTER-FREIGHT-LIST-basicSetting'] },
text: '基础设置', // text: '基础设置',
click: item => this.settingAction(item) // click: item => this.settingAction(item)
}, // },
{ {
acl: { ability: ['USERCENTER-FREIGHT-LIST-balance'] }, acl: { ability: ['USERCENTER-FREIGHT-LIST-balance'] },
text: '资金账户', text: '资金账户',

View File

@ -100,8 +100,8 @@
<nz-switch [(ngModel)]="item.itemValue"></nz-switch> <nz-switch [(ngModel)]="item.itemValue"></nz-switch>
</ng-container> </ng-container>
<!-- 开关选项 --> <!-- 开关选项 -->
<ng-container *ngSwitchCase="99"> <ng-container *ngSwitchCase="999">
<nz-switch [(ngModel)]="item.itemValue"></nz-switch> <ng-content select="custom-element"></ng-content>
</ng-container> </ng-container>
</ng-container> </ng-container>
</se> </se>
@ -112,7 +112,7 @@
<div class="mb-md save-btn"> <div class="mb-md save-btn">
<button class="ml-lg" nz-button nzSize="large" nzType="primary" (click)="saveAction()" <button class="ml-lg" nz-button nzSize="large" nzType="primary" (click)="saveAction()"
*ngIf="selectedTab?.configKey!=='freight'">保存</button> *ngIf="selectedTab?.configKey!=='freight' && labelWidth!==0">保存</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,3 +1,16 @@
<app-dynamic-setting-h5 [tabs]="tabs" [configList]="configList" [selectedTab]="selectedTab" <app-dynamic-setting-h5 [tabs]="tabs" [configList]="configList" [selectedTab]="selectedTab"
(selectedEvent)="changeType($event)" (saveEvent)="saveAction($event)" [tabSpan]="6" [labelWidth]="200" > (selectedEvent)="changeType($event)" (saveEvent)="saveAction($event)" [tabSpan]="6" [labelWidth]="labelWidth">
<custom-element>
<ng-container [ngSwitch]="selectedTab?.configType">
<ng-container *ngSwitchCase="1">
权限配置
</ng-container>
<ng-container *ngSwitchCase="2">
</ng-container>
<ng-container *ngSwitchDefault>
费率变更记录
</ng-container>
</ng-container>
</custom-element>
</app-dynamic-setting-h5> </app-dynamic-setting-h5>

View File

@ -1,5 +1,5 @@
/* /*
* @Description : * @Description :
* @Version : 1.0 * @Version : 1.0
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-10 16:06:17 * @Date : 2022-01-10 16:06:17
@ -8,9 +8,12 @@
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\dynamic-setting\\dynamic-setting-modal\\dynamic-setting-modal.component.ts * @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\dynamic-setting\\dynamic-setting-modal\\dynamic-setting-modal.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/compiler';
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { ModalHelper } from '@delon/theme'; import { ModalHelper } from '@delon/theme';
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef } from 'ng-zorro-antd/modal';
import { Observable, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { BaseService } from 'src/app/shared/services'; import { BaseService } from 'src/app/shared/services';
@Component({ @Component({
@ -21,41 +24,58 @@ import { BaseService } from 'src/app/shared/services';
export class DynamicSettingModalComponent implements OnInit { export class DynamicSettingModalComponent implements OnInit {
tabs: any[] = []; tabs: any[] = [];
selectedTab: any = null; selectedTab: any = null;
configFullKey = 'sys.config' configFullKey = 'sys.config';
configList: any = []; configList: any = [];
// 配置类型数组重组函数
@Input()
formatTypeList = (item: any[]) => {
return [...item];
};
@Input() @Input()
extendType!: string; extendType!: string;
@Input() @Input()
businessId!: string; businessId!: string;
@Input() @Input()
configvalue!: string; configvalue!: string;
@Input()
labelWidth = 200;
constructor(public service: BaseService, private modalHelp: NzModalRef) {} constructor(public service: BaseService, private modalHelp: NzModalRef) {}
ngOnInit() { ngOnInit() {
if(this.configvalue) { if (this.configvalue) {
this.configFullKey = this.configvalue this.configFullKey = this.configvalue;
} }
this.getTypeList(); this.getTypeList();
} }
getTypeList() { getTypeList() {
this.service this.service
.request('/api/mdc/pbc/sysConfigItemExtend/getSysConfigExtend', { .request('/api/mdc/pbc/sysConfigItemExtend/getSysConfigExtend', {
configFullKey: this.configFullKey, configFullKey: this.configFullKey,
extendType: this.extendType, extendType: this.extendType,
businessId: this.businessId businessId: this.businessId
}) })
.subscribe((res: Array<any>) => { .pipe(
if (res?.length > 0) { map((res: Array<any>) => {
const typeData = res.find(config => config.configFullKey === this.configFullKey); if (res?.length > 0) {
if (typeData) { const typeData = res.find(config => config.configFullKey === this.configFullKey);
this.tabs = typeData.children; if (typeData) {
this.selectedTab = typeData.children[0]; return typeData.children || [];
this.configList = this.formatItems(this.selectedTab.items); }
} }
return [];
}),
map(this.formatTypeList)
)
.subscribe((res: Array<any>) => {
this.tabs = res;
if (res?.length > 0) {
this.selectedTab = res[0];
this.configList = this.formatItems(this.selectedTab.items);
const hiddenType = this.configList.find((item: any) => item.itemType === 7 || item.itemType === 999);
this.labelWidth = hiddenType ? 0 : 200;
} }
}); });
} }
@ -63,6 +83,8 @@ export class DynamicSettingModalComponent implements OnInit {
changeType(type: any): void { changeType(type: any): void {
this.selectedTab = type; this.selectedTab = type;
this.configList = this.formatItems(type.items); this.configList = this.formatItems(type.items);
const hiddenType = this.configList.find((item: any) => item.itemType === 7 || item.itemType === 999);
this.labelWidth = hiddenType ? 0 : 200;
} }
saveAction(params: Array<any>) { saveAction(params: Array<any>) {
@ -93,13 +115,12 @@ export class DynamicSettingModalComponent implements OnInit {
itemData: item.extendItemData || item.itemData, itemData: item.extendItemData || item.itemData,
itemValue: item.extendItemValue || item.itemValue itemValue: item.extendItemValue || item.itemValue
})) }))
.map(item => ( .map(item => ({
{
...item, ...item,
remark: item?.remark ? JSON.parse(item?.remark) : null, remark: item?.remark ? JSON.parse(item?.remark) : null,
extend: item?.extend ? JSON.parse(item?.extend) : [], extend: item?.extend ? JSON.parse(item?.extend) : [],
// itemData: item.itemData ? JSON.parse(item.itemData) : item.itemData, // itemData: item.itemData ? JSON.parse(item.itemData) : item.itemData,
itemValue: item?.itemValue ? item?.itemType !== 8? JSON.parse(item?.itemValue) : item?.itemValue : item?.itemValue itemValue: item?.itemValue ? (item?.itemType !== 8 ? JSON.parse(item?.itemValue) : item?.itemValue) : item?.itemValue
})); }));
} }
return []; return [];

View File

@ -17,10 +17,12 @@ import { FormsModule } from '@angular/forms';
import { DynamicSettingModalComponent } from './dynamic-setting-modal/dynamic-setting-modal.component'; import { DynamicSettingModalComponent } from './dynamic-setting-modal/dynamic-setting-modal.component';
import { FreightTableComponent } from './freight-table/freight-table.component'; import { FreightTableComponent } from './freight-table/freight-table.component';
import { SEModule } from '@delon/abc/se'; import { SEModule } from '@delon/abc/se';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
const COMPONENTS = [DynamicSettingH5Component, DynamicSettingModalComponent, FreightTableComponent]; const COMPONENTS = [DynamicSettingH5Component, DynamicSettingModalComponent, FreightTableComponent];
@NgModule({ @NgModule({
declarations: [...COMPONENTS], declarations: [...COMPONENTS],
imports: [CommonModule, FormsModule, SHARED_ZORRO_MODULES, SEModule], imports: [CommonModule, FormsModule, SHARED_ZORRO_MODULES, SEModule],
exports: [...COMPONENTS] exports: [...COMPONENTS],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}) })
export class DynamicSettingModule {} export class DynamicSettingModule {}

View File

@ -45,7 +45,6 @@ export class ShipperBaseService extends BaseService {
* @returns * @returns
*/ */
getEnterpriseProject(params?: any) { getEnterpriseProject(params?: any) {
console.log(params)
return this.request(this.$api_get_enterprise_project, params).pipe( return this.request(this.$api_get_enterprise_project, params).pipe(
map((res: any) => { map((res: any) => {
if (!res) { if (!res) {