parent
22997e0be5
commit
d1093ed642
@ -1 +1,240 @@ |
|||||||
<p>comp-order works!</p> |
<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 nz-input formControlName="userPhone" 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 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> |
||||||
|
<nz-select formControlName="payType" nzAllowClear [nzPlaceHolder]="'请选择'"> |
||||||
|
<nz-option *ngFor="let item of orderPayTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</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 formControlName="tradeStatus" nzAllowClear [nzPlaceHolder]="'请选择'"> |
||||||
|
<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 nz-col [nzSpan]="24"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label>创建时间</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-range-picker formControlName="createTimeArray" nzShowTime [nzFormat]="'yyyy/MM/dd HH:mm:ss'"></nz-range-picker> |
||||||
|
<nz-radio-group 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" [hidden]="!isCollapse"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label>商品名称</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<input nz-input formControlName="goodsName" placeholder="请输入" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col [nzSpan]="6" [hidden]="!isCollapse"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label>卡密订单</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<input nz-input formControlName="channelOrderNo" placeholder="请输入" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col [nzSpan]="6" [hidden]="!isCollapse"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label>卡密</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<input nz-input formControlName="couNo" placeholder="请输入" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col [nzSpan]="6" [hidden]="!isCollapse"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label>卡密状态</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-select formControlName="couStatus" nzAllowClear [nzPlaceHolder]="'请选择'"> |
||||||
|
<nz-option *ngFor="let item of orderCouponNoStatus" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></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)="searchFormSubmit()">查询</button> |
||||||
|
<button nz-button (click)="searchFormReset()">重置</button> |
||||||
|
<a class="collapse" (click)="isCollapse = !isCollapse"> |
||||||
|
更多查询条件 |
||||||
|
<i nz-icon [nzType]="!isCollapse ? 'down' : 'up'"></i> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
|
||||||
|
<nz-table #basicTable |
||||||
|
[nzScroll]="{ x: '3500px' }" |
||||||
|
[nzBordered]="true" |
||||||
|
[nzFrontPagination]="false" |
||||||
|
[nzShowQuickJumper]="true" |
||||||
|
[nzShowTotal]="totalTemplate" |
||||||
|
[(nzPageIndex)]="tablePageNum" |
||||||
|
(nzPageIndexChange)="queryData()" |
||||||
|
[nzTotal]="tableData.total" |
||||||
|
[nzData]="tableData.list" > |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th rowspan="2" nzWidth="180px">交易单号</th> |
||||||
|
<th rowspan="2" nzWidth="150px">子交易单号</th> |
||||||
|
<th rowspan="2" nzWidth="120px">用户手机号</th> |
||||||
|
<th rowspan="2" nzWidth="120px">商品key</th> |
||||||
|
<th rowspan="2" nzWidth="180px">商品名称</th> |
||||||
|
<th rowspan="2" nzWidth="150px">商品规格</th> |
||||||
|
<th rowspan="2" nzWidth="100px">商品价格</th> |
||||||
|
<th rowspan="2" nzWidth="100px">购买数量</th> |
||||||
|
<th colspan="9">交易信息</th> |
||||||
|
<th rowspan="2">卡密订单</th> |
||||||
|
<th rowspan="2">卡密</th> |
||||||
|
<th rowspan="2">过期时间</th> |
||||||
|
<th rowspan="2">卡密状态</th> |
||||||
|
<th rowspan="2" nzRight>操作</th> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>订单金额</th> |
||||||
|
<th>优惠券优惠</th> |
||||||
|
<th>积分抵扣</th> |
||||||
|
<th>实付金额</th> |
||||||
|
<th>支付渠道</th> |
||||||
|
<th>支付方式</th> |
||||||
|
<th>交易状态</th> |
||||||
|
<th>创建时间</th> |
||||||
|
<th>支付时间</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;index as i"> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.orderNo}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.childOrderNo}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.userPhone}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.goodsKey}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.goodsName}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.goodsSpecsName}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.goodsPrice}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.goodsCount}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.totalPrice}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.couponDiscountPrice}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.integralDiscountPrice}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.payRealPrice}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.payChannel | dictionary: 'ORDER_PAY_CHANNEL'}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.payType | dictionary: 'ORDER_PAY_TYPE'}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.tradeStatus | dictionary: 'ORDER_CHILD_STATUS'}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td *ngIf="basicTable.data[i-1]?.orderNo != data['orderNo']" rowSpan="{{data.goodsCount}}">{{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td nzEllipsis nz-tooltip nzTooltipTitle="{{data.channelOrderNo}}">{{data.channelOrderNo}}</td> |
||||||
|
<td nzEllipsis nz-tooltip nzTooltipTitle="{{data.couNo}}">{{data.couNo}}</td> |
||||||
|
<td>{{data.expireTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{data.couStatus | dictionary: 'ORDER_COUPON_NO_STATUS'}}</td> |
||||||
|
<td nzRight> |
||||||
|
<a (click)="showDetail(data.childOrderNo)">详情</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 >删除</li> |
||||||
|
</ul> |
||||||
|
</nz-dropdown-menu> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
||||||
|
</nz-table> |
||||||
|
|
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="orderDetailVisible" nzWidth="1000px" nzTitle="订单详情" [nzFooter]="null" (nzOnCancel)="closeDetail()" [nzBodyStyle]="{ 'padding': '10px' }"> |
||||||
|
<ng-container *nzModalContent> |
||||||
|
<nz-tabset nzType="card" nzSize="small"> |
||||||
|
<nz-tab nzTitle="交易详情"> |
||||||
|
<nz-descriptions nzBordered [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }"> |
||||||
|
<nz-descriptions-item nzTitle="交易单号">Zhou Maomao</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="子订单号">18100000000</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="交易金额"></nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="总优惠金额"></nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="优惠券优惠"></nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="积分抵扣"></nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="实付金额"></nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="用户手机号"></nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="创建时间">Empty</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="支付时间">Empty</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="完成时间">Empty</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="取消时间">Empty</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="退款时间">Empty</nz-descriptions-item> |
||||||
|
</nz-descriptions> |
||||||
|
</nz-tab> |
||||||
|
<nz-tab nzTitle="商品详情"> |
||||||
|
<nz-table #orderDetailTable |
||||||
|
[nzData]="tableData.list" |
||||||
|
[nzTotal]="tableData.list.length" |
||||||
|
[nzScroll]="{ x: '2000px' }" |
||||||
|
[nzPaginationType]="'small'" |
||||||
|
[nzSize]="'small'" |
||||||
|
> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>商品key</th> |
||||||
|
<th>商品名称</th> |
||||||
|
<th>商品规格</th> |
||||||
|
<th>商品面值</th> |
||||||
|
<th>卡密订单号</th> |
||||||
|
<th>卡密</th> |
||||||
|
<th>状态</th> |
||||||
|
<th>过期时间</th> |
||||||
|
<th>派发时间</th> |
||||||
|
<th>过期时间</th> |
||||||
|
<th>完成时间</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of orderDetailTable.data"> |
||||||
|
<td>{{ data.goodsKey }}</td> |
||||||
|
<td>{{ data.goodsName }}</td> |
||||||
|
<td>{{ data.goodsSpecsName }}</td> |
||||||
|
<td>{{ data.goodsPrice }}</td> |
||||||
|
<td nzEllipsis nz-tooltip nzTooltipTitle="{{data.channelOrderNo}}">{{ data.channelOrderNo }}</td> |
||||||
|
<td nzEllipsis nz-tooltip nzTooltipTitle="{{data.couNo}}">{{ data.couNo }}</td> |
||||||
|
<td>{{ data.couStatus | dictionary: 'ORDER_COUPON_NO_STATUS'}}</td> |
||||||
|
<td>{{ data.expireTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{ data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td>{{ data.deliverTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td> |
||||||
|
<td>{{ data.finishTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</nz-tab> |
||||||
|
</nz-tabset> |
||||||
|
|
||||||
|
</ng-container> |
||||||
|
</nz-modal> |
||||||
|
@ -0,0 +1,6 @@ |
|||||||
|
.search-area { |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
.search-area button { |
||||||
|
margin-right: 8px; |
||||||
|
} |
@ -1,12 +1,202 @@ |
|||||||
import { Component } from '@angular/core'; |
import { Component } from '@angular/core'; |
||||||
|
import {DatePipe, NgForOf, NgIf, NgSwitch} from "@angular/common"; |
||||||
|
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; |
||||||
|
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms"; |
||||||
|
import {NzButtonComponent} from "ng-zorro-antd/button"; |
||||||
|
import { |
||||||
|
NzCellEllipsisDirective, |
||||||
|
NzCellFixedDirective, |
||||||
|
NzTableCellDirective, |
||||||
|
NzTableComponent, |
||||||
|
NzTbodyComponent, NzTheadComponent, |
||||||
|
NzThMeasureDirective, NzTrDirective |
||||||
|
} 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 {NzFlexDirective} from "ng-zorro-antd/flex"; |
||||||
|
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; |
||||||
|
import {NzIconDirective} from "ng-zorro-antd/icon"; |
||||||
|
import {NzInputDirective} from "ng-zorro-antd/input"; |
||||||
|
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; |
||||||
|
import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/modal"; |
||||||
|
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
||||||
|
import {SysAccountService} from "../../../services/account/sys-account.service"; |
||||||
|
import {RoleService} from "../../../services/role/role.service"; |
||||||
|
import {NzMessageService} from "ng-zorro-antd/message"; |
||||||
|
import {OrderService} from "../../../services/trade/order.service"; |
||||||
|
import {NzDatePickerComponent, NzDatePickerModule, NzRangePickerComponent} from "ng-zorro-antd/date-picker"; |
||||||
|
import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio"; |
||||||
|
import {NzTooltipDirective} from "ng-zorro-antd/tooltip"; |
||||||
|
import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service"; |
||||||
|
import {NzTreeComponent} from "ng-zorro-antd/tree"; |
||||||
|
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; |
||||||
|
import {NzTabComponent, NzTabSetComponent, NzTabsModule} from "ng-zorro-antd/tabs"; |
||||||
|
|
||||||
@Component({ |
@Component({ |
||||||
selector: 'app-comp-order', |
selector: 'app-comp-order', |
||||||
standalone: true, |
standalone: true, |
||||||
imports: [], |
imports: [ |
||||||
|
DatePipe, |
||||||
|
DictionaryPipe, |
||||||
|
FormsModule, |
||||||
|
NgForOf, |
||||||
|
NgIf, |
||||||
|
NzButtonComponent, |
||||||
|
NzCellFixedDirective, |
||||||
|
NzColDirective, |
||||||
|
NzDividerComponent, |
||||||
|
NzDropDownADirective, |
||||||
|
NzDropDownDirective, |
||||||
|
NzDropdownMenuComponent, |
||||||
|
NzFlexDirective, |
||||||
|
NzFormControlComponent, |
||||||
|
NzFormDirective, |
||||||
|
NzFormItemComponent, |
||||||
|
NzFormLabelComponent, |
||||||
|
NzIconDirective, |
||||||
|
NzInputDirective, |
||||||
|
NzMenuDirective, |
||||||
|
NzMenuItemComponent, |
||||||
|
NzModalComponent, |
||||||
|
NzOptionComponent, |
||||||
|
NzRowDirective, |
||||||
|
NzSelectComponent, |
||||||
|
NzTableCellDirective, |
||||||
|
NzTableComponent, |
||||||
|
NzTbodyComponent, |
||||||
|
NzThMeasureDirective, |
||||||
|
NzTheadComponent, |
||||||
|
NzTrDirective, |
||||||
|
ReactiveFormsModule, |
||||||
|
NzModalModule, |
||||||
|
NzRangePickerComponent, |
||||||
|
NzDatePickerComponent, |
||||||
|
NzDatePickerModule, |
||||||
|
NzRadioButtonDirective, |
||||||
|
NzRadioComponent, |
||||||
|
NzRadioGroupComponent, |
||||||
|
NgSwitch, |
||||||
|
NzCellEllipsisDirective, |
||||||
|
NzTooltipDirective, |
||||||
|
NzTreeComponent, |
||||||
|
NzDescriptionsModule, |
||||||
|
NzTabSetComponent, |
||||||
|
NzTabComponent, |
||||||
|
NzTabsModule |
||||||
|
], |
||||||
templateUrl: './comp-order.component.html', |
templateUrl: './comp-order.component.html', |
||||||
styleUrl: './comp-order.component.less' |
styleUrl: './comp-order.component.less' |
||||||
}) |
}) |
||||||
export class CompOrderComponent { |
export class CompOrderComponent { |
||||||
|
// 表单页数
|
||||||
|
tablePageNum = 1; |
||||||
|
// 表单数据
|
||||||
|
tableData: any = { |
||||||
|
total: 0, |
||||||
|
list: [], |
||||||
|
}; |
||||||
|
// 搜索表单
|
||||||
|
searchForm: FormGroup; |
||||||
|
// 更多查询条件
|
||||||
|
isCollapse = false; |
||||||
|
// 时间类型选择
|
||||||
|
dateTypeSelect = DateSelectType; |
||||||
|
// 订单支付类型
|
||||||
|
orderPayTypeArray = new DictionaryPipe().getDictionaryList('ORDER_PAY_TYPE'); |
||||||
|
// 订单状态
|
||||||
|
orderStatusArray = new DictionaryPipe().getDictionaryList('ORDER_STATUS'); |
||||||
|
// 卡密使用状态
|
||||||
|
orderCouponNoStatus = new DictionaryPipe().getDictionaryList('ORDER_COUPON_NO_STATUS'); |
||||||
|
// 订单详情模态框
|
||||||
|
orderDetailVisible = false; |
||||||
|
// 订单详情数据
|
||||||
|
orderDetail: any = {}; |
||||||
|
constructor(private fb: NonNullableFormBuilder, |
||||||
|
private orderService : OrderService, |
||||||
|
private message: NzMessageService, |
||||||
|
private modal: NzModalService) { |
||||||
|
// 初始化搜索框
|
||||||
|
this.searchForm = this.fb.group({ |
||||||
|
userPhone: [''], |
||||||
|
orderNo: [''], |
||||||
|
tradeStatus: [''], |
||||||
|
payType: [''], |
||||||
|
goodsName: [''], |
||||||
|
channelOrderNo: [''], |
||||||
|
couNo: [''], |
||||||
|
couStatus: [''], |
||||||
|
createTimeArray: [[]], |
||||||
|
createTimeSelect: ['1'], |
||||||
|
createTimeS: [''], |
||||||
|
createTimeE: [''], |
||||||
|
}); |
||||||
|
this.createTimeInit(); |
||||||
|
this.queryData(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取数据 |
||||||
|
*/ |
||||||
|
queryData() { |
||||||
|
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.searchForm.value.pageNum = this.tablePageNum; |
||||||
|
this.searchForm.value.pageSize = 10; |
||||||
|
this.searchForm.value.objectType = 1; |
||||||
|
this.searchForm.value.time = new Date().getTime(); |
||||||
|
this.orderService.queryList(this.searchForm.value, (data: any) => { |
||||||
|
if (data['return_code'] == '000000') { |
||||||
|
this.tableData = data['return_data']; |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 搜索表单提交 |
||||||
|
*/ |
||||||
|
searchFormSubmit(): void { |
||||||
|
this.tablePageNum = 1; |
||||||
|
this.queryData(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 搜索表单重置 |
||||||
|
*/ |
||||||
|
searchFormReset(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建时间初始化 |
||||||
|
*/ |
||||||
|
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]); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 展示详情 |
||||||
|
* @param orderNo |
||||||
|
*/ |
||||||
|
showDetail(childOrderNo: string) { |
||||||
|
this.orderDetailVisible = true; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 关闭详情 |
||||||
|
*/ |
||||||
|
closeDetail() { |
||||||
|
this.orderDetail = {}; |
||||||
|
this.orderDetailVisible = false; |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -0,0 +1,34 @@ |
|||||||
|
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 OrderService { |
||||||
|
|
||||||
|
constructor(private http: HttpClient) { } |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询订单列表 |
||||||
|
* @param param |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
public queryList(param: object, callBack:any) { |
||||||
|
this.http.get(environment.orderUrl + 'coupon/queryList?'+ObjectData.objectByString(param)).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询订单详情 |
||||||
|
* @param param |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
public queryOrder(orderNo: string, callBack:any) { |
||||||
|
this.http.get(environment.orderUrl + 'queryOrder?orderNo='+orderNo).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,122 @@ |
|||||||
|
/** |
||||||
|
* 选择类型 |
||||||
|
*/ |
||||||
|
export const DateSelectType: any = [ |
||||||
|
{ value: 1, name: '今日'}, |
||||||
|
{ value: 2, name: '昨日'}, |
||||||
|
{ value: 3, name: '本周'}, |
||||||
|
{ value: 4, name: '上周'}, |
||||||
|
{ value: 5, name: '本月'}, |
||||||
|
{ value: 6, name: '上月'}, |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* 时间工具类 |
||||||
|
*/ |
||||||
|
export class DateUtils { |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取时间 |
||||||
|
* @param currentDate 当前时间 |
||||||
|
* @param type 类型 1:今日 2:昨日 3:本周 4:上周 5:本月 6:上月 |
||||||
|
*/ |
||||||
|
public static getDate(currentDate: Date, type: number): any { |
||||||
|
const returnObj = { |
||||||
|
timeS: 0, |
||||||
|
timeE: 0, |
||||||
|
} |
||||||
|
|
||||||
|
if (type === 1) { |
||||||
|
currentDate.setHours(0); |
||||||
|
currentDate.setMinutes(0); |
||||||
|
currentDate.setSeconds(0); |
||||||
|
returnObj.timeS = currentDate.getTime(); |
||||||
|
currentDate.setHours(23); |
||||||
|
currentDate.setMinutes(59); |
||||||
|
currentDate.setSeconds(59); |
||||||
|
returnObj.timeE = currentDate.getTime(); |
||||||
|
|
||||||
|
} else if (type === 2) { |
||||||
|
currentDate.setDate(currentDate.getDate() - 1) |
||||||
|
currentDate.setHours(0); |
||||||
|
currentDate.setMinutes(0); |
||||||
|
currentDate.setSeconds(0); |
||||||
|
returnObj.timeS = currentDate.getTime(); |
||||||
|
currentDate.setHours(23); |
||||||
|
currentDate.setMinutes(59); |
||||||
|
currentDate.setSeconds(59); |
||||||
|
returnObj.timeE = currentDate.getTime(); |
||||||
|
|
||||||
|
} else if (type === 3) { |
||||||
|
const dayOfWeek = currentDate.getDay(); |
||||||
|
const dayOffset = dayOfWeek === 0 ? -6 : 1 - dayOfWeek; |
||||||
|
|
||||||
|
const start = new Date(currentDate); |
||||||
|
start.setDate(start.getDate() + dayOffset) |
||||||
|
start.setHours(0); |
||||||
|
start.setMinutes(0); |
||||||
|
start.setSeconds(0); |
||||||
|
returnObj.timeS = start.getTime(); |
||||||
|
|
||||||
|
const end = new Date(currentDate); |
||||||
|
end.setDate(end.getDate() + 6) |
||||||
|
end.setHours(23); |
||||||
|
end.setMinutes(59); |
||||||
|
end.setSeconds(59); |
||||||
|
returnObj.timeE = end.getTime(); |
||||||
|
|
||||||
|
} else if (type === 4) { |
||||||
|
const startOfThisWeek = new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate() - currentDate.getDay() + 1); |
||||||
|
const endOfLastWeek = new Date(startOfThisWeek.getTime() - 1); |
||||||
|
const startOfLastWeek = new Date((endOfLastWeek.getTime() + 1) - (7 * 24 * 60 * 60 * 1000)); |
||||||
|
|
||||||
|
startOfLastWeek .setHours(0); |
||||||
|
startOfLastWeek .setMinutes(0); |
||||||
|
startOfLastWeek .setSeconds(0); |
||||||
|
returnObj.timeS = startOfLastWeek .getTime(); |
||||||
|
|
||||||
|
endOfLastWeek.setHours(23); |
||||||
|
endOfLastWeek.setMinutes(59); |
||||||
|
endOfLastWeek.setSeconds(59); |
||||||
|
returnObj.timeE = endOfLastWeek.getTime(); |
||||||
|
|
||||||
|
} else if (type === 5) { |
||||||
|
var daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth()+1, 0).getDate(); |
||||||
|
|
||||||
|
const start = new Date(currentDate); |
||||||
|
start.setDate(1) |
||||||
|
start.setHours(0); |
||||||
|
start.setMinutes(0); |
||||||
|
start.setSeconds(0); |
||||||
|
returnObj.timeS = start.getTime(); |
||||||
|
|
||||||
|
const end = new Date(currentDate); |
||||||
|
end.setDate(daysInMonth) |
||||||
|
end.setHours(23); |
||||||
|
end.setMinutes(59); |
||||||
|
end.setSeconds(59); |
||||||
|
returnObj.timeE = end.getTime(); |
||||||
|
|
||||||
|
} else if (type === 6) { |
||||||
|
var daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).getDate(); |
||||||
|
|
||||||
|
const start = new Date(currentDate); |
||||||
|
start.setMonth(currentDate.getMonth() - 1); |
||||||
|
start.setDate(1) |
||||||
|
start.setHours(0); |
||||||
|
start.setMinutes(0); |
||||||
|
start.setSeconds(0); |
||||||
|
returnObj.timeS = start.getTime(); |
||||||
|
|
||||||
|
const end = new Date(currentDate); |
||||||
|
end.setMonth(currentDate.getMonth() - 1); |
||||||
|
end.setDate(daysInMonth) |
||||||
|
end.setHours(23); |
||||||
|
end.setMinutes(59); |
||||||
|
end.setSeconds(59); |
||||||
|
returnObj.timeE = end.getTime(); |
||||||
|
} |
||||||
|
|
||||||
|
return returnObj; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue