提交代码

pull/1/head
胡锐 3 years ago
parent f5550c81bb
commit e0fd00cc7a
  1. 217
      src/app/admin/order/oil-station-order/oil-station-order.component.html
  2. 132
      src/app/admin/order/oil-station-order/oil-station-order.component.ts
  3. 4
      src/environments/environment.ts
  4. 3
      tsconfig.json

@ -110,7 +110,7 @@
<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;" (click)="showPrintModal(data)">打印小票</a>-->
<a style="float: left;width: 100%;margin-bottom: 10px;" (click)="showPrintDiv(data)">打印小票</a>
<a nz-dropdown [nzDropdownMenu]="menu">操作列表<i nz-icon nzType="down"></i></a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
@ -159,82 +159,143 @@
</nz-modal>
<nz-modal [(nzVisible)]="printModal" nzTitle="订单详情" nzWidth="58mm" [nzBodyStyle]="{ width: '58mm', height: '210mm'}" (nzOnCancel)="closePrintModal()">
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
<!--<div id="div_print">
<div style="float: left;margin-bottom: 150px;">
<div style="line-height: 30px; color:#000;">
<span style="font-size: 13px;float: left;width: 100%;">{{printDataObject.gasName}}</span>
<span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(客户存根)</span>
</div>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
</div> <div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div>
<table style="width: 100%;">
<tbody>
<tr><td class="print_td">-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;</td></tr>
<tr>
<td class="print_td">流水号:<span>{{printDataObject.orderNo}}</span></td>
</tr>
<tr><td class="print_td">-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;</td></tr>
<tr>
<td class="print_td">时间:<span>{{printDataObject.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</span></td>
</tr>
<tr>
<td class="print_td">来源:<span>嗨森逛</span></td>
</tr>
<tr>
<td class="print_td">油枪:<span>{{printDataObject.gasGunNo}}</span></td>
</tr>
<tr>
<td class="print_td">油品:<span>{{printDataObject.gasOilNo}}</span></td>
</tr>
<tr>
<td class="print_td">升数:<span>{{printDataObject.gasOilLiters}}升</span></td>
</tr>
<tr>
<td class="print_td">实际加油升数以油站加油机为准!</td>
</tr>
<tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>
<tr><td style="font-size: 30px;color: black">¥{{printDataObject.oilPrice}}元</td></tr>
<tr><td class="print_td">-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;</td></tr>
<tr><td style="float: left;color: black;margin-left: 35px;">开心又省钱; 来”嗨森逛“</td></tr>
</tbody>
</table>
</div>
</nz-modal>
<div style="float: left;margin-bottom: 50px;">
<div style="line-height: 30px; color:#000;">
<span style="font-size: 13px;float: left;width: 100%;">{{printDataObject.gasName}}</span>
<span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(收银员存根)</span>
</div>
<table style="width: 100%;">
<tbody>
<tr><td class="print_td">-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;</td></tr>
<tr>
<td class="print_td">流水号:<span>{{printDataObject.orderNo}}</span></td>
</tr>
<tr><td class="print_td">-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;</td></tr>
<tr>
<td class="print_td">时间:<span>{{printDataObject.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</span></td>
</tr>
<tr>
<td class="print_td">来源:<span>嗨森逛</span></td>
</tr>
<tr>
<td class="print_td">油枪:<span>{{printDataObject.gasGunNo}}</span></td>
</tr>
<tr>
<td class="print_td">油品:<span>{{printDataObject.gasOilNo}}</span></td>
</tr>
<tr>
<td class="print_td">升数:<span>{{printDataObject.gasOilLiters}}升</span></td>
</tr>
<tr>
<td class="print_td">实际加油升数以油站加油机为准!</td>
</tr>
<tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>
<tr><td style="font-size: 30px;color: black">¥{{printDataObject.oilPrice}}元</td></tr>
<tr><td class="print_td">-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;</td></tr>
<tr><td style="float: left;color: black;margin-left: 35px;">开心又省钱; 来”嗨森逛“</td></tr>
</tbody>
</table>
</div>
&lt;!&ndash; <table border=1 cellspacing=0 cellpadding=1 width="100%" style="border-collapse:collapse" bordercolor="#333333">
<thead>
<tr>
<td width="10%">
<div align=center><b>表格页眉</b></div>
</td>
<td width="25%">
<div align=center><b>品名</b></div>
</td>
<td width="10%">
<div align=center><b>颜色</b></div>
</td>
<td width="10%">
<div align=center><b>规格</b></div>
</td>
<td width="10%">
<div align=center><b>数量</b></div>
</td>
<td width="15%">
<div align=center><b>单价</b></div>
</td>
<td width="20%">
<div align=center><b>金额</b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>&nbsp;1</td>
<td>名称01</td>
<td>浅灰色</td>
<td>185/10</td>
<td>1</td>
<td>248.00</td>
<td>248.00</td>
</tr>
<tr>
<td>&nbsp;2</td>
<td>名称02</td>
<td>浅灰色</td>
<td>185/10</td>
<td>1</td>
<td>248.00</td>
<td>248.00</td>
</tr>
<tr>
<td>&nbsp;3</td>
<td>名称03</td>
<td>浅灰色</td>
<td>185/10</td>
<td>1</td>
<td>248.00</td>
<td>248.00</td>
</tr>
<tr>
<td>&nbsp;4</td>
<td>名称04</td>
<td>浅灰色</td>
<td>185/10</td>
<td>1</td>
<td>248.00</td>
<td>248.00</td>
</tr>
</table>&ndash;&gt;
</div>-->

@ -10,7 +10,7 @@ import {MerchantService} from '../../../services/merchant.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {CommonsService} from '../../../services/commons.service';
import {WebsocketService} from '../../../services/websocket.service';
import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace";
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
@Component({
selector: 'app-oil-station-order',
@ -37,9 +37,15 @@ export class OilStationOrderComponent implements OnInit {
roleType: number;
secUser: object;
printModal = false;
printData = {};
printDataObject: PrintData = {
gasName: '',
orderNo: '',
createTime: '',
gasOilNo: '',
gasGunNo: '',
gasOilLiters: 0,
oilPrice: 0
};
constructor(
private form: FormBuilder,
@ -158,19 +164,113 @@ export class OilStationOrderComponent implements OnInit {
});
}
/**
*
*/
showPrintModal(data: object) {
this.printData = data;
this.printModal = true;
showPrintDiv(data: PrintData) {
data['createTime'] = new Date(data['createTime']).toLocaleString();
this.printDiv(data);
}
/**
*
*/
closePrintModal() {
this.printData = {};
this.printModal = false;
printDiv(data: object) {
const headstr = '<html><head><title>打印小票</title></head><body>';
const footstr = '</body>';
const newstr = '<div id="div_print">\n' +
' <div style="float: left;margin-bottom: 150px;">\n' +
' <div style="line-height: 30px; color:#000;">\n' +
' <span style="font-size: 13px;float: left;width: 100%;">' + data['gasName'] + '</span>\n' +
' <span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(客户存根)</span>\n' +
' </div>\n' +
' <table style="width: 100%;">\n' +
' <tbody>\n' +
' <tr><td style="font-size: smaller;color: black;">---------------------------------------------------</td></tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">流水号:<span>' + data['orderNo'] + '</span></td>\n' +
' </tr>\n' +
' <tr><td style="font-size: smaller;color: black;">---------------------------------------------------</td></tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">时间:<span>' + data['createTime'] + '</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">来源:<span>嗨森逛</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">油枪:<span>' + data['gasGunNo'] + '</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">油品:<span>' + data['gasOilNo'] + '</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">升数:<span>' + data['gasOilLiters'] + '升</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">实际加油升数以油站加油机为准!</td>\n' +
' </tr>\n' +
' <tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>\n' +
' <tr><td style="font-size: 30px;color: black">¥' + data['totalPrice'] + '元</td></tr>\n' +
' <tr><td style="font-size: smaller;color: black;">---------------------------------------------------</td></tr>\n' +
' <tr><td style="float: left;color: black;margin-left: 35px;">开心又省钱; 来”嗨森逛“</td></tr>\n' +
' </tbody>\n' +
' </table>\n' +
' </div>\n' +
' <div style="float: left;margin-bottom: 50px;">\n' +
' <div style="line-height: 30px; color:#000;">\n' +
' <span style="font-size: 13px;float: left;width: 100%;">' + data['gasName'] + '</span>\n' +
' <span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(收银员存根)</span>\n' +
' </div>\n' +
' <table style="width: 100%;">\n' +
' <tbody>\n' +
' <tr><td style="font-size: smaller;color: black;">---------------------------------------------------</td></tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">流水号:<span>' + data['orderNo'] + '</span></td>\n' +
' </tr>\n' +
' <tr><td style="font-size: smaller;color: black;">---------------------------------------------------</td></tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">时间:<span>' + data['createTime'] + '</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;"来源:<span>嗨森逛</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">油枪:<span>' + data['gasGunNo'] + '</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">油品:<span>' + data['gasOilNo'] + '</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">升数:<span>' + data['gasOilLiters'] + '升</span></td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="font-size: smaller;color: black;">实际加油升数以油站加油机为准!</td>\n' +
' </tr>\n' +
' <tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>\n' +
' <tr><td style="font-size: 30px;color: black">¥' + data['totalPrice'] + '元</td></tr>\n' +
' <tr><td style="font-size: smaller;color: black;">---------------------------------------------------</td></tr>\n' +
' <tr><td style="float: left;color: black;margin-left: 35px;">开心又省钱; 来”嗨森逛“</td></tr>\n' +
' </tbody>\n' +
' </table>\n' +
' </div>\n' +
'</div>';
console.log(newstr);
// const oldstr = document.body.innerHTML;
document.body.innerHTML = headstr + newstr + footstr;
window.print();
// document.body.innerHTML = oldstr;
location.reload();
return false;
}
}
export class PrintData {
// 油站名称
gasName = '';
// 订单号
orderNo = '';
// 下单时间
createTime = '';
// 油品
gasOilNo = '';
// 加油抢号
gasGunNo = '';
// 加油升数
gasOilLiters = 0;
// 加油金额
oilPrice = 0;
}

@ -6,8 +6,8 @@ export const environment = {
production: false,
/* baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'http://localhost:9302/filesystem/',*/
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsg.dctpay.com/filesystem/',
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
};

@ -16,7 +16,8 @@
],
"lib": [
"es2018",
"dom"
"dom",
"scripthost"
],
"allowSyntheticDefaultImports": true
},

Loading…
Cancel
Save