Merge branch 'develop'
This commit is contained in:
		| @ -5,7 +5,7 @@ import { OnChanges } from '@angular/core'; | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-05 11:01:55 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-04-27 11:13:07 | ||||
|  * @LastEditTime : 2022-04-27 20:19:39 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.ts | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
|  */ | ||||
| @ -87,7 +87,6 @@ export class ContractManagementTemplateTextComponent implements OnInit { | ||||
|             widget: 'select', | ||||
|             placeholder: '请选择', | ||||
|             change: (tag: any, org: any) => { | ||||
|               console.log(tag); | ||||
|               switch (tag) { | ||||
|                 case 'MX': | ||||
|                   this.Types = [ | ||||
| @ -95,7 +94,7 @@ export class ContractManagementTemplateTextComponent implements OnInit { | ||||
|                     { label: '订单补充协议', value: '2' }, | ||||
|                     { label: '运单合同', value: '3' }, | ||||
|                     { label: '运单补充协议', value: '4' }, | ||||
|                     { label: '委托代收合同', value: '5' }, | ||||
|                     { label: '委托代收合同', value: '5' } | ||||
|                   ]; | ||||
|                   this.sf.getProperty('/contractType')!.schema.enum = this.Types; | ||||
|                   this.sf.getProperty('/contractType')!.widget.reset(this.Types); | ||||
| @ -176,7 +175,7 @@ export class ContractManagementTemplateTextComponent implements OnInit { | ||||
|           } | ||||
|         } | ||||
|       }, | ||||
|       required: ['templateName', 'templateType','contractType'] | ||||
|       required: ['templateName', 'templateType', 'contractType'] | ||||
|     }; | ||||
|     this.ui = { | ||||
|       '*': { | ||||
| @ -204,14 +203,69 @@ export class ContractManagementTemplateTextComponent implements OnInit { | ||||
|     }; | ||||
|   } | ||||
|   initData(url: string) { | ||||
|     console.log('编辑'); | ||||
|  | ||||
|     this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => { | ||||
|       if (res) { | ||||
|         this.detailList = res; | ||||
|         this.title = this.detailList?.templateName; | ||||
|         this.sfdata = res; | ||||
|         this.sfdata2 = res; | ||||
|      | ||||
|         switch (res.templateType) { | ||||
|           case 'MX': | ||||
|             let Types1 = [ | ||||
|               { label: '订单合同', value: '1' }, | ||||
|               { label: '订单补充协议', value: '2' }, | ||||
|               { label: '运单合同', value: '3' }, | ||||
|               { label: '运单补充协议', value: '4' }, | ||||
|               { label: '委托代收合同', value: '5' } | ||||
|             ]; | ||||
|             setTimeout(() => { | ||||
|               if (this.sf) { | ||||
|                 this.sf.getProperty('/contractType')!.schema.enum = Types1; | ||||
|                 this.sf.getProperty('/contractType')!.widget.reset(Types1); | ||||
|                 if (res.contractType) { | ||||
|                   this.sf.setValue('/contractType', res.contractType); | ||||
|                 } | ||||
|               } | ||||
|             }); | ||||
|  | ||||
|             return; | ||||
|             break; | ||||
|           case 'KJ': | ||||
|             const Types2 = [ | ||||
|               { label: '网络货物运输服务合同', value: '6' }, | ||||
|               { label: '运输服务承揽合同', value: '7' } | ||||
|             ]; | ||||
|             setTimeout(() => { | ||||
|               if (this.sf) { | ||||
|                 this.sf.getProperty('/contractType')!.schema.enum = Types2; | ||||
|                 this.sf.getProperty('/contractType')!.widget.reset(Types2); | ||||
|                 if (res.contractType) { | ||||
|                   this.sf.setValue('/contractType', res.contractType); | ||||
|                 } | ||||
|               } | ||||
|             }); | ||||
|             return; | ||||
|             break; | ||||
|           case 'HHR': | ||||
|             const Types3 = [ | ||||
|               { label: '企业合伙人入驻合同', value: '8' }, | ||||
|               { label: '个人合伙人入驻合同', value: '9' } | ||||
|             ]; | ||||
|             setTimeout(() => { | ||||
|               if (this.sf) { | ||||
|                 this.sf.getProperty('/contractType')!.schema.enum = Types3; | ||||
|                 this.sf.getProperty('/contractType')!.widget.reset(Types3); | ||||
|                 if (res.contractType) { | ||||
|                   this.sf.setValue('/contractType', res.contractType); | ||||
|                 } | ||||
|               } | ||||
|             }); | ||||
|             return; | ||||
|             break; | ||||
|           default: | ||||
|             break; | ||||
|         } | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
| @ -220,13 +274,12 @@ export class ContractManagementTemplateTextComponent implements OnInit { | ||||
|   } | ||||
|  | ||||
|   save() { | ||||
|     console.log(this.sf.value.templateName); | ||||
|     console.log(this.sf.value.templateType); | ||||
|     console.log(this.sf2.value.templateContent); | ||||
|     console.log(this.title); | ||||
|     console.log(this.title || this.detailList.templateName); | ||||
|      | ||||
|     if (!this.sf.value.templateName || !this.sf.value.templateType || !this.sf2.value.templateContent || !(this.title || this.detailList.templateName)) { | ||||
|     if ( | ||||
|       !this.sf.value.templateName || | ||||
|       !this.sf.value.templateType || | ||||
|       !this.sf2.value.templateContent || | ||||
|       !(this.title || this.detailList.templateName) | ||||
|     ) { | ||||
|       this.service.msgSrv.error('必填参数为空,请检查再重新保存!'); | ||||
|       return; | ||||
|     } | ||||
| @ -239,9 +292,8 @@ export class ContractManagementTemplateTextComponent implements OnInit { | ||||
|     const params = { | ||||
|       ...this.sf.value, | ||||
|       ...this.sf2.value, | ||||
|       templateTitle: this.title || this.detailList.templateName | ||||
|       templateTitle: this.detailList.templateName || this.title | ||||
|     }; | ||||
|     console.log(params); | ||||
|     this.service.request(this.service.$api_save_contractTemplate, params).subscribe((res: any) => { | ||||
|       if (res) { | ||||
|         this.service.msgSrv.success('保存成功!'); | ||||
| @ -249,4 +301,5 @@ export class ContractManagementTemplateTextComponent implements OnInit { | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|   EditType() {} | ||||
| } | ||||
|  | ||||
| @ -125,6 +125,7 @@ export class ContractManagementTemplateFrameComponent implements OnInit { | ||||
|       { | ||||
|         title: '合同模板名称', | ||||
|         className: 'text-center', | ||||
|         width: '300px', | ||||
|         render: 'templateName' | ||||
|       }, | ||||
|       { | ||||
| @ -135,7 +136,7 @@ export class ContractManagementTemplateFrameComponent implements OnInit { | ||||
|       }, | ||||
|       { | ||||
|         title: '合同类型', | ||||
|         width: '100px', | ||||
|         width: '200px', | ||||
|         className: 'text-center', | ||||
|         index: 'contractTypeLabel' | ||||
|       }, | ||||
|  | ||||
| @ -125,6 +125,7 @@ export class ContractManagementTemplatePartnerComponent implements OnInit { | ||||
|       { | ||||
|         title: '合同模板名称', | ||||
|         className: 'text-center', | ||||
|         width: '300px', | ||||
|         render: 'templateName' | ||||
|       }, | ||||
|       { | ||||
| @ -135,7 +136,7 @@ export class ContractManagementTemplatePartnerComponent implements OnInit { | ||||
|       }, | ||||
|       { | ||||
|         title: '合同类型', | ||||
|         width: '100px', | ||||
|         width: '200px', | ||||
|         className: 'text-center', | ||||
|         index: 'contractTypeLabel' | ||||
|       }, | ||||
|  | ||||
| @ -125,6 +125,7 @@ export class ContractManagementTemplateDetailComponent implements OnInit { | ||||
|       { | ||||
|         title: '合同模板名称', | ||||
|         className: 'text-center', | ||||
|         width: '300px', | ||||
|         render: 'templateName' | ||||
|       }, | ||||
|       { | ||||
| @ -135,7 +136,7 @@ export class ContractManagementTemplateDetailComponent implements OnInit { | ||||
|       }, | ||||
|       { | ||||
|         title: '合同类型', | ||||
|         width: '100px', | ||||
|         width: '200px', | ||||
|         className: 'text-center', | ||||
|         index: 'contractTypeLabel' | ||||
|       }, | ||||
|  | ||||
| @ -741,6 +741,13 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { | ||||
|       fuelCardAmount: oilCardPay, | ||||
|       resourcetype: '1' | ||||
|     }; | ||||
|     if(!this?.sf1.value?.shipperAppUserId || !this?.sf1.value?.enterpriseInfoName) { | ||||
|       this.service.msgSrv.warning('请先选择货主和网络货运人!'); | ||||
|       this.sf7.setValue('/prePay', 0); | ||||
|       this.sf7.setValue('/toPay', 0); | ||||
|       this.sf7.setValue('/receiptPay', 0); | ||||
|       return | ||||
|     } | ||||
|     this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { | ||||
|       if (res) { | ||||
|         this.sf7.setValue('/appendFee', res.surcharge); | ||||
|  | ||||
| @ -761,6 +761,13 @@ export class SupplyManagementReleasePublishComponent implements OnInit { | ||||
|       fuelCardAmount: oilCardPay, | ||||
|       resourcetype: '1' | ||||
|     }; | ||||
|     if(!this?.sf1.value?.shipperAppUserId || !this?.sf1.value?.enterpriseInfoName) { | ||||
|       this.service.msgSrv.warning('请先选择货主和网络货运人!'); | ||||
|       this.sf7.setValue('/prePay', 0); | ||||
|       this.sf7.setValue('/toPay', 0); | ||||
|       this.sf7.setValue('/receiptPay', 0); | ||||
|       return | ||||
|     } | ||||
|     this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { | ||||
|       if (res) { | ||||
|         this.sf7.setValue('/appendFee', res.surcharge); | ||||
| @ -994,18 +1001,18 @@ export class SupplyManagementReleasePublishComponent implements OnInit { | ||||
|       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 { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user