车辆对接
This commit is contained in:
		@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: your name
 | 
			
		||||
 * @Date: 2021-12-15 13:17:42
 | 
			
		||||
 * @LastEditTime: 2021-12-29 15:12:09
 | 
			
		||||
 * @LastEditTime: 2022-01-04 11:10:46
 | 
			
		||||
 * @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\vehicle\update-freight\update-freight.component.html
 | 
			
		||||
@ -10,5 +10,5 @@
 | 
			
		||||
<sf style="margin-top: 15px;" #sf mode="edit" [schema]="schema" [ui]="ui" button="none"></sf>
 | 
			
		||||
<div class="modal-footer">
 | 
			
		||||
  <button nz-button type="button" (click)="close()">关闭</button>
 | 
			
		||||
  <button nz-button type="submit" nzType="primary" (click)="save(sf.value)" [disabled]="sf.valid">确定</button>
 | 
			
		||||
  <button nz-button type="submit" nzType="primary" (click)="save(sf.value)" >确定</button>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ import { preloaderFinished } from '@delon/theme';
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: your name
 | 
			
		||||
 * @Date: 2021-12-14 14:03:07
 | 
			
		||||
 * @LastEditTime: 2021-12-29 15:02:47
 | 
			
		||||
 * @LastEditTime: 2022-01-04 11:21:29
 | 
			
		||||
 * @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
 | 
			
		||||
@ -42,17 +42,12 @@ export class VehicleModifyRateComponent implements OnInit {
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    console.log(this.data)
 | 
			
		||||
    this.initSF(this.data);
 | 
			
		||||
    this.initSF();
 | 
			
		||||
  }
 | 
			
		||||
  initSF(data: any) {
 | 
			
		||||
    const info = {
 | 
			
		||||
      prePay: data.list?.filter((item: any) => item.costCode === 'PRE')[0],
 | 
			
		||||
      toPay: data.list?.filter((item: any) => item.costCode === 'RECE')[0],
 | 
			
		||||
      receiptPay: data.list?.filter((item: any) => item.costCode === 'BACK')[0]
 | 
			
		||||
    };
 | 
			
		||||
  initSF() {
 | 
			
		||||
    this.schema = {
 | 
			
		||||
      properties: {
 | 
			
		||||
        prePay: {
 | 
			
		||||
        additionalRate: {
 | 
			
		||||
          type: 'number',
 | 
			
		||||
          title: '附加费率',
 | 
			
		||||
          ui: {
 | 
			
		||||
@ -62,7 +57,7 @@ export class VehicleModifyRateComponent implements OnInit {
 | 
			
		||||
          } as SFNumberWidgetSchema
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
      required: ['prePay']
 | 
			
		||||
      required: ['additionalRate']
 | 
			
		||||
    };
 | 
			
		||||
    this.ui = {
 | 
			
		||||
      '*': {
 | 
			
		||||
@ -73,14 +68,23 @@ export class VehicleModifyRateComponent implements OnInit {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  save(value: any): void {
 | 
			
		||||
 
 | 
			
		||||
    if(!this.sf.value?.additionalRate) {
 | 
			
		||||
      this.service.msgSrv.warning('请填写附加费!')
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    console.log(this.sf.value)
 | 
			
		||||
    const params = {
 | 
			
		||||
    };
 | 
			
		||||
      ids: this.data?.ids,
 | 
			
		||||
      ...this.sf.value
 | 
			
		||||
 | 
			
		||||
    this.service.request(this.service.$api_get_insertFreightChangeWhole, params).subscribe((res: any) => {
 | 
			
		||||
    };
 | 
			
		||||
    console.log(params)
 | 
			
		||||
    this.service.request(this.service.$api_set_updateAdditionalRateBatch, params).subscribe((res: any) => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.modal.destroy();
 | 
			
		||||
        this.modal.close(true);
 | 
			
		||||
        this.service.msgSrv.success('变更运费成功');
 | 
			
		||||
      } else {
 | 
			
		||||
      this.service.msgSrv.error(res?.msg)
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user