edit
This commit is contained in:
		| @ -172,9 +172,15 @@ export class InvoiceDetailComponent implements OnInit { | |||||||
|           title: '所属项目', |           title: '所属项目', | ||||||
|           ui: { |           ui: { | ||||||
|             widget: 'select', |             widget: 'select', | ||||||
|             placeholder: '请选择', |             serverSearch: true, | ||||||
|  |             searchDebounceTime: 300, | ||||||
|  |             searchLoadingText: '搜索中...', | ||||||
|             allowClear: true, |             allowClear: true, | ||||||
|             asyncData: () => this.service.getEnterpriseProject({ id: this.ltdId }) |             onSearch: (q: any) => this.service.getProjectList({ projectName: q, enterpriseId: this.headerInfo?.shipperId }) | ||||||
|  |             // widget: 'select', | ||||||
|  |             // placeholder: '请选择', | ||||||
|  |             // allowClear: true, | ||||||
|  |             // asyncData: () => this.service.getEnterpriseProject({ id: this.ltdId }) | ||||||
|           }, |           }, | ||||||
|           default: '' |           default: '' | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -284,10 +284,14 @@ export class InvoiceRequestedDetailComponent implements OnInit { | |||||||
|           default: '', |           default: '', | ||||||
|           ui: { |           ui: { | ||||||
|             widget: 'select', |             widget: 'select', | ||||||
|  |             serverSearch: true, | ||||||
|  |             searchDebounceTime: 300, | ||||||
|  |             searchLoadingText: '搜索中...', | ||||||
|  |             allowClear: true, | ||||||
|  |             onSearch: (q: any) => this.service.getProjectList({ projectName: q, enterpriseId: this.headerInfo?.shipperId }), | ||||||
|             visibleIf: { |             visibleIf: { | ||||||
|               expand: (value: boolean) => value |               expand: (value: boolean) => value | ||||||
|             }, |             } | ||||||
|             asyncData: () => this.service.getEnterpriseProject() |  | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -26,6 +26,8 @@ export class ShipperBaseService extends BaseService { | |||||||
|  |  | ||||||
|   // 获取货主企业列表 |   // 获取货主企业列表 | ||||||
|   public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; |   public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; | ||||||
|  |   // 批量获取项目信息 | ||||||
|  |   public $api_get_project_list = '/api/mdc/cuc/enterpriseProject/getProjectList'; | ||||||
|   constructor(public injector: Injector) { |   constructor(public injector: Injector) { | ||||||
|     super(injector); |     super(injector); | ||||||
|   } |   } | ||||||
| @ -247,6 +249,35 @@ export class ShipperBaseService extends BaseService { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 批量获取项目信息 | ||||||
|  |    * @returns | ||||||
|  |    */ | ||||||
|  |   getProjectList(params = { projectName: '', enterpriseId: '' }, containerAll = false) { | ||||||
|  |     let str = params.projectName.replace(/^\s+|\s+$/g, ''); | ||||||
|  |     if (str) { | ||||||
|  |       return this.request(this.$api_get_project_list, params) | ||||||
|  |         .pipe( | ||||||
|  |           map((res: any) => { | ||||||
|  |             if (!res) { | ||||||
|  |               return []; | ||||||
|  |             } | ||||||
|  |             const list = res.map((item: any) => { | ||||||
|  |               return { label: item.projectName, value: item.id }; | ||||||
|  |             }); | ||||||
|  |             const obj = []; | ||||||
|  |             if (containerAll) { | ||||||
|  |               obj.push({ label: '全部', value: '' }); | ||||||
|  |             } | ||||||
|  |             return [...obj, ...list]; | ||||||
|  |           }) | ||||||
|  |         ) | ||||||
|  |         .toPromise(); | ||||||
|  |     } else { | ||||||
|  |       return of([]); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * 获取结算客户 |    * 获取结算客户 | ||||||
|    * @returns |    * @returns | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user