This commit is contained in:
wangshiming
2021-12-14 20:24:42 +08:00
parent 553d22a01e
commit 7bbd8a8bc9
13 changed files with 452 additions and 272 deletions

View File

@ -27,7 +27,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
sf3data: any; // 货源单设置回显
sf4data: any; // 货源单设置回显
sf5data: any; // 货源单设置回显
sf6data: any; // 货源单设置回显
sf7data: any; // 货源单设置回显
creatTime: any; // 货源单设置回显
modifyTime: any; // 货源单设置回显
@ -69,13 +68,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
schema4: SFSchema = {};
ui4!: SFUISchema;
@ViewChild('sf5', { static: false }) sf5!: SFComponent;
schema5: SFSchema = {};
ui5!: SFUISchema;
@ViewChild('sf6', { static: false }) sf6!: SFComponent;
schema6: SFSchema = {};
ui6!: SFUISchema;
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
schema7: SFSchema = {};
@ -95,9 +87,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
// this.initSF2();
this.initSF3();
this.initSF4();
this.initSF5();
this.initSF6();
this.initSF7();
this.initdata();
}
@ -244,13 +234,52 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
initSF4() {
this.schema4 = {
properties: {
freightPrice: {
type: 'string',
title: '运费单价',
ui: {
errors: { required: '请选择运费单价' },
widget: 'custom',
placeholder: '请输入'
}
},
freightType: {
type: 'string',
title: '',
ui: {
hidden: true
},
default: '1'
},
rule: {
type: 'string',
title: '',
ui: {
widget: 'custom',
errors: { required: '请选择运费取整规则' }
}
},
settlementBasis: {
type: 'string',
title: '',
enum: [
{ label: '以收货为准', value: '1' },
{ label: '以发货为准', value: '2' }
],
ui: {
widget: 'select',
placeholder: '结算依据',
errors: { required: '请选择结算依据' }
} as SFSelectWidgetSchema
},
weight: {
type: 'string',
title: '货物数量',
ui: {
widget: 'custom',
placeholder: '请输入',
errors: { required: '必填项' }
errors: { required: '请填写总重量' }
}
},
volume: {
@ -317,13 +346,22 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} as SFSelectWidgetSchema
}
},
required: ['weight', 'maxWeight', 'maxCube']
required: ['weight', 'maxWeight', 'maxCube', 'freightPrice', 'rule', 'settlementBasis']
};
this.ui4 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
},
$freightPrice: {
grid: { span: 8 }
},
$rule: {
grid: { span: 8 }
},
$settlementBasis: {
grid: { span: 8 }
},
$weight: {
grid: { span: 8 }
},
@ -342,112 +380,21 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
};
}
initSF5() {
this.schema5 = {
properties: {
goodsValue: {
type: 'string',
title: '货物价值',
ui: {
widget: 'custom',
placeholder: '请输入'
}
}
}
};
this.ui5 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
}
};
changeValue() {
this.totalFees = Number(this.sf7?.value?.appendFee) + Number(this.sf7?.value?.oilCardPay) + Number(this.sf7?.value?.prePay) + Number(this.sf7?.value?.receiptPay) + Number(this.sf7?.value?.toPay)
console.log(this.totalFees)
}
initSF6() {
this.schema6 = {
this.schema7 = {
properties: {
stateReceipt: {
paymentDays: {
type: 'string',
title: '是否回单',
enum: [
{ label: '需要', value: true },
{ label: '不需要', value: false }
],
ui: {
widget: 'select',
errors: { required: '请选择' },
placeholder: '请选择'
}
},
receiptType: {
type: 'string',
title: '回单类型',
enum: [
{ label: '电子回单', value: 1 },
{ label: '纸质回单', value: 2 }
],
ui: {
widget: 'select',
placeholder: '请选择',
errors: { required: '请选择' },
visibleIf: {
stateReceipt: value => value === true
}
}
},
receiptUserId: {
type: 'string',
title: '选择地址',
title: '到货后',
ui: {
widget: 'custom',
placeholder: '请点击选择收回单地址',
validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
visibleIf: {
receiptType: value => value === '2'
}
},
default: '1212'
},
name4: {
type: 'string',
title: '联系人',
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
},
name5: {
type: 'string',
title: '联系电话',
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
},
name6: {
type: 'string',
title: '所在地区',
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
},
receiptAddress: {
type: 'string',
title: '详细地址',
maxLength: 20,
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
placeholder: '请输入',
errors: { required: '请输入付款承诺天数' }
}
},
remarks: {
type: 'string',
@ -460,31 +407,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} as SFTextareaWidgetSchema
}
},
required: ['stateReceipt', 'receiptType']
};
this.ui6 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
}
};
}
changeValue() {
this.totalFees = Number(this.sf7?.value?.appendFee) + Number(this.sf7?.value?.oilCardPay) + Number(this.sf7?.value?.prePay) + Number(this.sf7?.value?.receiptPay) + Number(this.sf7?.value?.toPay)
console.log(this.totalFees)
}
initSF7() {
this.schema7 = {
properties: {
totalFee: {
type: 'string',
title: '总费用',
ui: {
widget: 'custom',
placeholder: '请输入'
}
}
}
required: ['paymentDays']
};
this.ui7 = {
'*': {
@ -494,6 +417,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
};
}
addStartInfo(event: any) {
if (this.startInfo.length < 5) {
const controlId = this.startInfo.length;
@ -567,9 +491,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
});
}
submit(): void {
console.log('进来了')
console.log(this.startInfo)
debugger;
// Object.keys(this.validateForm1.controls).forEach(key => {
// this.validateForm1.controls[key].markAsDirty();
// this.validateForm1.controls[key].updateValueAndValidity();
@ -577,7 +499,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
// this.sf1.validator({ emitError: true });
// this.sf3.validator({ emitError: true });
// this.sf4.validator({ emitError: true });
// this.sf6.validator({ emitError: true });
// if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
// return;
// }
@ -598,8 +519,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
const params: any = {
...this.sf1.value,
...this.sf5.value,
...this.sf6.value,
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo,],
goodsInfoDTOList: [
{
@ -756,41 +675,37 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
goodsName: res?.goodsInfoVOList[0]?.goodsName || '',
}
this.sf4data = {
weight: res?.goodsInfoVOList[0]?.weight || '',
volume: res?.goodsInfoVOList[0]?.volume || '',
vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand || '',
maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || '',
// weight: res?.goodsInfoVOList[0]?.weight || '',
// volume: res?.goodsInfoVOList[0]?.volume || '',
// vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand || '',
// maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || '',
// maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
// number: res?.goodsInfoVOList[0]?.number || '',
// goodsType: res?.goodsInfoVOList[0]?.goodsType || '',
// modifyTime: res?.goodsInfoVOList[0]?.modifyTime || '',
// modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId || '',
// resourceId: res?.goodsInfoVOList[0]?.resourceId || '',
// rule: res?.goodsInfoVOList[0]?.rule || '',
// settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '',
freightPrice: res?.goodsInfoVOList[0]?.freightPrice || '',
freightType: res?.goodsInfoVOList[0]?.freightType || '',
rule: res?.goodsInfoVOList[0]?.rule || '',
settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '',
weight: res?.goodsInfoVOList[0]?.weight || '',
volume: res?.goodsInfoVOList[0]?.volume || '',
number: res?.goodsInfoVOList[0]?.number || '',
maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
number: res?.goodsInfoVOList[0]?.number || '',
goodsType: res?.goodsInfoVOList[0]?.goodsType || '',
modifyTime: res?.goodsInfoVOList[0]?.modifyTime || '',
modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId || '',
resourceId: res?.goodsInfoVOList[0]?.resourceId || '',
rule: res?.goodsInfoVOList[0]?.rule || '',
settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '',
maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || ''
}
if(this.PageStatus === '大宗修改') {
this.sf4data.id = res?.goodsInfoVOList[0]?.id;
}
this.totalFees = res?.freightPrice || '0';
this.sf5data = {
goodsValue: res?.goodsValue || '',
}
this.sf6data = {
stateReceipt: res?.supplementaryInformationVO?.stateReceipt || '',
receiptType: res?.supplementaryInformationVO?.receiptType || '',
receiptUserId: res?.supplementaryInformationVO?.receiptUserId || '',
remarks: res?.supplementaryInformationVO?.remarks || ''
};
this.sf7data = {
prePay: res?.shippingInformationVO?.prePay || '',
toPay: res?.shippingInformationVO?.toPay || '',
oilCardPay: res?.shippingInformationVO?.oilCardPay || '',
receiptPay: res?.shippingInformationVO?.receiptPay || '',
// subtotal: res?.shippingInformationVO?.oilCardPay || '',
appendFee: res?.shippingInformationVO?.appendFee || '',
paymentDays: res?.shippingInformationVO?.paymentDays || '',
}
paymentDays: res?.paymentDays || '',
remarks: res?.remarks || ''
};
}
}