From def81dabc3df5013fde4a6f68e44f8ae8d7d368a Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 28 Oct 2022 10:10:02 +0800 Subject: [PATCH 1/6] 1 --- .../cms-content/cms-content.component.html | 347 ++++----- .../cms-content/cms-content.component.less | 27 + .../cms/cms-content/cms-content.component.ts | 671 ++++++++++++++---- .../third-product.component.html | 2 +- src/app/app-common.module.ts | 2 - src/app/pipes/index.ts | 1 - 6 files changed, 728 insertions(+), 322 deletions(-) diff --git a/src/app/admin/cms/cms-content/cms-content.component.html b/src/app/admin/cms/cms-content/cms-content.component.html index 3cecfd1..21aed05 100644 --- a/src/app/admin/cms/cms-content/cms-content.component.html +++ b/src/app/admin/cms/cms-content/cms-content.component.html @@ -1,213 +1,228 @@ - - 内容管理 - - - 内容发布 - + + 内容管理 + + + 内容发布 + - -
-
-
-
- - 内容分类 - - - - - -
-
- - 内容标题 - - - - -
-
- - 内容状态 - - - - - - - - -
-
- - 展示平台 - - - - - - - - - -
- -
- -
-
- - -
-
-
+
+ +
+ + + + + + + + + + + + +
+
+ +
共搜索到 {{total}} 条数据
+ + + +
-
- 共计 {{total}} 条数据 -
- -
+ - + (nzPageIndexChange)="getRequest()" + (nzPageSizeChange)="getRequest(true)" + [nzScroll]="{ x: '1150px'}"> + 序号 - 分类名称 - 内容标题 - 展示平台 - 状态 + 分类名称 + 内容标题 + 简要描述 + 访问总量 + 是否推荐 + 状态 创建时间 - 操作 + 操作 - - {{i+1}} - {{data.tag}} + + {{i+ 1}} + {{data.categoryName}} {{data.title}} - {{data.platform | showType}} + {{data.description}} + {{data.visitCount}} - {{data.status == 1 ? '编辑中': '已发布'}} + + - {{data.createTime | date:'yyyy-MM-dd hh:mm:ss' }} - - 更多操作 - - - + + 编辑中 + 已发布 + + {{data.createTime | date:'yyyy-MM-dd' }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 附件名称 + 附件类型 + 附件描述 + 排序 + 添加时间 + 操作 + + + + + {{ data.patchName }} + 图片 + 音频 + 视频 + 文档 + 其他 + {{data.patchDesc}} + {{data.sort}} + {{data.addTime | date:'yyyy-MM-dd'}} + + +
- - - - + + +
+ + + + 发布模板 + + + + + + + + +
diff --git a/src/app/admin/cms/cms-content/cms-content.component.less b/src/app/admin/cms/cms-content/cms-content.component.less index e69de29..3562ef1 100644 --- a/src/app/admin/cms/cms-content/cms-content.component.less +++ b/src/app/admin/cms/cms-content/cms-content.component.less @@ -0,0 +1,27 @@ +.width_input { + width: 200px; +} +.width_input_chlid { + width: 200px; + margin-left: 10px; +} +[nz-form] { + max-width: 600px; +} +button { + margin-left: 8px; +} +:host ::ng-deep .upload-list-inline .ant-upload-list-item { + float: left; + width: 200px; + margin-right: 8px; +} +.search-result-list { + margin-top: 16px; + border: 1px dashed #e9e9e9; + border-radius: 6px; + background-color: #fafafa; + min-height: 200px; + text-align: center; + padding-top: 80px; +} diff --git a/src/app/admin/cms/cms-content/cms-content.component.ts b/src/app/admin/cms/cms-content/cms-content.component.ts index 32edbf1..6ef0cc3 100644 --- a/src/app/admin/cms/cms-content/cms-content.component.ts +++ b/src/app/admin/cms/cms-content/cms-content.component.ts @@ -1,22 +1,12 @@ import {Component, OnInit} from '@angular/core'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; -import {HttpClient} from '@angular/common/http'; -import {NzMessageService, NzModalService, NzUploadFile} from 'ng-zorro-antd'; +import {HttpClient, HttpEvent, HttpEventType, HttpRequest, HttpResponse} from '@angular/common/http'; +import {NzMessageService, NzModalService, UploadXHRArgs} from 'ng-zorro-antd'; import {Router} from '@angular/router'; import {LocalStorageService} from '../../../services/local-storage.service'; import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; import {environment} from '../../../../environments/environment'; -import {CmsService} from '../../../services/cms.service'; -import {CommonsService} from '../../../services/commons.service'; - -function getBase64(file: File): Promise { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = () => resolve(reader.result); - reader.onerror = error => reject(error); - }); -} + @Component({ selector: 'app-cms-content', @@ -24,93 +14,247 @@ function getBase64(file: File): Promise { styleUrls: ['./cms-content.component.less'] }) export class CmsContentComponent implements OnInit { - - - WEB_SERVE_URL = environment.imageUrl; - POST_URL = environment.baseUrl; - searchForm: FormGroup; // 搜索框 - validateForm: FormGroup; // 添加框 - requestData = []; // 列表数据 - nodes = []; // 类型树 - total: number; // 页码 - pageNum = 1; // 页码 - pageSize = 10; // 条码 +// 搜索按钮等待特效 + isLoadingSearch = false; + // 搜索内容标题 + searchTitle = ''; + // 状态搜索 + searchStatus = ''; + // 分类搜索 + searchCategoryId = ''; + // 公司id + searchCompanyId = ''; + // 查询数组 + requestData = []; + // 查询数组等待特效 loading = true; - editFlag = false; + // 请求页码 + pageIndex = 1; + // 请求条数 + pageSize = 10; + // 查询总条数 + total = 0; + /** 分类树数据 **/ + nodes = []; + WEB_SERVE_URL; + // 选中的内容id + contentSelect = ''; + // 是否显示附件列表 + showPatch = 0; + // 根据内容查询附件列表 + patchList = []; + + // 添加附件相关 + // 提交等待 + isOkLoading = false; + // 附件类型 + patchTypeCheck = '0'; + // 附件返回地址 + patchPath = ''; + // 允许上传的文件类型 + annexForm: FormGroup; + /** 定义附件表单 **/ isVisible = false; - imgFile = []; - previewImage: string | undefined = ''; - previewVisible = false; - id: number; + /** 是否弹出添加 **/ + fileList = []; + // 上传的后缀名 + suffix = ''; + // 允许上传的文件类型 + imageSuffix = [ + 'jpg', + 'jpeg', + 'png', + 'jif', + 'dwg', + 'dxf', + 'jp2', + 'jpe', + 'svf', + 'tif', + 'tiff', + ]; + audioSuffix = [ + '3gpp', + 'ac3', + 'mp2', + 'mp3', + 'asf', + 'cda', + 'wav', + 'wma', + 'mid', + 'ra', + 'rma', + 'mod', + ]; + videoSuffix = [ + '3gpp', + 'mp2', + 'mp4', + 'mpeg', + 'mpg', + 'avi', + 'rmvb', + 'flv', + '3pg', + 'rm', + 'mov', + 'wmv', + 'mkv', + 'f4v', + 'm4v', + ]; + applicationSuffix = [ + 'asf', + 'doc', + 'dot', + 'dtd', + 'htm', + 'html', + 'css', + 'csv', + 'js', + 'json', + 'mpp', + 'ogg', + 'pdf', + 'pot', + 'pps', + 'ppt', + 'rtf', + 'txt', + 'wdb', + 'wps', + 'xhtml', + 'xlc', + 'xlm', + 'xls', + 'xlt', + 'xlw', + 'xml', + 'zip', + 'docx', + 'xlsx', + 'pptx', + 'sql' + ]; + + isPublish = false; + isPushOkLoading = false; + moduleId = ''; + pushId = ''; + pushForm: FormGroup; + // 可选择的模板列表 + selectModule = []; + /** 按钮数据权限 **/ + BTN_cmscontent_add = 0; + BTN_cmscontent_edit = 0; + BTN_cmscontent_delete = 0; + BTN_cmscontent_patch = 0; + BTN_cmscontent_up_down = 0; + constructor( private fb: FormBuilder, private http: HttpClient, // http请求 private message: NzMessageService, // 信息提示 private router: Router, - private common: CommonsService, - private cms: CmsService, + private modalService: NzModalService, // 对话框 + private store: LocalStorageService, // 请求缓存 ) { this.WEB_SERVE_URL = environment.baseUrl; + this.searchCompanyId = this.store.get(ADMIN_INFO_OBJECT)['secUser']['companyId']; } ngOnInit() { - - this.searchForm = this.fb.group({ - title: [null], - categoryId: [null], - platform: [null], - status: [null], + /** 循环查询 按钮权限 **/ + for (let i = 0; i < this.store.get(ADMIN_INFO_OBJECT)['buttonList'].length; i++) { + if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_add') { + this.BTN_cmscontent_add = 1; + } + if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_edit') { + this.BTN_cmscontent_edit = 1; + } + if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_delete') { + this.BTN_cmscontent_delete = 1; + } + if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_patch') { + this.BTN_cmscontent_patch = 1; + } + if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_up_down') { + this.BTN_cmscontent_up_down = 1; + } + } + this.annexForm = this.fb.group({ + patchName: [null, [Validators.required]], + patchDesc: [null], + patchType: [null, [Validators.required]], + sort: [null, [Validators.required]], }); - - this.validateForm = this.fb.group({ - categoryId: [null, [Validators.required]], - title: [null, [Validators.required]], - platform: [null], - platformArray: [null], - sortId: [null, [Validators.required]], - description: [null, [Validators.required]], - jumpType: [null], - jumpUrl: [null], - + this.pushForm = this.fb.group({ + moduleId: [null] }); - const roleType = 1; + // 获取登录人 角色类型,查询分类树 + console.log(this.store.get(ADMIN_INFO_OBJECT)); + let roleType = 1; + /* if (0 == this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['companyType']) { + roleType = 1; + } else if (1 == this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['companyType']) { + if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['isService'] == true) { + roleType = 3; + } else { + roleType = 2; + } + } else if (2 == this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['companyType']) { + roleType = 3; + }*/ this.findCategoryTree(roleType); - this.getRequest(true, this.searchForm.value); - + this.getRequest(); } + // 重置搜索 + resetSearch() { + // 搜索内容标题 + this.searchTitle = ''; + // 状态搜索 + this.searchStatus = ''; + // 分类搜索 + this.searchCategoryId = ''; + } - // 查询列表 - public getRequest(reset: boolean = false, whereObject: object) { - - + // 请求列表 + getRequest(reset: boolean = false) { + this.showPatch = 0; + this.loading = false; if (reset) { - this.pageNum = 1; + this.pageIndex = 1; + } + if (this.searchStatus == null) { + this.searchStatus = ''; + } + if (this.searchCategoryId == null) { + this.searchCategoryId = ''; } - whereObject['pageNum'] = this.pageNum; - whereObject['pageSize'] = this.pageSize; - this.cms.getListContent(whereObject, data => { + this.http.get(this.WEB_SERVE_URL + '/cmsContent/getListContent?pageNum=' + this.pageIndex + '&pageSize=' + this.pageSize + '&title=' + this.searchTitle + '&category=' + this.searchCategoryId + '&status=' + this.searchStatus + '&companyId=' + this.searchCompanyId).subscribe(data => { console.log(data); - this.loading = false; if (data['return_code'] === '000000') { this.requestData = data['return_data'].list; this.total = data['return_data'].total; + this.isLoadingSearch = false; } else { - this.message.error(data['return_msg']); + this.message.create('error', data['return_msg']); } }); } - // 重置 - public resetForm(): void { - this.searchForm.reset(); + // 搜索 + getSearch() { + this.getRequest(); } - // 查询分类树 findCategoryTree(roleType) { - this.cms.getOwnCategoryTree(roleType , data => { + this.http.get(this.WEB_SERVE_URL + '/cmsCategory/getOwnCategoryTree?roleType=' + roleType).subscribe(data => { if (data['return_code'] === '000000') { this.nodes = data['return_data']; if (this.nodes.length !== 0) { @@ -129,6 +273,7 @@ export class CmsContentComponent implements OnInit { for (const i in data) { if (data[i].nodes == null) { const item = { + /** 重新赋值 **/ isLeaf: true, title: data[i].text, key: data[i].id, @@ -137,6 +282,7 @@ export class CmsContentComponent implements OnInit { data[i] = item; } else { const item = { + /** 重新赋值 **/ isLeaf: false, title: data[i].text, key: data[i].id, @@ -147,119 +293,340 @@ export class CmsContentComponent implements OnInit { } } this.nodes = data; + console.log(this.nodes); } - // 新增 + // 跳转添加 getAdd() { - this.isVisible = true; - this.editFlag = false; + this.router.navigate(['/admin/cms/cmscontentadd'], { + queryParams: { + editFlag: 0 + } + }); + } + + // 跳转修改 + getEdit(id) { + this.router.navigate(['/admin/cms/cmscontentedit'], { + queryParams: { + id: id + } + }); + } + + // 跳转详情 + getContentView(id) { + this.router.navigate(['/admin/cms/cmscontentview'], { + queryParams: { + id: id + } + }); } - // 编辑 - getEdit(data: object) { - console.log(data); - if (data['imgData'] != null && data['imgData'] !== '') { - const logo = String(data['imgData']); - const logoArray = []; - logoArray.push( - { - uid: 1, - name: logo, - status: 'done', - url: environment.imageUrl + logo - }); - this.imgFile = logoArray; + // 对话框删除 + showDeleteConfirmDelete(id): void { + this.modalService.confirm({ + nzTitle: '是否确定删除', + nzOkText: '是', + nzOnOk: () => this.deleteContent(id), + nzCancelText: '否', + }); + } + + // 删除内容 + deleteContent(id) { + if (id === undefined) { + return; } - this.id = data['id']; - this.validateForm.patchValue(data); - this.editFlag = true; - this.isVisible = true; + if (id === null) { + return; + } + if (id === '') { + return; + } + this.http.get(this.WEB_SERVE_URL + '/cmsContent/delContent?id=' + id).subscribe(data => { + if (data['return_code'] === '000000') { + this.message.create('success', `删除成功!`); + this.getRequest(); + } else { + this.message.create('warning', data['return_msg']); + } + }); } - // 提交内容 - handleOk() { - // tslint:disable-next-line:forin - for (const i in this.validateForm.controls) { - this.validateForm.controls[i].markAsDirty(); - this.validateForm.controls[i].updateValueAndValidity(); - if (this.validateForm.controls[i].errors != null) { - this.message.error('必填项不能为空'); - return; + // 查询附件列表 + findPatchByContent(id) { + this.contentSelect = id; + this.http.get(this.WEB_SERVE_URL + '/cmsContent/getListPatches?pageNum=1&pageSize=100&contentId=' + id).subscribe(data => { + if (data['return_code'] === '000000') { + this.showPatch = 1; + this.patchList = data['return_data'].list; + console.log(this.patchList); + } else { + this.message.create('warning', data['return_msg']); } + }); + } + + // 弹出添加附件 + addPatch() { + this.isVisible = true; + } + + // 删除附件确认 + showDeletePatch(id) { + this.modalService.confirm({ + nzTitle: '是否确定删除', + nzOkText: '是', + nzOnOk: () => this.deletePatch(id), + nzCancelText: '否', + }); + } + + // 删除附件 + deletePatch(id) { + if (id === undefined || id === null || id === '') { + return; } - if (this.imgFile.length !== 0) { - if (this.imgFile[0]['response'] != null) { - this.validateForm.value.imgData = this.imgFile[0]['response']['return_data'][0]; + this.http.get(this.WEB_SERVE_URL + '/cmsPatch/delPatch?id=' + id).subscribe(data => { + if (data['return_code'] === '000000') { + this.message.create('success', `删除成功!`); + this.findPatchByContent(this.contentSelect); } else { - this.validateForm.value.imgData = this.imgFile[0].name; + this.message.create('warning', data['return_msg']); } + }); + } + + // 取消按钮 + handleCancel(): void { + this.isVisible = false; + this.patchPath = ''; + this.fileList = []; + /** 隐藏弹框 **/ + } + + // 附件类型选择 + getChange(event) { + if (event != null) { + this.patchTypeCheck = event; + console.log(event); } - if (this.editFlag) { - this.validateForm.value.id = this.id; - this.cms.updateCmsContent(this.validateForm.value , data => { - if (data['return_code'] === '000000') { - this.isVisible = false; - this.getRequest(false, this.searchForm.value); - this.message.success('修改成功'); - } else { - this.message.create('error', '修改失败'); - } - }); - } else { - this.cms.insertCmsContent(this.validateForm.value , data => { - if (data['return_code'] === '000000') { - this.isVisible = false; - this.getRequest(false, this.searchForm.value); - this.message.success('新增成功'); - } else { - this.message.create('error', '修改失败'); + } + + // 附件上传设置 + customReq = (item: UploadXHRArgs) => { + this.patchPath = ''; // 置空路径 + const formData = new FormData(); + formData.append('requestFile', item.file as any); + formData.append('uploadType', 'cmsPatch'); + console.log(item); + const req = new HttpRequest('POST', item.action!, formData, { + reportProgress: true, + }); + console.log(req); + return this.http.request(req).subscribe( + (event: HttpEvent) => { + console.log(event); + if (event.type === HttpEventType.UploadProgress) { + if (event.total! > 0) { + (event as any).percent = (event.loaded / event.total!) * 100; + } + item.onProgress!(event, item.file!); + } else if (event instanceof HttpResponse) { + item.onSuccess!(event.body, item.file!, event); + if (event.body.return_code === '000000') { + this.patchPath = event.body.return_data[item.file.name]; + this.suffix = this.patchPath.split('.')[this.patchPath.split('.').length - 1]; + } } - }); - } + }, + err => { + item.onError!(err, item.file!); + } + ); } - // 图片查看 - handlePreview = async (file: NzUploadFile) => { - if (!file.url && !file.preview) { - // tslint:disable-next-line:no-non-null-assertion - file.preview = await getBase64(file.originFileObj!); + /** 清空 **/ + emptyForm(e: MouseEvent): void { + e.preventDefault(); + this.annexForm.reset(); + for (const key in this.annexForm.controls) { + this.annexForm.controls[key].markAsPristine(); + this.annexForm.controls[key].updateValueAndValidity(); } - this.previewImage = file.url || file.preview; - this.previewVisible = true; } - showDeleteConfirmDelete(id: number): void { - this.common.showConfirm('是否确定删除!' , dataR => { - if (dataR) { - this.cms.deleteById(id, data => { - if (data['return_code'] === '000000') { - this.getRequest(true, this.searchForm.value); - this.message.success(data['return_data']); - } else { - this.message.error(data['return_msg']); - } - }); + // 附件弹窗确定添加按钮 + handlePatchOk(value: any): void { + // 校验类型选择与必填 + if (value.patchName == null || value.patchName == '') { + this.message.create('error', `请填写附件名称!`); + return; + } + if (value.sort == null || value.sort == '') { + this.message.create('error', `请填写附件排序,越小越靠前!`); + return; + } + if (value.patchType == '1') { + if (this.imageSuffix.indexOf(this.suffix) == -1) { + this.message.create('error', `请上传图片类型的附件!`); + return; + } + } else if (value.patchType == '2') { + if (this.audioSuffix.indexOf(this.suffix) == -1) { + this.message.create('error', `请上传音频类型的附件!`); + return; + } + } else if (value.patchType == '3') { + if (this.videoSuffix.indexOf(this.suffix) == -1) { + this.message.create('error', `请上传视频类型的附件!`); + return; + } + } else if (value.patchType == '4') { + if (this.applicationSuffix.indexOf(this.suffix) == -1) { + this.message.create('error', `请上传文档类型的附件!`); + return; + } + } else if (value.patchType == '5') { + } else { + this.message.create('error', `请选择附件类型!`); + return; + } + if (this.patchPath == null || this.patchPath == '') { + this.message.create('error', `请上传附件!`); + return; + } + // 定义附件数据 + const params = { + 'contentId': this.contentSelect, + 'patchName': value.patchName, + 'patchDesc': value.patchDesc, + 'patchType': value.patchType, + 'patchPath': this.patchPath, + 'source': 1, + 'sort': value.sort, + 'suffixName': this.suffix, + 'addTime': new Date() + }; + /** 确定等待 **/ + this.http.post(this.WEB_SERVE_URL + '/cmsPatch/addPatch', params).subscribe(data => { + if (data['return_code'] === '000000') { + this.isVisible = false; + this.isOkLoading = false; + this.fileList = []; + this.patchTypeCheck = '0'; + this.findPatchByContent(this.contentSelect); + this.message.create('success', `新增成功!`); + } else { + this.message.create('warning', data['return_msg']); } + }, error => { + this.message.create('error', `未知错误!`); }); } + // 弹出发布附件 + addPush(id, categoryId) { + this.findModuleByCategory(categoryId); + this.pushId = id; + // document.getElementById('resetPush').click(); + this.isPublish = true; + } + // 取消发布 + handleCancelPush(): void { + this.isPublish = false; + this.moduleId = ''; + this.pushId = ''; + /** 隐藏弹框 **/ + } - public getForbiddenUser(id, status: any): void { - const message = (status === 2 ? '是否下架当前内容' : '是否上架当前内容'); - const s = status === 2 ? 1 : 2; - this.common.showConfirm(message, data => { - if (data) { - this.cms.updateContentStatus(id, s , dataUser => { - if (dataUser['return_code'] === '000000') { - this.message.success(dataUser['return_data']); - } else { - this.message.error(dataUser['return_msg']); - } - this.getRequest(false , this.searchForm.value); - }); + // 附件弹窗确定添加按钮 + handlePushOk(value: any): void { + console.log('发布'); + console.log(this.pushId); + console.log(this.moduleId); + console.log(value.moduleId); + if (this.pushId == null || this.pushId == '') { + this.message.create('error', '请重新选择发布的内容!'); + return; + } + if (this.moduleId == null || this.moduleId == undefined) { + this.moduleId = ''; + } + + // 定义附件数据 + const params = { + 'id': this.pushId, + 'status': 2, + 'moduleId': this.moduleId + }; + /** 确定等待 **/ + this.http.post(this.WEB_SERVE_URL + '/cmsContent/updateStatusOfContent', params).subscribe(data => { + if (data['return_code'] === '000000') { + this.isPublish = false; + this.isPushOkLoading = false; + this.moduleId = ''; + this.pushId = ''; + this.getRequest(); + this.message.create('success', `发布成功!`); + } else { + this.message.create('warning', data['return_msg']); } + }, error => { + this.message.create('error', `未知错误!`); }); } + /** 清空模板 **/ + emptyPushForm(e: MouseEvent): void { + e.preventDefault(); + this.pushForm.reset(); + for (const key in this.pushForm.controls) { + this.pushForm.controls[key].markAsPristine(); + this.pushForm.controls[key].updateValueAndValidity(); + } + } + + // 根据内容分类查询可使用的模板列表 + findModuleByCategory(categoryId) { + this.http.get(this.WEB_SERVE_URL + '/cmsCategoryModule/getModuleByCategoryId?categoryId=' + categoryId).subscribe(data => { + if (data['return_code'] === '000000') { + this.selectModule = data['return_data']; + console.log(this.selectModule); + } else { + this.message.create('error', data['return_msg']); + } + }); + } + + showDown(id): void { + this.modalService.confirm({ + nzTitle: '是否确定下线', + nzOkText: '是', + nzOnOk: () => this.DownContent(id), + nzCancelText: '否', + }); + } + + // 下线 + DownContent(id) { + // 定义附件数据 + const params = { + 'id': id, + 'status': 1 + }; + /** 确定等待 **/ + this.http.post(this.WEB_SERVE_URL + '/cmsContent/updateStatusOfContent', params).subscribe(data => { + if (data['return_code'] === '000000') { + this.getRequest(); + this.message.create('success', `下线成功!`); + } else { + this.message.create('warning', data['return_msg']); + } + }, error => { + this.message.create('error', `未知错误!`); + }); + } } diff --git a/src/app/admin/config-manage/third-product/third-product.component.html b/src/app/admin/config-manage/third-product/third-product.component.html index ba87b74..e163ad0 100644 --- a/src/app/admin/config-manage/third-product/third-product.component.html +++ b/src/app/admin/config-manage/third-product/third-product.component.html @@ -77,7 +77,7 @@ {{i + 1}} {{data.productName}} - {{data.productType | productType : data.productId}} + {{data.discount == null ? '暂未配置' : data.discount + "%"}} {{data.integralDiscount == null ? '0' : data.integralDiscount + "%"}} {{data.productPayTypeString.substring(0 , data.productPayTypeString.length - 1)}} diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 22a6456..b1b7043 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -59,7 +59,6 @@ import { PlatformPipe } from './pipes/recharge-pipe/platform.pipe'; import { IntegralTypePipe } from './pipes/integral/integral-type.pipe'; import { IntegralProductPipe } from './pipes/integral/integral-product.pipe'; import { MsgTypePipe } from './pipes/msg/msg-type.pipe'; -import { ProductTypePipe } from './pipes/third-product/product-type.pipe'; const PIPES = [ TimesPipe, @@ -113,7 +112,6 @@ const PIPES = [ IntegralTypePipe, IntegralProductPipe, MsgTypePipe, - ProductTypePipe, ]; diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index b648dac..5956d41 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -41,4 +41,3 @@ export * from './apiMerchant/source-type.pipe'; export * from './gas-class-group-task/gas-class-group-task-status.pipe'; export * from './gas-order/gas-order-status.pipe'; export * from './recharge-pipe/platform.pipe'; -export * from './third-product/product-type.pipe'; From 06054e53d17f52a93ec513b09368be97e2ec3d6d Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 23 Dec 2022 13:57:47 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../company-amount-record.component.html | 3 +- .../company-amount-routing.module.ts | 2 + .../fleet-oil-card-car.component.html | 118 +++++ .../fleet-oil-card-car.component.scss | 3 + .../fleet-oil-card-car.component.spec.ts | 25 + .../fleet-oil-card-car.component.ts | 252 ++++++++++ .../fleet-oil-card-list.component.html | 241 +++++++++ .../fleet-oil-card-list.component.scss | 3 + .../fleet-oil-card-list.component.spec.ts | 25 + .../fleet-oil-card-list.component.ts | 467 ++++++++++++++++++ .../fleet-oil-card-order.component.html | 167 +++++++ .../fleet-oil-card-order.component.scss | 0 .../fleet-oil-card-order.component.spec.ts | 25 + .../fleet-oil-card-order.component.ts | 147 ++++++ .../fleet-oil-card-record.component.html | 145 ++++++ .../fleet-oil-card-record.component.scss | 3 + .../fleet-oil-card-record.component.spec.ts | 25 + .../fleet-oil-card-record.component.ts | 100 ++++ .../fleet-oil-card-routing.module.ts | 22 + .../fleet-oil-card-user-list.component.html | 123 +++++ .../fleet-oil-card-user-list.component.scss | 3 + ...fleet-oil-card-user-list.component.spec.ts | 25 + .../fleet-oil-card-user-list.component.ts | 251 ++++++++++ .../fleet-oil-card/fleet-oil-card.module.ts | 29 ++ .../oil-price-task-edit.component.ts | 1 - .../oil-card-order.component.html | 8 +- .../distribution-integral-list.component.ts | 6 +- .../promotion-order-list.component.ts | 6 +- src/app/admin/promotion/promotion.module.ts | 4 +- .../system/system-msg/system-msg.component.ts | 8 +- src/app/app-routing.module.ts | 5 + .../company-amount-record-source-type.pipe.ts | 4 +- src/app/services/distribution.service.ts | 2 +- .../services/fleet-oil-card-car.service.ts | 39 ++ .../services/fleet-oil-card-user.service.ts | 39 ++ src/app/services/fleet-oil-card.service.ts | 148 ++++++ src/app/services/msg.service.ts | 2 +- 37 files changed, 2453 insertions(+), 23 deletions(-) create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.html create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.scss create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.spec.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.html create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.scss create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.spec.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.html create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.scss create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.spec.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.html create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.scss create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.spec.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-routing.module.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.html create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.scss create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.spec.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.ts create mode 100644 src/app/admin/fleet-oil-card/fleet-oil-card.module.ts create mode 100644 src/app/services/fleet-oil-card-car.service.ts create mode 100644 src/app/services/fleet-oil-card-user.service.ts create mode 100644 src/app/services/fleet-oil-card.service.ts diff --git a/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html b/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html index bdce8ff..251ac96 100644 --- a/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html +++ b/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html @@ -35,7 +35,8 @@ - + + diff --git a/src/app/admin/company-amount/company-amount-routing.module.ts b/src/app/admin/company-amount/company-amount-routing.module.ts index dd5efb0..c91946f 100644 --- a/src/app/admin/company-amount/company-amount-routing.module.ts +++ b/src/app/admin/company-amount/company-amount-routing.module.ts @@ -4,10 +4,12 @@ import {CompanyAmountRecordComponent} from './company-amount-record/company-amou import {OilCardListComponent} from '../oil-card/oil-card-list/oil-card-list.component'; import {OilCardOrderComponent} from '../oil-card/oil-card-order/oil-card-order.component'; import {PayPwdComponent} from './pay-pwd/pay-pwd.component'; +import {FleetOilCardListComponent} from '../fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component'; const routes: Routes = [ { path: 'list', component: CompanyAmountRecordComponent }, { path: 'oil-card', component: OilCardListComponent }, + { path: 'fleet-oil-card', component: FleetOilCardListComponent }, { path: 'oil-card-order', component: OilCardOrderComponent }, { path: 'pay-pwd-config', component: PayPwdComponent }, ]; diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.html b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.html new file mode 100644 index 0000000..e14fb10 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.html @@ -0,0 +1,118 @@ + + + + + + +
+
+
+ +
+ + 联系人 + + + + +
+ +
+ + 联系电话 + + + + +
+
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ + + + + +
+ + + + + + 序号 + 车辆车牌 + 车主姓名 + 车主电话 + 创建时间 + 创建人 + 操作 + + + + + {{i+1}} + {{data.carLicensePlate}} + {{data.contactName}} + {{data.contactPhone}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.opUserName}} + + 操作列表 + + + + + + + +
+
+ + + + + + + 序号 + 客户姓名 + 客户电话 + 失败原因 + + + + + {{ i + 1}} + {{data.contactName}} + {{data.contactPhone}} + {{data.errMsg}} + + + + diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.scss b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.scss new file mode 100644 index 0000000..690993b --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.scss @@ -0,0 +1,3 @@ +.table-td-operation a { + padding: 0px 5px; +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.spec.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.spec.ts new file mode 100644 index 0000000..0ec7d41 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FleetOilCardCarComponent } from './fleet-oil-card-car.component'; + +describe('FleetOilCardCarComponent', () => { + let component: FleetOilCardCarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FleetOilCardCarComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FleetOilCardCarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.ts new file mode 100644 index 0000000..55d8bf6 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-car/fleet-oil-card-car.component.ts @@ -0,0 +1,252 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {FleetOilCardUserService} from '../../../services/fleet-oil-card-user.service'; +import {OrganizationService} from '../../../services/organization.service'; +import {CompanyAccountService} from '../../../services/company-account.service'; +import {ActivatedRoute, Router} from '@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {FleetOilCardCarService} from '../../../services/fleet-oil-card-car.service'; + +@Component({ + selector: 'app-fleet-oil-card-car', + templateUrl: './fleet-oil-card-car.component.html', + styleUrls: ['./fleet-oil-card-car.component.scss'] +}) +export class FleetOilCardCarComponent implements OnInit { + WEB_SERVE_URL = environment.baseUrl; + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + fleetCardNo: string; + + rechargeModal = false; + rechargeForm: FormGroup; + rechargeBtnLoading = false; + + orgArray = []; + accountObject = { + amounts: 0 + }; + + importErrorDataModal = false; + errorDataArray = []; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private fleetOilCardCarService: FleetOilCardCarService, + private organizationService: OrganizationService, + private companyAccountService: CompanyAccountService, + private activatedRoute: ActivatedRoute, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + ngOnInit(): void { + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams.cardNo != null) { + this.fleetCardNo = queryParams.cardNo; + } + }); + + this.searchForm = this.form.group({ + contactName: [null], + contactPhone: [null], + }); + + this.rechargeForm = this.form.group({ + cardNo: [{ value: null, disabled: true }, [Validators.required]], + price: [100, [Validators.required]], + twoPwd: [null, [Validators.required]], + }); + + if (this.roleType === 5 && this.adminFlag === 1) { + this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id'], data => { + this.orgArray = data['return_data']; + }); + } + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['fleetOilCardNo'] = this.fleetCardNo; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.fleetOilCardCarService.getCarList(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; + if (this.searchForm.value.createTime != null) { + this.searchForm.value.createTimeS = new Date(this.searchForm.value.createTime[0]).getTime(); + this.searchForm.value.createTimeE = new Date(this.searchForm.value.createTime[1]).getTime(); + } else { + this.searchForm.value.createTimeS = null; + this.searchForm.value.createTimeE = null; + } + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + /** + * 弹出删除对话框 + */ + showDelConfirm(id: number): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否删除该数据?', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.delData(id) + }); + } + + delData(id: number) { + this.fleetOilCardCarService.delete({ id: id }, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + + /** + * 弹出禁用对话框 + */ + showDisabledConfirm(cardNo: string): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否禁用油卡', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.disabledData(cardNo) + }); + } + + /** + * 禁用数据 + */ + disabledData(cardNo: string) { + /* this.fleetOilCardService.disabled({ cardNo: cardNo}, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + });*/ + } + + /** + * 弹出启用对话框 + */ + showEnableConfirm(cardNo: string): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否启用油卡', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.enableData(cardNo) + }); + } + + /** + * 启用数据 + */ + enableData(cardNo: string) { + /* this.fleetOilCardService.enable({ cardNo: cardNo}, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + });*/ + } + + handleChange(info: NzUploadChangeParam): void { + if (info.file.status === 'done') { + if (info.file.response.return_code === '000000') { + if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) { + + this.requestData(1); + this.message.success('导入成功'); + + } else { + this.modal.warning({ + nzTitle: '提示', + nzOkText: '查看失败数据', + nzContent: '只有部分数据导入成功', + nzOnOk: () => this.showImportErrorDataModal(info.file.response.return_data) + }); + } + } else { + this.message.error(info.file.response.return_msg); + } + } else if (info.file.status === 'error') { + this.message.error('上传错误'); + } + } + + // 打开模态框 + showImportErrorDataModal(data: []) { + this.errorDataArray = data['errorData']; + this.importErrorDataModal = true; + } + + closeImportErrorDataModal() { + this.importErrorDataModal = false; + } + + downloadTemplate() { + window.location.href = this.FILE_URL + "template/导入车辆模板.xlsx"; + } + +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.html b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.html new file mode 100644 index 0000000..cce223b --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.html @@ -0,0 +1,241 @@ + + + + + + +
+
+
+
+ + 所属部门 + + + + + + +
+ +
+ + 油卡卡号 + + + + +
+ +
+ + 联系人 + + + + +
+ +
+ + 联系电话 + + + + +
+ +
+ + 油卡状态 + + + + + + + +
+ +
+ + 生成时间 + + + + +
+ +
+ +
+
+ + +
+
+
+
+ +
+
+ + + + + +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ + +
+ + + + + + 序号 + 所属部门 + 卡号 + 余额 + 消费金额 + 联系人 + 联系电话 + 油卡状态 + + 生成时间 + 操作 + + + + + {{i+1}} + {{data.orgName}} + {{data.cardNo}} + ¥{{data.amount}} + ¥{{data.amountConsume}} + {{data.contactName?data.contactName:'未设置'}} + {{data.contactPhone?data.contactPhone:'未设置'}} + {{data.status | oilCardStatus}} + + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + 充值 + 更多操作 + + + + + + + +
+
+ + +
+ + 生成数量 + + + + +
+ +
+
+
+ + +
+ + 联系人 + + + + + + 联系电话 + + + + +
+ +
+
+
+ + +
+ + 卡号 + + + + + + 充值金额 + + + + + + 支付密码 + + + + +
+ +
+
+
+ + +
+ + 卡号 + + + + + + 回收余额 + + + + + + 支付密码 + + + + +
+ +
+
+
diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.scss b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.scss new file mode 100644 index 0000000..690993b --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.scss @@ -0,0 +1,3 @@ +.table-td-operation a { + padding: 0px 5px; +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.spec.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.spec.ts new file mode 100644 index 0000000..7f281f1 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FleetOilCardListComponent } from './fleet-oil-card-list.component'; + +describe('FleetOilCardListComponent', () => { + let component: FleetOilCardListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FleetOilCardListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FleetOilCardListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.ts new file mode 100644 index 0000000..ef6a98d --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-list/fleet-oil-card-list.component.ts @@ -0,0 +1,467 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {NzMessageService, NzModalService} from 'ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {OrganizationService} from '../../../services/organization.service'; +import {CompanyAccountService} from '../../../services/company-account.service'; +import {Router} from '@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {ValidatorsService} from '../../../services/validators.service'; +import {FleetOilCardService} from '../../../services/fleet-oil-card.service'; + +@Component({ + selector: 'app-fleet-oil-card-list', + templateUrl: './fleet-oil-card-list.component.html', + styleUrls: ['./fleet-oil-card-list.component.scss'] +}) +export class FleetOilCardListComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + generateCardModal = false; + generateCardForm: FormGroup; + + editContactModal = false; + editContactForm: FormGroup; + editContactData = {}; + + rechargeModal = false; + rechargeForm: FormGroup; + rechargeBtnLoading = false; + + recycleAmountModal = false; + recycleAmountForm: FormGroup; + recycleAmountBtnLoading = false; + + orgArray = []; + accountObject = { + amounts: 0 + }; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private fleetOilCardService: FleetOilCardService, + private organizationService: OrganizationService, + private companyAccountService: CompanyAccountService, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + ngOnInit(): void { + this.searchForm = this.form.group({ + orgId: [null], + cardNo: [null], + contactName: [null], + contactPhone: [null], + createTime: [null], + createTimeS: [null], + createTimeE: [null], + bindTime: [null], + bindTimeS: [null], + bindTimeE: [null], + isConfigContact: [null], + status: [null], + bindStatus: [null], + }); + + this.editContactForm = this.form.group({ + cardNo: [null, [Validators.required]], + contactName: [null, [Validators.required]], + contactPhone: [null, [Validators.required, ValidatorsService.mobile]], + }); + + this.generateCardForm = this.form.group({ + generateNum: [1, [Validators.required]], + }); + + this.rechargeForm = this.form.group({ + cardNo: [{ value: null, disabled: true }, [Validators.required]], + price: [100, [Validators.required]], + twoPwd: [null, [Validators.required]], + }); + + this.recycleAmountForm = this.form.group({ + cardNo: [{ value: null, disabled: true }, [Validators.required]], + amount: [{ value: null, disabled: true }, [Validators.required]], + twoPwd: [null, [Validators.required]], + }); + + if (this.roleType === 5 && this.adminFlag === 1) { + this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id'], data => { + this.orgArray = data['return_data']; + }); + } + + if (this.roleType === 5 && this.adminFlag === 0) { + this.getAccount(); + } + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.fleetOilCardService.getCardList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 查询账户 + */ + getAccount() { + this.companyAccountService.getAccount(data => { + this.accountObject = data['return_data']; + }); + } + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + this.whereObject = whereObject; + if (this.searchForm.value.createTime != null) { + this.searchForm.value.createTimeS = new Date(this.searchForm.value.createTime[0]).getTime(); + this.searchForm.value.createTimeE = new Date(this.searchForm.value.createTime[1]).getTime(); + } else { + this.searchForm.value.createTimeS = null; + this.searchForm.value.createTimeE = null; + } + if (this.searchForm.value.bindTime != null) { + this.searchForm.value.bindTimeS = new Date(this.searchForm.value.bindTime[0]).getTime(); + this.searchForm.value.bindTimeE = new Date(this.searchForm.value.bindTime[1]).getTime(); + } else { + this.searchForm.value.bindTimeS = null; + this.searchForm.value.bindTimeE = null; + } + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + /** + * 展示生成油卡模态框 + */ + showGenerateCardModal() { + this.generateCardModal = true; + } + + /** + * 关闭生成油卡模态框 + */ + closeGenerateCardModal() { + this.generateCardModal = false; + } + + /** + * 提交生成数量 + */ + submitGenerateCard() { + for (const i in this.generateCardForm.controls) { + this.generateCardForm.controls[i].markAsDirty(); + this.generateCardForm.controls[i].updateValueAndValidity(); + } + if (this.generateCardForm.status == null || this.generateCardForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + + this.loadingObject.spinning = true; + this.loadingObject.msg = '生成油卡中...'; + this.closeGenerateCardModal(); + + this.fleetOilCardService.generateCard(this.generateCardForm.value, 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'], + }); + } + this.loadingObject.spinning = false; + }); + } + + /** + * 展示编辑联系人模态框 + */ + showEditContactModal(data: object) { + this.editContactForm.patchValue(data); + this.editContactData = data; + this.editContactModal = true; + } + + /** + * 关闭编辑联系人模态框 + */ + closeEditContactModal() { + this.editContactForm.reset(); + this.editContactModal = false; + } + + /** + * 提交编辑联系人数据 + */ + submitEditContactData() { + for (const i in this.editContactForm.controls) { + this.editContactForm.controls[i].markAsDirty(); + this.editContactForm.controls[i].updateValueAndValidity(); + } + if (this.editContactForm.status == null || this.editContactForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + this.fleetOilCardService.setContact(this.editContactForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '设置成功', + }); + this.closeEditContactModal(); + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + + /** + * 弹出禁用对话框 + */ + showDisabledConfirm(cardNo: string): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否禁用油卡', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.disabledData(cardNo) + }); + } + + /** + * 禁用数据 + */ + disabledData(cardNo: string) { + this.fleetOilCardService.disabled({ cardNo: cardNo}, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + + /** + * 弹出启用对话框 + */ + showEnableConfirm(cardNo: string): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否启用油卡', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.enableData(cardNo) + }); + } + + /** + * 启用数据 + */ + enableData(cardNo: string) { + this.fleetOilCardService.enable({ cardNo: cardNo}, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + + /** + * 展示充值模态框 + */ + showRechargeModal(cardNo: string) { + this.rechargeForm.patchValue({cardNo: cardNo}); + this.rechargeModal = true; + } + + /** + * 关闭充值模态框 + */ + closeRechargeModal() { + this.rechargeModal = false; + } + + /** + * 提交充值 + */ + submitRecharge() { + for (const i in this.rechargeForm.controls) { + this.rechargeForm.controls[i].markAsDirty(); + this.rechargeForm.controls[i].updateValueAndValidity(); + } + if (this.rechargeForm.status == null || this.rechargeForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + this.rechargeBtnLoading = true; + this.rechargeForm.value['cardNo'] = this.rechargeForm.controls['cardNo']['value']; + this.fleetOilCardService.recharge(this.rechargeForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '充值成功', + }); + this.closeRechargeModal(); + this.getAccount(); + this.requestData(this.whereObject['pageNum']); + + } else if (data['return_code'] === '102136') { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + this.router.navigateByUrl('admin/company-amount/pay-pwd-config'); + this.closeRechargeModal(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + this.rechargeBtnLoading = false; + }); + } + + + /** + * 展示充值模态框 + */ + showRecycleAmountModal(cardData: object) { + this.recycleAmountForm.patchValue(cardData); + this.recycleAmountModal = true; + } + + /** + * 关闭充值模态框 + */ + closeRecycleAmountModal() { + this.recycleAmountModal = false; + } + + /** + * 提交回收余额 + */ + submitRecycleAmount() { + for (const i in this.recycleAmountForm.controls) { + this.recycleAmountForm.controls[i].markAsDirty(); + this.recycleAmountForm.controls[i].updateValueAndValidity(); + } + if (this.recycleAmountForm.status == null || this.recycleAmountForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + this.recycleAmountBtnLoading = true; + this.recycleAmountForm.value['cardNo'] = this.recycleAmountForm.controls['cardNo']['value']; + this.fleetOilCardService.recycleAmount(this.recycleAmountForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '回收成功', + }); + this.closeRecycleAmountModal(); + this.getAccount(); + this.requestData(this.whereObject['pageNum']); + + } else if (data['return_code'] === '102136') { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + this.router.navigateByUrl('admin/company-amount/pay-pwd-config'); + this.closeRecycleAmountModal(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + this.recycleAmountBtnLoading = false; + }); + } + + /** + * 导出油卡 + */ + excelCard() { + this.fleetOilCardService.exportCard(this.whereObject, data => { + if (data['return_code'] === '000000') { + window.location.href = this.FILE_URL + 'temporary/' + data['return_data']; + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.html b/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.html new file mode 100644 index 0000000..2734158 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.html @@ -0,0 +1,167 @@ + + + + + + +
+
+
+
+ + 部门 + + + + + + +
+ +
+ + 油卡卡号 + + + + +
+ +
+ + 客户电话 + + + + +
+ +
+ + 车牌 + + + + +
+ +
+ + 加油站 + + + + +
+ +
+ + 交易状态 + + + + + + + + + + +
+ +
+ + 支付时间 + + + + +
+ +
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ +
+ + + + + + 序号 + 所属部门 + 客户电话 + 车牌 + 油卡卡号 + 交易单号 + 加油金额 + 优惠金额 + 实付金额 + 加油站 + 油号 + 油枪号 + 油站枪价 + 平台枪价 + 交易状态 + 创建时间 + 支付时间 + 退款时间 + + + + + + {{i+1}} + {{data.orgName}} + {{data.merPhone}} + {{data.carLicensePlate!=null?data.carLicensePlate:'未知'}} + {{data.memCardNo}} + {{data.orderNo}} + + ¥{{data.totalPrice}} + ¥{{data.deductionPrice}} + ¥{{data.payRealPrice}} + {{data.goodsName}} + {{data.gasOilNo}} + {{data.gasGunNo}} + {{data.gasPriceGun}} + {{data.platformPriceGun}} + {{data.statusName}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + + + +
+
diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.scss b/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.spec.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.spec.ts new file mode 100644 index 0000000..2881cec --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FleetOilCardOrderComponent } from './fleet-oil-card-order.component'; + +describe('FleetOilCardOrderComponent', () => { + let component: FleetOilCardOrderComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FleetOilCardOrderComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FleetOilCardOrderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.ts new file mode 100644 index 0000000..7dacace --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-order/fleet-oil-card-order.component.ts @@ -0,0 +1,147 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService, NzModalService} from 'ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {OrganizationService} from '../../../services/organization.service'; +import {NavigationComponent} from '../../navigation/navigation.component'; +import {CompanyAccountService} from '../../../services/company-account.service'; +import {ActivatedRoute} from '@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {FleetOilCardService} from '../../../services/fleet-oil-card.service'; + +@Component({ + selector: 'app-fleet-oil-card-order', + templateUrl: './fleet-oil-card-order.component.html', + styleUrls: ['./fleet-oil-card-order.component.scss'] +}) +export class FleetOilCardOrderComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + cardNo: string; + phone: string; + carLicensePlate: string; + orgArray = []; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private oilCardService: FleetOilCardService, + private organizationService: OrganizationService, + private navigationComponent: NavigationComponent, + private companyAccountService: CompanyAccountService, + private activatedRoute: ActivatedRoute, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + ngOnInit(): void { + this.searchForm = this.form.group({ + orgId: [null], + cardNo: [null], + goodsName: [null], + memPhone: [null], + carLicensePlate: [null], + status: [null], + payTime: [null], + payTimeS: [null], + payTimeE: [null], + }); + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams['cardNo'] != null) { + this.cardNo = queryParams['cardNo']; + } + if (queryParams['phone'] != null) { + this.phone = queryParams['phone']; + } + if (queryParams['carLicensePlate'] != null) { + this.carLicensePlate = queryParams['carLicensePlate']; + } + }); + + if (this.roleType === 5 && this.adminFlag === 1) { + this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id'], data => { + this.orgArray = data['return_data']; + }); + } + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + if (this.cardNo != null) { + this.whereObject['cardNo'] = this.cardNo; + } + if (this.phone != null) { + this.whereObject['phone'] = this.phone; + } + if (this.carLicensePlate != null) { + this.whereObject['carLicensePlate'] = this.carLicensePlate; + } + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.oilCardService.getCardOrderList(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; + if (this.searchForm.value.payTime != null) { + this.searchForm.value.payTimeS = new Date(this.searchForm.value.payTime[0]).getTime(); + this.searchForm.value.payTimeE = new Date(this.searchForm.value.payTime[1]).getTime(); + } else { + this.searchForm.value.payTimeS = null; + this.searchForm.value.payTimeE = null; + } + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + /** + * 导出油卡订单 + */ + excelCardOrder() { + this.oilCardService.exportCardOrder(this.whereObject, data => { + if (data['return_code'] === '000000') { + window.location.href = this.FILE_URL + 'temporary/' + data['return_data']; + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.html b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.html new file mode 100644 index 0000000..1417aec --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.html @@ -0,0 +1,145 @@ + + + + + + +
+
+
+ +
+ + 流水类型 + + + + + + + +
+ +
+ + 来源类型 + + + + + + + + + +
+ +
+ + 来源流水号 + + + + +
+ +
+ + 操作人类型 + + + + + + + +
+ +
+ + 创建时间 + + + + +
+ +
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+
+ + + + + + 序号 + 油卡卡号 + 账单类型 + 交易金额 + 交易前金额 + 交易后金额 + 来源类型 + 来源流水号 + 来源内容 + 操作人类型 + 操作人名称 + 操作人电话 + 创建时间 + + + + + + {{i+1}} + {{data.fleetOilCardNo}} + {{data.type | oilCardRecordType}} + ¥{{data.transactionAmount}} + ¥{{data.beforeAmount}} + ¥{{data.afterAmount}} + {{data.sourceType | oilCardRecordSourceType}} + {{data.sourceOrderNo}} + {{data.sourceContent}} + + 未知 + 管理员 + 客户 + + {{data.opUserName}} + {{data.opUserPhone}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + + + +
+
diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.scss b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.scss new file mode 100644 index 0000000..690993b --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.scss @@ -0,0 +1,3 @@ +.table-td-operation a { + padding: 0px 5px; +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.spec.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.spec.ts new file mode 100644 index 0000000..961d719 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FleetOilCardRecordComponent } from './fleet-oil-card-record.component'; + +describe('FleetOilCardRecordComponent', () => { + let component: FleetOilCardRecordComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FleetOilCardRecordComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FleetOilCardRecordComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.ts new file mode 100644 index 0000000..afc44c4 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-record/fleet-oil-card-record.component.ts @@ -0,0 +1,100 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {NzMessageService, NzModalService} from 'ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {FleetOilCardService} from '../../../services/fleet-oil-card.service'; +import {ActivatedRoute, Router} from '@angular/router'; + +@Component({ + selector: 'app-fleet-oil-card-record', + templateUrl: './fleet-oil-card-record.component.html', + styleUrls: ['./fleet-oil-card-record.component.scss'] +}) +export class FleetOilCardRecordComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + fleetOilCardNo: string; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private fleetOilCardService: FleetOilCardService, + private activatedRoute: ActivatedRoute, + private router: Router, + private form: FormBuilder) { + } + + ngOnInit(): void { + this.searchForm = this.form.group({ + fleetOilCardNo: [null], + type: [null], + sourceOrderNo: [null], + sourceType: [null], + opUserPhone: [null], + opUserType: [null], + }); + + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams.cardNo != null) { + this.fleetOilCardNo = queryParams.cardNo; + this.requestData(1); + } + }); + + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['fleetOilCardNo'] = this.fleetOilCardNo; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.fleetOilCardService.getRecordList(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; + if (this.searchForm.value.createTime != null) { + this.searchForm.value.createTimeS = new Date(this.searchForm.value.createTime[0]).getTime(); + this.searchForm.value.createTimeE = new Date(this.searchForm.value.createTime[1]).getTime(); + } else { + this.searchForm.value.createTimeS = null; + this.searchForm.value.createTimeE = null; + } + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-routing.module.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-routing.module.ts new file mode 100644 index 0000000..09c831f --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-routing.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {FleetOilCardListComponent} from './fleet-oil-card-list/fleet-oil-card-list.component'; +import {FleetOilCardUserListComponent} from './fleet-oil-card-user-list/fleet-oil-card-user-list.component'; +import {FleetOilCardCarComponent} from './fleet-oil-card-car/fleet-oil-card-car.component'; +import {FleetOilCardRecordComponent} from './fleet-oil-card-record/fleet-oil-card-record.component'; +import {FleetOilCardOrderComponent} from './fleet-oil-card-order/fleet-oil-card-order.component'; + + +const routes: Routes = [ + { path: 'list', component: FleetOilCardListComponent }, + { path: 'user-list', component: FleetOilCardUserListComponent }, + { path: 'car-list', component: FleetOilCardCarComponent }, + { path: 'record-list', component: FleetOilCardRecordComponent }, + { path: 'order-list', component: FleetOilCardOrderComponent }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class FleetOilCardRoutingModule { } diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.html b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.html new file mode 100644 index 0000000..f3eb7c0 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.html @@ -0,0 +1,123 @@ + + + + + + +
+
+
+ +
+ + 联系人 + + + + +
+ +
+ + 联系电话 + + + + +
+
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ + + + + +
+ + + + + + 序号 + 客户姓名 + 客户电话 + 消费总额 + 最近消费 + 创建时间 + 创建人 + 操作 + + + + + {{i+1}} + {{data.contactName}} + {{data.contactPhone}} + ¥{{data.amountConsume}} + + 未消费 + {{data.latelyConsumeTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.opUserName}} + + 操作列表 + + + + + + + +
+
+ + + + + + + 序号 + 客户姓名 + 客户电话 + 失败原因 + + + + + {{ i + 1}} + {{data.contactName}} + {{data.contactPhone}} + {{data.errMsg}} + + + + diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.scss b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.scss new file mode 100644 index 0000000..690993b --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.scss @@ -0,0 +1,3 @@ +.table-td-operation a { + padding: 0px 5px; +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.spec.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.spec.ts new file mode 100644 index 0000000..dc56ada --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FleetOilCardUserListComponent } from './fleet-oil-card-user-list.component'; + +describe('FleetOilCardUserListComponent', () => { + let component: FleetOilCardUserListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FleetOilCardUserListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FleetOilCardUserListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.ts b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.ts new file mode 100644 index 0000000..d1a42c0 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card-user-list/fleet-oil-card-user-list.component.ts @@ -0,0 +1,251 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {OrganizationService} from '../../../services/organization.service'; +import {CompanyAccountService} from '../../../services/company-account.service'; +import {ActivatedRoute, Router} from '@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {FleetOilCardUserService} from '../../../services/fleet-oil-card-user.service'; + +@Component({ + selector: 'app-fleet-oil-card-user-list', + templateUrl: './fleet-oil-card-user-list.component.html', + styleUrls: ['./fleet-oil-card-user-list.component.scss'] +}) +export class FleetOilCardUserListComponent implements OnInit { + WEB_SERVE_URL = environment.baseUrl; + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + fleetCardNo: string; + + rechargeModal = false; + rechargeForm: FormGroup; + rechargeBtnLoading = false; + + orgArray = []; + accountObject = { + amounts: 0 + }; + + importErrorDataModal = false; + errorDataArray = []; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private fleetOilCardUserService: FleetOilCardUserService, + private organizationService: OrganizationService, + private companyAccountService: CompanyAccountService, + private activatedRoute: ActivatedRoute, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + ngOnInit(): void { + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams.cardNo != null) { + this.fleetCardNo = queryParams.cardNo; + } + }); + + this.searchForm = this.form.group({ + contactName: [null], + contactPhone: [null], + }); + + this.rechargeForm = this.form.group({ + cardNo: [{ value: null, disabled: true }, [Validators.required]], + price: [100, [Validators.required]], + twoPwd: [null, [Validators.required]], + }); + + if (this.roleType === 5 && this.adminFlag === 1) { + this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id'], data => { + this.orgArray = data['return_data']; + }); + } + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['fleetOilCardNo'] = this.fleetCardNo; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.fleetOilCardUserService.getUserList(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; + if (this.searchForm.value.createTime != null) { + this.searchForm.value.createTimeS = new Date(this.searchForm.value.createTime[0]).getTime(); + this.searchForm.value.createTimeE = new Date(this.searchForm.value.createTime[1]).getTime(); + } else { + this.searchForm.value.createTimeS = null; + this.searchForm.value.createTimeE = null; + } + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + /** + * 弹出删除对话框 + */ + showDelConfirm(id: number): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否删除该用户?删除后用户无法使用车队油卡!', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.delData(id) + }); + } + + delData(id: number) { + this.fleetOilCardUserService.delete({ id: id }, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + + /** + * 弹出禁用对话框 + */ + showDisabledConfirm(cardNo: string): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否禁用油卡', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.disabledData(cardNo) + }); + } + + /** + * 禁用数据 + */ + disabledData(cardNo: string) { +/* this.fleetOilCardService.disabled({ cardNo: cardNo}, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + });*/ + } + + /** + * 弹出启用对话框 + */ + showEnableConfirm(cardNo: string): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否启用油卡', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.enableData(cardNo) + }); + } + + /** + * 启用数据 + */ + enableData(cardNo: string) { +/* this.fleetOilCardService.enable({ cardNo: cardNo}, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + });*/ + } + + handleChange(info: NzUploadChangeParam): void { + if (info.file.status === 'done') { + if (info.file.response.return_code === '000000') { + if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) { + + this.requestData(1); + this.message.success('导入成功'); + + } else { + this.modal.warning({ + nzTitle: '提示', + nzOkText: '查看失败数据', + nzContent: '只有部分数据导入成功', + nzOnOk: () => this.showImportErrorDataModal(info.file.response.return_data) + }); + } + } else { + this.message.error(info.file.response.return_msg); + } + } else if (info.file.status === 'error') { + this.message.error('上传错误'); + } + } + + // 打开模态框 + showImportErrorDataModal(data: []) { + this.errorDataArray = data['errorData']; + this.importErrorDataModal = true; + } + + closeImportErrorDataModal() { + this.importErrorDataModal = false; + } + + downloadTemplate() { + window.location.href = this.FILE_URL + "template/导入客户模板.xlsx"; + } + +} diff --git a/src/app/admin/fleet-oil-card/fleet-oil-card.module.ts b/src/app/admin/fleet-oil-card/fleet-oil-card.module.ts new file mode 100644 index 0000000..e173d53 --- /dev/null +++ b/src/app/admin/fleet-oil-card/fleet-oil-card.module.ts @@ -0,0 +1,29 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { FleetOilCardRoutingModule } from './fleet-oil-card-routing.module'; +import { FleetOilCardListComponent } from './fleet-oil-card-list/fleet-oil-card-list.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'; +import {NgxEchartsModule} from 'ngx-echarts'; +import { FleetOilCardUserListComponent } from './fleet-oil-card-user-list/fleet-oil-card-user-list.component'; +import { FleetOilCardCarComponent } from './fleet-oil-card-car/fleet-oil-card-car.component'; +import { FleetOilCardRecordComponent } from './fleet-oil-card-record/fleet-oil-card-record.component'; +import { FleetOilCardOrderComponent } from './fleet-oil-card-order/fleet-oil-card-order.component'; + +@NgModule({ + declarations: [FleetOilCardListComponent, FleetOilCardUserListComponent, FleetOilCardCarComponent, FleetOilCardRecordComponent, FleetOilCardOrderComponent], + imports: [ + CommonModule, + FleetOilCardRoutingModule, + NgZorroAntdModule, + ReactiveFormsModule, + FormsModule, + BreadcrumbModule, + AppCommonModule, + NgxEchartsModule, + ] +}) +export class FleetOilCardModule { } diff --git a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts index 9befb57..092465d 100644 --- a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts +++ b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts @@ -7,7 +7,6 @@ import {OilPriceTaskService} from '../../../services/oil-price/oil-price-task.se import {LocalStorageService} from "../../../services/local-storage.service"; import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; import {OilPriceOfficialService} from '../../../services/oil-price/oil-price-official.service'; -import {data} from 'jquery'; @Component({ selector: 'app-oil-price-task-edit', diff --git a/src/app/admin/oil-card/oil-card-order/oil-card-order.component.html b/src/app/admin/oil-card/oil-card-order/oil-card-order.component.html index 31953f2..fb8e1c3 100644 --- a/src/app/admin/oil-card/oil-card-order/oil-card-order.component.html +++ b/src/app/admin/oil-card/oil-card-order/oil-card-order.component.html @@ -97,15 +97,15 @@ 用户手机号 油卡卡号 平台订单号 - 团油订单号 + 加油金额 优惠金额 实付金额 加油站 油号 油枪号 - 团油油枪价 - 平台油枪价格 + 油站枪价 + 平台枪价 订单状态 创建时间 支付时间 @@ -120,7 +120,7 @@ {{data.merPhone}} {{data.memCardNo}} {{data.orderNo}} - {{data.gasOrderNo}} + ¥{{data.totalPrice}} ¥{{data.deductionPrice}} ¥{{data.payRealPrice}} diff --git a/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts b/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts index 9c691ad..67e1072 100644 --- a/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts +++ b/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts @@ -1,11 +1,9 @@ import { Component, OnInit } from '@angular/core'; import {environment} from '../../../../environments/environment'; -import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; import {IconService} from '../../../services/icon.service'; -import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; -import {Router} from '_@angular_router@9.0.7@@angular/router'; -import {CommonsService} from '../../../services/commons.service'; import {DistributionService} from '../../../services/distribution.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService} from 'ng-zorro-antd'; @Component({ selector: 'app-distribution-integral-list', diff --git a/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts b/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts index 401c83a..712d03d 100644 --- a/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts +++ b/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; import {environment} from '../../../../environments/environment'; -import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; import {DistributionService} from '../../../services/distribution.service'; import {IconService} from '../../../services/icon.service'; -import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService} from 'ng-zorro-antd'; @Component({ selector: 'app-promotion-order-list', @@ -23,8 +23,6 @@ export class PromotionOrderListComponent implements OnInit { pageSize = 10; // 条码 loading = true; - - constructor( private form: FormBuilder, private distribution: DistributionService, diff --git a/src/app/admin/promotion/promotion.module.ts b/src/app/admin/promotion/promotion.module.ts index a4e6705..ddf99bf 100644 --- a/src/app/admin/promotion/promotion.module.ts +++ b/src/app/admin/promotion/promotion.module.ts @@ -4,10 +4,10 @@ import { CommonModule } from '@angular/common'; import { PromotionRoutingModule } from './promotion-routing.module'; import { DistributionIntegralListComponent } from './distribution-integral-list/distribution-integral-list.component'; import { PromotionOrderListComponent } from './promotion-order-list/promotion-order-list.component'; -import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {SeparateModule} from '../../common/separate/separate.module'; -import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import {NgZorroAntdModule} from 'ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; @NgModule({ diff --git a/src/app/admin/system/system-msg/system-msg.component.ts b/src/app/admin/system/system-msg/system-msg.component.ts index b376b15..d065d65 100644 --- a/src/app/admin/system/system-msg/system-msg.component.ts +++ b/src/app/admin/system/system-msg/system-msg.component.ts @@ -1,11 +1,11 @@ import { Component, OnInit } from '@angular/core'; import {environment} from '../../../../environments/environment'; -import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; -import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; -import {NzMessageService, NzUploadFile} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; -import {Router} from '_@angular_router@9.0.7@@angular/router'; import {CommonsService} from '../../../services/commons.service'; import {MsgService} from '../../../services/msg.service'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {HttpClient} from '@angular/common/http'; +import {NzMessageService, NzUploadFile} from 'ng-zorro-antd'; +import {Router} from '@angular/router'; function getBase64(file: File): Promise { return new Promise((resolve, reject) => { diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3877c1f..7ced521 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -117,6 +117,11 @@ const routes: Routes = [ loadChildren: () => import('./admin/oil-card/oil-card.module').then(m => m.OilCardModule), canActivate: [InitGuardService] }, + { + path: 'fleet-oil-card', + loadChildren: () => import('./admin/fleet-oil-card/fleet-oil-card.module').then(m => m.FleetOilCardModule), + canActivate: [InitGuardService] + }, { path: 'gz-sinopec', loadChildren: () => import('./admin/gz-sinopec/gz-sinopec.module').then(m => m.GzSinopecModule), diff --git a/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts b/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts index d95af63..be219fd 100644 --- a/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts +++ b/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts @@ -10,9 +10,11 @@ export class CompanyAmountRecordSourceTypePipe implements PipeTransform { case 1: return '金额充值'; case 2: - return '油卡充值'; + return '个人油卡充值'; case 3: return '回收余额'; + case 4: + return '车队油卡充值'; } } diff --git a/src/app/services/distribution.service.ts b/src/app/services/distribution.service.ts index 159feab..ee720bd 100644 --- a/src/app/services/distribution.service.ts +++ b/src/app/services/distribution.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {CommonsService} from './commons.service'; import {environment} from '../../environments/environment'; +import {HttpClient} from '@angular/common/http'; @Injectable({ providedIn: 'root' diff --git a/src/app/services/fleet-oil-card-car.service.ts b/src/app/services/fleet-oil-card-car.service.ts new file mode 100644 index 0000000..6db2272 --- /dev/null +++ b/src/app/services/fleet-oil-card-car.service.ts @@ -0,0 +1,39 @@ +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 FleetOilCardCarService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 删除用户 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public delete(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCardCar/delete', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询车辆列表 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getCarList(param: object, callBack) { + this.http.get(environment.baseUrl + 'fleetOilCardCar/getCarList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/app/services/fleet-oil-card-user.service.ts b/src/app/services/fleet-oil-card-user.service.ts new file mode 100644 index 0000000..100f452 --- /dev/null +++ b/src/app/services/fleet-oil-card-user.service.ts @@ -0,0 +1,39 @@ +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 FleetOilCardUserService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 删除用户 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public delete(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCardUser/delete', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询用户列表 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getUserList(param: object, callBack) { + this.http.get(environment.baseUrl + 'fleetOilCardUser/getUserList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/app/services/fleet-oil-card.service.ts b/src/app/services/fleet-oil-card.service.ts new file mode 100644 index 0000000..df4551b --- /dev/null +++ b/src/app/services/fleet-oil-card.service.ts @@ -0,0 +1,148 @@ +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 FleetOilCardService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 车队油卡生成 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public generateCard(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCard/generateCard', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 油卡充值 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public recharge(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCard/recharge', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 回收余额 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public recycleAmount(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCard/recycleAmount', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询油卡列表 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getCardList(param: object, callBack) { + this.http.get(environment.baseUrl + 'fleetOilCard/getCardList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询油卡记录列表 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getRecordList(param: object, callBack) { + this.http.get(environment.baseUrl + 'fleetOilCard/getRecordList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询订单列表 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getCardOrderList(param: object, callBack) { + this.http.get(environment.baseUrl + 'fleetOilCard/getCardOrderList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 导出油卡订单 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public exportCardOrder(param: object, callBack) { + this.http.get(environment.baseUrl + 'fleetOilCard/exportCardOrder' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 设置联系人 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public setContact(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCard/setContact', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 禁用 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public disabled(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCard/disabled', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 启用 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public enable(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCard/enable', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 导出油卡 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public exportCard(param: object, callBack) { + this.http.post(environment.baseUrl + 'fleetOilCard/exportCard', param).subscribe(data => { + callBack(data); + }); + } + +} diff --git a/src/app/services/msg.service.ts b/src/app/services/msg.service.ts index d9a59aa..2168ccb 100644 --- a/src/app/services/msg.service.ts +++ b/src/app/services/msg.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {CommonsService} from './commons.service'; import {environment} from '../../environments/environment'; +import {HttpClient} from '@angular/common/http'; @Injectable({ providedIn: 'root' From c42cdcfeec5c04a1f92e24a9df3801ca234a91be Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Wed, 28 Dec 2022 13:47:10 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activate-edit.component.html | 4 +- .../api-merchants/list/list.component.html | 46 +++++-- .../api-merchants/list/list.component.ts | 125 ++++++++++++++++-- .../api-order/api-order-routing.module.ts | 15 +++ src/app/admin/api-order/api-order.module.ts | 37 ++++++ .../phone-order/phone-order.component.html | 1 + .../phone-order/phone-order.component.scss | 0 .../phone-order/phone-order.component.spec.ts | 25 ++++ .../phone-order/phone-order.component.ts | 15 +++ .../api-product/list/list.component.html | 1 + .../coupon-edit/coupon-edit.component.html | 10 +- .../coupon-edit/coupon-edit.component.ts | 1 + .../discount-edit.component.html | 4 +- .../api-merchant/api-merchant.component.html | 39 ++++++ .../api-merchant/api-merchant.component.scss | 25 ++++ .../api-merchant/api-merchant.component.ts | 34 +++++ src/app/admin/index/index.module.ts | 3 +- .../admin/index/index/index.component.html | 12 +- .../order-statistics.component.html | 15 +++ .../order-statistics.component.scss | 0 .../order-statistics.component.ts | 48 +++++++ .../order-list/order-list.component.html | 27 +++- .../order/order-list/order-list.component.ts | 32 ++++- src/app/app-common.module.ts | 7 +- src/app/app-routing.module.ts | 5 + src/app/pipes/index.ts | 1 + src/app/pipes/index/product-config.pipe.ts | 23 ++++ src/app/pipes/msg/msg-type.pipe.ts | 11 -- src/app/services/api-merchants.service.ts | 59 ++++++++- src/environments/environment.ts | 8 +- src/styles.scss | 9 ++ 31 files changed, 574 insertions(+), 68 deletions(-) create mode 100644 src/app/admin/api-order/api-order-routing.module.ts create mode 100644 src/app/admin/api-order/api-order.module.ts create mode 100644 src/app/admin/api-order/phone-order/phone-order.component.html create mode 100644 src/app/admin/api-order/phone-order/phone-order.component.scss create mode 100644 src/app/admin/api-order/phone-order/phone-order.component.spec.ts create mode 100644 src/app/admin/api-order/phone-order/phone-order.component.ts create mode 100644 src/app/admin/index/api-merchant/api-merchant.component.html create mode 100644 src/app/admin/index/api-merchant/api-merchant.component.scss create mode 100644 src/app/admin/index/api-merchant/api-merchant.component.ts create mode 100644 src/app/admin/index/order-statistics/order-statistics.component.html create mode 100644 src/app/admin/index/order-statistics/order-statistics.component.scss create mode 100644 src/app/admin/index/order-statistics/order-statistics.component.ts create mode 100644 src/app/pipes/index/product-config.pipe.ts diff --git a/src/app/admin/activate/activate-edit/activate-edit.component.html b/src/app/admin/activate/activate-edit/activate-edit.component.html index 0cb7436..3451483 100644 --- a/src/app/admin/activate/activate-edit/activate-edit.component.html +++ b/src/app/admin/activate/activate-edit/activate-edit.component.html @@ -69,7 +69,7 @@
- 共计 {{11}} 条数据 + 共计 {{listOfData.length}} 条数据
@@ -120,7 +120,7 @@ 奖励数量 - + diff --git a/src/app/admin/api-merchants/list/list.component.html b/src/app/admin/api-merchants/list/list.component.html index 9821570..07489a6 100644 --- a/src/app/admin/api-merchants/list/list.component.html +++ b/src/app/admin/api-merchants/list/list.component.html @@ -66,6 +66,7 @@ - 编号 - 商户名称 + 编号 + 商户名称 联系人 - 电话 - 商户号 - 商户KEY - 操作人员 + 电话 + 商户号 + 商户KEY + 操作人员 创建时间 帐户余额 - 状态 + 状态 操作 @@ -100,7 +101,7 @@ {{data.mchId }} {{data.apiKey }} {{data.operatorName }} - {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} + {{data.createTime | date: 'yyyy-MM-dd'}} ¥{{data.amounts}} {{data.status== 100? '正常':'禁用'}} @@ -109,8 +110,10 @@ 更多操作 @@ -137,7 +140,7 @@ 商户电话 - + @@ -178,7 +181,7 @@ - + 类型 @@ -244,7 +247,7 @@ - + 编号 @@ -293,3 +296,22 @@ + + + + + IP地址 + + + + + + + + + + + + + + diff --git a/src/app/admin/api-merchants/list/list.component.ts b/src/app/admin/api-merchants/list/list.component.ts index c484ffb..d758b2b 100644 --- a/src/app/admin/api-merchants/list/list.component.ts +++ b/src/app/admin/api-merchants/list/list.component.ts @@ -8,7 +8,8 @@ import {ApiProductService} from '../../../services/api-product.service'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {NzMessageService} from 'ng-zorro-antd'; import {Router} from '@angular/router'; - +import {HttpClient} from '@angular/common/http'; +import { map, filter, scan , take } from 'rxjs/operators'; @Component({ selector: 'app-list', @@ -36,9 +37,9 @@ export class ListComponent implements OnInit { id: number; edit = false; payPrice; - isVisibleGoods = false; + isVisibleIpAddress = false; realPrice = 0; - + mchId: string; rechargeModal = false; rechargeForm: FormGroup; configValidateForm: FormGroup; @@ -55,6 +56,10 @@ export class ListComponent implements OnInit { productArray = []; productConfigArray = []; discount; + ipAddress: string; + isSpinning = false; + isVisibleConfig = false; + checkOptions = []; formatterPercent = (value: number): string => `${value == null ? 0 : value} %`; parserPercent = (value: string): string => value.replace(' %', ''); @@ -65,6 +70,7 @@ export class ListComponent implements OnInit { private coupon: CouponService, private iconService: IconService, private message: NzMessageService, + private http: HttpClient, private router: Router, private common: CommonsService ) { @@ -85,6 +91,14 @@ export class ListComponent implements OnInit { this.common.getDictionary('RECHARGE_PLATFORM ', data => { this.platformArray = data['return_data']; }); + // 获取可用接口数据 + this.common.getDictionary('API_PRODUCT_CONFIG ', data => { + for (const i of data['return_data']) { + this.checkOptions.push({ + label: i['codeName'], value: i['codeValue'] + }); + } + }); } public init(): void { @@ -99,32 +113,41 @@ export class ListComponent implements OnInit { phone: [null], status: [null], }); - this.validateForm = this.form.group({ - merchantName: [null, [Validators.required]], - userName: [null, [Validators.required]], - phone: [null, [Validators.required]], - }); + this.initApiMerchantsPostFrom(false); this.configValidateForm = this.form.group({ productIds: [null, [Validators.required]], discount: [null, [Validators.required]], }); this.getRequest(true, this.searchForm.value); - this.apiMerchants.getListApiMerchantByAll(data => { + this.apiProduct.getAvailableApiProductByList(data => { if (data['return_code'] === '000000') { - this.merchantArray = data['return_data']; + this.productArray = data['return_data']; } else { this.message.error(data['return_msg']); } }); - this.apiProduct.getAvailableApiProductByList(data => { + + } + + // 出现可用商户列表 + public getListApiMerchantByAll(): void { + this.apiMerchants.getListApiMerchantByAll(data => { if (data['return_code'] === '000000') { - this.productArray = data['return_data']; + this.merchantArray = data['return_data']; } else { this.message.error(data['return_msg']); } }); + } + // 初始化商户提交报表 + public initApiMerchantsPostFrom(edit: boolean): void { + this.validateForm = this.form.group({ + merchantName: [null, [Validators.required]], + userName: [null, [Validators.required]], + phone: [{ value: null , disabled: edit}, [Validators.required]], + }); } // 查询列表 @@ -156,11 +179,13 @@ export class ListComponent implements OnInit { if (id != null) { this.id = id; this.edit = true; + this.initApiMerchantsPostFrom(true); this.apiMerchants.findById(id, data => { this.validateForm.patchValue(data['return_data']); this.isVisible = true; }); } else { + this.initApiMerchantsPostFrom(false); this.validateForm.reset(); this.isVisible = true; this.edit = false; @@ -284,6 +309,7 @@ export class ListComponent implements OnInit { * 展示充值模态框 */ showRechargeModal() { + this.getListApiMerchantByAll(); this.rechargeModal = true; } @@ -468,4 +494,79 @@ export class ListComponent implements OnInit { this.configValidateForm.reset(); } + + // 打开配置ip地址 + public configIp(mchId: string): void { + this.mchId = mchId; + this.apiMerchants.findByMchId( mchId , data => { + if (data['return_code'] === '000000') { + this.ipAddress = data['return_data']['ipAddress']; + } + }); + this.isVisibleIpAddress = true; + } + + // 提交配置 + public handleOkConfigIp(): void { + this.isSpinning = true; + this.apiMerchants.editApiIpAddress({ + mchId: this.mchId, + ipAddress: this.ipAddress + } , data => { + if (data['return_code'] === '000000') { + this.isSpinning = false; + this.message.success('配置成功'); + this.isVisibleIpAddress = false; + } else { + this.message.error(data['return_msg']); + } + }); + } + + // 打开配置产品弹框 + public configApiProduct(mchId: string): void { + this.mchId = mchId; + this.apiMerchants.getSecConfigList(mchId , data => { + console.log(data); + const returnData = data['return_data']; + if (data['return_data'].length > 0) { + for (const i of this.checkOptions) { + if (returnData.filter(item => item['codeType'] === i['value']).length > 0) { + i['checked'] = true; + } else { + i['checked'] = false; + } + } + } + this.isVisibleConfig = true; + }); + + + } + + // 配置产品 + public handleOkConfigProduct(): void { + const data = []; + for (const i of this.checkOptions) { + if (i['checked']) { + data.push(i['value']); + } + } + console.log(data); + const postData = { + mchId: this.mchId, + configProduct: data.join(',') + }; + this.isSpinning = true; + this.apiMerchants.configMerchant(postData , res => { + if (res['return_code'] === '000000') { + this.isSpinning = false; + this.message.success('配置成功'); + this.isVisibleConfig = false; + } else { + this.message.error(res['return_msg']); + } + }); + } + } diff --git a/src/app/admin/api-order/api-order-routing.module.ts b/src/app/admin/api-order/api-order-routing.module.ts new file mode 100644 index 0000000..4f5c778 --- /dev/null +++ b/src/app/admin/api-order/api-order-routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {PhoneOrderComponent} from './phone-order/phone-order.component'; + + + +const routes: Routes = [ + { path: 'phone-order', component: PhoneOrderComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class ApiOrderRoutingModule { } diff --git a/src/app/admin/api-order/api-order.module.ts b/src/app/admin/api-order/api-order.module.ts new file mode 100644 index 0000000..8b63015 --- /dev/null +++ b/src/app/admin/api-order/api-order.module.ts @@ -0,0 +1,37 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { PhoneOrderComponent } from './phone-order/phone-order.component'; +import {SystemRoutingModule} from '../system/system-routing.module'; +import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; +import {NgxNeditorModule} from '_@notadd_ngx-neditor@1.0.2@@notadd/ngx-neditor'; +import {RichtextModule} from '../../common/richtext/richtext.module'; +import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; +import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts'; +import {IndexRoutingModule} from '../index/index-routing.module'; +import {AppCommonModule} from '../../app-common.module'; +import {NzSpaceModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd/space'; +import {ApiOrderRoutingModule} from './api-order-routing.module'; + + + +@NgModule({ + declarations: [PhoneOrderComponent], + imports: [ + CommonModule, + ApiOrderRoutingModule, + NgZorroAntdModule, + FormsModule, + ReactiveFormsModule, + NgxNeditorModule, + RichtextModule, + BreadcrumbModule, + RegionSelectorModule, + NgxEchartsModule, + IndexRoutingModule, + AppCommonModule, + NzSpaceModule + ] +}) +export class ApiOrderModule { } diff --git a/src/app/admin/api-order/phone-order/phone-order.component.html b/src/app/admin/api-order/phone-order/phone-order.component.html new file mode 100644 index 0000000..43a7f6a --- /dev/null +++ b/src/app/admin/api-order/phone-order/phone-order.component.html @@ -0,0 +1 @@ +

phone-order works!

diff --git a/src/app/admin/api-order/phone-order/phone-order.component.scss b/src/app/admin/api-order/phone-order/phone-order.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/api-order/phone-order/phone-order.component.spec.ts b/src/app/admin/api-order/phone-order/phone-order.component.spec.ts new file mode 100644 index 0000000..493b5fd --- /dev/null +++ b/src/app/admin/api-order/phone-order/phone-order.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PhoneOrderComponent } from './phone-order.component'; + +describe('PhoneOrderComponent', () => { + let component: PhoneOrderComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PhoneOrderComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PhoneOrderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/api-order/phone-order/phone-order.component.ts b/src/app/admin/api-order/phone-order/phone-order.component.ts new file mode 100644 index 0000000..a959e3f --- /dev/null +++ b/src/app/admin/api-order/phone-order/phone-order.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-phone-order', + templateUrl: './phone-order.component.html', + styleUrls: ['./phone-order.component.scss'] +}) +export class PhoneOrderComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/admin/api-product/list/list.component.html b/src/app/admin/api-product/list/list.component.html index 7baf522..1664d23 100644 --- a/src/app/admin/api-product/list/list.component.html +++ b/src/app/admin/api-product/list/list.component.html @@ -75,6 +75,7 @@ class="table" #ajaxTable nzShowSizeChanger + nzBordered [nzFrontPagination]="false" [nzData]="requestData" [nzLoading]="loading" 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 d373000..00ab5e0 100644 --- a/src/app/admin/coupon/coupon-edit/coupon-edit.component.html +++ b/src/app/admin/coupon/coupon-edit/coupon-edit.component.html @@ -155,10 +155,18 @@
+
+ + 是否邮递实物 + + + + +
- 是否预约产品 + 是否预约产品 diff --git a/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts b/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts index 89ca8f4..42612e2 100644 --- a/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts +++ b/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts @@ -87,6 +87,7 @@ export class CouponEditComponent implements OnInit { isPresent: [false], reserveStatus: [false], buyPoints: [false], + wherePost: [false], payType: [null, [Validators.required]], displayArea: [null], couponSource: [null], diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.html b/src/app/admin/discount/discount-edit/discount-edit.component.html index 46dd779..6fec6ac 100644 --- a/src/app/admin/discount/discount-edit/discount-edit.component.html +++ b/src/app/admin/discount/discount-edit/discount-edit.component.html @@ -45,8 +45,8 @@
优惠券使用归属 - - + + diff --git a/src/app/admin/index/api-merchant/api-merchant.component.html b/src/app/admin/index/api-merchant/api-merchant.component.html new file mode 100644 index 0000000..13b1859 --- /dev/null +++ b/src/app/admin/index/api-merchant/api-merchant.component.html @@ -0,0 +1,39 @@ +
+
+

账户信息

+
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+

接口信息

+
+
+
+

商户号(mchId):{{apiMerchants['mchId']}}

+

密钥(apiKey):{{apiMerchants['apiKey']}}

+

IP白名单:{{apiMerchants['ext1']}}

+
+
+
+
+
+

已开通产品

+
+
+
+
{{item['codeType'] | productConfig}}
+
+
+
diff --git a/src/app/admin/index/api-merchant/api-merchant.component.scss b/src/app/admin/index/api-merchant/api-merchant.component.scss new file mode 100644 index 0000000..2b3e6a6 --- /dev/null +++ b/src/app/admin/index/api-merchant/api-merchant.component.scss @@ -0,0 +1,25 @@ +.content { + background: #fff; + margin-bottom: 20px; + margin-top: 20px; +} +.top-title { + padding: 16px; + border-bottom: 1px solid #e8e8e8 +} +.content-data { + padding: 24px; + .title { + color: rgba(0, 0, 0, 0.45); + font-size: 14px; + } +} +.product { + text-align: center; + font-size: 18px; + padding: 20px; + border: 1px solid #e8e8e8; +} +.product:hover { + box-shadow: #e8e8e8 0 0 4px 2px; +} diff --git a/src/app/admin/index/api-merchant/api-merchant.component.ts b/src/app/admin/index/api-merchant/api-merchant.component.ts new file mode 100644 index 0000000..bcdc9bc --- /dev/null +++ b/src/app/admin/index/api-merchant/api-merchant.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from '@angular/core'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {CommonsService} from "../../../services/commons.service"; +import {ApiMerchantsService} from "../../../services/api-merchants.service"; + +@Component({ + selector: 'app-api-merchant', + templateUrl: './api-merchant.component.html', + styleUrls: ['./api-merchant.component.scss'] +}) +export class ApiMerchantComponent implements OnInit { + + // API商户信息 + apiMerchants; + productConfig; + + constructor( + private store: LocalStorageService, // 数据缓存 + private apiMerchantService: ApiMerchantsService, + private common: CommonsService + ) { } + + ngOnInit(): void { + this.apiMerchants = this.store.get(ADMIN_INFO_OBJECT)['apiMerchants']; + + this.apiMerchantService.getSecConfigList(this.apiMerchants['mchId'] , data => { + if (data['return_code'] === '000000') { + this.productConfig = data['return_data']; + } + }); + } + +} diff --git a/src/app/admin/index/index.module.ts b/src/app/admin/index/index.module.ts index dcb69aa..0111e0a 100644 --- a/src/app/admin/index/index.module.ts +++ b/src/app/admin/index/index.module.ts @@ -14,11 +14,12 @@ import {RegionSelectorModule} from '../../common/region-selector/region-selector import {AppCommonModule} from '../../app-common.module'; import { TestComponent } from './test/test.component'; import {NzSpaceModule} from 'ng-zorro-antd/space'; +import { ApiMerchantComponent } from './api-merchant/api-merchant.component'; @NgModule({ - declarations: [IndexComponent, TestComponent], + declarations: [IndexComponent, TestComponent, ApiMerchantComponent], imports: [ CommonModule, SystemRoutingModule, diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html index 5d24a5d..b52c1c9 100644 --- a/src/app/admin/index/index/index.component.html +++ b/src/app/admin/index/index/index.component.html @@ -1,9 +1,9 @@ - - - 首页 - - + + + + + @@ -166,6 +166,8 @@
+ + diff --git a/src/app/admin/index/order-statistics/order-statistics.component.html b/src/app/admin/index/order-statistics/order-statistics.component.html new file mode 100644 index 0000000..2d36490 --- /dev/null +++ b/src/app/admin/index/order-statistics/order-statistics.component.html @@ -0,0 +1,15 @@ + + + + 订单统计汇总 + + + + + +
+
+
+
+ +
diff --git a/src/app/admin/index/order-statistics/order-statistics.component.scss b/src/app/admin/index/order-statistics/order-statistics.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/index/order-statistics/order-statistics.component.ts b/src/app/admin/index/order-statistics/order-statistics.component.ts new file mode 100644 index 0000000..f8ed86d --- /dev/null +++ b/src/app/admin/index/order-statistics/order-statistics.component.ts @@ -0,0 +1,48 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-order-statistics', + templateUrl: './order-statistics.component.html', + styleUrls: ['./order-statistics.component.scss'] +}) +export class OrderStatisticsComponent implements OnInit { + + // 根据年月日查询总交易金额 + orderStatisticsByYMDData: any; + + constructor() { } + + ngOnInit(): void { + this.orderStatisticsByYMD(3); + } + + public orderStatisticsByYMD(dateType: number): void { + this.orderStatisticsByYMDData = { + xAxis: { + type: 'category', + + data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + }, + yAxis: { + type: 'value' + }, + series: [ + { + data: [120, 200, 150, 80, 70, 110, 130], + label: { + show: true, + color: 'black', + position: 'top' + }, + type: 'bar', + showBackground: true, + color: '#1890ff', + backgroundStyle: { + color: 'rgba(180, 180, 180, 0.2)' + } + } + ] + }; + } + +} diff --git a/src/app/admin/order/order-list/order-list.component.html b/src/app/admin/order/order-list/order-list.component.html index dbdee41..dd79c40 100644 --- a/src/app/admin/order/order-list/order-list.component.html +++ b/src/app/admin/order/order-list/order-list.component.html @@ -147,7 +147,7 @@ 支付时间 取消时间 状态 - + 操作 @@ -167,10 +167,10 @@ {{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.cancelTime | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.orderStatus}} - - - - + + 订单详情 + +
@@ -185,3 +185,20 @@ + + + {{orderDetail['highChildOrderList'][0]['goodsName']}} + {{orderDetail['payType'] | paytype}} + {{orderDetail['payPrice']}} + {{orderDetail['memName']}} + {{orderDetail['memPhone']}} + {{orderDetail['orderNo']}} + {{orderDetail['createTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} + {{orderDetail['payTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} + {{orderDetail['orderStatus'] | orderCouponStatus}} + {{postData['address']}} + {{postData['user']}} + {{postData['phone']}} + + + diff --git a/src/app/admin/order/order-list/order-list.component.ts b/src/app/admin/order/order-list/order-list.component.ts index f118787..1938d9e 100644 --- a/src/app/admin/order/order-list/order-list.component.ts +++ b/src/app/admin/order/order-list/order-list.component.ts @@ -8,8 +8,8 @@ import {Router} from '@angular/router'; import {CommonsService} from '../../../services/commons.service'; import {OrderService} from '../../../services/order.service'; import {CompanyService} from '../../../services/company.service'; -import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; -import {LocalStorageService} from "../../../services/local-storage.service"; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {LocalStorageService} from '../../../services/local-storage.service'; @Component({ selector: 'app-order-list', @@ -31,7 +31,16 @@ export class OrderListComponent implements OnInit { id: number; // 订单ID isVisible = false; refundContent: string; + isVisibleDetail = false; roleType: number; + orderDetail: any = { + highChildOrderList: [{ + goodsName: '' + }] + }; + postData: any = { + address: '', + }; constructor( private form: FormBuilder, private order: OrderService, @@ -130,11 +139,20 @@ export class OrderListComponent implements OnInit { // 查看详情 public getDetail(id: number): void { - this.router.navigate(['/admin/order/order-detail'], { - queryParams: { - merchantId: id - } - }).then(r => console.log(r)); + this.isVisibleDetail = true; + this.order.getOrderById(id , data => { + if (data['return_code'] === '000000') { + console.log(data); + this.orderDetail = data['return_data']; + if (this.orderDetail['remarks'] != null) { + this.postData = JSON.parse(this.orderDetail['remarks']); + console.log(this.postData['address']); + + } + } else { + this.message.error(data['return_msg']); + } + }); } // 下载模板 diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index b1b7043..cdfe23e 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -48,14 +48,12 @@ import { GasStaffStatusPipe, PayStatusPipe, ChlidRechargeStatusPipe, - SourceTypePipe, GasClassGroupTaskStatusPipe, GasOrderStatusPipe + SourceTypePipe, GasClassGroupTaskStatusPipe, GasOrderStatusPipe, PlatformPipe, ProductConfigPipe, OilCardStatusPipe } from './pipes'; -import {OilCardStatusPipe} from './pipes'; import {OilTypePipe} from './pipes/store/oil-type.pipe'; import {OilPriceTaskStatusPipe} from './pipes/gas-oil-price/oil-price-task-status.pipe'; import {OilPriceTaskExecutionTypePipe} from './pipes/gas-oil-price/oil-price-task-execution-type.pipe'; import {OilPriceTaskPriceTypePipe} from './pipes/gas-oil-price/oil-price-task-price-type.pipe'; -import { PlatformPipe } from './pipes/recharge-pipe/platform.pipe'; import { IntegralTypePipe } from './pipes/integral/integral-type.pipe'; import { IntegralProductPipe } from './pipes/integral/integral-product.pipe'; import { MsgTypePipe } from './pipes/msg/msg-type.pipe'; @@ -112,6 +110,7 @@ const PIPES = [ IntegralTypePipe, IntegralProductPipe, MsgTypePipe, + ProductConfigPipe ]; @@ -124,7 +123,7 @@ const PIPES = [ NgxNeditorModule ], declarations: [ - ...PIPES + ...PIPES, ], exports: [ diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3877c1f..e725a6f 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -157,6 +157,11 @@ const routes: Routes = [ loadChildren: () => import('./admin/promotion/promotion.module').then(m => m.PromotionModule), canActivate: [InitGuardService] }, + { + path: 'api-order', + loadChildren: () => import('./admin/api-order/api-order.module').then(m => m.ApiOrderModule), + canActivate: [InitGuardService] + }, ], }, ]; diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index 5956d41..beea301 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -41,3 +41,4 @@ export * from './apiMerchant/source-type.pipe'; export * from './gas-class-group-task/gas-class-group-task-status.pipe'; export * from './gas-order/gas-order-status.pipe'; export * from './recharge-pipe/platform.pipe'; +export * from './index/product-config.pipe'; diff --git a/src/app/pipes/index/product-config.pipe.ts b/src/app/pipes/index/product-config.pipe.ts new file mode 100644 index 0000000..51d4f7a --- /dev/null +++ b/src/app/pipes/index/product-config.pipe.ts @@ -0,0 +1,23 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'productConfig' +}) +export class ProductConfigPipe implements PipeTransform { + + transform(value: string): string { + switch (value) { + case 'CQ_SHELL': + return '重庆壳牌接口'; + case 'KFC_CONFIG': + return '肯德基接口'; + case 'MEMBER_RECHARGE_CONFIG': + return '会员充值接口'; + case 'PHONE_CONFIG': + return '话费接口'; + case 'STARBUCKS_CONFIG': + return '星巴克接口'; + } + } + +} diff --git a/src/app/pipes/msg/msg-type.pipe.ts b/src/app/pipes/msg/msg-type.pipe.ts index 60156f9..a1e7b92 100644 --- a/src/app/pipes/msg/msg-type.pipe.ts +++ b/src/app/pipes/msg/msg-type.pipe.ts @@ -15,16 +15,5 @@ export class MsgTypePipe implements PipeTransform { return this.array[product][type - 1]; } - // transform(object: string , objectName: string): string { - // - // console.log(object); - // - // const o = JSON.parse(object); - // if (typeof o == 'object') { - // return o[objectName]; - // } - // return null; - // } - } diff --git a/src/app/services/api-merchants.service.ts b/src/app/services/api-merchants.service.ts index 90058db..d276fa6 100644 --- a/src/app/services/api-merchants.service.ts +++ b/src/app/services/api-merchants.service.ts @@ -1,7 +1,9 @@ import { Injectable } from '@angular/core'; import {CommonsService} from './commons.service'; -import {environment} from "../../environments/environment"; +import {environment} from '../../environments/environment'; import {HttpClient} from '@angular/common/http'; +import {take} from "rxjs/operators"; + @Injectable({ providedIn: 'root' @@ -122,7 +124,7 @@ export class ApiMerchantsService { * @methodName configApiProduct * @Description // 提交配置产品 * @Date 18:00 2022/6/8 - * @Param + * @Param configApiProduct */ public configApiProduct(params: object, callBack) { this.http.post(environment.baseUrl + 'apiProduct/configApiProduct', params).subscribe(data => { @@ -167,4 +169,57 @@ export class ApiMerchantsService { callBack(data); }); } + + /** + * @Author Sum1Dream + * @methodName editApiIpAddress + * @Description //编辑ip地址 + * @Date 09:25 2022/12/7 + * @Param params: object, callBack + */ + public editApiIpAddress(params: object, callBack) { + this.http.post(environment.baseUrl + 'apiIpAddress/editApiIpAddress', params).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName findByMchId + * @Description // 根据商户号查询详情 + * @Date 11:18 2022/12/7 + * @Param mchId: number, callBack + */ + public findByMchId(mchId: string, callBack) { + this.http.get(environment.baseUrl + 'apiIpAddress/findByMchId?mchId=' + mchId).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName getSecConfigList + * @Description // 查询配置内容 + * @Date 16:43 2022/12/7 + * @Param mchId: string, callBack + */ + public getSecConfigList(mchId: string, callBack) { + this.http.get(environment.baseUrl + 'apiIpAddress/getSecConfigList?mchId=' + mchId).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName configMerchant + * @Description // 配置商户可用接口 + * @Date 16:44 2022/12/7 + * @Param params: object, callBack + */ + public configMerchant(params: object, callBack) { + this.http.post(environment.baseUrl + 'apiIpAddress/configMerchant', params).subscribe(data => { + callBack(data); + }); + } + } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index cc5edd5..21ad46f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,10 +4,10 @@ export const environment = { production: false, - baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'http://localhost:9302/filesystem/', - // baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - // imageUrl: 'https://hsg.dctpay.com/filesystem/', + // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) + // imageUrl: 'http://localhost:9302/filesystem/', + baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + 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=', }; diff --git a/src/styles.scss b/src/styles.scss index b45d7aa..d64eb98 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -13,12 +13,21 @@ .fr { float: right; } +.ml { + margin-left: 20px; +} +.box-shadow:hover { + box-shadow: #e8e8e8 0 0 4px 2px; +} .cp { cursor: pointer; } .br { border-right: solid 1px #e8e8ed; } +.mt { + margin-top: 8px; +} .inner-content { padding: 24px; background: #fff; From 50b7e4a97ed992ce731d2acfcd841bcbf0f8d048 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 3 Jan 2023 09:41:57 +0800 Subject: [PATCH 4/6] 1 --- .../admin/merchant-store/store-edit/store-edit.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.html b/src/app/admin/merchant-store/store-edit/store-edit.component.html index ca9b096..a12b00e 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.html +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.html @@ -52,7 +52,6 @@ - From 775e6c616f3bb3dbe561939efaf8e5d53a9068f6 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 5 Jan 2023 14:38:58 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=95=86=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api-order/api-order-routing.module.ts | 10 +- src/app/admin/api-order/api-order.module.ts | 5 +- .../phone-order/phone-order.component.html | 160 +++++++++++++++++- .../phone-order/phone-order.component.scss | 5 + .../phone-order/phone-order.component.spec.ts | 25 --- .../phone-order/phone-order.component.ts | 87 +++++++++- .../order-list/order-list.component.ts | 5 +- src/app/app-common.module.ts | 17 +- src/app/pipes/index.ts | 2 + src/app/services/api-merchants.service.ts | 12 ++ src/app/services/index.service.ts | 3 - src/app/services/recharge.service.ts | 12 ++ src/environments/environment.ts | 8 +- 13 files changed, 303 insertions(+), 48 deletions(-) delete mode 100644 src/app/admin/api-order/phone-order/phone-order.component.spec.ts diff --git a/src/app/admin/api-order/api-order-routing.module.ts b/src/app/admin/api-order/api-order-routing.module.ts index 4f5c778..379f183 100644 --- a/src/app/admin/api-order/api-order-routing.module.ts +++ b/src/app/admin/api-order/api-order-routing.module.ts @@ -1,11 +1,15 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import {PhoneOrderComponent} from './phone-order/phone-order.component'; - - +import {VipTopUpOrderComponent} from './vip-top-up-order/vip-top-up-order.component'; +import {KfcOrderComponent} from './kfc-order/kfc-order.component'; +import {ListComponent} from './starbucks-order/list/list.component'; const routes: Routes = [ - { path: 'phone-order', component: PhoneOrderComponent } + { path: 'phone-order', component: PhoneOrderComponent }, + { path: 'vip-top-up-order', component: VipTopUpOrderComponent }, + { path: 'kfc-order', component: KfcOrderComponent }, + { path: 'starbuck-order', component: ListComponent } ]; @NgModule({ diff --git a/src/app/admin/api-order/api-order.module.ts b/src/app/admin/api-order/api-order.module.ts index 8b63015..176403a 100644 --- a/src/app/admin/api-order/api-order.module.ts +++ b/src/app/admin/api-order/api-order.module.ts @@ -13,11 +13,14 @@ import {IndexRoutingModule} from '../index/index-routing.module'; import {AppCommonModule} from '../../app-common.module'; import {NzSpaceModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd/space'; import {ApiOrderRoutingModule} from './api-order-routing.module'; +import { ListComponent } from './starbucks-order/list/list.component'; +import { KfcOrderComponent } from './kfc-order/kfc-order.component'; +import { VipTopUpOrderComponent } from './vip-top-up-order/vip-top-up-order.component'; @NgModule({ - declarations: [PhoneOrderComponent], + declarations: [PhoneOrderComponent, ListComponent, KfcOrderComponent, VipTopUpOrderComponent], imports: [ CommonModule, ApiOrderRoutingModule, diff --git a/src/app/admin/api-order/phone-order/phone-order.component.html b/src/app/admin/api-order/phone-order/phone-order.component.html index 43a7f6a..0637e86 100644 --- a/src/app/admin/api-order/phone-order/phone-order.component.html +++ b/src/app/admin/api-order/phone-order/phone-order.component.html @@ -1 +1,159 @@ -

phone-order works!

+ + + + + +
+
+
+
+ + 充值号码 + + + + +
+
+ + 平台订单号 + + + + +
+
+ + 第三方订单号 + + + + +
+
+ + 运营商 + + + + +
+
+ + 支付状态 + + + + + + + + + + +
+
+ + 充值状态 + + + + + + + + + +
+
+ + 回调状态 + + + + + + + + + +
+
+ + 支付时间 + + + + +
+
+ + 创建时间 + + + + +
+
+
+
+ + +
+
+
+
+ +
+ 共计 {{total}} 条数据 + + + + 编号 + 平台订单号 + 第三方订单号 + 运营商 + 充值号码 + 充值金额 + 下单金额 + 生成时间 + 支付时间 + 支付方式 + 充值状态 + 支付状态 + + + + + {{i + 1}} + {{data.orderNo}} + {{data.sourceOrderNo}} + {{data.operators}} + {{data.rechargeNumber}} + ¥{{data.rechargePrice}} + ¥{{data.payPrice}} + {{data.createTimed | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.callbackStatus | callbackStatus}} + {{data.rechargeStatus | rechargeStatus}} + {{data.payStatus | payStatus}} + + +
diff --git a/src/app/admin/api-order/phone-order/phone-order.component.scss b/src/app/admin/api-order/phone-order/phone-order.component.scss index e69de29..b68da73 100644 --- a/src/app/admin/api-order/phone-order/phone-order.component.scss +++ b/src/app/admin/api-order/phone-order/phone-order.component.scss @@ -0,0 +1,5 @@ +.table-td-operation { + a { + margin-left: 8px; + } +} diff --git a/src/app/admin/api-order/phone-order/phone-order.component.spec.ts b/src/app/admin/api-order/phone-order/phone-order.component.spec.ts deleted file mode 100644 index 493b5fd..0000000 --- a/src/app/admin/api-order/phone-order/phone-order.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PhoneOrderComponent } from './phone-order.component'; - -describe('PhoneOrderComponent', () => { - let component: PhoneOrderComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PhoneOrderComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PhoneOrderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/admin/api-order/phone-order/phone-order.component.ts b/src/app/admin/api-order/phone-order/phone-order.component.ts index a959e3f..88249e3 100644 --- a/src/app/admin/api-order/phone-order/phone-order.component.ts +++ b/src/app/admin/api-order/phone-order/phone-order.component.ts @@ -1,4 +1,11 @@ import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; +import {RechargeService} from '../../../services/recharge.service'; +import {DiscountService} from '../../../services/discount.service'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {CouponService} from '../../../services/coupon.service'; +import {IconService} from '../../../services/icon.service'; @Component({ selector: 'app-phone-order', @@ -7,9 +14,83 @@ import { Component, OnInit } from '@angular/core'; }) export class PhoneOrderComponent implements OnInit { - constructor() { } + FILE_URL = environment.imageUrl; + WEB_SERVE_URL = environment.baseUrl; + searchForm: FormGroup; // 搜索框 + validateForm: FormGroup; // 添加框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + isVisible = false; + constructor( + private form: FormBuilder, + private recharge: RechargeService, + private discount: DiscountService, + private modal: NzModalService, + private coupon: CouponService, + private iconService: IconService, + private message: NzMessageService, + + ) { + } + + ngOnInit(): void { + this.init(); + + } + + + public init(): void { + this.searchForm = this.form.group({ + rechargeNumber: [null], // 充值号码 + orderNo: [null], // 订单号 + sourceOrderNo: [null], // 第三方订单号 + operators: [null], // 运营商 + payStatus: [null], // 支付状态 + rechargeStatus: [null], // 充值状态 + callbackStatus: [null], // 回调状态 + payTime: [null], // 支付时间 + createTime: [null], // 创建时间 + }); + + this.getRequest(true, this.searchForm.value); + } + + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { + if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { + whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); + whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); + } + + if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { + whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); + whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); + } + this.loading = false; + if (reset) { + this.pageNum = 1; + } + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + this.recharge.getApiRechargePhoneByList(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(); + } + + - ngOnInit(): void { - } } diff --git a/src/app/admin/recharge-order/order-list/order-list.component.ts b/src/app/admin/recharge-order/order-list/order-list.component.ts index c0dbef2..5d098b5 100644 --- a/src/app/admin/recharge-order/order-list/order-list.component.ts +++ b/src/app/admin/recharge-order/order-list/order-list.component.ts @@ -5,14 +5,11 @@ import {DiscountService} from '../../../services/discount.service'; import {CouponService} from '../../../services/coupon.service'; import {IconService} from '../../../services/icon.service'; -import {CommonsService} from '../../../services/commons.service'; import {RechargeService} from '../../../services/recharge.service'; -import {NzMessageService, NzModalService, NzNotificationService, NzUploadChangeParam} from 'ng-zorro-antd'; +import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; -import {Router} from '@angular/router'; import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; import {CompanyService} from "../../../services/company.service"; -import {MerchantService} from "../../../services/merchant.service"; import {LocalStorageService} from "../../../services/local-storage.service"; @Component({ diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index cdfe23e..5fecb5a 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -46,9 +46,14 @@ import { RechargePlatformPipe, PriceStatusPipe, GasStaffStatusPipe, - PayStatusPipe, ChlidRechargeStatusPipe, - SourceTypePipe, GasClassGroupTaskStatusPipe, GasOrderStatusPipe, PlatformPipe, ProductConfigPipe, OilCardStatusPipe + SourceTypePipe, + GasClassGroupTaskStatusPipe, + GasOrderStatusPipe, + PlatformPipe, + ProductConfigPipe, + OilCardStatusPipe, + PayStatusPipe, CallbackStatusPipe, PayCouponStatusPipe } from './pipes'; import {OilTypePipe} from './pipes/store/oil-type.pipe'; import {OilPriceTaskStatusPipe} from './pipes/gas-oil-price/oil-price-task-status.pipe'; @@ -58,6 +63,7 @@ import { IntegralTypePipe } from './pipes/integral/integral-type.pipe'; import { IntegralProductPipe } from './pipes/integral/integral-product.pipe'; import { MsgTypePipe } from './pipes/msg/msg-type.pipe'; + const PIPES = [ TimesPipe, TextareaPipe, @@ -101,7 +107,6 @@ const PIPES = [ OilPriceTaskStatusPipe, OilPriceTaskExecutionTypePipe, OilPriceTaskPriceTypePipe, - PayStatusPipe, ChlidRechargeStatusPipe, SourceTypePipe, GasClassGroupTaskStatusPipe, @@ -110,7 +115,10 @@ const PIPES = [ IntegralTypePipe, IntegralProductPipe, MsgTypePipe, - ProductConfigPipe + ProductConfigPipe, + CallbackStatusPipe, + PayStatusPipe, + PayCouponStatusPipe, ]; @@ -124,6 +132,7 @@ const PIPES = [ ], declarations: [ ...PIPES, + ], exports: [ diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index beea301..9b76f17 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -42,3 +42,5 @@ export * from './gas-class-group-task/gas-class-group-task-status.pipe'; export * from './gas-order/gas-order-status.pipe'; export * from './recharge-pipe/platform.pipe'; export * from './index/product-config.pipe'; +export * from './apiMerchant/callback-status.pipe'; +export * from './order/pay-coupon-status.pipe'; diff --git a/src/app/services/api-merchants.service.ts b/src/app/services/api-merchants.service.ts index d276fa6..2cf456e 100644 --- a/src/app/services/api-merchants.service.ts +++ b/src/app/services/api-merchants.service.ts @@ -222,4 +222,16 @@ export class ApiMerchantsService { }); } + /** + * @Author Sum1Dream + * @methodName getApiThirdOrderByList + * @Description // 查询API第三方订单列表 + * @Date 09:59 2023/1/5 + * @Param params: object, callBack + */ + public getApiThirdOrderByList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'apiMerchants/getApiThirdOrderByList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts index 02b1817..f70d9a3 100644 --- a/src/app/services/index.service.ts +++ b/src/app/services/index.service.ts @@ -216,7 +216,4 @@ export class IndexService { callBack(data); }); } - - - } diff --git a/src/app/services/recharge.service.ts b/src/app/services/recharge.service.ts index b93adca..fd7cf05 100644 --- a/src/app/services/recharge.service.ts +++ b/src/app/services/recharge.service.ts @@ -101,6 +101,18 @@ export class RechargeService { }); } + /** + * 获取API充值话费订单 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getApiRechargePhoneByList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'apiMerchants/getApiRechargePhoneByList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + /** * 根据id查询详情 diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 21ad46f..a2d6d6f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,10 +4,10 @@ export const environment = { production: false, - // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) - // imageUrl: 'http://localhost:9302/filesystem/', - baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://hsgcs.dctpay.com/filesystem/', + baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'http://localhost:9302/filesystem/', + // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // 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=', }; From 51a09f3aee01f441c7ae1cf2fccd63aba771fb2d Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 5 Jan 2023 14:39:20 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=95=86=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kfc-order/kfc-order.component.html | 127 ++++++++++++++++++ .../kfc-order/kfc-order.component.scss | 5 + .../kfc-order/kfc-order.component.spec.ts | 25 ++++ .../kfc-order/kfc-order.component.ts | 91 +++++++++++++ .../starbucks-order/list/list.component.html | 127 ++++++++++++++++++ .../starbucks-order/list/list.component.scss | 5 + .../starbucks-order/list/list.component.ts | 92 +++++++++++++ .../vip-top-up-order.component.html | 127 ++++++++++++++++++ .../vip-top-up-order.component.scss | 5 + .../vip-top-up-order.component.ts | 93 +++++++++++++ .../pipes/apiMerchant/callback-status.pipe.ts | 21 +++ src/app/pipes/order/pay-coupon-status.pipe.ts | 26 ++++ 12 files changed, 744 insertions(+) create mode 100644 src/app/admin/api-order/kfc-order/kfc-order.component.html create mode 100644 src/app/admin/api-order/kfc-order/kfc-order.component.scss create mode 100644 src/app/admin/api-order/kfc-order/kfc-order.component.spec.ts create mode 100644 src/app/admin/api-order/kfc-order/kfc-order.component.ts create mode 100644 src/app/admin/api-order/starbucks-order/list/list.component.html create mode 100644 src/app/admin/api-order/starbucks-order/list/list.component.scss create mode 100644 src/app/admin/api-order/starbucks-order/list/list.component.ts create mode 100644 src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.html create mode 100644 src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.scss create mode 100644 src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.ts create mode 100644 src/app/pipes/apiMerchant/callback-status.pipe.ts create mode 100644 src/app/pipes/order/pay-coupon-status.pipe.ts diff --git a/src/app/admin/api-order/kfc-order/kfc-order.component.html b/src/app/admin/api-order/kfc-order/kfc-order.component.html new file mode 100644 index 0000000..beee660 --- /dev/null +++ b/src/app/admin/api-order/kfc-order/kfc-order.component.html @@ -0,0 +1,127 @@ + + + + + +
+
+
+
+ + 平台订单号 + + + + +
+
+ + 第三方订单号 + + + + +
+
+ + 订单状态 + + + + + + + + + + + + +
+ +
+ + 回调状态 + + + + + + + + + +
+
+ + 支付时间 + + + + +
+
+ + 创建时间 + + + + +
+
+
+
+ + +
+
+
+
+ +
+ 共计 {{total}} 条数据 + + + + 编号 + 平台订单号 + 第三方订单号 + 订单金额 + 下单金额 + 生成时间 + 支付时间 + 订单状态 + 支付状态 + + + + + {{i + 1}} + {{data.orderNo}} + {{data.sourceOrderNo}} + ¥{{data.orderPrice}} + ¥{{data.payPrice}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.callbackStatus | callbackStatus}} + {{data.orderStatus | payCouponStatus}} + + +
diff --git a/src/app/admin/api-order/kfc-order/kfc-order.component.scss b/src/app/admin/api-order/kfc-order/kfc-order.component.scss new file mode 100644 index 0000000..b68da73 --- /dev/null +++ b/src/app/admin/api-order/kfc-order/kfc-order.component.scss @@ -0,0 +1,5 @@ +.table-td-operation { + a { + margin-left: 8px; + } +} diff --git a/src/app/admin/api-order/kfc-order/kfc-order.component.spec.ts b/src/app/admin/api-order/kfc-order/kfc-order.component.spec.ts new file mode 100644 index 0000000..0c474b2 --- /dev/null +++ b/src/app/admin/api-order/kfc-order/kfc-order.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { KfcOrderComponent } from './kfc-order.component'; + +describe('KfcOrderComponent', () => { + let component: KfcOrderComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ KfcOrderComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(KfcOrderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/api-order/kfc-order/kfc-order.component.ts b/src/app/admin/api-order/kfc-order/kfc-order.component.ts new file mode 100644 index 0000000..4866982 --- /dev/null +++ b/src/app/admin/api-order/kfc-order/kfc-order.component.ts @@ -0,0 +1,91 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; +import {RechargeService} from '../../../services/recharge.service'; +import {DiscountService} from '../../../services/discount.service'; +import {ApiMerchantsService} from '../../../services/api-merchants.service'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {CouponService} from '../../../services/coupon.service'; +import {IconService} from '../../../services/icon.service'; + +@Component({ + selector: 'app-kfc-order', + templateUrl: './kfc-order.component.html', + styleUrls: ['./kfc-order.component.scss'] +}) +export class KfcOrderComponent implements OnInit { + + FILE_URL = environment.imageUrl; + WEB_SERVE_URL = environment.baseUrl; + searchForm: FormGroup; // 搜索框 + validateForm: FormGroup; // 添加框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + isVisible = false; + constructor( + private form: FormBuilder, + private recharge: RechargeService, + private discount: DiscountService, + private apiMerchant: ApiMerchantsService, + private modal: NzModalService, + private coupon: CouponService, + private iconService: IconService, + private message: NzMessageService, + + ) { + } + + ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + orderStatus: [null], // 订单状态 + orderNo: [null], // 订单号 + productType: [2], // 产品类型 + sourceOrderNo: [null], // 第三方订单号 + callbackStatus: [null], // 回调状态 + payTime: [null], // 支付时间 + createTime: [null], // 创建时间 + }); + + this.getRequest(true, this.searchForm.value); + } + + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { + if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { + whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); + whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); + } + + if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { + whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); + whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); + } + this.loading = false; + if (reset) { + this.pageNum = 1; + } + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + this.apiMerchant.getApiThirdOrderByList(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(); + } + +} diff --git a/src/app/admin/api-order/starbucks-order/list/list.component.html b/src/app/admin/api-order/starbucks-order/list/list.component.html new file mode 100644 index 0000000..beee660 --- /dev/null +++ b/src/app/admin/api-order/starbucks-order/list/list.component.html @@ -0,0 +1,127 @@ + + + + + +
+
+
+
+ + 平台订单号 + + + + +
+
+ + 第三方订单号 + + + + +
+
+ + 订单状态 + + + + + + + + + + + + +
+ +
+ + 回调状态 + + + + + + + + + +
+
+ + 支付时间 + + + + +
+
+ + 创建时间 + + + + +
+
+
+
+ + +
+
+
+
+ +
+ 共计 {{total}} 条数据 + + + + 编号 + 平台订单号 + 第三方订单号 + 订单金额 + 下单金额 + 生成时间 + 支付时间 + 订单状态 + 支付状态 + + + + + {{i + 1}} + {{data.orderNo}} + {{data.sourceOrderNo}} + ¥{{data.orderPrice}} + ¥{{data.payPrice}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.callbackStatus | callbackStatus}} + {{data.orderStatus | payCouponStatus}} + + +
diff --git a/src/app/admin/api-order/starbucks-order/list/list.component.scss b/src/app/admin/api-order/starbucks-order/list/list.component.scss new file mode 100644 index 0000000..b68da73 --- /dev/null +++ b/src/app/admin/api-order/starbucks-order/list/list.component.scss @@ -0,0 +1,5 @@ +.table-td-operation { + a { + margin-left: 8px; + } +} diff --git a/src/app/admin/api-order/starbucks-order/list/list.component.ts b/src/app/admin/api-order/starbucks-order/list/list.component.ts new file mode 100644 index 0000000..a6e363c --- /dev/null +++ b/src/app/admin/api-order/starbucks-order/list/list.component.ts @@ -0,0 +1,92 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../../environments/environment'; +import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; +import {RechargeService} from '../../../../services/recharge.service'; +import {DiscountService} from '../../../../services/discount.service'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {CouponService} from '../../../../services/coupon.service'; +import {IconService} from '../../../../services/icon.service'; +import {ApiMerchantsService} from '../../../../services/api-merchants.service'; + +@Component({ + selector: 'app-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.scss'] +}) +export class ListComponent implements OnInit { + + FILE_URL = environment.imageUrl; + WEB_SERVE_URL = environment.baseUrl; + searchForm: FormGroup; // 搜索框 + validateForm: FormGroup; // 添加框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + isVisible = false; + constructor( + private form: FormBuilder, + private recharge: RechargeService, + private discount: DiscountService, + private apiMerchant: ApiMerchantsService, + private modal: NzModalService, + private coupon: CouponService, + private iconService: IconService, + private message: NzMessageService, + + ) { + } + + ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + orderStatus: [null], // 订单状态 + orderNo: [null], // 订单号 + productType: [1], // 产品类型 + sourceOrderNo: [null], // 第三方订单号 + rechargeStatus: [null], // 充值状态 + callbackStatus: [null], // 回调状态 + payTime: [null], // 支付时间 + createTime: [null], // 创建时间 + }); + + this.getRequest(true, this.searchForm.value); + } + + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { + if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { + whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); + whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); + } + + if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { + whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); + whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); + } + this.loading = false; + if (reset) { + this.pageNum = 1; + } + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + this.apiMerchant.getApiThirdOrderByList(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(); + } + +} diff --git a/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.html b/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.html new file mode 100644 index 0000000..beee660 --- /dev/null +++ b/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.html @@ -0,0 +1,127 @@ + + + + + +
+
+
+
+ + 平台订单号 + + + + +
+
+ + 第三方订单号 + + + + +
+
+ + 订单状态 + + + + + + + + + + + + +
+ +
+ + 回调状态 + + + + + + + + + +
+
+ + 支付时间 + + + + +
+
+ + 创建时间 + + + + +
+
+
+
+ + +
+
+
+
+ +
+ 共计 {{total}} 条数据 + + + + 编号 + 平台订单号 + 第三方订单号 + 订单金额 + 下单金额 + 生成时间 + 支付时间 + 订单状态 + 支付状态 + + + + + {{i + 1}} + {{data.orderNo}} + {{data.sourceOrderNo}} + ¥{{data.orderPrice}} + ¥{{data.payPrice}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.callbackStatus | callbackStatus}} + {{data.orderStatus | payCouponStatus}} + + +
diff --git a/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.scss b/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.scss new file mode 100644 index 0000000..b68da73 --- /dev/null +++ b/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.scss @@ -0,0 +1,5 @@ +.table-td-operation { + a { + margin-left: 8px; + } +} diff --git a/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.ts b/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.ts new file mode 100644 index 0000000..50fbdad --- /dev/null +++ b/src/app/admin/api-order/vip-top-up-order/vip-top-up-order.component.ts @@ -0,0 +1,93 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; +import {RechargeService} from '../../../services/recharge.service'; +import {DiscountService} from '../../../services/discount.service'; +import {ApiMerchantsService} from '../../../services/api-merchants.service'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {CouponService} from '../../../services/coupon.service'; +import {IconService} from '../../../services/icon.service'; + +@Component({ + selector: 'app-vip-top-up-order', + templateUrl: './vip-top-up-order.component.html', + styleUrls: ['./vip-top-up-order.component.scss'] +}) +export class VipTopUpOrderComponent implements OnInit { + + FILE_URL = environment.imageUrl; + WEB_SERVE_URL = environment.baseUrl; + searchForm: FormGroup; // 搜索框 + validateForm: FormGroup; // 添加框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + isVisible = false; + constructor( + private form: FormBuilder, + private recharge: RechargeService, + private discount: DiscountService, + private apiMerchant: ApiMerchantsService, + private modal: NzModalService, + private coupon: CouponService, + private iconService: IconService, + private message: NzMessageService, + + ) { + } + + ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + orderStatus: [null], // 订单状态 + orderNo: [null], // 订单号 + productType: [3], // 产品类型 + sourceOrderNo: [null], // 第三方订单号 + rechargeStatus: [null], // 充值状态 + callbackStatus: [null], // 回调状态 + payTime: [null], // 支付时间 + createTime: [null], // 创建时间 + }); + + this.getRequest(true, this.searchForm.value); + } + + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { + if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { + whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); + whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); + } + + if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { + whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); + whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); + } + this.loading = false; + if (reset) { + this.pageNum = 1; + } + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + this.apiMerchant.getApiThirdOrderByList(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(); + } + + +} diff --git a/src/app/pipes/apiMerchant/callback-status.pipe.ts b/src/app/pipes/apiMerchant/callback-status.pipe.ts new file mode 100644 index 0000000..9374a35 --- /dev/null +++ b/src/app/pipes/apiMerchant/callback-status.pipe.ts @@ -0,0 +1,21 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'callbackStatus' +}) +export class CallbackStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 100: + return '未回调'; + case 101: + return '已回调'; + case 102: + return '回调未响应'; + case 103: + return '预备回调'; + } + } + +} diff --git a/src/app/pipes/order/pay-coupon-status.pipe.ts b/src/app/pipes/order/pay-coupon-status.pipe.ts new file mode 100644 index 0000000..31a3a5c --- /dev/null +++ b/src/app/pipes/order/pay-coupon-status.pipe.ts @@ -0,0 +1,26 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'payCouponStatus' +}) +export class PayCouponStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '待支付'; + case 2: + return '已支付'; + case 3: + return '已完成'; + case 4: + return '已退款'; + case 5: + return '已取消'; + case 6: + return '退款中'; + case 7: + return '拒绝退款'; + } + } +}