From 943853cd9ee60cd666e771792614fbf86dcb2cdd Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Fri, 28 Oct 2022 09:52:40 +0800
Subject: [PATCH] no message
---
.../kfc-order-list.component.html | 190 ++++++++++++++++++
.../kfc-order-list.component.scss | 0
.../kfc-order-list.component.ts | 118 +++++++++++
.../pipes/third-product/product-type.pipe.ts | 20 ++
src/app/services/order/order-kfc.service.ts | 29 +++
5 files changed, 357 insertions(+)
create mode 100644 src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.html
create mode 100644 src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.scss
create mode 100644 src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.ts
create mode 100644 src/app/pipes/third-product/product-type.pipe.ts
create mode 100644 src/app/services/order/order-kfc.service.ts
diff --git a/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.html b/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.html
new file mode 100644
index 0000000..190cfec
--- /dev/null
+++ b/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.html
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
共计 {{total?total:0}} 条数据
+
+
+
+
+
+
+
+
+ 交易单号 |
+ 客户电话 |
+ 订单名称 |
+ 订单金额 |
+ 支付金额 |
+ 支付方式 |
+ 支付卡号 |
+ 订单状态 |
+ 创建时间 |
+ 操作 |
+
+
+
+
+ {{data.orderNo}} |
+ {{data.memPhone}} |
+ {{data.title}} |
+ ¥{{data.totalPrice}} |
+ ¥{{data.payPrice}} |
+ {{data.orderStatus == 1 || data.orderStatus == 5 ? '未支付' : data.payType | orderPayType}} |
+ {{data.memCardNo}} |
+ {{data.orderStatus | orderStatus}} |
+ {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} |
+
+ 操作列表
+
+
+
+ |
+
+
+
+
+
diff --git a/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.scss b/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.ts b/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.ts
new file mode 100644
index 0000000..164385e
--- /dev/null
+++ b/src/app/admin/order-manage/kfc-order/kfc-order-list/kfc-order-list.component.ts
@@ -0,0 +1,118 @@
+import { Component, OnInit } from '@angular/core';
+import {FormBuilder, FormGroup} from '@angular/forms';
+import {ADMIN_INFO_OBJECT} from '../../../../services/local-storage.namespace';
+import {LocalStorageService} from '../../../../services/local-storage.service';
+import {CompanyService} from '../../../../services/company.service';
+import {CommonsService} from '../../../../services/commons.service';
+import {animate, state, style, transition, trigger} from '@angular/animations';
+import {OrderKfcService} from '../../../../services/order/order-kfc.service';
+import {NzMessageService} from 'ng-zorro-antd';
+
+
+@Component({
+ selector: 'app-kfc-order-list',
+ animations: [
+ trigger('openClose', [
+ state('open', style({
+ height: '260px',
+ opacity: 1,
+ backgroundColor: 'white'
+ })),
+ state('closed', style({
+ opacity: 1,
+ backgroundColor: 'white'
+ })),
+ transition('open => closed', [
+ animate('0.3s')
+ ]),
+ transition('closed => open', [
+ animate('0.3s')
+ ]),
+ ]),
+ ],
+ templateUrl: './kfc-order-list.component.html',
+ styleUrls: ['./kfc-order-list.component.scss']
+})
+export class KfcOrderListComponent implements OnInit {
+
+ // 搜索框
+ searchForm: FormGroup;
+ // 搜索框折叠
+ isCollapse = false;
+ // 订单状态数据
+ orderStatusArray = [];
+ // 公司数据
+ companyArray = [];
+ // 角色类型
+ roleType: number;
+ // 列表相关参数
+ // 总条数
+ total: number;
+ // 页码
+ pageNum = 1;
+ // 条码
+ pageSize = 10;
+ // 列表数据
+ requestData = [];
+ // 列表加载
+ loading = true;
+ constructor(
+ private form: FormBuilder,
+ private store: LocalStorageService,
+ private message: NzMessageService,
+ private kfcOrder: OrderKfcService,
+ private companyService: CompanyService,
+ private commonsService: CommonsService,
+ ) { }
+
+ ngOnInit(): void {
+ // 搜索表单初始化
+ this.searchForm = this.form.group({
+ orderNo: [null],
+ memPhone: [null],
+ payTimeArray: [null],
+ status: [null],
+ createTimeArray: [null],
+ refundTimeArray: [null],
+ companyId: [null],
+ payType: [null],
+ memCardNo: [null],
+ });
+ // 角色类型初始化
+ this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType);
+ // 查询公司列表
+ if (this.roleType === 0 || this.roleType === 1) {
+ this.companyService.selectCompanyList({ pageNum: 1, pageSize: 999 }, data => {
+ this.companyArray = data['return_data']['list'];
+ });
+ }
+ // 查询订单状态数据
+ this.commonsService.getDictionary('ORDER_OIL_STATUS', data => {
+ this.orderStatusArray = data['return_data'];
+ });
+ this.getRequest(true, this.searchForm.value);
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+ this.loading = true;
+ if (reset) {
+ this.pageNum = 1;
+ }
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ this.kfcOrder.getOrderKfcList(whereObject, data => {
+ this.loading = false;
+ if (data['return_code'] === '000000') {
+ console.log(data);
+ this.requestData = data['return_data'].list;
+ this.total = data['return_data'].total;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+}
+
+
diff --git a/src/app/pipes/third-product/product-type.pipe.ts b/src/app/pipes/third-product/product-type.pipe.ts
new file mode 100644
index 0000000..1202bc5
--- /dev/null
+++ b/src/app/pipes/third-product/product-type.pipe.ts
@@ -0,0 +1,20 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'productType'
+})
+export class ProductTypePipe implements PipeTransform {
+
+ array = {
+ 1: ['星巴克'],
+ 2: ['', '肯德基'],
+ 3: ['', '', '第三方产品'],
+ 4: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油'],
+ 5: ['', '', '', '', '在线加油'],
+ };
+
+ transform(type: number , product: number): string {
+ return this.array[type][product - 1];
+ }
+
+}
diff --git a/src/app/services/order/order-kfc.service.ts b/src/app/services/order/order-kfc.service.ts
new file mode 100644
index 0000000..a920995
--- /dev/null
+++ b/src/app/services/order/order-kfc.service.ts
@@ -0,0 +1,29 @@
+import { Injectable } from '@angular/core';
+import {HttpClient} from '@angular/common/http';
+import {CommonsService} from '../commons.service';
+import {environment} from "../../../environments/environment";
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class OrderKfcService {
+
+ constructor(
+ private http: HttpClient,
+ private common: CommonsService
+ ) { }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName getOrderKfcList
+ * @Description // 查询肯德基订单
+ * @Date 17:20 2022/10/27
+ * @Param param
+ */
+ public getOrderKfcList(param: object, callBack) {
+ this.http.get(environment.orderUrl + 'thirdParty/getOrderKfcList?' + this.common.getWhereCondition(param)).subscribe(data => {
+ callBack(data);
+ });
+ }
+}