替换containsAllLable
This commit is contained in:
@ -43,7 +43,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
private modal: NzModalService,
|
||||
private router: Router,
|
||||
public shipperservice: ShipperBaseService
|
||||
) { }
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF();
|
||||
@ -54,14 +54,14 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
const a:any = {};
|
||||
if(this.resourceStatus) {
|
||||
a.resourceStatus = this.resourceStatus
|
||||
get reqParams() {
|
||||
const a: any = {};
|
||||
if (this.resourceStatus) {
|
||||
a.resourceStatus = this.resourceStatus
|
||||
}
|
||||
const params: any = Object.assign({}, this.sf?.value || {});
|
||||
delete params._$expand;
|
||||
return {
|
||||
return {
|
||||
...a,
|
||||
...params,
|
||||
releaseTime: {
|
||||
@ -72,7 +72,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
start: this.sf?.value?.deadlineTime?.[0] || '',
|
||||
end: this.sf?.value?.deadlineTime?.[1] || '',
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
search() {
|
||||
this.st?.load(1);
|
||||
@ -82,7 +82,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
console.log(data)
|
||||
return data.map(item => ({
|
||||
...item,
|
||||
disabled: item.auditStatus !== '1'
|
||||
disabled: item.auditStatus !== '1'
|
||||
}));
|
||||
};
|
||||
/**
|
||||
@ -110,9 +110,9 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
default: '',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
containsAllLable: true,
|
||||
containsAllLabel: true,
|
||||
params: { dictKey: 'service:type' },
|
||||
containAllLable:true,
|
||||
containAllLable: true,
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value,
|
||||
},
|
||||
@ -123,9 +123,9 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
containsAllLable: true,
|
||||
containsAllLabel: true,
|
||||
params: { dictKey: 'goodresource:settlement:type' },
|
||||
containAllLable:true,
|
||||
containAllLable: true,
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value,
|
||||
},
|
||||
@ -186,7 +186,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
console.log(q)
|
||||
if (!!q) {
|
||||
return this.service
|
||||
.request(this.service.$api_enterpriceList, { enterpriseName: q})
|
||||
.request(this.service.$api_enterpriceList, { enterpriseName: q })
|
||||
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
|
||||
.toPromise();
|
||||
} else {
|
||||
@ -204,24 +204,24 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
this.freightSchema = {
|
||||
properties: {
|
||||
remarks: {
|
||||
title: '备注',
|
||||
type: 'string',
|
||||
maxLength: 50,
|
||||
ui: {
|
||||
placeholder: '请输入备注',
|
||||
widget: 'textarea',
|
||||
title: '备注',
|
||||
type: 'string',
|
||||
maxLength: 50,
|
||||
ui: {
|
||||
placeholder: '请输入备注',
|
||||
widget: 'textarea',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 16 } } };
|
||||
}
|
||||
};
|
||||
this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 16 } } };
|
||||
}
|
||||
/**
|
||||
* 初始化数据列表
|
||||
*/
|
||||
initST() {
|
||||
this.columns = [
|
||||
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
|
||||
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
|
||||
{
|
||||
title: '货源编号',
|
||||
width: '200px',
|
||||
@ -236,12 +236,12 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
{
|
||||
title: '装货地',
|
||||
className: 'text-left',
|
||||
index: 'loadingAddressArr',
|
||||
index: 'loadingAddressArr',
|
||||
width: '200px',
|
||||
}, {
|
||||
title: '卸货地',
|
||||
className: 'text-left',
|
||||
index: 'unloadingAddressArr',
|
||||
index: 'unloadingAddressArr',
|
||||
width: '200px',
|
||||
},
|
||||
{
|
||||
@ -306,7 +306,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
iif: item => item.auditStatus === '1',
|
||||
acl: { ability: ['SUPPLY-INDEX-bulkBatchAudit'] },
|
||||
},
|
||||
{
|
||||
{
|
||||
text: '二维码 ',
|
||||
click: (_record) => this.assignedQrcode(_record),
|
||||
iif: item => item.resourceStatus == 1,
|
||||
@ -314,7 +314,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
{
|
||||
text: '修改单价',
|
||||
click: (_record) => this.modification(_record),
|
||||
iif: item => item.resourceStatus == 1 ,
|
||||
iif: item => item.resourceStatus == 1,
|
||||
acl: { ability: ['SUPPLY-INDEX-modificationUnitPrice'] },
|
||||
},
|
||||
{
|
||||
@ -389,86 +389,86 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
tabChange(item: any) {
|
||||
console.log(item)
|
||||
}
|
||||
/**
|
||||
* 审核
|
||||
* status : 1 单个 2:批量
|
||||
* value : 单个单条数据
|
||||
*/
|
||||
audit(value: any, status?: any) {
|
||||
console.log(value)
|
||||
console.log(status)
|
||||
if(status === 2) {
|
||||
if(this.selectedRows.length <= 0) {
|
||||
this.service.msgSrv.error('未选择货源单!');
|
||||
return
|
||||
}
|
||||
let list: any[] = [];
|
||||
this.selectedRows.forEach(item => {
|
||||
list.push(item.id);
|
||||
});
|
||||
this.auditID = list;
|
||||
this.auditMany = true;
|
||||
} else {
|
||||
this.auditID = value.id
|
||||
this.auditMany = false;
|
||||
/**
|
||||
* 审核
|
||||
* status : 1 单个 2:批量
|
||||
* value : 单个单条数据
|
||||
*/
|
||||
audit(value: any, status?: any) {
|
||||
console.log(value)
|
||||
console.log(status)
|
||||
if (status === 2) {
|
||||
if (this.selectedRows.length <= 0) {
|
||||
this.service.msgSrv.error('未选择货源单!');
|
||||
return
|
||||
}
|
||||
this.isVisible = true;
|
||||
let list: any[] = [];
|
||||
this.selectedRows.forEach(item => {
|
||||
list.push(item.id);
|
||||
});
|
||||
this.auditID = list;
|
||||
this.auditMany = true;
|
||||
} else {
|
||||
this.auditID = value.id
|
||||
this.auditMany = false;
|
||||
}
|
||||
/**
|
||||
* 审核关闭弹窗
|
||||
*/
|
||||
this.isVisible = true;
|
||||
}
|
||||
/**
|
||||
* 审核关闭弹窗
|
||||
*/
|
||||
handleCancel(type: any) {
|
||||
this.isVisible = false
|
||||
}
|
||||
/**
|
||||
* 代发货源
|
||||
*/
|
||||
releaseGoods() {
|
||||
this.router.navigate(['/supply-management/bulk-release']);
|
||||
}
|
||||
/**
|
||||
* 代发货源
|
||||
*/
|
||||
releaseGoods() {
|
||||
this.router.navigate(['/supply-management/bulk-release']);
|
||||
}
|
||||
/**
|
||||
* 审核通过按钮
|
||||
*/
|
||||
handleOK(value: any) {
|
||||
if(this.selectedRows.length <= 0) {
|
||||
const params: any = {
|
||||
id: this.auditID,
|
||||
remarks: this.sfFre.value.remarks,
|
||||
}
|
||||
if(value == 1) {
|
||||
params.auditStatus = 2
|
||||
} else {
|
||||
params.auditStatus = 3
|
||||
}
|
||||
console.log(params)
|
||||
this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => {
|
||||
if (res === true) {
|
||||
this.service.msgSrv.success('审核成功!');
|
||||
this.isVisible = false;
|
||||
this.st?.reload();
|
||||
this.getGoodsSourceStatistical();
|
||||
if (this.selectedRows.length <= 0) {
|
||||
const params: any = {
|
||||
id: this.auditID,
|
||||
remarks: this.sfFre.value.remarks,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const params: any = {
|
||||
ids: this.auditID,
|
||||
remarks: this.sfFre.value.remarks,
|
||||
}
|
||||
if(value == 1) {
|
||||
params.auditStatus = 2
|
||||
} else {
|
||||
params.auditStatus = 3
|
||||
}
|
||||
console.log(params)
|
||||
this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => {
|
||||
if (res === true) {
|
||||
this.service.msgSrv.success('审核成功!');
|
||||
this.isVisible = false;
|
||||
this.st?.reload();
|
||||
this.getGoodsSourceStatistical();
|
||||
if (value == 1) {
|
||||
params.auditStatus = 2
|
||||
} else {
|
||||
params.auditStatus = 3
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(params)
|
||||
this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => {
|
||||
if (res === true) {
|
||||
this.service.msgSrv.success('审核成功!');
|
||||
this.isVisible = false;
|
||||
this.st?.reload();
|
||||
this.getGoodsSourceStatistical();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const params: any = {
|
||||
ids: this.auditID,
|
||||
remarks: this.sfFre.value.remarks,
|
||||
}
|
||||
if (value == 1) {
|
||||
params.auditStatus = 2
|
||||
} else {
|
||||
params.auditStatus = 3
|
||||
}
|
||||
console.log(params)
|
||||
this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => {
|
||||
if (res === true) {
|
||||
this.service.msgSrv.success('审核成功!');
|
||||
this.isVisible = false;
|
||||
this.st?.reload();
|
||||
this.getGoodsSourceStatistical();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 修改单价
|
||||
modification(item: any) {
|
||||
@ -509,34 +509,34 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
nzTitle: '<b>确定取消货源吗?</b>',
|
||||
nzContent: `<b>取消后不可恢复,谨慎操作</b>`,
|
||||
nzOnOk: () =>
|
||||
this.service.request(this.service.$api_cancelSource, {id: item.id}).subscribe((res) => {
|
||||
if(res) {
|
||||
this.service.request(this.service.$api_cancelSource, { id: item.id }).subscribe((res) => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('已取消货源!')
|
||||
this.st?.reload();
|
||||
this.getGoodsSourceStatistical();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
// 获取货源状态统计
|
||||
getGoodsSourceStatistical() {
|
||||
this.tabs = {
|
||||
totalQuantity: 0,
|
||||
cancelQuantity: 0,
|
||||
receivedQuantity: 0,
|
||||
stayQuantity: 0
|
||||
};
|
||||
const params: any = Object.assign({}, this.reqParams || {});
|
||||
delete params.resourceStatus
|
||||
this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 2, ...params }).subscribe(res => {
|
||||
if (res) {
|
||||
console.log(res)
|
||||
this.tabs = res;
|
||||
}
|
||||
})
|
||||
}
|
||||
userAction() {
|
||||
|
||||
}
|
||||
// 获取货源状态统计
|
||||
getGoodsSourceStatistical() {
|
||||
this.tabs = {
|
||||
totalQuantity: 0,
|
||||
cancelQuantity: 0,
|
||||
receivedQuantity: 0,
|
||||
stayQuantity: 0
|
||||
};
|
||||
const params: any = Object.assign({}, this.reqParams || {});
|
||||
delete params.resourceStatus
|
||||
this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 2, ...params }).subscribe(res => {
|
||||
if (res) {
|
||||
console.log(res)
|
||||
this.tabs = res;
|
||||
}
|
||||
})
|
||||
}
|
||||
userAction() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,10 +65,10 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
this.validateForm1 = fb.group({
|
||||
loadAddress0: [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]],
|
||||
unloadName0: [null, [Validators.required]],
|
||||
unloadPhone0: [null, [Validators.required,Validators.pattern('^[0-9]*$')]],
|
||||
unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]],
|
||||
loadingTime: [null, []],
|
||||
unloadingTime: [null, []]
|
||||
});
|
||||
@ -89,7 +89,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
@ViewChild('sf5', { static: false }) sf5!: SFComponent;
|
||||
schema5: SFSchema = {};
|
||||
ui5!: SFUISchema;
|
||||
|
||||
|
||||
@ViewChild('sf55', { static: false }) sf55!: SFComponent;
|
||||
schema55: SFSchema = {};
|
||||
ui55!: SFUISchema;
|
||||
@ -101,15 +101,15 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
||||
schema7: SFSchema = {};
|
||||
ui7!: SFUISchema;
|
||||
formatterRmb = (value: number): string =>{
|
||||
if(value){
|
||||
let value2 = Number(value).toLocaleString(undefined,{'minimumFractionDigits':2,'maximumFractionDigits':2});
|
||||
formatterRmb = (value: number): string => {
|
||||
if (value) {
|
||||
let value2 = Number(value).toLocaleString(undefined, { 'minimumFractionDigits': 2, 'maximumFractionDigits': 2 });
|
||||
return `¥ ${value2}`;
|
||||
}
|
||||
return `¥ 0.00`
|
||||
|
||||
} ;
|
||||
parserRmb = (value: string): string => value.replace('¥ ', '').replace(',','');
|
||||
|
||||
};
|
||||
parserRmb = (value: string): string => value.replace('¥ ', '').replace(',', '');
|
||||
// 页面初始化
|
||||
ngOnInit(): void {
|
||||
this.initSF1();
|
||||
@ -221,7 +221,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
} as SFSelectWidgetSchema
|
||||
}
|
||||
},
|
||||
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName', ]
|
||||
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName',]
|
||||
};
|
||||
this.ui1 = {
|
||||
'*': {
|
||||
@ -343,13 +343,13 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'select',
|
||||
mode: 'multiple',
|
||||
maxMultipleCount:3,
|
||||
maxMultipleCount: 3,
|
||||
placeholder: '请选择车型',
|
||||
errors: { required: '请选择车型' },
|
||||
asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }),
|
||||
change:(tag:any , org:any)=>{
|
||||
if(tag.includes("999")){
|
||||
this.sf4.setValue('/carModel',["999"]);
|
||||
change: (tag: any, org: any) => {
|
||||
if (tag.includes("999")) {
|
||||
this.sf4.setValue('/carModel', ["999"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -360,13 +360,13 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'select',
|
||||
mode: 'multiple',
|
||||
maxMultipleCount:3,
|
||||
maxMultipleCount: 3,
|
||||
placeholder: '请选择车长',
|
||||
errors: { required: '请选择车长' },
|
||||
asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }),
|
||||
change:(tag:any , org:any)=>{
|
||||
if(tag.includes("999")){
|
||||
this.sf4.setValue('/carModel',["999"]);
|
||||
change: (tag: any, org: any) => {
|
||||
if (tag.includes("999")) {
|
||||
this.sf4.setValue('/carModel', ["999"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -443,29 +443,29 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'select'
|
||||
},
|
||||
default:'0'
|
||||
default: '0'
|
||||
},
|
||||
type1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['车辆实时定位', '轨迹查询', '数据保护','赠送基本险'],
|
||||
enum: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: {insuranceType: (value: string) => value ==='1'},
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' },
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['车辆实时定位', '轨迹查询', '数据保护','赠送基本险'],
|
||||
default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险'],
|
||||
},
|
||||
type2: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['车辆实时定位', '轨迹查询', '数据保护','专属技术服务','赠送综合险'],
|
||||
enum: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: {insuranceType: (value: string) => value ==='2'},
|
||||
visibleIf: { insuranceType: (value: string) => value === '2' },
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['车辆实时定位', '轨迹查询', '数据保护','专属技术服务','赠送综合险'],
|
||||
default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险'],
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -501,7 +501,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'receipt:type' },
|
||||
containsAllLable: false,
|
||||
containsAllLabel: false,
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请选择' },
|
||||
visibleIf: {
|
||||
@ -573,7 +573,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
} as SFTextareaWidgetSchema
|
||||
}
|
||||
},
|
||||
required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress']
|
||||
required: ['stateReceipt', 'receiptType', 'receiptUserName', 'receiptUserPhone', 'receiptAddressArea', 'receiptAddress']
|
||||
};
|
||||
this.ui6 = {
|
||||
'*': {
|
||||
@ -589,19 +589,19 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
type: 'number',
|
||||
title: '预付',
|
||||
default: 0,
|
||||
ui: {widget: 'custom'}
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
toPay: {
|
||||
type: 'number',
|
||||
title: '到付',
|
||||
default: 0,
|
||||
ui: { widget: 'custom'}
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
default: 0,
|
||||
ui: {widget: 'custom'}
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
@ -651,12 +651,12 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
const params = {
|
||||
shipperId: this.envCache?.enterpriseId,
|
||||
enterpriseInfoId: this.envCache?.networkTransporterId,
|
||||
totalFreight:subtotal,
|
||||
fuelCardAmount:oilCardPay,
|
||||
resourcetype:'1'
|
||||
totalFreight: subtotal,
|
||||
fuelCardAmount: oilCardPay,
|
||||
resourcetype: '1'
|
||||
}
|
||||
this.service
|
||||
.request(this.service.$api_getCalculatedSurcharge,params)
|
||||
.request(this.service.$api_getCalculatedSurcharge, params)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.sf7.setValue('/appendFee', res.surcharge);
|
||||
@ -818,7 +818,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
...this.sf6.value,
|
||||
expenseDTOList: expenseList,
|
||||
paymentDays: this.sf7.value.paymentDays,
|
||||
insuranceType:this.sf55.value.insuranceType,
|
||||
insuranceType: this.sf55.value.insuranceType,
|
||||
};
|
||||
|
||||
let reqUrl = this.service.$api_consignWhole;
|
||||
@ -977,63 +977,63 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
// 装卸货地址互换
|
||||
swapAddress(){
|
||||
this.startInfo.forEach((element:any, index:any) => {
|
||||
this.validateForm1.removeControl(`loadAddress${index}`);
|
||||
this.validateForm1.removeControl(`loadName${index}`);
|
||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||
});
|
||||
this.endInfo.forEach((element:any, index:any) => {
|
||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||
this.validateForm1.removeControl(`unloadName${index}`);
|
||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||
});
|
||||
|
||||
let item = this.startInfo;
|
||||
this.startInfo = this.endInfo;
|
||||
this.endInfo = item;
|
||||
|
||||
this.startInfo.forEach((element:any,index:any) => {
|
||||
element.type = '1';
|
||||
this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||
});
|
||||
this.endInfo.forEach((element:any,index:any) => {
|
||||
element.type = '2';
|
||||
this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||
});
|
||||
|
||||
// 计算里程,时间
|
||||
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
||||
// 装卸货地址互换
|
||||
swapAddress() {
|
||||
this.startInfo.forEach((element: any, index: any) => {
|
||||
this.validateForm1.removeControl(`loadAddress${index}`);
|
||||
this.validateForm1.removeControl(`loadName${index}`);
|
||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||
});
|
||||
this.endInfo.forEach((element: any, index: any) => {
|
||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||
this.validateForm1.removeControl(`unloadName${index}`);
|
||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||
});
|
||||
|
||||
let item = this.startInfo;
|
||||
this.startInfo = this.endInfo;
|
||||
this.endInfo = item;
|
||||
|
||||
this.startInfo.forEach((element: any, index: any) => {
|
||||
element.type = '1';
|
||||
this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||
});
|
||||
this.endInfo.forEach((element: any, index: any) => {
|
||||
element.type = '2';
|
||||
this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||
});
|
||||
|
||||
// 计算里程,时间
|
||||
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
||||
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
|
||||
this.totalDistance = res.distance;
|
||||
this.totalTime = res.time;
|
||||
});
|
||||
}
|
||||
}
|
||||
goodsValuesChange(value: any) {
|
||||
console.log(value);
|
||||
console.log(this.totalDistance);
|
||||
|
||||
if(value >= 50000 && this.totalDistance > 0){
|
||||
const params = {
|
||||
goodsValue: value,
|
||||
insuranceType: this.sf55.value.insuranceType,
|
||||
km: this.totalDistance
|
||||
};
|
||||
this.service
|
||||
.request(this.service.$api_getWholeInsuranceInfo, params)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.sf5.setValue('/insurancePremium',res.insurancePremium);
|
||||
}else{
|
||||
this.sf5.setValue('/insurancePremium',null);
|
||||
}
|
||||
}
|
||||
goodsValuesChange(value: any) {
|
||||
console.log(value);
|
||||
console.log(this.totalDistance);
|
||||
|
||||
if (value >= 50000 && this.totalDistance > 0) {
|
||||
const params = {
|
||||
goodsValue: value,
|
||||
insuranceType: this.sf55.value.insuranceType,
|
||||
km: this.totalDistance
|
||||
};
|
||||
this.service
|
||||
.request(this.service.$api_getWholeInsuranceInfo, params)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.sf5.setValue('/insurancePremium', res.insurancePremium);
|
||||
} else {
|
||||
this.sf5.setValue('/insurancePremium', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
private router: Router,
|
||||
private ar: ActivatedRoute,
|
||||
public shipperSrv: ShipperBaseService
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
@ -147,7 +147,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
/**
|
||||
* 导入货源
|
||||
*/
|
||||
importGoodsSource() {}
|
||||
importGoodsSource() { }
|
||||
|
||||
/**
|
||||
* 修改运费
|
||||
@ -382,7 +382,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
// _$expand: (value: boolean) => value
|
||||
// },
|
||||
// allowClear: true,
|
||||
// containsAllLable: true,
|
||||
// containsAllLabel: true,
|
||||
// asyncData: () => this.shipperSrv.getEnterpriseProject(this.sf.value?.shipperAppUserId)
|
||||
// } as SFSelectWidgetSchema
|
||||
// },
|
||||
@ -402,7 +402,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
containsAllLable: true,
|
||||
containsAllLabel: true,
|
||||
params: { dictKey: 'service:type' },
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
@ -416,7 +416,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
allowClear: true,
|
||||
containsAllLable: true,
|
||||
containsAllLabel: true,
|
||||
params: { dictKey: 'goodresource:audit:status' },
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
|
||||
Reference in New Issue
Block a user