diff --git a/src/app/routes/order-management/components/bulk/bulk.component.ts b/src/app/routes/order-management/components/bulk/bulk.component.ts index 0df8b3e4..7c8698ee 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.ts +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -168,7 +168,24 @@ tabs = { }, shipperAppUserId: { type: 'string', - title: '货主' + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + onSearch: (q: any) => { + console.log(q) + if (!!q) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + } as SFSelectWidgetSchema, }, loadingPlace: { type: 'string', @@ -200,7 +217,7 @@ tabs = { if (!!q) { return this.service .request(this.service.$api_get_getDriverInfo, { keyword: q, model: 1, type: 1 }) - .pipe(map(res => (res as any[]).map(i => ({ label: i.name, value: i.id } as SFSchemaEnum)))) + .pipe(map(res => (res as any[]).map(i => ({ label: i.name, value: i.appUserId } as SFSchemaEnum)))) .toPromise(); } else { return of([]); @@ -301,7 +318,7 @@ tabs = { }, }, }, - enterpriseInfoName: { + enterpriseInfoId: { type: 'string', title: '网络货运人', ui: { @@ -327,7 +344,7 @@ tabs = { // asyncData: () => this.getCatalogueMember(), // }, // }, - goodsTypeId: { + goodsNameId: { type: 'string', title: '货物名称', ui: { diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.ts b/src/app/routes/order-management/components/vehicle/vehicle.component.ts index 39e964e7..f0aca842 100644 --- a/src/app/routes/order-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.ts @@ -213,7 +213,7 @@ resourceStatus: any; if (!!q) { return this.service .request(this.service.$api_get_getDriverInfo, { keyword: q, model: 1, type: 1 }) - .pipe(map(res => (res as any[]).map(i => ({ label: i.name, value: i.id } as SFSchemaEnum)))) + .pipe(map(res => (res as any[]).map(i => ({ label: i.name, value: i.appUserId } as SFSchemaEnum)))) .toPromise(); } else { return of([]); @@ -225,7 +225,7 @@ resourceStatus: any; } as SFSelectWidgetSchema }, - carNo: { + plateNumber: { title: '车牌号', type: 'string', ui: { @@ -274,12 +274,12 @@ resourceStatus: any; }, } as SFSelectWidgetSchema, }, - paymentstatus: { + paymentStatus: { title: '支付状态', type: 'string', ui: { widget: 'dict-select', - params: { dictKey: 'payment:status' }, + params: { dictKey: 'bill:payexpense:status' }, containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, @@ -327,15 +327,25 @@ resourceStatus: any; asyncData: () => this.service2.getNetworkFreightForwarder(), }, }, - goodsName: { + goodsNameId: { type: 'string', title: '货物名称', ui: { + widget: 'select', placeholder: '请选择', + errors: { required: '请选择货物类型' }, visibleIf: { _$expand: (value: boolean) => value, }, - }, + asyncData: () => + this.service2.loadConfigByKey('goods.name.config.type').pipe( + map((data: any) => { + return data[0].children?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ), + } as SFSelectWidgetSchema }, serviceType: { title: '服务类型', diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.html b/src/app/routes/supply-management/components/bulk/bulk.component.html index a75fd18e..d69addd7 100644 --- a/src/app/routes/supply-management/components/bulk/bulk.component.html +++ b/src/app/routes/supply-management/components/bulk/bulk.component.html @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.ts b/src/app/routes/supply-management/components/bulk/bulk.component.ts index 78367202..f37c3c6f 100644 --- a/src/app/routes/supply-management/components/bulk/bulk.component.ts +++ b/src/app/routes/supply-management/components/bulk/bulk.component.ts @@ -23,6 +23,7 @@ export class SupplyManagementBulkComponent implements OnInit { schema: SFSchema = {}; auditMany = false; isVisible = false; + auditID: any; _$expand = false; columns: STColumn[] = []; freightSchema: SFSchema = {}; @@ -131,7 +132,7 @@ export class SupplyManagementBulkComponent implements OnInit { }, } as SFDateWidgetSchema, }, - enterpriseInfoName: { + enterpriseInfoId: { type: 'string', title: '网络货运人', ui: { @@ -411,13 +412,25 @@ export class SupplyManagementBulkComponent implements OnInit { } /** * 审核 + * status : 1 单个 2:批量 + * value : 单个单条数据 */ audit(value: any, status?: any) { console.log(value) console.log(status) if(status === 2) { + if(this.selectedRows.length <= 0) { + this.service.msgSrv.error('未选择货源单!'); + return + } + let list: any[] = []; + this.selectedRows.forEach(item => { + list.push(item.id); + }); + this.auditID = list; this.auditMany = true; } else { + this.auditID = value.id this.auditMany = false; } this.isVisible = true; @@ -437,8 +450,46 @@ export class SupplyManagementBulkComponent implements OnInit { /** * 审核通过按钮 */ - handleOK() { - + handleOK(value: any) { + if(this.selectedRows.length <= 0) { + const params: any = { + id: this.auditID, + remarks: this.sfFre.value.remarks, + } + if(value == 1) { + params.auditStatus = 2 + } else { + params.auditStatus = 3 + } + console.log(params) + this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }) + } else { + const params: any = { + ids: this.auditID, + remarks: this.sfFre.value.remarks, + } + if(value == 1) { + params.auditStatus = 2 + } else { + params.auditStatus = 3 + } + console.log(params) + this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }) + } } // 修改单价 modification(item: any) { diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.html b/src/app/routes/supply-management/components/vehicle/vehicle.component.html index 811ab758..8f9f0b46 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.html +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.html @@ -1,7 +1,7 @@