|
|
@@ -0,0 +1,151 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="mini" @click="addBtn">
|
|
|
+ {{$t(`导出装箱单`)}}
|
|
|
+ </el-button>
|
|
|
+ <el-drawer
|
|
|
+ :visible.sync="drawer"
|
|
|
+ :with-header="false"
|
|
|
+ direction="rtl"
|
|
|
+ size="50%"
|
|
|
+ append-to-body>
|
|
|
+ <div class="detail__panel container">
|
|
|
+ <p class="normal-title" style="margin-bottom:16px">{{$t(drawerTitle)}}</p>
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="list"
|
|
|
+ :height="heightTable"
|
|
|
+ border
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ :label="$t(`报表名称`)">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="operation"
|
|
|
+ :label="$t(`操作`)"
|
|
|
+ width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="printBtn(scope.row)" type="text" size="mini">{{$t('打 印')}}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div style="margin-top:10px;text-align:right" >
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="param.content.pageNumber"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ :page-size="20"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "print",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ drawer:false,
|
|
|
+ list:[],
|
|
|
+ drawerTitle:'',
|
|
|
+ param:{
|
|
|
+ "id": 20230109155204,
|
|
|
+ "content": {
|
|
|
+ "sa_logisticsid":'',
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ heightTable:260 + 'px',
|
|
|
+ loading:false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ addBtn(){
|
|
|
+ this.idName = 'sa_logistics_boxid'
|
|
|
+ this.drawerTitle = '打印装箱单'
|
|
|
+ this.param.content.pageNUmber = 1
|
|
|
+ this.drawer = true
|
|
|
+ this.loading = true
|
|
|
+ this.heightTable = 'calc(100vh - 160px)'
|
|
|
+ this.listData()
|
|
|
+ this.queryReportId()
|
|
|
+ },
|
|
|
+ async queryReportId(){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20221213094401",
|
|
|
+ "content": {
|
|
|
+ "isExport":0,
|
|
|
+ "pageNumber":1,
|
|
|
+ "pageSize":100,
|
|
|
+ "systemappid": 163,
|
|
|
+ "where":{
|
|
|
+ "condition":'装箱单-HY'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ if (res.code == 0){
|
|
|
+ this.tool.showMessage(res,()=>{})
|
|
|
+ }else {
|
|
|
+ res.data.forEach(item=>{
|
|
|
+ this.sys_reportid = item.sys_reportid
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async listData(){
|
|
|
+ this.param.content.sa_logisticsid = this.$route.query.id
|
|
|
+ const res = await this.$api.requested(this.param)
|
|
|
+ let tableData = res.data.map(item=>{
|
|
|
+ return {
|
|
|
+ name:'箱码' + item.boxnum + '_装箱单',
|
|
|
+ sa_logistics_boxid:item.sa_logistics_boxid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.list = tableData
|
|
|
+ this.total = res.total
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
+ this.loading = false
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.param.content.pageSize = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.param.content.pageNumber = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ async printBtn (data) {
|
|
|
+ this.dataid = data.sa_logistics_boxid
|
|
|
+ let res = await this.$api.requested({
|
|
|
+ "id":20221213094501,
|
|
|
+ "content": {
|
|
|
+ sys_reportid:this.sys_reportid,
|
|
|
+ dataid:this.dataid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,() => {
|
|
|
+ // window.open(this.tool.getBaseUrl() + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
+ window.open('http://61.164.207.46:8000' + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|