ソースを参照

生产执行改造

dengrui 1 ヶ月 前
コミット
4413740220

+ 1 - 1
.env.development

@@ -8,7 +8,7 @@ VITE_APP_PORT = 3005
 VITE_APP_BASE_API = '/dev-api'
 
 # 上传文件接口地址
-VITE_APP_UPLOAD_URL = 'http://192.168.1.4:9000'
+VITE_APP_UPLOAD_URL = 'http://192.168.1.3:9000'
 
 # 开发接口地址
 VITE_APP_API_URL = 'http://192.168.1.3:8079'

+ 2 - 4
src/components/PDFView/index.vue

@@ -91,11 +91,9 @@ const showPdf = () => {
   visible.value = true;
 };
 const rendered = () => {
-  const clickableElementsA = document.querySelectorAll(
-    ".el-drawer__body .vue-pdf-embed div"
-  );
+  const clickableElementsA = document.querySelectorAll(".vue-pdf-embed div");
   const clickableElements = document.querySelectorAll(
-    ".el-drawer__body .vue-pdf-embed .vue-pdf-embed__page"
+    ".vue-pdf-embed .vue-pdf-embed__page"
   );
   clickableElementsA.forEach((element) => {
     element.style.display = "flex";

+ 289 - 0
src/components/PDFViewFull/index.vue

@@ -0,0 +1,289 @@
+<template>
+  <el-button
+    v-if="contentType === 'button'"
+    :type="btnType"
+    :link="isLink"
+    @click="showPdf"
+  >
+    {{ btnText }}
+  </el-button>
+  <div
+    v-if="needToShowPdf"
+    v-show="visible"
+    class="midPopUp"
+    @click="visible = false"
+    style="z-index: 999999999999 !important"
+  >
+    <div
+      class="popView"
+      style="
+        width: 90vw;
+        height: 90vh;
+        background-color: black;
+
+        overflow: hidden;
+      "
+      @click.stop
+    >
+      <div
+        v-show="loading"
+        style="
+          font-size: 30px;
+          font-weight: 600;
+          width: 100%;
+          height: 100%;
+          text-align: center;
+          line-height: 90vh;
+          color: white;
+        "
+      >
+        加载中..
+      </div>
+      <div
+        style="
+          height: 40px;
+          line-height: 40px;
+          font-size: 30px;
+          font-weight: 600;
+          padding-left: 20px;
+          color: white;
+          display: flex;
+          justify-content: space-between;
+        "
+      >
+        <div>共{{ pageLength }}页</div>
+        <div>
+          <el-button
+            type="primary"
+            style="font-size: 20px; margin-right: 20px"
+            @click="visible = false"
+            link
+            >关闭</el-button
+          >
+        </div>
+      </div>
+      <el-scrollbar
+        style="height: calc(90vh - 40px); width: 90vw; padding: 0px 20px"
+      >
+        <VuePdfEmbed
+          v-if="showVisible"
+          :source="{
+            url: pdfSource,
+            cMapUrl: '/cmaps/',
+            cMapPacked: true,
+          }"
+          @loaded="renderedShow"
+          @rendered="
+            showVisible = false;
+            showELStatus = true;
+          "
+          :page="1"
+          annotation-layer
+          text-layer
+        />
+
+        <template v-for="(item, index) in pageLength" :key="index">
+          <el-scrollbar v-if="showELStatus">
+            <VuePdfEmbed
+              v-if="showELStatus"
+              :source="{
+                url: pdfSource,
+                cMapUrl: '/cmaps/',
+                cMapPacked: true,
+              }"
+              :page="index + 1"
+              @rendered="index + 1 === pageLength ? rendered() : null"
+              annotation-layer
+              text-layer
+            />
+          </el-scrollbar>
+          <div
+            style="
+              width: 100%;
+              text-align: center;
+              font-size: 24px;
+              font-weight: bold;
+              margin: 20px 0;
+              color: white;
+            "
+          >
+            第 {{ index + 1 }} 页,共 {{ pageLength }} 页
+          </div>
+        </template>
+      </el-scrollbar>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import VuePdfEmbed from "vue-pdf-embed";
+// essential styles
+import "vue-pdf-embed/dist/style/index.css";
+
+// optional styles
+import "vue-pdf-embed/dist/style/annotationLayer.css";
+import "vue-pdf-embed/dist/style/textLayer.css";
+import { render } from "nprogress";
+
+// either URL, Base64, binary, or document proxy
+const props = defineProps({
+  pdfSource: {
+    type: String,
+    required: true,
+  },
+  pageNumber: {
+    type: Number,
+    default: 0,
+  },
+  needToShowPdf: {
+    type: Boolean,
+    default: false,
+  },
+  contentType: {
+    type: String as PropType<"button" | "pdf">,
+    default: "pdf",
+  },
+  btnText: {
+    type: String,
+    default: "预览",
+  },
+  btnType: {
+    type: String,
+    default: "primary",
+  },
+  isLink: {
+    type: Boolean,
+    default: false,
+  },
+  showPdfNumber: {
+    type: Number,
+    default: 0,
+  },
+});
+const loading = ref(true);
+const pageLength = ref(0);
+const pageStatus = ref(true);
+const renderedShow = (pdf: any) => {
+  pageLength.value = pdf.numPages;
+  pageStatus.value = false;
+  console.log(pageLength.value);
+};
+const visible = ref(false);
+const showVisible = ref(false);
+const showPdf = () => {
+  visible.value = true;
+  showVisible.value = true;
+};
+const showELStatus = ref(false);
+const rendered = () => {
+  loading.value = false;
+  // const clickableElementsA = document.querySelectorAll(".vue-pdf-embed div");
+  // const clickableElements = document.querySelectorAll(
+  //   ".vue-pdf-embed .vue-pdf-embed__page"
+  // );
+  // clickableElementsA.forEach((element) => {
+  //   element.style.display = "flex";
+  //   element.style.alignItems = "center";
+  //   element.style.justifyContent = "center";
+  // });
+  // clickableElements.forEach((element, index) => {
+  //   let rotationAngle = 0;
+  //   element.addEventListener("click", () => {
+  //     const currentWidth = element.offsetWidth;
+  //     const currentHeight = element.offsetHeight;
+  //     const parent = element.parentNode;
+  //     let distance = 0;
+  //     if (currentHeight > currentWidth) {
+  //       distance = currentHeight - currentWidth;
+  //     } else {
+  //       element.style.width = `${currentHeight}px`;
+  //       element.style.height = `${currentWidth}px`;
+  //     }
+  //     rotationAngle = (rotationAngle + 90) % 360;
+  //     if (rotationAngle == 0) {
+  //       if (distance > 0) {
+  //         element.style.transform = `rotate(${rotationAngle}deg) `;
+  //         element.firstElementChild.style.transform = `translateY(0px) `;
+  //       } else {
+  //         element.style.transform = `rotate(${rotationAngle}deg) `;
+  //         element.firstElementChild.style.transform = `translateY(0px) `;
+  //       }
+  //     }
+  //     if (rotationAngle == 90) {
+  //       if (distance > 0) {
+  //         element.style.transform = `rotate(${rotationAngle}deg)`;
+  //         element.firstElementChild.style.transform = `translateY(-${distance / 2}px) `;
+  //       } else {
+  //         element.style.transform = `rotate(${rotationAngle}deg)`;
+  //         element.firstElementChild.style.transform = `translateY(0px) `;
+  //       }
+  //     }
+  //     if (rotationAngle === 180) {
+  //       if (distance > 0) {
+  //         element.style.transform = `rotate(${rotationAngle}deg) `;
+  //         element.firstElementChild.style.transform = `translateY(0px) `;
+  //       } else {
+  //         element.style.transform = `rotate(${rotationAngle}deg) `;
+  //         element.firstElementChild.style.transform = `translateY(0px) `;
+  //       }
+  //     }
+  //     if (rotationAngle === 270) {
+  //       if (distance > 0) {
+  //         element.style.transform = `rotate(${rotationAngle}deg) `;
+  //         element.firstElementChild.style.transform = `translateY(${distance / 2}px) `;
+  //       } else {
+  //         element.style.transform = `rotate(${rotationAngle}deg) `;
+  //         element.firstElementChild.style.transform = `translateY(0px) `;
+  //       }
+  //     }
+  //     parent.style.width = `${currentWidth}px`;
+  //     parent.style.height = `${currentHeight}px`;
+  //   });
+  //   element.addEventListener("wheel", function (event) {
+  //     const currentWidth = element.offsetWidth;
+  //     const currentHeight = element.offsetHeight;
+  //     const parent = element.parentNode;
+  //     if (event.ctrlKey) {
+  //       event.preventDefault();
+
+  //       // 获取当前的transform值并解析
+  //       const transform = getComputedStyle(element).transform;
+  //       let scale = 1,
+  //         rotate = 0;
+
+  //       if (transform && transform !== "none") {
+  //         const transformMatrix = new WebKitCSSMatrix(transform);
+  //         scale = Math.sqrt(
+  //           Math.pow(transformMatrix.a, 2) + Math.pow(transformMatrix.b, 2)
+  //         );
+  //         rotate =
+  //           Math.atan2(transformMatrix.b, transformMatrix.a) * (180 / Math.PI);
+  //       }
+
+  //       // 根据滚轮方向调整缩放级别
+  //       if (event.deltaY < 0) {
+  //         // 向上滚动,放大
+  //         scale += 0.1;
+  //       } else {
+  //         // 向下滚动,缩小
+  //         scale -= 0.1;
+  //       }
+  //       // 确保缩放级别不会变成负数或过小
+  //       scale = Math.max(0.1, Math.min(scale, 5));
+
+  //       // 应用新的缩放级别和原有的旋转角度
+  //       element.style.transform = `scale(${scale}) rotate(${rotate}deg)`;
+  //       //同步放大展示盒子
+  //       parent.style.width = `${currentWidth * scale}px`;
+  //       parent.style.height = `${currentHeight * scale}px`;
+  //     }
+  //   });
+  // });
+};
+</script>
+
+<style lang="scss" scoped>
+.a {
+  position: relative;
+}
+</style>

+ 7 - 7
src/styles/variables.scss

@@ -67,10 +67,10 @@ $p20: 20px;
   justify-content: center;
   align-items: center;
 }
-:deep(.el-table--fit) {
-  background-color: #000 !important;
-}
-:deep(.el-table__cell) {
-  background-color: #000 !important;
-  color: white;
-}
+// :deep(.el-table--fit) {
+//   background-color: #000 !important;
+// }
+// :deep(.el-table__cell) {
+//   background-color: #000 !important;
+//   color: white;
+// }

+ 30 - 9
src/views/prepare-complete-suit/firstPopUpView/bindingScan.vue

@@ -19,13 +19,21 @@
             <el-table-column prop="materialCode" label="物料编号" />
             <el-table-column prop="spec" label="规格" />
             <el-table-column prop="num" label="数量" align="center" />
-            <el-table-column prop="batchCode" label="流转卡号/批次号" align="center" />
+            <el-table-column
+              prop="batchCode"
+              label="流转卡号/批次号"
+              align="center"
+            />
             <el-table-column prop="" label="操作" align="center">
               <template #default="scope">
-                <el-popconfirm title="确认清空?" @confirm="tableDelete(scope.row.materialCode)" confirm-button-text="确定"
-                  cancel-button-text="取消">
+                <el-popconfirm
+                  title="确认清空?"
+                  @confirm="tableDelete(scope.row.materialCode)"
+                  confirm-button-text="确定"
+                  cancel-button-text="取消"
+                >
                   <template #reference>
-                    <span class="opera">清空</span>
+                    <span class="opera">新增</span>
                   </template>
                 </el-popconfirm>
               </template>
@@ -38,9 +46,16 @@
         <div class="scan">
           <div class="scanBox">
             <div class="titleText">搜索记录:</div>
-            <el-input clearable v-model="seachInput" placeholder="请输入已扫码" />
+            <el-input
+              clearable
+              v-model="seachInput"
+              placeholder="请输入已扫码"
+            />
           </div>
-          <div class="titleText" style="display: flex; justify-content: space-between">
+          <div
+            class="titleText"
+            style="display: flex; justify-content: space-between"
+          >
             扫码记录:<span>本次总扫码{{ scanAllNum }}次</span>
             <span>目前实际记录{{ recordArray.length }}次</span>
           </div>
@@ -70,8 +85,13 @@
 
       <div class="bottomBtn">
         <el-button class="leftBtn" @click="handleClose">取消</el-button>
-        <el-button class="rightBtn" :disabled="scanItemArray.length < 1" @click="handleSubmit"
-          type="primary">绑定</el-button>
+        <el-button
+          class="rightBtn"
+          :disabled="scanItemArray.length < 1"
+          @click="handleSubmit"
+          type="primary"
+          >绑定</el-button
+        >
       </div>
     </div>
   </div>
@@ -311,7 +331,8 @@ const handleSubmit = async () => {
 }
 
 :deep(.el-input__wrapper) {
-  box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color)) inset;
+  box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color))
+    inset;
   cursor: default;
   border-radius: 16px;
 

ファイルの差分が大きいため隠しています
+ 1021 - 31
src/views/pro-steps/index.vue