diff --git a/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.html b/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.html new file mode 100644 index 0000000..7902a43 --- /dev/null +++ b/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.html @@ -0,0 +1,113 @@ +
+
+
+ + 申请时间 + + + + + + + +
+
+ + 开票状态 + + + + + + +
+
+ + 交易单号 + + + + +
+
+ + 联系电话 + + + + +
+
+ + +
+
+
+ + + + + 交易单号 + 开票公司 + 开票税号 + 开票金额 + 联系电话 + 邮箱 + 申请时间 + 开票状态 + 操作 + + + + + {{data.orderNo}} + {{data.companyName}} + {{data.taxNo}} + {{data.amount}} + {{data.contactsPhone}} + {{data.email}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.status | dictionary: 'GAS_ORDER_RECEIPT_STATUS_MANAGE'}} + + 成功 + + 失败 + + + + 总计 {{ total }} 条 + + + + + + +
+ + 交易单号 + + + + + + 备注 + + + + +
+ +
+
+
+
+
diff --git a/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.less b/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.less new file mode 100644 index 0000000..8cba11d --- /dev/null +++ b/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.less @@ -0,0 +1,12 @@ +.search-area { + margin-bottom: 10px; +} +.search-area button { + margin-right: 8px; +} +.submit-btn { + width: 150px; +} +.collapse { + margin-left: 10px; +} diff --git a/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.ts b/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.ts new file mode 100644 index 0000000..8b5b461 --- /dev/null +++ b/src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.ts @@ -0,0 +1,252 @@ +import { Component } from '@angular/core'; +import {FormGroup, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; +import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service"; +import {BrowserStorageService} from "../../../utils/localStorage.service"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/modal"; +import {GasOrderReceiptService} from "../../../services/trade-receipt/gas-order-receipt.service"; +import {DatePipe, NgForOf, NgIf} from "@angular/common"; +import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import { + NzCellFixedDirective, + NzTableCellDirective, + NzTableComponent, + NzTbodyComponent, NzTheadComponent, + NzThMeasureDirective, NzTrDirective +} from "ng-zorro-antd/table"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker"; +import {NzDescriptionsComponent, NzDescriptionsItemComponent} from "ng-zorro-antd/descriptions"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio"; +import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs"; +import {NzDropDownDirective, NzDropdownMenuComponent, NzDropDownModule} from "ng-zorro-antd/dropdown"; +import {NzIconModule} from "ng-zorro-antd/icon"; +import {NzCardModule} from "ng-zorro-antd/card"; +import {NzSpinComponent} from "ng-zorro-antd/spin"; +import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline"; +import {NzBadgeComponent} from "ng-zorro-antd/badge"; +import {NzTooltipDirective} from "ng-zorro-antd/tooltip"; +import {DateMinutesDiffPipe} from "../../../pipes/common/date-minutes-diff.pipe"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzTypographyComponent} from "ng-zorro-antd/typography"; + +@Component({ + selector: 'app-gas-order-receipt', + standalone: true, + imports: [ + DatePipe, + DictionaryPipe, + NgForOf, + NgIf, + NzButtonComponent, + NzCellFixedDirective, + NzColDirective, + NzDatePickerComponent, + NzDescriptionsComponent, + NzDescriptionsItemComponent, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + NzModalComponent, + NzOptionComponent, + NzRadioButtonDirective, + NzRadioComponent, + NzRadioGroupComponent, + NzRangePickerComponent, + NzRowDirective, + NzSelectComponent, + NzTabComponent, + NzTabSetComponent, + NzTableCellDirective, + NzTableComponent, + NzTbodyComponent, + NzThMeasureDirective, + NzTheadComponent, + NzTrDirective, + ReactiveFormsModule, + NzModalModule, + NzDropdownMenuComponent, + NzDropDownDirective, + NzDropDownModule, + NzIconModule, + NzCardModule, + NzSpinComponent, + NzTimelineItemComponent, + NzTimelineComponent, + NzBadgeComponent, + NzTooltipDirective, + DateMinutesDiffPipe, + NzDividerComponent, + NzTypographyComponent + ], + templateUrl: './gas-order-receipt.component.html', + styleUrl: './gas-order-receipt.component.less' +}) +export class GasOrderReceiptComponent { + loadingObject = { + title: "加载中...", + status: false, + }; + // 表单页数 + tablePageNum = 1; + // 表单数据 + tableData: any = { + total: 0, + list: [], + }; + // 搜索表单 + searchForm: FormGroup; + // 状态数据 + statusArray = new DictionaryPipe().getDictionaryList('GAS_ORDER_RECEIPT_STATUS_MANAGE'); + // 时间类型选择 + dateTypeSelect = DateSelectType; + // 失败模态框 + failForm: FormGroup; + failModel = false; + + constructor(private fb: NonNullableFormBuilder, + private gasOrderReceiptService : GasOrderReceiptService, + private storage: BrowserStorageService, + private message: NzMessageService, + private modal: NzModalService) { + // 初始化搜索框 + this.failForm = this.fb.group({ + applyNo: [{ value: null, disabled: true} ,[Validators.required]], + orderNo: [{ value: null, disabled: true} ,[Validators.required]], + remark: ['',[Validators.required]], + }); + + // 初始化搜索框 + this.searchForm = this.fb.group({ + orderNo: [''], + contactsPhone: [''], + status: [''], + 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(new Date(this.searchForm.controls['createTimeArray'].value[0]).getTime()); + this.searchForm.controls['createTimeE'].setValue(new Date(this.searchForm.controls['createTimeArray'].value[1]).getTime()); + } 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.gasOrderReceiptService.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 + */ + showSuccess(applyNo: string, orderNo: string) { + this.modal.confirm({ + nzTitle: '提示', + nzContent: '交易单号:' + orderNo + ',是否已开票成功?', + nzOnOk: () => this.success(applyNo) + }); + } + success(applyNo: string) { + this.gasOrderReceiptService.success({applyNo: applyNo}, (data: any) => { + if (data['return_code'] == '000000') { + this.message.success("操作成功"); + this.queryData(); + } else { + this.message.create('error', data['return_msg']); + } + }); + } + + showFail(applyNo: string, orderNo: string) { + this.failForm.patchValue({ applyNo: applyNo, orderNo: orderNo}); + this.failModel = true; + } + + submitRefundConfirm() { + for (const i in this.failForm.controls) { + this.failForm.controls[i].markAsDirty(); + this.failForm.controls[i].updateValueAndValidity(); + } + if (this.failForm.status == null || this.failForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + this.modal.confirm({ + nzTitle: '提示', + nzContent: '确定对交易订号('+this.failForm.controls['orderNo'].value+')进行退款吗?', + nzOnOk: () => this.submitFail() + }); + } + submitFail() { + const param = { + applyNo: this.failForm.controls['applyNo'].value, + orderNo: this.failForm.controls['orderNo'].value, + remark: this.failForm.controls['remark'].value, + }; + this.gasOrderReceiptService.fail(param, (data: any) => { + if (data['return_code'] == '000000') { + this.message.success("操作成功"); + this.queryData(); + this.failModel = false; + } else { + this.message.create('error', data['return_msg']); + } + }); + } + +} diff --git a/src/app/pages/trade/order-oil-list/order-oil-list.component.ts b/src/app/pages/trade/order-oil-list/order-oil-list.component.ts index 5511a57..3219ab8 100644 --- a/src/app/pages/trade/order-oil-list/order-oil-list.component.ts +++ b/src/app/pages/trade/order-oil-list/order-oil-list.component.ts @@ -426,6 +426,4 @@ export class OrderOilListComponent { } }) } - - protected readonly Date = Date; } diff --git a/src/app/pages/trade/trade.routes.ts b/src/app/pages/trade/trade.routes.ts index 193e54e..0d0fd17 100644 --- a/src/app/pages/trade/trade.routes.ts +++ b/src/app/pages/trade/trade.routes.ts @@ -1,8 +1,10 @@ import { Routes } from '@angular/router'; import {OrderRefundComponent} from "./order-refund/order-refund.component"; import {OrderOilListComponent} from "./order-oil-list/order-oil-list.component"; +import {GasOrderReceiptComponent} from "./gas-order-receipt/gas-order-receipt.component"; export const TRADE_ROUTES: Routes = [ { path: 'order-refund', component: OrderRefundComponent }, { path: 'order-oil', component: OrderOilListComponent }, + { path: 'gas-order', component: GasOrderReceiptComponent }, ]; diff --git a/src/app/services/trade-receipt/gas-order-receipt.service.ts b/src/app/services/trade-receipt/gas-order-receipt.service.ts new file mode 100644 index 0000000..34a3a28 --- /dev/null +++ b/src/app/services/trade-receipt/gas-order-receipt.service.ts @@ -0,0 +1,48 @@ +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 GasOrderReceiptService { + + constructor(private http: HttpClient) { } + + /** + * 查询列表 + * @param param + * @param callBack + */ + public queryList(param: any, callBack:any) { + param.tm = new Date().getTime(); + this.http.get(environment.baseUrl + 'gasOrderReceipt/queryReceiptList?'+ObjectData.objectByString(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 开票成功 + * @param param + * @param callBack + */ + public success(param: any, callBack:any) { + param.tm = new Date().getTime(); + this.http.post(environment.baseUrl + 'gasOrderReceipt/success', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 开票失败 + * @param param + * @param callBack + */ + public fail(param: any, callBack:any) { + param.tm = new Date().getTime(); + this.http.post(environment.baseUrl + 'gasOrderReceipt/fail', param).subscribe(data => { + callBack(data); + }); + } +}