提交代码

pull/1/head
胡锐 2 years ago
parent 07e9972b77
commit 0c31b1e012
  1. 116
      src/app/admin/gas-class-group/gas-class-group-list/gas-class-group-list.component.html
  2. 0
      src/app/admin/gas-class-group/gas-class-group-list/gas-class-group-list.component.scss
  3. 97
      src/app/admin/gas-class-group/gas-class-group-list/gas-class-group-list.component.ts
  4. 16
      src/app/admin/gas-class-group/gas-class-group-routing.module.ts
  5. 1
      src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.html
  6. 0
      src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.scss
  7. 15
      src/app/admin/gas-class-group/gas-class-group-task/gas-class-group-task.component.ts
  8. 25
      src/app/admin/gas-class-group/gas-class-group.module.ts
  9. 1
      src/app/admin/login/login/login.component.ts
  10. 5
      src/app/app-routing.module.ts
  11. 76
      src/app/services/gas-class-group-task.service.ts
  12. 63
      src/app/services/gas-class-group.service.ts

@ -0,0 +1,116 @@
<!--
&lt;!&ndash; start 面包屑 &ndash;&gt;
<app-breadcrumb></app-breadcrumb>
&lt;!&ndash; end 面包屑 &ndash;&gt;
&lt;!&ndash;条件搜索&ndash;&gt;
<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>
&lt;!&ndash;数组表格 &ndash;&gt;
<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,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 { }

@ -51,6 +51,7 @@ export class LoginComponent implements OnInit {
} }
this.loginService.userLogin(this.loginForm.value, data => { this.loginService.userLogin(this.loginForm.value, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
data['return_data']['object']['menuList'] = data['return_data']['object']['menuList'].filter(o => o.showOnMobile == 0);
this.store.set(ADMIN_INFO_OBJECT, data['return_data']['object']); this.store.set(ADMIN_INFO_OBJECT, data['return_data']['object']);
this.store.set(TOKEN, data['return_data']['uniqueCode']); this.store.set(TOKEN, data['return_data']['uniqueCode']);
this.store.set(INIT_FLAG, true); this.store.set(INIT_FLAG, true);

@ -132,6 +132,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/device/device.module').then(m => m.DeviceModule), loadChildren: () => import('./admin/device/device.module').then(m => m.DeviceModule),
canActivate: [InitGuardService] canActivate: [InitGuardService]
}, },
{
path: 'gas-class-group',
loadChildren: () => import('./admin/gas-class-group/gas-class-group.module').then(m => m.GasClassGroupModule),
canActivate: [InitGuardService]
},
{ {
path: 'api-product', path: 'api-product',
loadChildren: () => import('./admin/api-product/api-product.module').then(m => m.ApiProductModule), loadChildren: () => import('./admin/api-product/api-product.module').then(m => m.ApiProductModule),

@ -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…
Cancel
Save