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

@ -219,13 +219,23 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
// } // }
} }
}, },
goodsName: {
type: 'string',
title: '货物名称',
ui: {
// hidden: true,
// visibleIf: {
// goodsTypeName: (value: any) => value && value !== '其它'
// }
}
},
goodsTypeId: { goodsTypeId: {
type: 'string', type: 'string',
title: '货物类型', title: '',
ui: { ui: {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
errors: { required: '请选择货物类型' }, errors: { required: '请选择货物名称' },
asyncData: () => asyncData: () =>
this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => { map((data: any) => {
@ -247,47 +257,38 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
hidden: true hidden: true
} }
}, },
goodsNameId: {
type: 'string', // goodsName1: {
title: '', // type: 'string',
ui: { // title: '',
widget: 'select', // maxLength: 20,
placeholder: '请选择', // ui: {
errors: { required: '请填写货物类型' }, // errors: { required: '请填写货物名称' },
change: (value: any, data: any) => { // visibleIf: {
this.sf3.setValue('/goodsName', data.label); // goodsTypeName: (value: any) => value && value === '其它'
}, // },
visibleIf: { // blur: (value: any) => {
goodsTypeName: (value: any) => value && value !== '其它' // this.checkGoodsName();
} // }
} // }
}, // },
goodsName: { // goodsNameId: {
type: 'string', // type: 'string',
title: '', // title: '',
ui: { // ui: {
hidden: true, // widget: 'select',
visibleIf: { // placeholder: '请选择',
goodsTypeName: (value: any) => value && value !== '其它' // errors: { required: '请填写货物名称' },
} // change: (value: any, data: any) => {
} // // this.sf3.setValue('/goodsName', data.label);
}, // },
goodsName1: { // visibleIf: {
type: 'string', // goodsTypeName: (value: any) => value && value !== '其它'
title: '', // }
maxLength: 20, // }
ui: { // },
errors: { required: '请填写货物类型' },
visibleIf: {
goodsTypeName: (value: any) => value && value === '其它'
},
blur: (value: any) => {
this.checkGoodsName();
}
}
}
}, },
required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] required: ['goodsTypeId', 'goodsName', ]
}; };
this.ui3 = { this.ui3 = {
'*': { '*': {
@ -708,10 +709,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
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 === '其它') {
sf3Values.goodsName = 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'];
} }

View File

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

View File

@ -264,13 +264,23 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
// } // }
} }
}, },
goodsName: {
type: 'string',
title: '货物名称',
ui: {
// hidden: true,
// visibleIf: {
// goodsTypeName: (value: any) => value && value !== '其它'
// }
}
},
goodsTypeId: { goodsTypeId: {
type: 'string', type: 'string',
title: '货物类型', title: '',
ui: { ui: {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
errors: { required: '请选择货物类型' }, errors: { required: '请选择货物名称' },
asyncData: () => asyncData: () =>
this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => { map((data: any) => {
@ -292,47 +302,38 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
hidden: true hidden: true
} }
}, },
goodsNameId: {
type: 'string', // goodsName1: {
title: '', // type: 'string',
ui: { // title: '',
widget: 'select', // maxLength: 20,
placeholder: '请选择', // ui: {
errors: { required: '请填写货物类型' }, // errors: { required: '请填写货物名称' },
change: (_value: any, data: any) => { // visibleIf: {
this.sf3.setValue('/goodsName', data.label); // goodsTypeName: (value: any) => value && value === '其它'
}, // },
visibleIf: { // blur: (value: any) => {
goodsTypeName: (value: any) => value && value !== '其它' // this.checkGoodsName();
} // }
} // }
}, // },
goodsName: { // goodsNameId: {
type: 'string', // type: 'string',
title: '', // title: '',
ui: { // ui: {
hidden: true, // widget: 'select',
visibleIf: { // placeholder: '请选择',
goodsTypeName: (value: any) => value && value !== '其它' // errors: { required: '请填写货物名称' },
} // change: (value: any, data: any) => {
} // // this.sf3.setValue('/goodsName', data.label);
}, // },
goodsName1: { // visibleIf: {
type: 'string', // goodsTypeName: (value: any) => value && value !== '其它'
title: '', // }
maxLength: 20, // }
ui: { // },
errors: { required: '请填写货物类型' },
visibleIf: {
goodsTypeName: (value: any) => value && value === '其它'
},
blur: (value: any) => {
this.checkGoodsName();
}
}
}
}, },
required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] required: ['goodsTypeId', 'goodsName', ]
}; };
this.ui3 = { this.ui3 = {
'*': { '*': {
@ -1013,10 +1014,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
// 货物信息 // 货物信息
const sf3Values = { ...this.sf3.value }; const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') { console.log(sf3Values);
sf3Values.goodsName = 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'];
} }

View File

@ -251,13 +251,23 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
// } // }
} }
}, },
goodsName: {
type: 'string',
title: '货物名称',
ui: {
// hidden: true,
// visibleIf: {
// goodsTypeName: (value: any) => value && value !== '其它'
// }
}
},
goodsTypeId: { goodsTypeId: {
type: 'string', type: 'string',
title: '货物类型', title: '',
ui: { ui: {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
errors: { required: '请选择货物类型' }, errors: { required: '请选择货物名称' },
asyncData: () => asyncData: () =>
this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => { map((data: any) => {
@ -279,47 +289,38 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
hidden: true hidden: true
} }
}, },
goodsNameId: {
type: 'string', // goodsName1: {
title: '', // type: 'string',
ui: { // title: '',
widget: 'select', // maxLength: 20,
placeholder: '请选择', // ui: {
errors: { required: '请填写货物类型' }, // errors: { required: '请填写货物名称' },
change: (value: any, data: any) => { // visibleIf: {
this.sf3.setValue('/goodsName', data.label); // goodsTypeName: (value: any) => value && value === '其它'
}, // },
visibleIf: { // blur: (value: any) => {
goodsTypeName: (value: any) => value && value !== '其它' // this.checkGoodsName();
} // }
} // }
}, // },
goodsName: { // goodsNameId: {
type: 'string', // type: 'string',
title: '', // title: '',
ui: { // ui: {
hidden: true, // widget: 'select',
visibleIf: { // placeholder: '请选择',
goodsTypeName: (value: any) => value && value !== '其它' // errors: { required: '请填写货物名称' },
} // change: (value: any, data: any) => {
} // // this.sf3.setValue('/goodsName', data.label);
}, // },
goodsName1: { // visibleIf: {
type: 'string', // goodsTypeName: (value: any) => value && value !== '其它'
title: '', // }
maxLength: 20, // }
ui: { // },
errors: { required: '请填写货物类型' },
visibleIf: {
goodsTypeName: (value: any) => value && value === '其它'
},
blur: (value: any) => {
this.checkGoodsName();
}
}
}
}, },
required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] required: ['goodsTypeId', 'goodsName', ]
}; };
this.ui3 = { this.ui3 = {
'*': { '*': {
@ -978,10 +979,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
// 货物信息 // 货物信息
const sf3Values = { ...this.sf3.value }; const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') {
sf3Values.goodsName = 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'];
} }
@ -1020,19 +1017,18 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
insurancePackagedGoods: this.sf4.value.insurancePackagedGoods, insurancePackagedGoods: this.sf4.value.insurancePackagedGoods,
goodsValue: this.sf4.value.goodsValue goodsValue: this.sf4.value.goodsValue
}; };
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, shipperName: this.shipperName, type: 'onecar' }
// nzComponentParams: { object: params, shipperName: this.shipperName, type: 'onecar' } });
// }); 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 {
@ -1287,7 +1283,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.service.request(this.service.$api_checkGoodsName, name).subscribe(res => { this.service.request(this.service.$api_checkGoodsName, name).subscribe(res => {
if (res === false) { if (res === false) {
const modalRef = this.modalService.error({ const modalRef = this.modalService.error({
nzTitle: '货物类型含有违禁词,请重新输入!', nzTitle: '货物名称含有违禁词,请重新输入!',
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
// this.sf3.setValue('/goodsName1', null); // this.sf3.setValue('/goodsName1', null);