master
parent
7d747a6846
commit
0bfd4909fd
@ -0,0 +1,112 @@ |
||||
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'"> |
||||
<div nz-row [nzGutter]="24"> |
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label>运营商</nz-form-label> |
||||
<nz-form-control> |
||||
<nz-select nzSize="large" nzShowSearch nzAllowClear nzPlaceHolder="请选择" formControlName="type"> |
||||
<nz-option nzLabel="电信运营商" nzValue="1"></nz-option> |
||||
<nz-option nzLabel="移动运营商" nzValue="2"></nz-option> |
||||
<nz-option nzLabel="联通运营商" nzValue="3"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col [nzSpan]="6" class="search-area"> |
||||
<button nz-button [nzType]="'primary'" (click)="getRequest(true)">查询</button> |
||||
<button nz-button (click)="searchForm.reset()">重置</button> |
||||
<button nz-button [nzType]="'primary'" (click)="showEdit()">创建</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
<nz-table #basicTable |
||||
[nzBordered]="true" |
||||
[nzFrontPagination]="false" |
||||
[nzShowQuickJumper]="true" |
||||
[nzShowTotal]="totalTemplate" |
||||
[(nzPageIndex)]="tablePageNum" |
||||
(nzPageIndexChange)="getRequest(false)" |
||||
[nzTotal]="tableData.total" |
||||
[nzData]="tableData.list" > |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="80px">运营商</th> |
||||
<th nzWidth="100px">充值金额</th> |
||||
<th nzWidth="160px">折扣金额</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="100px">更新时间</th> |
||||
<th nzWidth="70px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data"> |
||||
<td>{{data.type | priceType}}</td> |
||||
<td>¥{{data.price}}</td> |
||||
<td>¥{{data.payPrice}}</td> |
||||
<td>{{ data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{ data.updateTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td > |
||||
<a (click)="showEdit(data)">修改</a> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a nz-dropdown [nzDropdownMenu]="menu"> |
||||
更多 |
||||
<span nz-icon nzType="down"></span> |
||||
</a> |
||||
<nz-dropdown-menu #menu="nzDropdownMenu"> |
||||
<ul nz-menu nzSelectable> |
||||
<li nz-menu-item nzDanger> |
||||
<a nz-popconfirm nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="delete(data.id)">删除</a> |
||||
</li> |
||||
|
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
||||
|
||||
|
||||
<!--添加弹出框--> |
||||
<nz-modal [(nzVisible)]="isVisibleEdit" [nzMaskClosable] = false nzTitle="编辑优惠券" (nzOnCancel)="isVisibleEdit = false" (nzOnOk)="handleEdit()"> |
||||
<ng-container *nzModalContent> |
||||
<form nz-form [formGroup]="editForm"> |
||||
<nz-form-item > |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>运营商</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请选择运营商!"> |
||||
<nz-select nzSize="large" nzShowSearch nzAllowClear nzPlaceHolder="请选择" formControlName="type"> |
||||
<nz-option nzLabel="电信运营商" nzValue="1"></nz-option> |
||||
<nz-option nzLabel="移动运营商" nzValue="2"></nz-option> |
||||
<nz-option nzLabel="联通运营商" nzValue="3"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
<nz-form-item > |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>售卖价格</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入售卖价格!"> |
||||
<nz-input-number-group nzPrefix="¥" nzSuffix="RMB" style="width: 100%"> |
||||
<nz-input-number formControlName="payPrice" [nzPrecision]="2"></nz-input-number> |
||||
</nz-input-number-group> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item > |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>充值金额</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入充值金额!"> |
||||
<nz-input-number-group nzPrefix="¥" nzSuffix="RMB" style="width: 100%"> |
||||
<nz-input-number formControlName="price" [nzPrecision]="2" ></nz-input-number> |
||||
</nz-input-number-group> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item > |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>排序</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入排序!"> |
||||
<nz-input-number style="width: 100%" formControlName="sort" [nzSize]="'large'" [nzMin]="1" [nzMax]="99999" [nzStep]="1" ></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
|
||||
</form> |
||||
</ng-container> |
||||
</nz-modal> |
||||
|
@ -0,0 +1,12 @@ |
||||
[nz-form-label] { |
||||
overflow: visible; |
||||
} |
||||
button { |
||||
margin-left: 8px; |
||||
} |
||||
.submit-btn { |
||||
width: 150px; |
||||
} |
||||
.search-area { |
||||
margin-top: 30px; |
||||
} |
@ -0,0 +1,178 @@ |
||||
import { Component } from '@angular/core'; |
||||
import {DatePipe, NgForOf, NgIf} from "@angular/common"; |
||||
import {NzButtonComponent} from "ng-zorro-antd/button"; |
||||
import { |
||||
NzTableComponent, NzTableModule, |
||||
NzThMeasureDirective |
||||
} from "ng-zorro-antd/table"; |
||||
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
||||
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
||||
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; |
||||
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; |
||||
import {NzIconDirective} from "ng-zorro-antd/icon"; |
||||
|
||||
import { |
||||
NzInputNumberComponent, |
||||
NzInputNumberGroupComponent, |
||||
} from "ng-zorro-antd/input-number"; |
||||
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; |
||||
import {NzModalComponent, NzModalContentDirective, NzModalModule} from "ng-zorro-antd/modal"; |
||||
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
||||
import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; |
||||
import {FormGroup, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; |
||||
|
||||
import {NzMessageService} from "ng-zorro-antd/message"; |
||||
import {CommonService} from "../../../../services/common/common.service"; |
||||
import {RechargeService} from "../../../../services/recharge/recharge.service"; |
||||
import {NzInputDirective} from "ng-zorro-antd/input"; |
||||
import {PriceTypePipe} from "../../../../pipes/recharge/price-type.pipe"; |
||||
|
||||
@Component({ |
||||
selector: 'app-price-list', |
||||
standalone: true, |
||||
imports: [ |
||||
NzModalComponent, |
||||
NzFormLabelComponent, |
||||
NzRowDirective, |
||||
NzFormDirective, |
||||
ReactiveFormsModule, |
||||
NzColDirective, |
||||
NzSelectComponent, |
||||
NzOptionComponent, |
||||
NzButtonComponent, |
||||
NzTableComponent, |
||||
NzThMeasureDirective, |
||||
NgForOf, |
||||
NzModalModule, |
||||
NzDividerComponent, |
||||
NzTableModule, |
||||
NzDropDownADirective, |
||||
DatePipe, |
||||
NzDropDownDirective, |
||||
NzDropdownMenuComponent, |
||||
NzIconDirective, |
||||
NzPopconfirmDirective, |
||||
NzMenuDirective, |
||||
NzMenuItemComponent, |
||||
NzModalContentDirective, |
||||
NzInputNumberGroupComponent, |
||||
NzInputNumberComponent, |
||||
NzFormControlComponent, |
||||
NzFormItemComponent, |
||||
NzInputDirective, |
||||
PriceTypePipe |
||||
|
||||
], |
||||
templateUrl: './price-list.component.html', |
||||
styleUrl: './price-list.component.less' |
||||
}) |
||||
export class PriceListComponent { |
||||
// 表单页数
|
||||
tablePageNum = 1; |
||||
// 表单数据
|
||||
tableData: any = { |
||||
total: 0, |
||||
loading: false, |
||||
list: [], |
||||
}; |
||||
// 搜索表单
|
||||
searchForm: FormGroup; |
||||
|
||||
// 编辑产品类型表单
|
||||
editForm: FormGroup; |
||||
// 编辑弹出框
|
||||
isVisibleEdit = false; |
||||
|
||||
|
||||
constructor(private fb: NonNullableFormBuilder, |
||||
private msg: NzMessageService, |
||||
private commonService: CommonService, |
||||
private rechargeService: RechargeService) { |
||||
|
||||
// 初始化搜索框
|
||||
this.searchForm = this.fb.group({ |
||||
type: [''], |
||||
}); |
||||
|
||||
// 初始化
|
||||
this.editForm = this.fb.group({ |
||||
type: ['' , [Validators.required]], |
||||
sort: ['' , [Validators.required]], |
||||
price: ['' , [Validators.required]], |
||||
payPrice: ['' , [Validators.required]], |
||||
id: [null], |
||||
}); |
||||
this.getRequest(); |
||||
|
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false) { |
||||
this.tableData.loading = true; |
||||
if (reset) { |
||||
this.tablePageNum = 1; |
||||
} |
||||
this.searchForm.value.pageNum = this.tablePageNum; |
||||
this.searchForm.value.pageSize = 10; |
||||
this.searchForm.value.time = new Date().getTime(); |
||||
|
||||
this.rechargeService.getList(this.searchForm.value , (data: any) => { |
||||
if (data['return_code'] == '000000') { |
||||
this.tableData = data['return_data']; |
||||
} else { |
||||
this.msg.error(data['return_msg']); |
||||
} |
||||
this.tableData.loading = false; |
||||
}); |
||||
} |
||||
|
||||
|
||||
// 唤醒编辑表单
|
||||
showEdit(item?: any) { |
||||
if (item != null) { |
||||
item.type = String(item.type); |
||||
this.editForm.patchValue(item); |
||||
} else { |
||||
this.editForm.reset(); |
||||
} |
||||
this.isVisibleEdit = true; |
||||
} |
||||
// 编辑表单提交
|
||||
handleEdit(): void { |
||||
if (this.editForm.valid) { |
||||
|
||||
this.rechargeService.editPrice(this.editForm.value , (data: any) => { |
||||
if (data['return_code'] === '000000') { |
||||
this.msg.success("成功!"); |
||||
this.isVisibleEdit = false; |
||||
this.getRequest(); |
||||
} else { |
||||
this.msg.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} else { |
||||
Object.values(this.editForm.controls).forEach(control => { |
||||
if (control.invalid) { |
||||
control.markAsDirty(); |
||||
control.updateValueAndValidity({ onlySelf: true }); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
// 删除
|
||||
delete(id: number): void { |
||||
this.rechargeService.delete(id , (data: any) => { |
||||
if (data['return_code'] === '000000') { |
||||
this.msg.success("成功!"); |
||||
this.getRequest(); |
||||
} else { |
||||
this.msg.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,163 @@ |
||||
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'"> |
||||
<div nz-row [nzGutter]="24"> |
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label>商品名称</nz-form-label> |
||||
<nz-form-control> |
||||
<input nzSize="large" nz-input formControlName="goodsName" placeholder="请输入" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label>订单号</nz-form-label> |
||||
<nz-form-control> |
||||
<input nzSize="large" nz-input formControlName="orderNo" placeholder="请输入" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label>用户手机号</nz-form-label> |
||||
<nz-form-control> |
||||
<input nzSize="large" nz-input formControlName="userPhone" placeholder="请输入" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col [nzSpan]="24"> |
||||
<nz-form-item> |
||||
<nz-form-label>创建时间</nz-form-label> |
||||
<nz-form-control> |
||||
<nz-range-picker nzSize="large" formControlName="createTimeArray" nzShowTime [nzFormat]="'yyyy/MM/dd HH:mm:ss'"></nz-range-picker> |
||||
<nz-radio-group nzSize="large" nzButtonStyle="solid" formControlName="createTimeSelect" (ngModelChange)="createTimeInit()"> |
||||
<label nz-radio-button *ngFor="let item of dateTypeSelect" nzValue="{{item.value}}">{{item.name}}</label> |
||||
</nz-radio-group> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col [nzSpan]="6"> |
||||
<nz-form-item> |
||||
<nz-form-label>订单状态</nz-form-label> |
||||
<nz-form-control> |
||||
<nz-select nzSize="large" nzShowSearch nzAllowClear nzPlaceHolder="请选择" formControlName="status"> |
||||
<nz-option *ngFor="let item of orderCinemaStatus" nzLabel="{{item['name']}}" nzValue="{{item['key']}}"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
|
||||
<div nz-col [nzSpan]="24" class="search-area"> |
||||
<button nz-button [nzType]="'primary'" (click)="getRequest()">查询</button> |
||||
<button nz-button (click)="searchForm.reset()">重置</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
<nz-table #basicTable |
||||
[nzScroll]="{ x: '1980px' }" |
||||
[nzBordered]="true" |
||||
[nzFrontPagination]="false" |
||||
[nzShowQuickJumper]="true" |
||||
[nzShowTotal]="totalTemplate" |
||||
[(nzPageIndex)]="tablePageNum" |
||||
(nzPageIndexChange)="getRequest(false)" |
||||
[nzTotal]="tableData.total" |
||||
[nzData]="tableData.list" > |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="200px">商品名称</th> |
||||
<th nzWidth="100px">商品图片</th> |
||||
<th nzWidth="100px">商品分类</th> |
||||
<th nzWidth="100px">商品品牌</th> |
||||
<th nzWidth="100px">用户手机号</th> |
||||
<th nzWidth="100px">订单号</th> |
||||
<th nzWidth="100px">子订单号</th> |
||||
<th nzWidth="50px">创建时间</th> |
||||
<th nzWidth="50px">更新时间</th> |
||||
<th nzRight nzWidth="50px">物流状态</th> |
||||
<th nzRight nzWidth="70px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data"> |
||||
<td>{{data.goodsName}} - {{data.goodsSpecsName}}</td> |
||||
<td> |
||||
<img nz-image width="60px" height="60px" nzSrc="{{imageUrl + data.img }}" [nzFallback]="fallbackImg" alt="" /> |
||||
</td> |
||||
<td>{{data.goodsTypeName}}</td> |
||||
<td>{{data.goodsBrandName}}</td> |
||||
<td>{{data.userPhone}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.childOrderNo}}</td> |
||||
<td>{{data.logisticsNo}}</td> |
||||
<td>{{ data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{ data.updateTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td nzRight> |
||||
<a (click)="showDetail(data)">详情</a> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
||||
|
||||
<nz-modal [nzWidth]="1400" [(nzVisible)]="orderDetailModal" nzTitle="订单详情" (nzOnCancel)="orderDetailModal = false" (nzOnOk)="orderDetailModal = false"> |
||||
<ng-container *nzModalContent> |
||||
|
||||
<nz-tabset nzType="card"> |
||||
<nz-tab nzTitle="订单信息"> |
||||
<nz-descriptions nzTitle="订单信息" nzBordered> |
||||
<nz-descriptions-item nzTitle="商品名称">{{orderGoodsData?.goodsName}} - {{orderGoodsData?.goodsSpecsName}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="用户手机号">{{ orderGoodsData?.userPhone }}</nz-descriptions-item>//. |
||||
0 <nz-descriptions-item nzTitle="商品分类">{{ orderGoodsData?.goodsTypeName }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="商品品牌">{{ orderGoodsData?.goodsBrandName }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="商品价格">{{ orderGoodsData?.goodsSpecsOriginalPrice }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="商品数量">{{ orderGoodsData?.goodsCount }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="图片" [nzSpan]="3"> |
||||
<nz-image-group> |
||||
<img nz-image width="80px" [nzFallback]="fallbackImg" nzSrc="{{imageUrl + orderGoodsData.img }}" alt="" /> |
||||
</nz-image-group> |
||||
</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="物流状态" [nzSpan]="3"> |
||||
<span *ngIf="orderGoodsData?.logisticsStatusDesc == null"> |
||||
{{orderGoodsData.status | orderGoodsStatus}} |
||||
</span> |
||||
<span *ngIf="orderGoodsData?.logisticsStatusDesc != null"> |
||||
<nz-badge *ngIf="orderGoodsData?.logisticsStatus == 'DELIVERING'" nzColor="cyan" nzText="{{orderGoodsData.logisticsStatusDesc}}"></nz-badge> |
||||
<nz-badge *ngIf="orderGoodsData?.logisticsStatus == 'TRANSPORT'" nzColor="lime" nzText="{{orderGoodsData.logisticsStatusDesc}}"></nz-badge> |
||||
<nz-badge *ngIf="orderGoodsData?.logisticsStatus == 'AGENT_SIGN'" nzStatus="success" nzText="{{orderGoodsData.logisticsStatusDesc}}"></nz-badge> |
||||
<nz-badge *ngIf="orderGoodsData?.logisticsStatus == 'SIGN'" nzStatus="success" nzText="{{orderGoodsData.logisticsStatusDesc}}"></nz-badge> |
||||
<nz-badge *ngIf="orderGoodsData?.logisticsStatus == 'ACCEPT'" nzStatus="processing" nzText="{{orderGoodsData.logisticsStatusDesc}}"></nz-badge> |
||||
<nz-badge *ngIf="orderGoodsData?.logisticsStatus == 'FAILED'" nzStatus="error" nzText="{{orderGoodsData.logisticsStatusDesc}}"></nz-badge> |
||||
<nz-badge *ngIf="orderGoodsData?.logisticsStatus == 'WAIT_ACCEPT'" nzStatus="default" nzText="{{orderGoodsData.logisticsStatusDesc}}"></nz-badge> |
||||
</span> |
||||
</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
</nz-tab> |
||||
<nz-tab nzTitle="支付信息"> |
||||
<nz-descriptions nzTitle="支付信息" nzBordered> |
||||
<nz-descriptions-item nzTitle="订单号">{{ orderGoodsData?.orderNo }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="子订单号" [nzSpan]="2">{{ orderGoodsData?.childOrderNo }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="支付流水号" [nzSpan]="3">{{ orderGoodsData?.paySerialNo }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="商品总金额" [nzSpan]="3">{{ orderGoodsData?.totalPrice }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="优惠券优惠金额" [nzSpan]="3">{{ orderGoodsData?.couponDiscountPrice }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="积分抵扣优惠金额" [nzSpan]="3">{{ orderGoodsData?.integralDiscountPrice }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="总优惠金额(优惠券优惠金额 + 积分抵扣)" [nzSpan]="3">{{ orderGoodsData?.totalDeductionPrice }}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="实付金额" [nzSpan]="3">{{ orderGoodsData?.payRealPrice }}</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
</nz-tab> |
||||
<nz-tab nzTitle="订单时间"> |
||||
<nz-descriptions nzTitle="订单时间" nzBordered> |
||||
<nz-descriptions-item *ngIf="orderGoodsData?.createTime != null" nzTitle="创建时间">{{ orderGoodsData?.createTime | date: 'yyyy-MM-dd HH:mm' }}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="orderGoodsData?.payTime != null" nzTitle="支付时间">{{ orderGoodsData?.payTime | date: 'yyyy-MM-dd HH:mm' }}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="orderGoodsData?.cancelTime != null" nzTitle="取消时间">{{ orderGoodsData?.cancelTime | date: 'yyyy-MM-dd HH:mm' }}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="orderGoodsData?.refundTime != null" nzTitle="退款时间">{{ orderGoodsData?.refundTime | date: 'yyyy-MM-dd HH:mm' }}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="orderGoodsData?.finishTime != null" nzTitle="完成时间">{{ orderGoodsData?.finishTime | date: 'yyyy-MM-dd HH:mm' }}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="orderGoodsData?.updateTime != null" nzTitle="更新时间">{{ orderGoodsData?.updateTime | date: 'yyyy-MM-dd HH:mm' }}</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
</nz-tab> |
||||
</nz-tabset> |
||||
|
||||
</ng-container> |
||||
</nz-modal> |
||||
|
@ -0,0 +1,6 @@ |
||||
.search-area { |
||||
margin-bottom: 10px; |
||||
} |
||||
.search-area button { |
||||
margin-right: 8px; |
||||
} |
@ -0,0 +1,184 @@ |
||||
import { Component } from '@angular/core'; |
||||
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms"; |
||||
import {environment} from "../../../../environments/environment"; |
||||
import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service"; |
||||
import {NzMessageService} from "ng-zorro-antd/message"; |
||||
import {OrderGoodsData} from "../../../model/order.interface"; |
||||
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
||||
import {NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; |
||||
import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; |
||||
import {NzInputDirective} from "ng-zorro-antd/input"; |
||||
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
||||
import {NzButtonComponent} from "ng-zorro-antd/button"; |
||||
import {NzTableComponent, NzTableModule, NzThMeasureDirective} from "ng-zorro-antd/table"; |
||||
import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; |
||||
import {NzModalModule} from "ng-zorro-antd/modal"; |
||||
import {DatePipe, NgClass, NgForOf, NgIf} from "@angular/common"; |
||||
import {GoodsStatusPipe} from "../../../pipes/goods/goods-status.pipe"; |
||||
import {OrderGoodsStatusPipe} from "../../../pipes/order/order-goods-status.pipe"; |
||||
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; |
||||
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; |
||||
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; |
||||
import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; |
||||
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
||||
import {NzTabSetComponent, NzTabsModule} from "ng-zorro-antd/tabs"; |
||||
import {NzIconDirective} from "ng-zorro-antd/icon"; |
||||
import {fallbackImg, orderCinemaStatus} from '../../../data/goods/goods.namespace'; |
||||
import {NzBadgeComponent} from "ng-zorro-antd/badge"; |
||||
import {AuditStatusPipe} from "../../../pipes/audit/audit-status.pipe"; |
||||
import {NzSpinComponent} from "ng-zorro-antd/spin"; |
||||
import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline"; |
||||
import {NzResultComponent} from "ng-zorro-antd/result"; |
||||
import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker"; |
||||
import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio"; |
||||
import {OrderCinemaService} from "../../../services/trade/order-cinema.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-order-cinema', |
||||
standalone: true, |
||||
imports: [ |
||||
NzColDirective, |
||||
NzRowDirective, |
||||
NzFormDirective, |
||||
ReactiveFormsModule, |
||||
NzTreeSelectComponent, |
||||
NzInputDirective, |
||||
NzSelectComponent, |
||||
NzOptionComponent, |
||||
NzButtonComponent, |
||||
NzTableComponent, |
||||
NzImageModule, |
||||
NzModalModule, |
||||
NzTableModule, |
||||
NzFormModule, |
||||
NzThMeasureDirective, |
||||
NgForOf, |
||||
NzImageDirective, |
||||
GoodsStatusPipe, |
||||
DatePipe, |
||||
OrderGoodsStatusPipe, |
||||
NzDropdownMenuComponent, |
||||
NgIf, |
||||
NzMenuDirective, |
||||
NzDescriptionsModule, |
||||
NzMenuItemComponent, |
||||
NzPopconfirmDirective, |
||||
NzDividerComponent, |
||||
NzDropDownADirective, |
||||
NzDropDownDirective, |
||||
NzTabsModule, |
||||
NzIconDirective, |
||||
NzBadgeComponent, |
||||
AuditStatusPipe, |
||||
NzTabSetComponent, |
||||
FormsModule, |
||||
NzSpinComponent, |
||||
NzTimelineItemComponent, |
||||
NgClass, |
||||
NzResultComponent, |
||||
NzTimelineComponent, |
||||
NzDatePickerComponent, |
||||
NzRadioButtonDirective, |
||||
NzRadioComponent, |
||||
NzRadioGroupComponent, |
||||
NzRangePickerComponent, |
||||
], |
||||
templateUrl: './order-cinema.component.html', |
||||
styleUrl: './order-cinema.component.less' |
||||
}) |
||||
export class OrderCinemaComponent { |
||||
// 表单页数
|
||||
tablePageNum = 1; |
||||
// 表单数据
|
||||
tableData: any = { |
||||
total: 0, |
||||
loading: false, |
||||
list: [], |
||||
}; |
||||
// 搜索表单
|
||||
searchForm: FormGroup; |
||||
|
||||
baseUrl = environment.baseUrl; |
||||
imageUrl = environment.imageUrl; |
||||
|
||||
orderGoodsData: any; |
||||
orderDetailModal = false; |
||||
// 时间类型选择
|
||||
dateTypeSelect = DateSelectType; |
||||
|
||||
|
||||
protected readonly fallbackImg = fallbackImg; |
||||
protected readonly orderCinemaStatus = orderCinemaStatus; |
||||
|
||||
constructor(private fb: NonNullableFormBuilder, |
||||
private msg: NzMessageService, |
||||
private orderCinema: OrderCinemaService) { |
||||
|
||||
|
||||
// 初始化搜索框
|
||||
this.searchForm = this.fb.group({ |
||||
orderNo: [''], |
||||
userPhone: [''], |
||||
goodsSpecsName: [''], |
||||
createTimeArray: [[]], |
||||
createTimeSelect: ['1'], |
||||
createTimeS: [''], |
||||
createTimeE: [''], |
||||
goodsName: [''], |
||||
payType: [''], |
||||
status: [''], |
||||
}); |
||||
|
||||
this.getRequest(); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false) { |
||||
|
||||
if (this.searchForm.controls['createTimeArray'].value != null |
||||
&& this.searchForm.controls['createTimeArray'].value.length > 0) { |
||||
this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0]); |
||||
this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1]); |
||||
} else { |
||||
this.searchForm.controls['createTimeS'].setValue(null) |
||||
this.searchForm.controls['createTimeE'].setValue(null) |
||||
} |
||||
|
||||
this.tableData.loading = true; |
||||
if (reset) { |
||||
this.tablePageNum = 1; |
||||
} |
||||
this.searchForm.value.pageNum = this.tablePageNum; |
||||
this.searchForm.value.pageSize = 10; |
||||
this.searchForm.value.time = new Date().getTime(); |
||||
|
||||
this.orderCinema.getListCinema(this.searchForm.value , (data: any) => { |
||||
if (data['return_code'] == '000000') { |
||||
this.tableData = data['return_data']; |
||||
} else { |
||||
this.msg.error(data['return_msg']); |
||||
} |
||||
this.tableData.loading = false; |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 创建时间初始化 |
||||
*/ |
||||
createTimeInit() { |
||||
let createTimeSelect = this.searchForm.controls['createTimeSelect'].value; |
||||
if (createTimeSelect != null) { |
||||
let timeObj = DateUtils.getDate(new Date(), Number(createTimeSelect)); |
||||
this.searchForm.controls['createTimeArray'].setValue([timeObj.timeS, timeObj.timeE]); |
||||
} |
||||
} |
||||
|
||||
|
||||
showDetail(data: OrderGoodsData): void { |
||||
this.orderGoodsData = data; |
||||
this.orderDetailModal = true; |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'priceType', |
||||
standalone: true |
||||
}) |
||||
export class PriceTypePipe implements PipeTransform { |
||||
|
||||
transform(value: number): any { |
||||
switch (value) { |
||||
case 1: |
||||
return '电信运营商'; |
||||
case 2: |
||||
return '移动运营商'; |
||||
case 3: |
||||
return '联通运营商'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,45 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {environment} from "../../../environments/environment"; |
||||
import {ObjectData} from "../../utils/objectData.service"; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class RechargeService { |
||||
|
||||
constructor(private http: HttpClient) { } |
||||
|
||||
/** |
||||
* 编辑金额 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public editPrice(params: object, callBack:any) { |
||||
this.http.post(environment.baseUrl + 'price/editPrice', params).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* @param params |
||||
* @param callBack |
||||
*/ |
||||
public getList(params: object, callBack:any) { |
||||
this.http.get(environment.baseUrl + 'price/getListPrice?' + ObjectData.objectByString(params)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* @param id |
||||
* @param callBack |
||||
*/ |
||||
public delete(id: number, callBack:any) { |
||||
this.http.get(environment.baseUrl + 'price/delete?id=' + id ).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,23 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {environment} from "../../../environments/environment"; |
||||
import {ObjectData} from "../../utils/objectData.service"; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class OrderCinemaService { |
||||
|
||||
constructor(private http: HttpClient) { } |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* @param param |
||||
* @param callBack |
||||
*/ |
||||
public getListCinema(param: object, callBack:any) { |
||||
this.http.get(environment.orderUrl + 'orderCinema/getListCinema?'+ObjectData.objectByString(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
Loading…
Reference in new issue