parent
29f3ac7adb
commit
2c4d2c059b
@ -0,0 +1,160 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<!--条件搜索--> |
||||
<div class="inner-content"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> |
||||
<div nz-row> |
||||
|
||||
<div nz-col nzSpan="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">审核对象名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="objectName"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<!-- <div nz-col nzSpan="6">--> |
||||
<!-- <nz-form-item>--> |
||||
<!-- <nz-form-label [nzSpan]="6">审核类型</nz-form-label>--> |
||||
<!-- <nz-form-control [nzSpan]="16">--> |
||||
<!-- <nz-select formControlName="objectType">--> |
||||
<!-- <nz-option nzValue="1" nzLabel="Jack"></nz-option>--> |
||||
<!-- <nz-option nzValue="2" nzLabel="Lucy"></nz-option>--> |
||||
<!-- <nz-option nzValue="disabled" nzLabel="Disabled" nzDisabled></nz-option>--> |
||||
<!-- </nz-select>--> |
||||
<!-- </nz-form-control>--> |
||||
<!-- </nz-form-item>--> |
||||
<!-- </div>--> |
||||
<div nz-col nzSpan="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">审核流水号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="approveSerialNo"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
|
||||
<div nz-row> |
||||
<div nz-col nzSpan="24" class="search-button"> |
||||
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button> |
||||
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
|
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="50px">编号</th> |
||||
<th nzWidth="120px">审核流水号</th> |
||||
<th nzWidth="80px">审核对象名称</th> |
||||
<th nzWidth="80px">审核类型</th> |
||||
<th nzWidth="100px">提交人员</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="80px">状态</th> |
||||
<th nzWidth="80px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.approveSerialNo}}</td> |
||||
<td>{{data.objectName}}</td> |
||||
<td>{{data.objectType | auditType}}</td> |
||||
<td>{{data.submitOperatorName}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.status | auditStatus}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<a (click)="getDetail(data.id , data.objectType)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="审核详情"></i></a> |
||||
<nz-divider *ngIf="data['status'] === 1" nzType="vertical"></nz-divider> |
||||
<a (click)="approveProcessed(3 , data.id)" *ngIf="data['status'] === 1"><i nz-icon nzType="check-circle" nzTheme="outline" nz-tooltip="通过"></i></a> |
||||
<nz-divider *ngIf="data['status'] === 1" nzType="vertical"></nz-divider> |
||||
<a (click)="approveProcessed(2 , data.id)" *ngIf="data['status'] === 1"><i nz-icon nzType="stop" nz-tooltip="驳回" nzTheme="outline"></i></a> |
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
<nz-modal [(nzVisible)]="isVisible" nzWidth="900" nzTitle="审核详情" (nzOnCancel)="handleCancel()"> |
||||
<nz-tabset [nzType]="'card'"> |
||||
<nz-tab nzTitle="审核内容"> |
||||
<ng-container *ngIf="objectType !== 3"> |
||||
<nz-descriptions nzBordered> |
||||
<nz-descriptions-item nzTitle="审核类型" >{{data['approve']['objectType'] | auditType}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="审核状态">{{data['approve']['status'] | auditStatus}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="申请人员">{{data['approve']['submitOperatorName']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="审核名称">{{data['approve']['objectName']}}</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
</ng-container> |
||||
<div *nzModalFooter> |
||||
<button *ngIf="data['approve']['status'] !== 1" nz-button nzType="default" (click)="handleCancel()">关闭</button> |
||||
<button *ngIf="data['approve']['status'] === 1" nz-button nzType="default" (click)="approveProcessed(2 , this.id)">审核驳回</button> |
||||
<button *ngIf="data['approve']['status'] === 1" nz-button nzType="primary" (click)="approveProcessed(3 , this.id)">审核通过</button> |
||||
</div> |
||||
</nz-tab> |
||||
<nz-tab *ngIf="objectType === 4" nzTitle="实物商品内容"> |
||||
<ng-container *ngIf="objectType !== 3"> |
||||
<nz-descriptions nzBordered> |
||||
<nz-descriptions-item nzTitle="商品名称">{{data['object']['name']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="类型名称">{{data['object']['goodsTypeName']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="创建时间">{{data['object']['createTime'] | date : 'yyyy-MM-dd'}}</nz-descriptions-item> |
||||
<nz-descriptions-item [nzSpan]="3" nzTitle="列表图"> |
||||
<app-preview-image class="ml" *ngFor="let item of data['object']['listImg'].split(',') " [previewImage] = item ></app-preview-image> |
||||
</nz-descriptions-item> |
||||
<nz-descriptions-item [nzSpan]="3" nzTitle="轮播图"> |
||||
<app-preview-image class="ml" *ngFor="let item of data['object']['bannerImg'].split(',') " [previewImage] = item ></app-preview-image> |
||||
</nz-descriptions-item> |
||||
<nz-descriptions-item [nzSpan]="3" nzTitle="详情图"> |
||||
<app-preview-image class="ml" *ngFor="let item of data['object']['detailImg'].split(',') " [previewImage] = item ></app-preview-image> |
||||
</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
</ng-container> |
||||
</nz-tab> |
||||
<nz-tab *ngIf="objectType === 4" nzTitle="规格内容"> |
||||
<nz-table nzBordered #skuDataList [nzData]="data['object']['goodsSkus']" [nzHideOnSinglePage]="true"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="80px">名称</th> |
||||
<th nzWidth="80px">图片</th> |
||||
<th nzWidth="80px">销售价格</th> |
||||
<th nzWidth="80px">售卖价格</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
|
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of skuDataList.data"> |
||||
<td>{{data.name}}</td> |
||||
<td> |
||||
<app-preview-image [previewImage] = data.showImg ></app-preview-image> |
||||
</td> |
||||
<td>¥{{data.originalPrice}}</td> |
||||
<td>¥{{data.price}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
|
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</nz-tab> |
||||
</nz-tabset> |
||||
</nz-modal> |
||||
|
@ -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']); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
} |
||||
} |
@ -0,0 +1,135 @@ |
||||
<!--面包屑--> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
|
||||
<!--条件搜索--> |
||||
<div class="inner-content"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> |
||||
<div nz-row> |
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">区域名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="regionName"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div nz-row> |
||||
<div nz-col nzSpan="24" class="search-button"> |
||||
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button> |
||||
<button nz-button nzType="default" (click)="searchForm.reset()"> |
||||
<i nz-icon nzType="reload" nzTheme="outline"></i>重置 |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
|
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" (click)="getEdit()"><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button> |
||||
</div> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzBordered |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">编号</th> |
||||
<th nzWidth="120px">区域名称</th> |
||||
<th nzWidth="80px">包邮价格</th> |
||||
<th nzWidth="130px">运费</th> |
||||
<th nzWidth="120px">创建时间</th> |
||||
<th nzRight nzWidth="90px">状态</th> |
||||
<th nzRight nzWidth="100px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.regionName}}</td> |
||||
<td>¥{{data.freePostPrice}}</td> |
||||
<td>¥{{data.freightPrice}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd'}}</td> |
||||
<td nzRight="">{{data.status== 2? '审核中':'生效'}}</td> |
||||
<td nzRight class="table-td-operation"> |
||||
<a (click)="getEdit(data.id)">编辑</a> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a (click)="deleteFreight(data.id)">删除</a> |
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
<nz-modal [(nzVisible)]="isVisible" nzTitle="编辑" (nzOnCancel)="isVisible = false" (nzOnOk)="handleOkEdit()"> |
||||
|
||||
<nz-spin [nzSpinning]="isSpinningEdit"> |
||||
<form nz-form [formGroup]="validateForm" class="login-form"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>区域</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择区域!"> |
||||
<nz-tree-select |
||||
style="width: 250px" |
||||
nzPlaceHolder="请选择区域" |
||||
formControlName="regionId" |
||||
[nzDropdownMatchSelectWidth]="true" |
||||
[nzDropdownStyle]="{ 'max-height': '300px' }" |
||||
[nzNodes]="regionalData" |
||||
> |
||||
</nz-tree-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>包邮价格</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入包邮价格!"> |
||||
<nz-input-number |
||||
style="width: 200px" |
||||
formControlName="freePostPrice" |
||||
[nzMin]="0" |
||||
[nzMax]="100000" |
||||
[nzStep]="1" |
||||
[nzPrecision]="2" |
||||
nzPrecisionMode="cut" |
||||
nzPlaceHolder="请输入包邮价格!" |
||||
[nzFormatter]="formatterPercent" |
||||
[nzParser]="parserPercent" |
||||
></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>运费</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入运费!"> |
||||
<nz-input-number |
||||
style="width: 200px" |
||||
formControlName="freightPrice" |
||||
[nzMin]="0" |
||||
[nzMax]="100000" |
||||
[nzStep]="1" |
||||
[nzPrecision]="2" |
||||
nzPrecisionMode="cut" |
||||
nzPlaceHolder="请输入原价!" |
||||
[nzFormatter]="formatterPercent" |
||||
[nzParser]="parserPercent" |
||||
></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
</form> |
||||
</nz-spin> |
||||
</nz-modal> |
@ -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: '否', |
||||
}); |
||||
} |
||||
|
||||
|
||||
} |
@ -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 { } |
@ -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 { } |
@ -0,0 +1,434 @@ |
||||
<!--面包屑--> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
|
||||
<!--条件搜索--> |
||||
<div class="inner-content"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> |
||||
<div nz-row> |
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">商品名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="name"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">商品标签</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="goodsLabel"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择状态"> |
||||
<nz-option nzLabel="上架" [nzValue]="1"></nz-option> |
||||
<nz-option nzLabel="编辑中" [nzValue]="2"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
|
||||
<div nz-row> |
||||
<div nz-col nzSpan="24" class="search-button"> |
||||
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button> |
||||
<button nz-button nzType="default" (click)="searchForm.reset()"> |
||||
<i nz-icon nzType="reload" nzTheme="outline"></i>重置 |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
|
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" (click)="getEdit()"><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button> |
||||
</div> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzBordered |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">编号</th> |
||||
<th nzWidth="120px">商品名称</th> |
||||
<th nzWidth="120px">商品标签</th> |
||||
<th nzWidth="80px">商品类型</th> |
||||
<th nzWidth="130px">列表图片</th> |
||||
<th nzWidth="120px">创建时间</th> |
||||
<th nzRight nzWidth="90px">状态</th> |
||||
<th nzRight nzWidth="100px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.name}}</td> |
||||
<td>{{data.goodsLabel }}</td> |
||||
<td>{{data.goodsTypeName }}</td> |
||||
<td> |
||||
<app-preview-image [previewImage] = data.listImg ></app-preview-image> |
||||
</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd'}}</td> |
||||
<td nzRight="">{{data.status | goodsStatus}}</td> |
||||
<td nzRight class="table-td-operation"> |
||||
<a *ngIf="data.status != 1" (click)="getEdit(data.id)">编辑</a> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a nz-dropdown [nzDropdownMenu]="menu">更多操作</a> |
||||
<nz-dropdown-menu #menu="nzDropdownMenu"> |
||||
<ul nz-menu nzSelectable> |
||||
<li nz-menu-item> <a (click)="getSku(data.id)">查看规格</a></li> |
||||
<li class="li-a" nz-menu-item><a (click)="configSku(data.id)">配置规格</a></li> |
||||
<li *ngIf="'BTN_CONFIG_AWARD' | button" nz-menu-item> <a (click)="getPresent(data.id)">赠送列表</a></li> |
||||
<li *ngIf="'BTN_CONFIG_AWARD' | button" class="li-a" nz-menu-item><a (click)="configPresent(data.id)">配置赠送规则</a></li> |
||||
<li class="li-a" nz-menu-item><a (click)='goodsUpDown(data.id , data.status)'>{{data.status === 2 ? '申请上线': '禁用'}}</a></li> |
||||
<li class="li-a" *ngIf="data.status != 1" nz-menu-item><a (click)="deleteGoods(data.id)">删除</a></li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
<nz-modal [(nzVisible)]="isVisibleEdit" nzTitle="编辑{{title}}" (nzOnCancel)="isVisibleEdit = false" (nzOnOk)="handleOkEdit()"> |
||||
|
||||
<nz-spin [nzSpinning]="isSpinningEdit"> |
||||
<form nz-form [formGroup]="validateForm" class="login-form"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>商品名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商品名称!"> |
||||
<input nz-input formControlName="name" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>商品类型</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商品类型!"> |
||||
<nz-tree-select |
||||
style="width: 250px" |
||||
nzPlaceHolder="请选择商品类型" |
||||
formControlName="goodsType" |
||||
[nzDropdownMatchSelectWidth]="true" |
||||
[nzDropdownStyle]="{ 'max-height': '300px' }" |
||||
[nzNodes]="goodsTypeData" |
||||
> |
||||
</nz-tree-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" >商品标签</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="goodsLabel" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">列表描述</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="listDescribe" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>列表图</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择列表图!"> |
||||
<nz-upload |
||||
nzAction="{{url.baseUrl}}/fileUpload/uploadfile" |
||||
nzListType="picture-card" |
||||
[(nzFileList)]="listImg" |
||||
[nzShowButton]="listImg.length < 1" |
||||
[nzPreview]="handlePreview" |
||||
> |
||||
<i nz-icon nzType="plus"></i> |
||||
<div class="ant-upload-text">上传图片</div> |
||||
</nz-upload> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>轮播图</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择轮播图!"> |
||||
<nz-upload |
||||
nzAction="{{url.baseUrl}}/fileUpload/uploadfile" |
||||
nzListType="picture-card" |
||||
[(nzFileList)]="bannerImg" |
||||
[nzShowButton]="bannerImg.length < 6" |
||||
[nzPreview]="handlePreview" |
||||
> |
||||
<i nz-icon nzType="plus"></i> |
||||
<div class="ant-upload-text">上传图片</div> |
||||
</nz-upload> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>详情图</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择详情图!"> |
||||
<nz-upload |
||||
nzAction="{{url.baseUrl}}/fileUpload/uploadfile" |
||||
nzListType="picture-card" |
||||
[(nzFileList)]="detailImg" |
||||
[nzShowButton]="detailImg.length < 7" |
||||
[nzPreview]="handlePreview" |
||||
> |
||||
<i nz-icon nzType="plus"></i> |
||||
<div class="ant-upload-text">上传图片</div> |
||||
</nz-upload> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
|
||||
</form> |
||||
</nz-spin> |
||||
</nz-modal> |
||||
|
||||
<nz-modal [(nzVisible)]="isVisibleSku" nzTitle="编辑{{title}}" (nzOnCancel)="isVisibleSku = false" (nzOnOk)="handleOkSku()"> |
||||
|
||||
<nz-spin [nzSpinning]="isSpinningEdit"> |
||||
<form nz-form [formGroup]="validateFormSku" class="login-form"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>规格名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入规格名称!"> |
||||
<input nz-input formControlName="name" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>价格</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入价格!"> |
||||
<nz-input-number |
||||
style="width: 200px" |
||||
formControlName="price" |
||||
[nzMin]="0" |
||||
[nzMax]="100000" |
||||
[nzStep]="1" |
||||
[nzPrecision]="2" |
||||
nzPrecisionMode="cut" |
||||
nzPlaceHolder="请输入价格!" |
||||
[nzFormatter]="formatterPercent" |
||||
[nzParser]="parserPercent" |
||||
></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>原价</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入原价!"> |
||||
<nz-input-number |
||||
style="width: 200px" |
||||
formControlName="originalPrice" |
||||
[nzMin]="0" |
||||
[nzMax]="100000" |
||||
[nzStep]="1" |
||||
[nzPrecision]="2" |
||||
nzPrecisionMode="cut" |
||||
nzPlaceHolder="请输入原价!" |
||||
[nzFormatter]="formatterPercent" |
||||
[nzParser]="parserPercent" |
||||
></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>库存</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入库存!"> |
||||
<nz-input-number |
||||
style="width: 200px" |
||||
formControlName="stock" |
||||
[nzMin]="1" |
||||
[nzMax]="100000" |
||||
[nzStep]="1" |
||||
nzPlaceHolder="请输入库存!" |
||||
></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>小图</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择小图!"> |
||||
<nz-upload |
||||
nzAction="{{url.baseUrl}}/fileUpload/uploadfile" |
||||
nzListType="picture-card" |
||||
[(nzFileList)]="showImg" |
||||
[nzShowButton]="showImg.length < 1" |
||||
[nzPreview]="handlePreview" |
||||
> |
||||
<i nz-icon nzType="plus"></i> |
||||
<div class="ant-upload-text">上传图片</div> |
||||
</nz-upload> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>轮播图</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择轮播图!"> |
||||
<nz-upload |
||||
nzAction="{{url.baseUrl}}/fileUpload/uploadfile" |
||||
nzListType="picture-card" |
||||
[(nzFileList)]="bannerSkuImg" |
||||
[nzShowButton]="bannerSkuImg.length < 4" |
||||
[nzPreview]="handlePreview" |
||||
> |
||||
<i nz-icon nzType="plus"></i> |
||||
<div class="ant-upload-text">上传图片</div> |
||||
</nz-upload> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</form> |
||||
</nz-spin> |
||||
</nz-modal> |
||||
|
||||
|
||||
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false"> |
||||
<ng-template #modalContent> |
||||
<img [src]="previewImage" [ngStyle]="{ width: '100%' }" /> |
||||
</ng-template> |
||||
</nz-modal> |
||||
|
||||
<!--sku列表--> |
||||
<nz-modal [(nzVisible)]="isVisibleSkuList" nzTitle="规格列表" (nzOnCancel)="isVisibleSkuList = false" [nzFooter]="null" |
||||
nzWidth="1000px" [nzBodyStyle]=" { padding: '20px 20px 30px 20px'}"> |
||||
<nz-table [nzLoading]="loadingSku" nzBordered #skuDataList [nzData]="skuData" [nzHideOnSinglePage]="true"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="80px">名称</th> |
||||
<th nzWidth="80px">图片</th> |
||||
<th nzWidth="80px">销售价格</th> |
||||
<th nzWidth="80px">售卖价格</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="100px">更新时间</th> |
||||
<th nzWidth="70px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of skuDataList.data"> |
||||
<td>{{data.name}}</td> |
||||
<td> |
||||
<app-preview-image [previewImage] = data.showImg ></app-preview-image> |
||||
</td> |
||||
<td>¥{{data.originalPrice}}</td> |
||||
<td>¥{{data.price}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.updateTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<a (click)="configSku(data.goodsId , data.id)">编辑</a> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a (click)="deleteSku(data.id)">删除</a> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</nz-modal> |
||||
|
||||
<nz-modal [(nzVisible)]="isVisiblePresent" nzTitle="配置奖励" (nzOnCancel)="isVisiblePresent = false" (nzOnOk)="handleOk()"> |
||||
<div nz-row *ngFor="let control of listOfControl; let i = index"> |
||||
<div nz-col class="gutter-row" [nzSpan]="20"> |
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>类型</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择类型"> |
||||
<nz-select *ngIf="control.isEdit" nzShowSearch nzAllowClear [(ngModel)]="control.type" nzPlaceHolder="请选择类型"> |
||||
<nz-option nzLabel="卡券" [nzValue]="1"></nz-option> |
||||
<nz-option nzLabel="优惠券" [nzValue]="2"></nz-option> |
||||
</nz-select> |
||||
<span *ngIf="!control.isEdit">{{control.type === 1 ? '卡券': '优惠券'}}</span> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col *ngIf="control.type == 2" class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>代理商</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择代理商"> |
||||
<nz-select *ngIf="control.isEdit" nzShowSearch nzAllowClear [(ngModel)]="control.agentId" (ngModelChange)="getSourceNameName($event , i , presentType.agentName)" nzPlaceHolder="请选择代理商状态"> |
||||
<nz-option *ngFor="let item of agentData" nzLabel="{{item.agentName}}" [nzValue]="item.id"></nz-option> |
||||
</nz-select> |
||||
<span *ngIf="!control.isEdit">{{control.agentName}}</span> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col *ngIf="control.type == 2" class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>优惠券</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券"> |
||||
<nz-select *ngIf="control.isEdit" nzShowSearch nzAllowClear [(ngModel)]="control.sourceId" (ngModelChange)="getSourceNameName($event , i , presentType.discountName)" nzPlaceHolder="请选择优惠券"> |
||||
<nz-option *ngFor="let item of discountList" nzLabel="{{item['highDiscount'].discountName}}" [nzValue]="item.id"></nz-option> |
||||
</nz-select> |
||||
<span *ngIf="!control.isEdit">{{control.sourceName}}</span> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col *ngIf="control.type !== 2" class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>卡券</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择卡券"> |
||||
<nz-select *ngIf="control.isEdit" nzShowSearch [(ngModel)]="control.sourceId" |
||||
(ngModelChange)="getSourceNameName($event , i , presentType.couponName)" |
||||
nzPlaceHolder="请选择卡券" |
||||
> |
||||
<nz-option *ngFor="let item of listOfOption" [nzLabel]="item['couponName']" [nzValue]="item['id']"></nz-option> |
||||
</nz-select> |
||||
<span *ngIf="!control.isEdit">{{control.sourceName}}</span> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col class="gutter-row" [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>奖励数量</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入奖励数量"> |
||||
<input nz-input type="number" *ngIf="control.isEdit" [(ngModel)]="control.num" placeholder="请输入奖励数量" /> |
||||
<span *ngIf="!control.isEdit">{{control.num}}</span> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
<div nz-col class="gutter-row" [nzSpan]="4"> |
||||
<button nz-button nzType="default" (click)="removeField(i , $event)"><i nz-icon nzType="delete" nzTheme="outline"></i>删除</button> |
||||
<br/> |
||||
<button class="btn" *ngIf="control.isEdit" nz-button nzType="primary" (click)="addField(i)"><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button> |
||||
</div> |
||||
</div> |
||||
</nz-modal> |
||||
|
||||
|
||||
<nz-modal [(nzVisible)]="isVisiblePresentList" nzTitle="赠送列表列表" (nzOnCancel)="isVisiblePresentList = false" [nzFooter]="null" |
||||
nzWidth="1000px" [nzBodyStyle]=" { padding: '20px 20px 30px 20px'}"> |
||||
<nz-table [nzLoading]="loadingSku" nzBordered #presentDataList [nzData]="presentData" [nzHideOnSinglePage]="true"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="80px">类型</th> |
||||
<th nzWidth="120px">赠送内容</th> |
||||
<th nzWidth="40px">数量</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="100px">更新时间</th> |
||||
<th nzWidth="50px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of presentDataList.data"> |
||||
<td>{{data.type === 1 ? '卡券': '优惠券'}}</td> |
||||
<td>{{data.sourceName}}</td> |
||||
<td>{{data.num}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.updateTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<!-- <a (click)="configSku(data.goodsId , data.id)">编辑</a>--> |
||||
<!-- <nz-divider nzType="vertical"></nz-divider>--> |
||||
<a (click)="deletePresent(data.id)">删除</a> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</nz-modal> |
@ -0,0 +1,3 @@ |
||||
.btn { |
||||
margin-top: 20px; |
||||
} |
@ -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<string | ArrayBuffer | null> { |
||||
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: '否', |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,296 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
<nz-spin [nzSpinning]="loadingObject.status" [nzTip]="loadingObject.title"> |
||||
<!-- start 搜索条件 --> |
||||
<div [@openClose]="isCollapse ? 'open' : 'closed'"> |
||||
<div class="inner-content"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> |
||||
<div nz-row> |
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">交易单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="orderNo" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">客户电话</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="memPhone" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">交易状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-select formControlName="orderStatus" nzAllowClear> |
||||
<nz-option *ngFor="let item of orderStatusArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
|
||||
<div nz-row *ngIf="isCollapse"> |
||||
<div nz-col nzSpan="8" *ngIf="roleType == 0 || roleType == 1"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">分公司</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-select nzShowSearch formControlName="companyId" nzAllowClear> |
||||
<nz-option *ngFor="let item of companyArray" nzValue="{{item['id']}}" nzLabel="{{item['name']}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">支付方式</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-select nzAllowClear formControlName="payType"> |
||||
<nz-option nzValue="1" nzLabel="支付宝"></nz-option> |
||||
<nz-option nzValue="2" nzLabel="微信"></nz-option> |
||||
<nz-option nzValue="3" nzLabel="积分抵扣"></nz-option> |
||||
<nz-option nzValue="4" nzLabel="汇联通工会卡"></nz-option> |
||||
<nz-option nzValue="5" nzLabel="银联"></nz-option> |
||||
<nz-option nzValue="6" nzLabel="银联分期"></nz-option> |
||||
<nz-option nzValue="7" nzLabel="嗨森逛油卡"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">支付卡号</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="memCardNo" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">支付时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-range-picker |
||||
[nzShowTime]="{ nzHideDisabledOptions: true }" |
||||
formControlName="payTimeArray" |
||||
nzFormat="yyyy-MM-dd HH:mm:ss" |
||||
></nz-range-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">创建时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-range-picker |
||||
[nzShowTime]="{ nzHideDisabledOptions: true }" |
||||
formControlName="createTimeArray" |
||||
nzFormat="yyyy-MM-dd HH:mm:ss" |
||||
></nz-range-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">退款时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-range-picker |
||||
[nzShowTime]="{ nzHideDisabledOptions: true }" |
||||
formControlName="refundTimeArray" |
||||
nzFormat="yyyy-MM-dd HH:mm:ss" |
||||
></nz-range-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
<div nz-row> |
||||
<div nz-col nzSpan="24" class="search-button"> |
||||
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button> |
||||
<button nz-button nzType="default" (click)="searchForm.reset();"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||
<a class="collapse" (click)="isCollapse = !isCollapse;">{{!isCollapse ? '更多条件' : '隐藏条件'}}<i nz-icon [nzType]="!isCollapse ? 'down' : 'up'"></i></a> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
<!-- end 搜索条件 --> |
||||
|
||||
<!--列表数据--> |
||||
<div class="inner-content"> |
||||
<span>共计 {{total?total:0}} 条数据</span> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" (click)="excelOrder(searchForm.value)" ><i nz-icon nzType="export" nzTheme="outline"></i>导出Excel</button> |
||||
</div> |
||||
|
||||
<!--数组表格 --> |
||||
<nz-table #basicTable |
||||
nzShowPagination |
||||
nzShowSizeChanger |
||||
nzBordered |
||||
[nzData]="requestData" |
||||
[nzTotal]="total" |
||||
[nzLoading]="loading" |
||||
[nzFrontPagination]="false" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)" |
||||
[nzPageSizeOptions]="[10,20,50,100]" |
||||
[nzScroll]="{ x: '1200px'}"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="200px">交易单号</th> |
||||
<th nzWidth="130px">客户电话</th> |
||||
<th nzWidth="200px">订单名称</th> |
||||
<th nzWidth="100px">订单金额</th> |
||||
<th nzWidth="100px">支付金额</th> |
||||
<th nzWidth="100px">支付方式</th> |
||||
<th nzWidth="100px">订单状态</th> |
||||
<th nzWidth="180px">创建时间</th> |
||||
<th nzWidth="180px" nzRight="0px">物流状态</th> |
||||
<th nzWidth="110px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data;let i = index" [ngClass]="{'fontColor': data.logisticsStatus === '1' }"> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.memPhone}}</td> |
||||
<td>{{data.title}}</td> |
||||
<td>¥{{data.totalPrice}}</td> |
||||
<td>¥{{data.payPrice}}</td> |
||||
<td>{{data.orderStatus == 1 || data.orderStatus == 5 ? '未支付' : data.payType | orderPayType}}</td> |
||||
<td>{{data.orderStatus | orderStatus}}</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td nzRight="0px" >{{data.logisticsStatus | logisticsStatus}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a> |
||||
<nz-dropdown-menu #menu="nzDropdownMenu"> |
||||
<ul nz-menu nzSelectable> |
||||
<li nz-menu-item (click)="showOrderDetail(data.orderNo)"><a>详情</a></li> |
||||
<li nz-menu-item (click)="updateLogisticsNo(data.orderNo)"><a>录入物流编码</a></li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
</nz-spin> |
||||
|
||||
<nz-modal [(nzVisible)]="orderDetailModal" nzTitle="交易详情" (nzOnCancel)="orderDetailModal = false" [nzFooter]="null" |
||||
nzWidth="1000px" [nzBodyStyle]=" { padding: '20px 20px 30px 20px'}"> |
||||
<nz-spin [nzSpinning]="orderDetailModalLoading"> |
||||
<nz-tabset [nzType]="'card'"> |
||||
<nz-tab nzTitle="订单信息"> |
||||
<nz-descriptions nzBordered [nzColumn]="2" [nzSize]="'middle'"> |
||||
<nz-descriptions-item nzTitle="交易订单号">{{orderDetailObject.tradeOrder.orderNo}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="第三方交易号">{{orderDetailObject.tradeOrder.paySerialNo!=null?orderDetailObject.tradeOrder.paySerialNo:'无'}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="客户手机号">{{orderDetailObject.tradeOrder.memPhone}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="交易状态">{{orderDetailObject.tradeOrder.orderStatus | orderStatus}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="支付方式">{{orderDetailObject.tradeOrder.payType | orderPayType}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="支付卡号" *ngIf="orderDetailObject.tradeOrder.payType == 4 || orderDetailObject.tradeOrder.payType == 7"> |
||||
{{orderDetailObject.tradeOrder.memCardNo}} |
||||
</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="优惠券">{{orderDetailObject.tradeOrder.memDiscountName?orderDetailObject.tradeOrder.memDiscountName:'无'}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="返利">{{orderDetailObject.tradeOrder.whetherRebate?'是':'否'}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="备注">{{orderDetailObject.tradeOrder.remarks}}</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
</nz-tab> |
||||
<nz-tab nzTitle="支付信息"> |
||||
<nz-descriptions nzBordered [nzColumn]="3" [nzSize]="'middle'"> |
||||
<nz-descriptions-item nzTitle="交易总额" >{{orderDetailObject.tradeOrder.totalPrice}} 元</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="总优惠" >{{orderDetailObject.tradeOrder.totalDeductionPrice}} 元</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="产品优惠金额" >{{orderDetailObject.tradeOrder.deductionProductPrice}} 元</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="优惠券优惠" >{{orderDetailObject.tradeOrder.deductionCouponPrice}} 元</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="应付金额" >{{orderDetailObject.tradeOrder.payablePrice}} 元</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="积分抵扣" >{{orderDetailObject.tradeOrder.payGold / 100}} 元 </nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="实付金额" > |
||||
{{orderDetailObject.tradeOrder.payRealPrice!=null?orderDetailObject.tradeOrder.payRealPrice+' 元':'未支付'}} |
||||
</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
</nz-tab> |
||||
<nz-tab nzTitle="订单时间"> |
||||
<nz-card> |
||||
<nz-timeline> |
||||
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.createTime != null"> |
||||
<p>创建时间:{{orderDetailObject.tradeOrder.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</p> |
||||
<p>备注:{{orderDetailObject.tradeOrder.remarks?orderDetailObject.tradeOrder.remarks:'无'}}</p> |
||||
</nz-timeline-item> |
||||
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.cancelTime != null"> |
||||
<p>取消时间:{{orderDetailObject.tradeOrder.cancelTime | date : 'yyyy-MM-dd HH:mm:ss'}}</p> |
||||
<p>备注:{{orderDetailObject.tradeOrder.cancelRemarks?orderDetailObject.tradeOrder.cancelRemarks:'无'}}</p> |
||||
</nz-timeline-item> |
||||
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.payTime != null">支付时间:{{orderDetailObject.tradeOrder.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item> |
||||
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.finishTime != null">完成时间:{{orderDetailObject.tradeOrder.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item> |
||||
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.refundTime != null">退款时间:{{orderDetailObject.tradeOrder.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item> |
||||
</nz-timeline> |
||||
</nz-card> |
||||
</nz-tab> |
||||
<nz-tab nzTitle="商品信息"> |
||||
<nz-table nzBordered #childOrder [nzData]="orderDetailObject.tradeOrder.highChildOrderList" [nzHideOnSinglePage]="true"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="80px">产品类型</th> |
||||
<th nzWidth="100px">产品图片</th> |
||||
<th nzWidth="120px">产品名称</th> |
||||
<th nzWidth="30px">商品原价</th> |
||||
<th nzWidth="30px">支付价格</th> |
||||
<th nzWidth="20px">数量</th> |
||||
<th nzWidth="20px">支付总价</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of childOrder.data"> |
||||
<td>{{ data.goodsType | orderChildGoodsType}}</td> |
||||
<td> |
||||
<app-preview-image [previewImage] = data.goodsImg ></app-preview-image> |
||||
</td> |
||||
<td> |
||||
{{ data.goodsName }} |
||||
<nz-tag *ngIf="data.giveawayType == 1" [nzColor]="'magenta'">赠品</nz-tag> |
||||
</td> |
||||
<td>{{ data.goodsPrice }} 元</td> |
||||
<td>{{ data.goodsActualPrice }} 元</td> |
||||
<td>{{ data.saleCount }}</td> |
||||
<td>{{ data.totalActualPrice }} 元</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</nz-tab> |
||||
<nz-tab nzTitle="物流信息" *ngIf="orderDetailObject.goodsOrder.logisticsNo != null"> |
||||
<nz-timeline [nzReverse]="true"> |
||||
<nz-timeline-item *ngFor="let item of logisticsTraceDetails;let i = index" [nzColor]="i===logisticsTraceDetails.length -1?'green':'gray'"> |
||||
<p [ngClass]="{'fontColorBlue': i===logisticsTraceDetails.length -1 }">{{item['desc']}}</p> |
||||
<p [ngClass]="{'fontColorBlue': i===logisticsTraceDetails.length -1 }">{{item.time | date : 'yyyy-MM-dd HH:mm:ss'}}</p> |
||||
</nz-timeline-item> |
||||
</nz-timeline> |
||||
|
||||
</nz-tab> |
||||
</nz-tabset> |
||||
</nz-spin> |
||||
</nz-modal> |
||||
|
||||
<nz-modal [(nzVisible)]="isVisible" nzTitle="新增数量" (nzOnCancel)="isVisible = false" (nzOnOk)="handleOk()"> |
||||
<div nz-row> |
||||
<div nz-col nzSpan="20"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">物流单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input [(ngModel)]="logisticsNo"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
</nz-modal> |
@ -0,0 +1,9 @@ |
||||
img { |
||||
width: 60px; |
||||
} |
||||
.fontColor { |
||||
color: red; |
||||
} |
||||
.fontColorBlue { |
||||
color: #00a2d4; |
||||
} |
@ -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( '失败' , '更新成功'); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
@ -0,0 +1,7 @@ |
||||
<img class="head_img" src="{{imageUrl + previewImage}}" (click)="previewVisible = true" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> |
||||
|
||||
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false"> |
||||
<ng-template #modalContent> |
||||
<img [src]="imageUrl + previewImage" [ngStyle]="{ width: '100%' }" /> |
||||
</ng-template> |
||||
</nz-modal> |
@ -0,0 +1,4 @@ |
||||
.head_img { |
||||
height: 60px; |
||||
width: 60px; |
||||
} |
@ -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 { |
||||
} |
||||
|
||||
} |
@ -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 { } |
@ -0,0 +1,5 @@ |
||||
export enum PresentType { |
||||
discountName, |
||||
couponName, |
||||
agentName, |
||||
} |
@ -0,0 +1,3 @@ |
||||
|
||||
export enum Url { |
||||
} |
@ -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 '审核中'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -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 '待付款'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -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); |
||||
}); |
||||
} |
||||
} |
Loading…
Reference in new issue