提交代码

master
胡锐 2 years ago
parent 47a9b2d0d2
commit 24ed2cfc1f
  1. 12
      src/app/admin/agent/agent-list/agent-list.component.html
  2. 31
      src/app/admin/agent/agent-list/agent-list.component.ts
  3. 82
      src/app/admin/company/company-add/company-add.component.html
  4. 46
      src/app/admin/company/company-add/company-add.component.scss
  5. 25
      src/app/admin/company/company-add/company-add.component.spec.ts
  6. 73
      src/app/admin/company/company-add/company-add.component.ts
  7. 69
      src/app/admin/company/company-list/company-list.component.html
  8. 0
      src/app/admin/company/company-list/company-list.component.scss
  9. 25
      src/app/admin/company/company-list/company-list.component.spec.ts
  10. 64
      src/app/admin/company/company-list/company-list.component.ts
  11. 18
      src/app/admin/company/company-routing.module.ts
  12. 72
      src/app/admin/company/company-update/company-update.component.html
  13. 46
      src/app/admin/company/company-update/company-update.component.scss
  14. 25
      src/app/admin/company/company-update/company-update.component.spec.ts
  15. 87
      src/app/admin/company/company-update/company-update.component.ts
  16. 26
      src/app/admin/company/company.module.ts
  17. 146
      src/app/admin/device/device-list/device-list.component.html
  18. 4
      src/app/admin/device/device-list/device-list.component.scss
  19. 258
      src/app/admin/device/device-list/device-list.component.ts
  20. 183
      src/app/admin/device/device-order-list/device-order-list.component.html
  21. 7
      src/app/admin/device/device-order-list/device-order-list.component.scss
  22. 25
      src/app/admin/device/device-order-list/device-order-list.component.spec.ts
  23. 127
      src/app/admin/device/device-order-list/device-order-list.component.ts
  24. 4
      src/app/admin/device/device-routing.module.ts
  25. 3
      src/app/admin/device/device.module.ts
  26. 55
      src/app/admin/pay-qr-code/pay-qr-code-list/pay-qr-code-list.component.html
  27. 90
      src/app/admin/pay-qr-code/pay-qr-code-list/pay-qr-code-list.component.ts
  28. 24
      src/app/admin/salesman/salesman-list/salesman-list.component.html
  29. 50
      src/app/admin/salesman/salesman-list/salesman-list.component.ts
  30. 70
      src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.html
  31. 6
      src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.scss
  32. 25
      src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.spec.ts
  33. 85
      src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.ts
  34. 112
      src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.html
  35. 0
      src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.scss
  36. 25
      src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.spec.ts
  37. 172
      src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.ts
  38. 16
      src/app/admin/store-discount-activity/store-discount-activity-routing.module.ts
  39. 25
      src/app/admin/store-discount-activity/store-discount-activity.module.ts
  40. 6
      src/app/admin/store/store-list/store-list.component.html
  41. 4
      src/app/admin/store/store-list/store-list.component.ts
  42. 8
      src/app/app-common.module.ts
  43. 10
      src/app/app-routing.module.ts
  44. 17
      src/app/pipes/device/device-order-pay-type.pipe.ts
  45. 22
      src/app/pipes/device/device-order-status.pipe.ts
  46. 19
      src/app/pipes/device/device-order-type.pipe.ts
  47. 17
      src/app/pipes/device/device-type.pipe.ts
  48. 5
      src/app/pipes/index.ts
  49. 10
      src/app/services/commons.service.ts
  50. 60
      src/app/services/company.service.ts
  51. 48
      src/app/services/device-order.service.ts
  52. 47
      src/app/services/device.service.ts
  53. 10
      src/app/services/pay-qr-code.service.ts
  54. 4
      src/app/services/salesman.service.ts
  55. 81
      src/app/services/store-discount-activity.service.ts
  56. 11
      src/app/services/store.service.ts
  57. 1
      src/environments/environment.ts

@ -6,6 +6,16 @@
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8" *ngIf="userObjectType === 0">
<nz-form-item>
<nz-form-label [nzSpan]="8">分公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="companyId">
<nz-option *ngFor="let item of companyArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">代理商名称</nz-form-label>
@ -70,6 +80,7 @@
<thead>
<tr>
<th nzWidth="100px">序号</th>
<th nzWidth="200px" *ngIf="userObjectType === 0">分公司</th>
<th nzWidth="200px">代理商名称</th>
<th nzWidth="150px">联系人</th>
<th nzWidth="150px">联系电话</th>
@ -82,6 +93,7 @@
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{i + 1}}</td>
<td *ngIf="userObjectType === 0">{{data.companyName}}</td>
<td>{{data.name}}</td>
<td>{{data.contactPerson}}</td>
<td>{{data.contactPersonPhone}}</td>

@ -2,6 +2,9 @@ import { Component, OnInit } from '@angular/core';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {AgentService} from '../../../services/agent.service';
import {FormBuilder, FormGroup} from '@angular/forms';
import {CompanyService} from '../../../services/company.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
@Component({
selector: 'app-agent-list',
@ -16,13 +19,26 @@ export class AgentListComponent implements OnInit {
pageNum: number;
whereObject: any = {};
userObjectType: number;
companyArray = [];
constructor(private modal: NzModalService,
private message: NzMessageService,
private agentService: AgentService,
private form: FormBuilder) { }
private companyService: CompanyService,
private localStorageService: LocalStorageService,
private form: FormBuilder) {
this.userObjectType = Number(this.localStorageService.get(ADMIN_INFO_OBJECT)['secUser']['objectType']);
}
ngOnInit(): void {
if (this.userObjectType != null && this.userObjectType === 0) {
this.getCompanyList();
}
this.searchForm = this.form.group({
companyId: [null],
name: [null],
contactPerson: [null],
contactPersonPhone: [null],
@ -31,6 +47,19 @@ export class AgentListComponent implements OnInit {
this.requestData(1);
}
/**
*
*/
getCompanyList() {
this.companyService.selectCompanyList({pageNum: 1, pageSize: 99 }, data => {
if (data['return_code'] === '000000') {
this.companyArray = data['return_data']['list'];
} else {
this.modal.error(data['return_msg']);
}
});
}
/**
*
*/

@ -0,0 +1,82 @@
<!-- start 面包屑 -->
<nz-breadcrumb>
<nz-breadcrumb-item>
代理商
</nz-breadcrumb-item>
<nz-breadcrumb-item>
添加代理商
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<div class="main">
<form nz-form [formGroup]="companyForm">
<div class="title">账户信息</div>
<div nz-row>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>账户名称</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input type="text" formControlName="loginName" placeholder="请输入账户" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>账户密码</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input type="text" formControlName="password" placeholder="请输入密码" />
</nz-form-control>
</nz-form-item>
</div>
</div>
<div class="title">公司信息</div>
<div nz-row>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>地区</nz-form-label>
<nz-form-control [nzSpan]="8">
<nz-select formControlName="regionId" nzShowSearch nzAllowClear [nzPlaceHolder]="'请选择公司地区'">
<nz-option *ngFor="let item of provinceArray" nzValue="{{item.regionId}}" nzLabel="{{item.regionName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>公司名称</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input type="text" formControlName="name" placeholder="请输入公司名称" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8">联系电话</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input formControlName="phone" placeholder="联系电话"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8">所在地址</nz-form-label>
<nz-form-control [nzSpan]="8">
<textarea nz-input rows="4" maxlength="100" formControlName="address" placeholder="详细地址"></textarea>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div class="btn-div">
<button class="btn-post" nz-button nzType="primary" (click)="submitFrom()" [nzLoading]="btnLoading" nzBlock>保存</button>
</div>
</form>
</div>
</div>

@ -0,0 +1,46 @@
.main {
width: 90%;
margin-left: 5%;
.title {
width: 100%;
height: 46px;
line-height: 46px;
font-size: 16px;
text-align: center;
color: #1890ff;
background-color: #f3f9ff;
margin-bottom: 20px;
}
.idCard {
img {
width: 100px;
}
.userImg {
width: 90px;
}
}
.post_p_l {
//margin-left: 5% ;
}
.main_post_p {
font-size: 12px;
color: #999999;
margin-top: -10px;
}
.btn {
margin-top: 20px;
}
.bottom_solid {
border-bottom: 1px solid #e4e4e4;
}
.btn-div {
width: 100%;
text-align: center;
}
.btn-post {
width: 25%;
}
nz-date-picker {
width: 100%;
}
}

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CompanyAddComponent } from './company-add.component';
describe('CompanyAddComponent', () => {
let component: CompanyAddComponent;
let fixture: ComponentFixture<CompanyAddComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CompanyAddComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CompanyAddComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,73 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzModalService} from 'ng-zorro-antd';
import {ActivatedRoute, Router} from '@angular/router';
import {ValidatorsService} from '../../../services/validators.service';
import {CompanyService} from '../../../services/company.service';
import {CommonsService} from '../../../services/commons.service';
@Component({
selector: 'app-company-add',
templateUrl: './company-add.component.html',
styleUrls: ['./company-add.component.scss']
})
export class CompanyAddComponent implements OnInit {
companyForm: FormGroup;
btnLoading = false;
provinceArray = [];
constructor(private form: FormBuilder,
private modal: NzModalService,
private companyService: CompanyService,
private commonsService: CommonsService,
private activatedRoute: ActivatedRoute,
private router: Router) { }
ngOnInit(): void {
this.commonsService.getProvinceList(data => {
this.provinceArray = data['return_data'];
});
this.companyForm = this.form.group({
regionId: [null, [Validators.required]],
name: [null, [Validators.required]],
loginName: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(20)]],
password: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(20)]],
address: [null],
phone: [null],
});
}
submitFrom() {
this.btnLoading = true;
for (const i in this.companyForm.controls) {
this.companyForm.controls[i].markAsDirty();
this.companyForm.controls[i].updateValueAndValidity();
}
if (this.companyForm.status == null || this.companyForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请规范填写所有的必填项信息',
});
this.btnLoading = false;
return;
}
this.companyService.insertCompany(this.companyForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '添加成功',
nzOnOk: () => this.router.navigateByUrl('admin/company/list')
});
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
this.btnLoading = false;
});
}
}

@ -0,0 +1,69 @@
<!-- 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>
<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" [routerLink]="'/admin/company/add'"><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="200px">公司地区</th>
<th nzWidth="200px">公司名称</th>
<th nzWidth="150px">联系电话</th>
<th nzWidth="200px">详细地址</th>
<th nzWidth="160px">创建时间</th>
<th nzWidth="150px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{i + 1}}</td>
<td>{{data.regionName}}</td>
<td>{{data.name}}</td>
<td>{{data.phone?data.phone:'未填写'}}</td>
<td>{{data.address?data.address:'未填写'}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight="0px" class="table-td-operation">
<!--<a [routerLink]="['/admin/agent/detail']" [queryParams]="{agentId: data.id}">详情</a>-->
<a [routerLink]="['/admin/company/update']" [queryParams]="{companyId: data.id}">修改</a>
</td>
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CompanyListComponent } from './company-list.component';
describe('CompanyListComponent', () => {
let component: CompanyListComponent;
let fixture: ComponentFixture<CompanyListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CompanyListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CompanyListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,64 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {CompanyService} from '../../../services/company.service';
@Component({
selector: 'app-company-list',
templateUrl: './company-list.component.html',
styleUrls: ['./company-list.component.scss']
})
export class CompanyListComponent implements OnInit {
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
constructor(private modal: NzModalService,
private message: NzMessageService,
private companyService: CompanyService,
private form: FormBuilder) { }
ngOnInit(): void {
this.searchForm = this.form.group({
name: [null],
});
this.requestData(1);
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.companyService.selectCompanyList(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();
}
}

@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {CompanyListComponent} from './company-list/company-list.component';
import {CompanyAddComponent} from './company-add/company-add.component';
import {CompanyUpdateComponent} from './company-update/company-update.component';
const routes: Routes = [
{ path: 'list', component: CompanyListComponent },
{ path: 'add', component: CompanyAddComponent },
{ path: 'update', component: CompanyUpdateComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class CompanyRoutingModule { }

@ -0,0 +1,72 @@
<!-- start 面包屑 -->
<nz-breadcrumb>
<nz-breadcrumb-item>
代理商
</nz-breadcrumb-item>
<nz-breadcrumb-item>
添加代理商
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<div class="main">
<form nz-form [formGroup]="companyForm">
<div class="title">账户信息</div>
<div nz-row>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>账户名称</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input type="text" formControlName="loginName" placeholder="请输入账户" />
</nz-form-control>
</nz-form-item>
</div>
</div>
<div class="title">公司信息</div>
<div nz-row>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>地区</nz-form-label>
<nz-form-control [nzSpan]="8">
<nz-select formControlName="regionId" nzShowSearch nzAllowClear [nzPlaceHolder]="'请选择公司地区'">
<nz-option *ngFor="let item of provinceArray" nzValue="{{item.regionId}}" nzLabel="{{item.regionName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzRequired>公司名称</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input type="text" formControlName="name" placeholder="请输入公司名称" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8">联系电话</nz-form-label>
<nz-form-control [nzSpan]="8">
<input nz-input formControlName="phone" placeholder="联系电话"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="8">所在地址</nz-form-label>
<nz-form-control [nzSpan]="8">
<textarea nz-input rows="4" maxlength="100" formControlName="address" placeholder="详细地址"></textarea>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div class="btn-div">
<button class="btn-post" nz-button nzType="primary" (click)="submitFrom()" [nzLoading]="btnLoading" nzBlock>保存</button>
</div>
</form>
</div>
</div>

@ -0,0 +1,46 @@
.main {
width: 90%;
margin-left: 5%;
.title {
width: 100%;
height: 46px;
line-height: 46px;
font-size: 16px;
text-align: center;
color: #1890ff;
background-color: #f3f9ff;
margin-bottom: 20px;
}
.idCard {
img {
width: 100px;
}
.userImg {
width: 90px;
}
}
.post_p_l {
//margin-left: 5% ;
}
.main_post_p {
font-size: 12px;
color: #999999;
margin-top: -10px;
}
.btn {
margin-top: 20px;
}
.bottom_solid {
border-bottom: 1px solid #e4e4e4;
}
.btn-div {
width: 100%;
text-align: center;
}
.btn-post {
width: 25%;
}
nz-date-picker {
width: 100%;
}
}

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CompanyUpdateComponent } from './company-update.component';
describe('CompanyUpdateComponent', () => {
let component: CompanyUpdateComponent;
let fixture: ComponentFixture<CompanyUpdateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CompanyUpdateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CompanyUpdateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,87 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzModalService} from 'ng-zorro-antd';
import {CompanyService} from '../../../services/company.service';
import {CommonsService} from '../../../services/commons.service';
import {ActivatedRoute, Params, Router} from '@angular/router';
@Component({
selector: 'app-company-update',
templateUrl: './company-update.component.html',
styleUrls: ['./company-update.component.scss']
})
export class CompanyUpdateComponent implements OnInit {
companyForm: FormGroup;
btnLoading = false;
provinceArray = [];
dataObject: any = {};
constructor(private form: FormBuilder,
private modal: NzModalService,
private companyService: CompanyService,
private commonsService: CommonsService,
private activatedRoute: ActivatedRoute,
private router: Router) { }
ngOnInit(): void {
this.commonsService.getProvinceList(data => {
this.provinceArray = data['return_data'];
});
this.activatedRoute.queryParams.subscribe((queryParams: Params) => {
if (queryParams['companyId'] != null && queryParams['companyId'].length > 0) {
this.companyService.companyView(queryParams['companyId'], data => {
if (data['return_code'] === '000000') {
this.dataObject = data['return_data']['company'];
this.dataObject['loginName'] = data['return_data']['user']['loginName'];
this.dataObject['password'] = data['return_data']['user']['password'];
this.companyForm.patchValue(this.dataObject);
}
});
}
});
this.companyForm = this.form.group({
regionId: [null, [Validators.required]],
name: [null, [Validators.required]],
loginName: [{ value: null, disabled: true}],
address: [null],
phone: [null],
});
}
submitFrom() {
this.btnLoading = true;
for (const i in this.companyForm.controls) {
this.companyForm.controls[i].markAsDirty();
this.companyForm.controls[i].updateValueAndValidity();
}
if (this.companyForm.status == null || this.companyForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请规范填写所有的必填项信息',
});
this.btnLoading = false;
return;
}
this.companyForm.value['companyId'] = this.dataObject['id'];
this.companyService.updateCompany(this.companyForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '修改成功',
nzOnOk: () => this.router.navigateByUrl('admin/company/list')
});
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
this.btnLoading = false;
});
}
}

@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CompanyRoutingModule } from './company-routing.module';
import { CompanyAddComponent } from './company-add/company-add.component';
import { CompanyListComponent } from './company-list/company-list.component';
import { CompanyUpdateComponent } from './company-update/company-update.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: [CompanyAddComponent, CompanyListComponent, CompanyUpdateComponent],
imports: [
CommonModule,
CompanyRoutingModule,
NgZorroAntdModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule,
AppCommonModule,
]
})
export class CompanyModule { }

@ -7,7 +7,46 @@
<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">
<nz-select nzAllowClear formControlName="deviceType">
<nz-option *ngFor="let item of deviceTypeArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</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="deviceNo" />
</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="status">
<nz-option nzLabel="正常" nzValue="1"></nz-option>
<nz-option nzLabel="停用" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row *ngIf="isCollapse">
<div nz-col nzSpan="8" *ngIf="roleType == 1">
<nz-form-item>
<nz-form-label [nzSpan]="8">公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="companyName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 6">
<nz-form-item>
<nz-form-label [nzSpan]="8">代理商</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -15,7 +54,7 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2">
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 6">
<nz-form-item>
<nz-form-label [nzSpan]="8">业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -23,7 +62,7 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3">
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3 || roleType == 6">
<nz-form-item>
<nz-form-label [nzSpan]="8">商户</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -31,7 +70,7 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3 || roleType == 4">
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3 || roleType == 4 || roleType == 6">
<nz-form-item>
<nz-form-label [nzSpan]="8">门店</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -39,20 +78,15 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3 || roleType == 4">
<nz-form-item>
<nz-form-label [nzSpan]="8">设备SN号</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="deviceSn" />
</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>
<a class="collapse" (click)="toggleCollapse()">更多条件
<i nz-icon [nzType]="isCollapse ? 'down' : 'up'"></i>
</a>
</div>
</div>
</form>
@ -61,20 +95,11 @@
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" *ngIf="BTN_COMPANY_ALLOCATION" (click)="showAllocationCompanyModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配公司</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="BTN_AGENT_ALLOCATION" (click)="showAllocationAgentModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配代理商</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="BTN_SALESMAN_ALLOCATION" (click)="showAllocationSalesmanModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配业务员</button>
<button *ngIf="BTN_DOWN_DEVICE" nz-button nzType="primary" class="right-btn" (click)="downloadDeviceTemplate()"><i nz-icon nzType="download" nzTheme="outline"></i>下载导入模板</button>
<nz-upload
*ngIf="BTN_IMPORT_DEVICE"
class="right-btn"
[nzAccept]="'.xls,.xlsx'"
nzAction="{{baseUrl}}device/importDevice"
[nzHeaders]="{ authorization: 'authorization-text' }"
(nzChange)="importDeviceChange($event)"
[nzShowUploadList]="false"
>
<button nz-button nzType="primary" ><i nz-icon nzType="import" nzTheme="outline"></i>Excel导入设备</button>
</nz-upload>
<button *ngIf="BTN_IMPORT_DEVICE" nz-button nzType="primary" class="right-btn" (click)="showImportDevice()"><i nz-icon nzType="upload" nzTheme="outline"></i>导入设备</button>
</div>
<!--数组表格 -->
@ -89,13 +114,14 @@
<thead>
<tr>
<th nzWidth="100px" [nzShowCheckbox]="false"></th>
<th nzWidth="190px">设备SN号</th>
<th nzWidth="130px">设备类型</th>
<th nzWidth="190px">设备编号</th>
<th nzWidth="150px">公司</th>
<th nzWidth="150px">代理商</th>
<th nzWidth="150px">业务员</th>
<th nzWidth="180px">商户</th>
<th nzWidth="180px">门店</th>
<th nzWidth="180px">绑定门店时间</th>
<th nzWidth="100px">状态</th>
<th nzWidth="100px">设备状态</th>
<th nzWidth="160px">创建时间</th>
<th nzWidth="160px">创建人</th>
<th nzWidth="120px" nzRight="0px">操作</th>
@ -108,17 +134,13 @@
[nzChecked]="data.checked"
(nzCheckedChange)="checkedChange(data, $event)"
></td>
<td>{{data.deviceSn}}</td>
<td>{{data.deviceType | deviceType}}</td>
<td>{{data.deviceNo}}</td>
<td>{{data.companyName?data.companyName:'未分配'}}</td>
<td>{{data.agentName?data.agentName:'未分配'}}</td>
<td>{{data.salesmanName?data.salesmanName:'未分配'}}</td>
<td>{{data.merName?data.merName:'未绑定'}}</td>
<td>{{data.storeName?data.storeName:'未绑定'}}</td>
<td>
<span *ngIf="data.storeBindTime != null">
{{data.storeBindTime | date : 'yyyy-MM-dd HH:mm:ss'}}
</span>
<span *ngIf="data.storeBindTime == null">未绑定</span>
</td>
<td>{{data.merName?data.merName:'未分配'}}</td>
<td>{{data.storeName?data.storeName:'未分配'}}</td>
<td>{{data.status | deviceStatus}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.opUserName}}</td>
@ -126,8 +148,10 @@
<a nz-dropdown [nzDropdownMenu]="menu">操作列表 <i nz-icon nzType="down"></i> </a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li *ngIf="BTN_STORE_BIND" nz-menu-item>门店绑定</li>
<li *ngIf="BTN_STORE_UNBIND" (click)="showUnbindStore(data.id)" nz-menu-item>门店解绑</li>
<li *ngIf="BTN_STORE_UNBIND && data.storeName != null" (click)="showUnbindStore(data.id)" nz-menu-item>门店解绑</li>
<li *ngIf="BTN_DEVICE_DISABLE && data.status == 1" (click)="showDisable(data.id)" nz-menu-item>停用</li>
<li *ngIf="BTN_DEVICE_ENABLE && data.status == 2" (click)="showEnable(data.id)" nz-menu-item>启用</li>
<li *ngIf="BTN_DEVICE_DEL" (click)="showDeleteConfirm(data.id)" nz-menu-item>删除</li>
</ul>
</nz-dropdown-menu>
</td>
@ -142,20 +166,66 @@
<thead>
<tr>
<th nzWidth="50px">序号</th>
<th nzWidth="150px">设备SN</th>
<th nzWidth="150px">设备</th>
<th nzWidth="300px">原因</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{ i + 1}}</td>
<td>{{data.deviceSn}}</td>
<td>{{data.deviceNo}}</td>
<td>{{data.errorMessage}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="importDeviceModal" nzTitle="导入设备" (nzOnCancel)="importDeviceModal = false" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="importDeviceForm">
<nz-form-item>
<nz-form-label [nzSpan]="6">设备类型</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="deviceType">
<nz-option *ngFor="let data of deviceTypeArray" nzLabel="{{data.codeName}}" nzValue="{{data.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6">文件</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-upload
*ngIf="BTN_IMPORT_DEVICE"
[nzAccept]="'.xls,.xlsx'"
nzAction="{{baseUrl}}fileUpload/uploadfile"
[nzHeaders]="{ authorization: 'authorization-text' }"
(nzChange)="importDeviceChange($event)"
>
<button nz-button ><i nz-icon nzType="upload"></i>上传文件</button>
</nz-upload>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitImportDevice()">确定</button>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="allocationCompanyModal" nzTitle="分配公司" (nzOnCancel)="closeAllocationCompanyModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="allocationCompanyForm">
<nz-form-item>
<nz-form-label [nzSpan]="6">公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzShowSearch nzAllowClear formControlName="companyId">
<nz-option *ngFor="let data of companyDataArray" nzLabel="{{data.name}}" nzValue="{{data.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)="submitAllocationCompany()">确定</button>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="allocationAgentModal" nzTitle="分配代理商" (nzOnCancel)="closeAllocationAgentModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="allocationAgentForm">
<nz-form-item>

@ -1,3 +1,7 @@
.table-td-operation a {
padding: 0px 5px;
}
.collapse {
margin-left: 8px;
font-size: 12px;
}

@ -7,6 +7,8 @@ import {AgentService} from '../../../services/agent.service';
import {SalesmanService} from '../../../services/salesman.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {CompanyService} from '../../../services/company.service';
import {CommonsService} from '../../../services/commons.service';
@Component({
selector: 'app-device-list',
@ -32,6 +34,10 @@ export class DeviceListComponent implements OnInit {
checkedData = [];
companyDataArray = [];
allocationCompanyModal = false;
allocationCompanyForm: FormGroup;
agentDataArray = [];
allocationAgentModal = false;
allocationAgentForm: FormGroup;
@ -43,15 +49,25 @@ export class DeviceListComponent implements OnInit {
importDeviceErrorModal = false;
importDeviceErrorData = [];
importDeviceModal = false;
importDeviceForm: FormGroup;
deviceTypeArray = [];
BTN_IMPORT_DEVICE = false;
BTN_DOWN_DEVICE = false;
BTN_COMPANY_ALLOCATION;
BTN_AGENT_ALLOCATION;
BTN_SALESMAN_ALLOCATION;
BTN_STORE_BIND;
BTN_STORE_UNBIND;
BTN_DEVICE_ENABLE;
BTN_DEVICE_DISABLE;
BTN_DEVICE_DEL;
isCollapse = false;
constructor(private modal: NzModalService,
private message: NzMessageService,
private companyService: CompanyService,
private commonsService: CommonsService,
private salesmanService: SalesmanService,
private agentService: AgentService,
private deviceService: DeviceService,
@ -61,19 +77,45 @@ export class DeviceListComponent implements OnInit {
}
ngOnInit(): void {
this.BTN_IMPORT_DEVICE = this.store.isBtnCompetence('BTN_import_device'); // 导入设备 按钮权限
this.BTN_DOWN_DEVICE = this.store.isBtnCompetence('BTN_down_device'); // 下载设备 按钮权限
this.BTN_AGENT_ALLOCATION = this.store.isBtnCompetence('BTN_agent_allocation'); // 分配代理商 按钮权限
this.BTN_IMPORT_DEVICE = this.store.isBtnCompetence('BTN_import_device'); // 导入设备 按钮权限
this.BTN_DOWN_DEVICE = this.store.isBtnCompetence('BTN_down_device'); // 下载设备 按钮权限
this.BTN_COMPANY_ALLOCATION = this.store.isBtnCompetence('BTN_company_allocation'); // 分配代理商 按钮权限
this.BTN_AGENT_ALLOCATION = this.store.isBtnCompetence('BTN_agent_allocation'); // 分配代理商 按钮权限
this.BTN_SALESMAN_ALLOCATION = this.store.isBtnCompetence('BTN_salesman_allocation'); // 分配业务员 按钮权限
this.BTN_STORE_BIND = this.store.isBtnCompetence('BTN_store_bind'); // 门店绑定 按钮权限
this.BTN_STORE_UNBIND = this.store.isBtnCompetence('BTN_store_unbind'); // 门店解绑 按钮权限
this.BTN_DEVICE_ENABLE = this.store.isBtnCompetence('BTN_device_enable'); // 启用 按钮权限
this.BTN_DEVICE_DISABLE = this.store.isBtnCompetence('BTN_device_disable'); // 禁用 按钮权限
this.BTN_DEVICE_DEL = this.store.isBtnCompetence('BTN_device_del'); // 删除 按钮权限
this.BTN_STORE_UNBIND = this.store.isBtnCompetence('BTN_store_unbind'); // 门店解绑 按钮权限
this.searchForm = this.form.group({
companyName: [null],
agentName: [null],
salesmanName: [null],
merName: [null],
storeName: [null],
deviceSn: [null],
deviceType: [null],
deviceNo: [null],
status: [null],
});
this.commonsService.getDictionary('DEVICE_TYPE', data => {
this.deviceTypeArray = data['return_data'];
});
this.importDeviceForm = this.form.group({
deviceType: ['1', [Validators.required]],
file: [null],
});
this.allocationCompanyForm = this.form.group({
companyId: [null, [Validators.required]],
});
this.companyService.selectCompanyList({ pageNum: 1, pageSize: 999 }, data => {
if (data['return_code'] === '000000') {
this.companyDataArray = data['return_data']['list'];
}
});
this.allocationAgentForm = this.form.group({
@ -136,7 +178,7 @@ export class DeviceListComponent implements OnInit {
showDeleteConfirm(data: object): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否删除该设备',
nzContent: '是否删除该设备',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
@ -165,7 +207,14 @@ export class DeviceListComponent implements OnInit {
*
*/
downloadDeviceTemplate() {
window.location.href = environment.imageUrl + '/设备导入模板.xlsx';
window.location.href = environment.imageUrl + 'template/设备导入模板.xlsx';
}
/**
*
*/
showImportDevice() {
this.importDeviceModal = true;
}
/**
@ -173,32 +222,22 @@ export class DeviceListComponent implements OnInit {
* @param fileInfo
*/
importDeviceChange(fileInfo) {
this.loadingObject.spinning = true;
this.loadingObject.msg = '设备导入中...';
if (fileInfo.file.status !== 'uploading') {
}
if (fileInfo.file.status === 'done') {
this.loadingObject.spinning = false;
if (fileInfo.file.response.return_code === '000000') {
this.loadingObject.spinning = false;
if (fileInfo.file.response.return_data == null || fileInfo.file.response.return_data.length === 0) {
this.modal.success({
this.modal.error({
nzTitle: '提示',
nzContent: '成功',
nzOnOk: () => this.requestData(1)
nzContent: '文件上传失败',
});
} else {
console.log(fileInfo.file.response.return_data);
this.modal.warning({
nzTitle: '提示',
nzOkText: '导入失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showDeviceErrorModal(fileInfo.file.response.return_data)
});
this.importDeviceForm.controls['file'].setValue(fileInfo.file.response.return_data[0]);
}
} else {
this.loadingObject.spinning = false;
this.modal.error({
nzTitle: '提示',
nzContent: fileInfo.file.response.return_msg,
@ -213,6 +252,59 @@ export class DeviceListComponent implements OnInit {
}
}
/**
*
*/
submitImportDevice() {
this.loadingObject.spinning = true;
this.loadingObject.msg = '导入中...';
for (const i in this.importDeviceForm.controls) {
this.importDeviceForm.controls[i].markAsDirty();
this.importDeviceForm.controls[i].updateValueAndValidity();
}
if (this.importDeviceForm.value.file == null) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请上传文件',
});
this.loadingObject.spinning = false;
return;
}
if (this.importDeviceForm.status == null || this.importDeviceForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有的必填项',
});
this.loadingObject.spinning = false;
return;
}
this.deviceService.importDevice(this.importDeviceForm.value, data => {
this.loadingObject.spinning = false;
if (data['return_code'] === '000000') {
if (data['return_data'].length === 0) {
this.modal.success({
nzTitle: '提示',
nzContent: '成功',
nzOnOk: () => this.requestData(1)
});
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '导入失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showDeviceErrorModal(data['return_data'])
});
}
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
*/
@ -229,6 +321,66 @@ export class DeviceListComponent implements OnInit {
this.importDeviceErrorModal = false;
}
/**
*
*/
showDisable(deviceId: number): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否停用该设备?设备停用后无法使用!',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
nzOnOk: () => this.disable(deviceId)
});
}
disable(id: number) {
this.deviceService.disableDevice({ deviceId: id}, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功',
});
this.requestData(this.whereObject['pageNum']);
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
*/
showEnable(deviceId: number): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否启用该设备?',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
nzOnOk: () => this.enable(deviceId)
});
}
enable(id: number) {
this.deviceService.enableDevice({ deviceId: id}, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功',
});
this.requestData(this.whereObject['pageNum']);
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
*/
@ -263,6 +415,62 @@ export class DeviceListComponent implements OnInit {
});
}
/**
*
*/
showAllocationCompanyModal() {
this.allocationCompanyModal = true;
}
/**
*
*/
closeAllocationCompanyModal() {
this.allocationCompanyModal = false;
}
/**
*
*/
submitAllocationCompany() {
for (const i in this.allocationCompanyForm.controls) {
this.allocationCompanyForm.controls[i].markAsDirty();
this.allocationCompanyForm.controls[i].updateValueAndValidity();
}
if (this.allocationCompanyForm.status == null || this.allocationCompanyForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请选择公司',
});
return;
}
if (this.checkedData.length === 0) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请选择需要分配的设备',
});
return;
}
this.allocationCompanyForm.value['deviceArray'] = this.checkedData;
this.deviceService.assignCompany(this.allocationCompanyForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '分配成功',
});
this.checkedData = [];
this.requestData(this.whereObject['pageNum']);
this.closeAllocationCompanyModal();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
*/
@ -391,4 +599,8 @@ export class DeviceListComponent implements OnInit {
}
}
toggleCollapse(): void {
this.isCollapse = !this.isCollapse;
}
}

@ -0,0 +1,183 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<nz-spin [nzSpinning]="loadingObject.spinning" nzTip="{{loadingObject.msg}}">
<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="orderNo" />
</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="orderType">
<nz-option *ngFor="let item of deviceOrderTypeArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</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="deviceType">
<nz-option *ngFor="let item of deviceTypeArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row *ngIf="isCollapse">
<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="status">
<nz-option *ngFor="let item of deviceOrderStatusArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1">
<nz-form-item>
<nz-form-label [nzSpan]="8">公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="companyName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 6">
<nz-form-item>
<nz-form-label [nzSpan]="8">代理商</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="agentName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 6">
<nz-form-item>
<nz-form-label [nzSpan]="8">业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="salesmanName" />
</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="merName" />
</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="storeName" />
</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>
<a class="collapse" (click)="toggleCollapse()">更多条件
<i nz-icon [nzType]="isCollapse ? 'down' : 'up'"></i>
</a>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-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="200px">商户</th>
<th nzWidth="150px">门店</th>
<th nzWidth="200px">订单编号</th>
<th nzWidth="100px">订单类型</th>
<th nzWidth="130px">设备类型</th>
<th nzWidth="100px">需求数量</th>
<th nzWidth="100px">支付金额</th>
<th nzWidth="100px">支付方式</th>
<th nzWidth="160px">创建时间</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>{{data.merName}}</td>
<td>{{data.storeName}}</td>
<td>{{data.orderNo}}</td>
<td>{{data.orderType | deviceOrderType}}</td>
<td>{{data.deviceType | deviceType}}</td>
<td>{{data.deviceNum}}</td>
<td>{{data.payPrice}}</td>
<td>{{data.payType | deviceOrderPayType}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.status |deviceOrderStatus}}</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 (click)="showDeviceListModal(data.orderAssignList)" nz-menu-item>设备列表</li>
</ul>
</nz-dropdown-menu>
</td>
</tr>
</tbody>
</nz-table>
</div>
</nz-spin>
<nz-modal [(nzVisible)]="deviceListModal" nzTitle="已分配设备" (nzOnCancel)="closeDeviceListModal()" nzWidth="700px" [nzFooter]="null">
<nz-table #errorStudentTable [nzData]="orderAssignList">
<thead>
<tr>
<th nzWidth="150px">订单类型</th>
<th nzWidth="150px">设备类型</th>
<th nzWidth="150px">设备编号</th>
<th nzWidth="150px">状态</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{data.orderType | deviceOrderType}}</td>
<td>{{data.deviceType | deviceType}}</td>
<td>{{data.deviceNo}}</td>
<td>
<span *ngIf="data.status == 1">使用中</span>
<span *ngIf="data.status == 2">退款中</span>
<span *ngIf="data.status == 3">已退款</span>
</td>
</tr>
</tbody>
</nz-table>
</nz-modal>

@ -0,0 +1,7 @@
.table-td-operation a {
padding: 0px 5px;
}
.collapse {
margin-left: 8px;
font-size: 12px;
}

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DeviceOrderListComponent } from './device-order-list.component';
describe('DeviceOrderListComponent', () => {
let component: DeviceOrderListComponent;
let fixture: ComponentFixture<DeviceOrderListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DeviceOrderListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DeviceOrderListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,127 @@
import { Component, OnInit } from '@angular/core';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {CommonsService} from '../../../services/commons.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {FormBuilder, FormGroup} from '@angular/forms';
import {DeviceOrderService} from '../../../services/device-order.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {environment} from '../../../../environments/environment';
@Component({
selector: 'app-device-order-list',
templateUrl: './device-order-list.component.html',
styleUrls: ['./device-order-list.component.scss']
})
export class DeviceOrderListComponent implements OnInit {
// 角色类型 0:超级管理员 1:公司 2:代理商 3:业务员 4:商户 5:门店
roleType: number;
baseUrl = environment.baseUrl;
loadingObject = {
spinning: false,
msg: '加载中'
};
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
isCollapse = false;
deviceOrderStatusArray = [];
deviceOrderTypeArray = [];
deviceTypeArray = [];
deviceListModal = false;
orderAssignList = [];
constructor(private modal: NzModalService,
private message: NzMessageService,
private commonsService: CommonsService,
private deviceOrderService: DeviceOrderService,
private store: LocalStorageService,
private form: FormBuilder) { }
ngOnInit(): void {
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
this.searchForm = this.form.group({
companyName: [null],
agentName: [null],
salesmanName: [null],
merName: [null],
storeName: [null],
orderNo: [null],
orderType: [null],
deviceType: [null],
status: [null],
});
this.commonsService.getDictionary('DEVICE_ORDER_TYPE', data => {
this.deviceOrderTypeArray = data['return_data'];
});
this.commonsService.getDictionary('DEVICE_ORDER_STATUS', data => {
this.deviceOrderStatusArray = data['return_data'];
});
this.commonsService.getDictionary('DEVICE_TYPE', data => {
this.deviceTypeArray = data['return_data'];
});
this.requestData(1);
}
toggleCollapse(): void {
this.isCollapse = !this.isCollapse;
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.deviceOrderService.getOrderList(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();
}
/**
*
*/
showDeviceListModal(dataList: []) {
this.orderAssignList = dataList;
this.deviceListModal = true;
}
/**
*
*/
closeDeviceListModal() {
this.orderAssignList = [];
this.deviceListModal = false;
}
}

@ -1,10 +1,12 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {DeviceListComponent} from './device-list/device-list.component';
import {DeviceOrderListComponent} from './device-order-list/device-order-list.component';
const routes: Routes = [
{ path: 'list', component: DeviceListComponent}
{ path: 'list', component: DeviceListComponent },
{ path: 'order-list', component: DeviceOrderListComponent }
];
@NgModule({

@ -7,10 +7,11 @@ import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {AppCommonModule} from '../../app-common.module';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import { DeviceOrderListComponent } from './device-order-list/device-order-list.component';
@NgModule({
declarations: [DeviceListComponent],
declarations: [DeviceListComponent, DeviceOrderListComponent],
imports: [
CommonModule,
DeviceRoutingModule,

@ -7,7 +7,17 @@
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8" *ngIf="roleType == 1">
<div nz-col nzSpan="8" *ngIf="userType == 0">
<nz-form-item>
<nz-form-label [nzSpan]="8">公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzShowSearch nzAllowClear formControlName="companyId" (ngModelChange)="agentChange($event)">
<nz-option *ngFor="let data of agentDataArray" nzLabel="{{data.name}}" nzValue="{{data.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="userType == 0 || userType == 1">
<nz-form-item>
<nz-form-label [nzSpan]="8">代理商</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -17,7 +27,7 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2">
<div nz-col nzSpan="8" *ngIf="userType == 0 || userType == 1 || userType == 2">
<nz-form-item>
<nz-form-label [nzSpan]="8">业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -27,7 +37,7 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3">
<div nz-col nzSpan="8" *ngIf="userType == 0 || userType == 1 || userType == 2 || userType == 3">
<nz-form-item>
<nz-form-label [nzSpan]="8">商户</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -35,7 +45,7 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3 || roleType == 4">
<div nz-col nzSpan="8" *ngIf="userType == 0 || userType == 1 || userType == 2 || userType == 3 || userType == 4">
<nz-form-item>
<nz-form-label [nzSpan]="8">门店</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -52,7 +62,19 @@
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1">
<div nz-col nzSpan="8" *ngIf="userType == 0">
<nz-form-item>
<nz-form-label [nzSpan]="8">是否分配公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="isAssignCompany" >
<nz-option nzValue="true" nzLabel="是"></nz-option>
<nz-option nzValue="false" nzLabel="否"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="userType == 0 || userType == 1">
<nz-form-item>
<nz-form-label [nzSpan]="8">是否分配代理商</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -64,7 +86,7 @@
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2">
<div nz-col nzSpan="8" *ngIf="userType == 0 || userType == 1 || userType == 2">
<nz-form-item>
<nz-form-label [nzSpan]="8">是否分配业务员</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -76,7 +98,7 @@
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="roleType == 1 || roleType == 2 || roleType == 3">
<div nz-col nzSpan="8" *ngIf="userType == 0 || userType == 1 || userType == 2 || userType == 3">
<nz-form-item>
<nz-form-label [nzSpan]="8">是否分配门店</nz-form-label>
<nz-form-control [nzSpan]="14">
@ -102,6 +124,7 @@
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" *ngIf="BTN_QRCODE_GENERATE" (click)="showGeneratePayQrCodeModal()"><i nz-icon nzType="qrcode" nzTheme="outline"></i>生成二维码</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="BTN_QRCODE_COMPANY" (click)="showAllocationCompanyModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配公司</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="BTN_QRCODE_AGENT" (click)="showAllocationAgentModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配代理商</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="BTN_QRCODE_SALESMAN" (click)="showAllocationSalesmanModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配业务员</button>
</div>
@ -120,6 +143,7 @@
<th nzWidth="50px" [(nzChecked)]="allChecked" [nzShowCheckbox]="true" (nzCheckedChange)="onAllChecked($event)"></th>
<th nzWidth="120px">序列号</th>
<th nzWidth="150px">二维码</th>
<th nzWidth="150px" *ngIf="userType == 0">公司</th>
<th nzWidth="150px">代理商</th>
<th nzWidth="150px">业务员</th>
<th nzWidth="180px">商户</th>
@ -142,6 +166,7 @@
<td>
<img style="width: 100px; height: 100px;" src="{{data.qrCodeUrl}}">
</td>
<td *ngIf="userType == 0">{{data.companyName?data.companyName:'未分配'}}</td>
<td>{{data.agentName?data.agentName:'未分配'}}</td>
<td>{{data.salesmanName?data.salesmanName:'未分配'}}</td>
<td>{{data.merName?data.merName:'未绑定'}}</td>
@ -187,6 +212,22 @@
</form>
</nz-modal>
<nz-modal [(nzVisible)]="allocationCompanyModal" nzTitle="分配公司" (nzOnCancel)="closeAllocationCompanyModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="allocationCompanyForm">
<nz-form-item>
<nz-form-label [nzSpan]="6">公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzShowSearch nzAllowClear formControlName="companyId">
<nz-option *ngFor="let data of companyDataArray" nzLabel="{{data.name}}" nzValue="{{data.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)="submitAllocationCompany()">确定</button>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="allocationAgentModal" nzTitle="分配代理商" (nzOnCancel)="closeAllocationAgentModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="allocationAgentForm">
<nz-form-item>

@ -7,6 +7,7 @@ import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {PayQrCodeService} from '../../../services/pay-qr-code.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {CompanyService} from '../../../services/company.service';
@Component({
selector: 'app-pay-qr-code-list',
@ -14,8 +15,8 @@ import {NzMessageService, NzModalService} from 'ng-zorro-antd';
styleUrls: ['./pay-qr-code-list.component.scss']
})
export class PayQrCodeListComponent implements OnInit {
// 角色类型 0:超级管理员 1:公司 2:代理商 3:业务员 4:商户 5:门店
roleType: number;
// 用户类型 0:超级管理员 1:公司 2:代理商 3:业务员 4:商户 5:门店
userType: number;
baseUrl = environment.baseUrl;
@ -36,6 +37,10 @@ export class PayQrCodeListComponent implements OnInit {
generatePayQrCodeModal = false;
generatePayQrCodeForm: FormGroup;
companyDataArray = [];
allocationCompanyModal = false;
allocationCompanyForm: FormGroup;
agentDataArray = [];
allocationAgentModal = false;
allocationAgentForm: FormGroup;
@ -45,6 +50,7 @@ export class PayQrCodeListComponent implements OnInit {
allocationSalesmanForm: FormGroup;
BTN_QRCODE_GENERATE = false;
BTN_QRCODE_COMPANY = false;
BTN_QRCODE_AGENT = false;
BTN_QRCODE_SALESMAN = false;
BTN_QRCODE_DISABLED = false;
@ -53,16 +59,18 @@ export class PayQrCodeListComponent implements OnInit {
constructor(private modal: NzModalService,
private message: NzMessageService,
private salesmanService: SalesmanService,
private companyService: CompanyService,
private agentService: AgentService,
private salesmanService: SalesmanService,
private payQrCodeService: PayQrCodeService,
private store: LocalStorageService,
private form: FormBuilder) {
this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType);
this.userType = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser']['objectType']);
}
ngOnInit(): void {
this.BTN_QRCODE_GENERATE = this.store.isBtnCompetence('BTN_QRCODE_GENERATE'); // 生成二维码 按钮权限
this.BTN_QRCODE_COMPANY = this.store.isBtnCompetence('BTN_QRCODE_COMPANY'); // 分配代理商 按钮权限
this.BTN_QRCODE_AGENT = this.store.isBtnCompetence('BTN_QRCODE_AGENT'); // 分配代理商 按钮权限
this.BTN_QRCODE_SALESMAN = this.store.isBtnCompetence('BTN_QRCODE_SALESMAN'); // 分配业务员 按钮权限
this.BTN_QRCODE_DISABLED = this.store.isBtnCompetence('BTN_QRCODE_DISABLED'); // 二维码禁用 按钮权限
@ -70,11 +78,13 @@ export class PayQrCodeListComponent implements OnInit {
this.BTN_QRCODE_STORE_UNBIND = this.store.isBtnCompetence('BTN_QRCODE_STORE_UNBIND'); // 二维码门店解绑 按钮权限
this.searchForm = this.form.group({
companyId: [null],
agentId: [null],
salesmanId: [null],
merName: [null],
storeName: [null],
serialNumber: [null],
isAssignCompany: [null],
isAssignAgent: [null],
isAssignSalesman: [null],
isAssignStore: [null],
@ -84,6 +94,10 @@ export class PayQrCodeListComponent implements OnInit {
generateNum: [50, [Validators.required]],
});
this.allocationCompanyForm = this.form.group({
companyId: [null, [Validators.required]],
});
this.allocationAgentForm = this.form.group({
agentId: [null, [Validators.required]],
});
@ -97,7 +111,13 @@ export class PayQrCodeListComponent implements OnInit {
salesmanId: [null, [Validators.required]],
});
if (this.roleType === 2) {
if (this.userType === 0) {
this.companyService.selectCompanyList({pageNum: 1, pageSize: 999 }, data => {
if (data['return_code'] === '000000') {
this.companyDataArray = data['return_data']['list'];
}
});
} else if (this.userType === 2) {
this.salesmanService.querySalesmanListByAgent({ status: 1, pageNum: 1, pageSize: 999 }, data => {
if (data['return_code'] === '000000') {
this.salesmanDataArray = data['return_data']['list'];
@ -121,7 +141,7 @@ export class PayQrCodeListComponent implements OnInit {
let checkoutNum = 0;
for (const dataObject of this.dataObject['list']) {
dataObject['disabled'] = ((this.roleType === 1 && dataObject.agentId != null) || (this.roleType === 2 && dataObject.salesmanId != null));
dataObject['disabled'] = ((this.userType === 1 && dataObject.agentId != null) || (this.userType === 2 && dataObject.salesmanId != null));
if (this.checkedData.find(o => Number(o['id']) === Number(dataObject['id'])) != null) {
checkoutNum++;
dataObject['checked'] = true;
@ -303,6 +323,62 @@ export class PayQrCodeListComponent implements OnInit {
});
}
/**
*
*/
showAllocationCompanyModal() {
this.allocationCompanyModal = true;
}
/**
*
*/
closeAllocationCompanyModal() {
this.allocationCompanyModal = false;
}
/**
*
*/
submitAllocationCompany() {
for (const i in this.allocationCompanyForm.controls) {
this.allocationCompanyForm.controls[i].markAsDirty();
this.allocationCompanyForm.controls[i].updateValueAndValidity();
}
if (this.allocationCompanyForm.status == null || this.allocationCompanyForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请选择公司',
});
return;
}
if (this.checkedData.length === 0) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请选择需要分配的二维码',
});
return;
}
this.allocationCompanyForm.value['qrCodeArray'] = this.checkedData;
this.payQrCodeService.assignCompany(this.allocationCompanyForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '分配成功',
});
this.checkedData = [];
this.requestData(this.whereObject['pageNum']);
this.closeAllocationCompanyModal();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
*/
@ -462,7 +538,7 @@ export class PayQrCodeListComponent implements OnInit {
*/
agentChange(agentId: number) {
if (agentId != null) {
this.salesmanService.getSalesmanList({ agentId, pageNum: 1, pageSize: 9999}, data => {
this.salesmanService.querySalesmanList({ agentId, pageNum: 1, pageSize: 9999}, data => {
this.salesmanDataArray = data['return_data']['list'];
});
} else {

@ -6,6 +6,26 @@
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8" *ngIf="userObjectType === 0">
<nz-form-item>
<nz-form-label [nzSpan]="8">分公司</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="companyId" (ngModelChange)="getAgentList($event)">
<nz-option *ngFor="let item of companyArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8" *ngIf="userObjectType === 0 || userObjectType === 1">
<nz-form-item>
<nz-form-label [nzSpan]="8">代理商</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="agentId">
<nz-option *ngFor="let item of agentArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">姓名</nz-form-label>
@ -62,6 +82,8 @@
<thead>
<tr>
<th nzWidth="100px">序号</th>
<th nzWidth="200px" *ngIf="userObjectType === 0">分公司</th>
<th nzWidth="200px" *ngIf="userObjectType === 0 || userObjectType === 1">代理商名称</th>
<th nzWidth="200px">姓名</th>
<th nzWidth="150px">联系电话</th>
<th nzWidth="100px">状态</th>
@ -72,6 +94,8 @@
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{i + 1}}</td>
<td *ngIf="userObjectType === 0">{{data.companyName}}</td>
<td *ngIf="userObjectType === 0 || userObjectType === 1">{{data.agentName}}</td>
<td>{{data.name}}</td>
<td>{{data.phone}}</td>
<td>{{data.status | salesmanStatus}}</td>

@ -2,6 +2,10 @@ import { Component, OnInit } from '@angular/core';
import {SalesmanService} from '../../../services/salesman.service';
import {FormBuilder, FormGroup} from '@angular/forms';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {LocalStorageService} from '../../../services/local-storage.service';
import {CompanyService} from '../../../services/company.service';
import {AgentService} from '../../../services/agent.service';
@Component({
selector: 'app-salesman-list',
@ -16,13 +20,29 @@ export class SalesmanListComponent implements OnInit {
pageNum: number;
whereObject: any = {};
userObjectType: number;
companyArray = [];
agentArray = [];
constructor(private modal: NzModalService,
private message: NzMessageService,
private salesmanService: SalesmanService,
private form: FormBuilder) { }
private agentService: AgentService,
private companyService: CompanyService,
private localStorageService: LocalStorageService,
private form: FormBuilder) {
this.userObjectType = Number(this.localStorageService.get(ADMIN_INFO_OBJECT)['secUser']['objectType']);
}
ngOnInit(): void {
if (this.userObjectType != null && this.userObjectType === 0) {
this.getCompanyList();
} else if (this.userObjectType != null && this.userObjectType === 1) {
this.getAgentList(this.localStorageService.get(ADMIN_INFO_OBJECT)['bsCompany']['id']);
}
this.searchForm = this.form.group({
companyId: [null],
agentId: [null],
name: [null],
phone: [null],
status: [null],
@ -30,6 +50,32 @@ export class SalesmanListComponent implements OnInit {
this.requestData(1);
}
/**
*
*/
getCompanyList() {
this.companyService.selectCompanyList({pageNum: 1, pageSize: 99 }, data => {
if (data['return_code'] === '000000') {
this.companyArray = data['return_data']['list'];
} else {
this.modal.error(data['return_msg']);
}
});
}
/**
*
*/
getAgentList(companyId: number) {
this.agentService.queryAgentList({ companyId: companyId, pageNum: 1, pageSize: 99 }, data => {
if (data['return_code'] === '000000') {
this.agentArray = data['return_data']['list'];
} else {
this.modal.error(data['return_msg']);
}
});
}
/**
*
*/
@ -37,7 +83,7 @@ export class SalesmanListComponent implements OnInit {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.salesmanService.querySalesmanListByAgent(this.whereObject, data => {
this.salesmanService.querySalesmanList(this.whereObject, data => {
if (data['return_code'] === '000000') {
this.dataObject = data['return_data'];
} else {

@ -0,0 +1,70 @@
<!-- start 面包屑 -->
<nz-breadcrumb>
<nz-breadcrumb-item>
优惠活动
</nz-breadcrumb-item>
<nz-breadcrumb-item>
配置活动
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<nz-content class="inner-content">
<form nz-form [formGroup]="dataForm" >
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>门店</nz-form-label>
<nz-form-control [nzSm]="6" [nzXs]="24">
<nz-select [formControlName]="'storeId'" [nzPlaceHolder]="'请选择门店'">
<nz-option *ngFor="let item of storeArray" nzValue="{{item.id}}" nzLabel="{{item.name}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>优惠活动名称</nz-form-label>
<nz-form-control [nzSm]="6" [nzXs]="24">
<input nz-input placeholder="请输入优惠券名称..." [formControlName]="'name'" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>优惠券类型</nz-form-label>
<nz-form-control [nzSm]="6" [nzXs]="24">
<nz-select [formControlName]="'discountType'" [nzPlaceHolder]="'请选择优惠券类型'">
<nz-option nzValue="1" nzLabel="满减"></nz-option>
<nz-option nzValue="2" nzLabel="立减"></nz-option>
<nz-option nzValue="3" nzLabel="折扣"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="dataForm.value.discountType === '1'">
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>满减条件金额</nz-form-label>
<nz-form-control [nzSm]="6" [nzXs]="24">
<input nz-input [type]="'number'" placeholder="请输入满减条件金额" [formControlName]="'discountCondition'" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" [nzFor]="'discountPrice'" nzRequired>{{dataForm.value.discountType === '3' ? '优惠折扣' : '优惠金额'}}</nz-form-label>
<nz-form-control [nzSm]="6" [nzXs]="24" nzErrorTip="{{dataForm.value.discountType === '3' ? '请输入优惠折扣' : '请输入优惠金额'}}">
<input nz-input [type]="'number'" placeholder="{{dataForm.value.discountType === '3' ? '请输入优惠折扣' : '请输入优惠金额'}}" [formControlName]="'discountPrice'"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>活动结束时间</nz-form-label>
<nz-form-control [nzSm]="6" [nzXs]="24">
<nz-date-picker nzFormat="yyyy-MM-dd " [nzPlaceHolder]="'请选择活动结束时间'" [formControlName]="'endTime'"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item nz-row class="register-area">
<nz-form-control [nzSpan]="14" [nzOffset]="6">
<button nz-button nzType="primary" (click)="submitFrom()">提交</button>
</nz-form-control>
</nz-form-item>
</form>
</nz-content>

@ -0,0 +1,6 @@
nz-date-picker {
width: 100%;
}
.register-are {
margin-bottom: 8px;
}

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { StoreDiscountActivityEditComponent } from './store-discount-activity-edit.component';
describe('StoreDiscountActivityEditComponent', () => {
let component: StoreDiscountActivityEditComponent;
let fixture: ComponentFixture<StoreDiscountActivityEditComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StoreDiscountActivityEditComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(StoreDiscountActivityEditComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,85 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzModalService} from 'ng-zorro-antd';
import {ActivatedRoute, Router} from '@angular/router';
import {ValidatorsService} from '../../../services/validators.service';
import {StoreDiscountActivityService} from '../../../services/store-discount-activity.service';
import {StoreService} from '../../../services/store.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
@Component({
selector: 'app-store-discount-activity-edit',
templateUrl: './store-discount-activity-edit.component.html',
styleUrls: ['./store-discount-activity-edit.component.scss']
})
export class StoreDiscountActivityEditComponent implements OnInit {
dataForm: FormGroup;
btnLoading = false;
storeArray = [];
constructor(private form: FormBuilder,
private modal: NzModalService,
private storeDiscountActivityService: StoreDiscountActivityService,
private storeService: StoreService,
private activatedRoute: ActivatedRoute,
private router: Router) { }
ngOnInit(): void {
this.dataForm = this.form.group({
id: [null],
storeId: [null, [Validators.required]],
name: [null, [Validators.required]],
discountType: [1, [Validators.required]],
discountCondition: [0, [Validators.required]],
discountPrice: [0, [Validators.required]],
endTime: [null, [Validators.required]],
});
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams['id'] != null) {
this.storeDiscountActivityService.getActivityDetail(queryParams['id'], data => {
data['return_data']['storeId'] = String(data['return_data']['storeId']);
data['return_data']['discountType'] = String(data['return_data']['discountType']);
this.dataForm.patchValue(data['return_data']);
});
}
});
this.storeService.getStoreList({pageNum: 1, pageSize: 99999}, data => {
this.storeArray = data['return_data']['list'];
});
}
submitFrom() {
this.btnLoading = true;
for (const i in this.dataForm.controls) {
this.dataForm.controls[i].markAsDirty();
this.dataForm.controls[i].updateValueAndValidity();
}
if (this.dataForm.status == null || this.dataForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请规范填写所有的必填项信息',
});
return;
}
this.storeDiscountActivityService.configActivity(this.dataForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '提交成功',
nzOnOk: () => this.router.navigateByUrl('admin/store-discount-activity/list')
});
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
this.btnLoading = false;
});
}
}

@ -0,0 +1,112 @@
<!-- 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="storeName" />
</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 [formControlName]="'status'" [nzPlaceHolder]="''">
<nz-option nzValue="1" nzLabel="编辑中"></nz-option>
<nz-option nzValue="2" nzLabel="进行中"></nz-option>
<nz-option nzValue="3" nzLabel="已结束"></nz-option>
</nz-select>
</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 *ngIf="BTN_STORE_DISCOUNT_ACTIVITY_ADD" nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/store-discount-activity/edit']"><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="70px">序号</th>
<th nzWidth="150px">参与门店</th>
<th nzWidth="150px">优惠名称</th>
<th nzWidth="100px">优惠类型</th>
<th nzWidth="130px">参与优惠条件</th>
<th nzWidth="100px">优惠金额</th>
<th nzWidth="150px">结束时间</th>
<th nzWidth="100px">优惠状态</th>
<th nzWidth="160px">创建时间</th>
<th nzWidth="150px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{i + 1}}</td>
<td>{{data.storeName}}</td>
<td>{{data.name}}</td>
<td>
<span *ngIf="data.discountType == 1">满减</span>
<span *ngIf="data.discountType == 2">立减</span>
<span *ngIf="data.discountType == 3">折扣</span>
</td>
<td>¥ {{data.discountCondition}}</td>
<td>¥ {{data.discountPrice}}</td>
<td>{{data.endTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>
<span *ngIf="data.status == 1">编辑中</span>
<span *ngIf="data.status == 2">进行中</span>
<span *ngIf="data.status == 3">已结束</span>
</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 *ngIf="data.status != 3 && BTN_STORE_DISCOUNT_ACTIVITY_UPDATE">
<a [routerLink]="['/admin/store-discount-activity/edit']" [queryParams]="{id: data.id}">修改</a>
</li>
<li nz-menu-item *ngIf="data.status == 1 && BTN_STORE_DISCOUNT_ACTIVITY_UPDATE"><a (click)="showUpOnlineConfirm(data.id)">上线</a></li>
<li nz-menu-item *ngIf="data.status == 2 && BTN_STORE_DISCOUNT_ACTIVITY_UPDATE"><a (click)="showLowerOnlineConfirm(data.id)">下线</a></li>
<li nz-menu-item *ngIf="data.status == 1 && BTN_STORE_DISCOUNT_ACTIVITY_DEL"><a (click)="showDelConfirm(data.id)">删除</a></li>
</ul>
</nz-dropdown-menu>
</td>
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { StoreDiscountActivityListComponent } from './store-discount-activity-list.component';
describe('StoreDiscountActivityListComponent', () => {
let component: StoreDiscountActivityListComponent;
let fixture: ComponentFixture<StoreDiscountActivityListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StoreDiscountActivityListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(StoreDiscountActivityListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,172 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {ActivatedRoute} from '@angular/router';
import {LocalStorageService} from '../../../services/local-storage.service';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {StoreDiscountActivityService} from '../../../services/store-discount-activity.service';
@Component({
selector: 'app-store-discount-activity-list',
templateUrl: './store-discount-activity-list.component.html',
styleUrls: ['./store-discount-activity-list.component.scss']
})
export class StoreDiscountActivityListComponent implements OnInit {
dataObject: any = {};
storeId: number;
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
BTN_STORE_DISCOUNT_ACTIVITY_ADD = false;
BTN_STORE_DISCOUNT_ACTIVITY_UPDATE = false;
BTN_STORE_DISCOUNT_ACTIVITY_DEL = false;
constructor(private activatedRoute: ActivatedRoute,
private store: LocalStorageService, // 数据请求
private modal: NzModalService,
private message: NzMessageService,
private storeDiscountActivityService: StoreDiscountActivityService,
private form: FormBuilder) { }
ngOnInit(): void {
this.BTN_STORE_DISCOUNT_ACTIVITY_ADD = this.store.isBtnCompetence('BTN_STORE_DISCOUNT_ACTIVITY_ADD'); // 增加按钮权限
this.BTN_STORE_DISCOUNT_ACTIVITY_UPDATE = this.store.isBtnCompetence('BTN_STORE_DISCOUNT_ACTIVITY_UPDATE'); // 修改按钮权限
this.BTN_STORE_DISCOUNT_ACTIVITY_DEL = this.store.isBtnCompetence('BTN_STORE_DISCOUNT_ACTIVITY_DEL'); // 删除按钮权限
this.searchForm = this.form.group({
name: [null],
status: [null],
});
this.requestData(1);
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['storeId'] = this.storeId;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.storeDiscountActivityService.getActivityList(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();
}
/**
* 线
*/
showUpOnlineConfirm(id: number): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否删除优惠活动?<br/>',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
nzOnOk: () => this.upOnline(id)
});
}
/**
* 线
*
*/
upOnline(id: number) {
this.storeDiscountActivityService.upOnline(id, data => {
if (data['return_code'] === '000000') {
this.requestData(this.whereObject['pageNum']);
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg']
});
}
});
}
/**
* 线
*/
showLowerOnlineConfirm(id: number): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否删除优惠活动?<br/>',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
nzOnOk: () => this.lowerOnline(id)
});
}
/**
* 线
*
*/
lowerOnline(id: number) {
this.storeDiscountActivityService.lowerOnline(id, data => {
if (data['return_code'] === '000000') {
this.requestData(this.whereObject['pageNum']);
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg']
});
}
});
}
/**
*
*/
showDelConfirm(id: number): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否删除优惠活动?<br/>',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
nzOnOk: () => this.delete(id)
});
}
/**
*
*
*/
delete(id: number) {
this.storeDiscountActivityService.delete(id, 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 {StoreDiscountActivityListComponent} from './store-discount-activity-list/store-discount-activity-list.component';
import {StoreDiscountActivityEditComponent} from './store-discount-activity-edit/store-discount-activity-edit.component';
const routes: Routes = [
{ path: 'list', component: StoreDiscountActivityListComponent },
{ path: 'edit', component: StoreDiscountActivityEditComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class StoreDiscountActivityRoutingModule { }

@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { StoreDiscountActivityRoutingModule } from './store-discount-activity-routing.module';
import { StoreDiscountActivityListComponent } from './store-discount-activity-list/store-discount-activity-list.component';
import { StoreDiscountActivityEditComponent } from './store-discount-activity-edit/store-discount-activity-edit.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: [StoreDiscountActivityListComponent, StoreDiscountActivityEditComponent],
imports: [
CommonModule,
StoreDiscountActivityRoutingModule,
NgZorroAntdModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule,
AppCommonModule,
]
})
export class StoreDiscountActivityModule { }

@ -56,13 +56,13 @@
<thead>
<tr>
<th nzWidth="70px">序号</th>
<th nzWidth="180px">门店号</th>
<th nzWidth="200px">门店名称</th>
<th nzWidth="120px">门店号</th>
<th nzWidth="180px">门店名称</th>
<th nzWidth="150px">联系电话</th>
<th nzWidth="200px">门店地址</th>
<th nzWidth="100px">状态</th>
<th nzWidth="160px">创建时间</th>
<th nzWidth="150px" nzRight="0px">操作</th>
<th nzWidth="100px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>

@ -36,8 +36,6 @@ export class StoreListComponent implements OnInit {
this.activatedRoute.queryParams.subscribe((queryParams: Params) => {
if (queryParams['merId'] != null && queryParams['merId'].length > 0) {
this.whereObject['merId'] = queryParams['merId'];
} else {
this.whereObject['merId'] = this.store.get(ADMIN_INFO_OBJECT)['mer']['id'];
}
this.requestData(1);
});
@ -50,7 +48,7 @@ export class StoreListComponent implements OnInit {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.storeService.getStoreListByMer(this.whereObject, data => {
this.storeService.getStoreList(this.whereObject, data => {
if (data['return_code'] === '000000') {
this.dataObject = data['return_data'];
} else {

@ -22,8 +22,10 @@ import {
CardTypePipe,
MerStatusPipe,
CompleteStatusPipe,
MerTypePipe, DeviceStatusPipe, PlatformTypePipe,
MerTypePipe, DeviceStatusPipe, PlatformTypePipe, DeviceTypePipe, DeviceOrderTypePipe,
} from './pipes';
import {DeviceOrderStatusPipe} from './pipes/device/device-order-status.pipe';
import {DeviceOrderPayTypePipe} from './pipes/device/device-order-pay-type.pipe';
const PIPES = [
TimesPipe,
@ -40,6 +42,10 @@ const PIPES = [
MerTypePipe,
CompleteStatusPipe,
DeviceStatusPipe,
DeviceTypePipe,
DeviceOrderTypePipe,
DeviceOrderStatusPipe,
DeviceOrderPayTypePipe,
PlatformTypePipe
];

@ -28,6 +28,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/pay-qr-code/pay-qr-code.module').then(m => m.PayQrCodeModule),
canActivate: [InitGuardService]
},
{
path: 'company',
loadChildren: () => import('./admin/company/company.module').then(m => m.CompanyModule),
canActivate: [InitGuardService]
},
{
path: 'agent',
loadChildren: () => import('./admin/agent/agent.module').then(m => m.AgentModule),
@ -53,6 +58,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/store-device/store-device.module').then(m => m.StoreDeviceModule),
canActivate: [InitGuardService]
},
{
path: 'store-discount-activity',
loadChildren: () => import('./admin/store-discount-activity/store-discount-activity.module').then(m => m.StoreDiscountActivityModule),
canActivate: [InitGuardService]
},
{
path: 'salesman',
loadChildren: () => import('./admin/salesman/salesman.module').then(m => m.SalesmanModule),

@ -0,0 +1,17 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'deviceOrderPayType'
})
export class DeviceOrderPayTypePipe implements PipeTransform {
transform(type: number): string {
switch (type) {
case 1:
return '微信';
default:
return '未知';
}
}
}

@ -0,0 +1,22 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'deviceOrderStatus'
})
export class DeviceOrderStatusPipe implements PipeTransform {
transform(status: number): string {
switch (status) {
case 1:
return '待支付';
case 2:
return '已支付';
case 3:
return '已完成';
case 4:
return '已退款';
default:
return '未知';
}
}
}

@ -0,0 +1,19 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'deviceOrderType'
})
export class DeviceOrderTypePipe implements PipeTransform {
transform(type: number): string {
switch (type) {
case 1:
return '押金';
case 2:
return '购买';
default:
return '未知';
}
}
}

@ -0,0 +1,17 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'deviceType'
})
export class DeviceTypePipe implements PipeTransform {
transform(statusNum: number): string {
switch (statusNum) {
case 1:
return '4G收款音响';
default:
return '未知';
}
}
}

@ -13,3 +13,8 @@ export * from './mer/mer-type.pipe';
export * from './mer/complete-status.pipe';
export * from './device/device-status.pipe';
export * from './platform-type.pipe';
export * from './device/device-type.pipe';
export * from './device/device-order-type.pipe';
export * from './device/device-order-status.pipe';
export * from './device/device-order-pay-type.pipe';

@ -97,6 +97,16 @@ export class CommonsService {
});
}
/**
*
* @param callBack
*/
public getProvinceList(callBack) {
this.http.get(environment.baseUrl + 'common/getProvinceList').subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack

@ -0,0 +1,60 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {environment} from '../../environments/environment';
import {CommonsService} from './commons.service';
@Injectable({
providedIn: 'root'
})
export class CompanyService {
constructor(
private http: HttpClient,
private commonsService: CommonsService,
) { }
/**
*
* @param paramObject
* @param callBack
*/
insertCompany(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'bsCompany/insert', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
updateCompany(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'bsCompany/update', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
selectCompanyList(paramObject: object, callBack) {
this.http.get(environment.baseUrl + 'bsCompany/selectCompanyList?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
companyView(companyId: number, callBack) {
this.http.get(environment.baseUrl + 'bsCompany/companyView?companyId=' + companyId).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,48 @@
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 DeviceOrderService {
constructor(
private http: HttpClient,
private commonsService: CommonsService
) { }
/**
*
* @param paramObject
* @param callBack
*/
assignOrder(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'deviceOrder/assignOrder?orderNo', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
getOrderDetail(orderNo: string, callBack) {
this.http.get(environment.baseUrl + 'deviceOrder/getOrderDetail?orderNo' + orderNo).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
getOrderList(paramObject: object, callBack) {
this.http.get(environment.baseUrl + 'deviceOrder/getOrderList?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => {
callBack(data);
});
}
}

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import {CommonsService} from './commons.service';
import {environment} from '../../environments/environment';
import {HttpClient} from "@angular/common/http";
import {HttpClient} from '@angular/common/http';
@Injectable({
providedIn: 'root'
@ -13,6 +13,28 @@ export class DeviceService {
private commonsService: CommonsService
) { }
/**
*
* @param paramObject
* @param callBack
*/
importDevice(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'device/importDevice', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
assignCompany(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'device/assignCompany', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
@ -67,4 +89,27 @@ export class DeviceService {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
enableDevice(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'device/enableDevice', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
disableDevice(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'device/disableDevice', paramObject).subscribe(data => {
callBack(data);
});
}
}

@ -24,6 +24,16 @@ export class PayQrCodeService {
});
}
/**
*
* @param paramObject
* @param callBack
*/
assignCompany(param: object, callBack) {
this.http.post(environment.baseUrl + 'payQrCode/assignCompany', param).subscribe(data => {
callBack(data);
});
}
/**
*

@ -84,8 +84,8 @@ export class SalesmanService {
* @param paramObject
* @param callBack
*/
getSalesmanList(paramObject: object, callBack) {
this.http.get(environment.baseUrl + 'salesman/getSalesmanList?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => {
querySalesmanList(paramObject: object, callBack) {
this.http.get(environment.baseUrl + 'salesman/querySalesmanList?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => {
callBack(data);
});
}

@ -0,0 +1,81 @@
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 StoreDiscountActivityService {
constructor(
private http: HttpClient,
private commonsService: CommonsService
) { }
/**
*
* @param paramObject
* @param callBack
*/
configActivity(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'storeDiscountActivity/configActivity', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
getActivityDetail(activityId: number, callBack) {
this.http.get(environment.baseUrl + 'storeDiscountActivity/getActivityDetail?activityId=' + activityId).subscribe(data => {
callBack(data);
});
}
/**
* 线
* @param paramObject
* @param callBack
*/
upOnline(activityId: number, callBack) {
this.http.get(environment.baseUrl + 'storeDiscountActivity/upOnline?activityId=' + activityId).subscribe(data => {
callBack(data);
});
}
/**
* 线
* @param paramObject
* @param callBack
*/
lowerOnline(activityId: number, callBack) {
this.http.get(environment.baseUrl + 'storeDiscountActivity/lowerOnline?activityId=' + activityId).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
delete(activityId: number, callBack) {
this.http.get(environment.baseUrl + 'storeDiscountActivity/delete?activityId=' + activityId).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
getActivityList(paramObject: object, callBack) {
this.http.get(environment.baseUrl + 'storeDiscountActivity/getActivityList?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => {
callBack(data);
});
}
}

@ -13,6 +13,17 @@ export class StoreService {
private commonsService: CommonsService
) { }
/**
*
* @param paramObject
* @param callBack
*/
getStoreList(paramObject: object, callBack) {
this.http.get(environment.baseUrl + 'store/getStoreList?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => {
callBack(data);
});
}
/**
* id
* @param paramObject

@ -4,6 +4,7 @@
export const environment = {
production: false,
// baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://gratia-pay.dctpay.com/filesystem/',
obsUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com',

Loading…
Cancel
Save