123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
- <title></title>
- <style>
- table tr th,
- table tr td {
- border: 2px solid #333333;
- padding: 5px;
- height: 37px;
- box-sizing: border-box;
- }
- #app {
- /* height: 98vh; */
- position: relative;
- }
- .content {
- width: 1000px;
- padding: 70px 20px 20px 20px;
- font-size: 18px;
- height: calc(100vh - 7.5vh);
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- }
- table {
- width: 100%;
- text-align: center;
- border-collapse: collapse;
- border: 3px solid #333333;
- }
- .col-bgc {
- background: #f6f7fb;
- }
- .bottom-row1 {
- display: flex;
- /* justify-content: space-between; */
- margin-top: 10px;
- }
- .bottom-row2 {
- display: flex;
- }
- .number {
- text-align: right;
- margin-bottom: 10px;
- margin-top: 20px;
- }
- .config {
- margin-top: 10px;
- margin-right: 240px;
- }
- .autograph {
- margin-top: 10px;
- }
- .title {
- text-align: center;
- font-size: 36px;
- font-weight: 500;
- margin-bottom: 20px;
- }
- </style>
- </head>
- <body>
- <div id="app">
- <div class="content" v-for="(item,index) in tableData" v-if="!isDDPrint||isEWPrint">
- <!-- <div v-if="item.inOutFlag == '2'" class="title">{{item.companyName}}</div>
- <div v-else class="title">{{item.contractManagementInfo?item.contractManagementInfo.seller:item.companyName}}
- </div> -->
- <div></div>
- <div v-if="item.inOutFlag == '2'" class="title">入库检斤单</div>
- <div v-else class="title">出库检斤单</div>
- <div class="number">{{item.contractManagementInfo?item.contractManagementInfo.contractNo:''}}</div>
- <table class="table">
- <tr class="row">
- <td class="col col-bgc">出货单位</td>
- <td class="col" colspan="">
- {{item.contractManagementInfo?item.contractManagementInfo.seller:item.warehouseName}}
- <!-- {{item.companyName}} -->
- </td>
- <td class="col col-bgc">车牌号</td>
- <td class="col" colspan="">{{item.carNo}}</td>
- <td class="col col-bgc">货名</td>
- <td class="col" colspan="3">{{item.goodsName}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">收货单位</td>
- <td class="col" colspan="">
- <!-- {{item.contractManagementInfo?item.contractManagementInfo.buyer:item.receiveWarehouse}} -->
- {{item.companyName}}
- </td>
- <td class="col col-bgc">类型</td>
- <td class="col" colspan="">{{item.type}}</td>
- <td class="col col-bgc">等级</td>
- <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.grade:''}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">检斤时间</td>
- <td class="col" colspan="">{{item.updateDate}}</td>
- <td class="col col-bgc">水分(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.waterContent:''}}
- </td>
- <td class="col col-bgc">热损伤(%)</td>
- <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.jiaorenli:''}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">杂质(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.impurity:''}}</td>
- <td class="col col-bgc">霉变粒(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.mildewGrain:''}}
- </td>
- <td class="col col-bgc">容量</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
- </td>
- <td class="col col-bgc">不完善粒(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.imperfectGrain:''}}
- </td>
- </tr>
- <tr class="row">
- <td class="col col-bgc" colspan="">毛重(吨)</td>
- <td class="col" colspan="">{{item.grossWeight}}</td>
- <td class="col col-bgc" colspan="">皮重(吨)</td>
- <td class="col" colspan="">{{item.tare}}</td>
- <td class="col col-bgc" colspan="">扣重(吨)</td>
- <td class="col" colspan="">{{item.deductionWeight ? item.deductionWeight : '0'}}</td>
- <td class="col col-bgc" colspan="">净重(吨)</td>
- <td class="col" colspan="">{{item.netWeight}}</td>
- </tr>
- </table>
- <div class="bottom">
- <div class="bottom-row1">
- <div>检斤员:{{item.backOffice}}</div>
- </div>
- <div class="bottom-row2">
- <div class="config">收货单位签名或盖章:</div>
- <div class="config">客户签名:</div>
- <div class="autograph">司机签名:</div>
- </div>
- </div>
- </div>
- <!-- 打印额外 -->
- <div class="content" v-for="(item,index) in tableDataEW" v-if="isDDPrint||isEWPrint">
- <!-- <div v-if="item.inOutFlag == '2'" class="title">{{item.companyName}}</div>
- <div v-else class="title">{{item.contractManagementInfo?item.contractManagementInfo.seller:item.companyName}}
- </div> -->
- <div></div>
- <div v-if="item.inOutFlag == '2'" class="title">入库检斤单</div>
- <div v-else class="title">出库检斤单</div>
- <div class="number">{{item.contractManagementInfo?item.contractManagementInfo.contractNo:''}}</div>
- <table class="table">
- <tr class="row">
- <td class="col col-bgc">出货单位</td>
- <td class="col" colspan="">
- <!-- {{item.contractManagementInfo?item.contractManagementInfo.seller:item.warehouseName}} -->
- {{item.customer}}
- </td>
- <td class="col col-bgc">车牌号</td>
- <td class="col" colspan="">{{item.carNo}}</td>
- <td class="col col-bgc">货名</td>
- <td class="col" colspan="3">{{item.goodsName}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">收货单位</td>
- <td class="col" colspan="">
- <!-- {{item.contractManagementInfo?item.contractManagementInfo.buyer:item.receiveWarehouse}} -->
- {{item.companyName}}
- </td>
- <td class="col col-bgc">类型</td>
- <td class="col" colspan="">{{item.type}}</td>
- <td class="col col-bgc">等级</td>
- <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.grade:''}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">检斤时间</td>
- <td class="col" colspan="">{{item.updateDate}}</td>
- <td class="col col-bgc">水分(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.waterContent:''}}
- </td>
- <td class="col col-bgc">热损伤(%)</td>
- <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.jiaorenli:''}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">杂质(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.impurity:''}}</td>
- <td class="col col-bgc">霉变粒(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.mildewGrain:''}}
- </td>
- <td class="col col-bgc">容量</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
- </td>
- <td class="col col-bgc">不完善粒(%)</td>
- <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.imperfectGrain:''}}
- </td>
- </tr>
- <tr class="row">
- <td class="col col-bgc" colspan="">毛重(吨)</td>
- <td class="col" colspan="">{{item.grossWeight}}</td>
- <td class="col col-bgc" colspan="">皮重(吨)</td>
- <td class="col" colspan="">{{item.tare}}</td>
- <td class="col col-bgc" colspan="">扣重(吨)</td>
- <td class="col" colspan="">{{item.deductionWeight ? item.deductionWeight : '0'}}</td>
- <td class="col col-bgc" colspan="">净重(吨)</td>
- <td class="col" colspan="">{{item.netWeight}}</td>
- </tr>
- </table>
- <div class="bottom">
- <div class="bottom-row1">
- <div>检斤员:{{item.backOffice}}</div>
- </div>
- <div class="bottom-row2">
- <div class="config">收货单位签名或盖章:</div>
- <div class="config">客户签名:</div>
- <div class="autograph">司机签名:</div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <script src="../cdn/vue/2.6.10/vue.min.js"></script>
- <script src="https://unpkg.com/element-ui/lib/index.js"></script>
- <script type="text/javascript">
- new Vue({
- el: '#app',
- data: {
- tableData: {},
- tableDataEW: [],
- name: "",
- isDDPrint :false,
- isEWPrint:false,
- },
- computed: {},
- methods: {
- tableRowClassName({
- row,
- rowIndex
- }) {
- if (rowIndex === 1) {
- return 'warning-row';
- } else if (rowIndex === 3) {
- return 'success-row';
- }
- return '';
- },
- getQueryVariable(variable) {
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == variable) {
- return pair[1];
- }
- }
- return (false);
- },
- printSmall() {},
- printBig() {},
- },
- mounted() {debugger
- let _ew = decodeURIComponent(this.getQueryVariable("selectEW"))
- let _ewdd = decodeURIComponent(this.getQueryVariable("selectEWDD"))
- if(_ew== 'true'){
- this.tableDataEW = JSON.parse(localStorage.getItem('ewWarehouseBatchPrint'))
- this.isEWPrint = true
- }
- if(_ewdd== 'true'){
- this.tableDataEW = JSON.parse(localStorage.getItem('ewWarehouseBatchPrint'))
- this.isDDPrint = true
- }
- this.tableData = JSON.parse(localStorage.getItem("warehouseBatchPrint"))
- console.log("打印数据", this.tableData)
- document.title = "粮食检斤单"
- // window.print()
- // window.onafterprint = function(event) {
- // window.history.back(-1)
- // };
- },
- watch: {}
- })
- </script>
- </html>
|