Explorar el Código

feat: 采购订单列表每行增加导出功能

liujt hace 9 meses
padre
commit
8352732768

+ 15 - 0
src/api/purchasingManage/purchaseOrder.js

@@ -146,3 +146,18 @@ export async function queryHistoricalUnitPrice(productId) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+/**
+ * 导出采购单
+ */
+export async function getExport(id) {
+  const res = await request.get(
+    `/eom/purchaseorder/export/${id}`,
+    {
+      responseType: 'blob'
+    },
+
+  );
+
+  download(res.data, '采购订单.xlsx');
+}

+ 18 - 2
src/views/purchasingManage/purchaseOrder/index.vue

@@ -173,6 +173,15 @@
                 >
                   新增发票
                 </el-link>
+                <el-link
+                  v-if="$hasPermission('eom:purchaseorder:rowExport')"
+                  type="primary"
+                  :underline="false"
+                  icon="el-icon-download"
+                  @click="exportRowInfo(row)"
+                >
+                  导出
+                </el-link>
               </template>
             </ele-pro-table>
           </div>
@@ -277,7 +286,8 @@
   import outSourceSend from './outSourceSend/index';
   import {
     getTableList,
-    deleteInformation
+    deleteInformation,
+    getExport
   } from '@/api/purchasingManage/purchaseOrder';
   import dictMixins from '@/mixins/dictMixins';
   import { purchaseOrderProgressStatusEnum, reviewStatus } from '@/enum/dict';
@@ -288,6 +298,7 @@
   import { parameterGetByCode } from '@/api/main/index.js';
   import exceptionList from '@/views/saleManage/saleOrder/exceptionManagement/exceptionList/index.vue';
   import { getToDoReminder } from '@/api/common/index';
+  import { exportTable } from '@/api/system/file/index.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -548,7 +559,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 230,
+            width: 260,
             align: 'center',
             resizable: false,
             slot: 'action',
@@ -705,6 +716,11 @@
         if (row.relationType == 4) {
           this.$refs.contractDetailRef.open(data);
         }
+      },
+      // 导出
+      exportRowInfo(row) {
+        console.log(row);
+        getExport(row.id);
       }
     }
   };