This commit is contained in:
Taric Xin
2022-04-24 18:09:01 +08:00
parent 44bb14b64f
commit 4e4e05bacb
8 changed files with 299 additions and 419 deletions

View File

@ -8,25 +8,23 @@ import { OrderManagementService } from '../../services/order-management.service'
import { UpdateFreightComponent } from '../../modal/bulk/update-freight/update-freight.component';
import { ConfirReceiptComponent } from '../../modal/bulk/confir-receipt/confir-receipt.component';
import { of } from 'rxjs';
import { ShipperBaseService } from '@shared';
import { SearchDrawerService, ShipperBaseService } from '@shared';
import { Router } from '@angular/router';
import { orderManagementVoucherViewComponent } from '../../modal/audit/voucher-view/voucher-view.component';
import { BasicTableComponent } from 'src/app/routes/commom/components/basic-table/basic-table.component';
@Component({
selector: 'app-order-management-receipts-audit',
templateUrl: './receipts-audit.component.html',
styleUrls: ['./receipts-audit.component.less']
styleUrls: ['../../../commom/less/commom-table.less', './receipts-audit.component.less']
})
export class OrderManagementReceiptsAuditComponent implements OnInit {
ui: SFUISchema = {};
export class OrderManagementReceiptsAuditComponent extends BasicTableComponent implements OnInit {
uiView: SFUISchema = {};
schema: SFSchema = {};
schemaView: SFSchema = {};
auditMany = false;
isVisibleView = false;
isVisibleEvaluate = false;
isVisible = false;
_$expand = false;
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
columns: STColumn[] = [];
@ -41,8 +39,11 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
public service: OrderManagementService,
private modal: NzModalService,
public shipperservice: ShipperBaseService,
private router: Router
) { }
private router: Router,
public searchDrawerService: SearchDrawerService
) {
super(searchDrawerService);
}
/**
* 查询参数
@ -73,22 +74,22 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
if (this.sf) {
Object.assign(requestOptions.body, {
...a,
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || ''
}
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || ''
}
});
}
this.loading = true;
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
console.log(data)
this.loading = false
console.log(data);
this.loading = false;
return data.map(item => ({
...item,
// disabled: item.billStatus !== '4'
...item
// disabled: item.billStatus !== '4'
}));
};
get selectedRows() {
@ -105,7 +106,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
totalCount: 0
};
const params: any = Object.assign({}, this.reqParams || {});
delete params.auditStatus
delete params.auditStatus;
this.service.request(this.service.$api_get_getAuditStatistical, params).subscribe(res => {
if (res) {
let totalCount = 0;
@ -173,7 +174,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
_$expand: (value: boolean) => value
},
onSearch: (q: any) => {
let str =q.replace(/^\s+|\s+$/g,"");
let str = q.replace(/^\s+|\s+$/g, '');
if (str) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: str })
@ -196,7 +197,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
placeholder: '请先选择货主',
visibleIf: {
_$expand: (value: boolean) => value
},
}
} as SFSelectWidgetSchema
},
loadingPlace: {
@ -298,12 +299,12 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
loadingDocuments: {
type: 'string',
title: '装卸货凭证',
enum:[
{label: '全部',value: ''},
{label: '无装卸货凭证',value: '1'},
{label: '装卸货凭证齐全',value: '2'},
{label: '只有装货凭证',value: '3'},
{label: '只有卸货凭证',value: '4'},
enum: [
{ label: '全部', value: '' },
{ label: '无装卸货凭证', value: '1' },
{ label: '装卸货凭证齐全', value: '2' },
{ label: '只有装货凭证', value: '3' },
{ label: '只有卸货凭证', value: '4' }
],
ui: {
widget: 'select',
@ -311,13 +312,12 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
allowClear: true,
visibleIf: {
_$expand: (value: boolean) => value
},
}
}
},
}
},
type: 'object'
};
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
}
/**
@ -397,27 +397,27 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
{
text: '生成电子单据',
click: _record => this.generate(_record, 2),
iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] },
iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] }
},
{
text: '通过',
click: _record => this.sign(_record),
iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] },
iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] }
},
{
text: '修改',
click: _record => this.modification(_record),
iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] },
iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] }
},
{
text: '查看凭证',
click: _record => this.generate(_record, 3),
iif: item => item?.loadingElectronicsLadingBillFilePath && item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-view'] },
},
acl: { ability: ['ORDER-RECEIPTS-view'] }
}
]
}
];
@ -428,32 +428,18 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
tabChange(item: any) { }
/**
* 重置表单
*/
resetSF(): void {
this.sf.reset();
this._$expand = false;
}
tabChange(item: any) {}
/**
* 导入货源
*/
importGoodsSource() { }
audit(item: any) { }
importGoodsSource() {}
audit(item: any) {}
/**
* 审核通过按钮
*/
handleOK() { }
handleOK() {}
OpenPrice(item: any) {
this.isVisible = true;
}
@ -471,7 +457,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
});
modalRef.afterClose.subscribe((result: any) => {
this.st.load(1);
this.getGoodsSourceStatistical()
this.getGoodsSourceStatistical();
});
}
// 生成电子单据
@ -491,31 +477,31 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
nzFooter: null
});
modalRef.afterClose.subscribe((result: any) => {
if(result) {
if (result) {
this.st.load();
this.getGoodsSourceStatistical()
this.getGoodsSourceStatistical();
}
});
}
// 通过
sign(item?: any) {
let params: any = []
let params: any = [];
let text = '';
if (item === '1') {
if (this.selectedRows.length <= 0) {
this.service.msgSrv.error('请选择订单!')
return
this.service.msgSrv.error('请选择订单!');
return;
}
this.selectedRows.forEach(ite => {
params.push(ite.id);
});
text = `<b>已选择${this.selectedRows.length}条订单,确认批量通过审核吗?</b>`
text = `<b>已选择${this.selectedRows.length}条订单,确认批量通过审核吗?</b>`;
} else {
text = `<b>确认通过审核吗?</b>`
text = `<b>确认通过审核吗?</b>`;
params.push(item.id);
}
console.log(this.selectedRows)
console.log(params)
console.log(this.selectedRows);
console.log(params);
this.modal.confirm({
nzTitle: text,
nzContent: `<b>通过后不可修改,可以再生成电子单据。</b>`,
@ -535,8 +521,8 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
// 批量生成电子单据
sign1(item?: any) {
if (this.selectedRows?.length <= 0) {
this.service.msgSrv.error('请选择订单!')
return
this.service.msgSrv.error('请选择订单!');
return;
}
let params: any[] = [];
this.selectedRows.forEach(item => {
@ -545,17 +531,16 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
this.modal.confirm({
nzTitle: `<b>已选择${this.selectedRows.length}条订单,确认批量生成电子单据吗?</b>`,
nzContent: `<b>确认后单据不可修改,请谨慎操作。</b>`,
nzOnOk: () =>
{
this.service.downloadFile(this.service.$api_createBillEsignGoods,params)
this.service.msgSrv.success('生成成功!');
this.st?.reload()
nzOnOk: () => {
this.service.downloadFile(this.service.$api_createBillEsignGoods, params);
this.service.msgSrv.success('生成成功!');
this.st?.reload();
// this.getGoodsSourceStatistical();
}
})
}
});
}
// 获取所属项目
getRegionCode(regionCode: any) {
// 获取所属项目
getRegionCode(regionCode: any) {
console.log(regionCode);
return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode })
@ -575,8 +560,8 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
// }
});
}
// 导出
exprot() {
this.service.exportStart({ ...this.reqParams, pageSize: -1 }, this.service.$api_get_asyncExportExamineBillList);
}
// 导出
exprot() {
this.service.exportStart({ ...this.reqParams, pageSize: -1 }, this.service.$api_get_asyncExportExamineBillList);
}
}