This commit is contained in:
Taric Xin
2021-12-17 16:17:55 +08:00
parent 97c3bced33
commit 7b80dced8b

View File

@ -21,83 +21,73 @@ export class OrderManagementRiskComponent implements OnInit {
schema: SFSchema = {};
schemaView: SFSchema = {};
auditMany = false;
auditId : any;
auditId: any;
isVisibleRE = false;
_$expand = false;
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('sfView', { static: false }) sfView!: SFComponent;
columns: STColumn[] = [];
datass: any = [
tabs = [
{
one: '1',
two: '1',
three: '1',
id: 1
},
name: '全部',
type: 5,
count: 0
},
{
one: '2',
two: '2',
three: '2',
id: 2
},
];
tabs = [ {
name: '全部',
type: 5,
count: 0,
},
{
name: '待申诉',
type: 5,
count: 0,
},
{
name: '申诉中',
type: 5,
count: 0,
},
{
name: '申诉成功',
type: 5,
count: 0,
},
{
name: '申诉失败',
type: 5,
count: 0,
},
name: '待申诉',
type: 5,
count: 0
},
{
name: '申诉中',
type: 5,
count: 0
},
{
name: '申诉成功',
type: 5,
count: 0
},
{
name: '申诉失败',
type: 5,
count: 0
}
];
constructor(public service: SupplyManagementService, public service2: ShipperBaseService, private modal: NzModalService, public router: Router) { }
constructor(
public service: SupplyManagementService,
public service2: ShipperBaseService,
private modal: NzModalService,
public router: Router
) {}
/**
* 查询参数
*/
* 查询参数
*/
get reqParams() {
return {
...this.sf?.value,
...this.sf?.value
};
}
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
return this.st?.list.filter(item => item.checked) || [];
}
ngOnInit(): void {
this.initSF();
this.initST();
}
/**
* 初始化查询表单
*/
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
billCode: {
type: 'string',
title: '订单号',
title: '订单号'
},
resourceCode: {
type: 'string',
@ -112,8 +102,8 @@ export class OrderManagementRiskComponent implements OnInit {
title: '装货地',
ui: {
visibleIf: {
_$expand: (value: boolean) => value,
},
_$expand: (value: boolean) => value
}
}
},
dischargePlace: {
@ -121,8 +111,8 @@ export class OrderManagementRiskComponent implements OnInit {
title: '卸货地',
ui: {
visibleIf: {
_$expand: (value: boolean) => value,
},
_$expand: (value: boolean) => value
}
}
},
// driverName: {
@ -145,26 +135,25 @@ export class OrderManagementRiskComponent implements OnInit {
onSearch: (q: any) => {
if (!!q) {
return this.service
.request(this.service.$api_get_getDriverInfo, { keyword: q,
model: 1, type: 1 })
.pipe(map((res) => (res as any[]).map((i) => ({ label: i.name, value: i.id } as SFSchemaEnum))))
.request(this.service.$api_get_getDriverInfo, { keyword: q, model: 1, type: 1 })
.pipe(map(res => (res as any[]).map(i => ({ label: i.name, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
}
},
visibleIf: {
expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
no9: {
type: 'string',
title: '车牌号',
ui: {
visibleIf: {
_$expand: (value: boolean) => value,
},
_$expand: (value: boolean) => value
}
}
},
no10: {
@ -172,8 +161,8 @@ export class OrderManagementRiskComponent implements OnInit {
title: '收款人',
ui: {
visibleIf: {
_$expand: (value: boolean) => value,
},
_$expand: (value: boolean) => value
}
}
},
wayBillType: {
@ -182,11 +171,11 @@ export class OrderManagementRiskComponent implements OnInit {
ui: {
widget: 'dict-select',
params: { dictKey: 'goodresourceType' },
containAllLable:true,
containAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
shipperId: {
title: '托运人',
@ -194,11 +183,11 @@ export class OrderManagementRiskComponent implements OnInit {
ui: {
widget: 'dict-select',
params: { dictKey: 'BulkFreightUnitPriceType' },
containAllLable:true,
containAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
enterpriseInfoName: {
type: 'string',
@ -207,11 +196,11 @@ export class OrderManagementRiskComponent implements OnInit {
widget: 'select',
placeholder: '请选择',
visibleIf: {
_$expand: (value: boolean) => value,
_$expand: (value: boolean) => value
},
allowClear: true,
asyncData: () => this.service2.getNetworkFreightForwarder(),
},
asyncData: () => this.service2.getNetworkFreightForwarder()
}
},
createTime: {
title: '创建时间',
@ -221,12 +210,12 @@ export class OrderManagementRiskComponent implements OnInit {
mode: 'range',
format: 'yyyy-MM-dd',
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFDateWidgetSchema,
},
_$expand: (value: boolean) => value
}
} as SFDateWidgetSchema
}
},
type: 'object',
type: 'object'
};
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
}
@ -253,7 +242,7 @@ export class OrderManagementRiskComponent implements OnInit {
title: '异常信息',
width: '100px',
className: 'text-center',
index: 'abnormalCause',
index: 'abnormalCause'
},
{ title: '托运人', index: 'shipperName', width: '120px', className: 'text-center' },
{ title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' },
@ -261,33 +250,31 @@ export class OrderManagementRiskComponent implements OnInit {
title: '运费明细',
className: 'text-center',
width: '120px',
render: 'billExpenseDetailVOList',
render: 'billExpenseDetailVOList'
},
{
title: '服务类型',
className: 'text-center',
width: '120px',
index: 'serviceTypeLabel',
}, {
index: 'serviceTypeLabel'
},
{
title: '装货地',
className: 'text-center',
width: '180px',
index: 'loadingPlace',
index: 'loadingPlace'
},
{
title: '卸货地',
className: 'text-center',
width: '180px',
index: 'dischargePlace',
index: 'dischargePlace'
},
{
title: '货物信息',
className: 'text-center',
width: '180px',
render: 'goodsInfoVOList',
render: 'goodsInfoVOList'
},
{
title: '承运司机',
@ -315,18 +302,18 @@ export class OrderManagementRiskComponent implements OnInit {
buttons: [
{
text: '审核',
click: (_record) => this.audit(_record),
click: _record => this.audit(_record)
},
{
text: '详情',
click: (_record) => this.viewEvaluate(_record),
},
],
},
click: _record => this.viewEvaluate(_record)
}
]
}
];
}
initSTAudit(value: number) {
if(value == 1) {
if (value == 1) {
this.schemaView = {
properties: {
billCode: {
@ -334,8 +321,8 @@ export class OrderManagementRiskComponent implements OnInit {
type: 'string',
default: this.auditId,
ui: {
widget: 'text',
},
widget: 'text'
}
},
representationsCause: {
title: '备注',
@ -345,9 +332,9 @@ export class OrderManagementRiskComponent implements OnInit {
placeholder: '通过可以不用填写原因 ,拒绝必须说明原因',
widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 }
},
},
},
}
}
}
};
} else {
this.schemaView = {
@ -357,8 +344,8 @@ export class OrderManagementRiskComponent implements OnInit {
type: 'string',
default: `已选${this.selectedRows?.length}条订单`,
ui: {
widget: 'text',
},
widget: 'text'
}
},
representationsCause: {
title: '备注',
@ -368,12 +355,12 @@ export class OrderManagementRiskComponent implements OnInit {
placeholder: '通过可以不用填写原因 ,拒绝必须说明原因',
widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 }
},
},
},
}
}
}
};
}
this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } };
}
/**
@ -383,14 +370,14 @@ export class OrderManagementRiskComponent implements OnInit {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 伸缩查询条件
*/
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
tabChange(item: any) {
console.log(item)
console.log(item);
}
/**
* 重置表单
@ -400,18 +387,15 @@ export class OrderManagementRiskComponent implements OnInit {
this._$expand = false;
}
// 获取录单员
// 获取录单员
getCatalogueMember() {
const params = {
};
const params = {};
return this.service.request(this.service.$api_get_catalogue_member, params, 'GET').pipe(
map((res) => {
map(res => {
if (res) {
console.log(res)
console.log(res);
}
}),
})
);
}
@ -421,74 +405,70 @@ export class OrderManagementRiskComponent implements OnInit {
/**
* 导入货源
*/
importGoodsSource() {
importGoodsSource() {}
}
/*
* 审核关闭弹窗
*/
/*
* 审核关闭弹窗
*/
handleCancel() {
this.isVisibleRE = false
this.isVisibleRE = false;
}
/**
* 审核通过按钮
*/
/**
* 审核通过按钮
*/
handleOK() {
console.log(this.sfView.value)
console.log(this.sfView.value);
const parms = {
id: this.sfView.value.billCode,
representationsCause: this.sfView.value.representationsCause,
}
this.service.request(this.service.$api_get_catalogue_member, parms).subscribe((res) => {
console.log(res)
if(res) {
this.service.msgSrv.success('审核通过!')
this.isVisibleRE = false
} else{
this.service.msgSrv.error(res.msg)
representationsCause: this.sfView.value.representationsCause
};
this.service.request(this.service.$api_get_catalogue_member, parms).subscribe(res => {
console.log(res);
if (res) {
this.service.msgSrv.success('审核通过!');
this.isVisibleRE = false;
} else {
this.service.msgSrv.error(res.msg);
}
})
});
}
/**
* 审核拒绝按钮
*/
/**
* 审核拒绝按钮
*/
reject() {
console.log(this.sfView.value)
console.log(this.sfView.value);
const parms = {
id: this.sfView.value.billCode,
representationsCause: this.sfView.value.representationsCause,
}
this.service.request(this.service.$api_get_catalogue_member, parms).subscribe((res) => {
console.log(res)
if(res) {
this.service.msgSrv.success('审核通过!')
this.isVisibleRE = false
} else{
this.service.msgSrv.error(res.msg)
representationsCause: this.sfView.value.representationsCause
};
this.service.request(this.service.$api_get_catalogue_member, parms).subscribe(res => {
console.log(res);
if (res) {
this.service.msgSrv.success('审核通过!');
this.isVisibleRE = false;
} else {
this.service.msgSrv.error(res.msg);
}
})
});
}
/**
*审核
*/
/**
*审核
*/
audit(item?: any) {
this.isVisibleRE = true
if(item) {
this.auditId = item.id;
this.initSTAudit(1);
this.isVisibleRE = true;
if (item) {
this.auditId = item.id;
this.initSTAudit(1);
} else {
this.initSTAudit(2);
this.initSTAudit(2);
}
console.log(item)
console.log(item);
}
/**
*查看详情
*/
/**
*查看详情
*/
viewEvaluate(item: any) {
console.log(item)
this.router.navigate(['/order-management/risk-detail', item.id])
console.log(item);
this.router.navigate(['/order-management/risk-detail', item.id]);
}
}