Selaa lähdekoodia

1.开发服务器端口设置2.检验页面。3.流转卡号组件添加双击复制功能

jiaxiaoqiang 10 kuukautta sitten
vanhempi
commit
448cbb0ab7

+ 1 - 1
.env.development

@@ -2,7 +2,7 @@
 NODE_ENV='development'
 
 # 应用端口
-VITE_APP_PORT = 3005
+VITE_APP_PORT = 3008
 
 # 代理前缀
 VITE_APP_BASE_API = '/dev-api'

+ 9 - 0
src/router/modules/process.ts

@@ -169,6 +169,15 @@ export default {
         back: true,
       },
     },
+    {
+      path: "checkOut",
+      component: () => import("@/views/pro-operation/check-out/index.vue"),
+      name: "checkOut",
+      meta: {
+        title: "检验",
+        back: true,
+      },
+    },
   ],
   beforeEnter: (to, from, next) => {
     const store = useUserStore();

+ 107 - 0
src/views/pro-operation/check-out/index.vue

@@ -0,0 +1,107 @@
+<template>
+  <div class="mainContentBox">
+    <div class="header">
+      <ScanCodeInput
+        v-model="inputValueC"
+        placeholder="请扫码或输入当前用户信息,按回车键确认"
+        style="width: 550px"
+        @keyup.enter="handleSubmit"
+      />
+      <div v-if="inputValueC" class="info">当前检验用户:{{ inputValueC }}</div>
+    </div>
+    <div class="bottom-container">
+      <el-tabs
+        v-model="activeName"
+        class="demo-tabs"
+        type="card"
+        @tab-click="handleClick"
+      >
+        <el-tab-pane
+          v-if="store.scanInfo.inspection == 0"
+          label="首检"
+          name="first"
+          >User
+        </el-tab-pane>
+        <el-tab-pane label="巡检" name="second">Config</el-tab-pane>
+        <el-tab-pane label="不检" name="third">Role</el-tab-pane>
+      </el-tabs>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import ScanCodeInput from "@/components/ScanCodeInput/index.vue";
+import { useProcessStore } from "@/store";
+
+const store = useProcessStore();
+const inputValueC = ref("");
+const handleSubmit = () => {
+  console.log(inputValueC.value);
+};
+
+onMounted(() => {
+  inputValueC.value = "";
+  console.log("mounted");
+});
+
+const activeName = ref("first");
+
+const handleClick = (tab: any, event: Event) => {
+  console.log(tab, event);
+};
+</script>
+
+<style lang="scss" scoped>
+.header {
+  height: 60px;
+  display: flex;
+  align-items: center;
+  justify-content: start;
+  border: 1px solid #ccc;
+
+  .info {
+    margin-left: 20px;
+    font-size: 16px;
+    color: #666;
+    font-weight: bold;
+  }
+}
+
+.bottom-container {
+  margin-top: 10px;
+  height: calc(100% - 70px);
+  border: 1px solid #ccc;
+}
+
+:deep(.el-tabs--card > .el-tabs__header .el-tabs__nav) {
+  background: rgba(0, 0, 0, 0.1);
+  border-radius: 16px 16px 16px 16px;
+  overflow: hidden;
+  border: 0;
+}
+
+:deep(.el-tabs--card > .el-tabs__header) {
+  height: 80px;
+  border: 0;
+  overflow: hidden;
+  border-radius: 16px 16px 16px 16px;
+}
+
+:deep(.el-tabs--card > .el-tabs__header .el-tabs__item) {
+  width: 290px;
+  height: 80px;
+  border-radius: 0;
+  font-weight: 500;
+  font-size: 24px;
+  overflow: hidden;
+  background: transparent;
+  border-color: transparent;
+}
+
+:deep(.el-tabs--card > .el-tabs__header .el-tabs__item.is-active) {
+  background: white;
+  border-radius: 16px 16px 16px 16px;
+  border-color: transparent;
+  overflow: hidden;
+}
+</style>

+ 7 - 0
src/views/pro-steps/components/operates.vue

@@ -53,6 +53,9 @@ const setIndex = (index: number) => {
     case "baogong":
       reportWorkRef.value?.openReportWorkDrawer();
       break;
+    case "jianyan":
+      router.push({ name: "checkOut" });
+      break;
     default:
       break;
   }
@@ -83,6 +86,10 @@ const stepComponents = ref([
     compentName: "报工",
     compentType: "baogong",
   },
+  {
+    compentName: "检验",
+    compentType: "jianyan",
+  },
 ]);
 </script>
 

+ 16 - 5
src/views/process/components/transferNum.vue

@@ -17,14 +17,14 @@
       <Transition>
         <div v-if="selectSeqArray.length > 0">
           <div
-            class="row"
-            @click="clickCardNum(index)"
             v-for="(item, index) in selectSeqArray"
             :key="index"
+            class="row"
+            @click="clickCardNum(index)"
           >
             <el-tooltip
-              effect="dark"
               :content="item.seqNo"
+              effect="dark"
               placement="left"
               trigger="hover"
             >
@@ -34,6 +34,7 @@
                     ? 'describeText active'
                     : 'describeText'
                 "
+                @dblclick="handleCopy(item.seqNo)"
                 >{{ item.seqNo }}</span
               >
             </el-tooltip>
@@ -62,9 +63,18 @@
 </template>
 
 <script lang="ts" setup>
-import { useDictionaryStore } from "@/store";
-import { useProcessStore } from "@/store";
+import { useDictionaryStore, useProcessStore } from "@/store";
 import { Transition } from "vue";
+import { useClipboard } from "@vueuse/core";
+
+const { copy, isSupported } = useClipboard();
+const handleCopy = (text: string) => {
+  if (isSupported) {
+    copy(text);
+    ElMessage.success("复制成功");
+  }
+};
+
 const store = useProcessStore();
 const dictS = useDictionaryStore();
 const selectSeqIndex = inject("selectSeqIndex");
@@ -82,6 +92,7 @@ onMounted(() => {
 .success {
   color: #64bb5c;
 }
+
 .body {
   width: 100%;
   background-color: white;