edit
This commit is contained in:
		@ -12,28 +12,14 @@
 | 
				
			|||||||
  <!-- 搜索区 -->
 | 
					  <!-- 搜索区 -->
 | 
				
			||||||
  <!-- 搜索表单 -->
 | 
					  <!-- 搜索表单 -->
 | 
				
			||||||
  <div nz-row nzGutter="8">
 | 
					  <div nz-row nzGutter="8">
 | 
				
			||||||
    <div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
 | 
					    <div nz-col [nzXl]=" 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
 | 
				
			||||||
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
 | 
					      <sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }" [compact]="true" [button]="'none'"></sf>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
 | 
					    <div nz-col [nzXl]=" 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
 | 
				
			||||||
      <button
 | 
					      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl
 | 
				
			||||||
        nz-button
 | 
					        [acl-ability]="['USERCENTER-DRIVER-CONFIG-search']">查询</button>
 | 
				
			||||||
        nzType="primary"
 | 
					      <button nz-button nzType="primary" [disabled]="service.http.loading" (click)="exportList()" acl
 | 
				
			||||||
        [nzLoading]="service.http.loading"
 | 
					        [acl-ability]="['USERCENTER-DRIVER-CONFIG-export']">导出</button>
 | 
				
			||||||
        (click)="st?.load(1)"
 | 
					 | 
				
			||||||
        acl
 | 
					 | 
				
			||||||
        [acl-ability]="['USERCENTER-DRIVER-CONFIG-search']"
 | 
					 | 
				
			||||||
        >查询</button
 | 
					 | 
				
			||||||
      >
 | 
					 | 
				
			||||||
      <button
 | 
					 | 
				
			||||||
        nz-button
 | 
					 | 
				
			||||||
        nzType="primary"
 | 
					 | 
				
			||||||
        [disabled]="service.http.loading"
 | 
					 | 
				
			||||||
        (click)="exportList()"
 | 
					 | 
				
			||||||
        acl
 | 
					 | 
				
			||||||
        [acl-ability]="['USERCENTER-DRIVER-CONFIG-export']"
 | 
					 | 
				
			||||||
        >导出</button
 | 
					 | 
				
			||||||
      >
 | 
					 | 
				
			||||||
      <button nz-button (click)="resetSF()" [disabled]="service.http.loading">重置</button>
 | 
					      <button nz-button (click)="resetSF()" [disabled]="service.http.loading">重置</button>
 | 
				
			||||||
      <!-- <button nz-button nzType="link" (click)="expandToggle()">
 | 
					      <!-- <button nz-button nzType="link" (click)="expandToggle()">
 | 
				
			||||||
        {{ !_$expand ? '展开' : '收起' }}
 | 
					        {{ !_$expand ? '展开' : '收起' }}
 | 
				
			||||||
@ -44,39 +30,22 @@
 | 
				
			|||||||
</nz-card>
 | 
					</nz-card>
 | 
				
			||||||
<nz-card>
 | 
					<nz-card>
 | 
				
			||||||
  <!-- 数据列表 -->
 | 
					  <!-- 数据列表 -->
 | 
				
			||||||
  <st
 | 
					  <st #st [columns]="columns" [data]="service.$api_configPage" [req]="{  params: reqParams }"
 | 
				
			||||||
    #st
 | 
					    [loading]="service.http.loading">
 | 
				
			||||||
    [columns]="columns"
 | 
					 | 
				
			||||||
    [data]="service.$api_configPage"
 | 
					 | 
				
			||||||
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
 | 
					 | 
				
			||||||
    [res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
 | 
					 | 
				
			||||||
    [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
 | 
					 | 
				
			||||||
    [loading]="service.http.loading"
 | 
					 | 
				
			||||||
  >
 | 
					 | 
				
			||||||
    <ng-template st-row="monthFreightAmount" let-item let-index="index">
 | 
					    <ng-template st-row="monthFreightAmount" let-item let-index="index">
 | 
				
			||||||
    <div>{{item?.monthFreightAmount | currency}}</div>
 | 
					      <div>{{item?.monthFreightAmount | currency}}</div>
 | 
				
			||||||
    </ng-template>
 | 
					    </ng-template>
 | 
				
			||||||
    <ng-template st-row="dayWithdrawalAmount" let-item let-index="index">
 | 
					    <ng-template st-row="dayWithdrawalAmount" let-item let-index="index">
 | 
				
			||||||
    <div>{{item?.dayWithdrawalAmount | currency}}</div>
 | 
					      <div>{{item?.dayWithdrawalAmount | currency}}</div>
 | 
				
			||||||
    </ng-template>
 | 
					    </ng-template>
 | 
				
			||||||
    <ng-template st-row="monthWithdrawalAmount" let-item let-index="index">
 | 
					    <ng-template st-row="monthWithdrawalAmount" let-item let-index="index">
 | 
				
			||||||
    <div>{{item?.monthWithdrawalAmount | currency}}</div>
 | 
					      <div>{{item?.monthWithdrawalAmount | currency}}</div>
 | 
				
			||||||
    </ng-template>
 | 
					    </ng-template>
 | 
				
			||||||
    <ng-template st-row="monthReceivableAmount" let-item let-index="index">
 | 
					    <ng-template st-row="monthReceivableAmount" let-item let-index="index">
 | 
				
			||||||
    <div>{{item?.monthReceivableAmount | currency}}</div>
 | 
					      <div>{{item?.monthReceivableAmount | currency}}</div>
 | 
				
			||||||
    </ng-template>
 | 
					    </ng-template>
 | 
				
			||||||
    <ng-template st-row="isCaptain" let-item let-index="index">
 | 
					    <ng-template st-row="isCaptain" let-item let-index="index">
 | 
				
			||||||
    <div>{{item?.isCaptain == 1 ? '车队长' : '司机'}}</div>
 | 
					      <div>{{item?.isCaptain == 1 ? '车队长' : '司机'}}</div>
 | 
				
			||||||
    </ng-template>
 | 
					    </ng-template>
 | 
				
			||||||
  </st>
 | 
					  </st>
 | 
				
			||||||
</nz-card>
 | 
					</nz-card>
 | 
				
			||||||
 | 
					 | 
				
			||||||
<ng-template #promoterModal>
 | 
					 | 
				
			||||||
  <div nz-row nzGutter="8">
 | 
					 | 
				
			||||||
    <div nz-col nzSpan="24" se-container [labelWidth]="80">
 | 
					 | 
				
			||||||
      <se [col]="1" label="手机号">
 | 
					 | 
				
			||||||
        <input nz-input [(ngModel)]="promotersTelephone" maxlength="11" required />
 | 
					 | 
				
			||||||
      </se>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
  </div>
 | 
					 | 
				
			||||||
</ng-template>
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -1,8 +1,7 @@
 | 
				
			|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
 | 
					import { Component, OnInit, ViewChild } from '@angular/core';
 | 
				
			||||||
import { ActivatedRoute, Router } from '@angular/router';
 | 
					import { ActivatedRoute } from '@angular/router';
 | 
				
			||||||
import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
 | 
					import { STColumn, STComponent } from '@delon/abc/st';
 | 
				
			||||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
 | 
					import { SFComponent, SFSchema } from '@delon/form';
 | 
				
			||||||
import { ModalHelper } from '@delon/theme';
 | 
					 | 
				
			||||||
import { DynamicSettingModalComponent } from '@shared';
 | 
					import { DynamicSettingModalComponent } from '@shared';
 | 
				
			||||||
import { NzModalService } from 'ng-zorro-antd/modal';
 | 
					import { NzModalService } from 'ng-zorro-antd/modal';
 | 
				
			||||||
import { UsermanageService } from '../../../services/usercenter.service';
 | 
					import { UsermanageService } from '../../../services/usercenter.service';
 | 
				
			||||||
@ -12,19 +11,12 @@ import { UsermanageService } from '../../../services/usercenter.service';
 | 
				
			|||||||
  styleUrls: ['./driver-config.component.less']
 | 
					  styleUrls: ['./driver-config.component.less']
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
export class UserCenterComponentsDriverConfigComponent implements OnInit {
 | 
					export class UserCenterComponentsDriverConfigComponent implements OnInit {
 | 
				
			||||||
  _$expand = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } };
 | 
					 | 
				
			||||||
  schema: SFSchema = this.initSF();
 | 
					  schema: SFSchema = this.initSF();
 | 
				
			||||||
  columns: STColumn[] = this.initST();
 | 
					  columns: STColumn[] = this.initST();
 | 
				
			||||||
  @ViewChild('st', { static: false }) st!: STComponent;
 | 
					  @ViewChild('st', { static: false }) st!: STComponent;
 | 
				
			||||||
  @ViewChild('sf', { static: false }) sf!: SFComponent;
 | 
					  @ViewChild('sf', { static: false }) sf!: SFComponent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @ViewChild('promoterModal', { static: false })
 | 
					  constructor(public service: UsermanageService, private modal: NzModalService) {}
 | 
				
			||||||
  promoterModal!: any;
 | 
					 | 
				
			||||||
  promotersTelephone = '';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute, private modalHelper: ModalHelper,) {}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * 查询参数
 | 
					   * 查询参数
 | 
				
			||||||
@ -33,56 +25,12 @@ export class UserCenterComponentsDriverConfigComponent implements OnInit {
 | 
				
			|||||||
    const params: any = {
 | 
					    const params: any = {
 | 
				
			||||||
      ...(this.sf && this.sf.value)
 | 
					      ...(this.sf && this.sf.value)
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    if (this.sf?.value.effectiveDate) {
 | 
					 | 
				
			||||||
      params.effectiveDateStart = this.sf?.value.effectiveDate[0];
 | 
					 | 
				
			||||||
      params.effectiveDateEnd = this.sf?.value.effectiveDate[1];
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    delete params.effectiveDate;
 | 
					    delete params.effectiveDate;
 | 
				
			||||||
    delete params.expand;
 | 
					    delete params.expand;
 | 
				
			||||||
    return params;
 | 
					    return params;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  get selectedRows() {
 | 
					  ngOnInit() {}
 | 
				
			||||||
    return this.st?.list.filter(item => item.checked) || [];
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  ngOnInit() {
 | 
					 | 
				
			||||||
    this.ar.url.subscribe(params => {
 | 
					 | 
				
			||||||
      this.st?.load(1);
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  dataProcess(data: STData[]): STData[] {
 | 
					 | 
				
			||||||
    return data.map((i, index) => {
 | 
					 | 
				
			||||||
      i.showSortFlag = false;
 | 
					 | 
				
			||||||
      return i;
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  addPromoter(item?: any) {
 | 
					 | 
				
			||||||
    this.promotersTelephone = item?.promotersTelephone;
 | 
					 | 
				
			||||||
    const modal = this.modal.create({
 | 
					 | 
				
			||||||
      nzTitle: '推广业务员',
 | 
					 | 
				
			||||||
      nzContent: this.promoterModal,
 | 
					 | 
				
			||||||
      nzOnOk: () => {
 | 
					 | 
				
			||||||
        if (!!!this.promotersTelephone) {
 | 
					 | 
				
			||||||
          return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) {
 | 
					 | 
				
			||||||
          this.service.msgSrv.error('手机格式错误');
 | 
					 | 
				
			||||||
          return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        this.service
 | 
					 | 
				
			||||||
          .request(this.service.$api_add_user_salesman, { userId: item.userId, mobile: this.promotersTelephone })
 | 
					 | 
				
			||||||
          .subscribe(res => {
 | 
					 | 
				
			||||||
            if (res) {
 | 
					 | 
				
			||||||
              this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功');
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            this.st.load();
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  settingAction(item?: any) {
 | 
					  settingAction(item?: any) {
 | 
				
			||||||
    this.modal.create({
 | 
					    this.modal.create({
 | 
				
			||||||
@ -91,24 +39,18 @@ export class UserCenterComponentsDriverConfigComponent implements OnInit {
 | 
				
			|||||||
      nzWidth: 900,
 | 
					      nzWidth: 900,
 | 
				
			||||||
      nzComponentParams: {
 | 
					      nzComponentParams: {
 | 
				
			||||||
        extendType: '3',
 | 
					        extendType: '3',
 | 
				
			||||||
        businessId: item.id,
 | 
					        businessId: item.appUserId,
 | 
				
			||||||
        configvalue: 'sys.config'
 | 
					        configvalue: 'sys.config'
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      nzFooter: null
 | 
					      nzFooter: null
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  expandToggle() {
 | 
					 | 
				
			||||||
    this._$expand = !this._$expand;
 | 
					 | 
				
			||||||
    this.sf?.setValue('/expand', this._$expand);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * 重置表单
 | 
					   * 重置表单
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  resetSF() {
 | 
					  resetSF() {
 | 
				
			||||||
    this.sf.reset();
 | 
					    this.sf.reset();
 | 
				
			||||||
    this._$expand = false;
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  exportList() {
 | 
					  exportList() {
 | 
				
			||||||
@ -140,11 +82,11 @@ export class UserCenterComponentsDriverConfigComponent implements OnInit {
 | 
				
			|||||||
          enum: [
 | 
					          enum: [
 | 
				
			||||||
            { label: '全部', value: '' },
 | 
					            { label: '全部', value: '' },
 | 
				
			||||||
            { label: '车队长', value: 1 },
 | 
					            { label: '车队长', value: 1 },
 | 
				
			||||||
            { label: '司机', value: 0 },
 | 
					            { label: '司机', value: 0 }
 | 
				
			||||||
          ],
 | 
					          ],
 | 
				
			||||||
          default: '',
 | 
					          default: '',
 | 
				
			||||||
          ui: {
 | 
					          ui: {
 | 
				
			||||||
            widget: 'select',
 | 
					            widget: 'select'
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -158,7 +100,7 @@ export class UserCenterComponentsDriverConfigComponent implements OnInit {
 | 
				
			|||||||
      { title: '手机号', className: 'text-center', index: 'mobile' },
 | 
					      { title: '手机号', className: 'text-center', index: 'mobile' },
 | 
				
			||||||
      { title: '类型', className: 'text-center', render: 'isCaptain' },
 | 
					      { title: '类型', className: 'text-center', render: 'isCaptain' },
 | 
				
			||||||
      { title: '月承运金额上限(元)', className: 'text-center', render: 'monthFreightAmount' },
 | 
					      { title: '月承运金额上限(元)', className: 'text-center', render: 'monthFreightAmount' },
 | 
				
			||||||
      { title: '日提现金额上限(元)', className: 'text-center', render: 'dayWithdrawalAmount', },
 | 
					      { title: '日提现金额上限(元)', className: 'text-center', render: 'dayWithdrawalAmount' },
 | 
				
			||||||
      { title: '月提现金额上限(元)', className: 'text-center', render: 'monthWithdrawalAmount' },
 | 
					      { title: '月提现金额上限(元)', className: 'text-center', render: 'monthWithdrawalAmount' },
 | 
				
			||||||
      { title: '月收款金额上限(元)', className: 'text-center', render: 'monthReceivableAmount' },
 | 
					      { title: '月收款金额上限(元)', className: 'text-center', render: 'monthReceivableAmount' },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user