提交代码

pull/1/head
胡锐 2 years ago
parent f5550c81bb
commit e0fd00cc7a
  1. 219
      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>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>{{data.status | orderCouponStatus}}</td> <td nzRight>{{data.status | orderCouponStatus}}</td>
<td nzRight class="table-td-operation"> <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> <a nz-dropdown [nzDropdownMenu]="menu">操作列表<i nz-icon nzType="down"></i></a>
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
@ -159,82 +159,143 @@
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="printModal" nzTitle="订单详情" nzWidth="58mm" [nzBodyStyle]="{ width: '58mm', height: '210mm'}" (nzOnCancel)="closePrintModal()"> <!--<div id="div_print">
<div nz-row [nzGutter]="16"> <div style="float: left;margin-bottom: 150px;">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <div style="line-height: 30px; color:#000;">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <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>
<div nz-row [nzGutter]="16"> <table style="width: 100%;">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tbody>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <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>
</div> <div nz-row [nzGutter]="16"> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <td class="print_td">流水号:<span>{{printDataObject.orderNo}}</span></td>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> </tr>
</div> <div nz-row [nzGutter]="16"> <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>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <td class="print_td">时间:<span>{{printDataObject.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</span></td>
</div> <div nz-row [nzGutter]="16"> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <td class="print_td">来源:<span>嗨森逛</span></td>
</div> <div nz-row [nzGutter]="16"> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <td class="print_td">油枪:<span>{{printDataObject.gasGunNo}}</span></td>
</div> <div nz-row [nzGutter]="16"> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <td class="print_td">油品:<span>{{printDataObject.gasOilNo}}</span></td>
</div> <div nz-row [nzGutter]="16"> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <td class="print_td">升数:<span>{{printDataObject.gasOilLiters}}升</span></td>
</div> <div nz-row [nzGutter]="16"> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <td class="print_td">实际加油升数以油站加油机为准!</td>
</div> <div nz-row [nzGutter]="16"> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr><td style="font-size: 30px;color: black">¥{{printDataObject.oilPrice}}元</td></tr>
</div> <div nz-row [nzGutter]="16"> <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>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr><td style="float: left;color: black;margin-left: 35px;">开心又省钱; 来”嗨森逛“</td></tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> </tbody>
</div> <div nz-row [nzGutter]="16"> </table>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <div style="float: left;margin-bottom: 50px;">
</div> <div nz-row [nzGutter]="16"> <div style="line-height: 30px; color:#000;">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <span style="font-size: 13px;float: left;width: 100%;">{{printDataObject.gasName}}</span>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <span style="font-size: 13px;float: left;width: 100%;margin-left: 60px;">(收银员存根)</span>
</div> <div nz-row [nzGutter]="16"> </div>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <table style="width: 100%;">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tbody>
</div> <div nz-row [nzGutter]="16"> <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>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <td class="print_td">流水号:<span>{{printDataObject.orderNo}}</span></td>
</div> <div nz-row [nzGutter]="16"> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <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>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr>
</div> <div nz-row [nzGutter]="16"> <td class="print_td">时间:<span>{{printDataObject.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</span></td>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr>
</div> <div nz-row [nzGutter]="16"> <td class="print_td">来源:<span>嗨森逛</span></td>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr>
</div> <div nz-row [nzGutter]="16"> <td class="print_td">油枪:<span>{{printDataObject.gasGunNo}}</span></td>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr>
</div> <div nz-row [nzGutter]="16"> <td class="print_td">油品:<span>{{printDataObject.gasOilNo}}</span></td>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr>
</div> <div nz-row [nzGutter]="16"> <td class="print_td">升数:<span>{{printDataObject.gasOilLiters}}升</span></td>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr>
</div> <div nz-row [nzGutter]="16"> <td class="print_td">实际加油升数以油站加油机为准!</td>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr><td style="float: left;margin-top: 10px;font-size: 30px;color: black">加油金额</td></tr>
</div> <div nz-row [nzGutter]="16"> <tr><td style="font-size: 30px;color: black">¥{{printDataObject.oilPrice}}元</td></tr>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <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>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr><td style="float: left;color: black;margin-left: 35px;">开心又省钱; 来”嗨森逛“</td></tr>
</div> <div nz-row [nzGutter]="16"> </tbody>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> </table>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> </div>
</div> <div nz-row [nzGutter]="16"> &lt;!&ndash; <table border=1 cellspacing=0 cellpadding=1 width="100%" style="border-collapse:collapse" bordercolor="#333333">
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">油站名称</div></div> <thead>
<div nz-col class="gutter-row" [nzSpan]="12"><div class="inner-box">{{printData['gasName']}}</div></div> <tr>
</div> <td width="10%">
</nz-modal> <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 {LocalStorageService} from '../../../services/local-storage.service';
import {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
import {WebsocketService} from '../../../services/websocket.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({ @Component({
selector: 'app-oil-station-order', selector: 'app-oil-station-order',
@ -37,9 +37,15 @@ export class OilStationOrderComponent implements OnInit {
roleType: number; roleType: number;
secUser: object; secUser: object;
printDataObject: PrintData = {
printModal = false; gasName: '',
printData = {}; orderNo: '',
createTime: '',
gasOilNo: '',
gasGunNo: '',
gasOilLiters: 0,
oilPrice: 0
};
constructor( constructor(
private form: FormBuilder, private form: FormBuilder,
@ -158,19 +164,113 @@ export class OilStationOrderComponent implements OnInit {
}); });
} }
/** showPrintDiv(data: PrintData) {
* data['createTime'] = new Date(data['createTime']).toLocaleString();
*/ this.printDiv(data);
showPrintModal(data: object) {
this.printData = data;
this.printModal = true;
} }
/** printDiv(data: object) {
* const headstr = '<html><head><title>打印小票</title></head><body>';
*/ const footstr = '</body>';
closePrintModal() { const newstr = '<div id="div_print">\n' +
this.printData = {}; ' <div style="float: left;margin-bottom: 150px;">\n' +
this.printModal = false; ' <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, production: false,
/* baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) /* baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'http://localhost:9302/filesystem/',*/ imageUrl: 'http://localhost:9302/filesystem/',*/
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsg.dctpay.com/filesystem/', imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
}; };

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

Loading…
Cancel
Save