diff --git a/src/app/pages/trade/comp-order/comp-order.component.ts b/src/app/pages/trade/comp-order/comp-order.component.ts index 769735e..1f19459 100644 --- a/src/app/pages/trade/comp-order/comp-order.component.ts +++ b/src/app/pages/trade/comp-order/comp-order.component.ts @@ -152,7 +152,6 @@ export class CompOrderComponent { } 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') { diff --git a/src/app/pages/trade/order-after-sales/order-after-sales.component.html b/src/app/pages/trade/order-after-sales/order-after-sales.component.html new file mode 100644 index 0000000..8babfe6 --- /dev/null +++ b/src/app/pages/trade/order-after-sales/order-after-sales.component.html @@ -0,0 +1,217 @@ +
+
+
+ + 申请单号 + + + + +
+
+ + 申请类型 + + + + + + +
+
+ + 用户手机号 + + + + +
+
+ + 商品单号 + + + + +
+
+ + 状态 + + + + + + +
+
+ + 创建时间 + + + + + + + +
+
+ + +
+
+
+ + + + + 申请单号 + 申请类型 + 客户电话 + 商品单号 + 产品类型 + 产品名称 + 产品规格 + 申请数量 + 申请时间 + 状态 + 操作 + + + + + {{data.applyNo}} + {{data.type | dictionary: 'ORDER_AFTER_SALES_APPLY_TYPE'}} + {{data.userPhone}} + {{data.childOrderNo}} + {{data.productType | dictionary: 'ORDER_CHILD_PRODUCT_TYPE'}} + {{data.productName}} + {{data.productSpecName}} + {{data.productCount}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.status | dictionary: 'ORDER_AFTER_SALES_APPLY_STATUS'}} + + 详情 + + + 更多 + + + + + + + + + 总计 {{ total }} 条 + + + + + + + + + {{applyDetail.applyDetail.applyNo}} + {{applyDetail.applyDetail.type | dictionary: 'ORDER_AFTER_SALES_APPLY_TYPE'}} + {{applyDetail.applyDetail.userPhone}} + {{applyDetail.applyDetail.productType | dictionary: 'ORDER_CHILD_PRODUCT_TYPE'}} + {{applyDetail.applyDetail.productName}} + {{applyDetail.applyDetail.productSpecName}} + {{applyDetail.applyDetail.productCount}} + {{applyDetail.applyDetail.createTime | date:'yyyy-MM-dd HH:mm:ss'}} + {{applyDetail.applyDetail.sendExpressNo}} + +
+
+ +
+
+
+ {{applyDetail.applyDetail.remarks}} +
+
+ + + {{applyDetail.childOrder.orderNo}} + {{applyDetail.childOrder.childOrderNo}} + {{applyDetail.childOrder.productType | dictionary: 'ORDER_CHILD_PRODUCT_TYPE'}} + {{applyDetail.childOrder.productName}} + {{applyDetail.childOrder.productSpecName}} + {{applyDetail.childOrder.productCount}} + {{applyDetail.childOrder.productTotalPrice}} + {{applyDetail.childOrder.totalDeductionPrice}} + {{applyDetail.childOrder.couponDiscountPrice}} + {{applyDetail.childOrder.integralDiscountPrice}} + {{applyDetail.childOrder.productActualPrice}} + {{applyDetail.childOrder.status | dictionary: 'ORDER_CHILD_STATUS'}} + {{applyDetail.childOrder.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + + + + + + {{item.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}【{{item.status | dictionary: 'ORDER_AFTER_SALES_APPLY_STATUS'}}】 操作人:{{item.opUserName}} +
+
+ +
+
+

备注:{{item.remarks!=null?item.remarks:'无'}}

+
+
+
+
+
+
+ + + +
+ + 申请单号 + + + + + + 申请类型 + + + + + + + + 审核 + + + + + + + + + 备注 + + + + +
+
+ +
+
+
diff --git a/src/app/pages/trade/order-after-sales/order-after-sales.component.less b/src/app/pages/trade/order-after-sales/order-after-sales.component.less new file mode 100644 index 0000000..f257b03 --- /dev/null +++ b/src/app/pages/trade/order-after-sales/order-after-sales.component.less @@ -0,0 +1,9 @@ +.search-area { + margin-bottom: 10px; +} +.search-area button { + margin-right: 8px; +} +.submit-btn { + width: 150px; +} diff --git a/src/app/pages/trade/order-after-sales/order-after-sales.component.ts b/src/app/pages/trade/order-after-sales/order-after-sales.component.ts new file mode 100644 index 0000000..8562342 --- /dev/null +++ b/src/app/pages/trade/order-after-sales/order-after-sales.component.ts @@ -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']); + } + }); + } + +} diff --git a/src/app/pages/trade/trade.routes.ts b/src/app/pages/trade/trade.routes.ts index d4cee95..8ae9ae6 100644 --- a/src/app/pages/trade/trade.routes.ts +++ b/src/app/pages/trade/trade.routes.ts @@ -1,6 +1,8 @@ import { Routes } from '@angular/router'; import {CompOrderComponent} from "./comp-order/comp-order.component"; +import {OrderAfterSalesComponent} from "./order-after-sales/order-after-sales.component"; export const TRADE_ROUTES: Routes = [ { path: 'comp-order', component: CompOrderComponent }, + { path: 'order-after-sales', component: OrderAfterSalesComponent }, ]; diff --git a/src/app/services/trade/order-after-sales.service.ts b/src/app/services/trade/order-after-sales.service.ts new file mode 100644 index 0000000..ef887eb --- /dev/null +++ b/src/app/services/trade/order-after-sales.service.ts @@ -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); + }); + } + +} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 95f2f04..b43cabf 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -6,11 +6,11 @@ export const environment = { production: false, // baseUrl: 'https://phgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) // orderUrl: 'https://phgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) - // userUrl: 'https://phgcs.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) + userUrl: 'https://phgcs.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) // imageUrl: 'https://phgcs.dctpay.com/filesystem/', baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) - orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址) - userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) + orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) + // userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) imageUrl: 'https://phgcs.dctpay.com/filesystem/', };