This commit is contained in:
wangshiming
2022-03-02 09:36:42 +08:00
parent 59fe0d3b2f
commit 803e3f3f77
2 changed files with 148 additions and 147 deletions

View File

@ -41,8 +41,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
maxPiece: 99999, maxPiece: 99999,
maxDays: 999, maxDays: 999,
intervalDays: 999, intervalDays: 999,
maxTimes: 999, maxTimes: 999
} };
sf1data: any; // 货源单设置回显 sf1data: any; // 货源单设置回显
sf3data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显
sf4data: any; // 货源单设置回显 sf4data: any; // 货源单设置回显
@ -121,7 +121,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
return `${value2}`; return `${value2}`;
} }
}; };
parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); parserRmb = (value: string): string => value.replace('¥', '').replace(',', '');
@ -154,8 +153,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
console.log(q === ' ') console.log(q === ' ');
let str =q.replace(/^\s+|\s+$/g,""); let str = q.replace(/^\s+|\s+$/g, '');
if (str) { if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: str }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
@ -166,9 +165,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
let str =q.replace(/^\s+|\s+$/g,""); let str = q.replace(/^\s+|\s+$/g, '');
if (str) { if (str) {
this.getRegionCode(str); this.getRegionCode(str);
this.payChange();
} }
} }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
@ -715,14 +715,13 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
const receiptPay = this.sf7.value.receiptPay || 0; const receiptPay = this.sf7.value.receiptPay || 0;
const oilCardPay = 0; const oilCardPay = 0;
const subtotal = prePay + toPay + receiptPay; const subtotal = prePay + toPay + receiptPay;
console.log(this?.sf1.value?.enterpriseInfoName) console.log(this?.sf1.value?.enterpriseInfoName);
if (this?.sf1.value?.enterpriseInfoName) { if (this?.sf1.value?.enterpriseInfoName) {
console.log('5555'); console.log('5555');
} }
console.log(this?.sf1.value?.enterpriseInfoId) console.log(this?.sf1.value?.enterpriseInfoId);
console.log(this?.sf1data?.enterpriseInfoId) console.log(this?.sf1data?.enterpriseInfoId);
console.log(this?.sf1?.value?.enterpriseInfoName ? this?.sf1?.value?.enterpriseInfoName : this?.sf1data?.enterpriseInfoId || '') console.log(this?.sf1?.value?.enterpriseInfoName ? this?.sf1?.value?.enterpriseInfoName : this?.sf1data?.enterpriseInfoId || '');
const params = { const params = {
shipperId: this?.sf1?.value?.shipperAppUserId, shipperId: this?.sf1?.value?.shipperAppUserId,
enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '', enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '',
@ -732,12 +731,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}; };
this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => {
if (res) { if (res) {
console.log(res) console.log(res);
this.sf7.setValue('/appendFee', res.surcharge); this.sf7.setValue('/appendFee', res.surcharge);
this.sf7.setValue('/subtotal', subtotal); this.sf7.setValue('/subtotal', subtotal);
this.sf7.setValue('/total', subtotal + res.surcharge); this.sf7.setValue('/total', subtotal + res.surcharge);
let items = this?.sf1data?.enterpriseInfoId || ''; let items = this?.sf1data?.enterpriseInfoId || '';
console.log(items) console.log(items);
this.service this.service
.request( .request(
this.service.$api_getAdditionalRate + this.service.$api_getAdditionalRate +
@ -782,9 +781,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.service.limitKeys.piece, this.service.limitKeys.piece,
this.service.limitKeys.maxDays, this.service.limitKeys.maxDays,
this.service.limitKeys.intervalDays, this.service.limitKeys.intervalDays,
this.service.limitKeys.maxTimes, this.service.limitKeys.maxTimes
]; ];
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => { this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => {
const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue; const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue;
const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue; const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue;
const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue; const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue;
@ -797,9 +796,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
maxPiece: Number(maxPiece), maxPiece: Number(maxPiece),
maxDays: Number(maxDays), maxDays: Number(maxDays),
intervalDays: Number(intervalDays), intervalDays: Number(intervalDays),
maxTimes: Number(maxTimes), maxTimes: Number(maxTimes)
} };
}) });
} }
subStartInfo(event: any, index: number) { subStartInfo(event: any, index: number) {
this.startInfo.splice(index, 1); this.startInfo.splice(index, 1);
@ -1019,7 +1018,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
nzContent: TranAgreementComponent, nzContent: TranAgreementComponent,
nzWidth: 900, nzWidth: 900,
nzFooter: null, nzFooter: null,
nzComponentParams: {Object: params,} nzComponentParams: { Object: params }
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
if (result) { if (result) {
@ -1029,7 +1028,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
// 提交 // 提交
submit(submitType?: string, params?: any): void { submit(submitType?: string, params?: any): void {
// const params: any = { // const params: any = {
// ...this.sf1.value, // ...this.sf1.value,
// ...this.sf5.value, // ...this.sf5.value,
@ -1279,7 +1277,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
goodsValue: res?.goodsValue || '', goodsValue: res?.goodsValue || '',
insurancePremium: res?.insurancePremium || '', insurancePremium: res?.insurancePremium || '',
insuranceRate: res?.insuranceRate || '', insuranceRate: res?.insuranceRate || '',
insurancePackagedGoods: res?.insurancePackagedGoods || '', insurancePackagedGoods: res?.insurancePackagedGoods || ''
}; };
this.sf6data = { this.sf6data = {
stateReceipt: res?.stateReceipt, stateReceipt: res?.stateReceipt,

View File

@ -108,8 +108,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
maxPiece: 99999, maxPiece: 99999,
maxDays: 999, maxDays: 999,
intervalDays: 999, intervalDays: 999,
maxTimes: 999, maxTimes: 999
} };
formatterRmb = (value: number): string => { formatterRmb = (value: number): string => {
if (value === null || value === undefined) { if (value === null || value === undefined) {
@ -118,7 +118,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
return `${value2}`; return `${value2}`;
} }
}; };
parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); parserRmb = (value: string): string => value.replace('¥', '').replace(',', '');
// 页面初始化 // 页面初始化
@ -146,8 +145,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
console.log(q === ' ') console.log(q === ' ');
let str =q.replace(/^\s+|\s+$/g,""); let str = q.replace(/^\s+|\s+$/g, '');
if (str) { if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: str }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
@ -158,11 +157,12 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
let str =q.replace(/^\s+|\s+$/g,""); let str = q.replace(/^\s+|\s+$/g, '');
if (str) { if (str) {
this.getRegionCode(str); this.getRegionCode(str);
this.payChange();
}
} }
},
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
enterpriseProjectId: { enterpriseProjectId: {
@ -189,7 +189,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
allowClear: true, allowClear: true,
asyncData: () => this.shipperSrv.getNetworkFreightForwarder() asyncData: () => this.shipperSrv.getNetworkFreightForwarder(),
change: () => this.payChange()
} }
}, },
externalResourceCode: { externalResourceCode: {
@ -237,7 +238,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
} }
}, },
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName', ] required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName']
}; };
this.ui1 = { this.ui1 = {
'*': { '*': {
@ -343,7 +344,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
placeholder: '请输入', placeholder: '请输入'
} }
}, },
number: { number: {
@ -351,7 +352,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
placeholder: '请输入', placeholder: '请输入'
} }
}, },
carModel: { carModel: {
@ -399,7 +400,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
$carModel: { $carModel: {
spanLabelFixed: 100, spanLabelFixed: 100,
grid: { span: 8 } grid: { span: 8 }
}, }
}; };
} }
@ -416,7 +417,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
map((res: any) => { map((res: any) => {
return [...res]; return [...res];
}) })
) );
}, },
change: (tag: any, org: any) => { change: (tag: any, org: any) => {
this.getInsurersPrice(tag); this.getInsurersPrice(tag);
@ -679,9 +680,9 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.service.limitKeys.piece, this.service.limitKeys.piece,
this.service.limitKeys.maxDays, this.service.limitKeys.maxDays,
this.service.limitKeys.intervalDays, this.service.limitKeys.intervalDays,
this.service.limitKeys.maxTimes, this.service.limitKeys.maxTimes
]; ];
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => { this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => {
const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue; const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue;
const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue; const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue;
const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue; const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue;
@ -694,9 +695,9 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
maxPiece: Number(maxPiece), maxPiece: Number(maxPiece),
maxDays: Number(maxDays), maxDays: Number(maxDays),
intervalDays: Number(intervalDays), intervalDays: Number(intervalDays),
maxTimes: Number(maxTimes), maxTimes: Number(maxTimes)
} };
}) });
} }
// 不可选择的时间 // 不可选择的时间
disabledDateStart = (current: Date): boolean => { disabledDateStart = (current: Date): boolean => {
@ -753,14 +754,19 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
resourcetype: '1' resourcetype: '1'
}; };
this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => {
console.log('999') console.log('999');
console.log(this?.sf1.value) console.log(this?.sf1.value);
if (res) { if (res) {
this.sf7.setValue('/appendFee', res.surcharge); this.sf7.setValue('/appendFee', res.surcharge);
this.sf7.setValue('/subtotal', subtotal); this.sf7.setValue('/subtotal', subtotal);
this.sf7.setValue('/total', subtotal + res.surcharge); this.sf7.setValue('/total', subtotal + res.surcharge);
this.service this.service
.request(this.service.$api_getAdditionalRate + `?shipperId=${this?.sf1.value?.shipperAppUserId || ''}&enterpriseInfoId=${this?.sf1.value?.enterpriseInfoName || ''}&resourcetype='1'`) .request(
this.service.$api_getAdditionalRate +
`?shipperId=${this?.sf1.value?.shipperAppUserId || ''}&enterpriseInfoId=${
this?.sf1.value?.enterpriseInfoName || ''
}&resourcetype='1'`
)
.subscribe(res => { .subscribe(res => {
if (res) { if (res) {
this.currentRate = res.rate * 100; this.currentRate = res.rate * 100;
@ -939,7 +945,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' }, { expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' },
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' } { expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' }
]; ];
console.log(this.sf55?.value) console.log(this.sf55?.value);
// const params = { // const params = {
// id: '', // id: '',
// ...this.sf1.value, // ...this.sf1.value,
@ -965,13 +971,13 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
expenseDTOList: expenseList, expenseDTOList: expenseList,
paymentDays: this.sf7.value.paymentDays paymentDays: this.sf7.value.paymentDays
}; };
console.log(params) console.log(params);
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({
nzTitle: '运输协议', nzTitle: '运输协议',
nzContent: TranAgreementComponent, nzContent: TranAgreementComponent,
nzWidth: 900, nzWidth: 900,
nzFooter: null, nzFooter: null,
nzComponentParams: {Object: params,} nzComponentParams: { Object: params }
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
if (result) { if (result) {
@ -981,8 +987,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
// 提交 // 提交
submit(submitType?: string, params?: any): void { submit(submitType?: string, params?: any): void {
let reqUrl = this.service.$api_consignWhole; let reqUrl = this.service.$api_consignWhole;
if (submitType) { if (submitType) {
if (submitType == 'assign') { if (submitType == 'assign') {
@ -1182,7 +1186,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
// 计算保价费金额 // 计算保价费金额
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) { getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) { if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) {
const params = { const params = {
insuranceType, insuranceType,
goodsValue: this.sf5.value.goodsValue, goodsValue: this.sf5.value.goodsValue,