提交代码

pull/1/head
胡锐 2 years ago
parent 9f2e139ff0
commit e73051011a
  1. 4
      src/app/admin/merchant-store/store-list/store-list.component.html
  2. 20
      src/app/admin/order/oil-station-order/oil-station-order.component.html
  3. 33
      src/app/admin/order/oil-station-order/oil-station-order.component.ts
  4. 4
      src/app/services/order.service.ts

@ -93,9 +93,9 @@
<nz-divider nzType="vertical"></nz-divider>
<a *ngIf="'BTN_add_blance' | button" (click)="getRecharge(data.id)">增加余额</a>
<nz-divider *ngIf="'BTN_add_blance' | button" nzType="vertical"></nz-divider>
<a (click)="getDelete(data.id)">删除</a><!--
<a (click)="getDelete(data.id)">删除</a>
<nz-divider nzType="vertical"></nz-divider>
<a [routerLink]="['/admin/device/list']" [queryParams]="{ merStoreId: data.id}">设备管理</a>-->
<a [routerLink]="['/admin/device/list']" [queryParams]="{ merStoreId: data.id}">设备管理</a>
</td>
</tbody>
</nz-table>

@ -120,8 +120,8 @@
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>{{data.status | orderCouponStatus}}</td>
<td nzRight class="table-td-operation">
<a style="float: left;width: 100%;margin-bottom: 10px;" *ngIf="(secUser['objectType'] == 3 || secUser['objectType'] == 8) && data.printStatus == false" (click)="showPrintDiv(data.orderId, data)">打印小票</a>
<a style="float: left;width: 100%;margin-bottom: 10px;" *ngIf="(secUser['objectType'] == 3 || secUser['objectType'] == 8) && data.printStatus == true" (click)="showPrintDiv(data.orderId, data)">已打印({{data.printNum+'次'}})</a>
<a style="float: left;width: 100%;margin-bottom: 10px;" *ngIf="(secUser['objectType'] == 3 || secUser['objectType'] == 8) && data.printStatus == false" (click)="showPrintModal(data.orderId, data)">打印小票</a>
<a style="float: left;width: 100%;margin-bottom: 10px;" *ngIf="(secUser['objectType'] == 3 || secUser['objectType'] == 8) && data.printStatus == true" (click)="showPrintModal(data.orderId, data)">已打印({{data.printNum+'次'}})</a>
<a nz-dropdown [nzDropdownMenu]="menu">操作列表<i nz-icon nzType="down"></i></a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
@ -170,6 +170,22 @@
</nz-modal>
<nz-modal [(nzVisible)]="printModal" nzTitle="选择打印方式" nzWidth="200" (nzOnCancel)="printModal = false" [nzFooter]="null">
<form nz-form>
<nz-form-item>
<nz-form-control>
<button nz-button nzType="primary" nzBlock (click)="showPrintDiv()">热敏打印机</button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control>
<button nz-button nzType="primary" nzBlock (click)="cloudPrint()">云打印机</button>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<!--<div id="div_print">
<div style="float: left;margin-bottom: 150px;">
<div style="line-height: 30px; color:#000;">

@ -3,7 +3,7 @@ import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
import {OrderService} from '../../../services/order.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {Router} from '_@angular_router@9.0.7@@angular/router';
import {CompanyService} from '../../../services/company.service';
import {MerchantService} from '../../../services/merchant.service';
@ -40,11 +40,18 @@ export class OilStationOrderComponent implements OnInit {
gasArray = [];
printDataObject = {
orderId: null,
printData: null
};
printModal = false;
constructor(
private form: FormBuilder,
private order: OrderService,
private webSocketService: WebsocketService,
private iconService: IconService,
private modal: NzModalService,
private message: NzMessageService,
private router: Router,
private company: CompanyService,
@ -167,11 +174,31 @@ export class OilStationOrderComponent implements OnInit {
});
}
showPrintDiv(orderId: number, data: PrintData) {
showPrintModal(orderId: number, data: PrintData) {
this.printDataObject.orderId = orderId;
this.printDataObject.printData = data;
this.printModal = true;
}
cloudPrint() {
this.orderService.print(this.printDataObject.orderId, 2, dataBack => {
if (dataBack['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功',
});
this.getRequest(false, this.searchForm.value);
}
});
}
showPrintDiv() {
const orderId = this.printDataObject.orderId;
const data = this.printDataObject.printData;
data['createTime'] = new Date(data['createTime']).toLocaleString();
this.printDiv(data);
this.orderService.print(orderId, dataBack => {
this.orderService.print(orderId, 1, dataBack => {
if (dataBack['return_code'] === '000000') {
this.getRequest(false, this.searchForm.value);
}

@ -21,8 +21,8 @@ export class OrderService {
* @param paramsObject
* @param callBack
*/
public print(orderId: number, callBack) {
this.http.get(environment.baseUrl + 'highOrder/print?orderId=' + orderId).subscribe(data => {
public print(orderId: number, printType: number, callBack) {
this.http.get(environment.baseUrl + 'highOrder/print?orderId=' + orderId + '&printType=' + printType).subscribe(data => {
callBack(data);
});
}

Loading…
Cancel
Save