This commit is contained in:
wangshiming
2022-05-09 16:26:23 +08:00
parent a00fdbf800
commit 3de10b7b4d
4 changed files with 168 additions and 195 deletions

View File

@ -235,13 +235,34 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
initSF3() {
this.schema3 = {
properties: {
goodsTypeId: {
goodsTips: {
type: 'string',
title: '',
ui: {
widget: 'custom',
class: 'goods_Tips_item',
// visibleIf: {
// goodsTypeName: (value: any) => value && value === '其它'
// }
}
},
goodsName: {
type: 'string',
title: '货物名称',
ui: {
// hidden: true,
// visibleIf: {
// goodsTypeName: (value: any) => value && value !== '其它'
// }
}
},
goodsTypeId: {
type: 'string',
title: '',
ui: {
widget: 'select',
placeholder: '请选择',
errors: { required: '请选择货物类型' },
errors: { required: '请选择货物名称' },
asyncData: () =>
this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => {
@ -263,44 +284,8 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
hidden: true
}
},
goodsNameId: {
type: 'string',
title: '',
ui: {
widget: 'select',
placeholder: '请选择',
errors: { required: '请填写货物名称' },
change: (value: any, data: any) => {
this.sf3.setValue('/goodsName', data.label);
},
visibleIf: {
goodsTypeName: (value: any) => value && value !== '其它'
}
}
},
goodsName: {
type: 'string',
title: '',
ui: {
hidden: true,
visibleIf: {
goodsTypeName: (value: any) => value && value !== '其它'
}
}
},
goodsName1: {
type: 'string',
title: '',
maxLength: 20,
ui: {
errors: { required: '请填写货物名称' },
visibleIf: {
goodsTypeName: (value: any) => value && value === '其它'
}
}
}
},
required: ['goodsTypeId', 'goodsName', 'goodsNameId','goodsName1']
required: ['goodsTypeId', 'goodsName', ]
};
this.ui3 = {
'*': {
@ -624,10 +609,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
// 货物信息
const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') {
sf3Values.goodsName = sf3Values.goodsName1;
delete sf3Values.goodsName1;
}
if (this.sf4.value.carModel.includes('999')) {
this.sf4.value.carModel = ['999']
}