From bb56b2b6f21acb7c69c02585e5bc534d2f67715f Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 27 三月 2025 17:13:35 +0800
Subject: [PATCH] WMS首页优化,WCS优化AGV和产线、输送线交互逻辑
---
项目代码/WMS/WIDESEA_WMSClient/src/views/Home.vue | 300 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 290 insertions(+), 10 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
index 820437a..bcc2fa7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
@@ -1,24 +1,304 @@
<template>
- <div class="title"></div>
+ <div>
+ <!-- height:40px -->
+ <div class="title">搴撲綅骞抽潰鍥�</div>
+
+ <!-- <div>鍙樉绀轰竴涓尯鍩熺殑涓�涓爢鍨涙満瀵瑰簲鐨勭姸鎬�</div> -->
+ <div class="main" :style="{ height: mian_height }">
+ <!-- 骞抽潰鍥炬樉绀哄尯鍩� -->
+ <div class="right">
+ <div v-for="layer in locationData" :key="layer.index">
+ <div class="row_tip">绗瑊{ layer.index }}灞�</div>
+ <div class="row" v-for="row in layer.rows" :key="row.index">
+ <el-tooltip
+ v-for="col in row.cols"
+ :key="col.column"
+ effect="dark"
+ :content="getTooltipContent(col)"
+ placement="top"
+ :show-after="200"
+ :hide-after="0"
+ ><div
+ class="item"
+ :style="{ 'background-color': GetBgColor(col) }"
+ >
+ {{ row.index }}-{{ col.column }}-{{ layer.index }}
+ </div>
+ </el-tooltip>
+ </div>
+ </div>
+ </div>
+
+ <!-- 閫夋嫨鎻愮ず鍖哄煙 -->
+ <div class="left">
+ <!-- <div>鍖哄煙锛�</div>
+ <el-select
+ size="mini"
+ filterable
+ v-model="Area.shelf_code"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="item in slectData"
+ :value="item.shelf_code"
+ :label="item.house_name"
+ :key="item.house_name"
+ ></el-option>
+ </el-select> -->
+ <!-- <div class="tipText">鍫嗗灈鏈猴細</div>
+ <el-select
+ size="mini"
+ clearable
+ filterable
+ @change="SCChange"
+ v-model="Area.tunnel"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="item in scList"
+ :value="item"
+ :label="item"
+ :key="item"
+ ></el-option>
+ </el-select> -->
+ <!-- <div class="tipText">灞傦細</div>
+ <el-select
+ size="mini"
+ clearable
+ filterable
+ @change="SCChange"
+ v-model="Area.layer"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="item in layers"
+ :value="item"
+ :label="item"
+ :key="item"
+ ></el-option>
+ </el-select> -->
+ <br />
+ <ElButton type="success" class="btn" @click="GetViewData"
+ >鍒锋柊</ElButton
+ >
+
+ <div style="margin-top: 80px">
+ <div>璇存槑</div>
+ <div v-for="item in infoMsg" :key="item.bgcolor">
+ <div class="infoMsg" :style="{ 'background-color': item.bgcolor }">
+ {{ item.msg }}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
</template>
<script>
-import { ref, reactive } from 'vue'
+import { ElButton } from "element-plus";
export default {
- setup() {
+ data() {
return {
-
- }
- }
-}
+ slectData: [],
+ scList: [],
+ layers: [],
+ Area: { house_name: "", tunnel: "", shelf_code: "" },
+ mian_height: "",
+ infoMsg: [
+ { bgcolor: "lightgreen", msg: "绌鸿揣浣�", state: 0 },
+ { bgcolor: "orange", msg: "鏈夎揣", state: "Stored" },
+ { bgcolor: "#2BB3D5", msg: "鎵ц涓�", state: "InAssigned" },
+ { bgcolor: "#ccc", msg: "绂佺敤", state: "Lock" },
+ { bgcolor: "red", msg: "寮傚父", state: "error" },
+ { bgcolor: "#b7ba6b", msg: "绌烘墭", state: 99 },
+ ],
+ locationData: [],
+ };
+ },
+ computed: {
+ GetBgColor() {
+ return (col) => {
+ var bgColor = "#b7ba6b";
+ //浼樺厛鏄剧ず绂佺敤鐘舵��
+ if (col.enalbeStatus == 3) {
+ this.infoMsg.forEach((el) => {
+ if (el.state == "Lock") {
+ bgColor = el.bgcolor;
+ }
+ });
+ } else {
+ this.infoMsg.forEach((el) => {
+ if (
+ col.locationStatus == 4 ||
+ col.locationStatus == 6 ||
+ col.locationStatus == 7
+ ) {
+ if (el.state == "InAssigned") {
+ bgColor = el.bgcolor;
+ }
+ } else if (col.locationStatus == 2 || col.locationStatus == 3) {
+ if (el.state == "Stored") {
+ bgColor = el.bgcolor;
+ }
+ } else if (el.state == col.locationStatus) {
+ bgColor = el.bgcolor;
+ }
+ });
+ }
+ return bgColor;
+ };
+ },
+ },
+ watch: {
+ //鍒囨崲搴撳尯
+ "Area.shelf_code"(newValue, oldValue) {
+ this.scList = [];
+ this.layers = [];
+ this.slectData.forEach((e) => {
+ if (e.areaName == newValue) {
+ this.Area.tunnel = e.tunnel[0];
+ this.scList = e.tunnel;
+ this.Area.layer = "绗�" + e.layers[0] + "灞�";
+ this.layers = e.layers;
+ }
+ });
+ this.GetViewData();
+ },
+ },
+ methods: {
+ getTooltipContent(col) {
+ return `鐘舵��: ${this.getStatusText(col.locationStatus)}
+ 鍚敤鐘舵��: ${this.getEnableStatusText(col.enalbeStatus)}
+ 鎵樼洏鍙�: ${col.palletNo || "鏃�"}`;
+ },
+ getStatusText(status) {
+ const statusMap = {
+ 0: "绌鸿揣浣�",
+ 2: "鏈夎揣",
+ 3: "鏈夎揣",
+ 4: "鎵ц涓�",
+ 6: "鎵ц涓�",
+ 7: "鎵ц涓�",
+ 99: "绌烘墭",
+ };
+ return statusMap[status] || "鏈煡鐘舵��";
+ },
+ getEnableStatusText(status) {
+ const enableMap = {
+ 1: "姝e父",
+ 3: "绂佺敤",
+ };
+ return enableMap[status] || "鏈煡";
+ },
+ GetViewData() {
+ var _this = this;
+ this.http
+ .post("/api/StockView/GetLocationStockView", {}, "鏌ヨ涓�")
+ .then((x) => {
+ _this.locationData = x.data;
+ // console.log("鍚庣杩斿洖:", x.data);
+ // console.log("杩斿洖鏁版嵁:", _this.locationData);
+ });
+ },
+ // 鍒囨崲鍫嗗灈鏈�
+ SCChange() {
+ this.GetViewData();
+ },
+ },
+ mounted() {
+ var mainHeight = document.getElementById("vol-main");
+ this.mian_height = mainHeight.offsetHeight - 40 + "px";
+ var _this = this;
+ //鍔犺浇涓嬫媺閫夐」
+ this.http
+ .get("/api/LocationInfo/GetLocationLayer", {}, "鏌ヨ涓�")
+ .then((x) => {
+ _this.slectData = x;
+ //鍔犺浇绗竴涓尯鍩燂紝绗竴涓爢鍨涙満
+ _this.Area.shelf_code = _this.slectData[0].areaName;
+ _this.scList = _this.slectData[0].tunnel;
+ _this.layers = _this.slectData[0].layers;
+ });
+ this.GetViewData();
+ },
+ components: { ElButton },
+};
</script>
<style scoped>
+.left {
+ height: 100%;
+ float: left;
+ width: 18%;
+ /* background: lightblue; */
+ padding-top: 20px;
+ padding-left: 20px;
+}
+
+.right {
+ padding: 9px;
+ height: 98%;
+ overflow-y: auto;
+ overflow-x: auto;
+ float: left;
+ width: 82%;
+ padding-top: 5px;
+}
+
.title {
- line-height: 70vh;
text-align: center;
- font-size: 28px;
- color: orange;
+ padding: 5px 0px;
+ font-size: 20px;
+ font-weight: bold;
+ width: 82%;
+}
+
+.row_tip {
+ font-size: 16px;
+ padding-left: 5px;
+}
+
+.row {
+ overflow: auto;
+ margin-bottom: 11px;
+}
+
+.item {
+ float: left;
+ width: 66px;
+ height: 38px;
+ margin: 3px;
+ background-color: lightblue;
+ text-align: center;
+ font-size: 14px;
+ border-radius: 3px;
+ line-height: 38px;
+}
+
+.tipText {
+ margin-top: 10px;
+}
+
+.btn {
+ margin-top: 15px;
+}
+
+.infoMsg {
+ float: left;
+ width: 63px;
+ height: 35px;
+ margin: 3px;
+ text-align: center;
+ font-size: 14px;
+ border-radius: 3px;
+ line-height: 38px;
+}
+</style>
+
+<style>
+.el-input {
+ width: 180px;
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3