提交代码

master
胡锐 1 year ago
parent 63204cba68
commit ec4be641ed
  1. 39
      src/app/admin/mer/mer-list/mer-list.component.html
  2. 104
      src/app/admin/mer/mer-list/mer-list.component.ts
  3. 6
      src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts
  4. 6
      src/app/admin/trade-checking/trade-checking/trade-checking.component.ts
  5. 6
      src/app/services/mer.service.ts

@ -69,6 +69,17 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="salesmanId">
<nz-option *ngFor="let item of salesmanArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
@ -83,7 +94,7 @@
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<!--<button nz-button nzType="primary" class="right-btn" [routerLink]="'/admin/agent/add'"><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>-->
<button nz-button nzType="primary" class="right-btn" (click)="merMigrateSalesmanModal = true">移交业务员</button>
</div>
<!--数组表格 -->
@ -97,6 +108,7 @@
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
<th nzWidth="50px" [(nzChecked)]="allChecked" [nzShowCheckbox]="true" (nzCheckedChange)="onAllChecked($event)"></th>
<th nzWidth="60px">序号</th>
<th nzWidth="100px">商户类型</th>
<th nzWidth="180px">商户号</th>
@ -108,11 +120,18 @@
<th nzWidth="100px">状态</th>
<th nzWidth="130px">资料填写情况</th>
<th nzWidth="160px">创建时间</th>
<th nzWidth="100px">业务员</th>
<th nzWidth="120px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td
[nzShowCheckbox]="true"
[nzChecked]="data.checked"
[nzDisabled]="data.disabled"
(nzCheckedChange)="checkedChange(data, $event)"
></td>
<td>{{i + 1}}</td>
<td>{{data.merType | merType}}</td>
<td>{{data.merNo}}</td>
@ -124,6 +143,7 @@
<td>{{data.merStatus | merStatus}}</td>
<td>{{data.completeStatus | completeStatus}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.salesmanName}}</td>
<td nzRight="0px" class="table-td-operation">
<a nz-dropdown [nzDropdownMenu]="menu">商户操作 <i nz-icon nzType="down"></i> </a>
<nz-dropdown-menu #menu="nzDropdownMenu">
@ -214,3 +234,20 @@
</nz-tab>
</nz-tabset>
</nz-modal>
<nz-modal [(nzVisible)]="merMigrateSalesmanModal" nzTitle="移交业务员" (nzOnCancel)="merMigrateSalesmanModal = false" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="merMigrateSalesmanForm">
<nz-form-item>
<nz-form-label [nzSpan]="6">业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="salesmanId">
<nz-option *ngFor="let item of salesmanArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitMigrateSalesman()">确定</button>
</div>
</form>
</nz-modal>

@ -6,6 +6,7 @@ import {environment} from '../../../../environments/environment';
import {NzMessageService, NzModalService, NzUploadFile} from "ng-zorro-antd";
import {LocalStorageService} from "../../../services/local-storage.service";
import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace";
import {SalesmanService} from '../../../services/salesman.service';
@Component({
selector: 'app-mer-list',
@ -27,10 +28,19 @@ export class MerListComponent implements OnInit {
ccbConfigForm: FormGroup;
ccbFileArray: NzUploadFile[] = [];
salesmanArray = [];
allChecked = false;
checkedData = [];
merMigrateSalesmanModal = false;
merMigrateSalesmanForm: FormGroup;
constructor(private modal: NzModalService,
private message: NzMessageService,
private merService: MerService,
private merPlatformService: MerPlatformService,
private salesmanService: SalesmanService,
private store: LocalStorageService,
private form: FormBuilder) {
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
@ -44,9 +54,14 @@ export class MerListComponent implements OnInit {
merStatus: [null],
regPhone: [null],
regName: [null],
salesmanId: [null],
});
this.requestData(1);
this.salesmanService.querySalesmanList({ pageNum: 1, pageSize: 999}, data => {
this.salesmanArray = data['return_data']['list'];
});
this.ccbConfigForm = this.form.group({
merId: [null],
platformType: [null],
@ -59,6 +74,10 @@ export class MerListComponent implements OnInit {
refundCertUrl: [null],
refundCertPwd: [null, [Validators.required]],
});
this.merMigrateSalesmanForm = this.form.group({
salesmanId: [null, [Validators.required]],
});
}
/**
@ -220,6 +239,91 @@ export class MerListComponent implements OnInit {
break;
}
}
/**
*
* @param data
* @param checked
*/
checkedChange(data: object, checked: boolean) {
if (checked === true) {
if (this.checkedData.find(o => Number(o['id']) === Number(data['id'])) == null) {
data['checked'] = true;
this.checkedData.push(data);
}
} else {
data['checked'] = true;
const findIndex = this.checkedData.findIndex(o => Number(o['id']) === Number(data['id']));
this.checkedData.splice(findIndex, 1);
}
}
/**
*
* @param data
*/
onAllChecked(checked: boolean) {
if (checked === true) {
const filterArray = this.dataObject['list'].filter(({ disabled }) => !disabled);
for (const data of filterArray) {
if (this.checkedData.find(o => Number(o['id']) === Number(data['id'])) == null) {
data['checked'] = true;
this.checkedData.push(data);
}
}
} else {
const filterArray = this.dataObject['list'].filter(({ disabled }) => !disabled);
for (const data of filterArray) {
data['checked'] = false;
const findIndex = this.checkedData.findIndex(o => Number(o['id']) === Number(data['id']));
this.checkedData.splice(findIndex, 1);
}
}
}
submitMigrateSalesman() {
for (const i in this.merMigrateSalesmanForm.controls) {
this.merMigrateSalesmanForm.controls[i].markAsDirty();
this.merMigrateSalesmanForm.controls[i].updateValueAndValidity();
}
if (this.merMigrateSalesmanForm.status == null || this.merMigrateSalesmanForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请选择业务员',
});
return;
}
if (this.checkedData.length === 0) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请选择需要转移的商户',
});
return;
}
const merList = [];
for (const mer of this.checkedData) {
merList.push(mer['id']);
}
this.merMigrateSalesmanForm.value['merList'] = merList;
this.merService.merMigrateSalesman(this.merMigrateSalesmanForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功',
});
this.checkedData = [];
this.requestData(this.whereObject['pageNum']);
this.merMigrateSalesmanModal = false;
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
}

@ -108,11 +108,15 @@ export class TradeCheckingDetailComponent implements OnInit {
searchSettleTime(dateType: number, selectDate: Date) {
if (new Date().getDate() === selectDate.getDate()) {
const currentDate = new Date();
if (currentDate.getFullYear() === selectDate.getFullYear()
&& currentDate.getMonth() === selectDate.getMonth()
&& currentDate.getDate() === selectDate.getDate()) {
this.modal.error({
nzTitle: '提示',
nzContent: '无法选择当日,当日还未清算'
});
return;
// 起始时间
if (dateType === 1) {
this.searchForm.controls['settleTimeS'].setValue(this.currentDate.getTime());

@ -93,11 +93,15 @@ export class TradeCheckingComponent implements OnInit {
searchSettleTime(dateType: number, selectDate: Date) {
if (new Date().getDate() === selectDate.getDate()) {
const currentDate = new Date();
if (currentDate.getFullYear() === selectDate.getFullYear()
&& currentDate.getMonth() === selectDate.getMonth()
&& currentDate.getDate() === selectDate.getDate()) {
this.modal.error({
nzTitle: '提示',
nzContent: '无法选择当日,当日还未清算'
});
return;
// 起始时间
if (dateType === 1) {
this.searchForm.controls['settleTimeS'].setValue(this.currentDate.getTime());

@ -35,5 +35,11 @@ export class MerService {
});
}
merMigrateSalesman(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'mer/merMigrateSalesman', paramObject).subscribe(data => {
callBack(data);
});
}
}

Loading…
Cancel
Save