ooo 1 рік тому
батько
коміт
17564fea42

+ 26 - 11
src/views/base/craftManagement/route/components/bottomTable.vue

@@ -17,15 +17,24 @@
       @size-change="dataList"
       @current-change="dataList"
     >
-      <!-- <template #filePath-form="scope">
-        <single-upload v-model="form.filePath" />
-        <FilesUpload v-model:src="form.filePath" v-model:src-list="form.filePath" />
-      </template> -->
-      <!-- <template #filePath="{ row }">
-        <el-button link type="primary" @click.stop="imgUrlClick(row)">{{
-          row.filePath
-        }}</el-button>
-      </template> -->
+      <template #filePath-form="scope">
+        <!-- <single-upload v-model="form.filePath" />
+        <FilesUpload v-model:src="form.filePath" v-model:src-list="form.filePath" /> -->
+        <div style="height: 100px; width: 100px; overflow: hidden">
+          <PDFView
+            :need-to-show-pdf="true"
+            content-type="button"
+            :is-link="true"
+            :show-pdf-number="form.showAppointPageNum"
+            :pdf-source="getSourceUrl(form.filePath)"
+          />
+        </div>
+      </template>
+      <template #filePath="{ row }">
+        <el-button link type="primary" @click.stop="imgUrlClick(row)"
+          >查看PDF</el-button
+        >
+      </template>
     </avue-crud>
     <CommonTable
       ref="commonTableRef"
@@ -34,7 +43,7 @@
       @selected-sure="onSelectedFinish"
     />
     <el-dialog v-model="dialogVisible">
-      <img w-full :src="previewImgUrl" alt="Preview Image" />
+      <VuePdfEmbed :source="previewImgUrl" annotation-layer text-layer />
     </el-dialog>
   </div>
 </template>
@@ -42,6 +51,8 @@
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import { getTableConfig } from "./configs";
+import PDFView from "@/components/PDFView/index.vue";
+import VuePdfEmbed from "vue-pdf-embed";
 import {
   saveCompoents,
   getBomVersion,
@@ -75,6 +86,9 @@ const { selectionChange, multipleUpdate } = Methords; //选中和批量删除事
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const bomVersion = ref(null);
+const getSourceUrl = (filePath) => {
+  return import.meta.env.VITE_APP_UPLOAD_URL + filePath;
+};
 const startCreat = () => {
   if (props.tableType === "wuliaocaiji") {
     if (data.value && data.value.length > 0) {
@@ -181,7 +195,8 @@ const onSelectedFinish = (itemValue) => {
 const previewImgUrl = ref("");
 const dialogVisible = ref(false);
 const imgUrlClick = (itemValue) => {
-  previewImgUrl.value = itemValue.imgUrl;
+  previewImgUrl.value =
+    import.meta.env.VITE_APP_UPLOAD_URL + itemValue.filePath;
   dialogVisible.value = true;
 };
 

+ 1 - 1
src/views/base/craftManagement/route/components/configs.ts

@@ -179,7 +179,7 @@ export const getTableConfig = (id : string) => {
 
 				{ label: "标题", prop: "title", addDisabled: true, editDisabled: true },
 				{ label: "展示页数", prop: "showAppointPageNum", type: "number" },
-				{ label: "总页数", prop: "pageNum", type: "number" },
+				{ label: "总页数", prop: "pageNum", type: "number",hide: true,display: false, },
 				{
 					label: "版本号", prop: "recordVersion", type: "number", addDisabled: true, editDisabled: true,
 					rules: [

+ 3 - 3
src/views/pro/traceability/components/materialsCom.vue

@@ -92,13 +92,13 @@ option.value = Object.assign(option.value, {
       search: false,
     },
     {
-      label: "需求数量",
-      prop: "needNum",
+      label: "采集编码",
+      prop: "itemSeq",
       search: false,
     },
     {
       label: "已采集数量",
-      prop: "realNum",
+      prop: "num",
       search: false,
     },
   ],

+ 2 - 2
src/views/pro/traceability/index.vue

@@ -21,7 +21,7 @@
       </el-aside>
       <el-container>
         <el-header style="height: 20%">
-          <el-descriptions title="产品信息回顾" border>
+          <el-descriptions title="产品信息一览" border>
             <el-descriptions-item label="产品名称">{{
               productReviewInfo.materialName
             }}</el-descriptions-item>
@@ -35,7 +35,7 @@
               productReviewInfo.materialModel
             }}</el-descriptions-item>
             <el-descriptions-item label="铭牌号">-</el-descriptions-item>
-            <el-descriptions-item label="Remarks">
+            <el-descriptions-item label="是否返工">
               <el-tag size="small">否</el-tag>
             </el-descriptions-item>
             <el-descriptions-item label="工单出站">{{