批量审核
This commit is contained in:
		| @ -1,17 +1,22 @@ | ||||
| <!-- | ||||
|  * @Author: your name | ||||
|  * @Date: 2021-12-14 14:03:07 | ||||
|  * @LastEditTime: 2022-01-17 14:53:10 | ||||
|  * @LastEditors: Please set LastEditors | ||||
|  * @LastEditTime: 2022-01-17 17:02:31 | ||||
|  * @LastEditors: your name | ||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||
|  * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.html | ||||
| --> | ||||
| <sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 90, grid: { span:24 } } }" [button]="'none'"> | ||||
| </sf> | ||||
| <nz-divider style="margin-top: 0;"></nz-divider> | ||||
| <sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 90, grid: { span: 24 } } }" [button]="'none'"> </sf> | ||||
| <nz-divider style="margin-top: 0"></nz-divider> | ||||
| <div> | ||||
|     <p style="font-size: 16px;"> | ||||
|         <span style="font-weight: bolder">总运费:<span style="color: #dc112a">{{ data.totalFreight | currency }}</span></span> | ||||
|     </p> | ||||
|     <p style="margin-bottom: 0;"> 运输费:{{ data.freight | currency}},附加费:{{ data.surcharge | currency }}</p> | ||||
| </div> | ||||
|   <p style="font-size: 16px"> | ||||
|     <span style="font-weight: bolder" | ||||
|       >总运费:<span style="color: #dc112a">{{ data.totalFreight |currency }}</span></span | ||||
|     > | ||||
|   </p> | ||||
|   <p style="margin-bottom: 0"> 运输费:{{ data.freight |currency }},附加费:{{ data.surcharge |currency}}</p> | ||||
| </div> | ||||
| <div class="modal-footer"> | ||||
|   <button nz-button type="button" (click)="close()">关闭</button> | ||||
|   <button nz-button type="submit" nzType="primary" (click)="save(sf.value)">确定</button> | ||||
| </div> | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| /* | ||||
|  * @Author: your name | ||||
|  * @Date: 2021-12-14 14:03:07 | ||||
|  * @LastEditTime: 2022-01-13 13:33:14 | ||||
|  * @LastEditTime: 2022-01-17 17:02:25 | ||||
|  * @LastEditors: Please set LastEditors | ||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||
|  * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts | ||||
| @ -12,6 +12,7 @@ import { | ||||
|   SFSelectWidgetSchema, | ||||
|   SFStringWidgetSchema, SFTextWidgetSchema | ||||
| } from '@delon/form'; | ||||
| import { NzModalRef } from 'ng-zorro-antd/modal'; | ||||
| import { Subscription } from 'rxjs'; | ||||
| import { OrderManagementService } from '../../../services/order-management.service'; | ||||
|  | ||||
| @ -28,7 +29,7 @@ export class UpdateFreightComponent implements OnInit { | ||||
|   data: any; | ||||
|  | ||||
|   calculateSub!: Subscription; | ||||
|   constructor(private service: OrderManagementService) {} | ||||
|   constructor(private service: OrderManagementService,private modal: NzModalRef, ) {} | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     this.schema = this.initSF(this.data); | ||||
| @ -44,8 +45,10 @@ export class UpdateFreightComponent implements OnInit { | ||||
|           type: 'object', | ||||
|           properties: { | ||||
|             freightPrice: { | ||||
|               type: 'string', | ||||
|               type: 'number', | ||||
|               title: '运费单价', | ||||
|               minimum:0, | ||||
|               maximum:99999, | ||||
|               ui: { | ||||
|                 addOnAfter: data.freightTypeLabel, | ||||
|                 placeholder: '请输入', | ||||
| @ -104,6 +107,8 @@ export class UpdateFreightComponent implements OnInit { | ||||
|               type: 'number', | ||||
|               title: '装货重量', | ||||
|               default: data.acceptWeight, | ||||
|               minimum:0, | ||||
|               maximum:99999, | ||||
|               ui: { | ||||
|                 unit: '吨', | ||||
|                 placeholder: '请输入', | ||||
| @ -118,8 +123,10 @@ export class UpdateFreightComponent implements OnInit { | ||||
|               type: 'number', | ||||
|               title: '装货体积', | ||||
|               default: data.acceptVolume, | ||||
|               minimum:0, | ||||
|               maximum:99999, | ||||
|               ui: { | ||||
|                 unit: '方', | ||||
|                 unit: '吨', | ||||
|                 placeholder: '请输入', | ||||
|                 grid: { | ||||
|                   span: 12 | ||||
| @ -132,6 +139,8 @@ export class UpdateFreightComponent implements OnInit { | ||||
|               type: 'number', | ||||
|               title: '卸货重量', | ||||
|               default: data.settlementWeight, | ||||
|               minimum:0, | ||||
|               maximum:99999, | ||||
|               ui: { | ||||
|                 unit: '吨', | ||||
|                 placeholder: '请输入', | ||||
| @ -146,8 +155,10 @@ export class UpdateFreightComponent implements OnInit { | ||||
|               type: 'number', | ||||
|               title: '卸货体积', | ||||
|               default: data.settlementVolume, | ||||
|               minimum:0, | ||||
|               maximum:99999, | ||||
|               ui: { | ||||
|                 unit: '方', | ||||
|                 unit: '吨', | ||||
|                 placeholder: '请输入', | ||||
|                 grid: { | ||||
|                   span: 12 | ||||
| @ -179,23 +190,36 @@ export class UpdateFreightComponent implements OnInit { | ||||
|   } | ||||
|  | ||||
|   changeNumVal() { | ||||
|     console.log(this.sf.valid) | ||||
|     if(this.sf.valid) { | ||||
|       console.log(this.sf.valid) | ||||
|     if (this.calculateSub) { | ||||
|       this.calculateSub.unsubscribe(); | ||||
|     } | ||||
|     // if (this.calculateSub) { | ||||
|     //   this.calculateSub.unsubscribe(); | ||||
|     // } | ||||
|     // this.calculateSub = this.service | ||||
|     //   .request(this.service.$api_calculate_cost, { billId: this.data.billId, ...this.sf.value, changeCause: '' }) | ||||
|     //   .subscribe((res: any) => { | ||||
|     //     if (res) { | ||||
|     //       Object.assign(this.data, { | ||||
|     //         totalFreight: res.totalFreight, | ||||
|     //         freight: res.freight, | ||||
|     //         surcharge: res.surcharge | ||||
|     //       }); | ||||
|     //     } | ||||
|     //   }); | ||||
|     this.calculateSub = this.service | ||||
|       .request(this.service.$api_calculate_cost, { billId: this.data.billId, ...this.sf.value, changeCause: '' }) | ||||
|       .subscribe(res => { | ||||
|         if (res) { | ||||
|           Object.assign(this.data, { | ||||
|             totalFreight: res.totalFreight, | ||||
|             freight: res.freight, | ||||
|             surcharge: res.surcharge | ||||
|           }); | ||||
|         } | ||||
|       }); | ||||
|   } | ||||
|  | ||||
|   save(value: any): void { | ||||
|     if(!this.sf.valid){ | ||||
|       this.sf.validator({ emitError: true }); | ||||
|       return; | ||||
|     }  | ||||
|     this.service.request(this.service.$api_change_bulk, { billId: this.data.billId, ...this.sf.value }).subscribe(res => { | ||||
|       if (res) { | ||||
|         this.service.msgSrv.success('变更运费成功'); | ||||
|         this.modal.destroy(true); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   close(): void { | ||||
|     this.modal.destroy(); | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -2,7 +2,7 @@ import { Params } from '@angular/router'; | ||||
| /* | ||||
|  * @Author: your name | ||||
|  * @Date: 2021-12-14 14:03:07 | ||||
|  * @LastEditTime: 2022-01-04 09:37:50 | ||||
|  * @LastEditTime: 2022-01-17 16:20:06 | ||||
|  * @LastEditors: Please set LastEditors | ||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||
|  * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts | ||||
| @ -12,6 +12,7 @@ import {SFComponent, SFNumberWidgetSchema, SFSchema, SFUISchema} from '@delon/fo | ||||
| import { NzMessageService } from 'ng-zorro-antd/message'; | ||||
| import { NzModalRef } from 'ng-zorro-antd/modal'; | ||||
| import { OrderManagementService } from '../../../services/order-management.service'; | ||||
| import { ShipperBaseService } from '@shared'; | ||||
|  | ||||
|  | ||||
| @Component({ | ||||
| @ -28,7 +29,12 @@ export class VehicleFreightPeopleComponent implements OnInit { | ||||
|  | ||||
|   data: any; | ||||
|  | ||||
|   constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService, ) {} | ||||
|   constructor( | ||||
|     private modal: NzModalRef, | ||||
|     private msgSrv: NzMessageService, | ||||
|     public service: OrderManagementService, | ||||
|     public shipperservice: ShipperBaseService, | ||||
|      ) {} | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     console.log(this.data) | ||||
| @ -37,7 +43,7 @@ export class VehicleFreightPeopleComponent implements OnInit { | ||||
|   initSF() { | ||||
|     this.schema = { | ||||
|       properties: { | ||||
|         enterpriseInfoName: { | ||||
|         enterpriseInfoId: { | ||||
|           type: 'string', | ||||
|           title: '网络货运人', | ||||
|           ui: { | ||||
| @ -47,7 +53,7 @@ export class VehicleFreightPeopleComponent implements OnInit { | ||||
|               _$expand: (value: boolean) => value, | ||||
|             }, | ||||
|             allowClear: true, | ||||
|             asyncData: () => this.service.getNetworkFreightForwarderHistory(this.data), | ||||
|             asyncData: () => this.shipperservice.getNetworkFreightForwarder(), | ||||
|           }, | ||||
|         }, | ||||
|       }, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user