cz 1 年間 前
コミット
08080075e2
1 ファイル変更16 行追加2 行削除
  1. 16 2
      src/components/PDF/purchasePDFOneNew.vue

+ 16 - 2
src/components/PDF/purchasePDFOneNew.vue

@@ -249,8 +249,12 @@
           </tr>
           <tr>
             <td colspan="6" style="text-align: left">
-              <div v-if="item.remark" style="width: 720px; overflow: auto">
-                <span v-html="item.remark"></span>
+              <div
+                v-if="item.remark"
+                style="width: 720px; overflow: auto"
+                class="img"
+              >
+                <div v-html="getHtmlStr(item.remark)"></div>
               </div>
               <div v-else style="height: 15px"></div>
             </td>
@@ -286,6 +290,16 @@ const getHtml = (str) => {
   }
 };
 
+const getHtmlStr = (str) => {
+  if (str) {
+    let newStr = str.replace(
+      /<img\b/gi,
+      "<img style='max-width:720px; object-fit: contain;'"
+    );
+    return newStr;
+  }
+};
+
 const handlePrintPdf = (row) => {
   loading.value = true;
   proxy.post("/ehsdPurchase/detail", { id: row.id }).then((res) => {