提交底阿媽

dev
胡锐 3 days ago
parent 098e0ff07e
commit 68709fbb75
  1. 53
      src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.html
  2. 109
      src/app/pages/trade/gas-order-receipt/gas-order-receipt.component.ts
  3. 6
      src/app/pages/trade/order-oil-list/order-oil-list.component.ts
  4. 12
      src/app/services/trade-receipt/gas-order-receipt.service.ts

@ -1,4 +1,5 @@
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'"> <nz-spin [nzSpinning]="loadingObject.status" nzTip="{{loadingObject.title}}">
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'">
<div nz-row [nzGutter]="24"> <div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="24"> <div nz-col [nzSpan]="24">
<nz-form-item> <nz-form-item>
@ -48,7 +49,8 @@
<div nz-col [nzSpan]="24" class="search-area"> <div nz-col [nzSpan]="24" class="search-area">
<button nz-button [nzType]="'primary'" (click)="searchFormSubmit()">查询</button> <button nz-button [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
<button nz-button (click)="searchFormReset()">重置</button> <button nz-button (click)="searchFormReset()">重置</button>
<button nz-button [nzType]="'primary'" (click)="export()">导出加油明细</button> <button nz-button [nzType]="'primary'" (click)="export()">导出申请明细</button>
<button nz-button [nzType]="'primary'" (click)="showImport()">导入开票完成</button>
</div> </div>
</div> </div>
</form> </form>
@ -99,7 +101,7 @@
</tbody> </tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> <ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table> </nz-table>
</nz-spin>
<nz-modal [(nzVisible)]="failModel" nzTitle="开票失败备注" (nzOnCancel)="failModel = false" [nzFooter]="null" nzWidth="800px"> <nz-modal [(nzVisible)]="failModel" nzTitle="开票失败备注" (nzOnCancel)="failModel = false" [nzFooter]="null" nzWidth="800px">
<ng-container *nzModalContent> <ng-container *nzModalContent>
@ -124,3 +126,48 @@
</nz-spin> </nz-spin>
</ng-container> </ng-container>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="importErrorModal" nzTitle="导入失败数据" (nzOnCancel)="importErrorModal = false" nzWidth="700px" [nzFooter]="null">
<ng-container *nzModalContent>
<nz-table #errorStudentTable [nzData]="importErrorData" [nzSize]="'small'">
<thead>
<tr>
<th nzWidth="50px">序号</th>
<th nzWidth="150px">申请单号</th>
<th nzWidth="300px">原因</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{ i + 1}}</td>
<td>{{data.applyNo}}</td>
<td>{{data.errorMessage}}</td>
</tr>
</tbody>
</nz-table>
</ng-container>
</nz-modal>
<nz-modal [(nzVisible)]="importModal" nzTitle="导入设备" (nzOnCancel)="importModal = false" nzWidth="500px" [nzFooter]="null">
<ng-container *nzModalContent>
<form nz-form [formGroup]="importFleUrlForm">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>文件</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-upload
[nzAccept]="'.xls,.xlsx'"
nzAction="{{baseUrl}}fileUpload/uploadfile"
[nzHeaders]="{ authorization: 'authorization-text' }"
(nzChange)="importDeviceChange($event)"
>
<button nz-button><i nz-icon nzType="upload" ></i>上传文件</button>
</nz-upload>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitImport()">确定</button>
</div>
</form>
</ng-container>
</nz-modal>

@ -34,6 +34,7 @@ import {DateMinutesDiffPipe} from "../../../pipes/common/date-minutes-diff.pipe"
import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzTypographyComponent} from "ng-zorro-antd/typography"; import {NzTypographyComponent} from "ng-zorro-antd/typography";
import {environment} from "../../../../environments/environment"; import {environment} from "../../../../environments/environment";
import {NzUploadModule} from "ng-zorro-antd/upload";
@Component({ @Component({
selector: 'app-gas-order-receipt', selector: 'app-gas-order-receipt',
@ -84,15 +85,18 @@ import {environment} from "../../../../environments/environment";
NzTooltipDirective, NzTooltipDirective,
DateMinutesDiffPipe, DateMinutesDiffPipe,
NzDividerComponent, NzDividerComponent,
NzTypographyComponent NzTypographyComponent,
NzUploadModule
], ],
templateUrl: './gas-order-receipt.component.html', templateUrl: './gas-order-receipt.component.html',
styleUrl: './gas-order-receipt.component.less' styleUrl: './gas-order-receipt.component.less'
}) })
export class GasOrderReceiptComponent { export class GasOrderReceiptComponent {
imageUrl = environment.imageUrl; imageUrl = environment.imageUrl;
loadingObject = { baseUrl = environment.baseUrl;
title: "加载中...",
loadingObject: any = {
title: "处理中...",
status: false, status: false,
}; };
// 表单页数 // 表单页数
@ -112,6 +116,12 @@ export class GasOrderReceiptComponent {
failForm: FormGroup; failForm: FormGroup;
failModel = false; failModel = false;
importErrorModal = false;
importErrorData: any = [];
importFleUrlForm: FormGroup;
importModal = false;
constructor(private fb: NonNullableFormBuilder, constructor(private fb: NonNullableFormBuilder,
private gasOrderReceiptService : GasOrderReceiptService, private gasOrderReceiptService : GasOrderReceiptService,
private storage: BrowserStorageService, private storage: BrowserStorageService,
@ -124,6 +134,10 @@ export class GasOrderReceiptComponent {
remark: ['',[Validators.required]], remark: ['',[Validators.required]],
}); });
this.importFleUrlForm = this.fb.group({
fileUrl: [''],
});
// 初始化搜索框 // 初始化搜索框
this.searchForm = this.fb.group({ this.searchForm = this.fb.group({
orderNo: [''], orderNo: [''],
@ -262,5 +276,94 @@ export class GasOrderReceiptComponent {
}); });
} }
/**
*
*/
showImport() {
this.importModal = true;
}
/**
*
*/
submitImport() {
this.loadingObject.spinning = true;
this.loadingObject.msg = '导入中...';
if (this.importFleUrlForm.controls['fileUrl'].value == null) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请上传文件',
});
this.loadingObject.spinning = false;
return;
}
this.gasOrderReceiptService.importComplete(this.importFleUrlForm.value, (data: any) => {
this.loadingObject.spinning = false;
if (data['return_code'] === '000000') {
if (data['return_data'].length === 0) {
this.modal.success({
nzTitle: '提示',
nzContent: '成功',
nzOnOk: () => this.queryData()
});
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '导入失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showImportErrorModal(data['return_data'])
});
}
} else {
this.importModal = true;
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
* @param data
*/
showImportErrorModal(data:any) {
this.importErrorData = data;
this.importErrorModal = true;
}
/**
*
* @param fileInfo
*/
importDeviceChange(fileInfo: any) {
if (fileInfo.file.status !== 'uploading') {
}
if (fileInfo.file.status === 'done') {
this.loadingObject.spinning = false;
if (fileInfo.file.response.return_code === '000000') {
if (fileInfo.file.response.return_data == null || fileInfo.file.response.return_data.length === 0) {
this.modal.error({
nzTitle: '提示',
nzContent: '文件上传失败',
});
} else {
this.importFleUrlForm.controls['fileUrl'].setValue(fileInfo.file.response.return_data[0]);
}
} else {
this.modal.error({
nzTitle: '提示',
nzContent: fileInfo.file.response.return_msg,
});
}
} else if (fileInfo.file.status === 'error') {
this.loadingObject.spinning = false;
this.modal.error({
nzTitle: '提示',
nzContent: '导入失败'
});
}
}
} }

@ -165,10 +165,11 @@ export class OrderOilListComponent {
// 退款提示模态框 // 退款提示模态框
this.refundForm = this.fb.group({ this.refundForm = this.fb.group({
orderNo: [{ value: null, disabled: true}, [Validators.required]], orderNo: [{ value: null, disabled: true}, [Validators.required]],
childOrderNo: [{ value: null, disabled: true}, [Validators.required]], orderChildNo: [null],
merName: [{ value: null}], merName: [{ value: null}],
userPhone: [{ value: null}], userPhone: [{ value: null}],
gasRefuelPrice: [{ value: null}], gasRefuelPrice: [{ value: null}],
gasOilNo: [{ value: null}],
payTime: [{ value: null}], payTime: [{ value: null}],
remarks: [null,[Validators.required]], remarks: [null,[Validators.required]],
}); });
@ -386,6 +387,7 @@ export class OrderOilListComponent {
'加油油站:'+this.refundForm.controls['merName'].value+'<br/>'+ '加油油站:'+this.refundForm.controls['merName'].value+'<br/>'+
'加油客户:'+(this.refundForm.controls['userPhone'].value!=null?this.refundForm.controls['userPhone'].value:'无')+'<br/>'+ '加油客户:'+(this.refundForm.controls['userPhone'].value!=null?this.refundForm.controls['userPhone'].value:'无')+'<br/>'+
'加油金额:¥'+this.refundForm.controls['gasRefuelPrice'].value+'<br/>'+ '加油金额:¥'+this.refundForm.controls['gasRefuelPrice'].value+'<br/>'+
'加油油号:'+this.refundForm.controls['gasOilNo'].value+'#<br/>'+
'支付时间:'+ new Date(this.refundForm.controls['payTime'].value).toLocaleString()+'<br/>'+ '支付时间:'+ new Date(this.refundForm.controls['payTime'].value).toLocaleString()+'<br/>'+
'确定退款吗?', '确定退款吗?',
nzOnOk: () => this.submitRefund() nzOnOk: () => this.submitRefund()
@ -399,7 +401,7 @@ export class OrderOilListComponent {
submitRefund() { submitRefund() {
this.loadingObject.status = true; this.loadingObject.status = true;
this.loadingObject.title = '处理中...'; this.loadingObject.title = '处理中...';
this.orderRefundService.tradeOrderChild(this.refundForm.controls['childOrderNo'].value,1, this.refundForm.controls['remarks'].value, (data: any) => { this.orderRefundService.tradeOrderChild(this.refundForm.controls['orderChildNo'].value,1, this.refundForm.controls['remarks'].value, (data: any) => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.modal.success({ this.modal.success({
nzTitle: '提示', nzTitle: '提示',

@ -57,4 +57,16 @@ export class GasOrderReceiptService {
callBack(data); callBack(data);
}); });
} }
/**
*
* @param param
* @param callBack
*/
public importComplete(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.post(environment.baseUrl + 'gasOrderReceipt/importComplete', param).subscribe(data => {
callBack(data);
});
}
} }

Loading…
Cancel
Save