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. 107
      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/ .git/
.idea/ .idea/
node_modules/ 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-item>
<nz-form-label [nzFor]="'address'" nzRequired>门店地址</nz-form-label> <nz-form-label [nzFor]="'address'" nzRequired>门店地址</nz-form-label>
<nz-form-control nzErrorTip="请输入门店地址!"> <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-control>
</nz-form-item> </nz-form-item>
</div> </div>

@ -43,49 +43,82 @@
</span> </span>
<div class="operating-button"> <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> <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> </div>
<nz-table <nz-spin nzTip="批量导入中..." [nzSpinning]="isSpinning">
class="table" <nz-table
#ajaxTable class="table"
nzShowSizeChanger #ajaxTable
[nzFrontPagination]="false" nzShowSizeChanger
[nzData]="requestData" [nzFrontPagination]="false"
[nzLoading]="loading" [nzData]="requestData"
[nzTotal]="total" [nzLoading]="loading"
[(nzPageIndex)]="pageNum" [nzTotal]="total"
[(nzPageSize)]="pageSize" [(nzPageIndex)]="pageNum"
[nzScroll]="{ x: '1200px' }" [(nzPageSize)]="pageSize"
(nzPageIndexChange)="getRequest(false , searchForm.value)" [nzScroll]="{ x: '1200px' }"
(nzPageSizeChange)="getRequest(false , searchForm.value)"> (nzPageIndexChange)="getRequest(false , searchForm.value)"
<thead nzSingleSort> (nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">所属地区</th>
<th nzWidth="80px">门店编号</th>
<th nzWidth="80px">门店名称</th>
<th nzWidth="100px">门店电话</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="80px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.regionName}}</td>
<td>{{data.storeKey}}</td>
<td>{{data.storeName}}</td>
<td>{{data.telephone}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="编辑"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDetail(data.id)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="门店详情"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDelete(data.id)"><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>
</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> <tr>
<th nzWidth="50px">编号</th> <th nzWidth="80px">序号</th>
<th nzWidth="80px">所属地区</th> <th nzWidth="150px">门店编号</th>
<th nzWidth="80px">门店编号</th> <th nzWidth="150px">门店名称</th>
<th nzWidth="80px">门店名称</th> <th nzWidth="150px">区域ID</th>
<th nzWidth="100px">门店电话</th> <th nzWidth="300px">原因</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="80px" nzRight="0px">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index"> <tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{i+1}}</td> <td>{{ i + 1}}</td>
<td>{{data.regionName}}</td>
<td>{{data.storeKey}}</td> <td>{{data.storeKey}}</td>
<td>{{data.storeName}}</td> <td>{{data.storeName}}</td>
<td>{{data.telephone}}</td> <td>{{data.regionId}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.errorMessage}}</td>
<td nzRight="0px" class="table-td-operation"> </tr>
<a (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="编辑"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDetail(data.id)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="门店详情"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDelete(data.id)"><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>
</td>
</tbody> </tbody>
</nz-table> </nz-table>
</div> </nz-modal>

@ -1,10 +1,11 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms'; import {FormBuilder, FormGroup} from '@angular/forms';
import {IconService} from '../../../services/icon.service'; 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 {ActivatedRoute, Router} from '@angular/router';
import {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
import {MerchantStoreService} from '../../../services/merchant-store.service'; import {MerchantStoreService} from '../../../services/merchant-store.service';
import {environment} from '../../../../environments/environment';
@Component({ @Component({
selector: 'app-store-list', selector: 'app-store-list',
@ -21,12 +22,18 @@ export class StoreListComponent implements OnInit {
loading = true; loading = true;
id = null; id = null;
name: string; name: string;
WEB_SERVE_URL = environment.baseUrl;
importErrorStudentArray = [];
errorStudentVisible = false;
isSpinning = false;
constructor( constructor(
private form: FormBuilder, private form: FormBuilder,
private merchantStore: MerchantStoreService, private merchantStore: MerchantStoreService,
private iconService: IconService, private iconService: IconService,
private message: NzMessageService, private message: NzMessageService,
private router: Router, private router: Router,
private modal: NzModalService,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private common: CommonsService private common: CommonsService
) { ) {
@ -125,4 +132,44 @@ export class StoreListComponent implements OnInit {
}).then(r => console.log(r)); }).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-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <!-- <nz-form-item>-->
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">logo</nz-form-label> <!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">logo</nz-form-label>-->
<nz-form-control [nzSm]="14" [nzXs]="24"> <!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<nz-upload <!-- <nz-upload-->
nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile" <!-- nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile"-->
nzListType="picture-card" <!-- nzListType="picture-card"-->
[(nzFileList)]="orgLogo" <!-- [(nzFileList)]="orgLogo"-->
[nzShowButton]="orgLogo.length < 1" <!-- [nzShowButton]="orgLogo.length < 1"-->
> <!-- >-->
<i nz-icon nzType="plus"></i> <!-- <i nz-icon nzType="plus"></i>-->
<div class="ant-upload-text">上传</div> <!-- <div class="ant-upload-text">上传</div>-->
</nz-upload> <!-- </nz-upload>-->
</nz-form-control> <!-- </nz-form-control>-->
</nz-form-item> <!-- </nz-form-item>-->
<nz-form-item> <!-- <nz-form-item>-->
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">邮箱</nz-form-label> <!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">邮箱</nz-form-label>-->
<nz-form-control [nzSm]="14" [nzXs]="24"> <!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<input nz-input formControlName="email" placeholder="请输入邮箱" /> <!-- <input nz-input formControlName="email" placeholder="请输入邮箱" />-->
</nz-form-control> <!-- </nz-form-control>-->
</nz-form-item> <!-- </nz-form-item>-->
<nz-form-item> <!-- <nz-form-item>-->
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">网站</nz-form-label> <!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="province">网站</nz-form-label>-->
<nz-form-control [nzSm]="14" [nzXs]="24"> <!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<input nz-input formControlName="siteUrl" placeholder="请输入网站" /> <!-- <input nz-input formControlName="siteUrl" placeholder="请输入网站" />-->
</nz-form-control> <!-- </nz-form-control>-->
</nz-form-item> <!-- </nz-form-item>-->
<nz-form-item> <!-- <nz-form-item>-->
<nz-form-label [nzSm]="6" [nzXs]="24">备注</nz-form-label> <!-- <nz-form-label [nzSm]="6" [nzXs]="24">备注</nz-form-label>-->
<nz-form-control [nzSm]="14" [nzXs]="24"> <!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<textarea nz-input [rows]="4" formControlName="remark" placeholder="请输入备注" ></textarea> <!-- <textarea nz-input [rows]="4" formControlName="remark" placeholder="请输入备注" ></textarea>-->
</nz-form-control> <!-- </nz-form-control>-->
</nz-form-item> <!-- </nz-form-item>-->
</form> </form>
</nz-modal> </nz-modal>

@ -4,10 +4,10 @@
export const environment = { export const environment = {
production: false, production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'http://localhost:9302/filesystem/', imageUrl: 'http://localhost:9302/filesystem/',
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址) // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/', // imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
}; };
/* /*

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

Loading…
Cancel
Save