fix bug
This commit is contained in:
		@ -4,7 +4,7 @@
 | 
			
		||||
 * @Author       : Shiming
 | 
			
		||||
 * @Date         : 2022-01-12 10:52:50
 | 
			
		||||
 * @LastEditors  : Shiming
 | 
			
		||||
 * @LastEditTime : 2022-04-11 11:28:18
 | 
			
		||||
 * @LastEditTime : 2022-04-11 14:33:19
 | 
			
		||||
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\complaint\\complaint.component.html
 | 
			
		||||
 * Copyright (C) 2022 huzhenhong. All rights reserved.
 | 
			
		||||
-->
 | 
			
		||||
@ -27,7 +27,7 @@
 | 
			
		||||
      <div nz-col [nzSpan]="24" style="display: flex; justify-content: flex-end;">
 | 
			
		||||
        <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="isLoading && st.loading"
 | 
			
		||||
          (click)="st?.load(1)"  acl  [acl-ability]="['ORDER-COMPLAINT-search']">查询</button>
 | 
			
		||||
        <button nz-button nzType="primary" acl  [acl-ability]="['ORDER-COMPLAINT-export']"
 | 
			
		||||
        <button nz-button nzType="primary" acl  [acl-ability]="['ORDER-COMPLAINT-export']" (click)="exprot()"
 | 
			
		||||
         >导出</button>
 | 
			
		||||
        <button nz-button (click)="resetSF()">重置</button>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,6 @@ import { NzModalService } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { map } from 'rxjs/operators';
 | 
			
		||||
import { OrderManagementService } from '../../services/order-management.service';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-supply-management-complaint',
 | 
			
		||||
  templateUrl: './complaint.component.html',
 | 
			
		||||
@ -32,30 +31,27 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
  isLoading: boolean = false;
 | 
			
		||||
  mainTabs = [
 | 
			
		||||
    { name: '司机投诉', status: '2' },
 | 
			
		||||
    { name: '货主投诉', status: '1' },
 | 
			
		||||
  ]
 | 
			
		||||
  tabs = [  {
 | 
			
		||||
    name: '全部',
 | 
			
		||||
    type: 0,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    name: '待处理',
 | 
			
		||||
    type: 1,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    name: '已处理',
 | 
			
		||||
    type: 2,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    name: '已撤销',
 | 
			
		||||
    type: 3,
 | 
			
		||||
  }
 | 
			
		||||
    { name: '货主投诉', status: '1' }
 | 
			
		||||
  ];
 | 
			
		||||
  constructor(
 | 
			
		||||
    public service: OrderManagementService,
 | 
			
		||||
    private modal: NzModalService,
 | 
			
		||||
    private router: Router
 | 
			
		||||
     ) {   
 | 
			
		||||
  tabs = [
 | 
			
		||||
    {
 | 
			
		||||
      name: '全部',
 | 
			
		||||
      type: 0
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      name: '待处理',
 | 
			
		||||
      type: 1
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      name: '已处理',
 | 
			
		||||
      type: 2
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      name: '已撤销',
 | 
			
		||||
      type: 3
 | 
			
		||||
    }
 | 
			
		||||
  ];
 | 
			
		||||
  constructor(public service: OrderManagementService, private modal: NzModalService, private router: Router) {
 | 
			
		||||
    //    console.log(this.selectedIndex);
 | 
			
		||||
    //   if (this.selectedIndex === 0) {
 | 
			
		||||
    //   this.selectedMainTabStatus = '2';
 | 
			
		||||
@ -65,25 +61,25 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
 * 查询参数
 | 
			
		||||
 */
 | 
			
		||||
   * 查询参数
 | 
			
		||||
   */
 | 
			
		||||
  get reqParams() {
 | 
			
		||||
    const a: any = {};
 | 
			
		||||
    if(this.resourceStatus) {
 | 
			
		||||
      a.complaintStatus = this.resourceStatus 
 | 
			
		||||
    if (this.resourceStatus) {
 | 
			
		||||
      a.complaintStatus = this.resourceStatus;
 | 
			
		||||
    }
 | 
			
		||||
    if(this.selectedMainTabStatus) {
 | 
			
		||||
      a.complainantParty = this.selectedMainTabStatus
 | 
			
		||||
    if (this.selectedMainTabStatus) {
 | 
			
		||||
      a.complainantParty = this.selectedMainTabStatus;
 | 
			
		||||
    }
 | 
			
		||||
    const params: any = Object.assign({}, this.sf?.value || {});
 | 
			
		||||
    delete params._$expand;
 | 
			
		||||
    return {
 | 
			
		||||
      ...a,
 | 
			
		||||
      ...params,
 | 
			
		||||
      ...params
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
  get selectedRows() {
 | 
			
		||||
    return this.st?.list.filter((item) => item.checked) || [];
 | 
			
		||||
    return this.st?.list.filter(item => item.checked) || [];
 | 
			
		||||
  }
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.initSF();
 | 
			
		||||
@ -91,17 +87,15 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
    this.initSTAudit();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
 * 初始化查询表单
 | 
			
		||||
 */
 | 
			
		||||
   * 初始化查询表单
 | 
			
		||||
   */
 | 
			
		||||
  initSF() {
 | 
			
		||||
    this.schema = {
 | 
			
		||||
      properties: {
 | 
			
		||||
        complaintCode: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '投诉单号',
 | 
			
		||||
          title: '投诉单号'
 | 
			
		||||
        },
 | 
			
		||||
        complaintCause: {
 | 
			
		||||
          title: '投诉原因',
 | 
			
		||||
@ -109,22 +103,23 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'dict-select',
 | 
			
		||||
            params: { dictKey: 'drvcomplaint:cause' },
 | 
			
		||||
            containsAllLabel: true,
 | 
			
		||||
            containsAllLabel: true
 | 
			
		||||
          } as SFSelectWidgetSchema
 | 
			
		||||
        },
 | 
			
		||||
        complainantTime: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          
 | 
			
		||||
 | 
			
		||||
          title: '投诉时间',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd' } as SFDateWidgetSchema,
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
            widget: 'sl-from-to',
 | 
			
		||||
            type: 'date',
 | 
			
		||||
            format: 'yyyy-MM-dd'
 | 
			
		||||
          } as SFDateWidgetSchema
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
    this.ui = 
 | 
			
		||||
    {
 | 
			
		||||
     '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 8 } },
 | 
			
		||||
   
 | 
			
		||||
    this.ui = {
 | 
			
		||||
      '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 8 } }
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -150,7 +145,7 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
        title: '投诉时间',
 | 
			
		||||
        width: '170px',
 | 
			
		||||
        index: 'complainantTime',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        className: 'text-center'
 | 
			
		||||
      },
 | 
			
		||||
      { title: '托运方', index: 'shipperAppUserName', width: '200px', className: 'text-center' },
 | 
			
		||||
      { title: '司机', index: 'driverName', width: '120px', className: 'text-center' },
 | 
			
		||||
@ -160,8 +155,20 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
      //   width: '170px',
 | 
			
		||||
      //   render: 'complaintCauseLabel'
 | 
			
		||||
      // },
 | 
			
		||||
      { title: '投诉原因',iif: value => this.selectedMainTabStatus == '1', index: 'shpComplaintCauseLabel', className: 'text-center',width: '170px', },
 | 
			
		||||
      { title: '投诉原因',iif: value => this.selectedMainTabStatus == '2', index: 'drvComplaintCauseLabel', className: 'text-center',width: '170px', },
 | 
			
		||||
      {
 | 
			
		||||
        title: '投诉原因',
 | 
			
		||||
        iif: value => this.selectedMainTabStatus == '1',
 | 
			
		||||
        index: 'shpComplaintCauseLabel',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '170px'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        title: '投诉原因',
 | 
			
		||||
        iif: value => this.selectedMainTabStatus == '2',
 | 
			
		||||
        index: 'drvComplaintCauseLabel',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '170px'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        title: '投诉状态',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
@ -172,19 +179,19 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
        title: '处理人',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '200px',
 | 
			
		||||
        index:'handlePartyLabel'
 | 
			
		||||
        index: 'handlePartyLabel'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        title: '处理时间',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '200px',
 | 
			
		||||
        index:'handleTime'
 | 
			
		||||
        index: 'handleTime'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        title: '处理结果',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '170px',
 | 
			
		||||
        index:'handleResult'
 | 
			
		||||
        index: 'handleResult'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        title: '投诉方',
 | 
			
		||||
@ -211,11 +218,11 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
          // },
 | 
			
		||||
          {
 | 
			
		||||
            text: '查看',
 | 
			
		||||
            click: (_record) => this.view(_record),
 | 
			
		||||
            acl: { ability: ['ORDER-COMPLAINT-view'] },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
            click: _record => this.view(_record),
 | 
			
		||||
            acl: { ability: ['ORDER-COMPLAINT-view'] }
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
  }
 | 
			
		||||
  initSTAudit() {
 | 
			
		||||
@ -229,8 +236,8 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
            placeholder: '最多不超过50字',
 | 
			
		||||
            widget: 'textarea',
 | 
			
		||||
            autosize: { minRows: 3, maxRows: 6 }
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      required: ['handleResult']
 | 
			
		||||
    };
 | 
			
		||||
@ -243,20 +250,19 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
    return Object.keys(this.schema?.properties || {}).length;
 | 
			
		||||
  }
 | 
			
		||||
  /**
 | 
			
		||||
  * 伸缩查询条件
 | 
			
		||||
  */
 | 
			
		||||
   * 伸缩查询条件
 | 
			
		||||
   */
 | 
			
		||||
  expandToggle(): void {
 | 
			
		||||
    this._$expand = !this._$expand;
 | 
			
		||||
    this.sf?.setValue('/_$expand', this._$expand);
 | 
			
		||||
  }
 | 
			
		||||
  tabChange(item: any) {
 | 
			
		||||
  }
 | 
			
		||||
  tabChange(item: any) {}
 | 
			
		||||
  /**
 | 
			
		||||
   * 重置表单
 | 
			
		||||
   */
 | 
			
		||||
  resetSF(): void {
 | 
			
		||||
    this.sf.reset();
 | 
			
		||||
    this.isLoading = true
 | 
			
		||||
    this.isLoading = true;
 | 
			
		||||
  }
 | 
			
		||||
  selectChange(e: number) {
 | 
			
		||||
    this.resourceStatus = e;
 | 
			
		||||
@ -265,29 +271,26 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
      this.st.load();
 | 
			
		||||
    }, 500);
 | 
			
		||||
  }
 | 
			
		||||
    /**
 | 
			
		||||
  /**
 | 
			
		||||
   * 切换投诉与被投诉tab
 | 
			
		||||
   */
 | 
			
		||||
     selectMainTab(e: any) {
 | 
			
		||||
      this.selectedMainTabStatus = e?.status;
 | 
			
		||||
      this.resourceStatus = '';
 | 
			
		||||
      this.initST();
 | 
			
		||||
      this.initSF();
 | 
			
		||||
      setTimeout(() => {
 | 
			
		||||
        this.st.load(1);
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  
 | 
			
		||||
  selectMainTab(e: any) {
 | 
			
		||||
    this.selectedMainTabStatus = e?.status;
 | 
			
		||||
    this.resourceStatus = '';
 | 
			
		||||
    this.initST();
 | 
			
		||||
    this.initSF();
 | 
			
		||||
    setTimeout(() => {
 | 
			
		||||
      this.st.load(1);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 导入货源
 | 
			
		||||
   */
 | 
			
		||||
  importGoodsSource() {
 | 
			
		||||
  importGoodsSource() {}
 | 
			
		||||
  audit(item: any) {}
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
  audit(item: any) {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 /*
 | 
			
		||||
  /*
 | 
			
		||||
  * 审核关闭弹窗
 | 
			
		||||
  view: 1
 | 
			
		||||
  浮动费用: 0
 | 
			
		||||
@ -298,60 +301,60 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
      ...this.sfView.value,
 | 
			
		||||
      handleStatus: 0,
 | 
			
		||||
      id: this.channelId
 | 
			
		||||
    }
 | 
			
		||||
    this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) =>{
 | 
			
		||||
      if(res) {
 | 
			
		||||
        this.service.msgSrv.success('已拒绝!')
 | 
			
		||||
        this.isVisibleRE = false
 | 
			
		||||
        this.st.reload(1)
 | 
			
		||||
      } else{
 | 
			
		||||
        this.service.msgSrv.error(res?.msg)
 | 
			
		||||
    };
 | 
			
		||||
    this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.service.msgSrv.success('已拒绝!');
 | 
			
		||||
        this.isVisibleRE = false;
 | 
			
		||||
        this.st.reload(1);
 | 
			
		||||
      } else {
 | 
			
		||||
        this.service.msgSrv.error(res?.msg);
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    this.isVisibleRE = false
 | 
			
		||||
    });
 | 
			
		||||
    this.isVisibleRE = false;
 | 
			
		||||
  }
 | 
			
		||||
  Cancel() {
 | 
			
		||||
    this.isVisibleRE = false
 | 
			
		||||
    this.isVisibleRE = false;
 | 
			
		||||
  }
 | 
			
		||||
  handleCancel2() {
 | 
			
		||||
    const paramsa = {
 | 
			
		||||
      id: this.channelId
 | 
			
		||||
    }
 | 
			
		||||
    this.service.request(this.service.$api_get_canelComplaint, paramsa).subscribe((res: any) =>{
 | 
			
		||||
      if(res) {
 | 
			
		||||
        this.service.msgSrv.success('已拒绝!')
 | 
			
		||||
        this.isVisibleRE = false
 | 
			
		||||
        this.st.reload(1)
 | 
			
		||||
      } else{
 | 
			
		||||
        this.service.msgSrv.error(res?.msg)
 | 
			
		||||
    };
 | 
			
		||||
    this.service.request(this.service.$api_get_canelComplaint, paramsa).subscribe((res: any) => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.service.msgSrv.success('已拒绝!');
 | 
			
		||||
        this.isVisibleRE = false;
 | 
			
		||||
        this.st.reload(1);
 | 
			
		||||
      } else {
 | 
			
		||||
        this.service.msgSrv.error(res?.msg);
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    this.isVisibleRE = false
 | 
			
		||||
    });
 | 
			
		||||
    this.isVisibleRE = false;
 | 
			
		||||
  }
 | 
			
		||||
    /**
 | 
			
		||||
  * 审核通过按钮
 | 
			
		||||
  */
 | 
			
		||||
  /**
 | 
			
		||||
   * 审核通过按钮
 | 
			
		||||
   */
 | 
			
		||||
  handleOK() {
 | 
			
		||||
    const paramsa = {
 | 
			
		||||
      ...this.sfView.value,
 | 
			
		||||
      handleStatus: 1,
 | 
			
		||||
      id: this.channelId
 | 
			
		||||
    }
 | 
			
		||||
    this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) =>{
 | 
			
		||||
      if(res) {
 | 
			
		||||
        this.service.msgSrv.success('已通过!')
 | 
			
		||||
        this.isVisibleRE = false
 | 
			
		||||
        this.st.reload(1)
 | 
			
		||||
      } else{
 | 
			
		||||
        this.service.msgSrv.error(res?.msg)
 | 
			
		||||
    };
 | 
			
		||||
    this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.service.msgSrv.success('已通过!');
 | 
			
		||||
        this.isVisibleRE = false;
 | 
			
		||||
        this.st.reload(1);
 | 
			
		||||
      } else {
 | 
			
		||||
        this.service.msgSrv.error(res?.msg);
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
   /**
 | 
			
		||||
  *查看评价
 | 
			
		||||
  */
 | 
			
		||||
  /**
 | 
			
		||||
   *查看评价
 | 
			
		||||
   */
 | 
			
		||||
  viewEvaluate(item: any) {
 | 
			
		||||
    this.isVisibleRE = true
 | 
			
		||||
    this.isVisibleRE = true;
 | 
			
		||||
    this.channelId = item.id;
 | 
			
		||||
  }
 | 
			
		||||
  view(value: any) {
 | 
			
		||||
@ -359,6 +362,10 @@ export class OrderManagementComplaintComponent implements OnInit {
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        detail: JSON.stringify(value)
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  // 导出
 | 
			
		||||
  exprot() {
 | 
			
		||||
    this.service.exportStart({ ...this.reqParams, pageSize: -1 }, this.service.$api_asyncExportComplaintListDrv);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user