pull/1/head
袁野 4 years ago
parent 95349eef2e
commit b8b80e271e
  1. 45
      .gitignore
  2. 2
      src/app/admin/merchant-store/store-edit/store-edit.component.html
  3. 33
      src/app/admin/merchant-store/store-list/store-list.component.html
  4. 49
      src/app/admin/merchant-store/store-list/store-list.component.ts
  5. 70
      src/app/admin/system/system-organization/system-organization.component.html
  6. 8
      src/environments/environment.ts
  7. 1
      src/styles.scss

45
.gitignore vendored

@ -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

@ -70,7 +70,7 @@
<nz-form-item>
<nz-form-label [nzFor]="'address'" nzRequired>门店地址</nz-form-label>
<nz-form-control nzErrorTip="请输入门店地址!">
<input nz-input placeholder="请输入门店地址..." readonly [formControlName]="'address'" id="'address'" />
<input nz-input placeholder="请输入门店地址..." [formControlName]="'address'" id="'address'" />
</nz-form-control>
</nz-form-item>
</div>

@ -43,7 +43,17 @@
</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/merchantStore/store-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
<nz-upload
[nzAccept]="'.xls,.xlsx'"
nzAction="{{WEB_SERVE_URL}}highMerchantStore/importMerchantStore"
[nzHeaders]="{ authorization: 'authorization-text' }"
(nzChange)="handleChange($event)"
[nzShowUploadList]="false"
>
<button nz-button nzType="primary" ><i nz-icon nzType="import" nzTheme="outline"></i>批量导入</button>
</nz-upload>
</div>
<nz-spin nzTip="批量导入中..." [nzSpinning]="isSpinning">
<nz-table
class="table"
#ajaxTable
@ -85,7 +95,30 @@
</td>
</tbody>
</nz-table>
</nz-spin>
</div>
<nz-modal [(nzVisible)]="errorStudentVisible" nzTitle="导入失败数据" (nzOnCancel)="handleCancelError()" nzWidth="900px" [nzFooter]="null">
<nz-table #errorStudentTable [nzData]="importErrorStudentArray">
<thead>
<tr>
<th nzWidth="80px">序号</th>
<th nzWidth="150px">门店编号</th>
<th nzWidth="150px">门店名称</th>
<th nzWidth="150px">区域ID</th>
<th nzWidth="300px">原因</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{ i + 1}}</td>
<td>{{data.storeKey}}</td>
<td>{{data.storeName}}</td>
<td>{{data.regionId}}</td>
<td>{{data.errorMessage}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>

@ -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;
}
}

@ -106,41 +106,41 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">logo</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-upload
nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile"
nzListType="picture-card"
[(nzFileList)]="orgLogo"
[nzShowButton]="orgLogo.length < 1"
>
<i nz-icon nzType="plus"></i>
<div class="ant-upload-text">上传</div>
</nz-upload>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">邮箱</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="email" placeholder="请输入邮箱" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">网站</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="siteUrl" placeholder="请输入网站" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">备注</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<textarea nz-input [rows]="4" formControlName="remark" placeholder="请输入备注" ></textarea>
</nz-form-control>
</nz-form-item>
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">logo</nz-form-label>-->
<!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<!-- <nz-upload-->
<!-- nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile"-->
<!-- nzListType="picture-card"-->
<!-- [(nzFileList)]="orgLogo"-->
<!-- [nzShowButton]="orgLogo.length < 1"-->
<!-- >-->
<!-- <i nz-icon nzType="plus"></i>-->
<!-- <div class="ant-upload-text">上传</div>-->
<!-- </nz-upload>-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">邮箱</nz-form-label>-->
<!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<!-- <input nz-input formControlName="email" placeholder="请输入邮箱" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">网站</nz-form-label>-->
<!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<!-- <input nz-input formControlName="siteUrl" placeholder="请输入网站" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSm]="6" [nzXs]="24">备注</nz-form-label>-->
<!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<!-- <textarea nz-input [rows]="4" formControlName="remark" placeholder="请输入备注" ></textarea>-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
</form>
</nz-modal>

@ -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/',
};
/*

@ -39,6 +39,7 @@
}
.operating-button button {
margin-bottom: 15px;
margin-left: 10px;
}
.table {
margin-top: 20px;

Loading…
Cancel
Save