123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" href="../cdn/element-ui/2.13.2/theme-chalk/index.css">
- <title></title>
- <style>
- table,
- table tr th,
- table tr td {
- border: 2px solid #333333;
- padding: 5px 0;
- height: 37px;
- }
- body {
- margin: 0;
- }
- #app {
- /* height: 98vh;
- position: relative; */
- }
- .content {
- width: 1000px;
- padding: 30px 20px 20px 20px;
- font-size: 18px;
- height: 630px;
- /* height: 570px; */
- position: relative;
- margin: auto;
- }
- .a5-content {
- height: 130vh;
- }
- 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: 5px 0;
- }
- .bottom-row2 {
- display: flex;
- }
- img,
- .left {
- width: 120px;
- height: 120px;
- position: absolute;
- left: 12px;
- top: 9px;
- }
- .config {
- margin-top: 10px;
- margin-right: 160px;
- }
- .autograph {
- margin-top: 10px;
- margin-right: 160px;
- }
- .bottom-row3 {
- margin: 10px 0;
- }
- .title {
- text-align: center;
- font-size: 26px;
- font-weight: 500;
- position: relative;
- margin-left: 50px;
- /* margin-top: 47px; */
- }
- .number {
- text-align: right;
- margin-bottom: 10px;
- margin-top: 30px;
- }
- .small-row {
- display: flex;
- }
- .small-content {
- width: 300px;
- /* margin: 0 auto;
- border: 1px solid #ccc;
- padding: 20px 20px 160px 20px;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- margin: auto; */
- }
- .small-title {
- text-align: center;
- font-size: 18px;
- /* display: flex; */
- justify-content: space-between;
- align-items: center;
- }
- .numberNo {
- font-size: 36px;
- margin: auto;
- }
- .small-row {
- display: flex;
- justify-content: space-between;
- margin: 10px;
- }
- .small-img {
- margin-right: 0;
- }
- .sign {
- margin-right: 100px;
- }
- .small-code {
- position: relative;
- left: calc(50% - 55px)
- }
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <div v-if="selectPrint">
- <div v-for="(item,index) in tableData1" :key="index" v-if="!isDDPrint||isEWPrint">
- <div class="content" :class="pageType=='A5'?'a5-content':''">
- <!-- <div class="title">{{item.compName}}</div> -->
- <div class="title">入库检斤单</div>
- <div class="left">
- <img :src="item.codeUrl" alt="">
- </div>
- <div class="number">{{item.number}}</div>
- <table class="table">
- <tr class="row">
- <td class="col col-bgc">客户姓名</td>
- <td class="col" colspan="2">{{item.customer}}</td>
- <td class="col col-bgc">客户电话</td>
- <td class="col">{{item.customerPhone}}</td>
- <td class="col col-bgc">车牌号</td>
- <td class="col" colspan="2">{{item.carNumber}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">收货单位</td>
- <td class="col" colspan="2">{{item.compName}}</td>
- <td class="col col-bgc">联系人</td>
- <td class="col">{{item.person}}</td>
- <td class="col col-bgc">联系电话</td>
- <td class="col" colspan="2">{{item.personPhone}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">货名</td>
- <td class="col">{{item.goodsName}}</td>
- <td class="col col-bgc">类型</td>
- <td class="col">{{item.type}}</td>
- <td class="col col-bgc">{{item.goodsName == '大豆' ? '蛋白' : '容重(克/升)'}}</td>
- <td class="col">
- {{item.goodsName=='大豆'?item.qualityInspectionManagement.protein:item.qualityInspectionManagement.bulkDensity}}
- </td>
- <td class="col col-bgc">{{item.goodsName == '大豆' ? '完善粒率(%)' : '不完善粒(%)'}}</td>
- <td class="col">
- {{item.goodsName ==
- '大豆'?item.qualityInspectionManagement.completeGrain:item.qualityInspectionManagement.imperfectGrain}}
- </td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">等级</td>
- <td class="col">
- {{item.qualityInspectionManagement?item.qualityInspectionManagement.grade:''}}</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">
- {{item.qualityInspectionManagement?item.qualityInspectionManagement.jiaorenli:''}}</td>
- <td class="col col-bgc">质检时间</td>
- <td class="col">
- {{item.qualityInspectionManagement?item.qualityInspectionManagement.qualityDate:''}}
- </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.buckleMiscellaneous:''}}
- </td>
- <td class="col col-bgc">仓位号</td>
- <td class="col">{{item.binNumber.indexOf("托盘") !=
- -1?item.binNumber.replace("托盘",""):item.binNumber}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">毛重(公斤)</td>
- <td class="col">{{item.grossWeight}}</td>
- <td class="col col-bgc">皮重(公斤)</td>
- <td class="col">{{item.tare}}</td>
- <td class="col col-bgc">扣重(公斤)</td>
- <td class="col">{{item.buckleMiscellaneous}}</td>
- <td class="col col-bgc">净重(公斤)</td>
- <td class="col">{{item.netWeight}}</td>
- <!-- <td class="col " colspan="2"></td> -->
- </tr>
- <tr class="row">
- <td class="col col-bgc" colspan="2">毛重检斤时间</td>
- <td class="col" colspan="2">{{item.grossDate}}</td>
- <td class="col col-bgc" colspan="2"> 皮重检斤时间</td>
- <td class="col" colspan="2">{{item.tareDate}}</td>
- </tr>
- </table>
- <div class="bottom">
- <div class="bottom-row1">
- <div>毛检:{{item.secretaryWeigher}}</div>
- <div style="margin-left:60px">皮检:{{item.skinInspector}}</div>
- <!-- <div>{{tableData.qualityDate}}</div> -->
- </div>
- <div class="bottom-row2">
- <!-- <div class="left">
- <img :src="item.codeUrl" alt="">
- </div> -->
- <div class="config" v-if="item.warehouseName!='白城补数据'">收货单位签名或盖章:</div>
- <div class="config" v-if="item.warehouseName=='白城补数据'">收货单位签名或盖章:黑龙江中天昊元贸易有限公司</div>
- <div class="autograph">客户签名:</div>
- <div class="autograph" v-if="item.warehouseName!='白城补数据'">司机签名:</div>
- </div>
- <!-- <div class="bottom-row3">扫一扫</div> -->
- </div>
- </div>
- </div>
- <!-- 打印额外 -->
- <div v-for="(item,index) in tableDataEW" :key="index" v-if="isDDPrint||isEWPrint">
- <div class="content" :class="pageType=='A5'?'a5-content':''">
- <!-- <div class="title">{{item.customer}}</div> -->
- <div class="title">入库检斤单</div>
- <div class="left">
- <img :src="item.codeUrl" alt="">
- </div>
- <div class="number">{{item.number}}</div>
- <table class="table">
- <tr class="row">
- <td class="col col-bgc" v-if="item.serviceManagementType == 3">客户姓名</td>
- <td class="col" colspan="2" v-if="item.serviceManagementType == 3">{{item.customer}}</td>
- <td class="col col-bgc" v-if="item.serviceManagementType == 1">发货单位</td>
- <td class="col" colspan="2" v-if="item.serviceManagementType == 1">{{item.customer}}</td>
- <td class="col col-bgc" v-if="item.serviceManagementType == 3">客户电话</td>
- <td class="col" v-if="item.serviceManagementType == 3">{{item.customerPhone}}</td>
- <td class="col col-bgc" v-if="item.serviceManagementType == 1">联系电话</td>
- <td class="col" v-if="item.serviceManagementType == 1">{{item.contractManagement ?
- item.contractManagement.sellerPhone : ""}}</td>
- <td class="col col-bgc">车牌号</td>
- <td class="col" colspan="2">{{item.carNumber}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">收货单位</td>
- <td class="col" colspan="2">{{item.compName}}</td>
- <td class="col col-bgc">联系人</td>
- <td class="col">{{item.person}}</td>
- <td class="col col-bgc">联系电话</td>
- <td class="col" colspan="2">{{item.personPhone}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">货名</td>
- <td class="col">{{item.goodsName}}</td>
- <td class="col col-bgc">类型</td>
- <td class="col">{{item.type}}</td>
- <td class="col col-bgc">{{item.goodsName == '大豆' ? '蛋白' : '容重(克/升)'}}</td>
- <td class="col">
- {{item.goodsName=='大豆'?item.qualityInspectionManagement.protein:item.qualityInspectionManagement.bulkDensity}}
- </td>
- <td class="col col-bgc">{{item.goodsName == '大豆' ? '完善粒率(%)' : '不完善粒(%)'}}</td>
- <td class="col">
- {{item.goodsName ==
- '大豆'?item.qualityInspectionManagement.completeGrain:item.qualityInspectionManagement.imperfectGrain}}
- </td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">等级</td>
- <td class="col">
- {{item.qualityInspectionManagement?item.qualityInspectionManagement.grade:''}}</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">
- {{item.qualityInspectionManagement?item.qualityInspectionManagement.jiaorenli:''}}</td>
- <td class="col col-bgc">质检时间</td>
- <td class="col">
- {{item.qualityInspectionManagement?item.qualityInspectionManagement.qualityDate:''}}
- </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.buckleMiscellaneous:''}}
- </td>
- <td class="col col-bgc">仓位号</td>
- <td class="col">{{item.binNumber.indexOf("托盘") !=
- -1?item.binNumber.replace("托盘",""):item.binNumber}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">毛重(公斤)</td>
- <td class="col">{{item.grossWeight}}</td>
- <td class="col col-bgc">皮重(公斤)</td>
- <td class="col">{{item.tare}}</td>
- <td class="col col-bgc">扣重(公斤)</td>
- <td class="col">{{item.buckleMiscellaneous}}</td>
- <td class="col col-bgc">净重(公斤)</td>
- <td class="col">{{item.netWeight}}</td>
- <!-- <td class="col " colspan="2"></td> -->
- </tr>
- <tr class="row">
- <td class="col col-bgc" colspan="2">毛重检斤时间</td>
- <td class="col" colspan="2">{{item.grossDate}}</td>
- <td class="col col-bgc" colspan="2"> 皮重检斤时间</td>
- <td class="col" colspan="2">{{item.tareDate}}</td>
- </tr>
- </table>
- <div class="bottom">
- <div class="bottom-row1">
- <div>毛检:{{item.secretaryWeigher}}</div>
- <div style="margin-left:60px">皮检:{{item.skinInspector}}</div>
- <!-- <div>{{tableData.qualityDate}}</div> -->
- </div>
- <div class="bottom-row2">
- <!-- <div class="left">
- <img :src="item.codeUrl" alt="">
- </div> -->
- <div class="config" v-if="item.warehouseName!='白城补数据'">收货单位签名或盖章:</div>
- <div class="config" v-if="item.warehouseName=='白城补数据'">收货单位签名或盖章:黑龙江中天昊元贸易有限公司</div>
- <div class="autograph">客户签名:</div>
- <div class="autograph" v-if="item.warehouseName!='白城补数据'">司机签名:</div>
- </div>
- <!-- <div class="bottom-row3">扫一扫</div> -->
- </div>
- </div>
- </div>
- </div>
- <div v-else id="saveImg">
- <div class="content" v-if="bigContent" v-for="(_item,index) in tableData">
- <!-- //单个打印 -->
- <!-- <div class="title">{{_item.compName}}</div> -->
- <div v-if="!_item.printtype" class="title">{{_item.compName}}({{_item.warehouseName}})入库检斤单</div>
- <div v-if="_item.printtype" class="title">{{_item.compName}}({{_item.warehouseName}})出库检斤单</div>
- <div class="left">
- <img :src="_item.codeUrl" alt="">
- </div>
- <div v-if="!_item.printtype" class="number">
- <div>单位:公斤/元</div>{{_item.number}}
- </div>
- <table :style="!_item.printtype?'margin-top:20px;':'margin-top:80px;'" class="table">
- <tr class="row">
- <td class="col col-bgc" v-if="_item.serviceManagementType == 3">客户姓名</td>
- <td class="col" colspan="3" v-if="_item.serviceManagementType == 3">{{_item.customer}}</td>
- <td class="col col-bgc" v-if="_item.serviceManagementType == 1">发货单位</td>
- <td class="col" colspan="3" v-if="_item.serviceManagementType == 1">{{_item.customer}}</td>
- <td class="col col-bgc" v-if="_item.serviceManagementType == 3">客户电话</td>
- <td class="col" v-if="_item.serviceManagementType == 3">{{_item.customerPhone}}</td>
- <td class="col col-bgc" v-if="_item.serviceManagementType == 1">联系电话</td>
- <td class="col" v-if="_item.serviceManagementType == 1">{{_item.contractManagement ?
- _item.contractManagement.sellerPhone : ""}}</td>
- <td class="col col-bgc">车牌号</td>
- <td class="col" colspan="1">{{_item.carNumber}}</td>
- </tr>
- <tr class="row">
- <!-- <td class="col col-bgc">收货单位</td>
- <td class="col" colspan="2">{{_item.compName}}</td> -->
- <td v-if='_item.customer!="白城市鹏羽粮食贸易有限公司"' class="col col-bgc">收货单位</td>
- <td v-else class="col col-bgc">收货仓库</td>
- <td class="col" colspan="3">{{_item.customer!="白城市鹏羽粮食贸易有限公司"?_item.compName:'北京天维康油脂调销中心有限公司'}}
- </td>
- <td class="col col-bgc">联系人</td>
- <td class="col">{{_item.person}}</td>
- <td class="col col-bgc">联系电话</td>
- <td class="col" colspan="1">{{_item.personPhone}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">货名</td>
- <td class="col">{{_item.goodsName}}</td>
- <td class="col col-bgc">类型</td>
- <td class="col">{{_item.type}}</td>
- <td class="col col-bgc">{{_item.goodsName == '大豆' ? '蛋白' : '容重(克/升)'}}</td>
- <td class="col">
- {{_item.goodsName=='大豆'?_item.qualityInspectionManagement.protein:_item.qualityInspectionManagement.bulkDensity}}
- </td>
- <td class="col col-bgc">{{_item.goodsName == '大豆' ? '完善粒率(%)' : '不完善粒(%)'}}</td>
- <td class="col">
- {{_item.goodsName ==
- '大豆'?_item.qualityInspectionManagement.completeGrain:_item.qualityInspectionManagement.imperfectGrain}}
- </td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">等级</td>
- <td class="col">{{_item.qualityInspectionManagement?_item.qualityInspectionManagement.grade:''}}
- </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">
- {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.jiaorenli:''}}</td>
- <td class="col col-bgc">质检时间</td>
- <td class="col">
- {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.qualityDate:''}}</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.buckleMiscellaneous:''}}
- </td>
- <td class="col col-bgc">仓位号</td>
- <td class="col">{{_item.binNumber.indexOf("托盘") !=
- -1?_item.binNumber.replace("托盘",""):_item.binNumber}}</td>
- </tr>
- <tr class="row">
- <td class="col col-bgc">毛重</td>
- <td class="col">{{_item.grossWeight}}</td>
- <td class="col col-bgc">皮重</td>
- <td class="col">{{_item.tare}}</td>
- <td class="col col-bgc">扣重</td>
- <td class="col">{{_item.buckleMiscellaneous}}</td>
- <td class="col col-bgc">净重</td>
- <td class="col">{{_item.netWeight}}</td>
- <td class="col " colspan="2"></td>
- </tr>
- <tr class="row">
- <td class="col col-bgc" colspan="1">毛检时间</td>
- <td class="col" colspan="1">{{_item.grossDate}}</td>
- <td class="col col-bgc" colspan="1"> 皮检时间</td>
- <td class="col" colspan="1">{{_item.tareDate}}</td>
- <td class="col col-bgc" colspan="1"> 记事</td>
- <td class="col" colspan="3">货权所有人:{{_item.compName}}</td>
- </tr>
- </table>
- <div class="bottom">
- <!-- <div class="bottom-row1">
- <div>毛检:{{_item.secretaryWeigher}}</div>
- <div style="margin-left:60px">皮检:{{_item.skinInspector}}</div>
- </div> -->
- <div class="bottom-row2">
- <!-- <div class="left">
- <img :src="tableData.codeUrl" alt="">
- </div> -->
- <div class="config">质检员:</div>
- <div class="autograph">检斤员:</div>
- <div class="autograph">发货单位:</div>
- <div class="autograph">司机签名:</div>
- </div>
- <!-- <div class="bottom-row3">扫一扫</div> -->
- </div>
- </div>
- </div>
- <div class="small-content" v-if="smallContent">
- <div class="small-title">
- <div class="numberNo">{{tableData.number.substring(tableData.number.length - 3)}}</div>
- <div style="margin: auto;">粮食检斤单</div>
- </div>
- <img :src="tableData.codeUrl" alt="" class="small-code">
- <div class="small-row">
- <div>业务编号</div>
- <div>{{tableData.number}}</div>
- </div>
- <div class="small-row" v-if="tableData.serviceManagementType == 3">
- <div>客户姓名</div>
- <div>{{tableData.customer}}</div>
- </div>
- <div class="small-row" v-if="tableData.serviceManagementType == 3">
- <div>客户电话</div>
- <div>{{tableData.customerPhone}}</div>
- </div>
- <div class="small-row" v-if="tableData.serviceManagementType == 1">
- <div>发货单位</div>
- <div>{{tableData.contractManagement ? tableData.contractManagement.seller : ""}}</div>
- </div>
- <div class="small-row" v-if="tableData.serviceManagementType == 1">
- <div>联系电话</div>
- <div>{{tableData.contractManagement ? tableData.contractManagement.sellerPhone : ""}}</div>
- </div>
- <div class="small-row">
- <div>车牌号</div>
- <div>{{tableData.carNumber}}</div>
- </div>
- <div class="small-row">
- <div>仓位号:</div>
- <div>{{tableData.binNumber.indexOf("托盘")!= -1?tableData.binNumber.replace("托盘",""):tableData.binNumber}}
- </div>
- </div>
- <div class="small-row">
- <div>收货单位</div>
- <div>{{tableData.compName}}</div>
- </div>
- <div class="small-row">
- <div>联系人</div>
- <div>{{tableData.person}}</div>
- </div>
- <div class="small-row">
- <div>联系电话</div>
- <div>{{tableData.personPhone}}</div>
- </div>
- <div class="small-row">
- <div>货名</div>
- <div>{{tableData.goodsName}}</div>
- </div>
- <div class="small-row">
- <div>类型</div>
- <div>{{tableData.type}}</div>
- </div>
- <div class="small-row">
- <div>毛重(公斤)</div>
- <div>{{tableData.grossWeight}}</div>
- </div>
- <div class="small-row">
- <div>毛检时间</div>
- <div>{{tableData.grossDate}}</div>
- </div>
- <div class="small-row">
- <div>皮重(公斤)</div>
- <div>{{tableData.tare}}</div>
- </div>
- <div class="small-row">
- <div>皮检时间</div>
- <div>{{tableData.tareDate}}</div>
- </div>
- <div class="small-row"
- v-if="tableData.qualityInspectionManagement.paramType == 2 || tableData.serviceManagementType == 1">
- <div>扣重(公斤)</div>
- <div>{{tableData.buckleMiscellaneous}}</div>
- </div>
- <div class="small-row">
- <div>净重(公斤)</div>
- <div>{{tableData.netWeight}}</div>
- </div>
- <div class="small-row">
- <div>收货单位签名或盖章:</div>
- </div>
- </div>
- </div>
- </body>
- <script src="../cdn/vue/2.6.10/vue.min.js"></script>
- <script src="../cdn/element-ui/2.13.2/index.js"></script>
- <script src="../static/winseaview.min.js"></script>
- <script type="text/javascript" src="../static/html2canvas.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
- <script type="text/javascript">
- // import API_CONFIG from "../../../vue.config.js"
- new Vue({
- el: '#app',
- data: {
- tableData: {},
- tableData1: [],
- tableDataEW: [],
- selectPrint: false,
- name: "",
- bigContent: false,
- smallContent: false,
- pageType: '',
- isDDPrint: false,
- isEWPrint: false,
- imgUrl: "",
- serverIp: ""
- },
- 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() { },
- closeDialog() {
- var that = this
- if (location.host == "www.eliangeyun.com") {
- that.serverIp = "https://api2.eliangeyun.com"
- } else {
- that.serverIp = localStorage.getItem("serverIp")
- }
- if (that.tableData && that.tableData.length == 1) {//this.tableData 条数为1 认为单个打印
- html2canvas(document.querySelector("#saveImg"), { foreignObjectRendering: true, allowTaint: true }).then((canvas) => {
- let dataURL = canvas.toDataURL('image/png')
- that.imgUrl = dataURL
- if (that.imgUrl !== '') {
- let b = that.dataURLtoFile(that.imgUrl, 'printImage')
- let formdata = new FormData()
- formdata.append('file', b)
- axios({
- method: 'post',
- url: "https://api2.eliangeyun.com/appendix/admin",
- data: formdata,
- }).then((response) => {
- // 编辑接口
- that.weighingList = that.tableData[0]
- that.weighingList.pictureAddress = response.data.data.url
- axios({//皮重检斤接口
- method: 'post',
- url: that.serverIp + "/weighingManagement/api/editTare",
- data: that.weighingList,
- }).then((response) => {//入库单截图上传成功
- })
- })
- }
- })
- }
- },
- // async getImgBase64() {
- // var that = this
- // let ele = document.querySelector("#saveImg")
- // const width = ele.offsetWidth
- // const height = ele.offsetHeight
- // let canvas = await html2canvas(ele, {
- // scale: 2,
- // width,
- // height,
- // backgroundColor: "red",
- // foreignObjectRendering:true,
- // allowTaint:true
- // })
- // let dataURL = canvas.toDataURL('image/png')
- // that.imgUrl = dataURL
- // if (that.imgUrl !== '') {
- // let b = that.dataURLtoFile(that.imgUrl, 'printImage')
- // let formdata = new FormData()
- // formdata.append('file', b)
- // document.body.appendChild(canvas)
- // // axios({
- // // method: 'post',
- // // url: "https://api2.eliangeyun.com/appendix/admin",
- // // data: formdata,
- // // }).then((response) => {
- // // debugger
- // // })
- // }
- // }
- },
- updated() {
- this.closeDialog()
- // this.getImgBase64()
- },
- mounted() {
- let _data = {}
- if (localStorage.getItem('print_in_data')) {
- _data = localStorage.getItem('print_in_data')
- }
- else {
- _data = decodeURIComponent(this.getQueryVariable("tableData"))
- }
- // let _data = decodeURIComponent(this.getQueryVariable("tableData"))
- let _type = this.getQueryVariable("type")
- let _ew = this.getQueryVariable("selectEW")
- let _ewdd = this.getQueryVariable("selectEWDD")
- this.pageType = this.getQueryVariable("radioType")
- if (_type == 2) {
- this.bigContent = true
- this.smallContent = false
- } else {
- this.smallContent = true
- this.bigContent = false
- }
- if (_data == 'false') {
- console.log(222222)
- this.selectPrint = true;
- this.tableData1 = JSON.parse(localStorage.getItem('selectPrint_jjSelectPrintList'))
- if (_ew == 'true') {
- this.tableDataEW = JSON.parse(localStorage.getItem('selectPrint_EWjjSelectPrintList'))
- this.isEWPrint = true
- }
- if (_ewdd == 'true') {
- this.tableDataEW = JSON.parse(localStorage.getItem('selectPrint_EWjjSelectPrintList'))
- this.isDDPrint = true
- }
- } else {
- this.tableData = JSON.parse(_data.replace(/baifenhao/g, '%'))
- }
- // sessionStorage.setItem('record_print', JSON.stringify(response))
- // this.tableData = JSON.parse(sessionStorage.getItem("record_print")
- document.title = "粮食检斤单"
- window.onafterprint = function (event) {
- window.history.back(-1)
- };
- window.print()
- },
- watch: {}
- })
- </script>
- </html>
|