diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts index b9ce6987..763173d1 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts @@ -219,13 +219,23 @@ export class SupplyManagementBulkPublishComponent implements OnInit { // } } }, + goodsName: { + type: 'string', + title: '货物名称', + ui: { + // hidden: true, + // visibleIf: { + // goodsTypeName: (value: any) => value && value !== '其它' + // } + } + }, goodsTypeId: { type: 'string', - title: '货物类型', + title: '', ui: { widget: 'select', placeholder: '请选择', - errors: { required: '请选择货物类型' }, + errors: { required: '请选择货物名称' }, asyncData: () => this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( map((data: any) => { @@ -247,47 +257,38 @@ export class SupplyManagementBulkPublishComponent 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 === '其它' - }, - blur: (value: any) => { - this.checkGoodsName(); - } - } - } + + // goodsName1: { + // type: 'string', + // title: '', + // maxLength: 20, + // ui: { + // errors: { required: '请填写货物名称' }, + // visibleIf: { + // goodsTypeName: (value: any) => value && value === '其它' + // }, + // blur: (value: any) => { + // this.checkGoodsName(); + // } + // } + // }, + // 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 !== '其它' + // } + // } + // }, }, - required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] + required: ['goodsTypeId', 'goodsName', ] }; this.ui3 = { '*': { @@ -708,10 +709,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit { const LoadingList = this.startInfo.concat(this.endInfo); // 货物信息 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']; } diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts index 18ebcb55..95133f57 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts @@ -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'] } diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 354ed480..3e81a823 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -264,13 +264,23 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { // } } }, + goodsName: { + type: 'string', + title: '货物名称', + ui: { + // hidden: true, + // visibleIf: { + // goodsTypeName: (value: any) => value && value !== '其它' + // } + } + }, goodsTypeId: { type: 'string', - title: '货物类型', + title: '', ui: { widget: 'select', placeholder: '请选择', - errors: { required: '请选择货物类型' }, + errors: { required: '请选择货物名称' }, asyncData: () => this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( map((data: any) => { @@ -292,47 +302,38 @@ export class SupplyManagementOnecarPublishComponent 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 === '其它' - }, - blur: (value: any) => { - this.checkGoodsName(); - } - } - } + + // goodsName1: { + // type: 'string', + // title: '', + // maxLength: 20, + // ui: { + // errors: { required: '请填写货物名称' }, + // visibleIf: { + // goodsTypeName: (value: any) => value && value === '其它' + // }, + // blur: (value: any) => { + // this.checkGoodsName(); + // } + // } + // }, + // 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 !== '其它' + // } + // } + // }, }, - required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] + required: ['goodsTypeId', 'goodsName', ] }; this.ui3 = { '*': { @@ -1013,10 +1014,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { // 货物信息 const sf3Values = { ...this.sf3.value }; - if (sf3Values.goodsTypeName === '其它') { - sf3Values.goodsName = sf3Values.goodsName1; - delete sf3Values.goodsName1; - } + console.log(sf3Values); + if (this.sf4.value.carModel.includes('999')) { this.sf4.value.carModel = ['999']; } diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index 6fd3cd8e..e2bc4dd8 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -251,13 +251,23 @@ export class SupplyManagementReleasePublishComponent implements OnInit { // } } }, + goodsName: { + type: 'string', + title: '货物名称', + ui: { + // hidden: true, + // visibleIf: { + // goodsTypeName: (value: any) => value && value !== '其它' + // } + } + }, goodsTypeId: { type: 'string', - title: '货物类型', + title: '', ui: { widget: 'select', placeholder: '请选择', - errors: { required: '请选择货物类型' }, + errors: { required: '请选择货物名称' }, asyncData: () => this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( map((data: any) => { @@ -279,47 +289,38 @@ export class SupplyManagementReleasePublishComponent 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 === '其它' - }, - blur: (value: any) => { - this.checkGoodsName(); - } - } - } + + // goodsName1: { + // type: 'string', + // title: '', + // maxLength: 20, + // ui: { + // errors: { required: '请填写货物名称' }, + // visibleIf: { + // goodsTypeName: (value: any) => value && value === '其它' + // }, + // blur: (value: any) => { + // this.checkGoodsName(); + // } + // } + // }, + // 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 !== '其它' + // } + // } + // }, }, - required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] + required: ['goodsTypeId', 'goodsName', ] }; this.ui3 = { '*': { @@ -978,10 +979,6 @@ export class SupplyManagementReleasePublishComponent 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']; } @@ -1020,19 +1017,18 @@ export class SupplyManagementReleasePublishComponent implements OnInit { insurancePackagedGoods: this.sf4.value.insurancePackagedGoods, goodsValue: this.sf4.value.goodsValue }; - console.log(params); - // const modalRef = this.modalService.create({ - // nzTitle: '运输协议', - // nzContent: TranAgreementComponent, - // nzWidth: 900, - // nzFooter: null, - // nzComponentParams: { object: params, shipperName: this.shipperName, type: 'onecar' } - // }); - // modalRef.afterClose.subscribe(result => { - // if (result) { - // this.submit(submitType, params); - // } - // }); + const modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { object: params, shipperName: this.shipperName, type: 'onecar' } + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType, params); + } + }); } // 提交 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 => { if (res === false) { const modalRef = this.modalService.error({ - nzTitle: '货物类型含有违禁词,请重新输入!', + nzTitle: '货物名称含有违禁词,请重新输入!', }); modalRef.afterClose.subscribe(result => { // this.sf3.setValue('/goodsName1', null);