Redeem 1 년 전
부모
커밋
2c901277d5
3개의 변경된 파일118개의 추가작업 그리고 2개의 파일을 삭제
  1. 40 1
      src/views/OYE/components/oYeInbound.vue
  2. 35 0
      src/views/OYE/components/oYeOutbound.vue
  3. 43 1
      src/views/OYE/components/oYeRealTimeInventory.vue

+ 40 - 1
src/views/OYE/components/oYeInbound.vue

@@ -59,6 +59,7 @@
           <el-input v-model="con1" style="width:200px" clearable></el-input>
         </el-form-item>
         <el-button type="primary" @click="search">查询</el-button>
+        <el-button type="primary" @click="exportExcel">导出</el-button>
         <el-button
           type="primary"
           @click="back"
@@ -71,6 +72,7 @@
     </div>
     <div class="table">
       <dilTable
+        @func="func"
         v-bind.sync="options"
         :showSummaryList="showSummaryList"
         :isshowSummary="true"
@@ -150,7 +152,9 @@ export default {
         'theoryWeight',
         'orderNetWeight'
       ],
-      queryMap: {}
+      queryMap: {},
+      tableData: [],
+      tableTop: []
     }
   },
   created() {
@@ -165,6 +169,41 @@ export default {
     this.getRequestUrl()
   },
   methods: {
+    func(res) {
+      console.log(res, 'res')
+      this.tableTop = res.columnData
+    },
+    exportExcel() {
+      //创建工作簿对象
+      let wb = XLSX.utils.book_new()
+      let data = []
+      let queryMap = {}
+      queryMap[this.screen] = this.con
+      queryMap[this.screen1] = this.con1
+      if (this.loginName != null) {
+        queryMap['consigneeName'] = this.loginName
+      }
+      if (this.orgCode == 'xiaoshouyewuyuan') {
+        queryMap['saler'] = getCookie('loginName')
+      }
+      queryMap.isExcel = 1
+      this.axios.post('/api/v1/wms/getOyeInboundResult', queryMap).then(res => {
+        this.tableData = res.data.data
+        this.tableData.forEach((item, index) => {
+          let temp = {}
+          this.tableTop.forEach(col => {
+            temp[col.label] = item[col.prop]
+          })
+          data.push(temp)
+        })
+        //将json数组转换成sheet
+        let table_sheet = XLSX.utils.json_to_sheet(data)
+        //为工作簿添加sheet
+        XLSX.utils.book_append_sheet(wb, table_sheet, '欧冶入库实绩')
+        //导出
+        XLSX.writeFile(wb, '欧冶入库实绩' + '.xlsx')
+      })
+    },
     returnClassName({ row, column, rowIndex, columnIndex }) {
       return {
         fontWeight: '500 !important',

+ 35 - 0
src/views/OYE/components/oYeOutbound.vue

@@ -59,6 +59,8 @@
           <el-input v-model="con1" style="width:200px" clearable></el-input>
         </el-form-item>
         <el-button type="primary" @click="search">查询</el-button>
+        <el-button type="primary" @click="exportExcel">导出</el-button>
+
         <el-button
           type="primary"
           @click="back"
@@ -152,6 +154,39 @@ export default {
     this.getRequestUrl()
   },
   methods: {
+    exportExcel() {
+      //创建工作簿对象
+      let wb = XLSX.utils.book_new()
+      let data = []
+      let queryMap = {}
+      queryMap[this.screen] = this.con
+      queryMap[this.screen1] = this.con1
+      if (this.loginName != null) {
+        queryMap['consigneeName'] = this.loginName
+      }
+      if (this.orgCode == 'xiaoshouyewuyuan') {
+        queryMap['saler'] = getCookie('loginName')
+      }
+      queryMap.isExcel = 1
+      this.axios
+        .post('/api/v1/wms/getOyeOutboundResult', queryMap)
+        .then(res => {
+          this.tableData = res.data.data
+          this.tableData.forEach((item, index) => {
+            let temp = {}
+            this.tableTop.forEach(col => {
+              temp[col.label] = item[col.prop]
+            })
+            data.push(temp)
+          })
+          //将json数组转换成sheet
+          let table_sheet = XLSX.utils.json_to_sheet(data)
+          //为工作簿添加sheet
+          XLSX.utils.book_append_sheet(wb, table_sheet, '欧冶出库实绩')
+          //导出
+          XLSX.writeFile(wb, '欧冶出库实绩' + '.xlsx')
+        })
+    },
     back() {
       this.$router.go(-1)
     },

+ 43 - 1
src/views/OYE/components/oYeRealTimeInventory.vue

@@ -35,6 +35,8 @@
           <el-input v-model="con1" style="width:200px" clearable></el-input>
         </el-form-item>
         <el-button type="primary" @click="search">查询</el-button>
+        <el-button type="primary" @click="exportExcel">导出</el-button>
+
         <el-button
           type="primary"
           @click="addEditTime"
@@ -46,6 +48,7 @@
     </div>
     <div class="table">
       <dilTable
+        @func="func"
         v-bind.sync="options"
         @radio-change="radioChange"
         :showSummaryList="showSummaryList"
@@ -247,7 +250,9 @@ export default {
       selectedRowData: {},
       updateInsertVisible: false,
       updateInsertForm: {},
-      showSummaryList: ['materialNumber', 'netWeight', 'theoryWeight']
+      showSummaryList: ['materialNumber', 'netWeight', 'theoryWeight'],
+      tableData: [],
+      tableTop: []
     }
   },
   computed: {
@@ -275,6 +280,43 @@ export default {
     this.getRequestUrl()
   },
   methods: {
+    func(res) {
+      console.log(res, 'res')
+      this.tableTop = res.columnData
+    },
+    exportExcel() {
+      //创建工作簿对象
+      let wb = XLSX.utils.book_new()
+      let data = []
+      let queryMap = {}
+      queryMap[this.screen] = this.con
+      queryMap[this.screen1] = this.con1
+      if (this.loginName != null) {
+        queryMap['consigneeName'] = this.loginName
+      }
+      if (this.orgCode == 'xiaoshouyewuyuan') {
+        queryMap['saler'] = getCookie('loginName')
+      }
+      queryMap.isExcel = 1
+      this.axios
+        .post('/api/v1/wms/getOyeRealTimeResult', queryMap)
+        .then(res => {
+          this.tableData = res.data.data
+          this.tableData.forEach((item, index) => {
+            let temp = {}
+            this.tableTop.forEach(col => {
+              temp[col.label] = item[col.prop]
+            })
+            data.push(temp)
+          })
+          //将json数组转换成sheet
+          let table_sheet = XLSX.utils.json_to_sheet(data)
+          //为工作簿添加sheet
+          XLSX.utils.book_append_sheet(wb, table_sheet, '欧冶实时库存')
+          //导出
+          XLSX.writeFile(wb, '欧冶实时库存' + '.xlsx')
+        })
+    },
     returnClassName({ row, column, rowIndex, columnIndex }) {
       return {
         fontWeight: '500 !important',