ezhizao_zx 11 månader sedan
förälder
incheckning
aebb2b07f1
1 ändrade filer med 19 tillägg och 16 borttagningar
  1. 19 16
      src/views/business/outsource/index.vue

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

@@ -130,6 +130,7 @@ import {
 } from "@/api/business/outsourcedOrder";
 import orderForm from "./form";
 import printJS from "print-js";
+import { nextTick } from "vue";
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
 const { delivery_method } = proxy.useDict("delivery_method");
@@ -211,16 +212,16 @@ function handleView(row) {
 /** 删除按钮操作 */
 function handleDelete(row) {
   const _ids = row.id || ids.value;
-    proxy.$modal
-      .confirm("是否确认删除选中的数据项?")
-      .then(function () {
-        return delOrder(_ids);
-      })
-      .then(() => {
-        getList();
-        proxy.$modal.msgSuccess("删除成功!");
-      })
-      .catch(() => {});
+  proxy.$modal
+    .confirm("是否确认删除选中的数据项?")
+    .then(function () {
+      return delOrder(_ids);
+    })
+    .then(() => {
+      getList();
+      proxy.$modal.msgSuccess("删除成功!");
+    })
+    .catch(() => { });
 }
 
 /** 导出按钮操作 */
@@ -243,12 +244,14 @@ function handlePrintCarrierCode() {
   getCarrierInfo(ids.value).then(res => {
     if (res.code === 200) {
       printCarriers.value = res.data
-      const imageGroup = document.getElementById("image-group");
-      printJS({
-        printable: "image-group", // 这里是你要打印内容的DOM元素的id
-        type: "html",
-        style: "@page { size: auto;  margin: 0mm; }", // 可以添加打印样式
-      });
+      nextTick(_ => {
+        const imageGroup = document.getElementById("image-group");
+        printJS({
+          printable: "image-group", // 这里是你要打印内容的DOM元素的id
+          type: "html",
+          style: "@page { size: auto;  margin: 0mm; }", // 可以添加打印样式
+        });
+      })
     }
   })
 }