parent
07e9972b77
commit
0c31b1e012
@ -0,0 +1,116 @@ |
||||
<!-- |
||||
<!– start 面包屑 –> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!– end 面包屑 –> |
||||
<!–条件搜索–> |
||||
|
||||
<div class="inner-content"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)"> |
||||
<div nz-row> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">班组名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="name" /> |
||||
</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"> |
||||
<input nz-input formControlName="principalName" /> |
||||
</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"> |
||||
<input nz-input formControlName="principalPhone" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
|
||||
<div nz-row> |
||||
<div nz-col nzSpan="24" class="search-button"> |
||||
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button> |
||||
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button> |
||||
</div> |
||||
|
||||
<!–数组表格 –> |
||||
<nz-table #basicTable |
||||
[nzData]="dataObject.list" |
||||
[nzTotal]="dataObject.total" |
||||
[nzFrontPagination]="false" |
||||
[nzLoading]="tableLoading" |
||||
[nzPageIndex]="whereObject.pageNum" |
||||
(nzPageIndexChange)="requestData($event)" |
||||
[nzScroll]="{ x: '1150px'}"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="100px">序号</th> |
||||
<th nzWidth="100px">班组名称</th> |
||||
<th nzWidth="150px">负责人名称</th> |
||||
<th nzWidth="100px">负责人电话</th> |
||||
<th nzWidth="120px">创建时间</th> |
||||
<th nzWidth="100px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.name}}</td> |
||||
<td>{{data.principalName}}</td> |
||||
<td>{{data.principalPhone}}</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</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"> |
||||
<ul nz-menu nzSelectable> |
||||
<li nz-menu-item><a >修改</a></li> |
||||
<li nz-menu-item><a (click)="showDeleteConfirm(data.id)">删除</a></li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
<nz-modal [(nzVisible)]="recycleAmountModal" nzTitle="油卡余额回收" (nzOnCancel)="closeRecycleAmountModal()" nzWidth="500px" [nzFooter]="null"> |
||||
<form nz-form [formGroup]="recycleAmountForm"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >卡号</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="cardNo" disabled /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >回收余额</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-input-number style="width: 100%" formControlName="amount"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >支付密码</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input type="password" formControlName="twoPwd" nz-input placeholder="请输入支付密码" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<div style="text-align: center;"> |
||||
<button nz-button nzType="primary" style="width: 150px;" [nzLoading]="recycleAmountBtnLoading" (click)="submitRecycleAmount()">确定</button> |
||||
</div> |
||||
</form> |
||||
</nz-modal> |
||||
--> |
@ -0,0 +1,97 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
||||
import {GasClassGroupService} from '../../../services/gas-class-group.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-gas-class-group-list', |
||||
templateUrl: './gas-class-group-list.component.html', |
||||
styleUrls: ['./gas-class-group-list.component.scss'] |
||||
}) |
||||
export class GasClassGroupListComponent implements OnInit { |
||||
|
||||
dataObject: any = {}; |
||||
tableLoading = true; |
||||
searchForm: FormGroup; |
||||
pageNum: number; |
||||
whereObject: any = {}; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private gasClassGroupService: GasClassGroupService, |
||||
private form: FormBuilder) { } |
||||
|
||||
ngOnInit(): void { |
||||
this.searchForm = this.form.group({ |
||||
name: [null], |
||||
principalName: [null], |
||||
principalPhone: [null], |
||||
}); |
||||
this.requestData(1); |
||||
} |
||||
|
||||
/** |
||||
* 请求数据 |
||||
*/ |
||||
requestData(pageNum) { |
||||
this.tableLoading = true; |
||||
this.whereObject['pageNum'] = pageNum; |
||||
this.whereObject['pageSize'] = 10; |
||||
this.gasClassGroupService.getClassGroupList(this.whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.dataObject = data['return_data']; |
||||
} else { |
||||
this.modal.error(data['return_msg']); |
||||
} |
||||
this.tableLoading = false; |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 搜索 |
||||
* @param whereObject 条件 |
||||
*/ |
||||
search(whereObject: object) { |
||||
this.whereObject = whereObject; |
||||
this.requestData(1); |
||||
} |
||||
|
||||
/** |
||||
* 重置 |
||||
*/ |
||||
resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
/** |
||||
* 弹出删除对话框 |
||||
*/ |
||||
showDeleteConfirm(groupId: number): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否删除该代理商', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.deleteData(groupId) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除数据 |
||||
* |
||||
*/ |
||||
deleteData(groupId: number) { |
||||
this.gasClassGroupService.delClassGroup(groupId, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,16 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import {GasClassGroupListComponent} from './gas-class-group-list/gas-class-group-list.component'; |
||||
import {GasClassGroupTaskComponent} from './gas-class-group-task/gas-class-group-task.component'; |
||||
|
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'list', component: GasClassGroupListComponent}, |
||||
{ path: 'task-list', component: GasClassGroupTaskComponent}, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class GasClassGroupRoutingModule { } |
@ -0,0 +1 @@ |
||||
<p>gas-class-group-task works!</p> |
@ -0,0 +1,15 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'app-gas-class-group-task', |
||||
templateUrl: './gas-class-group-task.component.html', |
||||
styleUrls: ['./gas-class-group-task.component.scss'] |
||||
}) |
||||
export class GasClassGroupTaskComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit(): void { |
||||
} |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { CommonModule } from '@angular/common'; |
||||
|
||||
import { GasClassGroupRoutingModule } from './gas-class-group-routing.module'; |
||||
import { GasClassGroupListComponent } from './gas-class-group-list/gas-class-group-list.component'; |
||||
import { GasClassGroupTaskComponent } from './gas-class-group-task/gas-class-group-task.component'; |
||||
import {NgZorroAntdModule} from 'ng-zorro-antd'; |
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; |
||||
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; |
||||
import {AppCommonModule} from '../../app-common.module'; |
||||
|
||||
|
||||
@NgModule({ |
||||
declarations: [GasClassGroupListComponent, GasClassGroupTaskComponent], |
||||
imports: [ |
||||
CommonModule, |
||||
GasClassGroupRoutingModule, |
||||
NgZorroAntdModule, |
||||
ReactiveFormsModule, |
||||
FormsModule, |
||||
BreadcrumbModule, |
||||
AppCommonModule, |
||||
] |
||||
}) |
||||
export class GasClassGroupModule { } |
@ -0,0 +1,76 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from '@angular/common/http'; |
||||
import {CommonsService} from './commons.service'; |
||||
import {environment} from '../../environments/environment'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class GasClassGroupTaskService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 开启班组任务 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public startGroupTask(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasClassGroupTask/startGroupTask', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 结束班组任务 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public endGroupTask(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasClassGroupTask/endGroupTask', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 交换班组任务 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public swapGroupTask(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasClassGroupTask/swapGroupTask', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 交换班组任务 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getClassGroupTaskById(id: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'gasClassGroupTask/getClassGroupTaskById?gasClassGroupTaskId=' + id).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 交换班组任务 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getClassGroupTaskList(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'gasClassGroupTask/getClassGroupTaskList' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,63 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from '@angular/common/http'; |
||||
import {CommonsService} from './commons.service'; |
||||
import {environment} from '../../environments/environment'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class GasClassGroupService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 编辑班组 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public editClassGroup(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasClassGroup/editClassGroup', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除班组 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public delClassGroup(groupId: number, callBack) { |
||||
this.http.post(environment.baseUrl + 'gasClassGroup/delClassGroup', { id: groupId}).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id查询详情 |
||||
* |
||||
* @param groupId 班组id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getClassGroupById(groupId: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'gasClassGroup/getClassGroupById?groupId=' + groupId).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询班组列表 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getClassGroupList(param: Object, callBack) { |
||||
this.http.get(environment.baseUrl + 'gasClassGroup/getClassGroupList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
Loading…
Reference in new issue