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); + }); + } +}