提交代码

master
胡锐 5 months ago
parent 6bc3b4a6cc
commit 66fc71d29e
  1. 12
      src/app/data/common/button.namespace.ts
  2. 2
      src/app/pages/body/index/index.component.ts
  3. 5
      src/app/pages/index/index/index.component.html
  4. 7
      src/app/pages/index/index/index.component.ts
  5. 18
      src/app/pages/login/login/login.component.ts
  6. 296
      src/app/pages/trade/order-oil-list/order-oil-list.component.html
  7. 30
      src/app/pages/trade/order-oil-list/order-oil-list.component.less
  8. 388
      src/app/pages/trade/order-oil-list/order-oil-list.component.ts
  9. 2
      src/app/pages/trade/trade.routes.ts
  10. 38
      src/app/pipes/common/button.pipe.ts
  11. 24
      src/app/services/agent/agent-staff.service.ts
  12. 24
      src/app/services/agent/agent.service.ts
  13. 80
      src/app/services/trade/order-oil.service.ts
  14. 33
      src/app/services/trade/order-refund.service.ts
  15. BIN
      src/assets/logo.jpg
  16. 6
      src/environments/environment.prod.ts
  17. 2
      src/environments/environment.ts
  18. BIN
      src/favicon.ico

@ -0,0 +1,12 @@
export interface Button {
menuName: string;
menuType: string;
menuUrl: string;
menuUrlImg: string;
menuPSid: number;
menuSort: string;
menuDesc: string;
}
export let buttonData: Button[] = [];

@ -76,8 +76,6 @@ export class IndexComponent {
private router: Router, // 路由
private login: LoginService
) {
this.nzConfigService.set('button', { nzSize: 'large' })
this.nzConfigService.set('treeSelect', { nzSize: 'large' })
// 缓存数据字典
this.commonService.queryDictionary('','',(data: any) => {
dictionaryData.length = 0;

@ -0,0 +1,5 @@
<nz-result
[nzIcon]="'smile-twotone'"
nzTitle="欢迎使用嗨加油管理后台!"
>
</nz-result>

@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs";
import {NgForOf} from "@angular/common";
import {NgForOf, NgOptimizedImage} from "@angular/common";
import {NzResultComponent} from "ng-zorro-antd/result";
@Component({
selector: 'app-index',
@ -8,7 +9,9 @@ import {NgForOf} from "@angular/common";
imports: [
NzTabSetComponent,
NzTabComponent,
NgForOf
NgForOf,
NgOptimizedImage,
NzResultComponent
],
templateUrl: './index.component.html',
styleUrl: './index.component.less'

@ -21,6 +21,8 @@ import {DATA, INIT_FLAG, LOGIN_DATA, USER_TOKEN} from "../../../data/login/local
import {Router} from "@angular/router";
import {BrowserStorageService} from "../../../utils/localStorage.service";
import {LoginService} from "../../../services/login/login.service";
import {dictionaryData} from "../../../data/common/dictionary.namespace";
import {buttonData} from "../../../data/common/button.namespace";
@ -97,7 +99,21 @@ export class LoginComponent {
this.storage.set(DATA, data['return_data']['object']);
this.storage.set(USER_TOKEN, data['return_data']['token']);
this.storage.set(INIT_FLAG, true);
this.router.navigateByUrl('/admin/index').then(r => console.log("返回内容" ,r));
// 缓存角色按钮权限
for (let item of data['return_data']['object']['button']) {
buttonData.push(
{
menuName: item.menuName,
menuType: item.menuType,
menuUrl: item.menuUrl,
menuUrlImg: item.menuUrlImg,
menuPSid: item.menuPSid,
menuSort: item.menuSort,
menuDesc: item.menuDesc,
}
);
}
this.router.navigateByUrl('/admin/index');
} else {
this.message.error(data['return_msg']);
}

@ -0,0 +1,296 @@
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'">
<div nz-row [nzGutter]="24">
<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">
<nz-form-item>
<nz-form-label>交易状态</nz-form-label>
<nz-form-control>
<nz-select formControlName="status" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of statusArray" 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="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>
<input nz-input formControlName="paySerialNo" 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="gasOilNo" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilNoArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</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="payType" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of payTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div *ngIf="accountType == 1 || accountType == 2 || accountType == 3" nz-col [nzSpan]="6" [hidden]="!isCollapse">
<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 *ngIf="accountType == 1 || accountType == 4 || accountType == 5" nz-col [nzSpan]="6" [hidden]="!isCollapse">
<nz-form-item>
<nz-form-label>油站名称</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merName" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div *ngIf="accountType == 1 || accountType == 2" nz-col [nzSpan]="6" [hidden]="!isCollapse">
<nz-form-item>
<nz-form-label>加油员</nz-form-label>
<nz-form-control>
<input nz-input formControlName="gasStaffName" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div *ngIf="accountType == 1" nz-col [nzSpan]="6" [hidden]="!isCollapse">
<nz-form-item>
<nz-form-label>代理商</nz-form-label>
<nz-form-control>
<nz-select formControlName="agentId" nzAllowClear [nzPlaceHolder]="'请选择'" (ngModelChange)="queryAgentStaff($event)">
<nz-option *ngFor="let item of agentArray" nzValue="{{item.id}}" nzLabel="{{item.name}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div *ngIf="accountType == 1 || accountType == 4" nz-col [nzSpan]="6" [hidden]="!isCollapse">
<nz-form-item>
<nz-form-label>业务员</nz-form-label>
<nz-form-control>
<nz-select formControlName="agentStaffId" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of agentStaffArray" nzValue="{{item.id}}" nzLabel="{{item.name}}"></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>
<button nz-button [nzType]="'primary'" (click)="exportOilOrder()">导出加油明细</button>
<a class="collapse" (click)="isCollapse = !isCollapse">
更多查询条件
<i nz-icon [nzType]="!isCollapse ? 'down' : 'up'"></i>
</a>
</div>
</div>
</form>
<div class="csp-statistic">
<div class="csp-statistic-title">
<span>加油笔数:</span>
<span class="csp-text-primary" style="margin-right: 50px;">{{totalData.totalCount}}笔</span>
<span>加油金额:</span>
<span class="csp-text-primary" style="margin-right: 50px;">{{totalData.totalRefuelPrice}}元</span>
<span>加油升数:</span>
<span class="csp-text-primary">{{totalData.totalOilLiters}}升</span>
</div>
</div>
<nz-table #basicTable
[nzScroll]="{ x: '4500px'}"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()"
[nzTotal]="tableData.total"
[nzData]="tableData.list" >
<thead>
<tr>
<th *ngIf="accountType == 1" rowspan="2" nzWidth="100px">代理商</th>
<th *ngIf="accountType == 1 || accountType == 4" rowspan="2" nzWidth="100px">业务员</th>
<th rowspan="2" nzWidth="200px">交易单号</th>
<th *ngIf="accountType == 1 || accountType == 2 || accountType == 3" rowspan="2" nzWidth="120px">客户电话</th>
<th *ngIf="accountType == 1 || accountType == 4 || accountType == 5" rowspan="2" nzWidth="200px">加油站</th>
<th *ngIf="accountType == 1 || accountType == 2" rowspan="2" nzWidth="120px">加油员</th>
<th colspan="8">加油信息</th>
<th colspan="8">支付信息</th>
<th rowspan="2">交易状态</th>
<th rowspan="2">创建时间</th>
<th rowspan="2">支付时间</th>
<th rowspan="2">退款时间</th>
<th rowspan="2">取消时间</th>
<th rowspan="2" nzWidth="110px" nzRight="0px">操作</th>
</tr>
<tr>
<th>加油金额</th>
<th>加油升数</th>
<th>油号</th>
<th>油枪号</th>
<th>平台折扣</th>
<th>平台价</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 basicTable.data;let i = index">
<td *ngIf="accountType == 1">{{data.agentName?data.agentName:'无'}}</td>
<td *ngIf="accountType == 1 || accountType == 4">{{data.agentStaffName?data.agentStaffName:'无'}}</td>
<td>{{data.orderNo}}</td>
<td *ngIf="accountType == 1 || accountType == 2 || accountType == 3">{{data.userPhone!=null?data.userPhone:'无'}}</td>
<td *ngIf="accountType == 1 || accountType == 4 || accountType == 5">{{data.merName}}</td>
<td *ngIf="accountType == 1 || accountType == 2">{{data.gasStaffName?data.gasStaffName:'未知'}}</td>
<td>{{data.gasRefuelPrice}}元</td>
<td>{{data.gasOilLiters}}升</td>
<td>{{data.gasOilNo}}#</td>
<td>{{data.gasGunNo}}号枪</td>
<td>{{data.gasDiscount != 1?(data.gasDiscount*100) + '折':'无'}}</td>
<td>{{data.gasPricePlatform}}元</td>
<td>{{data.gasPriceGun}}元</td>
<td>{{data.gasPriceOfficial}}元</td>
<td>{{data.totalDeductionPrice}}元</td>
<td>{{data.deductionCouponPrice}}元</td>
<td>{{data.deductionOilPrice}}元</td>
<td>{{data.payablePrice}}元</td>
<td>{{data.payIntegral / 100}}元</td>
<td>{{data.actualPayPrice!=null?data.payPrice+'元':'未支付'}}</td>
<td>{{data.payType | dictionary: 'ORDER_PAY_TYPE'}}</td>
<td>{{data.paySerialNo}}</td>
<td>{{data.status | dictionary: 'GAS_ORDER_STATUS'}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.cancelTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight="0px" class="table-td-operation">
<a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item (click)="showOrderDetail(data.orderNo)">交易详情</li>
<li *ngIf="data.status == 2 && GAS_REFUND_BTN" (click)="showRefund(data.orderNo, data.orderChildNo)" nz-menu-item>交易退款</li>
<li *ngIf="data.status == 2 && GAS_ORDER_PRINT_BTN" (click)="showOrderPrint(data.orderNo);" nz-menu-item>打印小票</li>
</ul>
</nz-dropdown-menu>
</td>
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
<nz-modal [(nzVisible)]="orderDetailModal" nzTitle="交易详情" (nzOnCancel)="closeOrderDetail()" [nzFooter]="null"
nzWidth="1000px" [nzBodyStyle]=" { padding: '5px 5px 30px 5px'}">
<ng-container *nzModalContent>
<nz-spin [nzSpinning]="orderDetailModalLoading">
<nz-tabset [nzTabPosition]="'top'" [nzType]="'card'" class="order-oil-tab">
<nz-tab nzTitle="加油详情">
<nz-descriptions nzBordered [nzColumn]="2" [nzSize]="'middle'">
<nz-descriptions-item nzSpan="2" nzTitle="加油站">{{orderDetailObject.gasOrder.merName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油单号">{{orderDetailObject.tradeOrder.orderNo}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="交易状态">{{orderDetailObject.tradeOrder.orderStatus| dictionary: 'GAS_ORDER_STATUS' }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付方式">{{orderDetailObject.tradeOrder.payType | dictionary: 'ORDER_PAY_TYPE'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付单号">{{orderDetailObject.tradeOrder.paySerialNo!=null?orderDetailObject.tradeOrder.paySerialNo:'无'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="客户手机号" *ngIf="accountType == 1 || accountType == 2 || accountType == 3">{{orderDetailObject.tradeOrder.memPhone}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油员">{{orderDetailObject.gasOrder.gasStaffName!=null?orderDetailObject.gasOrder.gasStaffName:'未知'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油金额">{{orderDetailObject.gasOrder.gasRefuelPrice}}元</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油升数">{{orderDetailObject.gasOrder.gasOilLiters}}升</nz-descriptions-item>
<nz-descriptions-item nzTitle="油品">{{orderDetailObject.gasOrder.gasOilNo}} # </nz-descriptions-item>
<nz-descriptions-item nzTitle="油枪">{{orderDetailObject.gasOrder.gasGunNo}} 号枪</nz-descriptions-item>
<nz-descriptions-item nzSpan="1" nzTitle="平台优惠">
<span nz-typography>平台折扣:{{orderDetailObject.gasOrder.gasDiscount != 1?(orderDetailObject.gasOrder.gasDiscount * 100)+'折':'无'}}</span><br>
<span nz-typography>总优惠:{{orderDetailObject.gasOrder.totalDeductionPrice}}元</span><br>
<span nz-typography>优惠券优惠:{{orderDetailObject.gasOrder.deductionCouponPrice}}元</span><br>
<span nz-typography>加油优惠:{{orderDetailObject.gasOrder.deductionOilPrice}}元</span><br>
<span nz-typography>积分抵扣:{{orderDetailObject.gasOrder.payIntegral / 100}}元</span><br>
</nz-descriptions-item>
<nz-descriptions-item nzSpan="1" nzTitle="油价">
<nz-badge nzStatus="processing" nzText="平台价:{{orderDetailObject.gasOrder.gasPricePlatform}}"></nz-badge><br>
<nz-badge nzStatus="processing" nzText="油站价:{{orderDetailObject.gasOrder.gasPriceGun}}"></nz-badge><br>
<nz-badge nzStatus="processing" nzText="国标价:{{orderDetailObject.gasOrder.gasPriceOfficial}}"></nz-badge>
</nz-descriptions-item>
<nz-descriptions-item nzSpan="1" nzTitle="应付">{{orderDetailObject.gasOrder.payablePrice}}</nz-descriptions-item>
<nz-descriptions-item nzSpan="1" nzTitle="实付">{{orderDetailObject.gasOrder.actualPayPrice}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="accountType == 1" nzTitle="代理商">
{{orderDetailObject.gasOrder.agentName?orderDetailObject.gasOrder.agentName:'无'}}
</nz-descriptions-item>
<nz-descriptions-item *ngIf="accountType == 1 || accountType == 4" nzTitle="业务员">
{{orderDetailObject.gasOrder.agentStaffName?orderDetailObject.gasOrder.agentStaffName:'无'}}
</nz-descriptions-item>
</nz-descriptions>
</nz-tab>
<nz-tab nzTitle="交易时间">
<nz-card>
<nz-timeline>
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.createTime != null">创建时间:{{orderDetailObject.tradeOrder.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item>
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.cancelTime != null">取消时间:{{orderDetailObject.tradeOrder.cancelTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item>
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.payTime != null">支付时间:{{orderDetailObject.tradeOrder.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item>
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.finishTime != null">完成时间:{{orderDetailObject.tradeOrder.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item>
<nz-timeline-item *ngIf="orderDetailObject.tradeOrder.refundTime != null">退款时间:{{orderDetailObject.tradeOrder.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}}</nz-timeline-item>
</nz-timeline>
</nz-card>
</nz-tab>
</nz-tabset>
</nz-spin>
</ng-container>
</nz-modal>
<nz-modal [(nzVisible)]="orderRefundModal" nzTitle="交易退款" (nzOnCancel)="closeRefund()" [nzFooter]="null" nzWidth="800px">
<ng-container *nzModalContent>
<nz-spin [nzSpinning]="loadingObject.status" [nzTip]="loadingObject.title">
<form nz-form [formGroup]="refundForm">
<nz-form-item>
<nz-form-label>交易单号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="orderNo" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label>退款备注</nz-form-label>
<nz-form-control>
<textarea rows="4" nz-input formControlName="remarks" maxlength="100"></textarea>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button [nzType]="'primary'" (click)="submitRefundConfirm()">提交退款</button>
</div>
</form>
</nz-spin>
</ng-container>
</nz-modal>

@ -0,0 +1,30 @@
.search-area {
margin-bottom: 10px;
}
.search-area button {
margin-right: 8px;
}
.submit-btn {
width: 150px;
}
.collapse {
margin-left: 10px;
}
.csp-statistic {
font-feature-settings: "tnum";
border: 1px solid #d9d9d9;
border-radius: 4px;
}
.csp-statistic-title {
padding: 0 16px;
height: 64px;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
background-color: #fafafa;
}
.csp-text-primary{
font-size: 20px;
color: #1890ff;
}

@ -0,0 +1,388 @@
import {Component, OnInit} from '@angular/core';
import {OrderOilService} from "../../../services/trade/order-oil.service";
import {FormBuilder, FormGroup, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {NzMessageService} from "ng-zorro-antd/message";
import {environment} from "../../../../environments/environment";
import {DatePipe, DecimalPipe, 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, NzDescriptionsModule} 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, NzTabsModule} from "ng-zorro-antd/tabs";
import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service";
import {OrderRefundService} from "../../../services/trade/order-refund.service";
import {NzDropDownDirective, NzDropdownMenuComponent, NzDropDownModule} from "ng-zorro-antd/dropdown";
import {NzIconModule} from "ng-zorro-antd/icon";
import {AgentService} from "../../../services/agent/agent.service";
import {AgentStaffService} from "../../../services/agent/agent-staff.service";
import {NzStatisticModule} from "ng-zorro-antd/statistic";
import {NzCardModule} from "ng-zorro-antd/card";
import {BrowserStorageService} from "../../../utils/localStorage.service";
import {DATA} from "../../../data/login/localStorage.namespace";
import {NzSpinComponent, NzSpinModule} from "ng-zorro-antd/spin";
import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline";
import {NzBadgeComponent} from "ng-zorro-antd/badge";
import {ButtonPipe} from "../../../pipes/common/button.pipe";
@Component({
selector: 'app-order-oil-list',
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,
],
templateUrl: './order-oil-list.component.html',
styleUrl: './order-oil-list.component.less'
})
export class OrderOilListComponent {
loadingObject = {
title: "加载中...",
status: false,
};
imageUrl = environment.imageUrl;
// 表单页数
tablePageNum = 1;
// 表单数据
tableData: any = {
total: 0,
list: [],
};
// 统计数据
totalData = {
totalCount: 0,
totalRefuelPrice: 0,
totalOilLiters: 0,
};
// 搜索表单
searchForm: FormGroup;
// 更多搜索条件
isCollapse = false;
// 时间类型选择
dateTypeSelect = DateSelectType;
// 状态
statusArray = new DictionaryPipe().getDictionaryList('GAS_ORDER_STATUS');
// 油号
oilNoArray = new DictionaryPipe().getDictionaryList('OIL_NO');
// 支付类型
payTypeArray = new DictionaryPipe().getDictionaryList('ORDER_PAY_TYPE');
// 账户类型
accountType: number;
// 代理商
agentArray: any = [];
// 业务员
agentStaffArray: any = [];
// 订单详情模态框
orderDetailModal= false;
// 订单详情模态框加载
orderDetailModalLoading= false;
// 订单详情对象
orderDetailObject: any = {
gasOrder: {},
tradeOrder: {},
};
orderRefundModal = false;
refundForm: FormGroup;
GAS_REFUND_BTN = new ButtonPipe().isButton("GAS_REFUND");
GAS_ORDER_PRINT_BTN = new ButtonPipe().isButton("GAS_ORDER_PRINT_BTN");
constructor(private fb: NonNullableFormBuilder,
private orderOilService : OrderOilService,
private agentService : AgentService,
private storage: BrowserStorageService,
private agentStaffService : AgentStaffService,
private orderRefundService: OrderRefundService,
private message: NzMessageService,
private modal: NzModalService) {
this.accountType = this.storage.get(DATA)['account']['objectType'];
// 退款提示模态框
this.refundForm = this.fb.group({
orderNo: [{ value: null, disabled: true}, [Validators.required]],
childOrderNo: [{ value: null, disabled: true}, [Validators.required]],
remarks: [null],
});
// 初始化搜索框
this.searchForm = this.fb.group({
merName: [''],
userPhone: [''],
orderNo: [''],
payType: [''],
paySerialNo: [''],
gasOilNo: [''],
gasStaffName: [''],
agentId: [''],
agentStaffId: [''],
status: ['2'],
createTimeArray: [[]],
createTimeSelect: ['1'],
createTimeS: [''],
createTimeE: [''],
});
// 初始化创建时间
this.createTimeInit();
// 查询数据
this.queryData();
if (this.accountType == 1) {
// 查询代理商
this.queryAgent();
}
if (this.accountType == 4) {
// 查询业务员
this.queryAgentStaff(this.storage.get(DATA)['account']['objectId']);
}
}
/**
*
*/
queryAgent() {
this.agentService.queryAgentList({ pageNum:1,pageSize:999}, (data: any) => {
this.agentArray = data['return_data']['list'];
});
}
/**
*
* @param agentId
*/
queryAgentStaff(agentId: number) {
this.searchForm.controls['agentStaffId'].setValue(null);
this.agentStaffService.getStaffList({ agentId: agentId,pageNum:1,pageSize:999}, (data: any) => {
this.agentStaffArray = data['return_data']['list'];
});
}
/**
*
*/
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.orderOilService.queryList(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
}
});
// 查询统计
this.orderOilService.countOilData(this.searchForm.value,(data: any) => {
if (data['return_code'] == '000000') {
this.totalData = 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]);
}
}
/**
*
*/
exportOilOrder() {
this.orderOilService.exportOilOrder(this.searchForm.value, (data:any) => {
window.location.href = this.imageUrl + 'temporary/' + data['return_data'];
});
}
/**
*
* @param orderNo
*/
showOrderDetail(orderNo: string) {
this.orderDetailModalLoading = true;
this.orderOilService.queryOilOrder(orderNo, (data:any) => {
this.orderDetailObject = data['return_data'];
this.orderDetailModalLoading = false;
});
this.orderDetailModal = true;
}
/**
*
*/
closeOrderDetail() {
this.orderDetailModal = false;
}
/**
* 退
* @param orderNo
* @param childOrderNo
*/
showRefund(orderNo: string, childOrderNo: string) {
this.refundForm.patchValue({ orderNo: orderNo, childOrderNo: childOrderNo})
this.orderRefundModal = true;
}
/**
* 退
*/
closeRefund() {
this.orderRefundModal = false;
}
/**
* 退
* @param orderNo
*/
submitRefundConfirm() {
for (const i in this.refundForm.controls) {
this.refundForm.controls[i].markAsDirty();
this.refundForm.controls[i].updateValueAndValidity();
}
if (this.refundForm.status == null || this.refundForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有必填项',
});
return;
}
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定对交易订号('+this.refundForm.controls['orderNo'].value+')进行退款吗?',
nzOnOk: () => this.submitRefund()
});
}
/**
* 退
* @param orderNo
*/
submitRefund() {
this.loadingObject.status = true;
this.loadingObject.title = '处理中...';
this.orderRefundService.tradeOrderChild(this.refundForm.controls['childOrderNo'].value,1, this.refundForm.controls['remarks'].value, (data: any) => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功',
});
this.queryData();
this.closeRefund();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
this.loadingObject.status = false;
});
this.orderRefundModal = true;
}
/**
*
*/
showOrderPrint(orderNo: string) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '是否补打小票?',
nzOnOk: () => this.submitOrderPrint(orderNo)
});
}
/**
*
*/
submitOrderPrint(orderNo: string) {
this.orderOilService.printOrder(orderNo, (data: any) => {
if (data['return_code'] === '000000') {
this.message.success("操作成功");
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
})
}
}

@ -1,6 +1,8 @@
import { Routes } from '@angular/router';
import {OrderRefundComponent} from "./order-refund/order-refund.component";
import {OrderOilListComponent} from "./order-oil-list/order-oil-list.component";
export const TRADE_ROUTES: Routes = [
{ path: 'order-refund', component: OrderRefundComponent },
{ path: 'order-oil', component: OrderOilListComponent },
];

@ -0,0 +1,38 @@
import { Pipe, PipeTransform } from '@angular/core';
import {Button, buttonData} from "../../data/common/button.namespace";
@Pipe({
name: 'button',
standalone: true
})
export class ButtonPipe implements PipeTransform {
data: Button[] = buttonData;
/**
*
* @param buttonCode
*/
isButton(buttonCode: string): boolean {
// 读取缓存数据
return this.data.find(o => o.menuUrl == buttonCode) != null;
}
/**
*
* @param buttonCode
*/
getButton(buttonCode: string): Button | any {
// 读取缓存数据
return this.data.find(o => o.menuUrl == buttonCode);
}
transform(codeType: string): string {
const obj = this.getButton(codeType);
if (obj == null) {
return '未知';
} else {
return obj.menuName;
}
}
}

@ -0,0 +1,24 @@
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 AgentStaffService {
constructor(private http: HttpClient) { }
/**
*
* @param param
* @param callBack
*/
public getStaffList(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.get(environment.baseUrl + 'agentStaff/getStaffList?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,24 @@
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 AgentService {
constructor(private http: HttpClient) { }
/**
*
* @param param
* @param callBack
*/
public queryAgentList(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.get(environment.baseUrl + 'agent/queryAgentList?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,80 @@
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 OrderOilService {
constructor(private http: HttpClient) { }
/**
*
* @param param
* @param callBack
*/
public queryList(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.get(environment.baseUrl + 'gasOrder/queryOilOrderList?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param param
* @param callBack
*/
public exportOilOrder(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.get(environment.baseUrl + 'gasOrder/exportOilOrder?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param param
* @param callBack
*/
public countOilData(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.get(environment.baseUrl + 'gasOrder/countOilData?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param orderNo
* @param callBack
*/
public queryOilOrder(orderNo: string, callBack:any) {
const param = {
orderNo: orderNo,
tm: new Date().getTime()
}
this.http.get(environment.baseUrl + 'gasOrder/queryOilOrder?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param orderNo
* @param callBack
*/
public printOrder(orderNo: string, callBack:any) {
const param = {
orderNo: orderNo,
tm: new Date().getTime()
}
this.http.get(environment.baseUrl + 'gasOrder/printOrder?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
}

@ -10,6 +10,39 @@ export class OrderRefundService {
constructor(private http: HttpClient) { }
/**
* 退
* @param param
* @param callBack
*/
public tradeOrder(orderNo: string, remark: string, callBack:any) {
const param = {
orderNo: orderNo,
remark: remark,
time: new Date().getTime()
}
this.http.post(environment.baseUrl + 'refund/tradeOrder', param).subscribe(data => {
callBack(data);
});
}
/**
* 退
* @param param
* @param callBack
*/
public tradeOrderChild(childOrderNo: string, productCount: number, remark: string, callBack:any) {
const param = {
childOrderNo: childOrderNo,
productCount: productCount,
remark: remark,
time: new Date().getTime()
}
this.http.post(environment.baseUrl + 'refund/tradeOrderChild', param).subscribe(data => {
callBack(data);
});
}
/**
* 退
* @param param

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@ -1,7 +1,5 @@
export const environment = {
production: true,
baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/',
baseUrl: 'https://oil.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://oil.dctpay.com/filesystem/',
};

@ -5,7 +5,7 @@
export const environment = {
production: false,
baseUrl: 'https://test-oil.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/',
imageUrl: 'https://test-oil.dctpay.com/filesystem/',
};
/*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Loading…
Cancel
Save