提交代码

pull/1/head
胡锐 3 years ago
parent d20bbbeed0
commit 9617efe27e
  1. 3
      src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
  2. 18
      src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
  3. 13
      src/app/services/oil-card.service.ts

@ -129,6 +129,7 @@
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="showGenerateCardModal()" ><i nz-icon nzType="plus" nzTheme="outline"></i>生成油卡</button>
<button nz-button nzType="primary" class="right-btn" (click)="excelCard()" ><i nz-icon nzType="import" nzTheme="outline"></i>导出油卡</button>
</div>
<!--数组表格 -->
@ -146,6 +147,7 @@
<th nzWidth="80px" *ngIf="roleType == 5 && adminFlag == 1">部门</th>
<th nzWidth="160px">卡号</th>
<th nzWidth="110px">余额</th>
<th nzWidth="110px">消费金额</th>
<th nzWidth="100px">联系人</th>
<th nzWidth="120px">联系电话</th>
<th nzWidth="100px">油卡状态</th>
@ -162,6 +164,7 @@
<td *ngIf="roleType == 5 && adminFlag == 1">{{data.orgName}}</td>
<td>{{data.cardNo}}</td>
<td>¥{{data.amount}}</td>
<td>¥{{data.amountConsume}}</td>
<td>{{data.contactName?data.contactName:'未设置'}}</td>
<td>{{data.contactPhone?data.contactPhone:'未设置'}}</td>
<td>{{data.status | oilCardStatus}}</td>

@ -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']
});
}
});
}
}

@ -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);
});
}
}

Loading…
Cancel
Save