共计 {{total}} 条数据
+
+ 商戶名称:
+ {{name}}
+
@@ -74,35 +60,26 @@
编号 |
- 商户编号 |
- 商户名称 |
- 商户LOGO |
- 商户电话 |
+ 门店编号 |
+ 门店名称 |
+ 门店电话 |
创建时间 |
- 状态 |
操作 |
{{i+1}} |
- {{data.merchantKey}} |
- {{data.merchantName}} |
-
-
- |
+ {{data.storeKey}} |
+ {{data.storeName}} |
{{data.telephone}} |
{{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
- {{data.status ===1 ? '正常' : '禁用'}} |
-
-
-
+
-
-
+
|
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 13d2c62..f8c7d2a 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
@@ -3,7 +3,7 @@ import {FormBuilder, FormGroup} from '@angular/forms';
import {MerchantService} from '../../../services/merchant.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from 'ng-zorro-antd';
-import {Router} from '@angular/router';
+import {ActivatedRoute, Router} from '@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {MerchantStoreService} from '../../../services/merchant-store.service';
@@ -20,31 +20,39 @@ export class StoreListComponent implements OnInit {
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
-
+ id = null;
+ name: string;
constructor(
private form: FormBuilder,
private merchantStore: MerchantStoreService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
+ private activatedRoute: ActivatedRoute,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
+
}
public init(): void {
+ this.activatedRoute.queryParams.subscribe(queryParams => {
+ if (queryParams.merchantId != null) {
+ this.id = queryParams.merchantId;
+ this.name = queryParams.name;
+ }
+ });
this.searchForm = this.form.group({
- merchantKey: [null],
- merchantName: [null],
+ storeName: [null],
telephone: [null],
- status: [null],
});
this.getRequest(true, this.searchForm.value);
}
+
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
@@ -54,14 +62,28 @@ export class StoreListComponent implements OnInit {
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
- this.merchantStore.getStoreListByMerchant(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']);
- }
- });
+ if (this.id == null) {
+ this.merchantStore.getStoreListByMerchant(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']);
+ }
+ });
+ } else {
+ whereObject['merchantId'] = this.id;
+ this.merchantStore.getStoreListByCompany(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']);
+ }
+ });
+ }
+
+
}
// 重置
@@ -69,29 +91,12 @@ export class StoreListComponent implements OnInit {
this.searchForm.reset();
}
- // 禁用商户
- public disableMerchant(id): void {
- const message = '是否禁用商户';
- this.common.showConfirm(message, data => {
- if (data) {
- this.merchantStore.disableMerchant(id, dataReturn => {
- if (dataReturn['return_code'] === '000000') {
- this.message.success('操作成功');
- this.getRequest(false , this.searchForm.value);
- } else {
- this.message.warning(dataReturn['return_msg']);
- }
- });
- }
- });
- }
-
- // 启动商户
- public enableMerchant(id): void {
- const message = '是否启用商户';
+ // 禁用门店
+ public getDelete(id): void {
+ const message = '是否删除门店';
this.common.showConfirm(message, data => {
if (data) {
- this.merchantStore.enableMerchant(id, dataReturn => {
+ this.merchantStore.deleteMerchantStore(id, dataReturn => {
if (dataReturn['return_code'] === '000000') {
this.message.success('操作成功');
this.getRequest(false , this.searchForm.value);
@@ -103,31 +108,22 @@ export class StoreListComponent implements OnInit {
});
}
-
// 修改
public getEdit(id: number): void {
- this.router.navigate(['/admin/merchant/merchant-edit'], {
+ this.router.navigate(['/admin/merchantStore/store-edit'], {
queryParams: {
- merchantId: id
+ storeId: id
}
}).then(r => console.log(r));
}
// 查看详情
public getDetail(id: number): void {
- this.router.navigate(['/admin/merchant/merchant-detail'], {
+ this.router.navigate(['/admin/merchantStore/store-detail'], {
queryParams: {
- merchantId: id
+ storeId: id
}
}).then(r => console.log(r));
}
- // 查看门店列表
- public getList(id: number): void {
- this.router.navigate(['/admin/merchant/merchant-detail'], {
- queryParams: {
- merchantId: id
- }
- }).then(r => console.log(r));
- }
}
diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
index f33cfad..88d34a1 100644
--- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
+++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
@@ -27,11 +27,10 @@ export class MerchantDetailComponent implements OnInit {
});
}
- // 查询课程详情
+ // 查询详情
public getDetails(id: number) {
this.merchant.getMerchantById(id , data => {
this.data = data['return_data'];
- console.log(data);
});
}
diff --git a/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts b/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
index 13de7f4..f82331a 100644
--- a/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
+++ b/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
@@ -96,7 +96,7 @@ export class MerchantEditComponent implements OnInit {
this.validateForm.value.merchantLogo = this.logoFile[0].name;
}
}
- console.log(this.validateForm.value);
+
if (this.editFlag) {
this.validateForm.value.id = this.id;
this.merchant.updateMerchant(this.validateForm.value, data => {
diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.html b/src/app/admin/merchant/merchant-list/merchant-list.component.html
index 1bbf77d..9ac6b71 100644
--- a/src/app/admin/merchant/merchant-list/merchant-list.component.html
+++ b/src/app/admin/merchant/merchant-list/merchant-list.component.html
@@ -99,7 +99,7 @@
-
+
diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.ts b/src/app/admin/merchant/merchant-list/merchant-list.component.ts
index 7fff044..8a6d7fa 100644
--- a/src/app/admin/merchant/merchant-list/merchant-list.component.ts
+++ b/src/app/admin/merchant/merchant-list/merchant-list.component.ts
@@ -123,10 +123,11 @@ export class MerchantListComponent implements OnInit {
}
// 查看门店列表
- public getList(id: number): void {
- this.router.navigate(['/admin/merchant/merchant-detail'], {
+ public getList(id: number , merchantName: string): void {
+ this.router.navigate(['/admin/merchantStore/store-list'], {
queryParams: {
- merchantId: id
+ merchantId: id,
+ name: merchantName,
}
}).then(r => console.log(r));
}
diff --git a/src/app/services/merchant-store.service.ts b/src/app/services/merchant-store.service.ts
index bf52d11..8c3a479 100644
--- a/src/app/services/merchant-store.service.ts
+++ b/src/app/services/merchant-store.service.ts
@@ -25,6 +25,18 @@ export class MerchantStoreService {
});
}
+ /**
+ * 超级管理员查询门店列表
+ *
+ * @param paramsObject 对象
+ * @param callBack 回调
+ */
+ public getStoreListByCompany(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'highMerchantStore/getStoreListByCompany?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 新增商户
*
@@ -32,8 +44,8 @@ export class MerchantStoreService {
* @param callBack 回调
* @return data 返回结果
*/
- public insertMerchant(params: object, callBack) {
- this.http.post(environment.baseUrl + 'highMerchant/insertMerchant', params).subscribe(data => {
+ public insertMerchantStore(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'highMerchantStore/insertMerchantStore', params).subscribe(data => {
callBack(data);
});
}
@@ -45,8 +57,8 @@ export class MerchantStoreService {
* @param callBack 回调
* @return data 返回结果
*/
- public updateMerchant(params: object, callBack) {
- this.http.post(environment.baseUrl + 'highMerchant/updateMerchant', params).subscribe(data => {
+ public updateMerchantStore(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'highMerchantStore/updateMerchantStore', params).subscribe(data => {
callBack(data);
});
}
@@ -57,8 +69,8 @@ export class MerchantStoreService {
* @param merchantId 职位id
* @param callBack 回调
*/
- public getMerchantById(merchantId: number, callBack) {
- this.http.get(environment.baseUrl + 'highMerchant/getMerchantById?id=' + merchantId).subscribe(data => {
+ public getMerchantStoreById(merchantId: number, callBack) {
+ this.http.get(environment.baseUrl + 'highMerchantStore/getMerchantStoreById?id=' + merchantId).subscribe(data => {
callBack(data);
});
}
@@ -70,22 +82,11 @@ export class MerchantStoreService {
* @param id 用户id
* @param callBack 返回参数
*/
- public disableMerchant(id: number, callBack) {
- this.http.get(environment.baseUrl + 'highMerchant/disableMerchant?id=' + id).subscribe(data => {
+ public deleteMerchantStore(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'highMerchantStore/deleteMerchantStore?id=' + id).subscribe(data => {
callBack(data);
});
}
- /**
- * 启用商户
- *
- * @param id 用户id
- * @param callBack 返回参数
- */
- public enableMerchant(id: number, callBack) {
- this.http.get(environment.baseUrl + 'highMerchant/enableMerchant?id=' + id).subscribe(data => {
- callBack(data);
- });
- }
}
diff --git a/src/index.html b/src/index.html
index 309f89b..268e126 100644
--- a/src/index.html
+++ b/src/index.html
@@ -5,6 +5,8 @@
嗨商城
+
+
diff --git a/tsconfig.json b/tsconfig.json
index 30956ae..9ddd180 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -17,7 +17,8 @@
"lib": [
"es2018",
"dom"
- ]
+ ],
+ "allowSyntheticDefaultImports": true
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,