浏览代码

物料流转创建进度。header去掉头像和进度。

jiaxiaoqiang 9 月之前
父节点
当前提交
013e8fb643

+ 9 - 0
src/api/process/materialFlow.ts

@@ -8,6 +8,15 @@ export function getDestinationList(withStore: number) {
   });
 }
 
+// 获取rfid和工位上抽屉的状态
+export function getStationInfo(obj: object) {
+  return request({
+    url: `/api/v1/wms/common/queryStationInfo`,
+    method: "post",
+    data: obj,
+  });
+}
+
 // 根据仓库获取具体的坐标列表
 export function getStoreListByNo(no: string) {
   return request({

+ 1 - 0
src/api/user/types.ts

@@ -13,6 +13,7 @@ export interface UserInfo {
   deptId?: string;
   stationType?: string;
   notice?: boolean;
+  stationCode?: string;
 }
 
 /**

+ 22 - 21
src/layout/components/header.vue

@@ -26,32 +26,33 @@
             @click="messageStatus = !messageStatus"
           />
         </div>
-        <div class="task">
-          <el-progress
-            :percentage="processCount"
-            :show-text="false"
-            :stroke-width="10"
-          />
-          <div class="process">任务进度: {{ processCount }}%</div>
-        </div>
-        <div>
-          <div class="name">{{ userStore.user.username }}</div>
-          <div class="work">{{ userStore.user.station }}</div>
-        </div>
+        <!--        <div class="task">-->
+        <!--          <el-progress-->
+        <!--            :percentage="processCount"-->
+        <!--            :show-text="false"-->
+        <!--            :stroke-width="10"-->
+        <!--          />-->
+        <!--          <div class="process">任务进度: {{ processCount }}%</div>-->
+        <!--        </div>-->
+
         <el-dropdown
           ref="dropdown1"
           trigger="contextmenu"
           @command="handleCommand"
         >
-          <img
-            v-if="userStore.user.avatar"
-            :alt="userStore.user.avatar"
-            :src="userStore.user.avatar"
-            object-fit="cover"
-            style="width: 48px; height: 48px; border-radius: 24px"
-            @click="showClick"
-          />
-          <svg-icon v-else icon-class="head" size="48" @click="showClick" />
+          <div>
+            <div class="name">{{ userStore.user.username }}</div>
+            <div class="work">{{ userStore.user.station }}</div>
+          </div>
+          <!--          <img-->
+          <!--            v-if="userStore.user.avatar"-->
+          <!--            :alt="userStore.user.avatar"-->
+          <!--            :src="userStore.user.avatar"-->
+          <!--            object-fit="cover"-->
+          <!--            style="width: 48px; height: 48px; border-radius: 24px"-->
+          <!--            @click="showClick"-->
+          <!--          />-->
+          <!--          <svg-icon v-else icon-class="head" size="48" @click="showClick" />-->
           <template #dropdown>
             <el-dropdown-menu style="width: 150px">
               <!--              <el-dropdown-item command="a">Action 1</el-dropdown-item>-->

+ 1 - 0
src/store/modules/user.ts

@@ -55,6 +55,7 @@ export const useUserStore = defineStore(
             user.value.roles = data.roles;
             user.value.deptId = data.deptId;
             user.value.stationType = data.stationType;
+            user.value.stationCode = data.stationCode;
             isGetAuth.value = true;
 
             user.value.perms = data.permissions ?? [];

+ 31 - 11
src/views/material-flow/creatTask.vue

@@ -5,16 +5,16 @@
         <div class="type-title">当前料箱</div>
 
         <div style="display: flex; margin-bottom: 15px">
-          <ScanCodeInput
-            v-model="currentBox"
-            :clearable="true"
-            placeholder="请扫描或输入料箱编号"
-            style="width: 50%"
-            @keyup.enter="enterBox"
-          />
+          <!--          <ScanCodeInput-->
+          <!--            v-model="currentBox"-->
+          <!--            :clearable="true"-->
+          <!--            placeholder="请扫描或输入料箱编号"-->
+          <!--            style="width: 50%"-->
+          <!--            @keyup.enter="enterBox"-->
+          <!--          />-->
           <div class="current-box">
-            <span class="left">{{ boxDetail?.name || "未绑定料箱" }}</span>
-            <span class="right">{{ boxDetail?.code || "未绑定料箱" }}</span>
+            <span class="left">料箱id: {{ boxDetail?.rfid ?? "" }}</span>
+            <!--            <span class="right">{{ boxDetail?.code || "未绑定料箱" }}</span>-->
           </div>
         </div>
 
@@ -94,7 +94,10 @@
             </div>
           </el-scrollbar>
         </div>
-        <el-button class="sureBtn el-button-big" type="primary" @click="createTask"
+        <el-button
+          class="sureBtn el-button-big"
+          type="primary"
+          @click="createTask"
           >创建任务
         </el-button>
       </el-col>
@@ -109,14 +112,19 @@ import {
   getBoxDetailByLabel,
   getDestinationList,
   getMaterialInfoByLabel,
+  getStationInfo,
 } from "@/api/process/materialFlow";
-import { useCommonStoreHook } from "@/store";
+import { useCommonStoreHook, useUserStore } from "@/store";
 
 const commonS = useCommonStoreHook();
+const userStore = useUserStore();
 const map = commonS.loadingMap;
 
 const currentBox = ref("");
 const boxDetail = ref<any>({});
+
+let currentTimer = -1;
+
 const enterBox = () => {
   currentBox.value = currentBox.value.trim();
   getBoxDetailByLabel(currentBox.value).then((res: any) => {
@@ -178,6 +186,18 @@ onMounted(() => {
   getDestinationList(1).then((res: any) => {
     destinationList.value = res.data;
   });
+
+  currentTimer = setInterval(() => {
+    getStationInfo({ stanCode: userStore.user.stationCode }).then(
+      (res: any) => {
+        boxDetail.value = res;
+      }
+    );
+  });
+});
+
+onBeforeUnmount(() => {
+  clearInterval(currentTimer);
 });
 
 const createTask = () => {