parent
00831186a5
commit
ee4abf47a8
@ -0,0 +1,217 @@ |
|||||||
|
<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="applyNo" 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="type" nzAllowClear [nzPlaceHolder]="'请选择'"> |
||||||
|
<nz-option *ngFor="let item of applyTypeArray" 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> |
||||||
|
<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="childOrderNo" 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="status" nzAllowClear [nzPlaceHolder]="'请选择'"> |
||||||
|
<nz-option *ngFor="let item of applyStatusArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col [nzSpan]="18"> |
||||||
|
<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]="24" class="search-area"> |
||||||
|
<button nz-button [nzType]="'primary'" (click)="searchFormSubmit()">查询</button> |
||||||
|
<button nz-button (click)="searchFormReset()">重置</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
|
||||||
|
<nz-table #basicTable |
||||||
|
[nzScroll]="{ x: '1500px' }" |
||||||
|
[nzBordered]="true" |
||||||
|
[nzFrontPagination]="false" |
||||||
|
[nzShowQuickJumper]="true" |
||||||
|
[nzShowTotal]="totalTemplate" |
||||||
|
[(nzPageIndex)]="tablePageNum" |
||||||
|
(nzPageIndexChange)="queryData()" |
||||||
|
[nzTotal]="tableData.total" |
||||||
|
[nzData]="tableData.list" > |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="150px">申请单号</th> |
||||||
|
<th nzWidth="100px">申请类型</th> |
||||||
|
<th nzWidth="130px">客户电话</th> |
||||||
|
<th nzWidth="150px">商品单号</th> |
||||||
|
<th nzWidth="100px">产品类型</th> |
||||||
|
<th nzWidth="200px">产品名称</th> |
||||||
|
<th nzWidth="100px">产品规格</th> |
||||||
|
<th nzWidth="100px">申请数量</th> |
||||||
|
<th nzWidth="150px">申请时间</th> |
||||||
|
<th nzWidth="100px">状态</th> |
||||||
|
<th nzWidth="120px" nzRight>操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;index as i"> |
||||||
|
<td>{{data.applyNo}}</td> |
||||||
|
<td>{{data.type | dictionary: 'ORDER_AFTER_SALES_APPLY_TYPE'}}</td> |
||||||
|
<td>{{data.userPhone}}</td> |
||||||
|
<td>{{data.childOrderNo}}</td> |
||||||
|
<td>{{data.productType | dictionary: 'ORDER_CHILD_PRODUCT_TYPE'}}</td> |
||||||
|
<td>{{data.productName}}</td> |
||||||
|
<td>{{data.productSpecName}}</td> |
||||||
|
<td>{{data.productCount}}</td> |
||||||
|
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td>{{data.status | dictionary: 'ORDER_AFTER_SALES_APPLY_STATUS'}}</td> |
||||||
|
<td nzRight> |
||||||
|
<a (click)="showDetail(data.applyNo)">详情</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 *ngIf="data.status == 1" (click)="showAudit(data)">审核申请</li> |
||||||
|
<li nz-menu-item *ngIf="data.status == 4" (click)="showFinishConfirm(data.applyNo)">完结申请</li> |
||||||
|
</ul> |
||||||
|
</nz-dropdown-menu> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
||||||
|
</nz-table> |
||||||
|
|
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="applyDetailVisible" 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="申请单号">{{applyDetail.applyDetail.applyNo}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="申请类型">{{applyDetail.applyDetail.type | dictionary: 'ORDER_AFTER_SALES_APPLY_TYPE'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="用户手机号">{{applyDetail.applyDetail.userPhone}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="产品类型">{{applyDetail.applyDetail.productType | dictionary: 'ORDER_CHILD_PRODUCT_TYPE'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="产品名称">{{applyDetail.applyDetail.productName}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="产品规格">{{applyDetail.applyDetail.productSpecName}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="申请产品数量">{{applyDetail.applyDetail.productCount}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="申请时间">{{applyDetail.applyDetail.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="快递单号" [nzSpan]="3">{{applyDetail.applyDetail.sendExpressNo}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="图片" [nzSpan]="3"> |
||||||
|
<div nz-row *ngIf="applyDetail.applyDetail.photo != null && applyDetail.applyDetail.photo != ''"> |
||||||
|
<div *ngFor="let img of applyDetail.applyDetail.photo.split(',')" nz-col class="gutter-row" [nzSpan]="4"> |
||||||
|
<img nz-image width="100px" height="100px" nzSrc="{{imageUrl + img}}" alt="" src=""/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="备注" [nzSpan]="3">{{applyDetail.applyDetail.remarks}}</nz-descriptions-item> |
||||||
|
</nz-descriptions> |
||||||
|
</nz-tab> |
||||||
|
<nz-tab nzTitle="商品订单"> |
||||||
|
<nz-descriptions nzBordered [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }"> |
||||||
|
<nz-descriptions-item nzTitle="交易单号">{{applyDetail.childOrder.orderNo}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="商品单号">{{applyDetail.childOrder.childOrderNo}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="产品类型">{{applyDetail.childOrder.productType | dictionary: 'ORDER_CHILD_PRODUCT_TYPE'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="产品名称">{{applyDetail.childOrder.productName}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="产品规格">{{applyDetail.childOrder.productSpecName}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="购买数量">{{applyDetail.childOrder.productCount}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="商品总价">{{applyDetail.childOrder.productTotalPrice}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="总优惠">{{applyDetail.childOrder.totalDeductionPrice}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="优惠券优惠">{{applyDetail.childOrder.couponDiscountPrice}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="积分抵扣">{{applyDetail.childOrder.integralDiscountPrice}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="实付金额">{{applyDetail.childOrder.productActualPrice}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="状态">{{applyDetail.childOrder.status | dictionary: 'ORDER_CHILD_STATUS'}}</nz-descriptions-item> |
||||||
|
<nz-descriptions-item nzTitle="下单时间">{{applyDetail.childOrder.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||||
|
</nz-descriptions> |
||||||
|
</nz-tab> |
||||||
|
<nz-tab nzTitle="时间线"> |
||||||
|
<nz-timeline> |
||||||
|
<nz-timeline-item *ngFor="let item of applyDetail.applyOpRecord"> |
||||||
|
{{item.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}【{{item.status | dictionary: 'ORDER_AFTER_SALES_APPLY_STATUS'}}】 操作人:{{item.opUserName}} |
||||||
|
<div nz-row *ngIf="item.photo != null && item.photo != ''"> |
||||||
|
<div *ngFor="let img of item.photo.split(',')" nz-col class="gutter-row" [nzSpan]="2"> |
||||||
|
<img nz-image width="50px" height="50px" nzSrc="{{imageUrl + img}}" alt="" src=""/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<p nz-typography>备注:{{item.remarks!=null?item.remarks:'无'}}</p> |
||||||
|
</nz-timeline-item> |
||||||
|
</nz-timeline> |
||||||
|
</nz-tab> |
||||||
|
</nz-tabset> |
||||||
|
</ng-container> |
||||||
|
</nz-modal> |
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="applyAuditVisible" nzWidth="500px" nzTitle="审核" [nzFooter]="null" (nzOnCancel)="closeAudit()" [nzBodyStyle]="{ 'padding': '10px' }"> |
||||||
|
<ng-container *nzModalContent> |
||||||
|
<form nz-form [formGroup]="applyAuditForm" > |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24">申请单号</nz-form-label> |
||||||
|
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||||
|
<input nz-input formControlName="applyNo" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24">申请类型</nz-form-label> |
||||||
|
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||||
|
<nz-select formControlName="type"> |
||||||
|
<nz-option *ngFor="let item of applyTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></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-radio-group formControlName="auditStatus" > |
||||||
|
<label nz-radio nzValue="true">通过</label> |
||||||
|
<label nz-radio nzValue="false">驳回</label> |
||||||
|
</nz-radio-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24">备注</nz-form-label> |
||||||
|
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip=""> |
||||||
|
<textarea rows="4" formControlName="remarks" nz-input></textarea> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</form> |
||||||
|
<div nz-flex [nzJustify]="'center'"> |
||||||
|
<button nz-button nzType="primary" class="submit-btn" (click)="submitAuditForm()">确定</button> |
||||||
|
</div> |
||||||
|
</ng-container> |
||||||
|
</nz-modal> |
@ -0,0 +1,9 @@ |
|||||||
|
.search-area { |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
.search-area button { |
||||||
|
margin-right: 8px; |
||||||
|
} |
||||||
|
.submit-btn { |
||||||
|
width: 150px; |
||||||
|
} |
@ -0,0 +1,298 @@ |
|||||||
|
import { Component } from '@angular/core'; |
||||||
|
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; |
||||||
|
import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service"; |
||||||
|
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; |
||||||
|
import {NzMessageService} from "ng-zorro-antd/message"; |
||||||
|
import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/modal"; |
||||||
|
import {OrderAfterSalesService} from "../../../services/trade/order-after-sales.service"; |
||||||
|
import {DatePipe, NgForOf, NgIf, NgSwitch} from "@angular/common"; |
||||||
|
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 {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
||||||
|
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 {NzTreeComponent} from "ng-zorro-antd/tree"; |
||||||
|
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; |
||||||
|
import {NzTabComponent, NzTabSetComponent, NzTabsModule} from "ng-zorro-antd/tabs"; |
||||||
|
import {NzTimelineModule} from "ng-zorro-antd/timeline"; |
||||||
|
import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; |
||||||
|
import {NzTypographyComponent} from "ng-zorro-antd/typography"; |
||||||
|
import {environment} from "../../../../environments/environment"; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-order-after-sales', |
||||||
|
standalone: true, |
||||||
|
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, |
||||||
|
NzTimelineModule, |
||||||
|
NzImageDirective, |
||||||
|
NzImageModule, |
||||||
|
NzTypographyComponent |
||||||
|
], |
||||||
|
templateUrl: './order-after-sales.component.html', |
||||||
|
styleUrl: './order-after-sales.component.less' |
||||||
|
}) |
||||||
|
export class OrderAfterSalesComponent { |
||||||
|
imageUrl = environment.imageUrl; |
||||||
|
// 表单页数
|
||||||
|
tablePageNum = 1; |
||||||
|
// 表单数据
|
||||||
|
tableData: any = { |
||||||
|
total: 0, |
||||||
|
list: [], |
||||||
|
}; |
||||||
|
// 搜索表单
|
||||||
|
searchForm: FormGroup; |
||||||
|
// 时间类型选择
|
||||||
|
dateTypeSelect = DateSelectType; |
||||||
|
// 申请状态
|
||||||
|
applyStatusArray = new DictionaryPipe().getDictionaryList('ORDER_AFTER_SALES_APPLY_STATUS'); |
||||||
|
// 申请类型
|
||||||
|
applyTypeArray = new DictionaryPipe().getDictionaryList('ORDER_AFTER_SALES_APPLY_TYPE'); |
||||||
|
// 申请详情模态框
|
||||||
|
applyDetailVisible = false; |
||||||
|
// 申请详情数据
|
||||||
|
applyDetail: any = { |
||||||
|
applyOpRecord: [] |
||||||
|
}; |
||||||
|
// 申请审核表单
|
||||||
|
applyAuditForm: FormGroup; |
||||||
|
// 申请审核模态框
|
||||||
|
applyAuditVisible = false; |
||||||
|
constructor(private fb: NonNullableFormBuilder, |
||||||
|
private orderAfterSalesService : OrderAfterSalesService, |
||||||
|
private message: NzMessageService, |
||||||
|
private modal: NzModalService) { |
||||||
|
// 初始化搜索框
|
||||||
|
this.searchForm = this.fb.group({ |
||||||
|
type: [''], |
||||||
|
userPhone: [''], |
||||||
|
childOrderNo: [''], |
||||||
|
applyNo: [''], |
||||||
|
status: [''], |
||||||
|
createTimeArray: [[]], |
||||||
|
createTimeSelect: ['1'], |
||||||
|
createTimeS: [''], |
||||||
|
createTimeE: [''], |
||||||
|
}); |
||||||
|
|
||||||
|
this.applyAuditForm = this.fb.group({ |
||||||
|
applyNo: [''], |
||||||
|
type: [''], |
||||||
|
auditStatus: ['', [Validators.required]], |
||||||
|
remarks: [''], |
||||||
|
}); |
||||||
|
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.time = new Date().getTime(); |
||||||
|
this.orderAfterSalesService.queryApplyList(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 applyNo |
||||||
|
*/ |
||||||
|
showDetail(applyNo: string) { |
||||||
|
this.orderAfterSalesService.queryApply(applyNo,(data: any) => { |
||||||
|
if (data['return_code'] == '000000') { |
||||||
|
this.applyDetail = data['return_data']; |
||||||
|
console.log(this.applyDetail); |
||||||
|
this.applyDetailVisible = true; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 关闭详情 |
||||||
|
*/ |
||||||
|
closeDetail() { |
||||||
|
this.applyDetail = {}; |
||||||
|
this.applyDetailVisible = false; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 打开审核模态框 |
||||||
|
* @param data |
||||||
|
*/ |
||||||
|
showAudit(data: any) { |
||||||
|
data.type = String(data.type); |
||||||
|
data.remarks = ''; |
||||||
|
this.applyAuditForm.patchValue(data); |
||||||
|
this.applyAuditForm.controls['applyNo'].disable(); |
||||||
|
this.applyAuditForm.controls['type'].disable(); |
||||||
|
this.applyAuditVisible = true; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 提交审核 |
||||||
|
*/ |
||||||
|
submitAuditForm() { |
||||||
|
if (this.applyAuditForm.valid) { |
||||||
|
this.applyAuditForm.controls['applyNo'].enable(); |
||||||
|
this.orderAfterSalesService.audit(this.applyAuditForm.value, (data: any) => { |
||||||
|
if (data['return_code'] == '000000') { |
||||||
|
|
||||||
|
this.message.create('success', '操作成功'); |
||||||
|
// 清空表单
|
||||||
|
this.closeAudit(); |
||||||
|
|
||||||
|
this.queryData(); |
||||||
|
} else { |
||||||
|
this.message.create('error', data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} else { |
||||||
|
this.applyAuditForm.controls['applyNo'].disable(); |
||||||
|
Object.values(this.applyAuditForm.controls).forEach(control => { |
||||||
|
if (control.invalid) { |
||||||
|
control.markAsDirty(); |
||||||
|
control.updateValueAndValidity({ onlySelf: true }); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 关闭审核 |
||||||
|
*/ |
||||||
|
closeAudit() { |
||||||
|
this.applyAuditForm.reset(); |
||||||
|
this.applyAuditVisible = false; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 完结提示框 |
||||||
|
* @param applyNo |
||||||
|
*/ |
||||||
|
showFinishConfirm(applyNo: string): void { |
||||||
|
this.modal.confirm({ |
||||||
|
nzTitle: '提示', |
||||||
|
nzContent: '申请完结后金额原路退回', |
||||||
|
nzOnOk: () => this.submitFinish(applyNo) |
||||||
|
}); |
||||||
|
} |
||||||
|
submitFinish(applyNo: string): void { |
||||||
|
const param = { |
||||||
|
applyNo: applyNo |
||||||
|
} |
||||||
|
this.orderAfterSalesService.finish(param, (data: any) => { |
||||||
|
if (data['return_code'] == '000000') { |
||||||
|
this.message.create('success', '操作成功'); |
||||||
|
this.queryData(); |
||||||
|
} else { |
||||||
|
this.message.create('error', data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,6 +1,8 @@ |
|||||||
import { Routes } from '@angular/router'; |
import { Routes } from '@angular/router'; |
||||||
import {CompOrderComponent} from "./comp-order/comp-order.component"; |
import {CompOrderComponent} from "./comp-order/comp-order.component"; |
||||||
|
import {OrderAfterSalesComponent} from "./order-after-sales/order-after-sales.component"; |
||||||
|
|
||||||
export const TRADE_ROUTES: Routes = [ |
export const TRADE_ROUTES: Routes = [ |
||||||
{ path: 'comp-order', component: CompOrderComponent }, |
{ path: 'comp-order', component: CompOrderComponent }, |
||||||
|
{ path: 'order-after-sales', component: OrderAfterSalesComponent }, |
||||||
]; |
]; |
||||||
|
@ -0,0 +1,57 @@ |
|||||||
|
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 OrderAfterSalesService { |
||||||
|
|
||||||
|
constructor(private http: HttpClient) { } |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询订单列表 |
||||||
|
* @param param |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
public queryApplyList(param: object, callBack:any) { |
||||||
|
this.http.get(environment.orderUrl + 'afterSales/queryApplyList?'+ObjectData.objectByString(param)).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询订单详情 |
||||||
|
* @param applyNo |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
public queryApply(applyNo: string, callBack:any) { |
||||||
|
this.http.get(environment.orderUrl + 'afterSales/queryApply?applyNo='+applyNo).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 审核 |
||||||
|
* @param param |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
public audit(param: object, callBack:any) { |
||||||
|
this.http.post(environment.orderUrl + 'afterSales/audit', param).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 完成申请 |
||||||
|
* @param param |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
public finish(param: object, callBack:any) { |
||||||
|
this.http.post(environment.orderUrl + 'afterSales/finish', param).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue