From b8b80e271ea1a773599b9fb5b666995151d9b716 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Fri, 26 Mar 2021 23:07:42 +0800 Subject: [PATCH] 1 --- .gitignore | 45 -------- .../store-edit/store-edit.component.html | 2 +- .../store-list/store-list.component.html | 107 ++++++++++++------ .../store-list/store-list.component.ts | 49 +++++++- .../system-organization.component.html | 70 ++++++------ src/environments/environment.ts | 8 +- src/styles.scss | 1 + 7 files changed, 159 insertions(+), 123 deletions(-) diff --git a/.gitignore b/.gitignore index 4f785e5..2504c57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,51 +1,6 @@ .git/ .idea/ node_modules/ -# See http://help.github.com/ignore-files/ for more about ignoring files. -/src/assets/node_modules/ -# compiled output -/dist -/tmp -/out-tsc -# Only exists if Bazel was run -/bazel-out -# dependencies -/node_modules - -# profiling files -chrome-profiler-events*.json -speed-measure-plugin*.json - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -.history/* - -# misc -/.sass-cache -/connect.lock -/coverage -/libpeerconnection.log -npm-debug.log -yarn-error.log -testem.log -/typings - -# System Files -.DS_Store -Thumbs.db 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 783dc58..00cf7c9 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 @@ -70,7 +70,7 @@ 门店地址 - + diff --git a/src/app/admin/merchant-store/store-list/store-list.component.html b/src/app/admin/merchant-store/store-list/store-list.component.html index 3e6e7de..23445cb 100644 --- a/src/app/admin/merchant-store/store-list/store-list.component.html +++ b/src/app/admin/merchant-store/store-list/store-list.component.html @@ -43,49 +43,82 @@
+ + +
- - + + + + + 编号 + 所属地区 + 门店编号 + 门店名称 + 门店电话 + 创建时间 + 操作 + + + + + {{i+1}} + {{data.regionName}} + {{data.storeKey}} + {{data.storeName}} + {{data.telephone}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} + + + + + + + + + + + + + + + + + - 编号 - 所属地区 - 门店编号 - 门店名称 - 门店电话 - 创建时间 - 操作 + 序号 + 门店编号 + 门店名称 + 区域ID + 原因 - - {{i+1}} - {{data.regionName}} + + {{ i + 1}} {{data.storeKey}} {{data.storeName}} - {{data.telephone}} - {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} - - - - - - - + {{data.regionId}} + {{data.errorMessage}} + - - - - + diff --git a/src/app/admin/merchant-store/store-list/store-list.component.ts b/src/app/admin/merchant-store/store-list/store-list.component.ts index 6b7e0a6..336dd01 100644 --- a/src/app/admin/merchant-store/store-list/store-list.component.ts +++ b/src/app/admin/merchant-store/store-list/store-list.component.ts @@ -1,10 +1,11 @@ import { Component, OnInit } from '@angular/core'; import {FormBuilder, FormGroup} from '@angular/forms'; import {IconService} from '../../../services/icon.service'; -import {NzMessageService} from 'ng-zorro-antd'; +import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd'; import {ActivatedRoute, Router} from '@angular/router'; import {CommonsService} from '../../../services/commons.service'; import {MerchantStoreService} from '../../../services/merchant-store.service'; +import {environment} from '../../../../environments/environment'; @Component({ selector: 'app-store-list', @@ -21,12 +22,18 @@ export class StoreListComponent implements OnInit { loading = true; id = null; name: string; + WEB_SERVE_URL = environment.baseUrl; + importErrorStudentArray = []; + errorStudentVisible = false; + isSpinning = false; + constructor( private form: FormBuilder, private merchantStore: MerchantStoreService, private iconService: IconService, private message: NzMessageService, private router: Router, + private modal: NzModalService, private activatedRoute: ActivatedRoute, private common: CommonsService ) { @@ -125,4 +132,44 @@ export class StoreListComponent implements OnInit { }).then(r => console.log(r)); } + handleCancelError(): void { + this.errorStudentVisible = false; + } + + handleChange(info: NzUploadChangeParam): void { + this.isSpinning = true; + if (info.file.status !== 'uploading') { + console.log(info.file, info.fileList); + } + if (info.file.status === 'done') { + if (info.file.response.return_code === '000000') { + this.loading = false; + this.isSpinning = false; + if (info.file.response.return_data.errorTotal === 0) { + this.message.success('导入成功'); + this.getRequest(true, this.searchForm.value); + } else { + this.modal.warning({ + nzTitle: '提示', + nzOkText: '查看失败数据', + nzContent: '只有部分数据导入成功', + nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data) + }); + } + } else { + this.isSpinning = false; + this.loading = false; + this.message.error(info.file.response.return_msg); + } + } else if (info.file.status === 'error') { + this.message.error('上传错误'); + } + } + + // 打开模态框 + showErrorStudentModal(data: []) { + this.getRequest(true, this.searchForm.value); + this.importErrorStudentArray = data['errorData']; + this.errorStudentVisible = true; + } } diff --git a/src/app/admin/system/system-organization/system-organization.component.html b/src/app/admin/system/system-organization/system-organization.component.html index 26661ac..19bbb3a 100644 --- a/src/app/admin/system/system-organization/system-organization.component.html +++ b/src/app/admin/system/system-organization/system-organization.component.html @@ -106,41 +106,41 @@ - - logo - - - -
上传
-
-
-
- - - 邮箱 - - - - - - - 网站 - - - - - - - 备注 - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 184a1dc..532a068 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/', }; /* diff --git a/src/styles.scss b/src/styles.scss index 263d7f5..f028cfe 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -39,6 +39,7 @@ } .operating-button button { margin-bottom: 15px; + margin-left: 10px; } .table { margin-top: 20px;