门店名称
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 43be6b1..372f5d0 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
@@ -2,7 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {environment} from '../../../../environments/environment';
import {MerchantService} from '../../../services/merchant.service';
-import {NzMessageService} from 'ng-zorro-antd';
+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';
@@ -10,6 +10,15 @@ import {MerchantStoreService} from '../../../services/merchant-store.service';
declare var AMap: any; // 一定要声明AMap,要不然报错找不到AMap
declare var AMapUI: any;
+function getBase64(file: File): Promise {
+ return new Promise((resolve, reject) => {
+ const reader = new FileReader();
+ reader.readAsDataURL(file);
+ reader.onload = () => resolve(reader.result);
+ reader.onerror = error => reject(error);
+ });
+}
+
@Component({
selector: 'app-store-edit',
templateUrl: './store-edit.component.html',
@@ -25,6 +34,7 @@ export class StoreEditComponent implements OnInit {
logoFile = [];
WEB_SERVE_URL = environment.baseUrl;
previewVisible = false;
+ previewImage: string | undefined = '';
constructor(
private fb: FormBuilder,
@@ -62,6 +72,16 @@ export class StoreEditComponent implements OnInit {
}
+ // 图片查看
+ handlePreview = async (file: NzUploadFile) => {
+ if (!file.url && !file.preview) {
+ // tslint:disable-next-line:no-non-null-assertion
+ file.preview = await getBase64(file.originFileObj!);
+ }
+ this.previewImage = file.url || file.preview;
+ this.previewVisible = true;
+ }
+
// 返回
getBack() {
history.back();
@@ -83,14 +103,13 @@ export class StoreEditComponent implements OnInit {
return;
}
}
- console.log(this.validateForm.value);
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.merchantLogo = this.logoFile[0]['response']['return_data'][0];
+ this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0];
} else {
- this.validateForm.value.merchantLogo = this.logoFile[0].name;
+ this.validateForm.value.storeLogo = this.logoFile[0].name;
}
}
if (this.editFlag) {
@@ -121,6 +140,18 @@ export class StoreEditComponent implements OnInit {
if (data['return_code'] === '000000') {
data['return_data'].telephone = data['return_data'].secUser.loginName;
data['return_data'].password = data['return_data'].secUser.password;
+ if (data['return_data']['storeLogo'] != null && data['return_data']['storeLogo'] !== '') {
+ const logo = String(data['return_data']['storeLogo']);
+ const logoArray = [];
+ logoArray.push(
+ {
+ uid: 1,
+ name: logo,
+ status: 'done',
+ url: environment.imageUrl + logo
+ });
+ this.logoFile = logoArray;
+ }
this.validateForm.patchValue(data['return_data']);
this.getMap();
} else {
diff --git a/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.html b/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.html
new file mode 100644
index 0000000..a95a9d6
--- /dev/null
+++ b/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.html
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
+
共计 {{total}} 条数据
+
+
+
+
+
+
+ 编号 |
+ 商品名称 |
+ 订单来源 |
+ 订单类型 |
+ 订单号 |
+ 支付流水号 |
+ 客户名称 |
+ 客户电话 |
+ 支付模式 |
+ 支付方式 |
+ 支付金额 |
+ 生成时间 |
+ 支付时间 |
+ 取消时间 |
+ 状态 |
+
+
+
+
+ {{i+1}} |
+ {{data.goodsName}} |
+ {{data.giveawayType}} |
+ {{data.goodsType}} |
+ {{data.orderNo}} |
+ {{data.paySerialNo}} |
+ {{data.memName == null ? '暂无': data.memName}} |
+ {{data.memPhone == null ? '暂无': data.memPhone}} |
+ {{data.payModel}} |
+ {{data.payType}} |
+ {{data.payPrice}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.cancelTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.orderStatus}} |
+
+
+
+
+
+
+
+ 退款理由
+
+
+
+
+
+
diff --git a/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.scss b/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.ts b/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.ts
new file mode 100644
index 0000000..ed547f0
--- /dev/null
+++ b/src/app/admin/order/dicount-package-order-list/dicount-package-order-list.component.ts
@@ -0,0 +1,192 @@
+import { Component, OnInit } from '@angular/core';
+import {environment} from '../../../../environments/environment';
+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 {CommonsService} from '../../../services/commons.service';
+import {OrderService} from '../../../services/order.service';
+import {CompanyService} from '../../../services/company.service';
+import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
+import {LocalStorageService} from '../../../services/local-storage.service';
+
+@Component({
+ selector: 'app-dicount-package-order-list',
+ templateUrl: './dicount-package-order-list.component.html',
+ styleUrls: ['./dicount-package-order-list.component.scss']
+})
+export class DicountPackageOrderListComponent implements OnInit {
+
+ WEB_SERVE_URL = environment.baseUrl;
+ FILE_URL = environment.imageUrl;
+ searchForm: FormGroup; // 搜索框
+ requestData = []; // 列表数据
+ companyData = []; // 列表数据
+ merchantData = []; // 列表数据
+ total: number; // 页码
+ pageNum = 1; // 页码
+ pageSize = 10; // 条码
+ loading = true;
+ id: number; // 订单ID
+ isVisible = false;
+ refundContent: string;
+ roleType: number;
+ constructor(
+ private form: FormBuilder,
+ private order: OrderService,
+ private iconService: IconService,
+ private message: NzMessageService,
+ private router: Router,
+ private company: CompanyService,
+ private merchant: MerchantService,
+ private store: LocalStorageService, // 数据请求
+ private common: CommonsService
+ ) {
+ }
+
+ ngOnInit(): void {
+ this.init();
+ this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole']['roleType'];
+ const whereObject = {};
+ whereObject['pageNum'] = 1;
+ whereObject['pageSize'] = 10000;
+ this.company.selectCompanyList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ this.companyData = data['return_data'].list;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ if (this.roleType === 5) {
+ this.getMerchantListByCompany(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id']);
+ } else {
+ this.getMerchantListByCompany(this.searchForm.value.companyId);
+ }
+
+ }
+
+ public init(): void {
+ this.searchForm = this.form.group({
+ companyId: [null],
+ merchantId: [null],
+ orderNo: [null],
+ paySerialNo: [null],
+ payModel: [null],
+ payType: [null],
+ memDiscountName: [null],
+ memPhone: [null],
+ orderStatus: [null],
+ payTime: [null]
+ });
+ this.getRequest(true, this.searchForm.value);
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
+ whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
+ whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
+ }
+
+
+ this.loading = false;
+ if (reset) {
+ this.pageNum = 1;
+ }
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ this.order.getDiscountPackageList(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 getMerchantListByCompany(companyId: number): void {
+ this.merchant.getMerchantListByCompany(companyId, data => {
+ if (data['return_code'] === '000000') {
+ if (data['return_code'] === '000000') {
+ this.merchantData = data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ // 重置
+ public resetForm(): void {
+ this.searchForm.reset();
+ }
+
+
+ // 查看详情
+ public getDetail(id: number): void {
+ this.router.navigate(['/admin/order/order-detail'], {
+ queryParams: {
+ merchantId: id
+ }
+ }).then(r => console.log(r));
+ }
+
+ // 下载模板
+ downloadTemplate(whereObject) {
+ if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
+ whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
+ whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
+ }
+ this.order.exportDiscountPackageList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ window.location.href = this.FILE_URL + data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ provinceChange(e) {
+ console.log(e);
+ }
+
+ // 退款
+ public orderToRefund(id): void {
+
+ }
+
+ showModal(id): void {
+ this.id = id;
+ this.isVisible = true;
+ }
+
+ handleOk(): void {
+ this.common.showConfirm('确认订单是否退款', item => {
+ if (item) {
+ const params = {
+ orderId: this.id ,
+ refundContent: this.refundContent
+ };
+ this.order.refuelingOrderRefund(params, data => {
+ if (data['return_code'] === '000000') {
+ this.getRequest(false, this.searchForm.value);
+ this.isVisible = false;
+ this.message.success('退款成功');
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+ });
+ }
+
+ handleCancel(): void {
+ this.isVisible = false;
+ }
+}
diff --git a/src/app/admin/order/order-list/order-list.component.html b/src/app/admin/order/order-list/order-list.component.html
index 245c602..dbdee41 100644
--- a/src/app/admin/order/order-list/order-list.component.html
+++ b/src/app/admin/order/order-list/order-list.component.html
@@ -70,6 +70,8 @@
+
+
diff --git a/src/app/admin/order/order-routing.module.ts b/src/app/admin/order/order-routing.module.ts
index f894dc4..0d56bd1 100644
--- a/src/app/admin/order/order-routing.module.ts
+++ b/src/app/admin/order/order-routing.module.ts
@@ -10,8 +10,12 @@ import {OrderKListComponent} from './order-k-list/order-k-list.component';
import {OrderHListComponent} from './order-h-list/order-h-list.component';
import {OrderAgentComponent} from './order-agent/order-agent.component';
import {PreOrderComponent} from './pre-order/pre-order.component';
+<<<<<<< HEAD
import {PackageRecordListComponent} from './package-record-list/package-record-list.component';
import {DiscountUseConditionListComponent} from './discount-use-condition-list/discount-use-condition-list.component';
+=======
+import {DicountPackageOrderListComponent} from './dicount-package-order-list/dicount-package-order-list.component';
+>>>>>>> a9b4eaf54ddd85df8da4868c8de4a63783d5eaf6
const routes: Routes = [
@@ -25,8 +29,12 @@ const routes: Routes = [
{ path: 'order-h-list', component: OrderHListComponent },
{ path: 'order-agent', component: OrderAgentComponent },
{ path: 'pre-order', component: PreOrderComponent },
+<<<<<<< HEAD
{ path: 'package-record-list', component: PackageRecordListComponent },
{ path: 'discount-use-condition-list', component: DiscountUseConditionListComponent },
+=======
+ { path: 'discount-package-order-list', component: DicountPackageOrderListComponent},
+>>>>>>> a9b4eaf54ddd85df8da4868c8de4a63783d5eaf6
];
@NgModule({
diff --git a/src/app/admin/order/order.module.ts b/src/app/admin/order/order.module.ts
index fa98261..ae1162a 100644
--- a/src/app/admin/order/order.module.ts
+++ b/src/app/admin/order/order.module.ts
@@ -20,22 +20,20 @@ import { OrderAgentComponent } from './order-agent/order-agent.component';
import { PreOrderComponent } from './pre-order/pre-order.component';
import { PackageRecordListComponent } from './package-record-list/package-record-list.component';
import { DiscountUseConditionListComponent } from './discount-use-condition-list/discount-use-condition-list.component';
-import {NzSpaceModule} from "_ng-zorro-antd@9.3.0@ng-zorro-antd/space";
-
+import {DicountPackageOrderListComponent} from "./dicount-package-order-list/dicount-package-order-list.component";
@NgModule({
- declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent, DiscountUseConditionListComponent],
- imports: [
- CommonModule,
- OrderRoutingModule,
- NgZorroAntdModule,
- SeparateModule,
- ReactiveFormsModule,
- FormsModule,
- BreadcrumbModule,
- RegionSelectorModule,
- AppCommonModule,
- NzSpaceModule
- ]
+ declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent, DiscountUseConditionListComponent, DicountPackageOrderListComponent],
+ imports: [
+ CommonModule,
+ OrderRoutingModule,
+ NgZorroAntdModule,
+ SeparateModule,
+ ReactiveFormsModule,
+ FormsModule,
+ BreadcrumbModule,
+ RegionSelectorModule,
+ AppCommonModule
+ ]
})
export class OrderModule { }
diff --git a/src/app/services/discount-package.service.ts b/src/app/services/discount-package.service.ts
index 3c6abcb..ef3d328 100644
--- a/src/app/services/discount-package.service.ts
+++ b/src/app/services/discount-package.service.ts
@@ -180,5 +180,18 @@ export class DiscountPackageService {
});
}
+ /**
+ * @Author Sum1Dream
+ * @methodName getDiscountPackageOrderList
+ * @Description // 查询优惠券包订单列表
+ * @Date 4:19 下午 2021/12/9
+ * @Param [paramsObject: object, callBack]
+ */
+ public getDiscountPackageOrderList(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'highDiscountPackage/getDiscountPackageOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
}
diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts
index 22d1c0a..87e0c15 100644
--- a/src/app/services/order.service.ts
+++ b/src/app/services/order.service.ts
@@ -26,6 +26,19 @@ export class OrderService {
});
}
+ /**
+ * @Author Sum1Dream
+ * @methodName getDiscountPackageList
+ * @Description // 查询优惠券包订单列表
+ * @Date 5:24 下午 2021/12/9
+ * @Param [paramsObject: object, callBack]
+ */
+ public getDiscountPackageList(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'highOrder/getDiscountPackageList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 查询代理商订单列表
*
@@ -93,6 +106,19 @@ export class OrderService {
});
}
+ /**
+ * @Author Sum1Dream
+ * @methodName exportDiscountPackageList
+ * @Description // 到处优惠券包订单列表
+ * @Date 5:25 下午 2021/12/9
+ * @Param [paramsObject: object, callBack]
+ */
+ public exportDiscountPackageList(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'highOrder/exportDiscountPackageList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* @Author Sum1Dream
* @methodName exportListPreOrder