commit
ee77471f6d
@ -1 +1,122 @@ |
|||||||
<p>brand works!</p> |
<!-- 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="8"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="6">标题</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<input nz-input formControlName="title"/> |
||||||
|
</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="goodTypeId" nzPlaceHolder="请选择商品类别"> |
||||||
|
<nz-option *ngFor="let item of goodTypData" nzLabel="{{item.title}}" nzValue="{{item.id}}"></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)="resetForm()"><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 |
||||||
|
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="80px">标题</th> |
||||||
|
<th nzWidth="80px">图片</th> |
||||||
|
<th nzWidth="100px">创建时间</th> |
||||||
|
<th nzWidth="100px">更新时间</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.title}}</td> |
||||||
|
<td> |
||||||
|
<img class="head_img" src="{{WEB_SERVE_URL + data.img}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> |
||||||
|
</td> |
||||||
|
<td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{data.updatedTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td nzRight="0px" class="table-td-operation"> |
||||||
|
<a (click)="getEdit(data.id)">编辑</a> |
||||||
|
<nz-divider nzType="vertical"></nz-divider> |
||||||
|
<a (click)="getDetail(data.id)">删除</a> |
||||||
|
</td> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="isVisible" nzTitle="编辑" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> |
||||||
|
<form nz-form [formGroup]="validateForm"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="4" nzRequired>标题</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="12" nzErrorTip="请输入标题!"> |
||||||
|
<input nz-input placeholder="请输入标题..." [formControlName]="'title'" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="4" nzRequired>商品类别</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="12" nzErrorTip="请选择商品类别!"> |
||||||
|
<nz-select nzShowSearch nzAllowClear formControlName="goodTypeId" nzPlaceHolder="请选择商品类别"> |
||||||
|
<nz-option *ngFor="let item of goodTypData" nzLabel="{{item.title}}" nzValue="{{item.id}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="4" nzRequired>图片</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="20" nzErrorTip="请上传图片!"> |
||||||
|
<nz-upload |
||||||
|
nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile" |
||||||
|
nzListType="picture-card" |
||||||
|
[(nzFileList)]="imgFile" |
||||||
|
[nzShowButton]="imgFile.length < 1" |
||||||
|
[nzPreview]="handlePreview" |
||||||
|
> |
||||||
|
<i nz-icon nzType="plus"></i> |
||||||
|
<div class="ant-upload-text">上传图片</div> |
||||||
|
</nz-upload> |
||||||
|
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false"> |
||||||
|
<ng-template #modalContent> |
||||||
|
<img [src]="previewImage" [ngStyle]="{ width: '100%' }" /> |
||||||
|
</ng-template> |
||||||
|
</nz-modal> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</form> |
||||||
|
</nz-modal> |
||||||
|
@ -0,0 +1,4 @@ |
|||||||
|
.head_img { |
||||||
|
height: 60px; |
||||||
|
width: 60px; |
||||||
|
} |
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { BrandComponent } from './brand.component'; |
|
||||||
|
|
||||||
describe('BrandComponent', () => { |
|
||||||
let component: BrandComponent; |
|
||||||
let fixture: ComponentFixture<BrandComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ BrandComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(BrandComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -0,0 +1,236 @@ |
|||||||
|
<!-- 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="8" *ngIf="roleType === 1"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="6">区域公司</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<nz-select nzShowSearch nzAllowClear [formControlName]="'companyId'" (ngModelChange)="getMerchantListByCompany($event)"> |
||||||
|
<nz-option *ngFor="let item of companyData" nzValue="{{item.id}}" nzLabel="{{item.name}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col nzSpan="8" *ngIf="roleType === 5 || roleType === 1"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="6">商户</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<nz-select nzShowSearch nzAllowClear [formControlName]="'merchantId'" (ngModelChange)="getMerchantStoreById($event)"> |
||||||
|
<nz-option *ngFor="let item of merchantData" nzValue="{{item.id}}" nzLabel="{{item.merchantName}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col nzSpan="8" *ngIf="roleType === 5 || roleType === 1 || roleType === 2"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="6">门店</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<nz-select nzShowSearch nzAllowClear [formControlName]="'merchantStoreId'"> |
||||||
|
<nz-option *ngFor="let item of merchantStoreData" nzValue="{{item.id}}" nzLabel="{{item.storeName}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</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="orderNo"/> |
||||||
|
</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="preOrderNo"/> |
||||||
|
</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="goodsName"/> |
||||||
|
</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="preUserName"/> |
||||||
|
</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="userPhone"/> |
||||||
|
</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 nzPlaceHolder="请选择订单状态" formControlName="status"> |
||||||
|
<nz-option nzLabel="预约中" nzValue="1"></nz-option> |
||||||
|
<nz-option nzLabel="预约成功" nzValue="2"></nz-option> |
||||||
|
<nz-option nzLabel="预约完成" nzValue="3"></nz-option> |
||||||
|
<nz-option nzLabel="预约失败" nzValue="4"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</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-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="createTime"></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)="resetForm()"><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" *ngIf="'BTN_export_order' | button" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button> |
||||||
|
</div> |
||||||
|
<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="180px">商品名称</th> |
||||||
|
<th nzWidth="180px">用户名称</th> |
||||||
|
<th nzWidth="180px">用户电话</th> |
||||||
|
<th nzWidth="180px">订单号</th> |
||||||
|
<th nzWidth="180px">预约订单号</th> |
||||||
|
<th nzWidth="120px">实付金额</th> |
||||||
|
<th nzWidth="140px">生成时间</th> |
||||||
|
<th nzRight nzWidth="100px">额外状态</th> |
||||||
|
<th nzRight nzWidth="100px">状态</th> |
||||||
|
<th nzWidth="120px" nzRight>操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||||
|
<td>{{i+1}}</td> |
||||||
|
<td>{{data.goodsName}}</td> |
||||||
|
<td>{{data.preUserName}}</td> |
||||||
|
<td>{{data.preUserPhone}}</td> |
||||||
|
<td>{{data.orderNo}}</td> |
||||||
|
<td>{{data.preOrderNo}}</td> |
||||||
|
<td>{{data.payRealPrice}}</td> |
||||||
|
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td nzRight>{{data.ext1 === null ? '暂无' : data.ext1 }}</td> |
||||||
|
<td nzRight>{{data.status | preOrderStatus}}</td> |
||||||
|
<td nzRight class="table-td-operation"> |
||||||
|
<a (click)="getDetail(data.orderId , data.id)">详情</a> |
||||||
|
<span *ngIf=" data.ext1 !== '退款中'"> |
||||||
|
<nz-divider *ngIf="(data.status === 4 && 'BTN_pre-order-refund' | button) || (data.status === 1 && 'BTN_pre-order-success' | button)" nzType="vertical"></nz-divider> |
||||||
|
<a *ngIf="(data.status === 4 && 'BTN_pre-order-refund' | button) || (data.status === 1 && 'BTN_pre-order-success' | button)" nz-dropdown [nzDropdownMenu]="menu">更多</a> |
||||||
|
</span> |
||||||
|
<nz-dropdown-menu #menu="nzDropdownMenu"> |
||||||
|
<ul nz-menu nzSelectable> |
||||||
|
<li class="dropdown_menu" *ngIf="data.status === 1 && 'BTN_pre-order-success' | button" (click)="getPreSuccess(data.id)" nz-menu-item>预约成功</li> |
||||||
|
<li class="dropdown_menu" *ngIf="data.status === 1 && 'BTN_pre-order-fail' | button" (click)="getPreFail(data.id)" nz-menu-item>预约失败</li> |
||||||
|
<li class="dropdown_menu" *ngIf="(data.status === 4 && 'BTN_pre-order-refund' | button) && data.ext1 === null" (click)="postRefund(data.orderNo)" nz-menu-item>申请退款</li> |
||||||
|
</ul> |
||||||
|
</nz-dropdown-menu> |
||||||
|
</td> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="isVisible" nzTitle="发起预约" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label nzRequired>预计时间</nz-form-label> |
||||||
|
<nz-form-control nzErrorTip="请选择预计时间!"> |
||||||
|
<nz-date-picker [(ngModel)]="reachTime" ></nz-date-picker> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label nzRequired>安装地址</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<textarea [(ngModel)]="reachAddress" nz-input rows="2" placeholder="请输入安装地址"></textarea> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label nzRequired>预约备注</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<textarea [(ngModel)]="preUserRemark" nz-input rows="2" placeholder="请输入预约备注"></textarea> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</nz-modal> |
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="isVisibleFail" nzTitle="预约失败" (nzOnCancel)="handleCancelFail()" (nzOnOk)="handleOkFail()"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label nzRequired>失败备注</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<textarea [(ngModel)]="statusFailDesc" nz-input rows="2" placeholder="请输入失败备注"></textarea> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</nz-modal> |
||||||
|
|
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="isVisibleDetail" nzTitle="订单详情" nzWidth="1200" (nzOnCancel)="handleCancelOrder()" (nzOnOk)="handleCancelOrder()"> |
||||||
|
<nz-descriptions nzTitle="支付订单详情" nzBordered [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }"> |
||||||
|
<nz-descriptions-item nzTitle="商品名称">{{orderDetail['highChildOrderList'][0]['goodsName']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="支付类型">{{orderDetail['payType'] | paytype}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="支付金额">{{orderDetail['payPrice']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="客户名称">{{orderDetail['memName']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="客户电话">{{orderDetail['memPhone']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="订单号">{{orderDetail['orderNo']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="创建时间">{{orderDetail['createTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="支付时间">{{orderDetail['payTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="订单状态">{{orderDetail['orderStatus'] | orderCouponStatus}}</nz-descriptions-item> |
||||||
|
</nz-descriptions> |
||||||
|
|
||||||
|
<nz-descriptions nzTitle="预约订单详情" nzBordered [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }"> |
||||||
|
<nz-descriptions-item nzTitle="商品名称">{{preOrderDetail['goodsName']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="操作人员">{{preOrderDetail['opUserName']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="预约订单号">{{preOrderDetail['preOrderNo']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="预约备注">{{preOrderDetail['preUserRemark'] == null ? '暂无': preOrderDetail['preUserRemark']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="客户姓名">{{preOrderDetail['preUserName']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="客户电话">{{preOrderDetail['preUserPhone']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="到店地址">{{preOrderDetail['reachAddress'] == null ? '暂无': preOrderDetail['reachAddress']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="到店时间">{{preOrderDetail['reachTime'] == null ? '暂无': preOrderDetail['reachTime'] | date: 'yyyy-MM-dd'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="预约时间">{{preOrderDetail['preTime'] | date: 'yyyy-MM-dd'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="创建时间">{{preOrderDetail['createTime'] | date: 'yyyy-MM-dd'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="预约失败备注">{{preOrderDetail['statusFailDesc']}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="订单状态">{{preOrderDetail['status'] | preOrderStatus}}</nz-descriptions-item> |
||||||
|
</nz-descriptions> |
||||||
|
</nz-modal> |
||||||
|
|
||||||
|
|
@ -0,0 +1,287 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {environment} from '../../../../environments/environment'; |
||||||
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||||
|
import {MerchantService} from '../../../services/merchant.service'; |
||||||
|
import {IconService} from '../../../services/icon.service'; |
||||||
|
import {NzMessageService} from 'ng-zorro-antd'; |
||||||
|
import {Router} from '@angular/router'; |
||||||
|
import {CommonsService} from '../../../services/commons.service'; |
||||||
|
import {OrderService} from '../../../services/order.service'; |
||||||
|
import {CompanyService} from '../../../services/company.service'; |
||||||
|
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||||
|
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||||
|
import {MerchantStoreService} from '../../../services/merchant-store.service'; |
||||||
|
import {RechargeService} from '../../../services/recharge.service'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-pre-order', |
||||||
|
templateUrl: './pre-order.component.html', |
||||||
|
styleUrls: ['./pre-order.component.scss'] |
||||||
|
}) |
||||||
|
export class PreOrderComponent implements OnInit { |
||||||
|
|
||||||
|
WEB_SERVE_URL = environment.baseUrl; |
||||||
|
FILE_URL = environment.imageUrl; |
||||||
|
searchForm: FormGroup; // 搜索框
|
||||||
|
requestData = []; // 列表数据
|
||||||
|
companyData = []; // 列表数据
|
||||||
|
merchantData = []; // 列表数据
|
||||||
|
merchantStoreData = []; // 列表数据
|
||||||
|
total: number; // 页码
|
||||||
|
pageNum = 1; // 页码
|
||||||
|
pageSize = 10; // 条码
|
||||||
|
loading = true; |
||||||
|
id: number; // 订单ID
|
||||||
|
isVisible = false; |
||||||
|
isVisibleFail = false; |
||||||
|
isVisibleDetail = false; |
||||||
|
preUserRemark: string; |
||||||
|
statusFailDesc: string; |
||||||
|
reachAddress: string; |
||||||
|
reachTime; |
||||||
|
roleType: number; |
||||||
|
orderDetail: any = { |
||||||
|
highChildOrderList: [{ |
||||||
|
goodsName: '' |
||||||
|
}] |
||||||
|
}; |
||||||
|
preOrderDetail: any = {}; |
||||||
|
constructor( |
||||||
|
private form: FormBuilder, |
||||||
|
private order: OrderService, |
||||||
|
private iconService: IconService, |
||||||
|
private message: NzMessageService, |
||||||
|
private router: Router, |
||||||
|
private company: CompanyService, |
||||||
|
private recharge: RechargeService, |
||||||
|
private merchant: MerchantService, |
||||||
|
private store: LocalStorageService, // 数据请求
|
||||||
|
private merchantStore: MerchantStoreService, |
||||||
|
private common: CommonsService |
||||||
|
) { |
||||||
|
} |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.init(); |
||||||
|
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole']['roleType']; |
||||||
|
const whereObject = {}; |
||||||
|
whereObject['pageNum'] = 1; |
||||||
|
whereObject['pageSize'] = 10000; |
||||||
|
this.company.selectCompanyList(whereObject, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.companyData = data['return_data'].list; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
if (this.roleType === 5) { |
||||||
|
this.getMerchantListByCompany(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id']); |
||||||
|
} else { |
||||||
|
this.getMerchantListByCompany(this.searchForm.value.companyId); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public init(): void { |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
companyId: [null], |
||||||
|
merchantId: [null], |
||||||
|
merchantStoreId: [null], |
||||||
|
orderNo: [null], |
||||||
|
preOrderNo: [null], |
||||||
|
userPhone: [null], |
||||||
|
preUserName: [null], |
||||||
|
goodsType: [null], |
||||||
|
goodsName: [null], |
||||||
|
status: [null], |
||||||
|
createTime: [null] |
||||||
|
}); |
||||||
|
this.getRequest(true, this.searchForm.value); |
||||||
|
} |
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
public getRequest(reset: boolean = false, whereObject: object) { |
||||||
|
|
||||||
|
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { |
||||||
|
whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); |
||||||
|
whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
this.loading = false; |
||||||
|
if (reset) { |
||||||
|
this.pageNum = 1; |
||||||
|
} |
||||||
|
whereObject['pageNum'] = this.pageNum; |
||||||
|
whereObject['pageSize'] = this.pageSize; |
||||||
|
this.order.getListPreOrder(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 getMerchantListByCompany(companyId: number): void { |
||||||
|
this.merchant.getMerchantListByCompany(companyId, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.merchantData = data['return_data']; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// 查询商户
|
||||||
|
public getMerchantStoreById(merchantIds: number): void { |
||||||
|
|
||||||
|
const params = { |
||||||
|
pageNum: 1, |
||||||
|
pageSize: 1000000, |
||||||
|
merchantId: merchantIds |
||||||
|
}; |
||||||
|
|
||||||
|
this.merchantStore.getStoreListByCompany(params, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.merchantStoreData = data['return_data'].list; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
// 重置
|
||||||
|
public resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// 查看详情
|
||||||
|
public getDetail(orderId: number , id: number): void { |
||||||
|
this.order.getOrderById(orderId , data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.orderDetail = data['return_data']; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
this.order.getPreOrderById(id , data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.preOrderDetail = data['return_data']; |
||||||
|
console.log(this.preOrderDetail); |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
this.isVisibleDetail = true; |
||||||
|
} |
||||||
|
|
||||||
|
// 下载模板
|
||||||
|
downloadTemplate(whereObject) { |
||||||
|
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { |
||||||
|
whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); |
||||||
|
whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); |
||||||
|
} |
||||||
|
this.order.exportListPreOrder(whereObject, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
window.location.href = this.FILE_URL + data['return_data']; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
getPreSuccess(id): void { |
||||||
|
this.id = id; |
||||||
|
this.isVisible = true; |
||||||
|
} |
||||||
|
|
||||||
|
getPreFail(id: number): void { |
||||||
|
this.id = id; |
||||||
|
this.isVisibleFail = true; |
||||||
|
} |
||||||
|
|
||||||
|
handleOkFail(): void { |
||||||
|
this.common.showConfirm('是否确认预约失败', item => { |
||||||
|
if (item) { |
||||||
|
const params = { |
||||||
|
id: this.id , |
||||||
|
statusFailDesc: this.statusFailDesc |
||||||
|
}; |
||||||
|
this.order.preOrderFail(params, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.getRequest(false, this.searchForm.value); |
||||||
|
this.isVisibleFail = false; |
||||||
|
this.message.success('操作成功'); |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
handleCancelFail() { |
||||||
|
this.isVisibleFail = false; |
||||||
|
} |
||||||
|
|
||||||
|
handleOk(): void { |
||||||
|
this.common.showConfirm('是否确认预约', item => { |
||||||
|
if (item) { |
||||||
|
const params = { |
||||||
|
id: this.id , |
||||||
|
reachAddress: this.reachAddress, |
||||||
|
reachTime: this.reachTime, |
||||||
|
preUserRemark: this.preUserRemark, |
||||||
|
}; |
||||||
|
this.order.preOrderSuccess(params, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.getRequest(false, this.searchForm.value); |
||||||
|
this.isVisible = false; |
||||||
|
this.message.success('预约成功'); |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
handleCancel(): void { |
||||||
|
this.isVisible = false; |
||||||
|
} |
||||||
|
|
||||||
|
handleCancelOrder(): void { |
||||||
|
this.isVisibleDetail = false; |
||||||
|
} |
||||||
|
|
||||||
|
public postRefund(orderNo): void { |
||||||
|
this.common.showConfirm('确认订单申请退款', item => { |
||||||
|
if (item) { |
||||||
|
this.recharge.postRefund({ |
||||||
|
refundSource: 2 , |
||||||
|
sourceOrderNo: orderNo |
||||||
|
}, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.message.success('申请成功'); |
||||||
|
this.getRequest(false, this.searchForm.value); |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
import {LocalStorageService} from '../../services/local-storage.service'; |
||||||
|
import {ADMIN_INFO_OBJECT} from '../../services/local-storage.namespace'; |
||||||
|
@Pipe({ |
||||||
|
name: 'button' |
||||||
|
}) |
||||||
|
export class ButtonPipe implements PipeTransform { |
||||||
|
|
||||||
|
constructor( |
||||||
|
private store: LocalStorageService, // 数据请求
|
||||||
|
) { } |
||||||
|
|
||||||
|
transform(button: string): boolean { |
||||||
|
const buttonArray = new Set<string>(); |
||||||
|
buttonArray.add(button); |
||||||
|
console.log(this.store.get(ADMIN_INFO_OBJECT)['buttonList']); |
||||||
|
return this.store.get(ADMIN_INFO_OBJECT)['buttonList'].filter(i => buttonArray.has(i.permissionCode)).length > 0; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
|
||||||
|
@Pipe({ |
||||||
|
name: 'preOrderStatus' |
||||||
|
}) |
||||||
|
export class PreOrderStatusPipe implements PipeTransform { |
||||||
|
|
||||||
|
transform(value: number): string { |
||||||
|
switch (value) { |
||||||
|
case 1: |
||||||
|
return '预约中'; |
||||||
|
case 2: |
||||||
|
return '预约成功'; |
||||||
|
case 3: |
||||||
|
return '预约完成'; |
||||||
|
case 4: |
||||||
|
return '预约失败'; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue