-
- 设置定位
-
-
-
-
-
+
diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.ts b/src/app/admin/merchant-store/store-edit/store-edit.component.ts
index 372f5d0..32b53e4 100644
--- a/src/app/admin/merchant-store/store-edit/store-edit.component.ts
+++ b/src/app/admin/merchant-store/store-edit/store-edit.component.ts
@@ -6,6 +6,7 @@ import {NzMessageService, NzUploadFile} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';
import {ValidatorsService} from '../../../services/validators.service';
import {MerchantStoreService} from '../../../services/merchant-store.service';
+import {CommonsService} from "../../../services/commons.service";
declare var AMap: any; // 一定要声明AMap,要不然报错找不到AMap
declare var AMapUI: any;
@@ -35,15 +36,16 @@ export class StoreEditComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl;
previewVisible = false;
previewImage: string | undefined = '';
+ brandData = [];
constructor(
private fb: FormBuilder,
private merchantStore: MerchantStoreService,
private message: NzMessageService, // 信息提示
+ private commonsService: CommonsService,
private activatedRoute: ActivatedRoute,
) {
}
-
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.storeId != null) {
@@ -55,19 +57,23 @@ export class StoreEditComponent implements OnInit {
}
});
this.validateForm = this.fb.group({
- telephone: [null, [Validators.required, ValidatorsService.mobile]],
- password: [null, [Validators.required, ValidatorsService.minLength(6)]],
- storeKey: [null, [Validators.required, ValidatorsService.maxLength(10)]],
storeName: [null, [Validators.required]],
address: [null, [Validators.required]],
+ contactName: [null, [Validators.required]],
+ prestoreType: [null, [Validators.required]],
+ telephone: [null, [Validators.required]],
latitude: [29.553134, [Validators.required]],
longitude: [106.565428, [Validators.required]],
- status: [null],
- companyId: [null],
+ deviceSn: [null],
+ deviceKey: [null],
+ deviceName: [null],
regionId: [null],
- merchantId: [null],
- createTime: [null],
- secUser: {},
+ brandId: [null],
+ type: [null],
+ });
+
+ this.commonsService.getDictionary('MERCHANT_STORE_BRANCH', data => {
+ this.brandData = data['return_data'];
});
}
@@ -103,8 +109,6 @@ export class StoreEditComponent implements OnInit {
return;
}
}
- this.validateForm.value['secUser']['telephone'] = this.validateForm.value.telephone;
- this.validateForm.value['secUser']['password'] = this.validateForm.value.password;
if (this.logoFile.length !== 0) {
if (this.logoFile[0]['response'] != null) {
this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0];
@@ -138,8 +142,9 @@ export class StoreEditComponent implements OnInit {
public getDetails(id) {
this.merchantStore.getMerchantStoreById(id, data => {
if (data['return_code'] === '000000') {
- data['return_data'].telephone = data['return_data'].secUser.loginName;
- data['return_data'].password = data['return_data'].secUser.password;
+ console.log(data);
+ data['return_data']['brandId'] = String(data['return_data']['brandId']);
+ data['return_data']['type'] = String(data['return_data']['type']);
if (data['return_data']['storeLogo'] != null && data['return_data']['storeLogo'] !== '') {
const logo = String(data['return_data']['storeLogo']);
const logoArray = [];
@@ -164,7 +169,6 @@ export class StoreEditComponent implements OnInit {
getMap() {
// tslint:disable-next-line:variable-name
AMapUI.loadUI(['misc/PositionPicker'], PositionPicker => {
- console.log(this.validateForm.value);
const map = new AMap.Map('container', {
resizeEnable: true,
scrollWheel: false,
@@ -194,7 +198,6 @@ export class StoreEditComponent implements OnInit {
map: map
});
positionPicker.on('success', positionResult => {
- console.log(positionResult);
positionResult['latitude'] = positionResult.position.lat;
positionResult['longitude'] = positionResult.position.lng;
positionResult['regionId'] = positionResult.regeocode.addressComponent.adcode;
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 836925b..5bcf915 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
@@ -75,7 +75,7 @@
门店名称 |
门店电话 |
创建时间 |
-
操作 |
+
操作 |
@@ -87,11 +87,13 @@
{{data.telephone}} |
{{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
-
+ 编辑
-
+ 详情
-
+ 增加余额
+
+ 删除
|
@@ -122,3 +124,16 @@
+
+
+
+
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 336dd01..1a19a13 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,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {IconService} from '../../../services/icon.service';
import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd';
@@ -6,170 +6,200 @@ import {ActivatedRoute, Router} from '@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {MerchantStoreService} from '../../../services/merchant-store.service';
import {environment} from '../../../../environments/environment';
+import {IndexService} from '../../../services/index.service';
@Component({
- selector: 'app-store-list',
- templateUrl: './store-list.component.html',
- styleUrls: ['./store-list.component.scss']
+ selector: 'app-store-list',
+ templateUrl: './store-list.component.html',
+ styleUrls: ['./store-list.component.scss']
})
export class StoreListComponent implements OnInit {
- searchForm: FormGroup; // 搜索框
- requestData = []; // 列表数据
- total: number; // 页码
- pageNum = 1; // 页码
- pageSize = 10; // 条码
- 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
- ) {
- }
-
- 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({
- storeName: [null],
- telephone: [null],
- });
- this.getRequest(true, this.searchForm.value);
- }
-
-
- // 查询列表
- public getRequest(reset: boolean = false, whereObject: object) {
-
- this.loading = false;
- if (reset) {
- this.pageNum = 1;
+ searchForm: FormGroup; // 搜索框
+ requestData = []; // 列表数据
+ total: number; // 页码
+ pageNum = 1; // 页码
+ pageSize = 10; // 条码
+ loading = true;
+ id = null;
+ name: string;
+ price: string;
+ WEB_SERVE_URL = environment.baseUrl;
+ importErrorStudentArray = [];
+ errorStudentVisible = false;
+ isVisibleAdd = false;
+ isSpinning = false;
+
+ constructor(
+ private form: FormBuilder,
+ private merchantStore: MerchantStoreService,
+ private iconService: IconService,
+ private message: NzMessageService,
+ private router: Router,
+ private index: IndexService,
+ private modal: NzModalService,
+ private activatedRoute: ActivatedRoute,
+ private common: CommonsService
+ ) {
}
- whereObject['pageNum'] = this.pageNum;
- whereObject['pageSize'] = this.pageSize;
- 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']);
+
+ 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({
+ storeName: [null],
+ telephone: [null],
+ });
+ this.getRequest(true, this.searchForm.value);
+ }
+
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ this.loading = false;
+ if (reset) {
+ this.pageNum = 1;
}
- });
- } 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;
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ 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 {
- this.message.error(data['return_msg']);
+ 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']);
+ }
+ });
}
- });
+
+
}
+ // 重置
+ public resetForm(): void {
+ this.searchForm.reset();
+ }
- }
-
- // 重置
- public resetForm(): void {
- this.searchForm.reset();
- }
-
- // 禁用门店
- public getDelete(id): void {
- const message = '是否删除门店';
- this.common.showConfirm(message, data => {
- if (data) {
- this.merchantStore.deleteMerchantStore(id, dataReturn => {
- if (dataReturn['return_code'] === '000000') {
- this.message.success('操作成功');
- this.getRequest(false , this.searchForm.value);
- } else {
- this.message.warning(dataReturn['return_msg']);
- }
+ // 禁用门店
+ public getDelete(id): void {
+ const message = '是否删除门店';
+ this.common.showConfirm(message, data => {
+ if (data) {
+ this.merchantStore.deleteMerchantStore(id, dataReturn => {
+ if (dataReturn['return_code'] === '000000') {
+ this.message.success('操作成功');
+ this.getRequest(false, this.searchForm.value);
+ } else {
+ this.message.warning(dataReturn['return_msg']);
+ }
+ });
+ }
});
- }
- });
- }
-
- // 修改
- public getEdit(id: number): void {
- this.router.navigate(['/admin/merchantStore/store-edit'], {
- queryParams: {
- storeId: id
- }
- }).then(r => console.log(r));
- }
-
- // 查看详情
- public getDetail(id: number): void {
- this.router.navigate(['/admin/merchantStore/store-detail'], {
- queryParams: {
- storeId: id
- }
- }).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)
- });
+
+ // 修改
+ public getEdit(id: number): void {
+ this.router.navigate(['/admin/merchantStore/store-edit'], {
+ queryParams: {
+ storeId: id
+ }
+ }).then(r => console.log(r));
+ }
+
+ // 查看详情
+ public getDetail(id: number): void {
+ this.router.navigate(['/admin/merchantStore/store-detail'], {
+ queryParams: {
+ storeId: id
+ }
+ }).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);
}
- } else {
- this.isSpinning = false;
- this.loading = false;
- this.message.error(info.file.response.return_msg);
- }
- } else if (info.file.status === 'error') {
- this.message.error('上传错误');
+ 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;
+ }
+
+ // 增加余额
+ public getRecharge(id): void {
+ this.id = id;
+ this.isVisibleAdd = true;
+ }
+
+
+ handleOk(): void {
+ if (this.price == null) {
+ this.message.error('请输入充值金额');
+ return;
+ }
+ const paramsObject = {
+ storeId: this.id,
+ amount: this.price
+ };
+ this.index.recharge(paramsObject, data => {
+ if (data['return_code'] === '000000') {
+ this.getRequest(false, this.searchForm.value);
+ this.isVisibleAdd = false;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
}
- }
-
- // 打开模态框
- showErrorStudentModal(data: []) {
- this.getRequest(true, this.searchForm.value);
- this.importErrorStudentArray = data['errorData'];
- this.errorStudentVisible = true;
- }
}
diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
index 31ec073..96dab30 100644
--- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
+++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
@@ -1,3 +1,14 @@
+
+
+
+ 商户管理
+
+
+ 商户详情
+
+
+
+
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 dd25626..279914c 100644
--- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
+++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
@@ -1,39 +1,46 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
import {MerchantService} from '../../../services/merchant.service';
import {NzMessageService} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';
import {environment} from '../../../../environments/environment';
@Component({
- selector: 'app-merchant-detail',
- templateUrl: './merchant-detail.component.html',
- styleUrls: ['./merchant-detail.component.scss']
+ selector: 'app-merchant-detail',
+ templateUrl: './merchant-detail.component.html',
+ styleUrls: ['./merchant-detail.component.scss']
})
export class MerchantDetailComponent implements OnInit {
- data: any = {};
- id: number;
- FILE_URL = environment.imageUrl;
- constructor(
- private merchant: MerchantService,
- private message: NzMessageService, // 信息提示
- private activatedRoute: ActivatedRoute,
- ) { }
+ data: any = {};
+ id: number;
+ FILE_URL = environment.imageUrl;
- ngOnInit(): void {
- this.activatedRoute.queryParams.subscribe(queryParams => {
- if (queryParams.merchantId != null) {
- this.id = queryParams.merchantId;
- this.getDetails(queryParams.merchantId);
- }
- });
- }
+ constructor(
+ private merchant: MerchantService,
+ private message: NzMessageService, // 信息提示
+ private activatedRoute: ActivatedRoute,
+ ) {
+ }
- // 查询详情
- public getDetails(id: number) {
- this.merchant.getMerchantById(id , data => {
- this.data = data['return_data'];
- });
- }
+ ngOnInit(): void {
+ this.activatedRoute.queryParams.subscribe(queryParams => {
+ if (queryParams.merchantId != null) {
+ this.id = queryParams.merchantId;
+ this.getDetails(queryParams.merchantId);
+ }
+ });
+ }
+
+ // 查询详情
+ public getDetails(id: number) {
+ this.merchant.getMerchantById(id, data => {
+ this.data = data['return_data'];
+ });
+ }
+
+ // 返回
+ getBack() {
+ history.back();
+ }
}
diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts
index 86b5820..43159ee 100644
--- a/src/app/app-common.module.ts
+++ b/src/app/app-common.module.ts
@@ -44,6 +44,7 @@ import {
OilCardRecordTypePipe, OilCardRecordSourceTypePipe
} from './pipes';
import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe";
+import { OilTypePipe } from './pipes/store/oil-type.pipe';
@@ -98,6 +99,7 @@ const PIPES = [
],
declarations: [
...PIPES,
+ OilTypePipe,
],
diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts
index 3e22da1..439c5d3 100644
--- a/src/app/services/index.service.ts
+++ b/src/app/services/index.service.ts
@@ -53,6 +53,19 @@ export class IndexService {
});
}
+ /**
+ * @Author Sum1Dream
+ * @methodName addHLTBalance
+ * @Description // 新增余额
+ * @Date 12:12 下午 2022/1/10
+ * @Param
+ */
+ public recharge(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'merStoreAccount/recharge', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* @Author Sum1Dream
* @methodName queryCompanyAccountInfo2JD
@@ -124,5 +137,47 @@ export class IndexService {
});
}
+ /**
+ * @Author Sum1Dream
+ * @methodName getAccount
+ * @Description // 查询门店账户
+ * @Date 10:00 2022/5/18
+ * @Param
+ */
+
+ public getAccount(callBack) {
+ this.http.get(environment.baseUrl + 'merStoreAccount/getAccount').subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName getGasStatistical
+ * @Description // 查询门店账户
+ * @Date 10:00 2022/5/18
+ * @Param
+ */
+ public getGasStatistical(callBack) {
+ this.http.get(environment.baseUrl + 'highGas/getGasStatistical').subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName getAccountRecordList
+ * @Description // 查询门店账户流失记录
+ * @Date 10:00 2022/5/18
+ * @Param
+ */
+
+ public getAccountRecordList(paramsObject , callBack) {
+ this.http.get(environment.baseUrl + 'merStoreAccount/getAccountRecordList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+
}
diff --git a/src/app/services/merchant-store.service.ts b/src/app/services/merchant-store.service.ts
index 8c3a479..5854d19 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 getOilPriceListByStore(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'gasOilPrice/getOilPriceListByStore?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 超级管理员查询门店列表
*
@@ -88,5 +100,80 @@ export class MerchantStoreService {
});
}
+ /**
+ * 查询油站油品详情
+ *
+ * @param paramsObject 对象
+ * @param callBack 回调
+ */
+ public getOilPriceDetail(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'gasOilPrice/getOilPriceDetail?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * 编辑油品
+ *
+ * @param params 上传对象
+ * @param callBack 回调
+ * @return data 返回结果
+ */
+ public editGasOilPrice(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'gasOilPrice/editGasOilPrice', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * 删除油品
+ *
+ * @param params 上传对象
+ * @param callBack 回调
+ * @return data 返回结果
+ */
+ public delOilPrice(params: object, callBack) {
+ console.log(params);
+ this.http.post(environment.baseUrl + 'gasOilPrice/delOilPrice', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * 删除油枪
+ *
+ * @param params 上传对象
+ * @param callBack 回调
+ * @return data 返回结果
+ */
+ public delGunNo(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'gasOilGunNo/delGunNo', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * 查询油站油品油枪
+ *
+ * @param oilPriceId 对象
+ * @param callBack 回调
+ */
+ public getGunNoListByOilPrice(oilPriceId: number, callBack) {
+ this.http.get(environment.baseUrl + 'gasOilGunNo/getGunNoListByOilPrice?oilPriceId=' + oilPriceId).subscribe(data => {
+ callBack(data);
+ });
+ }
+ /**
+ * 配置油枪号
+ *
+ * @param params 上传对象
+ * @param callBack 回调
+ * @return data 返回结果
+ */
+ public addGasOilPrice(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'gasOilGunNo/addGasOilPrice', params).subscribe(data => {
+ callBack(data);
+ });
+ }
}