Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
@ -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; // 货源单设置回显
|
||||||
@ -117,11 +117,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
formatterRmb = (value: number): string => {
|
formatterRmb = (value: number): string => {
|
||||||
if (value === null || value === undefined) {
|
if (value === null || value === undefined) {
|
||||||
return '';
|
return '';
|
||||||
}else{
|
} else {
|
||||||
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,24 +715,32 @@ 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);
|
||||||
|
if (this?.sf1.value?.enterpriseInfoName) {
|
||||||
|
console.log('5555');
|
||||||
|
}
|
||||||
|
console.log(this?.sf1.value?.enterpriseInfoId);
|
||||||
|
console.log(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?.sf1.value?.enterpriseInfoName,
|
enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '',
|
||||||
totalFreight: subtotal,
|
totalFreight: subtotal,
|
||||||
fuelCardAmount: oilCardPay,
|
fuelCardAmount: oilCardPay,
|
||||||
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(this.envCache);
|
|
||||||
if (res) {
|
if (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 || '';
|
||||||
|
console.log(items);
|
||||||
this.service
|
this.service
|
||||||
.request(
|
.request(
|
||||||
this.service.$api_getAdditionalRate +
|
this.service.$api_getAdditionalRate +
|
||||||
`?shipperId=${this?.sf1.value?.shipperAppUserId || ''}&enterpriseInfoId=${this?.sf1.value?.enterpriseInfoName || ''}&resourcetype='1'`
|
`?shipperId=${this?.sf1?.value?.shipperAppUserId || ''}&enterpriseInfoId=${items}&resourcetype='1'`
|
||||||
)
|
)
|
||||||
.subscribe(res => {
|
.subscribe(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
@ -773,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;
|
||||||
@ -788,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);
|
||||||
@ -912,7 +920,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.service.msgSrv.warning('总费用不能为0!');
|
this.service.msgSrv.warning('总费用不能为0!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime))/(24*60*60*1000);
|
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime)) / (24 * 60 * 60 * 1000);
|
||||||
if (num > this.limitValues.maxDays) {
|
if (num > this.limitValues.maxDays) {
|
||||||
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
|
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
|
||||||
return;
|
return;
|
||||||
@ -1010,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) {
|
||||||
@ -1019,8 +1027,7 @@ 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,
|
||||||
@ -1146,6 +1153,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.sf1data = {
|
this.sf1data = {
|
||||||
enterpriseInfoName: res?.enterpriseInfoName,
|
enterpriseInfoName: res?.enterpriseInfoName,
|
||||||
|
enterpriseInfoId: res?.enterpriseInfoId,
|
||||||
dispatchPhone: res?.dispatchPhone,
|
dispatchPhone: res?.dispatchPhone,
|
||||||
dispatchName: res?.dispatchName,
|
dispatchName: res?.dispatchName,
|
||||||
externalResourceCode: res?.externalResourceCode,
|
externalResourceCode: res?.externalResourceCode,
|
||||||
@ -1239,7 +1247,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
|
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
|
||||||
}
|
}
|
||||||
this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId });
|
this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId });
|
||||||
|
|
||||||
if (res?.loadingTime) {
|
if (res?.loadingTime) {
|
||||||
this.loadingTime = res?.loadingTime;
|
this.loadingTime = res?.loadingTime;
|
||||||
}
|
}
|
||||||
@ -1269,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,
|
||||||
@ -1346,14 +1354,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 不可选择的时间
|
// 不可选择的时间
|
||||||
disabledDateStart = (current: Date): boolean => {
|
disabledDateStart = (current: Date): boolean => {
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
let year = d.getFullYear();
|
let year = d.getFullYear();
|
||||||
let month = d.getMonth();
|
let month = d.getMonth();
|
||||||
let date = d.getDate();
|
let date = d.getDate();
|
||||||
let hours = d.getHours();
|
let hours = d.getHours();
|
||||||
let mydate = new Date(year, month, date + this.limitValues.maxDays,hours+1);
|
let mydate = new Date(year, month, date + this.limitValues.maxDays, hours + 1);
|
||||||
return differenceInCalendarDays(new Date(), current) > 0 || new Date(current) > mydate;
|
return differenceInCalendarDays(new Date(), current) > 0 || new Date(current) > mydate;
|
||||||
};
|
};
|
||||||
// 装卸货地址互换
|
// 装卸货地址互换
|
||||||
|
|||||||
@ -66,10 +66,10 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
|||||||
this.validateForm1 = fb.group({
|
this.validateForm1 = fb.group({
|
||||||
loadAddress0: [null, [Validators.required]],
|
loadAddress0: [null, [Validators.required]],
|
||||||
loadName0: [null, [Validators.required]],
|
loadName0: [null, [Validators.required]],
|
||||||
loadPhone0: [null, [Validators.required,Validators.pattern('^[0-9]*$')]],
|
loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]],
|
||||||
unloadAddress0: [null, [Validators.required]],
|
unloadAddress0: [null, [Validators.required]],
|
||||||
unloadName0: [null, [Validators.required]],
|
unloadName0: [null, [Validators.required]],
|
||||||
unloadPhone0: [null, [Validators.required,Validators.pattern('^[0-9]*$')]],
|
unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]],
|
||||||
loadingTime: [null, []],
|
loadingTime: [null, []],
|
||||||
unloadingTime: [null, []]
|
unloadingTime: [null, []]
|
||||||
});
|
});
|
||||||
@ -90,7 +90,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
|||||||
@ViewChild('sf5', { static: false }) sf5!: SFComponent;
|
@ViewChild('sf5', { static: false }) sf5!: SFComponent;
|
||||||
schema5: SFSchema = {};
|
schema5: SFSchema = {};
|
||||||
ui5!: SFUISchema;
|
ui5!: SFUISchema;
|
||||||
|
|
||||||
@ViewChild('sf55', { static: false }) sf55!: SFComponent;
|
@ViewChild('sf55', { static: false }) sf55!: SFComponent;
|
||||||
schema55: SFSchema = {};
|
schema55: SFSchema = {};
|
||||||
ui55!: SFUISchema;
|
ui55!: SFUISchema;
|
||||||
@ -108,17 +108,16 @@ 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) {
|
||||||
return '';
|
return '';
|
||||||
}else{
|
} else {
|
||||||
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,33 +695,33 @@ 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 => {
|
||||||
return differenceInCalendarDays(new Date(), current) > 0;
|
return differenceInCalendarDays(new Date(), current) > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义校验数据
|
* 自定义校验数据
|
||||||
* @param val
|
* @param val
|
||||||
*/
|
*/
|
||||||
customValidator(val: number) {
|
customValidator(val: number) {
|
||||||
if (this.isEmpty(val)) {
|
if (this.isEmpty(val)) {
|
||||||
return [{ keyword: 'required', message: '不能为空' }];
|
return [{ keyword: 'required', message: '不能为空' }];
|
||||||
} else {
|
} else {
|
||||||
if (val <= 0) {
|
if (val <= 0) {
|
||||||
return [{ keyword: 'required', message: '数值需大于0' }];
|
return [{ keyword: 'required', message: '数值需大于0' }];
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
isEmpty(val: any) {
|
|
||||||
return val === undefined || val === null || val.toString().trim() === '';
|
isEmpty(val: any) {
|
||||||
}
|
return val === undefined || val === null || val.toString().trim() === '';
|
||||||
|
}
|
||||||
// 获取城市列表
|
// 获取城市列表
|
||||||
getRegionCode(regionCode: any) {
|
getRegionCode(regionCode: any) {
|
||||||
console.log(regionCode);
|
console.log(regionCode);
|
||||||
@ -747,20 +748,25 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
|||||||
const subtotal = prePay + toPay + receiptPay;
|
const subtotal = prePay + toPay + receiptPay;
|
||||||
const params = {
|
const params = {
|
||||||
shipperId: this?.sf1.value?.shipperAppUserId,
|
shipperId: this?.sf1.value?.shipperAppUserId,
|
||||||
enterpriseInfoId: this?.sf1.value?.enterpriseInfoName,
|
enterpriseInfoId: this?.sf1.value?.enterpriseInfoName || '',
|
||||||
totalFreight: subtotal,
|
totalFreight: subtotal,
|
||||||
fuelCardAmount: oilCardPay,
|
fuelCardAmount: oilCardPay,
|
||||||
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;
|
||||||
@ -872,7 +878,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
|||||||
this.service.msgSrv.warning('总费用不能为0!');
|
this.service.msgSrv.warning('总费用不能为0!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime))/(24*60*60*1000);
|
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime)) / (24 * 60 * 60 * 1000);
|
||||||
if (num > this.limitValues.maxDays) {
|
if (num > this.limitValues.maxDays) {
|
||||||
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
|
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
|
||||||
return;
|
return;
|
||||||
@ -908,81 +914,79 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 提交前协议弹窗
|
// 提交前协议弹窗
|
||||||
agreementConfirm(submitType?: string) {
|
agreementConfirm(submitType?: string) {
|
||||||
//装卸货信息
|
//装卸货信息
|
||||||
const LoadingList = this.startInfo.concat(this.endInfo);
|
const LoadingList = this.startInfo.concat(this.endInfo);
|
||||||
|
|
||||||
// 货物信息
|
// 货物信息
|
||||||
const sf3Values = { ...this.sf3.value };
|
const sf3Values = { ...this.sf3.value };
|
||||||
if (sf3Values.goodsTypeName === '其它') {
|
if (sf3Values.goodsTypeName === '其它') {
|
||||||
sf3Values.goodsName = sf3Values.goodsName1;
|
sf3Values.goodsName = sf3Values.goodsName1;
|
||||||
delete sf3Values.goodsName1;
|
delete sf3Values.goodsName1;
|
||||||
}
|
}
|
||||||
if (this.sf4.value.carModel.includes('999')) {
|
if (this.sf4.value.carModel.includes('999')) {
|
||||||
this.sf4.value.carModel = ['999'];
|
this.sf4.value.carModel = ['999'];
|
||||||
}
|
}
|
||||||
if (this.sf4.value.carLength.includes('999')) {
|
if (this.sf4.value.carLength.includes('999')) {
|
||||||
this.sf4.value.carLength = ['999'];
|
this.sf4.value.carLength = ['999'];
|
||||||
}
|
}
|
||||||
const goodsInfoVOList = [
|
const goodsInfoVOList = [
|
||||||
{
|
{
|
||||||
...sf3Values,
|
...sf3Values,
|
||||||
...this.sf4.value,
|
...this.sf4.value,
|
||||||
carModel: this.sf4.value.carModel.join(','),
|
carModel: this.sf4.value.carModel.join(','),
|
||||||
carLength: this.sf4.value.carLength.join(',')
|
carLength: this.sf4.value.carLength.join(',')
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
// 运费信息
|
// 运费信息
|
||||||
const expenseList = [
|
const expenseList = [
|
||||||
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' },
|
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' },
|
||||||
{ 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,
|
||||||
// unLoadingPlaceDTOList: LoadingList,
|
// unLoadingPlaceDTOList: LoadingList,
|
||||||
// unloadingTime: format(this.validateForm1.value?.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
// unloadingTime: format(this.validateForm1.value?.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
// loadingTime: format(this.validateForm1.value?.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
// loadingTime: format(this.validateForm1.value?.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
// goodsInfoDTOList: goodsInfoList,
|
// goodsInfoDTOList: goodsInfoList,
|
||||||
// ...this.sf5.value,
|
// ...this.sf5.value,
|
||||||
// ...this.sf6.value,
|
// ...this.sf6.value,
|
||||||
// expenseDTOList: expenseList,
|
// expenseDTOList: expenseList,
|
||||||
// paymentDays: this.sf7.value?.paymentDays,
|
// paymentDays: this.sf7.value?.paymentDays,
|
||||||
// insuranceType:this.sf55?.value?.insuranceType,
|
// insuranceType:this.sf55?.value?.insuranceType,
|
||||||
// };
|
// };
|
||||||
const params = {
|
const params = {
|
||||||
id: '',
|
id: '',
|
||||||
...this.sf1.value,
|
...this.sf1.value,
|
||||||
unLoadingPlaceDTOList: LoadingList,
|
unLoadingPlaceDTOList: LoadingList,
|
||||||
unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
goodsInfoDTOList: goodsInfoVOList,
|
goodsInfoDTOList: goodsInfoVOList,
|
||||||
...this.sf5.value,
|
...this.sf5.value,
|
||||||
...this.sf6.value,
|
...this.sf6.value,
|
||||||
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) {
|
||||||
this.submit(submitType, params);
|
this.submit(submitType, params);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 提交
|
// 提交
|
||||||
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,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* @Author : Shiming
|
* @Author : Shiming
|
||||||
* @Date : 2021-12-03 11:10:14
|
* @Date : 2021-12-03 11:10:14
|
||||||
* @LastEditors : Shiming
|
* @LastEditors : Shiming
|
||||||
* @LastEditTime : 2022-03-01 16:16:29
|
* @LastEditTime : 2022-03-02 09:46:36
|
||||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.html
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.html
|
||||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||||
-->
|
-->
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</nz-upload>
|
</nz-upload>
|
||||||
<span style="color: #ff4d4f; font-size: 12px;margin-left: 10px;" (click)="downFile()">下载导入模板</span>
|
<span style="color: #ff4d4f; font-size: 12px;margin-left: 10px; cursor: pointer;" (click)="downFile()">下载导入模板</span>
|
||||||
<div style="color: #ff4d4f; font-size: 12px; margin-top: 5px; width: 400px">仅支持XLX / XLSX文件格式,最多不能超过100行数据</div>
|
<div style="color: #ff4d4f; font-size: 12px; margin-top: 5px; width: 400px">仅支持XLX / XLSX文件格式,最多不能超过100行数据</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</sf>
|
</sf>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* @Author : Shiming
|
* @Author : Shiming
|
||||||
* @Date : 2022-03-01 15:13:03
|
* @Date : 2022-03-01 15:13:03
|
||||||
* @LastEditors : Shiming
|
* @LastEditors : Shiming
|
||||||
* @LastEditTime : 2022-03-01 16:18:58
|
* @LastEditTime : 2022-03-02 09:52:53
|
||||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.ts
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.ts
|
||||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||||
*/
|
*/
|
||||||
@ -184,12 +184,36 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
downFile() {
|
downFile() {
|
||||||
this.service.request(this.service.$api_exportGoodsResourceOperateTemplate).subscribe((res: any)=> {
|
console.log('78')
|
||||||
console.log(res)
|
// this.service.request(this.service.$api_exportGoodsResourceOperateTemplate).subscribe((res: any)=> {
|
||||||
if(res) {
|
// console.log('66')
|
||||||
this.status = false
|
// console.log(res)
|
||||||
}
|
// let aLink = document.createElement('a');
|
||||||
})
|
// const content = res;
|
||||||
|
// let blob = this.base64ToBlob(content); //new Blob([content]);
|
||||||
|
// let evt = document.createEvent("HTMLEvents");
|
||||||
|
// evt.initEvent("click", true, true);//initEvent 不加后两个参数在IE下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为
|
||||||
|
// aLink.download = '模板';
|
||||||
|
// aLink.href = URL.createObjectURL(blob);
|
||||||
|
// // aLink.dispatchEvent(evt);
|
||||||
|
// aLink.click();
|
||||||
|
// this.status = false
|
||||||
|
// })
|
||||||
|
this.service.downloadFile(this.service.$api_exportGoodsResourceOperateTemplate);
|
||||||
|
|
||||||
|
|
||||||
// window.location.href('')
|
// window.location.href('')
|
||||||
}
|
}
|
||||||
|
//base64转blob
|
||||||
|
base64ToBlob(code: any) {
|
||||||
|
let parts = code.split(';base64,');
|
||||||
|
let contentType = parts[0].split(':')[1];
|
||||||
|
let raw = window.atob(parts[1]);
|
||||||
|
let rawLength = raw.length;
|
||||||
|
let uInt8Array = new Uint8Array(rawLength);
|
||||||
|
for (let i = 0; i < rawLength; ++i) {
|
||||||
|
uInt8Array[i] = raw.charCodeAt(i);
|
||||||
|
}
|
||||||
|
return new Blob([uInt8Array], { type: contentType });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user