edit
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STComponent, STColumn, STChange } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema } from '@delon/form';
|
||||
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { TicketService } from '../../services/ticket.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-express-info',
|
||||
templateUrl: './express-info.component.html',
|
||||
styleUrls: ['./express-info.component.less']
|
||||
styleUrls: ['../../../commom/less/box.less']
|
||||
})
|
||||
export class ExpressInfoComponent implements OnInit {
|
||||
@ViewChild('st', { static: true })
|
||||
@ -15,54 +15,55 @@ export class ExpressInfoComponent implements OnInit {
|
||||
@ViewChild('sf', { static: false })
|
||||
sf!: SFComponent;
|
||||
|
||||
url = `/rule?_allow_anonymous=true`;
|
||||
url = `/api/fcc/ficoExpressH/getListPage`;
|
||||
|
||||
searchSchema: SFSchema = {
|
||||
properties: {
|
||||
receiveName: {
|
||||
title: '配置类型',
|
||||
expressCode: {
|
||||
title: '快递单号',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
// asyncData: () => {
|
||||
// return this.service.request(this.service.$api_getAppRoleList).pipe(
|
||||
// map((res: any) => {
|
||||
// this.roleList = res;
|
||||
// return res.map((item: any) => {
|
||||
// return { label: item.roleName, value: item.id };
|
||||
// });
|
||||
// }),
|
||||
// );
|
||||
// },
|
||||
change: (i: any) => {
|
||||
this.sf.value.receiveName = i;
|
||||
this.sf?.setValue('/receiveName', i);
|
||||
}
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
createTime: {
|
||||
title: '创建时间',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'sl-from-to-search',
|
||||
format: 'yyyy-MM-dd'
|
||||
} as SFDateWidgetSchema
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
columns: STColumn[] = [
|
||||
{ title: '配置类型', index: 'no' },
|
||||
{ title: '配置项', index: 'description' },
|
||||
{ title: '', index: 'key', type: 'checkbox', width: 50 },
|
||||
{ title: '快递单号', index: 'expressCode', width: 150 },
|
||||
{ title: '快递公司', index: 'expresscompany', width: 120 },
|
||||
{ title: '快递费用', index: 'description', width: 120 },
|
||||
{ title: '发票数量', index: 'quantity', width: 120 },
|
||||
{ title: '寄件人姓名', index: 'sname', width: 150 },
|
||||
{ title: '寄件人电话', index: 'stel', width: 150 },
|
||||
{
|
||||
title: '启用状态',
|
||||
className: 'text-center',
|
||||
index: 'status',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
0: { text: '启用', color: 'success' },
|
||||
2: { text: '停用', color: 'error' },
|
||||
3: { text: '停用', color: 'error' },
|
||||
1: { text: '停用', color: 'error' }
|
||||
}
|
||||
title: '寄件人地址',
|
||||
index: 'saddress',
|
||||
width: 150,
|
||||
format: item => `${item.sprovince}${item.scity}${item.scounty || ''}${item.saddress}`
|
||||
},
|
||||
{ title: '收件人姓名', index: 'rname', width: 150 },
|
||||
{ title: '收件人电话', index: 'rtel', width: 150 },
|
||||
{
|
||||
title: '收件人地址',
|
||||
index: 'raddress',
|
||||
width: 150,
|
||||
format: item => `${item.rprovince}${item.rcity}${item.rcounty || ''}${item.raddress}`
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
index: 'updatedAt',
|
||||
type: 'date'
|
||||
title: '下单时间',
|
||||
index: 'createTime',
|
||||
type: 'date',
|
||||
width: 180
|
||||
}
|
||||
];
|
||||
|
||||
@ -74,6 +75,19 @@ export class ExpressInfoComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
if (this.sf) {
|
||||
Object.assign(requestOptions.body, {
|
||||
...this.sf.value,
|
||||
createtime: {
|
||||
start: this.sf.value.createtime?.[0] || null,
|
||||
end: this.sf.value.createtime?.[1] || null
|
||||
}
|
||||
});
|
||||
}
|
||||
return requestOptions;
|
||||
};
|
||||
|
||||
stChange(e: STChange): void {
|
||||
switch (e.type) {
|
||||
case 'checkbox':
|
||||
@ -86,11 +100,28 @@ export class ExpressInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
printOrder() {
|
||||
if (this.selectedRows?.length <= 0) {
|
||||
this.service.msgSrv.warning('请选择快递单');
|
||||
return;
|
||||
}
|
||||
this.nzModalService.warning({
|
||||
nzTitle: '确认打印面单所选快递单?',
|
||||
nzClosable: false,
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => {}
|
||||
nzOnOk: () => {
|
||||
this.service
|
||||
.request(
|
||||
this.service.$api_get_print_pdf,
|
||||
this.selectedRows.map(item => item.expressCode)
|
||||
)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.service.reviewPDF(res.pdfUrl);
|
||||
} else {
|
||||
this.service.msgSrv.warning('下载失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user