Parcourir la source

外协单导出

wangxin il y a 1 an
Parent
commit
cc415be70e
1 fichiers modifiés avec 18 ajouts et 16 suppressions
  1. 18 16
      src/views/business/outsource/index.vue

+ 18 - 16
src/views/business/outsource/index.vue

@@ -93,12 +93,16 @@
       >
         删除
       </el-button>
-      <!--
-			<el-button type="warning" icon="Download" @click="handleExport" v-hasPermi="['business:outsource:export']">
-				导出
-			</el-button>
-			<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
-			-->
+
+      <el-button
+        type="warning"
+        icon="Download"
+        :disabled="ids.length != 1"
+        @click="handleExport"
+        v-hasPermi="['business:outsource:export']"
+      >
+        导出
+      </el-button>
     </div>
 
     <!-- 渲染数据区 -->
@@ -239,7 +243,11 @@
 </template>
 
 <script setup name="Order">
-import { listOrder, delOrder } from "@/api/business/outsourcedOrder";
+import {
+  listOrder,
+  delOrder,
+  exportOutsource,
+} from "@/api/business/outsourcedOrder";
 import orderForm from "./form";
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
@@ -260,8 +268,8 @@ const queryParams = ref({
   pageSize: 10,
   formCode: null,
   formDate: null,
-  startTime:null,
-  endTime:null,
+  startTime: null,
+  endTime: null,
   supplierName: null,
   deliveryMethod: null,
   packagingMethod: null,
@@ -335,13 +343,7 @@ function handleDelete(row) {
 
 /** 导出按钮操作 */
 function handleExport() {
-  proxy.download(
-    "business/order/export",
-    {
-      ...queryParams.value,
-    },
-    `order_${new Date().getTime()}.xlsx`
-  );
+  exportOutsource({ id: ids.value[0] });
 }
 
 getList();