Browse Source

Merge branch 'master' of http://192.168.101.4:3000/jiaxiaoqiang/JG-CLIENT-TEMP

# Conflicts:
#	src/api/process/callMateriel.ts
jiaxiaoqiang 1 year ago
parent
commit
3b895fca80

+ 7 - 0
src/api/process/callMateriel.ts

@@ -18,6 +18,13 @@ export function boxSuitDetailByBoxId(p: object) {
   });
 }
 
+export function accessoriesList(data: any) {
+  return request({
+    url: `/api/v1/base/accessories/material/accessoriesList`,
+    method: "post",
+    data: data,
+  });
+}
 // 未齐套叫料
 export function callNotFullSuit(p: object) {
   return request({

+ 64 - 0
src/components/MessageBox/index.vue

@@ -0,0 +1,64 @@
+<template>
+  <div v-show="modelValue" class="body">
+    <div class="item" @click="sendMessage">消息记录</div>
+    <el-scrollbar class="itemScrollbar">
+      <div class="item" v-for="item in 12"></div>
+    </el-scrollbar>
+  </div>
+</template>
+
+<script setup lang="ts">
+const porps = defineProps({
+  modelValue: {
+    type: Boolean,
+    default: false,
+  },
+});
+const messages = ref([]);
+const ws = new WebSocket(
+  `ws://192.168.101.4:8079/websocket/${localStorage.getItem("token")}`
+);
+const sendMessage = () => {
+  if (ws.readyState === WebSocket.OPEN) {
+    ws.send("确认啊啊啊啊");
+  } else {
+    console.error("WebSocket is not open");
+  }
+};
+ws.onopen = () => {
+  console.log("实时已连接");
+};
+ws.onmessage = (event) => {
+  const receivedMessage = event.data;
+  console.log("Received message:", receivedMessage);
+  messages.value.push(receivedMessage);
+};
+ws.onclose = () => {
+  console.log("实时连接断开");
+};
+const emits = defineEmits(["update:modelValue"]);
+</script>
+<style scoped lang="scss">
+.body {
+  width: 260px;
+  height: 40vh;
+  position: fixed;
+  right: 20px;
+  top: 80px;
+  z-index: 3;
+  background-color: red;
+  border-radius: 16px;
+  overflow: hidden;
+
+  .itemScrollbar {
+    height: calc(100% - 80px);
+  }
+
+  .item {
+    width: 100%;
+    height: 60px;
+    background-color: aqua;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 4 - 2
src/layout/components/header.vue

@@ -13,8 +13,8 @@
     </div>
     <div>
       <el-space>
-        <div class="">
-          <svg-icon icon-class="lingdang" size="48" class="activeNotice" />
+        <div>
+          <svg-icon @click="messageStatus = !messageStatus" icon-class="lingdang" size="48" class="activeNotice" />
         </div>
         <div class="task">
           <el-progress :percentage="processCount" :show-text="false" :stroke-width="10" />
@@ -38,6 +38,7 @@
         </el-dropdown>
       </el-space>
     </div>
+    <MessageBox v-model="messageStatus" />
   </div>
 </template>
 
@@ -61,6 +62,7 @@ const date = dayjs().format("YYYY-MM-DD");
 const time = ref(dayjs().format("HH:mm:ss"));
 
 const processCount = ref(50);
+const messageStatus = ref(false);
 
 const headUrl = ref("");
 

+ 120 - 72
src/views/pro-operation/call-materiel/desperse.vue

@@ -1,30 +1,42 @@
 <template>
   <div class="container-desperse">
-    <div class="left">2</div>
-    <div class="right">3</div>
-  </div>
-  <!-- <el-scrollbar>
-    <div class="grid-container">
+    <div class="left">
       <div
-        v-for="(box, index) in merterielBoxes"
+        class="box-item"
+        v-for="(box, index) in leftTrees"
         :key="index"
-        class="suit-box"
-        @click="testClick(index)"
+        :class="{ hoverEffect: index === leftTreeIndex }"
+        @click="changeRightEl(box, index)"
       >
-        <div>
-          <div class="suit-title">{{ box?.materialName }}</div>
-          <div class="suit-desc">{{ box?.spec }}</div>
-        </div>
-        <div>
-          <div>
-            <span class="suit-count">{{ box?.num }}</span>
-            <span class="suit-desc">{{ box?.unit }}</span>
+        {{ box.dictLabel }}
+      </div>
+    </div>
+    <div class="right">
+      <el-scrollbar>
+        <div class="grid-container">
+          <div
+            v-for="(box, index) in merterielBoxes"
+            :key="index"
+            class="suit-box"
+            @click="testClick(index)"
+          >
+            <div>
+              <div class="suit-title">{{ box?.materialName }}</div>
+              <div class="suit-desc">{{ box?.spec }}</div>
+            </div>
+            <div>
+              <div>
+                <span class="suit-count">{{ box?.totalNum }}</span>
+                <span class="suit-desc">{{ box?.unit }}</span>
+              </div>
+              <div class="suit-desc">当前库存</div>
+            </div>
           </div>
-          <div class="suit-desc">当前库存</div>
         </div>
-      </div>
-    </div> 
-  </el-scrollbar>-->
+      </el-scrollbar>
+    </div>
+  </div>
+
   <!-- <CallHistory ref="callHistoryRef" />
   <MarterielBoxDetail ref="materielBoxDetailRef" />
   <ChangeCount ref="changeCountRef" description="双面胶黑色" title="叫料数量" />
@@ -36,21 +48,43 @@
 // import MarterielBoxDetail from "@/views/pro-operation/call-materiel/components/materiel-box-detail.vue";
 // import ChangeCount from "@/components/CommonDialogs/ChangeCount.vue";
 // import ConfirmMessage from "@/components/CommonDialogs/ConfirmMessage.vue";
-// import { stockMaterialList } from "@/api/process/callMateriel";
-// import { useProcessStore } from "@/store/modules/processView";
-// import { useDictionaryStore } from "@/store/modules/dictionary";
+import { stockMaterialList, accessoriesList } from "@/api/process/callMateriel";
+import { useProcessStore } from "@/store/modules/processView";
+import { useDictionaryStore } from "@/store/modules/dictionary";
 
-// const processStore = useProcessStore();
-// const dictStore = useDictionaryStore();
-// const merterielBoxes = ref<any>([]);
+const processStore = useProcessStore();
+const dictStore = useDictionaryStore();
+const leftTrees = ref<any[]>([]);
+const leftTreeIndex = ref(0);
+const merterielBoxes = ref<any>([]);
+const changeRightEl = (row, index) => {
+  leftTreeIndex.value = index;
+  accessoriesDataList(index);
+};
+const testClick = () => {
+  console.log("here---in");
+};
+const accessoriesDataList = (index) => {
+  const firstObj = leftTrees?.value[index];
+  //dictLabel: "炼胶",dictSort: 1,dictValue: "1"
+  const queryAccessoriesParam = {
+    accessoriesType: firstObj.dictValue,
+    pageNo: 0,
+    pageSize: 1000,
+  };
 
-onMounted(() => {
-  // console.log("dictS.dicts", dictStore.dicts.accessories_type);
-  // merterielBoxes.value = dictStore.dicts.accessories_type.keys();
   // 获取数据
-  // stockMaterialList(processStore.scanInfo.materialCode).then((res) => {
-  //   merterielBoxes.value = res.data;
-  // });
+  accessoriesList(queryAccessoriesParam).then((res) => {
+    // console.log("onMounted", res.data);
+    merterielBoxes.value = res.data;
+  });
+};
+onMounted(() => {
+  console.log("dictS.dicts", dictStore.dicts.accessories_type);
+  leftTrees.value = dictStore?.dicts?.accessories_type;
+  if (leftTrees?.value) {
+    accessoriesDataList(0);
+  }
 });
 </script>
 
@@ -58,57 +92,71 @@ onMounted(() => {
 .container-desperse {
   display: flex;
   .left {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    flex-direction: column;
     width: 300px;
-    background-color: red;
+    .box-item {
+      border: 1px solid red;
+      width: 100%;
+      text-align: center;
+      line-height: 80px;
+      height: 80px;
+    }
+    .hoverEffect {
+      color: blue;
+      // text-decoration: underline;
+      // background-color: red;
+    }
   }
 
   .right {
     flex: 1;
     // margin-left: 12%;
-    background-color: black;
   }
 }
-// .grid-container {
-//   width: 100%;
-//   display: grid;
-//   /*行间距*/
-//   grid-row-gap: 24px;
-//   /*列间距*/
-//   grid-column-gap: 24px;
+.grid-container {
+  width: 100%;
+  display: grid;
+  /*行间距*/
+  grid-row-gap: 24px;
+  /*列间距*/
+  grid-column-gap: 24px;
 
-//   grid-template-columns: 1fr 1fr 1fr;
-//   overflow-y: auto;
+  grid-template-columns: 1fr 1fr 1fr;
+  overflow-y: auto;
 
-//   .suit-box {
-//     height: 210px;
-//     background-color: white;
-//     border-radius: 16px 16px 16px 16px;
-//     padding: 24px 30px;
-//     display: flex;
-//     flex-direction: column;
-//     align-items: start;
-//     justify-content: space-between;
-//     position: relative;
+  .suit-box {
+    height: 210px;
+    background-color: white;
+    border-radius: 16px 16px 16px 16px;
+    padding: 24px 30px;
+    display: flex;
+    flex-direction: column;
+    align-items: start;
+    justify-content: space-between;
+    position: relative;
 
-//     .suit-title {
-//       font-weight: 500;
-//       font-size: 20px;
-//       color: rgba(0, 0, 0, 0.9);
-//       text-align: left;
-//     }
+    .suit-title {
+      font-weight: 500;
+      font-size: 20px;
+      color: rgba(0, 0, 0, 0.9);
+      text-align: left;
+    }
 
-//     .suit-count {
-//       font-weight: bold;
-//       font-size: 38px;
-//       color: rgba(0, 0, 0, 0.9);
-//       text-align: left;
-//     }
+    .suit-count {
+      font-weight: bold;
+      font-size: 38px;
+      color: rgba(0, 0, 0, 0.9);
+      text-align: left;
+    }
 
-//     .suit-desc {
-//       font-size: 20px;
-//       color: rgba(0, 0, 0, 0.6);
-//       text-align: left;
-//     }
-//   }
-// }
+    .suit-desc {
+      font-size: 20px;
+      color: rgba(0, 0, 0, 0.6);
+      text-align: left;
+    }
+  }
+}
 </style>

+ 2 - 1
src/views/process/components/scanCode.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 扫码板块 -->
   <div class="icon">
-    <img class="imgIcon" src="@/assets/icons/shaoma.svg" @click="toProSteps" />
+    <img class="imgIcon" src="@/assets/icons/shaoma.svg" />
   </div>
   <div class="body">
     <ScanCodeInput v-model="inputValue" @keyup.enter="toProSteps" />
@@ -16,6 +16,7 @@ const store = useProcessStore();
 const router = useRouter();
 const inputValue = ref("");
 const toProSteps = () => {
+  if (inputValue.value == "") return ElMessage.error("二维码不能为空!");
   store.odersData.qrCode = inputValue.value;
   getScanData();
 };

+ 13 - 4
src/views/process/components/transferNum.vue

@@ -4,14 +4,16 @@
     <el-scrollbar class="scrollbar">
       <Empty v-if="selectSeqArray.length < 1" />
 
-      <div class="row" v-for="(item, index) in selectSeqArray" :key="index">
-        <el-tooltip effect="dark" :content="item.seqNo" placement="right" trigger="click" @click="clickCardNum(index)">
+      <div class="row" @click="clickCardNum(index)" v-for="(item, index) in selectSeqArray" :key="index">
+        <el-tooltip effect="dark" :content="item.seqNo" placement="right" trigger="click">
           <span :class="index == selectSeqIndex ? 'describeText active' : 'describeText'
             " style="cursor: pointer">{{ item.seqNo }}</span>
         </el-tooltip>
 
         <div class="status">
-          {{ dictS.getLableByValue("work_order_seq_state", item.state) }}
+          {{
+            dictS.getLableByValue("work_order_seq_state", String(item.state))
+          }}
         </div>
       </div>
     </el-scrollbar>
@@ -38,9 +40,16 @@ const clickCardNum = (index: number) => {
 
   .row {
     display: flex;
+    justify-content: space-between;
+    align-items: center;
+    vertical-align: center;
 
     .status {
-      width: 60px;
+      width: 100px;
+      font-size: $f24;
+      line-height: 24px;
+      margin-bottom: 10px;
+      text-align: center;
     }
   }
 }

+ 9 - 0
src/views/traceability/index.vue

@@ -0,0 +1,9 @@
+<template>
+  <div class="mainContentBox">生产履!</div>
+</template>
+
+<script lang="ts" setup></script>
+
+<style lang="scss" scoped>
+
+</style>