From 9617efe27e50fbffa41f1b20c285cc2cf250d06d Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Sun, 17 Apr 2022 22:45:04 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../oil-card-list/oil-card-list.component.html | 3 +++
.../oil-card-list/oil-card-list.component.ts | 18 ++++++++++++++++++
src/app/services/oil-card.service.ts | 13 ++++++++++++-
3 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
index 7b5bd9d..4592419 100644
--- a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
+++ b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
@@ -129,6 +129,7 @@
共计 {{dataObject.total?dataObject.total:0}} 条数据
+
@@ -146,6 +147,7 @@
部门 |
卡号 |
余额 |
+ 消费金额 |
联系人 |
联系电话 |
油卡状态 |
@@ -162,6 +164,7 @@
{{data.orgName}} |
{{data.cardNo}} |
¥{{data.amount}} |
+ ¥{{data.amountConsume}} |
{{data.contactName?data.contactName:'未设置'}} |
{{data.contactPhone?data.contactPhone:'未设置'}} |
{{data.status | oilCardStatus}} |
diff --git a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
index f4488f1..5f5f5a9 100644
--- a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
+++ b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
@@ -7,6 +7,7 @@ import {OilCardService} from '../../../services/oil-card.service';
import {CompanyAccountService} from '../../../services/company-account.service';
import {OrganizationService} from "../../../services/organization.service";
import {NavigationComponent} from "../../navigation/navigation.component";
+import {environment} from "../../../../environments/environment";
@Component({
selector: 'app-oil-card-list',
@@ -14,6 +15,7 @@ import {NavigationComponent} from "../../navigation/navigation.component";
styleUrls: ['./oil-card-list.component.scss']
})
export class OilCardListComponent implements OnInit {
+ FILE_URL = environment.imageUrl;
roleType;
adminFlag;
loadingObject = {
@@ -390,4 +392,20 @@ export class OilCardListComponent implements OnInit {
this.rechargeBtnLoading = false;
});
}
+
+ /**
+ * 导出油卡
+ */
+ excelCard() {
+ this.oilCardService.exportCard(this.whereObject, data => {
+ if (data['return_code'] === '000000') {
+ window.location.href = this.FILE_URL + 'temporary/' + data['return_data'];
+ } else {
+ this.modal.error({
+ nzTitle: '提示',
+ nzContent: data['return_msg']
+ });
+ }
+ });
+ }
}
diff --git a/src/app/services/oil-card.service.ts b/src/app/services/oil-card.service.ts
index 130671e..f0e45dd 100644
--- a/src/app/services/oil-card.service.ts
+++ b/src/app/services/oil-card.service.ts
@@ -97,7 +97,6 @@ export class OilCardService {
});
}
-
/**
* 油卡操作记录列表
*
@@ -109,4 +108,16 @@ export class OilCardService {
callBack(data);
});
}
+
+ /**
+ * 导出油卡
+ *
+ * @param param 参数对象
+ * @param callBack 回调
+ */
+ public exportCard(param: object, callBack) {
+ this.http.get(environment.baseUrl + 'oilCard/exportCard?' + this.common.getWhereCondition(param)).subscribe(data => {
+ callBack(data);
+ });
+ }
}