From 29f3ac7adbaf4a6520eaddb0612f54971bebe006 Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Tue, 16 May 2023 14:11:41 +0800
Subject: [PATCH 1/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
angular.json | 2 +-
src/app/admin/audit/audit.module.ts | 22 ++++++++++++----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/angular.json b/angular.json
index 218e30d..979f2e4 100644
--- a/angular.json
+++ b/angular.json
@@ -70,7 +70,7 @@
}
]
},
- "test": {
+ "dev": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
diff --git a/src/app/admin/audit/audit.module.ts b/src/app/admin/audit/audit.module.ts
index a8c53d5..4a3c492 100644
--- a/src/app/admin/audit/audit.module.ts
+++ b/src/app/admin/audit/audit.module.ts
@@ -10,19 +10,21 @@ import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {AppCommonModule} from '../../app-common.module';
import { RefundAuditComponent } from './refund-audit/refund-audit.component';
import { GoodsAuditComponent } from './goods-audit/goods-audit.component';
+import {PreviewImageModule} from '../../common/preview-image/preview-image.module';
@NgModule({
declarations: [AuditCouponComponent, RefundAuditComponent, GoodsAuditComponent],
- imports: [
- CommonModule,
- AuditRoutingModule,
- NgZorroAntdModule,
- SeparateModule,
- ReactiveFormsModule,
- FormsModule,
- BreadcrumbModule,
- AppCommonModule
- ]
+ imports: [
+ CommonModule,
+ AuditRoutingModule,
+ NgZorroAntdModule,
+ SeparateModule,
+ ReactiveFormsModule,
+ FormsModule,
+ BreadcrumbModule,
+ AppCommonModule,
+ PreviewImageModule
+ ]
})
export class AuditModule { }
From 2c4d2c059b8718a560b3616dc4456d1025bdbb28 Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Tue, 16 May 2023 14:12:06 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../goods-audit/goods-audit.component.html | 160 +++++
.../goods-audit/goods-audit.component.scss | 0
.../goods-audit/goods-audit.component.ts | 119 ++++
.../freight/freight.component.html | 135 +++++
.../freight/freight.component.scss | 0
.../freight/freight.component.ts | 172 ++++++
src/app/admin/goods/goods-routing.module.ts | 14 +
src/app/admin/goods/goods.module.ts | 30 +
src/app/admin/goods/list/list.component.html | 434 ++++++++++++++
src/app/admin/goods/list/list.component.scss | 3 +
src/app/admin/goods/list/list.component.ts | 562 ++++++++++++++++++
.../goods-order/goods-order.component.html | 296 +++++++++
.../goods-order/goods-order.component.scss | 9 +
.../goods-order/goods-order.component.ts | 211 +++++++
.../preview-image.component.html | 7 +
.../preview-image.component.scss | 4 +
.../preview-image/preview-image.component.ts | 21 +
.../preview-image/preview-image.module.ts | 21 +
src/app/enum/present-type.enum.ts | 5 +
src/app/enum/url.enum.ts | 3 +
src/app/pipes/goods/goods-status.pipe.ts | 19 +
src/app/pipes/goods/logistics-status.pipe.ts | 28 +
src/app/services/goods/goods.service.ts | 314 ++++++++++
23 files changed, 2567 insertions(+)
create mode 100644 src/app/admin/audit/goods-audit/goods-audit.component.html
create mode 100644 src/app/admin/audit/goods-audit/goods-audit.component.scss
create mode 100644 src/app/admin/audit/goods-audit/goods-audit.component.ts
create mode 100644 src/app/admin/config-manage/freight/freight.component.html
create mode 100644 src/app/admin/config-manage/freight/freight.component.scss
create mode 100644 src/app/admin/config-manage/freight/freight.component.ts
create mode 100644 src/app/admin/goods/goods-routing.module.ts
create mode 100644 src/app/admin/goods/goods.module.ts
create mode 100644 src/app/admin/goods/list/list.component.html
create mode 100644 src/app/admin/goods/list/list.component.scss
create mode 100644 src/app/admin/goods/list/list.component.ts
create mode 100644 src/app/admin/order-manage/goods-order/goods-order.component.html
create mode 100644 src/app/admin/order-manage/goods-order/goods-order.component.scss
create mode 100644 src/app/admin/order-manage/goods-order/goods-order.component.ts
create mode 100644 src/app/common/preview-image/preview-image.component.html
create mode 100644 src/app/common/preview-image/preview-image.component.scss
create mode 100644 src/app/common/preview-image/preview-image.component.ts
create mode 100644 src/app/common/preview-image/preview-image.module.ts
create mode 100644 src/app/enum/present-type.enum.ts
create mode 100644 src/app/enum/url.enum.ts
create mode 100644 src/app/pipes/goods/goods-status.pipe.ts
create mode 100644 src/app/pipes/goods/logistics-status.pipe.ts
create mode 100644 src/app/services/goods/goods.service.ts
diff --git a/src/app/admin/audit/goods-audit/goods-audit.component.html b/src/app/admin/audit/goods-audit/goods-audit.component.html
new file mode 100644
index 0000000..36abf4e
--- /dev/null
+++ b/src/app/admin/audit/goods-audit/goods-audit.component.html
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
共计 {{total}} 条数据
+
+
+
+ 编号 |
+ 审核流水号 |
+ 审核对象名称 |
+ 审核类型 |
+ 提交人员 |
+ 创建时间 |
+ 状态 |
+ 操作 |
+
+
+
+
+ {{i+1}} |
+ {{data.approveSerialNo}} |
+ {{data.objectName}} |
+ {{data.objectType | auditType}} |
+ {{data.submitOperatorName}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
+ {{data.status | auditStatus}} |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ {{data['approve']['objectType'] | auditType}}
+ {{data['approve']['status'] | auditStatus}}
+ {{data['approve']['submitOperatorName']}}
+ {{data['approve']['objectName']}}
+
+
+
+
+
+
+
+
+
+
+
+ {{data['object']['name']}}
+ {{data['object']['goodsTypeName']}}
+ {{data['object']['createTime'] | date : 'yyyy-MM-dd'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 名称 |
+ 图片 |
+ 销售价格 |
+ 售卖价格 |
+ 创建时间 |
+
+
+
+
+
+ {{data.name}} |
+
+
+ |
+ ¥{{data.originalPrice}} |
+ ¥{{data.price}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
+
+
+
+
+
+
+
+
diff --git a/src/app/admin/audit/goods-audit/goods-audit.component.scss b/src/app/admin/audit/goods-audit/goods-audit.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/audit/goods-audit/goods-audit.component.ts b/src/app/admin/audit/goods-audit/goods-audit.component.ts
new file mode 100644
index 0000000..d2abdfd
--- /dev/null
+++ b/src/app/admin/audit/goods-audit/goods-audit.component.ts
@@ -0,0 +1,119 @@
+import { Component, OnInit } from '@angular/core';
+import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
+import {AuditService} from '../../../services/audit.service';
+import {IconService} from '../../../services/icon.service';
+import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {CommonsService} from '../../../services/commons.service';
+
+@Component({
+ selector: 'app-goods-audit',
+ templateUrl: './goods-audit.component.html',
+ styleUrls: ['./goods-audit.component.scss']
+})
+export class GoodsAuditComponent implements OnInit {
+
+ searchForm: FormGroup; // 搜索框
+ requestData = []; // 列表数据
+ total: number; // 页码
+ pageNum = 1; // 页码
+ pageSize = 10; // 条码
+ loading = true;
+ isVisible = false;
+ id: number;
+ objectType;
+ data = {
+ approve: {},
+ object: {}
+ };
+ constructor(
+ private form: FormBuilder,
+ private audit: AuditService,
+ private iconService: IconService,
+ private message: NzMessageService,
+ private common: CommonsService,
+ ) {
+ }
+
+ ngOnInit(): void {
+ this.init();
+
+ }
+
+ public init(): void {
+ this.searchForm = this.form.group({
+ objectType: [4],
+ objectName: [null],
+ approveSerialNo: [null],
+ });
+ this.getRequest(true, this.searchForm.value);
+ }
+
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ this.loading = false;
+ if (reset) {
+ this.pageNum = 1;
+ }
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ this.audit.getApproveList(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 getDetail(id: number , objectType: number): void {
+ this.id = id;
+ this.objectType = objectType;
+ this.audit.getApproveDetail(id, data => {
+ if (data['return_code'] === '000000') {
+ this.data = data['return_data'];
+ this.isVisible = true;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+
+ }
+
+ handleCancel(): void {
+ this.isVisible = false;
+ }
+
+ public approveProcessed(statusD: number, id: number): void {
+ this.id = id;
+ const p = {
+ approveId: this.id,
+ status: statusD,
+ remarks: '',
+ };
+ this.common.showConfirm('是否确定', r => {
+ if (r) {
+
+ this.audit.approveProcessed(p, data => {
+ if (data['return_code'] === '000000') {
+ this.isVisible = false;
+ this.getRequest(true, this.searchForm.value);
+ this.message.success('操作成功');
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+ });
+
+ }
+}
diff --git a/src/app/admin/config-manage/freight/freight.component.html b/src/app/admin/config-manage/freight/freight.component.html
new file mode 100644
index 0000000..bccfe59
--- /dev/null
+++ b/src/app/admin/config-manage/freight/freight.component.html
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
共计 {{total}} 条数据
+
+
+
+
+
+
+ 编号 |
+ 区域名称 |
+ 包邮价格 |
+ 运费 |
+ 创建时间 |
+ 状态 |
+ 操作 |
+
+
+
+
+ {{i + 1}} |
+ {{data.regionName}} |
+ ¥{{data.freePostPrice}} |
+ ¥{{data.freightPrice}} |
+ {{data.createTime | date: 'yyyy-MM-dd'}} |
+ {{data.status== 2? '审核中':'生效'}} |
+
+ 编辑
+
+ 删除
+ |
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/admin/config-manage/freight/freight.component.scss b/src/app/admin/config-manage/freight/freight.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/config-manage/freight/freight.component.ts b/src/app/admin/config-manage/freight/freight.component.ts
new file mode 100644
index 0000000..ca321ca
--- /dev/null
+++ b/src/app/admin/config-manage/freight/freight.component.ts
@@ -0,0 +1,172 @@
+import { Component, OnInit } from '@angular/core';
+import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
+import {environment} from '../../../../environments/environment';
+import {NzModalService, NzNotificationService, NzUploadFile} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {CommonsService} from '../../../services/commons.service';
+import {GoodsService} from '../../../services/goods/goods.service';
+
+@Component({
+ selector: 'app-freight',
+ templateUrl: './freight.component.html',
+ styleUrls: ['./freight.component.scss']
+})
+export class FreightComponent implements OnInit {
+
+ // 搜索框
+ searchForm: FormGroup;
+ // 表单
+ validateForm: FormGroup;
+ url = environment;
+ // 列表数据
+ requestData = [];
+ // 总数
+ total: number;
+ // 页码
+ pageNum = 1;
+ // 条码
+ pageSize = 10;
+ // 等待
+ loading = false;
+ // 是否修改
+ editFlag = false;
+ // 编辑等待
+ isSpinningEdit = false;
+ // 弹出框编辑
+ isVisible = false;
+ id;
+ regionalData = [];
+ constructor(
+ private form: FormBuilder,
+ private notification: NzNotificationService,
+ private commonsService: CommonsService,
+ private modalService: NzModalService,
+ private goods: GoodsService
+ ) {
+ }
+
+ // 输入框内容
+ formatterPercent = (value: number): string => `${value == null ? 0 : value} ¥`;
+ parserPercent = (value: string): string => value.replace(' ¥', '');
+
+
+ ngOnInit(): void {
+
+ // 初始化搜索表单
+ this.searchForm = this.form.group({
+ regionName: [null],
+ regionId: [null],
+ });
+ // 初始化商品表单
+ this.validateForm = this.form.group({
+ regionId: [null, [Validators.required]],
+ freePostPrice: [null, [Validators.required]],
+ freightPrice: [null, [Validators.required]],
+ });
+ this.getRequest(true, this.searchForm.value);
+ this.commonsService.getRegional(data => {
+ if (data['return_code'] === '000000') {
+ this.regionalData = data['return_data'];
+ }
+ });
+
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ this.loading = true;
+ if (reset) {
+ this.pageNum = 1;
+ }
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ this.goods.getListRegionFreight(whereObject, data => {
+ this.loading = false;
+ if (data['return_code'] === '000000') {
+ this.requestData = data['return_data'].list;
+ this.total = data['return_data'].total;
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ }
+
+ // 编辑产品
+ public getEdit(id?: number): void {
+ this.isVisible = true;
+ this.id = id;
+ if (id != null) {
+ this.editFlag = true;
+ this.findGoodsDetailById(id);
+ }
+ }
+
+
+ // 查询商品详情
+ public findGoodsDetailById(id: number): void {
+ this.goods.findRegionFreightById(id , data => {
+ if (data['return_code'] === '000000') {
+ data['return_data']['regionId'] = Number(data['return_data']['regionId']);
+ this.validateForm.patchValue(data['return_data']);
+ }
+ });
+ }
+
+ // 确认提交
+ public handleOkEdit() {
+ for (const i in this.validateForm.controls) {
+ this.validateForm.controls[i].markAsDirty();
+ this.validateForm.controls[i].updateValueAndValidity();
+ if (this.validateForm.controls[i].errors != null) {
+ return;
+ }
+ }
+
+
+ if (this.editFlag) {
+ this.validateForm.value.id = this.id;
+ this.isSpinningEdit = true;
+ this.goods.updateRegionFreight(this.validateForm.value, data => {
+ this.isSpinningEdit = false;
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', '修改成功!');
+ this.isVisible = false;
+ this.getRequest(true, this.searchForm.value);
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ } else {
+ this.goods.insertRegionFreight(this.validateForm.value, data => {
+ this.isSpinningEdit = false;
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', '添加成功!');
+ this.isVisible = false;
+ this.getRequest(true, this.searchForm.value);
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ }
+ }
+ // 删除商品
+ public deleteFreight(id): void {
+ this.modalService.confirm({
+ nzTitle: '确定删除',
+ nzOkText: '是',
+ nzOnOk: () => {
+ this.goods.deleteRegionFreight(id, data => {
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', `删除成功!`);
+ this.getRequest(true, this.searchForm.value);
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ },
+ nzCancelText: '否',
+ });
+ }
+
+
+}
diff --git a/src/app/admin/goods/goods-routing.module.ts b/src/app/admin/goods/goods-routing.module.ts
new file mode 100644
index 0000000..6e6895f
--- /dev/null
+++ b/src/app/admin/goods/goods-routing.module.ts
@@ -0,0 +1,14 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import {ListComponent} from './list/list.component';
+
+
+const routes: Routes = [
+ { path: 'list', component: ListComponent },
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class GoodsRoutingModule { }
diff --git a/src/app/admin/goods/goods.module.ts b/src/app/admin/goods/goods.module.ts
new file mode 100644
index 0000000..db97468
--- /dev/null
+++ b/src/app/admin/goods/goods.module.ts
@@ -0,0 +1,30 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { GoodsRoutingModule } from './goods-routing.module';
+import { ListComponent } from './list/list.component';
+import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {SeparateModule} from '../../common/separate/separate.module';
+import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms';
+import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
+import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
+import {AppCommonModule} from '../../app-common.module';
+import {PreviewImageModule} from "../../common/preview-image/preview-image.module";
+
+
+@NgModule({
+ declarations: [ListComponent],
+ imports: [
+ CommonModule,
+ GoodsRoutingModule,
+ NgZorroAntdModule,
+ SeparateModule,
+ ReactiveFormsModule,
+ FormsModule,
+ BreadcrumbModule,
+ RegionSelectorModule,
+ AppCommonModule,
+ PreviewImageModule
+ ]
+})
+export class GoodsModule { }
diff --git a/src/app/admin/goods/list/list.component.html b/src/app/admin/goods/list/list.component.html
new file mode 100644
index 0000000..d3caf7c
--- /dev/null
+++ b/src/app/admin/goods/list/list.component.html
@@ -0,0 +1,434 @@
+
+
+
+
+
+
+
+
+
共计 {{total}} 条数据
+
+
+
+
+
+
+ 编号 |
+ 商品名称 |
+ 商品标签 |
+ 商品类型 |
+ 列表图片 |
+ 创建时间 |
+ 状态 |
+ 操作 |
+
+
+
+
+ {{i + 1}} |
+ {{data.name}} |
+ {{data.goodsLabel }} |
+ {{data.goodsTypeName }} |
+
+
+ |
+ {{data.createTime | date: 'yyyy-MM-dd'}} |
+ {{data.status | goodsStatus}} |
+
+ 编辑
+
+ 更多操作
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 名称 |
+ 图片 |
+ 销售价格 |
+ 售卖价格 |
+ 创建时间 |
+ 更新时间 |
+ 操作 |
+
+
+
+
+ {{data.name}} |
+
+
+ |
+ ¥{{data.originalPrice}} |
+ ¥{{data.price}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
+ {{data.updateTime | date: 'yyyy-MM-dd HH:mm'}} |
+
+ 编辑
+
+ 删除
+ |
+
+
+
+
+
+
+
+
+
+
+ 类型
+
+
+
+
+
+ {{control.type === 1 ? '卡券': '优惠券'}}
+
+
+
+
+
+ 代理商
+
+
+
+
+ {{control.agentName}}
+
+
+
+
+
+
+ 优惠券
+
+
+
+
+ {{control.sourceName}}
+
+
+
+
+
+ 卡券
+
+
+
+
+ {{control.sourceName}}
+
+
+
+
+
+ 奖励数量
+
+
+ {{control.num}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 类型 |
+ 赠送内容 |
+ 数量 |
+ 创建时间 |
+ 更新时间 |
+ 操作 |
+
+
+
+
+ {{data.type === 1 ? '卡券': '优惠券'}} |
+ {{data.sourceName}} |
+ {{data.num}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
+ {{data.updateTime | date: 'yyyy-MM-dd HH:mm'}} |
+
+
+
+ 删除
+ |
+
+
+
+
diff --git a/src/app/admin/goods/list/list.component.scss b/src/app/admin/goods/list/list.component.scss
new file mode 100644
index 0000000..8c20ea2
--- /dev/null
+++ b/src/app/admin/goods/list/list.component.scss
@@ -0,0 +1,3 @@
+.btn {
+ margin-top: 20px;
+}
diff --git a/src/app/admin/goods/list/list.component.ts b/src/app/admin/goods/list/list.component.ts
new file mode 100644
index 0000000..42f3b64
--- /dev/null
+++ b/src/app/admin/goods/list/list.component.ts
@@ -0,0 +1,562 @@
+import {Component, OnInit} from '@angular/core';
+import {FormBuilder, FormGroup, Validators} from '@angular/forms';
+import {GoodsService} from '../../../services/goods/goods.service';
+import {environment} from '../../../../environments/environment';
+import {NzNotificationService, NzUploadFile} from 'ng-zorro-antd';
+import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {CommonsService} from '../../../services/commons.service';
+import {AgentService} from '../../../services/agent.service';
+import {CouponService} from '../../../services/coupon.service';
+import {PresentType} from '../../../enum/present-type.enum';
+
+
+
+@Component({
+ selector: 'app-list',
+ templateUrl: './list.component.html',
+ styleUrls: ['./list.component.scss']
+})
+export class ListComponent implements OnInit {
+
+ // 搜索框
+ searchForm: FormGroup;
+ // 商品表单
+ validateForm: FormGroup;
+ // 商品sku表单
+ validateFormSku: FormGroup;
+ url = environment;
+ // 列表数据
+ requestData = [];
+ // 总数
+ total: number;
+ // 页码
+ pageNum = 1;
+ // 条码
+ pageSize = 10;
+ // 等待
+ loading = false;
+ // 是否修改
+ editFlag = false;
+ // 编辑等待
+ isSpinningEdit = false;
+ // 弹出框编辑商品
+ isVisibleEdit = false;
+ // 弹出框编辑sku
+ isVisibleSku = false;
+ // 商品标题
+ title: string;
+ // 商品ID
+ goodsId: number;
+ // 商品类型数据
+ goodsTypeData;
+ // 展示大图图片
+ previewImage: string | undefined = '';
+ previewVisible = false;
+ // 列表图片
+ listImg = [];
+ // 轮播图
+ bannerImg = [];
+ // 详情图
+ detailImg = [];
+ // sku展示小图
+ showImg = [];
+ // sku轮播图
+ bannerSkuImg = [];
+ // sku弹出框
+ isVisibleSkuList = false;
+ // SKU列表等待
+ loadingSku = false;
+ // SKU数据
+ skuData = [];
+ skuId = null;
+ isVisiblePresent = false;
+ // 优惠券数据
+ discountList = [];
+ // 卡券列表
+ listOfOption = [];
+ // 赠送内容
+ listOfControl = [{
+ isEdit: true,
+ agentId: null,
+ num: null,
+ sourceId: null,
+ agentName: null,
+ goodsId: null,
+ sourceName: null,
+ type: null,
+ }];
+ // 代理商列表
+ agentData = [];
+ presentType = PresentType;
+ isVisiblePresentList = false;
+ presentData = [];
+
+ constructor(
+ private form: FormBuilder,
+ private notification: NzNotificationService,
+ private commonsService: CommonsService,
+ private modalService: NzModalService,
+ private agent: AgentService,
+ private coupon: CouponService,
+ private goods: GoodsService
+ ) {
+ }
+
+ // 输入框内容
+ formatterPercent = (value: number): string => `${value == null ? 0 : value} ¥`;
+ parserPercent = (value: string): string => value.replace(' ¥', '');
+
+
+ ngOnInit(): void {
+
+ // 初始化搜索表单
+ this.searchForm = this.form.group({
+ name: [null],
+ status: [null],
+ goodsLabel: [null],
+ });
+ // 初始化商品表单
+ this.validateForm = this.form.group({
+ name: [null, [Validators.required]],
+ goodsType: [null, [Validators.required]],
+ goodsLabel: [null],
+ listDescribe: [null],
+ });
+ // 初始化商品表单
+ this.validateFormSku = this.form.group({
+ name: [null, [Validators.required]],
+ price: [null, [Validators.required]],
+ originalPrice: [null, [Validators.required]],
+ stock: [null, [Validators.required]],
+ });
+ // 获取商品分类树
+ this.goods.getGoodsTypeTree(3, data => {
+ if (data['return_code'] === '000000') {
+ this.goodsTypeData = data['return_data'];
+ }
+ });
+
+ this.getRequest(true, this.searchForm.value);
+
+ this.agent.getListAgent({
+ pageNum: 1 ,
+ pageSize: 800 ,
+ type: 1
+ }, data => {
+ if (data['return_code'] === '000000') {
+ this.agentData = data['return_data'].list;
+ }
+ });
+ this.coupon.getCouponListByAll({} , data => {
+ if (data['return_code'] === '000000') {
+ this.listOfOption = data['return_data'];
+ }
+ });
+
+
+
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ this.loading = true;
+ if (reset) {
+ this.pageNum = 1;
+ }
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ this.goods.getListGoodsDetail(whereObject, data => {
+ this.loading = false;
+ if (data['return_code'] === '000000') {
+ this.requestData = data['return_data'].list;
+ this.total = data['return_data'].total;
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ }
+
+ public getDiscount(id: number): void {
+ const whereObject = {};
+ whereObject['pageNum'] = 1;
+ whereObject['pageSize'] = 10000;
+ whereObject['agentId'] = id;
+ this.agent.getDiscountAgentList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ this.discountList = data['return_data'].list;
+ }
+ });
+ }
+
+ getSourceNameName(id: number , i , presentType: any ) {
+
+ console.log(i);
+
+ if (presentType === this.presentType.discountName) {
+ this.listOfControl[i].sourceName = this.discountList.find(item => {
+ return item.id === id;
+ })['highDiscount'].discountName;
+ }
+ if (presentType === this.presentType.couponName) {
+ this.listOfControl[i].sourceName = this.listOfOption.find(item => {
+ return item.id === id;
+ }).couponName;
+ }
+ if (presentType === this.presentType.agentName) {
+ this.getDiscount(id);
+ this.listOfControl[i].agentName = this.agentData.find(item => {
+ return item.id === id;
+ })['agentName'];
+ }
+
+
+ }
+
+
+ // 编辑产品
+ public getEdit(id?: number): void {
+ this.isVisibleEdit = true;
+ this.goodsId = id;
+ if (id != null) {
+ this.editFlag = true;
+ this.findGoodsDetailById(id);
+ }
+ }
+
+
+ // 查询商品详情
+ public findGoodsDetailById(id: number): void {
+ this.goods.findGoodsDetailById(id , data => {
+ if (data['return_code'] === '000000') {
+ if (!this.commonsService.whetherStringIsNull(data['return_data']['listImg'])) {
+ this.listImg = this.commonsService.stitchImg(data['return_data']['listImg']);
+ }
+ if (!this.commonsService.whetherStringIsNull(data['return_data']['bannerImg'])) {
+ this.bannerImg = this.commonsService.stitchImg(data['return_data']['bannerImg']);
+ }
+ if (!this.commonsService.whetherStringIsNull(data['return_data']['detailImg'])) {
+ this.detailImg = this.commonsService.stitchImg(data['return_data']['detailImg']);
+ }
+ this.validateForm.patchValue(data['return_data']);
+ }
+ });
+ }
+
+ // 确认提交
+ public handleOkEdit() {
+ for (const i in this.validateForm.controls) {
+ this.validateForm.controls[i].markAsDirty();
+ this.validateForm.controls[i].updateValueAndValidity();
+ if (this.validateForm.controls[i].errors != null) {
+ return;
+ }
+ }
+
+ if (this.listImg.length === 0 || this.bannerImg.length === 0 || this.detailImg.length === 0) {
+ this.notification.error('错误', '相关图片未上传!');
+ }
+
+ this.validateForm.value.listImg = this.commonsService.postImg(this.listImg);
+ this.validateForm.value.bannerImg = this.commonsService.postImg(this.bannerImg);
+ this.validateForm.value.detailImg = this.commonsService.postImg(this.detailImg);
+
+
+ if (this.editFlag) {
+ this.validateForm.value.id = this.goodsId;
+ this.isSpinningEdit = true;
+ this.goods.updateGoods(this.validateForm.value, data => {
+ this.isSpinningEdit = false;
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', '修改成功!');
+ this.isVisibleEdit = false;
+ this.getRequest(false, this.searchForm.value);
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ } else {
+ this.goods.insertGoods(this.validateForm.value, data => {
+ this.isSpinningEdit = false;
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', '添加成功!');
+ this.isVisibleEdit = false;
+ this.getRequest(false, this.searchForm.value);
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ }
+ }
+
+
+ // 图片查看
+ handlePreview = async (file: NzUploadFile) => {
+ if (!file.url && !file.preview) {
+ file.preview = await this.getBase64(file.originFileObj!);
+ }
+ this.previewImage = file.url || file.preview;
+ this.previewVisible = true;
+ }
+
+ // 图片转换成base64
+ 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);
+ });
+ }
+
+ public configSku(id: number , skuId?: number) {
+ this.isVisibleSku = true;
+ this.goodsId = id;
+ this.skuId = skuId;
+ if (skuId != null) {
+ this.findGoodsSkuById(skuId);
+ }
+ }
+
+ // sku编辑
+ public handleOkSku() {
+ for (const i in this.validateFormSku.controls) {
+ this.validateFormSku.controls[i].markAsDirty();
+ this.validateFormSku.controls[i].updateValueAndValidity();
+ if (this.validateFormSku.controls[i].errors != null) {
+ return;
+ }
+ }
+
+ if (this.showImg.length === 0 || this.bannerSkuImg.length === 0) {
+ this.notification.error('错误', '相关图片未上传!');
+ }
+
+ if (this.showImg[0]['response'] != null) {
+ this.validateFormSku.value.showImg = this.showImg[0]['response']['return_data'][0];
+ } else {
+ this.validateFormSku.value.showImg = this.showImg[0].name;
+ }
+ if (this.bannerSkuImg[0]['response'] != null) {
+ this.validateFormSku.value.bannerImg = this.bannerSkuImg[0]['response']['return_data'][0];
+ } else {
+ this.validateFormSku.value.bannerImg = this.bannerSkuImg[0].name;
+ }
+ this.validateFormSku.value.goodsId = this.goodsId;
+ if (this.skuId != null) {
+ this.validateFormSku.value.id = this.skuId;
+ this.isSpinningEdit = true;
+ this.goods.updateGoodsSku(this.validateFormSku.value, data => {
+ this.isSpinningEdit = false;
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', '修改成功!');
+ this.isVisibleSku = false;
+ this.skuId = null;
+ this.getListGoodsSku({goodsId : this.goodsId});
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ } else {
+ this.goods.insertGoodsSku(this.validateFormSku.value, data => {
+ this.isSpinningEdit = false;
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', '添加成功!');
+ this.isVisibleSku = false;
+ this.getListGoodsSku({goodsId : this.goodsId});
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ }
+ }
+
+ // 展示sku列表
+ public getSku(id: number): void {
+ this.goodsId = id;
+ this.isVisibleSkuList = true;
+ this.getListGoodsSku({goodsId : id});
+ }
+
+ // 展示配置规则
+ public configPresent(id: number): void {
+ this.goodsId = id;
+ this.listOfControl[0].goodsId = id;
+ this.isVisiblePresent = true;
+ }
+
+ // 查询sku列表
+ public getListGoodsSku( whereObject: object): void {
+ this.loadingSku = true;
+ this.goods.getListGoodsSku(whereObject , data => {
+ this.loadingSku = false;
+ if (data['return_code'] === '000000') {
+ this.skuData = data['return_data'];
+ }
+ });
+ }
+
+ // 查询sku详情
+ public findGoodsSkuById(id: number): void {
+ this.goods.findGoodsSkuById(id , data => {
+ if (data['return_code'] === '000000') {
+ if (!this.commonsService.whetherStringIsNull(data['return_data']['showImg'])) {
+ this.showImg = this.commonsService.stitchImg(data['return_data']['showImg']);
+ }
+ if (!this.commonsService.whetherStringIsNull(data['return_data']['bannerImg'])) {
+ this.bannerSkuImg = this.commonsService.stitchImg(data['return_data']['bannerImg']);
+ }
+ this.validateFormSku.patchValue(data['return_data']);
+ }
+ });
+ }
+
+
+ // 删除sku
+ public deleteSku(id): void {
+ this.modalService.confirm({
+ nzTitle: '确定删除',
+ nzOkText: '是',
+ nzOnOk: () => {
+ this.goods.deleteSku(id, data => {
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', `删除成功!`);
+ this.getListGoodsSku({goodsId : this.goodsId});
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ },
+ nzCancelText: '否',
+ });
+ }
+
+ // 商品的上下架
+ public goodsUpDown(id: number , status: number): void {
+ this.modalService.confirm({
+ nzTitle: status === 2 ? '是否申请上线' : '是否禁用',
+ nzOkText: '是',
+ nzOnOk: () => {
+ this.goods.goodsUpDown(id, data => {
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', `操作成功!`);
+ this.getRequest(false, this.searchForm.value);
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ },
+ nzCancelText: '否',
+ });
+ }
+
+ // 删除商品
+ public deleteGoods(id): void {
+ this.modalService.confirm({
+ nzTitle: '确定删除',
+ nzOkText: '是',
+ nzOnOk: () => {
+ this.goods.deleteGoods(id, data => {
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', `删除成功!`);
+ this.getRequest(false, this.searchForm.value);
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ },
+ nzCancelText: '否',
+ });
+ }
+
+ // 删除
+ removeField(i, e: MouseEvent): void {
+ e.preventDefault();
+ if (this.listOfControl.length > 1) {
+ this.listOfControl.splice(i, 1);
+ this.listOfControl[i - 1].isEdit = true;
+ }
+ }
+
+ // 新增
+ addField(i): void {
+ if (
+ this.listOfControl[i].type == null ||
+ this.listOfControl[i].sourceId == null ||
+ this.listOfControl[i].num == null
+ ) {
+ this.notification.error('失败' , '请填写必填项!');
+ return;
+ }
+
+ if (
+ this.listOfControl[i].type === 2 && this.listOfControl[i].agentId == null
+ ) {
+ this.notification.error('失败' , '请选择代理商!');
+ return;
+ }
+ this.listOfControl[i].isEdit = false;
+ const control = {
+ isEdit: true,
+ agentId: null,
+ goodsId: this.goodsId ,
+ num: null,
+ sourceId: null,
+ agentName: null,
+ sourceName: null,
+ type: null,
+ };
+ this.listOfControl.push(control);
+
+ }
+
+ handleOk(): void {
+ for (const item of this.listOfControl) {
+ if (item.sourceId != null) {
+ this.goods.insertPresent(item , data => {
+ if (data['return_code'] !== '000000') {
+ this.notification.error('失败', data['return_msg']);
+ return;
+ }
+ });
+ }
+ }
+ this.isVisiblePresent = false;
+ this.notification.success('成功', `新增成功!`);
+ }
+
+ public getListPresent( whereObject: object): void {
+ this.loadingSku = true;
+ this.goods.getListPresent(whereObject , data => {
+ this.loadingSku = false;
+ if (data['return_code'] === '000000') {
+ this.presentData = data['return_data'];
+ }
+ });
+ }
+
+ public getPresent(id: number): void {
+ this.goodsId = id;
+ this.isVisiblePresentList = true;
+ this.getListPresent({goodsId : id});
+ }
+
+ public deletePresent(id): void {
+ this.modalService.confirm({
+ nzTitle: '确定删除',
+ nzOkText: '是',
+ nzOnOk: () => {
+ this.goods.deletePresent(id, data => {
+ if (data['return_code'] === '000000') {
+ this.notification.success('成功', `删除成功!`);
+ this.getListPresent({goodsId : this.goodsId});
+ } else {
+ this.notification.error('失败', data['return_msg']);
+ }
+ });
+ },
+ nzCancelText: '否',
+ });
+ }
+
+}
diff --git a/src/app/admin/order-manage/goods-order/goods-order.component.html b/src/app/admin/order-manage/goods-order/goods-order.component.html
new file mode 100644
index 0000000..bcf43f2
--- /dev/null
+++ b/src/app/admin/order-manage/goods-order/goods-order.component.html
@@ -0,0 +1,296 @@
+
+
+
+
+
+
+
+
+
+
+
共计 {{total?total:0}} 条数据
+
+
+
+
+
+
+
+
+ 交易单号 |
+ 客户电话 |
+ 订单名称 |
+ 订单金额 |
+ 支付金额 |
+ 支付方式 |
+ 订单状态 |
+ 创建时间 |
+ 物流状态 |
+ 操作 |
+
+
+
+
+ {{data.orderNo}} |
+ {{data.memPhone}} |
+ {{data.title}} |
+ ¥{{data.totalPrice}} |
+ ¥{{data.payPrice}} |
+ {{data.orderStatus == 1 || data.orderStatus == 5 ? '未支付' : data.payType | orderPayType}} |
+ {{data.orderStatus | orderStatus}} |
+ {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.logisticsStatus | logisticsStatus}} |
+
+ 操作列表
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+ {{orderDetailObject.tradeOrder.orderNo}}
+ {{orderDetailObject.tradeOrder.paySerialNo!=null?orderDetailObject.tradeOrder.paySerialNo:'无'}}
+ {{orderDetailObject.tradeOrder.memPhone}}
+ {{orderDetailObject.tradeOrder.orderStatus | orderStatus}}
+ {{orderDetailObject.tradeOrder.payType | orderPayType}}
+
+ {{orderDetailObject.tradeOrder.memCardNo}}
+
+ {{orderDetailObject.tradeOrder.memDiscountName?orderDetailObject.tradeOrder.memDiscountName:'无'}}
+ {{orderDetailObject.tradeOrder.whetherRebate?'是':'否'}}
+ {{orderDetailObject.tradeOrder.remarks}}
+
+
+
+
+ {{orderDetailObject.tradeOrder.totalPrice}} 元
+ {{orderDetailObject.tradeOrder.totalDeductionPrice}} 元
+ {{orderDetailObject.tradeOrder.deductionProductPrice}} 元
+ {{orderDetailObject.tradeOrder.deductionCouponPrice}} 元
+ {{orderDetailObject.tradeOrder.payablePrice}} 元
+ {{orderDetailObject.tradeOrder.payGold / 100}} 元
+
+ {{orderDetailObject.tradeOrder.payRealPrice!=null?orderDetailObject.tradeOrder.payRealPrice+' 元':'未支付'}}
+
+
+
+
+
+
+
+ 创建时间:{{orderDetailObject.tradeOrder.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 备注:{{orderDetailObject.tradeOrder.remarks?orderDetailObject.tradeOrder.remarks:'无'}}
+
+
+ 取消时间:{{orderDetailObject.tradeOrder.cancelTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 备注:{{orderDetailObject.tradeOrder.cancelRemarks?orderDetailObject.tradeOrder.cancelRemarks:'无'}}
+
+ 支付时间:{{orderDetailObject.tradeOrder.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 完成时间:{{orderDetailObject.tradeOrder.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 退款时间:{{orderDetailObject.tradeOrder.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+
+
+
+
+
+
+
+ 产品类型 |
+ 产品图片 |
+ 产品名称 |
+ 商品原价 |
+ 支付价格 |
+ 数量 |
+ 支付总价 |
+
+
+
+
+ {{ data.goodsType | orderChildGoodsType}} |
+
+
+ |
+
+ {{ data.goodsName }}
+ 赠品
+ |
+ {{ data.goodsPrice }} 元 |
+ {{ data.goodsActualPrice }} 元 |
+ {{ data.saleCount }} |
+ {{ data.totalActualPrice }} 元 |
+
+
+
+
+
+
+
+ {{item['desc']}}
+ {{item.time | date : 'yyyy-MM-dd HH:mm:ss'}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/admin/order-manage/goods-order/goods-order.component.scss b/src/app/admin/order-manage/goods-order/goods-order.component.scss
new file mode 100644
index 0000000..50bea78
--- /dev/null
+++ b/src/app/admin/order-manage/goods-order/goods-order.component.scss
@@ -0,0 +1,9 @@
+img {
+ width: 60px;
+}
+.fontColor {
+ color: red;
+}
+.fontColorBlue {
+ color: #00a2d4;
+}
diff --git a/src/app/admin/order-manage/goods-order/goods-order.component.ts b/src/app/admin/order-manage/goods-order/goods-order.component.ts
new file mode 100644
index 0000000..255f0a2
--- /dev/null
+++ b/src/app/admin/order-manage/goods-order/goods-order.component.ts
@@ -0,0 +1,211 @@
+import { Component, OnInit } from '@angular/core';
+import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
+import {environment} from '../../../../environments/environment';
+import {LocalStorageService} from '../../../services/local-storage.service';
+import {NzMessageService, NzNotificationService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {OrderThirdPartyService} from '../../../services/order/order-third-party.service';
+import {CompanyService} from '../../../services/company.service';
+import {CommonsService} from '../../../services/commons.service';
+import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
+import {animate, state, style, transition, trigger} from '_@angular_animations@9.0.7@@angular/animations';
+import {GoodsService} from "../../../services/goods/goods.service";
+
+@Component({
+ selector: 'app-goods-order',
+ 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: './goods-order.component.html',
+ styleUrls: ['./goods-order.component.scss']
+})
+export class GoodsOrderComponent implements OnInit {
+
+
+ // 搜索框
+ searchForm: FormGroup;
+ // 搜索框折叠
+ isCollapse = false;
+ // 订单状态数据
+ orderStatusArray = [];
+ // 公司数据
+ companyArray = [];
+ // 角色类型
+ roleType: number;
+ // 列表相关参数
+ // 总条数
+ total: number;
+ // 页码
+ pageNum = 1;
+ // 条码
+ pageSize = 10;
+ // 列表数据
+ requestData = [];
+ // 列表加载
+ loading = true;
+ isVisible = false;
+ // 订单详情相关参数
+ // 详情模态框
+ orderDetailModal = false;
+ // 详情模态框数据等待
+ orderDetailModalLoading = false;
+ // 订单详情数据
+ orderDetailObject: any = {
+ tradeOrder: {},
+ goodsOrder: {
+ logisticsNo: null
+ },
+ };
+ // 数据加载中参数
+ loadingObject = {
+ title: '加载中...',
+ status: false,
+ };
+ // 请求地址参数
+ FILE_URL = environment.imageUrl;
+ orderNo;
+ logisticsNo;
+ logisticsTraceDetails;
+ constructor(
+ private form: FormBuilder,
+ private store: LocalStorageService,
+ private message: NzMessageService,
+ private thirdPartyOrder: OrderThirdPartyService,
+ private goods: GoodsService,
+ private companyService: CompanyService,
+ private commonsService: CommonsService,
+ private notification: NzNotificationService,
+ ) { }
+
+ ngOnInit(): void {
+ // 搜索表单初始化
+ this.searchForm = this.form.group({
+ orderNo: [null],
+ memPhone: [null],
+ payTimeArray: [null],
+ orderStatus: [null],
+ createTimeArray: [null],
+ refundTimeArray: [null],
+ companyId: [null],
+ payType: [null],
+ memCardNo: [null],
+ productType: [12],
+ });
+ // 角色类型初始化
+ 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_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;
+ if (whereObject['payTimeArray'] != null && whereObject['payTimeArray'].length !== 0) {
+ whereObject['payTimeS'] = whereObject['payTimeArray'][0].getTime();
+ whereObject['payTimeE'] = whereObject['payTimeArray'][1].getTime();
+ }
+ if (whereObject['refundTimeArray'] != null && whereObject['refundTimeArray'].length !== 0) {
+ whereObject['refundTimeS'] = whereObject['refundTimeArray'][0].getTime();
+ whereObject['refundTimeE'] = whereObject['refundTimeArray'][1].getTime();
+ }
+
+ if (whereObject['createTimeArray'] != null && whereObject['createTimeArray'].length !== 0) {
+ whereObject['createTimeS'] = whereObject['createTimeArray'][0].getTime();
+ whereObject['createTimeE'] = whereObject['createTimeArray'][1].getTime();
+ }
+ this.goods.getOrderList(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']);
+ }
+ });
+ }
+
+ // 展示订单详情
+ public showOrderDetail(orderNo: string) {
+ this.orderDetailModal = true;
+ this.orderDetailModalLoading = true;
+ this.goods.getGoodsOrderDetail(orderNo, data => {
+ if (data['return_code'] === '000000') {
+ console.log(data);
+ this.orderDetailObject = data['return_data'];
+ this.logisticsTraceDetails = data['return_data']['logisticsTraceDetails'];
+ console.log(this.logisticsTraceDetails);
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ this.orderDetailModalLoading = false;
+ });
+
+ }
+
+ // 导出数据
+ public excelOrder(whereObject) {
+ this.loadingObject.status = true;
+ this.loadingObject.title = '数据导出中...';
+ this.thirdPartyOrder.exportThirdPartyOrderList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ window.location.href = this.FILE_URL + 'temporary/' + data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ this.loadingObject.status = false;
+ });
+ }
+
+ // 更新运费单号
+ public updateLogisticsNo(order: string): void {
+ this.orderNo = order;
+ this.isVisible = true;
+ }
+
+ public handleOk(): void {
+ this.goods.updateLogisticsNo({
+ orderNo: this.orderNo ,
+ logisticsNo: this.logisticsNo
+ } , data => {
+ if (data['return_code'] === '000000') {
+ this.isVisible = false;
+ this.notification.success('成功' , '更新成功');
+ } else {
+ this.notification.error( '失败' , '更新成功');
+ }
+ });
+ }
+
+}
+
+
diff --git a/src/app/common/preview-image/preview-image.component.html b/src/app/common/preview-image/preview-image.component.html
new file mode 100644
index 0000000..636b9ad
--- /dev/null
+++ b/src/app/common/preview-image/preview-image.component.html
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/app/common/preview-image/preview-image.component.scss b/src/app/common/preview-image/preview-image.component.scss
new file mode 100644
index 0000000..8bee3fb
--- /dev/null
+++ b/src/app/common/preview-image/preview-image.component.scss
@@ -0,0 +1,4 @@
+.head_img {
+ height: 60px;
+ width: 60px;
+}
diff --git a/src/app/common/preview-image/preview-image.component.ts b/src/app/common/preview-image/preview-image.component.ts
new file mode 100644
index 0000000..923a40f
--- /dev/null
+++ b/src/app/common/preview-image/preview-image.component.ts
@@ -0,0 +1,21 @@
+import {Component, Input, OnInit} from '@angular/core';
+import {environment} from '../../../environments/environment';
+
+
+@Component({
+ selector: 'app-preview-image',
+ templateUrl: './preview-image.component.html',
+ styleUrls: ['./preview-image.component.scss']
+})
+export class PreviewImageComponent implements OnInit {
+
+ imageUrl = environment.imageUrl;
+
+ @Input() previewImage: string;
+ previewVisible = false;
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/common/preview-image/preview-image.module.ts b/src/app/common/preview-image/preview-image.module.ts
new file mode 100644
index 0000000..710a8d3
--- /dev/null
+++ b/src/app/common/preview-image/preview-image.module.ts
@@ -0,0 +1,21 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { PreviewImageComponent } from './preview-image.component';
+import {NgZorroAntdModule} from 'ng-zorro-antd';
+import {FormsModule} from '@angular/forms';
+
+
+
+
+@NgModule({
+ declarations: [PreviewImageComponent],
+ exports: [
+ PreviewImageComponent
+ ],
+ imports: [
+ CommonModule,
+ FormsModule,
+ NgZorroAntdModule
+ ]
+})
+export class PreviewImageModule { }
diff --git a/src/app/enum/present-type.enum.ts b/src/app/enum/present-type.enum.ts
new file mode 100644
index 0000000..ac5b2ae
--- /dev/null
+++ b/src/app/enum/present-type.enum.ts
@@ -0,0 +1,5 @@
+export enum PresentType {
+ discountName,
+ couponName,
+ agentName,
+}
diff --git a/src/app/enum/url.enum.ts b/src/app/enum/url.enum.ts
new file mode 100644
index 0000000..0f40e03
--- /dev/null
+++ b/src/app/enum/url.enum.ts
@@ -0,0 +1,3 @@
+
+export enum Url {
+}
diff --git a/src/app/pipes/goods/goods-status.pipe.ts b/src/app/pipes/goods/goods-status.pipe.ts
new file mode 100644
index 0000000..ab2a358
--- /dev/null
+++ b/src/app/pipes/goods/goods-status.pipe.ts
@@ -0,0 +1,19 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'goodsStatus'
+})
+export class GoodsStatusPipe implements PipeTransform {
+
+ transform(value: number): string {
+ switch (value) {
+ case 1:
+ return '上线中';
+ case 2:
+ return '编辑中';
+ case 3:
+ return '审核中';
+ }
+ }
+
+}
diff --git a/src/app/pipes/goods/logistics-status.pipe.ts b/src/app/pipes/goods/logistics-status.pipe.ts
new file mode 100644
index 0000000..8fd9c46
--- /dev/null
+++ b/src/app/pipes/goods/logistics-status.pipe.ts
@@ -0,0 +1,28 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'logisticsStatus'
+})
+export class LogisticsStatusPipe implements PipeTransform {
+ transform(value: string): string {
+ switch (value) {
+ case '1':
+ return '待发货';
+ case '2':
+ return '已发货';
+ case '3':
+ return '配送中';
+ case '4':
+ return '已送达';
+ case '5':
+ return '已取消';
+ case '6':
+ return '退货中';
+ case '7':
+ return '已退货';
+ case '8':
+ return '待付款';
+ }
+ }
+
+}
diff --git a/src/app/services/goods/goods.service.ts b/src/app/services/goods/goods.service.ts
new file mode 100644
index 0000000..28af65c
--- /dev/null
+++ b/src/app/services/goods/goods.service.ts
@@ -0,0 +1,314 @@
+import { Injectable } from '@angular/core';
+import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http';
+import {CommonsService} from '../commons.service';
+import {environment} from '../../../environments/environment';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class GoodsService {
+
+ constructor(
+ private http: HttpClient,
+ private common: CommonsService
+ ) { }
+
+
+ /**
+ * 查询列表
+ *
+ * @param paramsObject 对象
+ * @param callBack 回调
+ */
+ public getListGoodsDetail(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'goods/getListGoodsDetail?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName insertProduct
+ * @Description // 新增商品
+ * @Date 13:54 2023/4/12
+ * @Param params 上传对象
+ * @Param callBack 回调
+ */
+ public insertGoods(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'goods/insertGoods', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName editPriceStatus
+ * @Description // 修改商品
+ * @Date 15:03 2021/8/12
+ * @Param mod
+ **/
+ public updateGoods(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'goods/updateGoods', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName findGoodsDetailById
+ * @Description // 查询商品详情
+ * @Date 13:58 2023/4/12
+ * @Param id 商户编码
+ * @Param callBack
+ */
+ public findGoodsDetailById(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'goods/findGoodsDetailById?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName getGoodsTypeTree
+ * @Description // 查询商品类型树
+ * @Date 18:33 2023/4/12
+ * @Param businessType 业务类型
+ * @Param callBack 回调
+ */
+ public getGoodsTypeTree(businessType: number, callBack) {
+ this.http.get(environment.baseUrl + 'highGoodsType/getGoodsTypeTree?businessType=' + businessType).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName getListGoodsSku
+ * @Description // 查询商品SKU
+ * @Date 18:34 2023/4/12
+ * @Param paramsObject
+ * @Param callBack
+ */
+ public getListGoodsSku(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'goodsSku/getListGoodsSku?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName insertGoodsSku
+ * @Description // 新增商品SKU
+ * @Date 18:35 2023/4/12
+ * @Param params
+ * @Param callBack
+ */
+ public insertGoodsSku(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'goodsSku/insertGoodsSku', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName updateGoodsSku
+ * @Description // 更新商品SKU
+ * @Date 18:35 2023/4/12
+ * @Param params
+ * @Param callBack
+ */
+ public updateGoodsSku(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'goodsSku/updateGoodsSku', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName findGoodsSkuById
+ * @Description // 查询商品SKU详情
+ * @Date 18:36 2023/4/12
+ * @Param id
+ * @Param callBack
+ */
+ public findGoodsSkuById(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'goodsSku/findGoodsSkuById?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName deleteSku
+ * @Description // 删除sku
+ * @Date 11:38 2023/4/13
+ * @Param id
+ */
+ public deleteSku(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'goodsSku/deleteSku?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName goodsUpDown
+ * @Description // 商品上下架
+ * @Date 11:38 2023/4/13
+ * @Param id
+ */
+ public goodsUpDown(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'goods/goodsUpDown?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName deleteGoods
+ * @Description // 删除商品
+ * @Date 11:39 2023/4/13
+ * @Param id
+ */
+ public deleteGoods(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'goods/deleteGoods?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName getListRegionFreight
+ * @Description // 查询区域运费内容
+ * @Date 16:50 2023/4/14
+ * @Param paramsObject
+ */
+ public getListRegionFreight(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'regionFreight/getListRegionFreight?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName insertRegionFreight
+ * @Description // 插入区域运费
+ * @Date 16:51 2023/4/14
+ * @Param params
+ */
+ public insertRegionFreight(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'regionFreight/insertRegionFreight', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName updateRegionFreight
+ * @Description // 查询区域内容
+ * @Date 16:51 2023/4/14
+ * @Param params
+ */
+ public updateRegionFreight(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'regionFreight/updateRegionFreight', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName deleteRegionFreight
+ * @Description // 删除区域运费内容
+ * @Date 16:52 2023/4/14
+ * @Param id
+ */
+ public deleteRegionFreight(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'regionFreight/deleteRegionFreight?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName findRegionFreightById
+ * @Description // 查询区域运费内容
+ * @Date 16:53 2023/4/14
+ * @Param id
+ */
+ public findRegionFreightById(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'regionFreight/findRegionFreightById?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName insertPresent
+ * @Description // 新增赠送内容
+ * @Date 15:07 2023/4/18
+ * @Param params
+ */
+ public insertPresent(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'goodsPresent/insertPresent', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName updatePresent
+ * @Description // 更新赠送内容
+ * @Date 15:07 2023/4/18
+ * @Param params
+ */
+ public updatePresent(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'goodsPresent/updatePresent', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+
+ /**
+ * @Author Sum1Dream
+ * @methodName getListPresent
+ * @Description // 查询赠送配置列表
+ * @Date 15:08 2023/4/18
+ * @Param paramsObject
+ */
+ public getListPresent(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'goodsPresent/getListPresent?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName deleteGoods
+ * @Description // 删除
+ * @Date 15:09 2023/4/18
+ * @Param id
+ */
+ public deletePresent(id: number, callBack) {
+ this.http.get(environment.baseUrl + 'goodsPresent/deletePresent?id=' + id).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ public getOrderList(param: object, callBack) {
+ this.http.get(environment.orderUrl + 'goodsOrder/getOrderList?' + this.common.getWhereCondition(param)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ public updateLogisticsNo(param: object, callBack) {
+ this.http.get(environment.orderUrl + 'goodsOrder/updateLogisticsNo?' + this.common.getWhereCondition(param)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ public getGoodsOrderDetail(orderNo: string, callBack) {
+ this.http.get(environment.orderUrl + 'goodsOrder/getGoodsOrderDetail?orderNo=' + orderNo).subscribe(data => {
+ callBack(data);
+ });
+ }
+}
From f3b6e26a047bd6aee8a2f994826dc9d214df159f Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Wed, 17 May 2023 15:47:18 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/admin/goods/goods.module.ts | 2 +-
.../order-manage/goods-order/goods-order.component.html | 2 +-
src/app/admin/order-manage/order-manage-routing.module.ts | 2 ++
src/app/admin/order-manage/order-manage.module.ts | 3 ++-
src/app/services/goods/goods.service.ts | 7 +++++++
5 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/app/admin/goods/goods.module.ts b/src/app/admin/goods/goods.module.ts
index db97468..f011a5e 100644
--- a/src/app/admin/goods/goods.module.ts
+++ b/src/app/admin/goods/goods.module.ts
@@ -9,7 +9,7 @@ import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/f
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from '../../app-common.module';
-import {PreviewImageModule} from "../../common/preview-image/preview-image.module";
+import {PreviewImageModule} from '../../common/preview-image/preview-image.module';
@NgModule({
diff --git a/src/app/admin/order-manage/goods-order/goods-order.component.html b/src/app/admin/order-manage/goods-order/goods-order.component.html
index bcf43f2..0f1247b 100644
--- a/src/app/admin/order-manage/goods-order/goods-order.component.html
+++ b/src/app/admin/order-manage/goods-order/goods-order.component.html
@@ -282,7 +282,7 @@
-
+
diff --git a/src/app/admin/order-manage/order-manage-routing.module.ts b/src/app/admin/order-manage/order-manage-routing.module.ts
index e63851b..75eede6 100644
--- a/src/app/admin/order-manage/order-manage-routing.module.ts
+++ b/src/app/admin/order-manage/order-manage-routing.module.ts
@@ -13,6 +13,7 @@ import {PreOrderComponent} from './pre-order/pre-order.component';
import {MobileRechargeOrderListComponent} from './mobile-recharge-order-list/mobile-recharge-order-list.component';
import {HltChargeOrderComponent} from './hlt-charge-order/hlt-charge-order.component';
import {GoodsOrderComponent} from './goods-order/goods-order.component';
+import {GoodsChildOrderComponent} from './goods-child-order/goods-child-order.component';
const routes: Routes = [
@@ -29,6 +30,7 @@ const routes: Routes = [
{ path: 'discount-package-order-list', component: DicountPackageOrderListComponent},
{ path: 'hlt-order-list', component: HltChargeOrderComponent},
{ path: 'goods-order', component: GoodsOrderComponent},
+ { path: 'goods-child-order', component: GoodsChildOrderComponent},
];
@NgModule({
diff --git a/src/app/admin/order-manage/order-manage.module.ts b/src/app/admin/order-manage/order-manage.module.ts
index dace081..f22e652 100644
--- a/src/app/admin/order-manage/order-manage.module.ts
+++ b/src/app/admin/order-manage/order-manage.module.ts
@@ -23,9 +23,10 @@ import {MobileRechargeOrderListComponent} from './mobile-recharge-order-list/mob
import { HltChargeOrderComponent } from './hlt-charge-order/hlt-charge-order.component';
import { GoodsOrderComponent } from './goods-order/goods-order.component';
import {PreviewImageModule} from "../../common/preview-image/preview-image.module";
+import { GoodsChildOrderComponent } from './goods-child-order/goods-child-order.component';
@NgModule({
- declarations: [OrderOilListComponent, OrderCouponListComponent, OrderIntegralRechargeComponent, OrderRefundListComponent, KfcOrderListComponent, StarbucksOrderListComponent, MemberChargeOrderListComponent, MobileRechargeOrderListComponent, PreOrderComponent,DicountPackageOrderListComponent, MemberChargeOrderListComponent, DiscountUseConditionListComponent, HltChargeOrderComponent, GoodsOrderComponent],
+ declarations: [OrderOilListComponent, OrderCouponListComponent, OrderIntegralRechargeComponent, OrderRefundListComponent, KfcOrderListComponent, StarbucksOrderListComponent, MemberChargeOrderListComponent, MobileRechargeOrderListComponent, PreOrderComponent,DicountPackageOrderListComponent, MemberChargeOrderListComponent, DiscountUseConditionListComponent, HltChargeOrderComponent, GoodsOrderComponent, GoodsChildOrderComponent],
imports: [
CommonModule,
OrderManageRoutingModule,
diff --git a/src/app/services/goods/goods.service.ts b/src/app/services/goods/goods.service.ts
index 28af65c..e7d881e 100644
--- a/src/app/services/goods/goods.service.ts
+++ b/src/app/services/goods/goods.service.ts
@@ -300,6 +300,13 @@ export class GoodsService {
});
}
+
+ public getOrderChildList(param: object, callBack) {
+ this.http.get(environment.orderUrl + 'goodsOrder/getOrderChildList?' + this.common.getWhereCondition(param)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
public updateLogisticsNo(param: object, callBack) {
this.http.get(environment.orderUrl + 'goodsOrder/updateLogisticsNo?' + this.common.getWhereCondition(param)).subscribe(data => {
callBack(data);
From d8f88d77f5584bfb844ba81ff6d2a39bfa19b646 Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Wed, 17 May 2023 15:47:31 +0800
Subject: [PATCH 4/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../goods-child-order.component.html | 227 ++++++++++++++++++
.../goods-child-order.component.scss | 9 +
.../goods-child-order.component.ts | 176 ++++++++++++++
3 files changed, 412 insertions(+)
create mode 100644 src/app/admin/order-manage/goods-child-order/goods-child-order.component.html
create mode 100644 src/app/admin/order-manage/goods-child-order/goods-child-order.component.scss
create mode 100644 src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts
diff --git a/src/app/admin/order-manage/goods-child-order/goods-child-order.component.html b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.html
new file mode 100644
index 0000000..c568dfe
--- /dev/null
+++ b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.html
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
共计 {{total?total:0}} 条数据
+
+
+
+
+
+
+
+
+ 交易单号 |
+ 客户电话 |
+ 订单名称 |
+ 订单金额 |
+ 支付金额 |
+ 支付方式 |
+ 订单状态 |
+ 创建时间 |
+ 物流状态 |
+ 操作 |
+
+
+
+
+ {{data.orderNo}} |
+ {{data.memPhone}} |
+ {{data.title}} |
+ ¥{{data.totalPrice}} |
+ ¥{{data.payPrice}} |
+ {{data.orderStatus == 1 || data.orderStatus == 5 ? '未支付' : data.payType | orderPayType}} |
+ {{data.orderStatus | orderStatus}} |
+ {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.logisticsStatus | logisticsStatus}} |
+
+ 操作列表
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+ {{orderDetailObject.tradeOrder.orderNo}}
+ {{orderDetailObject.tradeOrder.paySerialNo!=null?orderDetailObject.tradeOrder.paySerialNo:'无'}}
+ {{orderDetailObject.tradeOrder.memPhone}}
+ {{orderDetailObject.tradeOrder.orderStatus | orderStatus}}
+ {{orderDetailObject.tradeOrder.payType | orderPayType}}
+
+ {{orderDetailObject.tradeOrder.memCardNo}}
+
+ {{orderDetailObject.tradeOrder.memDiscountName?orderDetailObject.tradeOrder.memDiscountName:'无'}}
+ {{orderDetailObject.tradeOrder.whetherRebate?'是':'否'}}
+ {{orderDetailObject.tradeOrder.remarks}}
+
+
+
+
+ {{orderDetailObject.tradeOrder.totalPrice}} 元
+ {{orderDetailObject.tradeOrder.totalDeductionPrice}} 元
+ {{orderDetailObject.tradeOrder.deductionProductPrice}} 元
+ {{orderDetailObject.tradeOrder.deductionCouponPrice}} 元
+ {{orderDetailObject.tradeOrder.payablePrice}} 元
+ {{orderDetailObject.tradeOrder.payGold / 100}} 元
+
+ {{orderDetailObject.tradeOrder.payRealPrice!=null?orderDetailObject.tradeOrder.payRealPrice+' 元':'未支付'}}
+
+
+
+
+
+
+
+ 创建时间:{{orderDetailObject.tradeOrder.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 备注:{{orderDetailObject.tradeOrder.remarks?orderDetailObject.tradeOrder.remarks:'无'}}
+
+
+ 取消时间:{{orderDetailObject.tradeOrder.cancelTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 备注:{{orderDetailObject.tradeOrder.cancelRemarks?orderDetailObject.tradeOrder.cancelRemarks:'无'}}
+
+ 支付时间:{{orderDetailObject.tradeOrder.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 完成时间:{{orderDetailObject.tradeOrder.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+ 退款时间:{{orderDetailObject.tradeOrder.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+
+
+
+
+
+
+
+ 产品类型 |
+ 产品图片 |
+ 产品名称 |
+ 商品原价 |
+ 支付价格 |
+ 数量 |
+ 支付总价 |
+
+
+
+
+ {{ data.goodsType | orderChildGoodsType}} |
+
+
+ |
+
+ {{ data.goodsName }}
+ 赠品
+ |
+ {{ data.goodsPrice }} 元 |
+ {{ data.goodsActualPrice }} 元 |
+ {{ data.saleCount }} |
+ {{ data.totalActualPrice }} 元 |
+
+
+
+
+
+
+
+ {{item['desc']}}
+ {{item.time | date : 'yyyy-MM-dd HH:mm:ss'}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/admin/order-manage/goods-child-order/goods-child-order.component.scss b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.scss
new file mode 100644
index 0000000..50bea78
--- /dev/null
+++ b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.scss
@@ -0,0 +1,9 @@
+img {
+ width: 60px;
+}
+.fontColor {
+ color: red;
+}
+.fontColorBlue {
+ color: #00a2d4;
+}
diff --git a/src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts
new file mode 100644
index 0000000..68ccae6
--- /dev/null
+++ b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts
@@ -0,0 +1,176 @@
+import { Component, OnInit } from '@angular/core';
+import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
+import {environment} from '../../../../environments/environment';
+import {LocalStorageService} from '../../../services/local-storage.service';
+import {NzMessageService, NzNotificationService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {OrderThirdPartyService} from '../../../services/order/order-third-party.service';
+import {GoodsService} from '../../../services/goods/goods.service';
+import {CompanyService} from '../../../services/company.service';
+import {CommonsService} from '../../../services/commons.service';
+import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
+
+@Component({
+ selector: 'app-goods-child-order',
+ templateUrl: './goods-child-order.component.html',
+ styleUrls: ['./goods-child-order.component.scss']
+})
+export class GoodsChildOrderComponent implements OnInit {
+
+
+ // 搜索框
+ searchForm: FormGroup;
+ // 搜索框折叠
+ isCollapse = false;
+ // 订单状态数据
+ orderStatusArray = [];
+ // 公司数据
+ companyArray = [];
+ // 角色类型
+ roleType: number;
+ // 列表相关参数
+ // 总条数
+ total: number;
+ // 页码
+ pageNum = 1;
+ // 条码
+ pageSize = 10;
+ // 列表数据
+ requestData = [];
+ // 列表加载
+ loading = true;
+ isVisible = false;
+ // 订单详情相关参数
+ // 详情模态框
+ orderDetailModal = false;
+ // 详情模态框数据等待
+ orderDetailModalLoading = false;
+ // 订单详情数据
+ orderDetailObject: any = {
+ tradeOrder: {},
+ goodsOrder: {
+ logisticsNo: null
+ },
+ };
+ // 数据加载中参数
+ loadingObject = {
+ title: '加载中...',
+ status: false,
+ };
+ // 请求地址参数
+ FILE_URL = environment.imageUrl;
+ orderNo;
+ logisticsNo;
+ logisticsTraceDetails;
+ constructor(
+ private form: FormBuilder,
+ private store: LocalStorageService,
+ private message: NzMessageService,
+ private thirdPartyOrder: OrderThirdPartyService,
+ private goods: GoodsService,
+ private companyService: CompanyService,
+ private commonsService: CommonsService,
+ private notification: NzNotificationService,
+ ) { }
+
+ ngOnInit(): void {
+ // 搜索表单初始化
+ this.searchForm = this.form.group({
+ orderNo: [null],
+ memPhone: [null],
+ status: [null],
+ createTimeArray: [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_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;
+
+ if (whereObject['createTimeArray'] != null && whereObject['createTimeArray'].length !== 0) {
+ whereObject['createTimeS'] = whereObject['createTimeArray'][0].getTime();
+ whereObject['createTimeE'] = whereObject['createTimeArray'][1].getTime();
+ }
+ this.goods.getOrderChildList(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']);
+ }
+ });
+ }
+
+ // 展示订单详情
+ public showOrderDetail(orderNo: string) {
+ this.orderDetailModal = true;
+ this.orderDetailModalLoading = true;
+ this.goods.getGoodsOrderDetail(orderNo, data => {
+ if (data['return_code'] === '000000') {
+ console.log(data);
+ this.orderDetailObject = data['return_data'];
+ this.logisticsTraceDetails = data['return_data']['logisticsTraceDetails'];
+ console.log(this.logisticsTraceDetails);
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ this.orderDetailModalLoading = false;
+ });
+
+ }
+
+ // 导出数据
+ public excelOrder(whereObject) {
+ this.loadingObject.status = true;
+ this.loadingObject.title = '数据导出中...';
+ this.thirdPartyOrder.exportThirdPartyOrderList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ window.location.href = this.FILE_URL + 'temporary/' + data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ this.loadingObject.status = false;
+ });
+ }
+
+ // 更新运费单号
+ public updateLogisticsNo(order: string): void {
+ this.orderNo = order;
+ this.isVisible = true;
+ }
+
+ public handleOk(): void {
+ this.goods.updateLogisticsNo({
+ orderNo: this.orderNo ,
+ logisticsNo: this.logisticsNo
+ } , data => {
+ if (data['return_code'] === '000000') {
+ this.isVisible = false;
+ this.notification.success('成功' , '更新成功');
+ } else {
+ this.notification.error( '失败' , '更新成功');
+ }
+ });
+ }
+
+}
From 13d36c18c770ad0e7c3d97ad14dd44c2ba09c76f Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Thu, 18 May 2023 17:48:58 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../goods-order/goods-order.component.ts | 3 +-
.../mobile-recharge-order-list.component.html | 34 +++++++++++----
.../mobile-recharge-order-list.component.scss | 3 ++
.../mobile-recharge-order-list.component.ts | 41 ++++++++++++++++++-
.../order/order-mobile-recharge.service.ts | 28 +++++++++++++
5 files changed, 98 insertions(+), 11 deletions(-)
diff --git a/src/app/admin/order-manage/goods-order/goods-order.component.ts b/src/app/admin/order-manage/goods-order/goods-order.component.ts
index 255f0a2..0edf642 100644
--- a/src/app/admin/order-manage/goods-order/goods-order.component.ts
+++ b/src/app/admin/order-manage/goods-order/goods-order.component.ts
@@ -163,7 +163,6 @@ export class GoodsOrderComponent implements OnInit {
console.log(data);
this.orderDetailObject = data['return_data'];
this.logisticsTraceDetails = data['return_data']['logisticsTraceDetails'];
- console.log(this.logisticsTraceDetails);
} else {
this.message.error(data['return_msg']);
}
@@ -201,7 +200,7 @@ export class GoodsOrderComponent implements OnInit {
this.isVisible = false;
this.notification.success('成功' , '更新成功');
} else {
- this.notification.error( '失败' , '更新成功');
+ this.notification.error( '失败' , data['return_msg']);
}
});
}
diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html
index d34e0ef..d7aee1f 100644
--- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html
+++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html
@@ -28,9 +28,9 @@
- 客户电话
+ 标题
-
+
@@ -38,6 +38,17 @@
+
+
+ 异常订单
+
+
+
+
+
+
+
+
交易状态
@@ -170,7 +181,7 @@
-
+
{{data.orderNo}} |
{{data.memPhone}} |
{{data.title}} |
@@ -184,6 +195,8 @@
@@ -252,13 +265,16 @@
-
+
- 请求订单号 |
- 充值平台 |
- 充值状态 |
- 创建时间 |
+ 请求订单号 |
+ 充值平台 |
+ 充值状态 |
+ 充值内容 |
+ 查询内容 |
+ 创建时间 |
@@ -266,6 +282,8 @@
{{data.orderNo}} |
{{data.rechargePlatform | platform}} |
{{data.status | chlidRechargeStatus}} |
+ {{data.ext1}} |
+ {{data.ext3}} |
{{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}} |
diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.scss b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.scss
index 363c972..04d72c1 100644
--- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.scss
+++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.scss
@@ -1,3 +1,6 @@
img {
width: 60px;
}
+.fontColor {
+ color: red;
+}
diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts
index b498f2a..e9287d1 100644
--- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts
+++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts
@@ -8,6 +8,7 @@ import {OrderMobileRechargeService} from '../../../services/order/order-mobile-r
import {FormBuilder, FormGroup} from '@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
import {animate, state, style, transition, trigger} from '@angular/animations';
+import {NzNotificationService} from "_ng-zorro-antd@9.3.0@ng-zorro-antd";
@Component({
selector: 'app-mobile-recharge-order-list',
@@ -80,6 +81,7 @@ export class MobileRechargeOrderListComponent implements OnInit {
private orderMobileRechargeService: OrderMobileRechargeService,
private companyService: CompanyService,
private commonsService: CommonsService,
+ private notification: NzNotificationService,
) { }
ngOnInit(): void {
@@ -92,6 +94,7 @@ export class MobileRechargeOrderListComponent implements OnInit {
createTimeArray: [null],
refundTimeArray: [null],
title: [null],
+ exceptionStatus: [null],
companyId: [null],
payType: [null],
memCardNo: [null],
@@ -136,7 +139,6 @@ export class MobileRechargeOrderListComponent implements OnInit {
this.orderMobileRechargeService.getOrderList(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 {
@@ -175,5 +177,42 @@ export class MobileRechargeOrderListComponent implements OnInit {
});
}
+
+ public refundOrder(orderNo: string): void {
+
+ this.commonsService.showConfirm('请确定当前订单无充值中记录!!!', item => {
+ if (item) {
+ this.loadingObject.status = true;
+ this.loadingObject.title = '订单退款中...';
+ this.orderMobileRechargeService.refundOrder(orderNo , data => {
+ if (data['return_code'] === '000000') {
+ this.getRequest(false, this.searchForm.value);
+ this.notification.success('成功' , '退款成功');
+ } else {
+ this.message.error(data['return_msg']);
+ this.notification.error( '失败' , data['return_msg']);
+ }
+ this.loadingObject.status = false;
+ });
+ }
+ });
+ }
+
+ public orderNormal(orderNo: string): void {
+
+ this.loadingObject.status = true;
+ this.loadingObject.title = '修改中...';
+ this.orderMobileRechargeService.orderNormal(orderNo , data => {
+ if (data['return_code'] === '000000') {
+ this.getRequest(false, this.searchForm.value);
+ this.notification.success('成功' , '修改成功');
+ } else {
+ this.message.error(data['return_msg']);
+ this.notification.error( '失败' , data['return_msg']);
+ }
+ this.loadingObject.status = false;
+ });
+ }
+
}
diff --git a/src/app/services/order/order-mobile-recharge.service.ts b/src/app/services/order/order-mobile-recharge.service.ts
index 0b8644b..1ba3ec7 100644
--- a/src/app/services/order/order-mobile-recharge.service.ts
+++ b/src/app/services/order/order-mobile-recharge.service.ts
@@ -51,4 +51,32 @@ export class OrderMobileRechargeService {
});
}
+ /**
+ * @Author Sum1Dream
+ * @methodName refundOrder
+ * @Description // 订单退款
+ * @Date 15:04 2023/5/18
+ * @Param orderNo
+ * @Param callBack
+ */
+ public refundOrder(orderNo: string, callBack) {
+ this.http.get(environment.orderUrl + 'mobileRecharge/refundOrder?orderNo=' + orderNo).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * @Author Sum1Dream
+ * @methodName orderNormal
+ * @Description // 异常转正常
+ * @Date 17:26 2023/5/18
+ * @Param orderNo
+ * @Param callBack
+ */
+ public orderNormal(orderNo: string, callBack) {
+ this.http.get(environment.orderUrl + 'mobileRecharge/orderNormal?orderNo=' + orderNo).subscribe(data => {
+ callBack(data);
+ });
+ }
+
}
From 6157d97f0483d48b024ba50e617c6cefd0c8eff2 Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Fri, 19 May 2023 11:35:24 +0800
Subject: [PATCH 6/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mobile-recharge-order-list.component.html | 10 +++++++++-
.../mobile-recharge-order-list.component.ts | 4 ++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html
index d7aee1f..52e119c 100644
--- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html
+++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html
@@ -195,8 +195,9 @@
@@ -275,6 +276,8 @@
充值内容 |
查询内容 |
创建时间 |
+ 更新时间 |
+
@@ -285,10 +288,15 @@
{{data.ext1}} |
{{data.ext3}} |
{{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}} |
+ {{data['updateTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} |
+
+
+
+
diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts
index e9287d1..f49c1a3 100644
--- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts
+++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts
@@ -200,6 +200,10 @@ export class MobileRechargeOrderListComponent implements OnInit {
public orderNormal(orderNo: string): void {
+ if (this.orderDetailModal) {
+ this.orderDetailModal = false;
+ }
+
this.loadingObject.status = true;
this.loadingObject.title = '修改中...';
this.orderMobileRechargeService.orderNormal(orderNo , data => {