You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
puhui-go-web/src/app/pages/account/complaint/complaint.component.ts

111 lines
3.4 KiB

import { Component } from '@angular/core';
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzImageDirective} from "ng-zorro-antd/image";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm";
import {
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} from "ng-zorro-antd/table";
import {PlatformCodePipe} from "../../../pipes/common/platform-code.pipe";
import {FormGroup, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms";
import {NzMessageService} from "ng-zorro-antd/message";
import {CommonService} from "../../../services/common/common.service";
import {CmsService} from "../../../services/cms/cms.service";
import {UserService} from "../../../services/account/user.service";
@Component({
selector: 'app-complaint',
standalone: true,
imports: [
DatePipe,
NgForOf,
NgIf,
NzButtonComponent,
NzColDirective,
NzDividerComponent,
NzDropDownADirective,
NzDropDownDirective,
NzDropdownMenuComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzIconDirective,
NzImageDirective,
NzInputDirective,
NzMenuDirective,
NzMenuItemComponent,
NzOptionComponent,
NzPopconfirmDirective,
NzRowDirective,
NzSelectComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
PlatformCodePipe,
ReactiveFormsModule
],
templateUrl: './complaint.component.html',
styleUrl: './complaint.component.less'
})
export class ComplaintComponent {
// 表单页数
tablePageNum = 1;
// 表单数据
tableData: any = {
total: 0,
loading: false,
list: [],
};
// 搜索表单
searchForm: FormGroup;
constructor(private fb: NonNullableFormBuilder,
private msg: NzMessageService,
private userService: UserService) {
// 初始化搜索框
this.searchForm = this.fb.group({
phone: [''],
name: [''],
});
this.getRequest();
}
// 查询列表
public getRequest(reset: boolean = false) {
this.tableData.loading = true;
if (reset) {
this.tablePageNum = 1;
}
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = 10;
this.searchForm.value.time = new Date().getTime();
this.userService.queryComplaintList(this.searchForm.value , (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
} else {
this.msg.error(data['return_msg']);
}
this.tableData.loading = false;
});
}
}