diff --git a/src/app/admin/audit/audit-coupon/audit-coupon.component.html b/src/app/admin/audit/audit-coupon/audit-coupon.component.html index 0026dc2..0803fc3 100644 --- a/src/app/admin/audit/audit-coupon/audit-coupon.component.html +++ b/src/app/admin/audit/audit-coupon/audit-coupon.component.html @@ -15,18 +15,19 @@ -
- - 审核类型 - - - - - - - - -
+ + + + + + + + + + + + +
审核流水号 diff --git a/src/app/admin/coupon/blx-coupon/blx-coupon.component.html b/src/app/admin/coupon/blx-coupon/blx-coupon.component.html new file mode 100644 index 0000000..0a4a3e8 --- /dev/null +++ b/src/app/admin/coupon/blx-coupon/blx-coupon.component.html @@ -0,0 +1,66 @@ + + + + + + +
+ 共计 {{total}} 条数据 + + + + + + 编号 + 优惠券编码 + 优惠券名称 + 面额 + + 优惠券状态 + + + + + + {{i+1}} + {{data.couponCode}} + {{data.couponName}} + {{data.denomination}} + + + {{data.couponStatus | blxCouponStatus}} + + + + + + +
\ No newline at end of file diff --git a/src/app/admin/coupon/blx-coupon/blx-coupon.component.scss b/src/app/admin/coupon/blx-coupon/blx-coupon.component.scss new file mode 100644 index 0000000..4be59fa --- /dev/null +++ b/src/app/admin/coupon/blx-coupon/blx-coupon.component.scss @@ -0,0 +1,6 @@ +img { + width: 60px; + } + .fontColor { + color: red; + } \ No newline at end of file diff --git a/src/app/admin/coupon/blx-coupon/blx-coupon.component.ts b/src/app/admin/coupon/blx-coupon/blx-coupon.component.ts new file mode 100644 index 0000000..88ebb7b --- /dev/null +++ b/src/app/admin/coupon/blx-coupon/blx-coupon.component.ts @@ -0,0 +1,61 @@ +import { Component, OnInit } from '@angular/core'; + +import { CouponService } from '../../../services/coupon.service'; +import {CommonsService} from '../../../services/commons.service'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import {NzMessageService} from 'ng-zorro-antd'; +@Component({ + selector: 'app-blx-coupon', + templateUrl: './blx-coupon.component.html', + styleUrls: ['./blx-coupon.component.scss'] +}) +export class BlxCouponComponent implements OnInit { + searchForm: FormGroup; // 搜索框 + requestData = []; // 列表数据 + total: number = 0; // 总计条数 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = false; + + constructor( + private form: FormBuilder, + private coupon: CouponService, + private message: NzMessageService, + ) { } + + ngOnInit() { + this.searchForm = this.form.group({ + // merchantId: [null], + // couponName: [null], + // couponType: [null], + // goodsTypeId: [null], + // brandId: [null], + // displayArea: [null], + // status: [null], + }); + this.getRequest(true,this.searchForm.value) + } + + + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { + + this.loading = true; + if (reset) { + this.pageNum = 1; + } + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + this.coupon.getBlxCouponList(whereObject, data => { + this.loading = false; + if (data['return_code'] === '000000') { + this.requestData = data['return_data'].list; + this.total = data['return_data'].total; + } else { + this.message.error(data['return_msg']); + } + }); + +} + +} diff --git a/src/app/admin/coupon/coupon-edit/coupon-edit.component.html b/src/app/admin/coupon/coupon-edit/coupon-edit.component.html index 113f489..275bf48 100644 --- a/src/app/admin/coupon/coupon-edit/coupon-edit.component.html +++ b/src/app/admin/coupon/coupon-edit/coupon-edit.component.html @@ -59,6 +59,7 @@ +
diff --git a/src/app/admin/coupon/coupon-routing.module.ts b/src/app/admin/coupon/coupon-routing.module.ts index dd1794c..ccd9149 100644 --- a/src/app/admin/coupon/coupon-routing.module.ts +++ b/src/app/admin/coupon/coupon-routing.module.ts @@ -4,6 +4,7 @@ import {CouponListComponent} from './coupon-list/coupon-list.component'; import {CouponEditComponent} from './coupon-edit/coupon-edit.component'; import {CouponDetailComponent} from './coupon-detail/coupon-detail.component'; import {SalesCodeListComponent} from './sales-code-list/sales-code-list.component'; +import { BlxCouponComponent } from './blx-coupon/blx-coupon.component'; const routes: Routes = [ @@ -11,6 +12,7 @@ const routes: Routes = [ { path: 'coupon-edit', component: CouponEditComponent }, { path: 'coupon-detail', component: CouponDetailComponent }, { path: 'salesCode-list', component: SalesCodeListComponent }, + {path:'blx-coupon',component:BlxCouponComponent} ]; @NgModule({ diff --git a/src/app/admin/coupon/coupon.module.ts b/src/app/admin/coupon/coupon.module.ts index 86ac4e0..a583866 100644 --- a/src/app/admin/coupon/coupon.module.ts +++ b/src/app/admin/coupon/coupon.module.ts @@ -12,9 +12,11 @@ import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {RichtextModule} from '../../common/richtext/richtext.module'; import {AppCommonModule} from '../../app-common.module'; import { SalesCodeListComponent } from './sales-code-list/sales-code-list.component'; +import { BlxCouponComponent } from './blx-coupon/blx-coupon.component'; @NgModule({ - declarations: [CouponListComponent, CouponEditComponent, CouponDetailComponent, SalesCodeListComponent], + declarations: [CouponListComponent, CouponEditComponent, CouponDetailComponent, SalesCodeListComponent, + BlxCouponComponent], imports: [ CommonModule, CouponRoutingModule, diff --git a/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts b/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts index c22ed83..14f2e5a 100644 --- a/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts +++ b/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {environment} from '../../../../environments/environment'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {CompanyService} from '../../../services/company.service'; @@ -11,386 +11,386 @@ import {DiscountPackageService} from '../../../services/discount-package.service import {ValidatorsService} from '../../../services/validators.service'; @Component({ - selector: 'app-discount-package-list', - templateUrl: './discount-package-list.component.html', - styleUrls: ['./discount-package-list.component.scss'] + selector: 'app-discount-package-list', + templateUrl: './discount-package-list.component.html', + styleUrls: ['./discount-package-list.component.scss'] }) export class DiscountPackageListComponent implements OnInit { - BASE_URL = environment.baseUrl; - WEB_SERVE_URL = environment.imageUrl; - searchForm: FormGroup; // 搜索框 - requestData = []; // 列表数据 - usingAttribution = []; // 列表数据 - total: number; // 页码 - pageNum = 1; // 页码 - pageSize = 10; // 条码 - loading = true; - listOfData = []; - isVisible = false; - isVisibleInventory = false; - id: number; - num: number; - - deliverUserAddForm: FormGroup; - deliverUserAddModal = false; - userInterval; - - deliverUserSearchForm: FormGroup; - deliverUserModal = false; - deliverUserArray = []; - deliverUserForm: FormGroup; - serialNumber: string; - - excelUserModal = false; - excelUploadBtn = true; - excelUploadFile = []; - - spinObject = { - title: '处理中', - status: false - }; - - constructor( - private form: FormBuilder, - private company: CompanyService, - private activate: ActivateService, - private iconService: IconService, - private message: NzMessageService, - private modal: NzModalService, - private router: Router, - private discountPackage: DiscountPackageService, - private commonsService: CommonsService, - ) { - } - - ngOnInit(): void { - this.init(); - } - - public init(): void { - this.searchForm = this.form.group({ - title: [null], - salesType: [null], - usingAttribution: [null], - recordNo: [null], - status: [null], - phone: [null], - }); - - this.deliverUserSearchForm = this.form.group({ - phone: [null], - registerStatus: [null], - errorStatus: [null], - }); - - this.deliverUserForm = this.form.group({ - packageId: [null], - packageName: [''], - phoneArray: [null], - }); - - this.deliverUserAddForm = this.form.group({ - phone: [null, [Validators.required, ValidatorsService.mobile]], - }); - - this.getRequest(true, this.searchForm.value); - this.commonsService.getDictionary('USING_ATTRIBUTION ', data => { - this.usingAttribution = data['return_data']; - }); - } - - // 查询列表 - public getRequest(reset: boolean = false, whereObject: object) { - - this.loading = false; - if (reset) { - this.pageNum = 1; + BASE_URL = environment.baseUrl; + WEB_SERVE_URL = environment.imageUrl; + searchForm: FormGroup; // 搜索框 + requestData = []; // 列表数据 + usingAttribution = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + listOfData = []; + isVisible = false; + isVisibleInventory = false; + id: number; + num: number; + + deliverUserAddForm: FormGroup; + deliverUserAddModal = false; + userInterval; + + deliverUserSearchForm: FormGroup; + deliverUserModal = false; + deliverUserArray = []; + deliverUserForm: FormGroup; + serialNumber: string; + + excelUserModal = false; + excelUploadBtn = true; + excelUploadFile = []; + + spinObject = { + title: '处理中', + status: false + }; + + constructor( + private form: FormBuilder, + private company: CompanyService, + private activate: ActivateService, + private iconService: IconService, + private message: NzMessageService, + private modal: NzModalService, + private router: Router, + private discountPackage: DiscountPackageService, + private commonsService: CommonsService, + ) { } - whereObject['pageNum'] = this.pageNum; - whereObject['pageSize'] = this.pageSize; - this.discountPackage.getDiscountPackageList(whereObject, data => { - if (data['return_code'] === '000000') { - this.requestData = data['return_data'].list; - this.total = data['return_data'].total; - } else { - this.message.error(data['return_msg']); - } - }); - } - - // 重置 - public resetForm(): void { - this.searchForm.reset(); - } - - // 活动开始 - public upDiscountPackage(id: number): void { - this.discountPackage.upDiscountPackage({discountPackageId : id}, data => { - if (data['return_code'] === '000000') { - this.message.success('上架成功'); - this.getRequest(true, this.searchForm.value); - } else { - this.message.error(data['return_msg']); - } - }); - } - - // 活动结束 - public downDiscountPackage(id: number): void { - this.discountPackage.downDiscountPackage({discountPackageId : id}, data => { - if (data['return_code'] === '000000') { - this.message.success('下架成功'); + + ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + title: [null], + salesType: [null], + usingAttribution: [null], + recordNo: [null], + status: [null], + phone: [null], + }); + + this.deliverUserSearchForm = this.form.group({ + phone: [null], + registerStatus: [null], + errorStatus: [null], + }); + + this.deliverUserForm = this.form.group({ + packageId: [null], + packageName: [''], + phoneArray: [null], + }); + + this.deliverUserAddForm = this.form.group({ + phone: [null, [Validators.required, ValidatorsService.mobile]], + }); + this.getRequest(true, this.searchForm.value); - } else { - this.message.error(data['return_msg']); - } - }); - } - - // 删除 - public deleteDiscountPackage(id: number): void { - this.commonsService.showConfirm('是否确认删除', isDelete => { - if (isDelete) { - this.discountPackage.deleteDiscountPackage({discountPackageId : id}, data => { - if (data['return_code'] === '000000') { - this.message.success('删除成功'); - this.getRequest(true, this.searchForm.value); - } else { - this.message.error(data['return_msg']); - } + this.commonsService.getDictionary('USING_ATTRIBUTION ', data => { + this.usingAttribution = data['return_data']; }); - } - }); - } - - - // 修改 - public getEdit(id: number): void { - this.router.navigate(['/admin/discount-package/discount-package-edit'], { - queryParams: { - id - } - }).then(r => console.log(r)); - } - - handleCancel(): void { - this.isVisible = false; - } - - public getDetails(id: number): void { - this.discountPackage.getDiscountPackageRuleById(id , data => { - if (data['return_code'] === '000000') { - this.listOfData = data['return_data']; - this.isVisible = true; - } else { - this.message.create('error', data['return_msg']); - } - }); - } - - // 增加库存 - public addInventory(id: number): void { - this.id = id; - this.isVisibleInventory = true; - } - - - handleCancelInventory(): void { - this.isVisibleInventory = false; - } - - handleOkdInventory(): void { - - if (this.num == null || this.num === 0) { - this.message.error('请输入新增库存数量'); - return; } + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { - const param = { - num: this.num, - discountPackageId: this.id - }; - const id = this.message.loading('增加库存中..', { nzDuration: 0 }).messageId; - this.discountPackage.addDiscountPackageStock(param , data => { - if (data['return_code'] === '000000') { + this.loading = false; + if (reset) { + this.pageNum = 1; + } + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + this.discountPackage.getDiscountPackageList(whereObject, data => { + if (data['return_code'] === '000000') { + this.requestData = data['return_data'].list; + this.total = data['return_data'].total; + } else { + this.message.error(data['return_msg']); + } + }); + } + + // 重置 + public resetForm(): void { + this.searchForm.reset(); + } + + // 活动开始 + public upDiscountPackage(id: number): void { + this.discountPackage.upDiscountPackage({discountPackageId: id}, data => { + if (data['return_code'] === '000000') { + this.message.success('上架成功'); + this.getRequest(true, this.searchForm.value); + } else { + this.message.error(data['return_msg']); + } + }); + } + + // 活动结束 + public downDiscountPackage(id: number): void { + this.discountPackage.downDiscountPackage({discountPackageId: id}, data => { + if (data['return_code'] === '000000') { + this.message.success('下架成功'); + this.getRequest(true, this.searchForm.value); + } else { + this.message.error(data['return_msg']); + } + }); + } + + // 删除 + public deleteDiscountPackage(id: number): void { + this.commonsService.showConfirm('是否确认删除', isDelete => { + if (isDelete) { + this.discountPackage.deleteDiscountPackage({discountPackageId: id}, data => { + if (data['return_code'] === '000000') { + this.message.success('删除成功'); + this.getRequest(true, this.searchForm.value); + } else { + this.message.error(data['return_msg']); + } + }); + } + }); + } + + + // 修改 + public getEdit(id: number): void { + this.router.navigate(['/admin/discount-package/discount-package-edit'], { + queryParams: { + id + } + }).then(r => console.log(r)); + } + + handleCancel(): void { + this.isVisible = false; + } + + public getDetails(id: number): void { + this.discountPackage.getDiscountPackageRuleById(id, data => { + if (data['return_code'] === '000000') { + this.listOfData = data['return_data']; + this.isVisible = true; + } else { + this.message.create('error', data['return_msg']); + } + }); + } + + // 增加库存 + public addInventory(id: number): void { + this.id = id; + this.isVisibleInventory = true; + } + + + handleCancelInventory(): void { this.isVisibleInventory = false; - this.getRequest(true, this.searchForm.value); - this.message.success('新增成功'); - } else { - this.message.create('error', data['return_msg']); - } - this.message.remove(id); - }); - } - - // 打开 发送优惠券包给用户模态框 - showDeliverUserModal(packageId: number, packageName: string) { - this.discountPackage.getHandleByPackageId({ packageId: packageId}, data => { - if (data['return_code'] === '000000') { - if (data['return_data'] != null) { - this.modal.confirm({ - nzTitle: '提示', - nzContent: '当前卷包有赠送任务进行中,是否查看赠送进度?', - nzOnOk: () => this.processRate(data['return_data']['serialNumber']) - }) - } else { - this.deliverUserForm.patchValue({ packageId: packageId, packageName: packageName}); - this.deliverUserModal = true; + } + + handleOkdInventory(): void { + + if (this.num == null || this.num === 0) { + this.message.error('请输入新增库存数量'); + return; } - } - }); - } - - // 关闭 发送优惠券包给用户模态框 - closeDeliverUserModal() { - this.deliverUserForm.reset(); - this.deliverUserModal = false; - } - - // 删除赠送用户 - delDeliverUser(serialNum: number) { - this.deliverUserArray = this.deliverUserArray.filter(o => o.serialNum != serialNum); - } - - // 展示导入模态框 - showExcelUserModal() { - this.excelUserModal = true; - } - - // 关闭导入模态框 - closeExcelUserModal() { - this.spinObject.status = false; - this.excelUploadBtn = true; - this.excelUploadFile = []; - this.excelUserModal = false; - } - - // 提交赠送数据 - submitDeliverUser() { - if (this.deliverUserArray.length == 0) { - this.modal.warning({ nzTitle: '提示', nzContent: '没有需要赠送的用户'}); + + + const param = { + num: this.num, + discountPackageId: this.id + }; + const id = this.message.loading('增加库存中..', {nzDuration: 0}).messageId; + this.discountPackage.addDiscountPackageStock(param, data => { + if (data['return_code'] === '000000') { + this.isVisibleInventory = false; + this.getRequest(true, this.searchForm.value); + this.message.success('新增成功'); + } else { + this.message.create('error', data['return_msg']); + } + this.message.remove(id); + }); } - this.deliverUserForm.patchValue({ phoneArray: this.deliverUserArray.filter(o => o.errorStatus == false)}); - this.spinObject.status = true; - this.spinObject.title = '处理中...'; - const param = this.deliverUserForm.value; - this.closeDeliverUserModal(); - - this.discountPackage.giveAway(param, data => { - if (data['return_code'] === '000000') { - this.serialNumber = data['return_data']; - this.processRate(this.serialNumber); - } else { - this.showDeliverUserModal(this.deliverUserForm.controls.packageId.value, this.deliverUserForm.controls.packageName.value); - this.message.create('error', data['return_msg']); - this.spinObject.status = false; - } - }); - } - - // 处理进度 - processRate(serialNum: string) { - this.spinObject.status = true; - this.userInterval = setInterval(() => this.commonsService.getRedisValueByType(serialNum, data => { - if (data['return_data'] != null) { - this.spinObject.title = '已处理' + data['return_data'] + '条数据'; - } else { + + // 打开 发送优惠券包给用户模态框 + showDeliverUserModal(packageId: number, packageName: string) { + this.discountPackage.getHandleByPackageId({packageId: packageId}, data => { + if (data['return_code'] === '000000') { + if (data['return_data'] != null) { + this.modal.confirm({ + nzTitle: '提示', + nzContent: '当前卷包有赠送任务进行中,是否查看赠送进度?', + nzOnOk: () => this.processRate(data['return_data']['serialNumber']) + }); + } else { + this.deliverUserForm.patchValue({packageId: packageId, packageName: packageName}); + this.deliverUserModal = true; + } + } + }); + } + + // 关闭 发送优惠券包给用户模态框 + closeDeliverUserModal() { + this.deliverUserForm.reset(); + this.deliverUserModal = false; + } + + // 删除赠送用户 + delDeliverUser(serialNum: number) { + this.deliverUserArray = this.deliverUserArray.filter(o => o.serialNum != serialNum); + } + + // 展示导入模态框 + showExcelUserModal() { + this.excelUserModal = true; + } + + // 关闭导入模态框 + closeExcelUserModal() { this.spinObject.status = false; - this.getRequest(true, this.searchForm.value); - clearTimeout(this.userInterval); - } - }), 1000); - } - - // 提交excel数据 - submitExcelUser() { - this.spinObject.title = '文件导入中... 数据太多会占用较长时间'; - this.spinObject.status = true; - this.discountPackage.getPhoneListByFileUrl({ fileUrl: this.excelUploadFile[0]['url']}, data => { - if (data['return_code'] === '000000') { - this.deliverUserArray = data['return_data']['data']; - this.closeExcelUserModal(); - } else { - this.spinObject.status = false; - this.message.error(data['return_msg']); + this.excelUploadBtn = true; + this.excelUploadFile = []; + this.excelUserModal = false; + } + + // 提交赠送数据 + submitDeliverUser() { + if (this.deliverUserArray.length == 0) { + this.modal.warning({nzTitle: '提示', nzContent: '没有需要赠送的用户'}); } - }); - } + this.deliverUserForm.patchValue({phoneArray: this.deliverUserArray.filter(o => o.errorStatus == false)}); + this.spinObject.status = true; + this.spinObject.title = '处理中...'; + const param = this.deliverUserForm.value; + this.closeDeliverUserModal(); + + this.discountPackage.giveAway(param, data => { + if (data['return_code'] === '000000') { + this.serialNumber = data['return_data']; + this.processRate(this.serialNumber); + } else { + this.showDeliverUserModal(this.deliverUserForm.controls.packageId.value, this.deliverUserForm.controls.packageName.value); + this.message.create('error', data['return_msg']); + this.spinObject.status = false; + } + }); + } - // 上传excel回调 - excelUserHandleChange(info: NzUploadChangeParam): void { - if (info.file.status !== 'uploading') { - this.excelUploadFile = []; + // 处理进度 + processRate(serialNum: string) { + this.spinObject.status = true; + this.userInterval = setInterval(() => this.commonsService.getRedisValueByType(serialNum, data => { + if (data['return_data'] != null) { + this.spinObject.title = '已处理' + data['return_data'] + '条数据'; + } else { + this.spinObject.status = false; + this.getRequest(true, this.searchForm.value); + clearTimeout(this.userInterval); + } + }), 1000); } - if (info.file.status === 'done') { - this.excelUploadBtn = false; - this.excelUploadFile.push( - { - uid: '1', - name: info.file.name, - status: 'done', - url: info.file['response']['return_data'][0], - thumbUrl: this.WEB_SERVE_URL + info.file['response']['return_data'][0], - } - ) - } else if (info.file.status === 'error') { - this.message.error('文件上传失败'); + + // 提交excel数据 + submitExcelUser() { + this.spinObject.title = '文件导入中... 数据太多会占用较长时间'; + this.spinObject.status = true; + this.discountPackage.getPhoneListByFileUrl({fileUrl: this.excelUploadFile[0]['url']}, data => { + if (data['return_code'] === '000000') { + this.deliverUserArray = data['return_data']['data']; + this.closeExcelUserModal(); + } else { + this.spinObject.status = false; + this.message.error(data['return_msg']); + } + }); } - } - - // 打开 发送优惠券包给用户模态框 - showDeliverUserAddModal() { - this.deliverUserAddModal = true; - } - - // 关闭 发送优惠券包给用户模态框 - closeDeliverUserAddModal() { - this.deliverUserAddForm.reset(); - this.deliverUserAddModal = false; - } - - submitDeliverUserAdd() { - for (const i in this.deliverUserAddForm.controls) { - this.deliverUserAddForm.controls[i].markAsDirty(); - this.deliverUserAddForm.controls[i].updateValueAndValidity(); + + // 上传excel回调 + excelUserHandleChange(info: NzUploadChangeParam): void { + if (info.file.status !== 'uploading') { + this.excelUploadFile = []; + } + if (info.file.status === 'done') { + this.excelUploadBtn = false; + this.excelUploadFile.push( + { + uid: '1', + name: info.file.name, + status: 'done', + url: info.file['response']['return_data'][0], + thumbUrl: this.WEB_SERVE_URL + info.file['response']['return_data'][0], + } + ) + } else if (info.file.status === 'error') { + this.message.error('文件上传失败'); + } } - if (this.deliverUserAddForm.status == null || this.deliverUserAddForm.status !== 'VALID') { - this.modal.warning({ - nzTitle: '提示', - nzContent: '请规范填写所有的必填项信息', - }); - return; + + // 打开 发送优惠券包给用户模态框 + showDeliverUserAddModal() { + this.deliverUserAddModal = true; } - let phoneObject = this.deliverUserArray.find(o => o.phone == this.deliverUserAddForm.controls.phone.value); - if (phoneObject != null) { - this.modal.warning({ - nzTitle: '提示', - nzContent: '手机号在列表中已存在', - }); - return; + // 关闭 发送优惠券包给用户模态框 + closeDeliverUserAddModal() { + this.deliverUserAddForm.reset(); + this.deliverUserAddModal = false; } - this.discountPackage.getPhoneRegisterStatus(this.deliverUserAddForm.value, data => { - if (data['return_code'] === '000000') { - this.deliverUserArray.push({ - serialNum: this.deliverUserArray.length + 1, - phone: this.deliverUserAddForm.controls.phone.value, - registerStatus: data['return_data'], - errorStatus: false, - errorMsg: null + submitDeliverUserAdd() { + for (const i in this.deliverUserAddForm.controls) { + this.deliverUserAddForm.controls[i].markAsDirty(); + this.deliverUserAddForm.controls[i].updateValueAndValidity(); + } + if (this.deliverUserAddForm.status == null || this.deliverUserAddForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请规范填写所有的必填项信息', + }); + return; + } + + let phoneObject = this.deliverUserArray.find(o => o.phone == this.deliverUserAddForm.controls.phone.value); + if (phoneObject != null) { + this.modal.warning({ + nzTitle: '提示', + nzContent: '手机号在列表中已存在', + }); + return; + } + + this.discountPackage.getPhoneRegisterStatus(this.deliverUserAddForm.value, data => { + if (data['return_code'] === '000000') { + this.deliverUserArray.push({ + serialNum: this.deliverUserArray.length + 1, + phone: this.deliverUserAddForm.controls.phone.value, + registerStatus: data['return_data'], + errorStatus: false, + errorMsg: null + }); + this.deliverUserArray = this.deliverUserArray.slice(); + this.closeDeliverUserAddModal(); + } }); - this.deliverUserArray = this.deliverUserArray.slice(); - this.closeDeliverUserAddModal(); - } - }); - } - - // 下载模板 - downloadTemp() { - window.location.href = this.WEB_SERVE_URL + 'template/导入模板.xlsx'; - } + } + + // 下载模板 + downloadTemp() { + window.location.href = this.WEB_SERVE_URL + 'template/导入模板.xlsx'; + } } diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html index a18c7f9..cfb6ddc 100644 --- a/src/app/admin/index/index/index.component.html +++ b/src/app/admin/index/index/index.component.html @@ -105,29 +105,29 @@
- -

汇联通预充值账号

-

余额:{{(balance - balanceData['payRealPrice']).toFixed(2)}}

+ +

汇联通工会卡充值

+

余额:{{(balance - balanceData['sum']).toFixed(2)}}

订单数量:{{balanceData['count']}}

-

支付总额:{{balanceData['payRealPrice'] == null ? '0': balanceData['payRealPrice']}}

-
-
-
- -

中石化订单

-

订单数量:{{orderData['count']}}

-

订单总额:{{orderData['orderPrice'] == null ? '0': orderData['orderPrice']}}

-

支付总额:{{orderData['payRealPrice'] == null ? '0': orderData['payRealPrice']}}

-
-
-
- -

话费订单

-

订单数量:{{rechargeData['count']}}

-

订单总额:{{rechargeData['orderPrice'] == null ? '0': rechargeData['orderPrice']}}

-

支付总额:{{rechargeData['payRealPrice'] == null ? '0': rechargeData['payRealPrice']}}

+

支付总额:{{balanceData['sum'] == null ? '0': balanceData['sum']}}

+ + + + + + + + + + + + + + + +
diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts index 600ff19..a267169 100644 --- a/src/app/admin/index/index/index.component.ts +++ b/src/app/admin/index/index/index.component.ts @@ -78,10 +78,10 @@ export class IndexComponent implements OnInit { if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany'] != null && this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id === 3) { this.code = 60; this.getHLTBalance(); - this.orderByIndex(); + // this.orderByIndex(); this.HLTOrderByIndex(); this.rechargeOrderByIndex(); - this.HLTOrderByList(); + // this.HLTOrderByList(); } if (this.store.get(ADMIN_INFO_OBJECT)['merchantStore'] != null) { @@ -135,7 +135,8 @@ export class IndexComponent implements OnInit { } public HLTOrderByIndex(): void { - this.index.HLTOrderByIndex(this.code, data => { + this.index.hltCardNoTopUpStatistic( data => { + console.log(data); if (data['return_code'] === '000000') { this.balanceData = data['return_data']; this.loading = false; @@ -156,15 +157,15 @@ export class IndexComponent implements OnInit { }); } - public HLTOrderByList(): void { - this.index.HLTOrderByList(this.code, data => { - if (data['return_code'] === '000000') { - this.listOfData = data['return_data']; - } else { - this.message.error(data['return_msg']); - } - }); - } + // public HLTOrderByList(): void { + // this.index.HLTOrderByList(this.code, data => { + // if (data['return_code'] === '000000') { + // this.listOfData = data['return_data']; + // } else { + // this.message.error(data['return_msg']); + // } + // }); + // } public getIndexCount(): void { this.index.getIndexCount(data => { diff --git a/src/app/admin/login/login/login.component.html b/src/app/admin/login/login/login.component.html index 95b7cd0..e88983d 100644 --- a/src/app/admin/login/login/login.component.html +++ b/src/app/admin/login/login/login.component.html @@ -9,30 +9,6 @@
嗨森逛后台登录
- -

用户名

@@ -60,11 +36,6 @@
- -
diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html index e021050..dc64b7b 100644 --- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html +++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html @@ -16,16 +16,14 @@ -
- 标题 + 下单手机号 - +
-
标题 @@ -34,10 +32,6 @@
- - - -
异常订单 @@ -49,6 +43,10 @@
+
+ +
+
交易状态 diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts index 5eb2c00..8b54853 100644 --- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts +++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts @@ -7,6 +7,7 @@ import {CommonsService} from '../../../services/commons.service'; import {OrderMobileRechargeService} from '../../../services/order/order-mobile-recharge.service'; import {FormBuilder, FormGroup} from '@angular/forms'; import {NzMessageService, NzNotificationService} from 'ng-zorro-antd'; + import {animate, state, style, transition, trigger} from '@angular/animations'; @Component({ @@ -174,10 +175,7 @@ export class MobileRechargeOrderListComponent implements OnInit { this.isVisible = true; this.orderMobileRechargeService.exportMobilePartyOrderList(whereObject, data => { - if (data['return_code'] === '000000') { - // this.message.success('导出成功!'); - // window.location.href = this.FILE_URL + 'temporary/' + data['return_data']; - } else { + if (data['return_code'] !== '000000') { this.isVisible = false; this.message.error(data['return_msg']); } diff --git a/src/app/admin/user/user-list/user-list.component.html b/src/app/admin/user/user-list/user-list.component.html index 5a1fb5b..6e424e5 100644 --- a/src/app/admin/user/user-list/user-list.component.html +++ b/src/app/admin/user/user-list/user-list.component.html @@ -33,6 +33,17 @@
+
+ + 是否推广员 + + + + + + + +
注册时间 @@ -59,6 +70,7 @@ class="table" #ajaxTable nzShowSizeChanger + nzBordered [nzFrontPagination]="false" [nzData]="requestData" [nzLoading]="loading" @@ -94,11 +106,53 @@ {{data.status === 1 ? '禁用': '启用'}} - {{data.isAgent === true ? '禁用推广员': '启用推广员'}} + + + 更多操作 + + +
+ +
+ +
+ + + + + 交易单号 + 客户电话 + 订单名称 + 订单金额 + 支付金额 + 创建时间 + + + + + {{data.orderNo}} + {{data.memPhone}} + {{data.title}} + ¥{{data.totalPrice}} + ¥{{data.payPrice}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + + + +
+ + + + diff --git a/src/app/admin/user/user-list/user-list.component.ts b/src/app/admin/user/user-list/user-list.component.ts index 455c689..72941b3 100644 --- a/src/app/admin/user/user-list/user-list.component.ts +++ b/src/app/admin/user/user-list/user-list.component.ts @@ -5,6 +5,7 @@ import {NzMessageService} from 'ng-zorro-antd'; import {IconService} from '../../../services/icon.service'; import {CommonsService} from '../../../services/commons.service'; import {environment} from '../../../../environments/environment'; +import {OrderService} from '../../../services/order.service'; @Component({ selector: 'app-user-list', @@ -20,11 +21,26 @@ export class UserListComponent implements OnInit { pageSize = 10; // 条码 loading = true; regTime; + orderListModal = false; + isVisible = false; + orderListModalLoading = false; + requestOrderData = []; + percent = 0; + processRateInterval; + FILE_URL = environment.imageUrl; + + userId; + loadingObject = { + title: '加载中...', + status: false, + }; + serialNumber; constructor( private form: FormBuilder, private user: UserService, private iconService: IconService, + private orderService: OrderService, private message: NzMessageService, private common: CommonsService ) { @@ -38,6 +54,7 @@ export class UserListComponent implements OnInit { this.searchForm = this.form.group({ name: [null], status: [null], + isAgent: [null], phone: [null], regTime: [null], }); @@ -104,4 +121,59 @@ export class UserListComponent implements OnInit { }); } + public getList(userId: string): void { + this.orderListModalLoading = true; + this.orderListModal = true; + this.userId = userId; + this.orderService.getPopularizeUserOrderList(userId , data => { + this.orderListModalLoading = false; + if (data['return_code'] === '000000') { + this.requestOrderData = data['return_data']; + } else { + this.message.error(data['return_msg']); + } + }); + } + + public excelOrder() { + const whereObject = {}; + this.percent = 0; + this.serialNumber = new Date().getTime(); + whereObject['serialNumber'] = this.serialNumber; + whereObject['promoteCode'] = this.userId; + this.isVisible = true; + this.processRate(this.serialNumber); + this.orderService.exportPopularizeUserOrderList(whereObject, data => { + if (data['return_code'] !== '000000') { + this.isVisible = false; + this.message.error(data['return_msg']); + } + this.loadingObject.status = false; + }); + } + + + // 获取导出百分比 + processRate(key: string) { + this.processRateInterval = setInterval(() => this.common.getRedisValueByType(key, data => { + this.percent = data['return_data']; + if (this.percent === 100) { + clearTimeout(this.processRateInterval); + this.loadingObject.status = true; + this.loadingObject.title = '下载中...'; + const interval = setInterval(() => this.common.getRedisValueByType(key + 'download', download => { + if (download['return_data'] != null) { + this.message.success('下载成功!'); + this.loadingObject.status = false; + window.location.href = this.FILE_URL + 'temporary/' + download['return_data']; + this.isVisible = false; + clearTimeout(interval); + } + }), 100); + } + }), 300); + + + } + } diff --git a/src/app/admin/user/user.module.ts b/src/app/admin/user/user.module.ts index 596f480..e4452e2 100644 --- a/src/app/admin/user/user.module.ts +++ b/src/app/admin/user/user.module.ts @@ -8,6 +8,7 @@ import {SeparateModule} from '../../common/separate/separate.module'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import { UserGoldComponent } from './user-gold/user-gold.component'; +import {AppCommonModule} from "../../app-common.module"; @NgModule({ @@ -19,7 +20,8 @@ import { UserGoldComponent } from './user-gold/user-gold.component'; SeparateModule, ReactiveFormsModule, FormsModule, - BreadcrumbModule + BreadcrumbModule, + AppCommonModule ] }) export class UserModule { } diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 9a536ce..4e16f70 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -73,6 +73,9 @@ import { PayCouponStatusPipe, OrderOilChannelTypePipe, VerifyProductTypePipe, + BlxCouponStatusPipe, + ReceiveTypePipe, + } from './pipes'; import {MsgTypePipe} from './pipes/msg/msg-type.pipe'; import { OrderProductTypePipe } from './pipes/order/order-product-type.pipe'; @@ -149,6 +152,8 @@ const PIPES = [ MsgTypePipe, OrderOilChannelTypePipe, VerifyProductTypePipe, + BlxCouponStatusPipe, + ReceiveTypePipe, LogisticsStatusPipe, OrderProductTypePipe, GoodsStatusPipe diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 83c1945..aaa238d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -17,6 +17,7 @@ import {NavigationModule} from './admin/navigation/navigation.module'; import {AppCommonModule} from './app-common.module'; import {NgxEchartsModule} from 'ngx-echarts'; import {HashLocationStrategy, LocationStrategy} from '@angular/common'; +import {RouterModule} from '@angular/router'; registerLocaleData(zh); diff --git a/src/app/pipes/coupon-status.pipe.ts b/src/app/pipes/coupon-status.pipe.ts index c428fca..e580422 100644 --- a/src/app/pipes/coupon-status.pipe.ts +++ b/src/app/pipes/coupon-status.pipe.ts @@ -22,3 +22,40 @@ export class CouponStatusPipe implements PipeTransform { } } } + + + +@Pipe({ + name: 'blxCouponStatus' +}) +export class BlxCouponStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 0: + return '待审核'; + case 1: + return '审核通过'; + case 2: + return '强制结束'; + } + } +} + + +@Pipe({ + name: 'receiveType' +}) +export class ReceiveTypePipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '天数'; + case 2: + return '时间段'; + case null: + return '暂无数据'; + } + } +} diff --git a/src/app/pipes/index/product-config.pipe.ts b/src/app/pipes/index/product-config.pipe.ts index 51d4f7a..cdef8f9 100644 --- a/src/app/pipes/index/product-config.pipe.ts +++ b/src/app/pipes/index/product-config.pipe.ts @@ -13,8 +13,10 @@ export class ProductConfigPipe implements PipeTransform { return '肯德基接口'; case 'MEMBER_RECHARGE_CONFIG': return '会员充值接口'; - case 'PHONE_CONFIG': + case 'CALLS_CONFIG': return '话费接口'; + case 'REFUEL_ONLINE_CONFIG': + return '在线加油接口'; case 'STARBUCKS_CONFIG': return '星巴克接口'; } diff --git a/src/app/services/coupon.service.ts b/src/app/services/coupon.service.ts index 5d5c177..bd2212b 100644 --- a/src/app/services/coupon.service.ts +++ b/src/app/services/coupon.service.ts @@ -168,6 +168,17 @@ export class CouponService { }); } + /* + 获取停车券列表 + */ + public getBlxCouponList(params: object, callBack) { + this.http.get(environment.baseUrl + 'apiCoupon/getBlxCouponList?'+ this.common.getWhereCondition(params)).subscribe(data => { + + callBack(data); + }); + } + + /** * 卡券销售面值 diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts index b95dd7b..139b5a4 100644 --- a/src/app/services/index.service.ts +++ b/src/app/services/index.service.ts @@ -243,4 +243,10 @@ export class IndexService { }); } + public hltCardNoTopUpStatistic(callBack) { + this.http.get(environment.orderUrl + 'orderStatistic/hltCardNoTopUpStatistic').subscribe(data => { + callBack(data); + }); + } + } diff --git a/src/app/services/login.service.ts b/src/app/services/login.service.ts index 8f77bf7..1e5d917 100644 --- a/src/app/services/login.service.ts +++ b/src/app/services/login.service.ts @@ -20,9 +20,11 @@ export class LoginService { * @return data 返回结果 */ public userLogin(params: object, callBack) { - this.http.post(environment.baseUrl + 'login/userLogin', params).subscribe(data => { - callBack(data); - }); + this.http.post(environment.baseUrl + 'login/userLogin', params).subscribe(data => { + callBack(data); + }, error => { + console.log(error); + }); } /** diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts index 2449a9d..3ea3e41 100644 --- a/src/app/services/order.service.ts +++ b/src/app/services/order.service.ts @@ -301,6 +301,33 @@ export class OrderService { }); } + /** + * @Author Sum1Dream + * @methodName getPopularizeUserOrderList + * @Description // 查询推广订单 + * @Date 14:23 2023/7/12 + * @Param promoteCode 推广码 + */ + public getPopularizeUserOrderList(promoteCode: string , callBack) { + this.http.get(environment.orderUrl + 'getPopularizeUserOrderList?promoteCode=' + promoteCode ).subscribe( data => { + callBack(data); + }); + } + + + /** + * @Author Sum1Dream + * @methodName exportMobilePartyOrderList + * @Description // 导出话费订单表格 + * @Date 10:07 2022/11/1 + * @Param param: object, callBack + */ + public exportPopularizeUserOrderList(param: object, callBack) { + this.http.get(environment.orderUrl + 'exportPopularizeUserOrderList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + public getGasOrderDetail(orderNo: string , callBack) { this.http.get(environment.baseUrl + 'highGas/getGasOrderDetail?orderNo=' + orderNo).subscribe( data => { callBack(data); diff --git a/src/environments/environment.ts b/src/environments/environment.ts index af9ff24..aad3c86 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,11 +4,12 @@ export const environment = { production: false, -// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) - // orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址) - // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) + baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) + orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址) + // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // baseUrl: 'https://hsg.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址) + // orderUrl: 'https://hsg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) + // orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) imageUrl: 'https://hsgcs.dctpay.com/filesystem/', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',