Explorar el Código

物流单新增导出装箱单功能,发货单打印材料功能可用调整

qymljy hace 7 meses
padre
commit
f37c133536

+ 1 - 1
src/HDrpManagement/dispatch/details/index.vue

@@ -19,7 +19,7 @@
       <div slot="tags">
       </div>
       <div slot="customOperationBef">
-        <printMaterials v-if="tool.checkAuth($route.name,'printMaterials')"></printMaterials>
+        <printMaterials v-if="tool.checkAuth($route.name,'printMaterials')" :disabled="mainData.status != '复核' && mainData.status != '关闭' "></printMaterials>
       </div>
       <div slot="customOperation">
         <Edit class="inline-16"  v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="onSuccess" />

+ 5 - 2
src/HDrpManagement/dispatch/modules/printMaterials.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <el-dropdown @command="addBtn">
-      <el-button type="primary" size="mini">
+    <el-dropdown @command="addBtn" :disabled="disabled">
+      <el-button :type="disabled?'':'primary'" size="mini" :disabled="disabled">
         {{$t(`打印资料`)}}<i class="el-icon-arrow-down el-icon--right"></i>
       </el-button>
       <el-dropdown-menu slot="dropdown">
@@ -57,6 +57,9 @@
 <script>
 export default {
   name: "printMaterials",
+  props:{
+    disabled:Boolean
+  },
   data(){
     return {
       drawer:false,

+ 6 - 1
src/HDrpManagement/logistics/details/index.vue

@@ -15,6 +15,9 @@
           @onEditSuccess="queryMainData($route.query.id)">
         <div slot="tags">
         </div>
+        <template slot="customOperationBef">
+          <print  v-if="tool.checkAuth($route.name,'exportPacking')"></print>
+        </template>
         <div slot="customOperation" >
           <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update')" :data="mainData" @onSuccess="queryMainData(),$refs.dispatch.listData()"/>
           <el-button type="primary" size="mini"  v-if="tool.checkAuth($route.name,'confirmRec') && mainData.status =='审核'" :disabled="mainData.status == '收货'" @click="onConfimRec">{{$t(`确认收货`)}}</el-button>
@@ -51,6 +54,7 @@
   import boxlist from './tabs/logisticsBox/logisticsBox.vue'
   import courierRecords from './tabs/courierRecords.vue'
   import erpInfo from './tabs/erpInfo.vue'
+  import print from '../modules/print'
   export default {
     name: "detail",
     data() {
@@ -69,7 +73,8 @@
       boxlist,
       courierRecords,
       Edit,
-      erpInfo
+      erpInfo,
+      print
     },
     methods:{
       async queryMainData(id) {

+ 151 - 0
src/HDrpManagement/logistics/modules/print.vue

@@ -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>