| | |
| | | setup() { |
| | | // å®ä¹ä»åºå表 |
| | | const warehouses = [ |
| | | { name: 'æ¿æä»', component: BoardWarehouse }, |
| | | { name: 'æµè¯æ¶ä»', component: TestFrameWarehouse }, |
| | | { name: 'é»çä»', component: SolderMaskWarehouse }, |
| | | { name: 'PPä»', component: PpWarehouse }, |
| | | { name: 'æ¿æä»', component: BoardWarehouse }, |
| | | { name: 'æµè¯æ¶ä»', component: TestFrameWarehouse }, |
| | | { name: '油墨ä»', component: InkWarehouse }, |
| | | { name: 'è¾
æä»', component: AuxiliaryWarehouse }, |
| | | { name: 'æåä»', component: BoardWarehouse }, |
| | | { name: 'å¹²èä»', component: DryFilmWarehouse}, |
| | | ]; |
| | | |
| | |
| | | <template> |
| | | <div id="vol-container" :class="['vol-theme-' + theme]"> |
| | | <div class="vol-aside" :style="{ width: menuWidth + 'px' }"> |
| | | <div class="header" :style="{ width: menuWidth - 1 + 'px' }"> |
| | | <img v-show="!isCollapse" v-bind:src="logo" /> |
| | | <i |
| | | @click="toggleLeft" |
| | | class="collapse-menu" |
| | | :class="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" |
| | | /> |
| | | </div> |
| | | <div class="vol-menu"> |
| | | <el-scrollbar style="height: 100%"> |
| | | <VolMenu |
| | | :currentMenuId="currentMenuId" |
| | | :on-select="onSelect" |
| | | :enable="true" |
| | | :open-select="false" |
| | | :isCollapse="isCollapse" |
| | | :list="menuOptions" |
| | | ></VolMenu> |
| | | </el-scrollbar> |
| | | </div> |
| | | </div> |
| | | <div class="vol-container" :style="{ left: menuWidth - 1 + 'px' }"> |
| | | <div class="vol-header"> |
| | | <div class="project-name">WMS</div> |
| | | <div class="header-text"> |
| | | <div class="h-link"> |
| | | <a |
| | | href="javascript:void(0)" |
| | | @click="to(item)" |
| | | v-for="(item, index) in links.filter((c) => { |
| | | return !c.icon; |
| | | })" |
| | | :key="index" |
| | | > |
| | | <span v-if="!item.icon">{{ item.text }}</span> |
| | | <i v-else :class="item.icon"></i> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | <div class="header-info"> |
| | | <div class="h-link"> |
| | | <a |
| | | href="javascript:void(0)" |
| | | @click="to(item)" |
| | | v-for="(item, index) in links.filter((c) => { |
| | | return c.icon; |
| | | })" |
| | | :key="index" |
| | | > |
| | | <span v-if="!item.icon">{{ item.text }}</span> |
| | | <i v-else :class="item.icon"></i> |
| | | </a> |
| | | </div> |
| | | <!--æ¶æ¯ç®¡ç--> |
| | | <div class="h-link" @click="messageModel = true"> |
| | | <a> |
| | | <i class="el-icon-message-solid"> |
| | | <el-badge |
| | | :value="messageList.length" |
| | | :type="messageList.length > 0 ? 'danger' : 'success'" |
| | | class="item" |
| | | style="width: 10px" |
| | | ></el-badge> |
| | | </i> |
| | | </a> |
| | | </div> |
| | | <div class="login-container"> |
| | | <div class="project-name">WIDESEA_WMS</div> |
| | | <div class="login-form"> |
| | | <div class="form-user" @keypress="loginPress"> |
| | | <div class="login-text"> |
| | | <div> |
| | | <img class="user-header" :src="userImg" :onerror="errorImg" /> |
| | | <div>欢è¿ç»å½...</div> |
| | | <div class="login-line"></div> |
| | | </div> |
| | | <div class="user"> |
| | | <span>{{ userName }}</span> |
| | | <span id="index-date"></span> |
| | | <div style="flex: 1"></div> |
| | | </div> |
| | | <div class="settings"> |
| | | <i style="font-size: 20px" class="el-icon-s-tools" @click="drawer_model = true" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="vol-path"> |
| | | <el-tabs |
| | | @tab-click="selectNav" |
| | | @tab-remove="removeNav" |
| | | @contextmenu.prevent="bindRightClickMenu(false)" |
| | | type="border-card" |
| | | class="header-navigation" |
| | | v-model="selectId" |
| | | :strtch="false" |
| | | > |
| | | <el-tab-pane |
| | | v-for="(item, navIndex) in navigation" |
| | | type="card" |
| | | :name="navIndex + ''" |
| | | :closable="navIndex > 0" |
| | | :key="navIndex" |
| | | :label="item.name" |
| | | > |
| | | <span style="display: none">{{ navIndex }}</span> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <!-- å³é®èå --> |
| | | <div v-show="contextMenuVisible"> |
| | | <ul :style="{ left: menuLeft + 'px', top: menuTop + 'px' }" class="contextMenu"> |
| | | <li v-show="visibleItem.all"> |
| | | <el-button link @click="closeTabs()"> |
| | | <i class="el-icon-close"></i> |
| | | {{ |
| | | navigation.length == 2 ? "å
³éèå" : "å
³éææ" |
| | | }} |
| | | </el-button> |
| | | </li> |
| | | <li v-show="visibleItem.left"> |
| | | <el-button link @click="closeTabs('left')"> |
| | | <i class="el-icon-back"></i>å
³é左边 |
| | | </el-button> |
| | | </li> |
| | | <li v-show="visibleItem.right"> |
| | | <el-button link @click="closeTabs('right')"> |
| | | <i class="el-icon-right"></i>å
³éå³è¾¹ |
| | | </el-button> |
| | | </li> |
| | | <li v-show="visibleItem.other"> |
| | | <el-button link @click="closeTabs('other')"> |
| | | <i class="el-icon-right"></i>å
³éå
¶ä» |
| | | </el-button> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <div class="vol-main" id="vol-main"> |
| | | <el-scrollbar style="height: 100%" v-if="permissionInited"> |
| | | <loading v-show="$store.getters.isLoading()"></loading> |
| | | <router-view v-slot="{ Component }"> |
| | | <keep-alive> |
| | | <component |
| | | :is="Component" |
| | | :key="$route.name" |
| | | v-if=" |
| | | !$route.meta || |
| | | ($route.meta && !$route.meta.hasOwnProperty('keepAlive')) |
| | | " |
| | | <div class="login-text-small">WELCOME TO LOGIN</div> |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-user"></div> |
| | | <input |
| | | type="text" |
| | | v-focus |
| | | v-model="userInfo.userName" |
| | | placeholder="请è¾å
¥è´¦å·" |
| | | /> |
| | | </keep-alive> |
| | | <component |
| | | :is="Component" |
| | | :key="$route.name" |
| | | v-if="$route.meta && $route.meta.hasOwnProperty('keepAlive')" |
| | | </div> |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-lock"></div> |
| | | <input |
| | | type="password" |
| | | v-focus |
| | | v-model="userInfo.password" |
| | | placeholder="请è¾å
¥å¯ç " |
| | | /> |
| | | </router-view> |
| | | </el-scrollbar> |
| | | </div> |
| | | </div> |
| | | <el-drawer title="鿩䏻é¢" v-model="drawer_model" direction="rtl" destroy-on-close> |
| | | <div class="theme-selector"> |
| | | <div |
| | | @click="changeTheme(item.name)" |
| | | class="item" |
| | | v-for="(item, index) in theme_color" |
| | | :key="index" |
| | | :style="{ background: item.color }" |
| | | > |
| | | <div |
| | | v-show="item.leftColor" |
| | | :style="{ background: item.leftColor }" |
| | | style="height: 100%; width: 20px" |
| | | class="t-left" |
| | | ></div> |
| | | <div class="t-right"></div> |
| | | </div> |
| | | </div> |
| | | </el-drawer> |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-mobile"></div> |
| | | |
| | | <el-drawer title="æ¶æ¯å表" v-model="messageModel" direction="rtl" destroy-on-close size="40%"> |
| | | <Message :list="messageList"></Message> |
| | | </el-drawer> |
| | | <input |
| | | v-focus |
| | | type="text" |
| | | v-model="userInfo.verificationCode" |
| | | placeholder="è¾å
¥éªè¯ç " |
| | | /> |
| | | <div class="code" @click="getVierificationCode"> |
| | | <img v-show="codeImgSrc != ''" :src="codeImgSrc" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="loging-btn"> |
| | | <el-button |
| | | size="large" |
| | | :loading="loading" |
| | | color="#3a6cd1" |
| | | :dark="true" |
| | | @click="login" |
| | | long |
| | | > |
| | | <span v-if="!loading">ç»å½</span> |
| | | <span v-else>æ£å¨ç»å½...</span> |
| | | </el-button> |
| | | </div> |
| | | |
| | | <!-- è´¦å·ä¿¡æ¯ --> |
| | | <!-- <div class="account-info"> |
| | | <p>æ¼ç¤ºè´¦å·ï¼admin666 å¯ç :123456</p> |
| | | <p>æ¬å°è´¦å·ï¼admin å¯ç :123456</p> |
| | | <p><a href="https://jq.qq.com/?_wv=1027&k=Sqstuy0M" style="text-decoration: none" |
| | | target="_blank">QQ3群:743852316</a> |
| | | |
| | | <a href="http://v2.volcore.xyz/document/guide" style="text-decoration: none" target="_blank">æ¡æ¶ææ¡£</a> |
| | | </p> |
| | | </div> --> |
| | | <!-- 龿¥ä½ç½® --> |
| | | <!-- <div class="app-link" > |
| | | <a href="#" style="text-decoration: none">ç§»å¨ç«¯æ«ç </a> |
| | | <a> |
| | | <i class="el-icon-chat-dot-round"></i> å°ç¨åº |
| | | <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/wechat.jpg" /></a> |
| | | <a> |
| | | <i class="el-icon-apple"></i> |
| | | Android |
| | | <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/Android.png" /></a> |
| | | <a> |
| | | <i class="el-icon-document"></i> |
| | | H5 |
| | | <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/H5.png" /></a> |
| | | </div> --> |
| | | </div> |
| | | |
| | | <!-- 页é¢åºé¨ --> |
| | | <!-- <div class="login-footer"> |
| | | <a style="text-decoration: none" href="https://beian.miit.gov.cn/" target="_blank">京ICPå¤19056538å·-1</a> |
| | | |
| | | |
| | | <a href="https://dotnet9.com/" style="text-decoration: none" target="blank">Dotnet9</a> |
| | | <a href="https://space.bilibili.com/525836469" style="text-decoration: none" target="blank">NETè§é¢æç¨(微软MVP-ACEå½å¶)</a> |
| | | <a href="https://www.cctalk.com/m/group/90268531" style="text-decoration: none" target="blank">VOLæ¡æ¶è§é¢</a> |
| | | <a href="http://120.48.115.252:9990" style="text-decoration: none" target="blank">è§é¢æ¼ç¤ºå°å</a> |
| | | </div> --> |
| | | |
| | | <img class="login-bg" src="/static/login_bg.png" /> |
| | | </div> |
| | | </template> |
| | | <style lang="less" scoped> |
| | | @import "./index/index.less"; |
| | | </style> |
| | | |
| | | |
| | | <script> |
| | | import loading from "@/components/basic/RouterLoading"; |
| | | import VolMenu from "@/components/basic/VolElementMenu.vue"; |
| | | import Message from "./index/Message.vue"; |
| | | import MessageConfig from "./index/MessageConfig.js"; |
| | | var imgUrl = require("@/assets/imgs/wms_x.png"); |
| | | var $this; |
| | | var $interval; |
| | | var $indexDate; |
| | | import { |
| | | defineComponent, |
| | | reactive, |
| | | ref, |
| | | watch, |
| | | onMounted, |
| | | reactive, |
| | | toRefs, |
| | | getCurrentInstance, |
| | | h |
| | | } from "vue"; |
| | | import { useRouter, useRoute } from "vue-router"; |
| | | import store from "../store/index"; |
| | | import http from "@/../src/api/http.js"; |
| | | import { ElNotification } from "element-plus"; |
| | | import { useStore } from "vuex"; |
| | | |
| | | export default defineComponent({ |
| | | components: { |
| | | VolMenu, |
| | | loading, |
| | | Message |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | allTabs: true, |
| | | leftTabs: true, |
| | | rightTabs: true, |
| | | otherTabs: true, |
| | | menuLeft: 0, |
| | | menuTop: 0 |
| | | }; |
| | | }, |
| | | setup(props, context) { |
| | | let client = ref(null); |
| | | // èæµç¸å
³åéï¼å»¶è¿æ¶é´å»ºè®®300-500msï¼æ ¹æ®å端æ¨éé¢çè°æ´ï¼ |
| | | const THROTTLE_DELAY = 300; // å»¶è¿æ´æ°æ¶é´ï¼æ¯«ç§ï¼ |
| | | let lastUpdateTime = ref(0); // ä¸ä¸æ¬¡æ´æ°æ¶é´ |
| | | let latestWsData = ref(null); // ç¼åææ°çWebSocketæ°æ® |
| | | let throttleTimer = ref(null); // èæµå®æ¶å¨ |
| | | |
| | | // è·åå
¨å±å±æ§åæ¹æ³ |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | // èå导èªé»è®¤å®½åº¦ |
| | | const menuWidth = ref(200); |
| | | const contextMenuVisible = ref(false); |
| | | const isCollapse = ref(false); |
| | | const drawer_model = ref(false); |
| | | const messageModel = ref(false); |
| | | const theme_color = ref([ |
| | | { name: "blue", color: "rgb(45, 140, 240)" }, |
| | | { name: "blue2", color: "rgb(45, 140, 240)", leftColor: "#0068d6" }, |
| | | { name: "red", color: "rgb(237, 64, 20)" }, |
| | | { name: "red2", color: "rgb(237, 64, 20)", leftColor: "#a90000" }, |
| | | { name: "dark", color: "#272929" }, |
| | | { name: "orange", color: "#ff9900" }, |
| | | { name: "orange2", color: "#ff9900", leftColor: "rgb(232 141 5)" }, |
| | | { name: "green", color: "rgb(25, 190, 107)" }, |
| | | { name: "green2", color: "rgb(25, 190, 107)", leftColor: "#019e4f" }, |
| | | { name: "white", color: "#fff" } |
| | | ]); |
| | | const links = ref([ |
| | | { text: "个人ä¸å¿", path: "/UserInfo", id: -1, icon: "el-icon-s-custom" }, |
| | | { |
| | | text: "å®å
¨éåº", |
| | | path: "/login", |
| | | id: -4, |
| | | icon: "el-icon-switch-button" |
| | | } |
| | | ]); |
| | | const errorImg = ref( |
| | | 'this.src="' + require("@/assets/imgs/error-img.png") + '"' |
| | | ); |
| | | const selectId = ref("1"); |
| | | // ãé¦é¡µãæ ç¾åºå·(å½åå³é®éä¸çèå) |
| | | const selectMenuIndex = ref("0"); |
| | | //2022.05.29å¢å tabé项ä¸èåèå¨åè½ |
| | | const currentMenuId = ref(0); |
| | | const userName = ref("--"); |
| | | const userTrueName = ref("--"); |
| | | const userInfo = ref({}); |
| | | const visibleItem = reactive({ |
| | | left: false, |
| | | right: false, |
| | | all: false, |
| | | other: false |
| | | }); |
| | | const userImg = ref(""); |
| | | const navigation = reactive([ |
| | | { orderNo: "0", id: "1", name: "é¦é¡µ", path: "/home" } |
| | | ]); |
| | | const logo = ref(imgUrl); |
| | | const theme = ref("blue2"); |
| | | const menuOptions = ref([]); |
| | | const permissionInited = ref(false); |
| | | const messageList = reactive([]); |
| | | let _config = getCurrentInstance().appContext.config.globalProperties; |
| | | let router = useRouter(); |
| | | const toggleLeft = () => { |
| | | isCollapse.value = !isCollapse.value; |
| | | menuWidth.value = isCollapse.value ? 63 : 200; |
| | | }; |
| | | //2021.08.28弿¾æå¨æå èåæ¹æ³ |
| | | _config.menu = { |
| | | show() { |
| | | toggleLeft(); |
| | | }, |
| | | hide() { |
| | | toggleLeft(); |
| | | } |
| | | }; |
| | | const Store = useStore(); |
| | | const s = ref(null); |
| | | |
| | | // èæµå¤çWebSocketæ°æ®ï¼æ ¸å¿é»è¾ï¼ |
| | | const handleThrottledWsData = (rawData) => { |
| | | // ç¼åææ°æ°æ®ï¼ç¡®ä¿æç»æ´æ°ç¨çæ¯ææ°å¼ï¼ |
| | | latestWsData.value = rawData; |
| | | const now = Date.now(); |
| | | |
| | | // æ
åµ1ï¼è·ç¦»ä¸æ¬¡æ´æ°è¶
è¿å»¶è¿æ¶é´ï¼ç´æ¥å¤ç |
| | | if (now - lastUpdateTime.value >= THROTTLE_DELAY) { |
| | | processAndUpdateData(); |
| | | lastUpdateTime.value = now; |
| | | } |
| | | // æ
åµ2ï¼æªè¶
è¿å»¶è¿æ¶é´ï¼ç¨å®æ¶å¨å»¶è¿å¤çï¼é¿å
éå¤è§¦åï¼ |
| | | else { |
| | | if (throttleTimer.value) clearTimeout(throttleTimer.value); |
| | | throttleTimer.value = setTimeout(() => { |
| | | processAndUpdateData(); |
| | | lastUpdateTime.value = Date.now(); |
| | | }, THROTTLE_DELAY); |
| | | } |
| | | }; |
| | | |
| | | // ç»ä¸å¤çå¹¶æ´æ°æ°æ®ï¼é¿å
éå¤ä»£ç ï¼ |
| | | const processAndUpdateData = () => { |
| | | if (!latestWsData.value) return; |
| | | try { |
| | | // è§£æWebSocketæ°æ® |
| | | const parsedData = typeof latestWsData.value === 'string' |
| | | ? JSON.parse(latestWsData.value) |
| | | : latestWsData.value; |
| | | |
| | | // 1. æ´æ°Vuexä¸çhomedata |
| | | store.dispatch("sethomedata", parsedData); |
| | | |
| | | // 2. å¤çæ¶æ¯å表 |
| | | if (parsedData.title && parsedData.message) { |
| | | messageList.push(parsedData); |
| | | // æ¾ç¤ºéç¥ |
| | | ElNotification({ |
| | | title: parsedData.title, |
| | | message: h("i", { style: "color: teal" }, parsedData.message), |
| | | position: "bottom-right" |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | console.error("WebSocketæ°æ®å¤ç失败ï¼", err); |
| | | } |
| | | }; |
| | | |
| | | // WebSocketè¿æ¥é»è¾ï¼ä½¿ç¨èæµå¤çæ°æ®ï¼ |
| | | const createSocket = url => { |
| | | // å
³éå·²æè¿æ¥ï¼é¿å
éå¤è¿æ¥ï¼ |
| | | if (client.value) { |
| | | client.value.close(); |
| | | } |
| | | |
| | | // å建WebSocketè¿æ¥ |
| | | client.value = new WebSocket("ws:localhost:9260/"); |
| | | |
| | | client.value.onopen = function() { |
| | | console.log("WebSocket è¿æ¥æå"); |
| | | }; |
| | | |
| | | // æ¶å°æ¶æ¯å交ç»èæµå½æ°å¤ç |
| | | client.value.onmessage = function(event) { |
| | | if (event && event.data) { |
| | | handleThrottledWsData(event.data); |
| | | } |
| | | }; |
| | | |
| | | client.value.onclose = function() { |
| | | console.log("WebSocket è¿æ¥å
³é"); |
| | | // éè¿é»è¾ |
| | | setTimeout(() => createSocket(url), 5000); |
| | | }; |
| | | |
| | | client.value.onerror = function(err) { |
| | | console.log("WebSocket è¿æ¥é误: ", err); |
| | | // é误åéè¿ |
| | | setTimeout(() => createSocket(url), 5000); |
| | | }; |
| | | }; |
| | | |
| | | const changeTheme = name => { |
| | | if (theme.value != name) { |
| | | theme.value = name; |
| | | } |
| | | localStorage.setItem("vol3_theme", name); |
| | | }; |
| | | const to = item => { |
| | | if (item.path == "#") { |
| | | window.open("https://github.com/cq-panda/Vue.NetCore"); |
| | | return; |
| | | } |
| | | if (item.path.indexOf("http") != -1) { |
| | | window.open(item.path); |
| | | return; |
| | | } |
| | | if (typeof item == "string" || item.path == "/login") { |
| | | if (item == "/login" || item.path == "/login") { |
| | | store.commit("clearUserInfo", ""); |
| | | window.location.href = "/"; |
| | | return; |
| | | } |
| | | router.push({ path: item }); |
| | | return; |
| | | } |
| | | if (item.path == "#") return; |
| | | open(item); |
| | | }; |
| | | const open = (item, useRoute) => { |
| | | let _index = navigation.findIndex(x => { |
| | | return x.path == item.path; |
| | | }); |
| | | if (_index == -1) { |
| | | navigation.push({ |
| | | id: item.id + "", |
| | | name: item.name || item.text || "æ æ é¢", |
| | | path: item.path, |
| | | query: item.query |
| | | }); |
| | | selectId.value = navigation.length - 1 + ""; |
| | | } else { |
| | | selectId.value = _index + ""; |
| | | } |
| | | if (useRoute === undefined) { |
| | | setItem(item); |
| | | router.push(item); |
| | | } |
| | | currentMenuId.value = item.id * 1; |
| | | // tabèåç»å®å³é®äºä»¶ |
| | | proxy.$nextTick(function(e) { |
| | | proxy.bindRightClickMenu(true); |
| | | }); |
| | | }; |
| | | const close = path => { |
| | | let index = navigation.findIndex(x => { |
| | | return x.path == path; |
| | | }); |
| | | if (index == -1) { |
| | | return _config.$Message.error("æªæ¾å°èå"); |
| | | } |
| | | removeNav(index); |
| | | }; |
| | | const setItem = item => { |
| | | localStorage.setItem( |
| | | window.location.origin + "_tabs", |
| | | JSON.stringify(item) |
| | | ); |
| | | }; |
| | | const getItem = () => { |
| | | let nav = localStorage.getItem(window.location.origin + "_tabs"); |
| | | return nav ? JSON.parse(nav) : null; |
| | | }; |
| | | const selectNav = item => { |
| | | selectId.value = item.props.name; |
| | | let _path = navigation[item.index].path; |
| | | currentMenuId.value = ( |
| | | menuOptions.value.find(c => { |
| | | return c.path == _path; |
| | | }) || { id: 0 } |
| | | ).id; |
| | | |
| | | router.push({ |
| | | path: navigation[item.index].path, |
| | | query: navigation[item.index].query |
| | | }); |
| | | }; |
| | | |
| | | const removeNav = _index => { |
| | | return new Promise(() => { |
| | | //å
³éçå½å项,跳转å°åä¸ä¸ªé¡µé¢ |
| | | if (selectId.value == _index + "") { |
| | | setItem(navigation[_index - 1]); |
| | | router.push({ |
| | | path: navigation[_index - 1].path, |
| | | query: navigation[_index - 1].query |
| | | }); |
| | | navigation.splice(_index, 1); |
| | | selectId.value = selectId.value - 1 + ""; |
| | | return; |
| | | } |
| | | if (_index < selectId.value) { |
| | | selectId.value = selectId.value - 1 + ""; |
| | | } |
| | | navigation.splice(_index, 1); |
| | | currentMenuId.value = ( |
| | | menuOptions.value.find(c => { |
| | | return c.path == navigation[selectId.value * 1].path; |
| | | }) || { id: 0 } |
| | | ).id; |
| | | }); |
| | | }; |
| | | |
| | | const getSelectMenuName = id => { |
| | | return menuOptions.value.find(function(x) { |
| | | return x.id == id; |
| | | }); |
| | | }; |
| | | const onSelect = treeId => { |
| | | var item = getSelectMenuName(treeId); |
| | | open(item, false); |
| | | }; |
| | | |
| | | /** |
| | | * æ¾ç¤ºå³é®èå |
| | | */ |
| | | const openTabsMenu = function(e) { |
| | | e.preventDefault(); |
| | | let tabId = e.target.id.split("-")[1] * 1; |
| | | |
| | | //è®°å½å½åéä¸çèåindex |
| | | selectMenuIndex.value = |
| | | document.getElementById("pane-" + tabId).children[0].textContent * 1; |
| | | //åªæé¦é¡µæ¶ä¸æ¾ç¤º |
| | | if (navigation.length == 1) { |
| | | return; |
| | | } |
| | | |
| | | //é¦é¡µè®¾ç½®æ¾ç¤ºå
³éå³è¾¹èå |
| | | if (!selectMenuIndex.value) { |
| | | visibleItem.all = false; |
| | | visibleItem.right = true; |
| | | visibleItem.left = false; |
| | | visibleItem.other = false; |
| | | } else { |
| | | visibleItem.all = true; |
| | | //䏿¯æåä¸ä¸ªæ¾ç¤ºå
³éå³è¾¹èå |
| | | visibleItem.right = selectMenuIndex.value != navigation.length - 1; |
| | | //åªæä¸¤ä¸ªè忶䏿¾ç¤ºå
³é左边 |
| | | visibleItem.left = navigation.length != 2; |
| | | //åªæä¸¤ä¸ªè忶䏿¾ç¤ºå
³éå
¶ä» |
| | | visibleItem.other = navigation.length != 2; |
| | | } |
| | | contextMenuVisible.value = true; |
| | | // 设置å³é®èåæ¾ç¤ºçä½ç½® |
| | | proxy.menuLeft = |
| | | e.target.getBoundingClientRect().left - (isCollapse.value ? 63 : 198); |
| | | proxy.menuTop = 36; |
| | | }; |
| | | |
| | | /** |
| | | * å
³éå³é®èå |
| | | */ |
| | | const closeTabsMenu = () => { |
| | | contextMenuVisible.value = false; |
| | | }; |
| | | const toHome = () => { |
| | | open({ |
| | | text: navigation[0].name, |
| | | path: navigation[0].path |
| | | }); |
| | | }; |
| | | /** |
| | | * å
³éå
¶å®æ ç¾é¡µ |
| | | */ |
| | | const closeTabs = value => { |
| | | let _menuId = navigation[selectId.value * 1].id; |
| | | let currnetIndex = selectId.value * 1; |
| | | switch (value) { |
| | | case "left": { |
| | | // å é¤å·¦ä¾§tabæ ç¾ |
| | | navigation.splice(1, currnetIndex - 1); |
| | | break; |
| | | } |
| | | case "right": { |
| | | // å é¤å³ä¾§tabæ ç¾ |
| | | if (selectMenuIndex.value == 0) { |
| | | navigation.splice(currnetIndex); |
| | | toHome(); |
| | | } else { |
| | | navigation.splice(currnetIndex + 1); |
| | | if (selectMenuIndex.value < currnetIndex) { |
| | | navigation.splice( |
| | | selectMenuIndex.value, |
| | | currnetIndex - selectMenuIndex.value |
| | | ); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | case "other": { |
| | | // å é¤å
¶ä»æætabæ ç¾ |
| | | navigation.splice(currnetIndex + 1); |
| | | navigation.splice(1, currnetIndex - 1); |
| | | break; |
| | | } |
| | | default: { |
| | | //å
³éææ |
| | | navigation.splice(1, navigation.length); |
| | | toHome(); |
| | | break; |
| | | } |
| | | } |
| | | selectId.value = |
| | | navigation.findIndex(c => { |
| | | return c.id == _menuId; |
| | | }) + ""; |
| | | closeTabsMenu(); |
| | | }; |
| | | |
| | | watch( |
| | | () => contextMenuVisible.value, |
| | | (newVal, oldVal) => { |
| | | if (newVal) { |
| | | document.body.addEventListener("click", closeTabsMenu); |
| | | } else { |
| | | document.body.removeEventListener("click", closeTabsMenu); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | /** |
| | | * ç³»ç»å建å¼å§ |
| | | */ |
| | | const created = () => { |
| | | let _theme = localStorage.getItem("vol3_theme"); |
| | | if (_theme) { |
| | | theme.value = _theme; |
| | | } |
| | | |
| | | let _userInfo = store.getters.getUserInfo(); |
| | | if (_userInfo) { |
| | | userName.value = _userInfo.userName; |
| | | userTrueName.value = _userInfo.userTrueName; |
| | | if (_userInfo.img) { |
| | | userImg.value = _config.base.getImgSrc(_userInfo.img, http.ipAddress); |
| | | } |
| | | } |
| | | |
| | | createSocket(window.webConfig.webSocketUrl); |
| | | |
| | | Object.assign(_config.$tabs, { open: open, close: close }); |
| | | |
| | | http.get("api/Sys_Menu/getTreeMenu", {}, true).then(data => { |
| | | data.push({ id: "1", name: "é¦é¡µ", url: "/home" }); |
| | | data.forEach(d => { |
| | | d.path = (d.url || "").replace("/Manager", ""); |
| | | d.to = (d.url || "").replace("/Manager", ""); |
| | | if (!d.icon || d.icon.substring(0, 3) != "el-") { |
| | | d.icon = "el-icon-menu"; |
| | | } |
| | | const loading = ref(false); |
| | | const codeImgSrc = ref(""); |
| | | const userInfo = reactive({ |
| | | userName: "", |
| | | password: "", |
| | | verificationCode: "", |
| | | UUID: undefined, |
| | | }); |
| | | |
| | | store.dispatch("setPermission", data); |
| | | menuOptions.value = data; |
| | | permissionInited.value = true; |
| | | |
| | | //å¼å¯æ¶æ¯æ¨é |
| | | if (_config.$global.signalR) { |
| | | MessageConfig(http, result => { |
| | | messageList.unshift(result); |
| | | }); |
| | | } |
| | | |
| | | //å½åå·æ°æ¯ä¸æ¯é¦é¡µ |
| | | if (router.currentRoute.value.path != navigation[0].path) { |
| | | //æ¥æ¾ç³»ç»èå |
| | | let item = menuOptions.value.find(x => { |
| | | return x.path == router.currentRoute.value.path; |
| | | }); |
| | | if (item) return onSelect(item.id); |
| | | //æ¥æ¾é¡¶é¨å¿«æ·è¿æ¥ |
| | | item = links.value.find(x => { |
| | | return x.path == router.currentRoute.value.path; |
| | | }); |
| | | //æ¥æ¾æå䏿¬¡è·³è½¬çé¡µé¢ |
| | | if (!item) { |
| | | item = getItem(); |
| | | } |
| | | if (item) { |
| | | return open(item, false); |
| | | } |
| | | } |
| | | selectId.value = "1"; |
| | | const getVierificationCode = () => { |
| | | http.get("/api/User/getVierificationCode").then((x) => { |
| | | codeImgSrc.value = "data:image/png;base64," + x.img; |
| | | userInfo.UUID = x.uuid; |
| | | }); |
| | | }; |
| | | created(); |
| | | getVierificationCode(); |
| | | |
| | | let appContext = getCurrentInstance().appContext; |
| | | let $message = appContext.config.globalProperties.$message; |
| | | let router = useRouter(); |
| | | |
| | | const login = () => { |
| | | if (!userInfo.userName) return $message.error("请è¾å
¥ç¨æ·å"); |
| | | if (!userInfo.password) return $message.error("请è¾å
¥å¯ç "); |
| | | if (!userInfo.verificationCode) { |
| | | return $message.error("请è¾å
¥éªè¯ç "); |
| | | } |
| | | loading.value = true; |
| | | http.post("/api/User/login", userInfo, "æ£å¨ç»å½....").then((result) => { |
| | | if (!result.status) { |
| | | loading.value = false; |
| | | getVierificationCode(); |
| | | return $message.error(result.message); |
| | | } |
| | | $message.success("ç»å½æå,æ£å¨è·³è½¬!"); |
| | | store.commit("setUserInfo", result.data); |
| | | |
| | | router.push({ path: "/" }); |
| | | }); |
| | | }; |
| | | const loginPress = (e) => { |
| | | if (e.keyCode == 13) { |
| | | login(); |
| | | } |
| | | }; |
| | | const openUrl = (url) => { |
| | | window.open(url, "_blank"); |
| | | }; |
| | | return { |
| | | menuWidth, |
| | | isCollapse, |
| | | drawer_model, |
| | | theme_color, |
| | | errorImg, |
| | | loading, |
| | | codeImgSrc, |
| | | getVierificationCode, |
| | | login, |
| | | userInfo, |
| | | userName, |
| | | userTrueName, |
| | | userImg, |
| | | selectId, |
| | | selectMenuIndex, |
| | | navigation, |
| | | links, |
| | | onSelect, |
| | | openTabsMenu, |
| | | selectNav, |
| | | getSelectMenuName, |
| | | removeNav, |
| | | logo, |
| | | theme, |
| | | menuOptions, |
| | | permissionInited, |
| | | changeTheme, |
| | | to, |
| | | toggleLeft, |
| | | messageModel, |
| | | messageList, |
| | | contextMenuVisible, |
| | | visibleItem, |
| | | closeTabsMenu, |
| | | closeTabs, |
| | | currentMenuId |
| | | loginPress, |
| | | openUrl, |
| | | }; |
| | | }, |
| | | /** |
| | | * æè½½é©å彿° |
| | | */ |
| | | mounted() { |
| | | let _date = showTime(); |
| | | $indexDate = document.getElementById("index-date"); |
| | | $indexDate.innerText = _date; |
| | | $interval = setInterval(function() { |
| | | $indexDate.innerText = showTime(); |
| | | }, 1000); |
| | | |
| | | this.bindRightClickMenu(true); |
| | | directives: { |
| | | focus: { |
| | | inserted: function (el) { |
| | | el.focus(); |
| | | }, |
| | | |
| | | methods: { |
| | | /** |
| | | * ç»å®å³é®äºä»¶ |
| | | */ |
| | | bindRightClickMenu(enable) { |
| | | if (!enable) return; |
| | | let that = this; |
| | | // 使ç¨åçjs 为å个domç»å®é¼ æ å³å»äºä»¶ |
| | | that.$nextTick(() => { |
| | | let tab_top_dom = Object.assign( |
| | | [], |
| | | document.getElementsByClassName("el-tabs__item is-top") |
| | | ); |
| | | tab_top_dom.forEach((item, index) => { |
| | | item.oncontextmenu = that.openTabsMenu; |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 鿝é©å彿° |
| | | */ |
| | | destroyed() { |
| | | $this = null; |
| | | clearInterval($interval); |
| | | // å
³éWebSocketè¿æ¥ |
| | | if (client && client.value) { |
| | | client.value.close(); |
| | | } |
| | | } |
| | | }, |
| | | }); |
| | | const week = new Array( |
| | | "ææä¸", |
| | | "ææäº", |
| | | "ææä¸", |
| | | "ææå", |
| | | "ææäº", |
| | | "ææå
", |
| | | "æææ¥" |
| | | ); |
| | | function showTime() { |
| | | let date = new Date(); |
| | | let year = date.getFullYear(); |
| | | let month = date.getMonth() + 1; |
| | | let day = date.getDate(); |
| | | let hour = date.getHours(); |
| | | let minutes = date.getMinutes(); |
| | | let second = date.getSeconds(); |
| | | |
| | | return ( |
| | | year + |
| | | "." + |
| | | (month < 10 ? "0" + month : month) + |
| | | "." + |
| | | (day < 10 ? "0" + day : day) + |
| | | "" + |
| | | " " + |
| | | (hour < 10 ? "0" + hour : hour) + |
| | | ":" + |
| | | (minutes < 10 ? "0" + minutes : minutes) + |
| | | ":" + |
| | | (second < 10 ? "0" + second : second) + |
| | | " " + |
| | | (week[date.getDay() - 1] || week[6]) |
| | | ); |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .vol-container .vol-path ::v-deep(.el-tabs__content) { |
| | | padding: 0; |
| | | .login-container { |
| | | display: flex; |
| | | width: 100%; |
| | | height: 100%; |
| | | background: rgb(246, 247, 252); |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | } |
| | | |
| | | .login-form { |
| | | align-items: center; |
| | | width: 50%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | // margin-right: 150px; |
| | | z-index: 999; |
| | | |
| | | .form-user { |
| | | // margin: 25px 0; |
| | | |
| | | .item { |
| | | margin-top: -20px; |
| | | margin-right: 40px; |
| | | } |
| | | border-radius: 5px; |
| | | border: 1px solid #ececec; |
| | | display: flex; |
| | | margin-bottom: 30px; |
| | | background: #ffff; |
| | | height: 45px; |
| | | padding-left: 20px; |
| | | display: flex; |
| | | |
| | | .contextMenu { |
| | | width: 120px; |
| | | margin: 0; |
| | | border: 1px solid #eaeaea; |
| | | background: #fff; |
| | | z-index: 30000; |
| | | position: absolute; |
| | | list-style-type: none; |
| | | padding: 5px 0; |
| | | border-radius: 4px; |
| | | font-size: 14px; |
| | | color: #333; |
| | | box-shadow: 2px 2px 3px 0 rgb(182 182 182 / 20%); |
| | | i, |
| | | button { |
| | | font-size: 14px !important; |
| | | } |
| | | } |
| | | |
| | | .contextMenu li { |
| | | margin: 0; |
| | | padding: 5px 17px; |
| | | } |
| | | |
| | | .contextMenu li:hover { |
| | | background: #fafafa; |
| | | .code { |
| | | position: relative; |
| | | cursor: pointer; |
| | | width: 74px; |
| | | padding: 5px 10px 0 0; |
| | | } |
| | | |
| | | .contextMenu li button { |
| | | color: #626060; |
| | | font-size: 14px; |
| | | letter-spacing: 1px; |
| | | .input-icon { |
| | | line-height: 45px; |
| | | color: #7a7a7a; |
| | | padding-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .el-tabs.el-tabs--top.el-tabs--border-card.header-navigation |
| | | > .el-tabs__header |
| | | .el-tabs__item:last-child, |
| | | .el-tabs--top.el-tabs--border-card.header-navigation |
| | | > .el-tabs__header |
| | | .el-tabs__item:nth-child(2) { |
| | | input:-webkit-autofill { |
| | | box-shadow: 0 0 0px 1000px white inset; |
| | | -webkit-box-shadow: 0 0 0px 1000px white inset !important; |
| | | } |
| | | |
| | | input { |
| | | background: white; |
| | | display: block; |
| | | box-sizing: border-box; |
| | | width: 100%; |
| | | min-width: 0; |
| | | margin: 0; |
| | | padding: 0; |
| | | color: #323233; |
| | | line-height: inherit; |
| | | text-align: left; |
| | | border: 0; |
| | | outline: none; |
| | | font-size: 16px; |
| | | line-height: 20px; |
| | | } |
| | | } |
| | | |
| | | .header-navigation ::v-deep(.el-tabs__item.is-top) { |
| | | padding: 0 15px; |
| | | .form-user, |
| | | .loging-btn { |
| | | width: 400px; |
| | | } |
| | | |
| | | .loging-btn { |
| | | box-shadow: 2px 4px 11px #a4c2ff; |
| | | margin-top: 10px; |
| | | |
| | | button { |
| | | padding: 21px; |
| | | font-size: 14px !important; |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .login-text { |
| | | font-weight: bolder; |
| | | font-size: 20px; |
| | | letter-spacing: 2px; |
| | | |
| | | position: relative; |
| | | display: flex; |
| | | |
| | | .login-line { |
| | | z-index: -1; |
| | | padding: 5px; |
| | | position: relative; |
| | | top: -8px; |
| | | width: 100%; |
| | | background-image: linear-gradient(to right, #6598ff, white); |
| | | } |
| | | } |
| | | |
| | | .login-text-small { |
| | | margin-bottom: 20px; |
| | | font-size: 13px; |
| | | color: #7d7c7c; |
| | | } |
| | | |
| | | .login-bg { |
| | | left: 0; |
| | | position: absolute; |
| | | height: 100%; |
| | | width: 50%; |
| | | z-index: 0; |
| | | } |
| | | |
| | | .project-name { |
| | | position: absolute; |
| | | top: 40px; |
| | | left: 40px; |
| | | z-index: 9999; |
| | | font-weight: bolder; |
| | | background-image: linear-gradient(to right, #1850c1, #9c009c); |
| | | -webkit-background-clip: text; |
| | | color: transparent; |
| | | font-size: 25px; |
| | | } |
| | | </style> |
| | | <style> |
| | | .horizontal-collapse-transition { |
| | | transition: 0s width ease-in-out, 0s padding-left ease-in-out, |
| | | 0s padding-right ease-in-out; |
| | | <style lang="less" scoped> |
| | | .app-link { |
| | | // font-weight: bolder; |
| | | text-align: center; |
| | | padding-top: 5px; |
| | | font-size: 12px; |
| | | width: 400px; |
| | | padding-left: 40px; |
| | | display: flex; |
| | | |
| | | a { |
| | | flex: 1; |
| | | position: relative; |
| | | cursor: pointer; |
| | | width: 70px; |
| | | color: #666666; |
| | | margin: 2px 10px 0 0; |
| | | } |
| | | |
| | | img { |
| | | display: none; |
| | | } |
| | | |
| | | a:hover { |
| | | color: #0545f6 !important; |
| | | |
| | | img { |
| | | display: block; |
| | | position: absolute; |
| | | z-index: 999999999; |
| | | top: -130px; |
| | | width: 120px; |
| | | left: -22px; |
| | | |
| | | border: 1px solid #b1b1b1; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .login-footer { |
| | | position: absolute; |
| | | width: 50%; |
| | | bottom: 0.5rem; |
| | | font-size: 12px; |
| | | text-align: center; |
| | | padding-bottom: 10px; |
| | | color: #4f4f4f; |
| | | |
| | | a { |
| | | margin-right: 10px; |
| | | font-size: 12px; |
| | | color: #4f4f4f; |
| | | } |
| | | |
| | | div { |
| | | margin-bottom: 5px; |
| | | } |
| | | |
| | | a:hover { |
| | | cursor: pointer; |
| | | color: #0540e3 !important; |
| | | } |
| | | } |
| | | |
| | | .account-info { |
| | | font-size: 12px; |
| | | color: #636363; |
| | | margin-top: 15px; |
| | | } |
| | | </style> |
| | | |
| | | <style lang="less" scoped> |
| | | @media screen and (max-width: 700px) { |
| | | .login-bg, |
| | | .account-info, |
| | | .app-link, |
| | | .login-footer, |
| | | .project-name { |
| | | display: none; |
| | | } |
| | | |
| | | .login-container { |
| | | padding: 2rem; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .login-form { |
| | | width: 100%; |
| | | } |
| | | |
| | | .form-user, |
| | | .loging-btn { |
| | | width: 100%; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="message-container"> |
| | | <div class="item" v-for="(item, index) in list" :key="index"> |
| | | <div class="title">{{ item.title }}({{ item.date }})</div> |
| | | <div class="content">{{ item.message }}</div> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | <!-- BCä»å åæºç¶æé¢æ¿ --> |
| | | <div class="skuang"> |
| | | <div class="bcuname">æ¿æä»å åæº</div> |
| | | <div class="bcankuang"> |
| | | <div class="xname">å åæºç¶æ:</div> |
| | | <div class="xbci" :title="bcData.R_BC_Status">{{ bcData.R_BC_Status || '-' }}</div> |
| | | </div> |
| | | <div class="bcankuang"> |
| | | <div class="xname">å åæºæèªå¨ç¶æ:</div> |
| | | <div class="xbci" :title="bcData.R_BC_AutoStatus">{{ bcData.R_BC_AutoStatus || '-' }}</div> |
| | | </div> |
| | | <div class="bcankuang"> |
| | | <div class="xname">æ£å¨æ§è¡çä»»å¡å·:</div> |
| | | <div class="xbci" :title="bcData.R_BC_TaskNum">{{ bcData.R_BC_TaskNum || '-' }}</div> |
| | | </div> |
| | | <div class="bcankuang"> |
| | | <div class="xname">å åæºå·¥ä½ç¶æ:</div> |
| | | <div class="xbci" :title="bcData.R_BC_WorkStatus">{{ bcData.R_BC_WorkStatus || '-' }}</div> |
| | | </div> |
| | | <div class="bcankuang"> |
| | | <div class="xname">ä½ä¸ç±»å:</div> |
| | | <div class="xbci" :title="bcData.R_BC_WorkType">{{ bcData.R_BC_WorkType || '-' }}</div> |
| | | </div> |
| | | <div class="bcankuang"> |
| | | <div class="xname">æçç±»å:</div> |
| | | <div class="xbci" :title="bcData.R_BC_TrayType">{{ bcData.R_BC_TrayType || '-' }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, nextTick, watch, onUnmounted } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default: () => { |
| | | return []; |
| | | } |
| | | } |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | created() { |
| | | if (!this.list.length) { |
| | | this.list.push({ |
| | | title: 'æ¶æ¯æµè¯æ qweqweqweqwé¢', |
| | | message: 'æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
容', |
| | | date: '2022-05-02 03:10' |
| | | setup() { |
| | | const store = useStore(); |
| | | // ä»
åå¨BCæ°æ®ï¼ä¸å
¶ä»æ°æ®é离 |
| | | const bcData = ref({}); |
| | | |
| | | // å»¶è¿æ´æ°é
ç½®ï¼è§£å³éªçé®é¢ |
| | | const UPDATE_DELAY = 300; // å»¶è¿300msæ´æ°UI |
| | | let updateTimer = null; // 宿¶å¨å®ä¾ |
| | | |
| | | // BCæ°æ®æ å°è§å |
| | | const bcStatusMap = { |
| | | R_BC_Status: { |
| | | 1: "æ£å¸¸", |
| | | 2: "æ
é", |
| | | 3: "æ¥å", |
| | | }, |
| | | R_BC_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | | 1: "æå¨", |
| | | 2: "åèªå¨", |
| | | 3: "èªå¨", |
| | | }, |
| | | R_BC_WorkStatus: { |
| | | 0: "å¾
æº", |
| | | 1: "åè´§ä¸", |
| | | 2: "åè´§å®æ", |
| | | 4: "æ¾è´§ä¸", |
| | | 5: "æ¾è´§å®æ", |
| | | 6: "ä»»å¡å®æ", |
| | | }, |
| | | R_BC_WorkType: { |
| | | 0: "æ ä½ä¸ä»»å¡(0)", |
| | | 1: "åæ¾è´§ä½ä¸(1)", |
| | | 2: "åªåè´§ä½ä¸(2)", |
| | | 3: "åªæ¾è´§ä½ä¸(3)", |
| | | 4: "ç§»å¨å°æå®ä½ç½®" |
| | | }, |
| | | R_BC_TrayType: { |
| | | "-1": "空箱(-1)", |
| | | 1: "å°æç(1)", |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | } |
| | | }; |
| | | |
| | | // BCåæ®µåç» |
| | | const bcFieldGroups = { |
| | | permissionFields: { |
| | | keys: ["R_BC_IsCanPut1", "R_BC_IsCanTake1", "R_BC_IsCanPut2", "R_BC_IsCanTake2", |
| | | "R_BC_IsCanPut3", "R_BC_IsCanTake3", "R_BC_IsCanPut4", "R_BC_IsCanTake4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | requestFields: { |
| | | keys: ["W_BC_PutRequest1", "W_BC_TakeRequest1", "W_BC_PutRequest2", "W_BC_TakeRequest2", |
| | | "W_BC_PutRequest3", "W_BC_TakeRequest3", "W_BC_PutRequest4", "W_BC_TakeRequest4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | finishFields: { |
| | | keys: ["W_BC_PutFinish1", "W_BC_TakeFinish1", "W_BC_PutFinish2", "W_BC_TakeFinish2", |
| | | "W_BC_PutFinish3", "W_BC_TakeFinish3", "W_BC_PutFinish4", "W_BC_TakeFinish4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | palletTypeFields: { |
| | | keys: ["R_BC_TakePalletType1", "R_BC_TakePalletType2", "R_BC_TakePalletType3", "R_BC_TakePalletType4", |
| | | "W_BC_PutPalletType1", "W_BC_PutPalletType2", "W_BC_PutPalletType3", "W_BC_PutPalletType4"], |
| | | map: { "-1": "空箱(-1)", 1: "å°æç(1)", 2: "䏿ç(2)", 3: "大æç(3)", 4: "ç¹å¤§æç(4)" } |
| | | } |
| | | }; |
| | | |
| | | // å¤çBCåå§æ°æ® |
| | | const processBCData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processedData = { ...rawData }; |
| | | |
| | | // å¤çæ ¸å¿ç¶æå段 |
| | | Object.keys(bcStatusMap).forEach(key => { |
| | | if (processedData.hasOwnProperty(key)) { |
| | | processedData[key] = bcStatusMap[key][processedData[key]] || processedData[key]; |
| | | } |
| | | }); |
| | | |
| | | // å¤çåç»å段 |
| | | Object.values(bcFieldGroups).forEach(group => { |
| | | group.keys.forEach(key => { |
| | | if (processedData.hasOwnProperty(key)) { |
| | | processedData[key] = group.map[processedData[key]] || processedData[key]; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | return processedData; |
| | | }; |
| | | |
| | | // å»¶è¿æ´æ°BCæ°æ®ï¼é¿å
é«é¢å·æ° |
| | | const delayedUpdateBCData = (newRawData) => { |
| | | if (updateTimer) { |
| | | clearTimeout(updateTimer); |
| | | } |
| | | |
| | | updateTimer = setTimeout(() => { |
| | | // åªå¤çå
å«BCç¹å¾åæ®µçæ°æ® |
| | | if (newRawData && newRawData.R_BC_Status !== undefined) { |
| | | bcData.value = processBCData(newRawData); |
| | | |
| | | // æ´æ°æ ·å¼ |
| | | nextTick(() => { |
| | | const valueElements = document.getElementsByClassName("xbci"); |
| | | for (let i = 0; i < valueElements.length; i++) { |
| | | if (valueElements[i].innerHTML === "æ¯") { |
| | | valueElements[i].style.color = "yellow"; |
| | | } else if (valueElements[i].innerHTML === "å¦") { |
| | | valueElements[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, UPDATE_DELAY); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // åå§å è½½æ°æ® |
| | | const initialData = store.state.homedata; |
| | | if (initialData && initialData.R_BC_Status !== undefined) { |
| | | bcData.value = processBCData(initialData); |
| | | } |
| | | |
| | | // ç嬿°æ®ååï¼åªå¤çBCæ°æ® |
| | | const unwatch = watch( |
| | | () => store.state.homedata, |
| | | (newData) => { |
| | | if (newData && newData.R_BC_Status !== undefined) { |
| | | delayedUpdateBCData(newData); |
| | | } |
| | | }, |
| | | { deep: true } |
| | | ); |
| | | |
| | | // ç»ä»¶å¸è½½æ¶æ¸
ç |
| | | onUnmounted(() => { |
| | | unwatch(); |
| | | if (updateTimer) { |
| | | clearTimeout(updateTimer); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | bcData |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="less"> |
| | | .message-container { |
| | | .title { |
| | | padding-bottom: 10px; |
| | | |
| | | <style scoped> |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | .item { |
| | | border-bottom: 1px solid #eee; |
| | | padding: 10px 20px; |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .content { |
| | | color: #7e7e7e; |
| | | font-size: 13px; |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .bcuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xbci { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .bcankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="message-container"> |
| | | <div class="item" v-for="(item, index) in list" :key="index"> |
| | | <div class="title">{{ item.title }}({{ item.date }})</div> |
| | | <div class="content">{{ item.message }}</div> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | <!-- CSJä»å åæºç¶æé¢æ¿ --> |
| | | <div class="skuang"> |
| | | <div class="csjuname">æµè¯æ¶ä»å åæº</div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å åæºç¶æ:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_Status">{{ csjData.R_CSJ_Status || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å åæºæèªå¨ç¶æ:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_AutoStatus">{{ csjData.R_CSJ_AutoStatus || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ£å¨æ§è¡çä»»å¡å·:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_TaskNum">{{ csjData.R_CSJ_TaskNum || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å åæºå·¥ä½ç¶æ:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_WorkStatus">{{ csjData.R_CSJ_WorkStatus || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">ä½ä¸ç±»å:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_WorkType">{{ csjData.R_CSJ_WorkType || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æçç±»å:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_TrayType">{{ csjData.R_CSJ_TrayType || '-' }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- CSJå
³èç«å°ï¼åºåº303+åºåº304ï¼ --> |
| | | <div class="skuang"> |
| | | <div class="csjuname">åºåº103ç«å°</div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanPut3">{{ csjData.R_CSJ_IsCanPut3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanTake3">{{ csjData.R_CSJ_IsCanTake3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutRequest3">{{ csjData.W_CSJ_PutRequest3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutFinish3">{{ csjData.W_CSJ_PutFinish3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeRequest3">{{ csjData.W_CSJ_TakeRequest3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeFinish3">{{ csjData.W_CSJ_TakeFinish3 || '-' }}</div> |
| | | </div> |
| | | |
| | | <div class="csjuname">åºåº104ç«å°</div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanPut4">{{ csjData.R_CSJ_IsCanPut4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanTake4">{{ csjData.R_CSJ_IsCanTake4 || '-' }}</div> |
| | | </div> |
| | | |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutRequest4">{{ csjData.W_CSJ_PutRequest4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutFinish4">{{ csjData.W_CSJ_PutFinish4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeRequest4">{{ csjData.W_CSJ_TakeRequest4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeFinish4">{{ csjData.W_CSJ_TakeFinish4 || '-' }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, nextTick, watch, onUnmounted } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default: () => { |
| | | return []; |
| | | } |
| | | } |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | created() { |
| | | if (!this.list.length) { |
| | | this.list.push({ |
| | | title: 'æ¶æ¯werweræµè¯æ é¢', |
| | | message: 'æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
容', |
| | | date: '2022-05-02 03:10' |
| | | setup() { |
| | | const store = useStore(); |
| | | // ä»
åå¨CSJæ°æ®ï¼ä¸å
¶ä»æ°æ®é离 |
| | | const csjData = ref({}); |
| | | |
| | | // å»¶è¿æ´æ°é
ç½®ï¼è§£å³éªçé®é¢ |
| | | const UPDATE_DELAY = 300; // å»¶è¿300msæ´æ°UI |
| | | let updateTimer = null; // 宿¶å¨å®ä¾ |
| | | |
| | | // CSJæ°æ®æ å°è§å |
| | | const csjStatusMap = { |
| | | R_CSJ_Status: { |
| | | 1: "æ£å¸¸", |
| | | 2: "æ
é", |
| | | 3: "æ¥å", |
| | | }, |
| | | R_CSJ_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | | 1: "æå¨", |
| | | 2: "åèªå¨", |
| | | 3: "èªå¨", |
| | | }, |
| | | R_CSJ_WorkStatus: { |
| | | 0: "å¾
æº", |
| | | 1: "åè´§ä¸", |
| | | 2: "åè´§å®æ", |
| | | 4: "æ¾è´§ä¸", |
| | | 5: "æ¾è´§å®æ", |
| | | 6: "ä»»å¡å®æ", |
| | | }, |
| | | R_CSJ_WorkType: { |
| | | 0: "æ ä½ä¸ä»»å¡(0)", |
| | | 1: "åæ¾è´§ä½ä¸(1)", |
| | | 2: "åªåè´§ä½ä¸(2)", |
| | | 3: "åªæ¾è´§ä½ä¸(3)", |
| | | 4: "ç§»å¨å°æå®ä½ç½®" |
| | | }, |
| | | R_CSJ_TrayType: { |
| | | "-1": "空箱(-1)", |
| | | 1: "å°æç(1)", |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | } |
| | | }; |
| | | |
| | | // CSJåæ®µåç» |
| | | const csjFieldGroups = { |
| | | permissionFields: { |
| | | keys: ["R_CSJ_IsCanPut1", "R_CSJ_IsCanTake1", "R_CSJ_IsCanPut2", "R_CSJ_IsCanTake2", |
| | | "R_CSJ_IsCanPut3", "R_CSJ_IsCanTake3", "R_CSJ_IsCanPut4", "R_CSJ_IsCanTake4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | requestFields: { |
| | | keys: ["W_CSJ_PutRequest1", "W_CSJ_TakeRequest1", "W_CSJ_PutRequest2", "W_CSJ_TakeRequest2", |
| | | "W_CSJ_PutRequest3", "W_CSJ_TakeRequest3", "W_CSJ_PutRequest4", "W_CSJ_TakeRequest4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | finishFields: { |
| | | keys: ["W_CSJ_PutFinish1", "W_CSJ_TakeFinish1", "W_CSJ_PutFinish2", "W_CSJ_TakeFinish2", |
| | | "W_CSJ_PutFinish3", "W_CSJ_TakeFinish3", "W_CSJ_PutFinish4", "W_CSJ_TakeFinish4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | palletTypeFields: { |
| | | keys: ["R_CSJ_TakePalletType1", "R_CSJ_TakePalletType2", "R_CSJ_TakePalletType3", "R_CSJ_TakePalletType4", |
| | | "W_CSJ_PutPalletType1", "W_CSJ_PutPalletType2", "W_CSJ_PutPalletType3", "W_CSJ_PutPalletType4"], |
| | | map: { "-1": "空箱(-1)", 1: "å°æç(1)", 2: "䏿ç(2)", 3: "大æç(3)", 4: "ç¹å¤§æç(4)" } |
| | | } |
| | | }; |
| | | |
| | | // å¤çCSJåå§æ°æ® |
| | | const processCSJData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processedData = { ...rawData }; |
| | | |
| | | // å¤çæ ¸å¿ç¶æå段 |
| | | Object.keys(csjStatusMap).forEach(key => { |
| | | if (processedData.hasOwnProperty(key)) { |
| | | processedData[key] = csjStatusMap[key][processedData[key]] || processedData[key]; |
| | | } |
| | | }); |
| | | |
| | | // å¤çåç»å段 |
| | | Object.values(csjFieldGroups).forEach(group => { |
| | | group.keys.forEach(key => { |
| | | if (processedData.hasOwnProperty(key)) { |
| | | processedData[key] = group.map[processedData[key]] || processedData[key]; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | return processedData; |
| | | }; |
| | | |
| | | // å»¶è¿æ´æ°CSJæ°æ®ï¼é¿å
é«é¢å·æ° |
| | | const delayedUpdateCSJData = (newRawData) => { |
| | | if (updateTimer) { |
| | | clearTimeout(updateTimer); |
| | | } |
| | | |
| | | updateTimer = setTimeout(() => { |
| | | // åªå¤çå
å«CSJç¹å¾åæ®µçæ°æ® |
| | | if (newRawData && newRawData.R_CSJ_Status !== undefined) { |
| | | csjData.value = processCSJData(newRawData); |
| | | |
| | | // æ´æ°æ ·å¼ |
| | | nextTick(() => { |
| | | const valueElements = document.getElementsByClassName("xcsji"); |
| | | for (let i = 0; i < valueElements.length; i++) { |
| | | if (valueElements[i].innerHTML === "æ¯") { |
| | | valueElements[i].style.color = "yellow"; |
| | | } else if (valueElements[i].innerHTML === "å¦") { |
| | | valueElements[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, UPDATE_DELAY); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // åå§å è½½æ°æ® |
| | | const initialData = store.state.homedata; |
| | | if (initialData && initialData.R_CSJ_Status !== undefined) { |
| | | csjData.value = processCSJData(initialData); |
| | | } |
| | | |
| | | // ç嬿°æ®ååï¼åªå¤çCSJæ°æ® |
| | | const unwatch = watch( |
| | | () => store.state.homedata, |
| | | (newData) => { |
| | | if (newData && newData.R_CSJ_Status !== undefined) { |
| | | delayedUpdateCSJData(newData); |
| | | } |
| | | }, |
| | | { deep: true } |
| | | ); |
| | | |
| | | // ç»ä»¶å¸è½½æ¶æ¸
ç |
| | | onUnmounted(() => { |
| | | unwatch(); |
| | | if (updateTimer) { |
| | | clearTimeout(updateTimer); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | csjData |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="less"> |
| | | .message-container { |
| | | .title { |
| | | padding-bottom: 10px; |
| | | |
| | | <style scoped> |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | .item { |
| | | border-bottom: 1px solid #eee; |
| | | padding: 10px 20px; |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .content { |
| | | color: #7e7e7e; |
| | | font-size: 13px; |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .csjuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xcsji { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .csjankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
| | |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RecWMSTaskCompleted(int taskNum); |
| | | /// <summary> |
| | | /// æ¥æ¶wcsä»»å¡åæ¶ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RecWMSTaskHandCancel(int taskNum); |
| | | } |
| | | } |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | if(task.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()) |
| | | if (task.TaskState == TaskStatusEnum.SC_Executing.ObjToInt() || (task.DeviceCode.Contains("SC01")&& task.TaskState == TaskStatusEnum.Pending.ObjToInt())) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("RecWMSTaskHandCancel"), AllowAnonymous] |
| | | public WebResponseContent RecWMSTaskHandCancel(int taskNum) |
| | | { |
| | | return Service.RecWMSTaskHandCancel(taskNum); |
| | | } |
| | | } |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥åWMSæå¨åæ¶ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RecWMSTaskHandCancel(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task != null) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Cancel.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.æ¿æä» |
| | | { |
| | | public class BCReadData |
| | | { |
| | | /// <summary> |
| | | /// å åæºç¶æ |
| | | /// </summary> |
| | | public short R_BC_Status; |
| | | |
| | | /// <summary> |
| | | /// å åæºæèªå¨ç¶æ |
| | | /// </summary> |
| | | public short R_BC_AutoStatus; |
| | | |
| | | /// <summary> |
| | | /// å½åæ£å¨æ§è¡çä»»å¡å· |
| | | /// </summary> |
| | | public int R_BC_TaskNum; |
| | | |
| | | /// <summary> |
| | | /// å åæºå·¥ä½ç¶æ |
| | | /// </summary> |
| | | public short R_BC_WorkStatus; |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸ç±»å |
| | | /// </summary> |
| | | public short R_BC_WorkType; |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public short R_BC_TrayType; |
| | | } |
| | | } |
| | |
| | | using Autofac.Core; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using AutoMapper; |
| | | using WIDESEAWCS_Tasks.æ¿æä»; |
| | | using HslCommunication.WebSocket; |
| | | using WIDESEAWCS_Tasks.æµè¯æ¶ä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IRouterRepository _routerRepository; |
| | | public static BCReadData bCReadData = new BCReadData(); |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | private WebSocketServer _webSocketServer; |
| | | |
| | | public StackerCraneJob_BC(IMapper mapper, ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository) |
| | | public StackerCraneJob_BC(IMapper mapper, ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository,WebSocketServer webSocketServer) |
| | | { |
| | | _mapper = mapper; |
| | | _taskService = taskService; |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _routerRepository = routerRepository; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | |
| | | } |
| | | } |
| | | } |
| | | bCReadData.R_BC_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | bCReadData.R_BC_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | bCReadData.R_BC_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | bCReadData.R_BC_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | bCReadData.R_BC_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | bCReadData.R_BC_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string bCData = JsonConvert.SerializeObject(bCReadData); |
| | | _webSocketServer.PublishAllClientPayload(bCData); |
| | | } |
| | | } |
| | | catch (Exception ex) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.æµè¯æ¶ä» |
| | | { |
| | | public class CSJReadData |
| | | { |
| | | /// <summary> |
| | | /// å åæºç¶æ |
| | | /// </summary> |
| | | public short R_CSJ_Status; |
| | | |
| | | /// <summary> |
| | | /// å åæºæèªå¨ç¶æ |
| | | /// </summary> |
| | | public short R_CSJ_AutoStatus; |
| | | |
| | | /// <summary> |
| | | /// å½åæ£å¨æ§è¡çä»»å¡å· |
| | | /// </summary> |
| | | public int R_CSJ_TaskNum; |
| | | |
| | | /// <summary> |
| | | /// å åæºå·¥ä½ç¶æ |
| | | /// </summary> |
| | | public short R_CSJ_WorkStatus; |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸ç±»å |
| | | /// </summary> |
| | | public short R_CSJ_WorkType; |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public short R_CSJ_TrayType; |
| | | |
| | | |
| | | ///åç«å°è¯»å103 |
| | | |
| | | ///åè´§æçç±»å(读) |
| | | public short R_CSJ_TakePalletType3; |
| | | /// <summary> |
| | | /// æ¾è´§æçç±»å(å) |
| | | /// </summary> |
| | | public short W_CSJ_PutPalletType3; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | public bool R_CSJ_IsCanPut3; |
| | | /// <summary> |
| | | /// æ¯å¦å
许åè´§(读) |
| | | /// </summary> |
| | | public bool R_CSJ_IsCanTake3; |
| | | /// <summary> |
| | | /// æ¾è´§è¯·æ±(å) |
| | | /// </summary> |
| | | public bool W_CSJ_PutRequest3; |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_CSJ_PutFinish3; |
| | | /// <summary> |
| | | /// å货请æ±(å) |
| | | /// </summary> |
| | | public bool W_CSJ_TakeRequest3; |
| | | /// <summary> |
| | | /// åè´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_CSJ_TakeFinish3; |
| | | |
| | | ///åç«å°è¯»å104 |
| | | |
| | | ///åè´§æçç±»å(读) |
| | | public short R_CSJ_TakePalletType4; |
| | | /// <summary> |
| | | /// æ¾è´§æçç±»å(å) |
| | | /// </summary> |
| | | public short W_CSJ_PutPalletType4; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | public bool R_CSJ_IsCanPut4; |
| | | /// <summary> |
| | | /// æ¯å¦å
许åè´§(读) |
| | | /// </summary> |
| | | public bool R_CSJ_IsCanTake4; |
| | | /// <summary> |
| | | /// æ¾è´§è¯·æ±(å) |
| | | /// </summary> |
| | | public bool W_CSJ_PutRequest4; |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_CSJ_PutFinish4; |
| | | /// <summary> |
| | | /// å货请æ±(å) |
| | | /// </summary> |
| | | public bool W_CSJ_TakeRequest4; |
| | | /// <summary> |
| | | /// åè´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_CSJ_TakeFinish4; |
| | | } |
| | | } |
| | |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); |
| | | } |
| | | } |
| | | if (item.StationCode == "103") |
| | | { |
| | | StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanPut3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanTake3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | else if (item.StationCode == "104") |
| | | { |
| | | StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanPut4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanTake4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using AutoMapper; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_Tasks.HoisterJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using WIDESEAWCS_Tasks.æµè¯æ¶ä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly IMapper _mapper; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ITaskService _taskService; |
| | | public static CSJReadData cSJReadData = new CSJReadData(); |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private WebSocketServer _webSocketServer; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | |
| | | public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper) |
| | | public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper, WebSocketServer webSocketServer) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _mapper = mapper; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | |
| | | } |
| | | } |
| | | } |
| | | cSJReadData.R_CSJ_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | cSJReadData.R_CSJ_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | cSJReadData.R_CSJ_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | cSJReadData.R_CSJ_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | cSJReadData.R_CSJ_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | cSJReadData.R_CSJ_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string cSJData = JsonConvert.SerializeObject(cSJReadData); |
| | | _webSocketServer.PublishAllClientPayload(cSJData); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | // ç¹å»ç¼è¾æé®å¼¹åºæ¡åæ§è¡ |
| | | if (this.currentAction === 'Edit') { // 夿å½åæ¯ç¼è¾æä½ |
| | | // è·åå½åç»å½ç¨æ·ï¼å设ä»å
¨å±åéè·åï¼å
·ä½æ ¹æ®ä½ ç项ç®å®ç°ï¼ |
| | | const currentUser = this.$store.state.userInfo?.username || '被人工修æ¹'; |
| | | |
| | | // è·åå½åæ¶é´å¹¶æ ¼å¼å为å端éè¦çæ ¼å¼ |
| | | const now = new Date(); |
| | | const formattedDate = now.toISOString().slice(0, 19).replace('T', ' '); |
| | | |
| | | // 设置修æ¹äººå段 |
| | | this.editFormFields.modifier = currentUser; |
| | | // è®¾ç½®ä¿®æ¹æ¶é´å段 |
| | | this.editFormFields.modifyDate = formattedDate; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | // ç¹å»ç¼è¾æé®å¼¹åºæ¡åæ§è¡ |
| | | if (this.currentAction === 'Edit') { // 夿å½åæ¯ç¼è¾æä½ |
| | | // è·åå½åç»å½ç¨æ·ï¼å设ä»å
¨å±åéè·åï¼å
·ä½æ ¹æ®ä½ ç项ç®å®ç°ï¼ |
| | | const currentUser = this.$store.state.userInfo?.username || 'system'; |
| | | |
| | | // è·åå½åæ¶é´å¹¶æ ¼å¼å为å端éè¦çæ ¼å¼ |
| | | const now = new Date(); |
| | | const formattedDate = now.toISOString().slice(0, 19).replace('T', ' '); |
| | | |
| | | // 设置修æ¹äººå段 |
| | | this.editFormFields.modifier = currentUser; |
| | | // è®¾ç½®ä¿®æ¹æ¶é´å段 |
| | | this.editFormFields.modifyDate = formattedDate; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | // ç¹å»ç¼è¾æé®å¼¹åºæ¡åæ§è¡ |
| | | if (this.currentAction === 'Edit') { // 夿å½åæ¯ç¼è¾æä½ |
| | | // è·åå½åç»å½ç¨æ·ï¼å设ä»å
¨å±åéè·åï¼å
·ä½æ ¹æ®ä½ ç项ç®å®ç°ï¼ |
| | | const currentUser = this.$store.state.userInfo?.username || 'system'; |
| | | |
| | | // è·åå½åæ¶é´å¹¶æ ¼å¼å为å端éè¦çæ ¼å¼ |
| | | const now = new Date(); |
| | | const formattedDate = now.toISOString().slice(0, 19).replace('T', ' '); |
| | | |
| | | // 设置修æ¹äººå段 |
| | | this.editFormFields.modifier = currentUser; |
| | | // è®¾ç½®ä¿®æ¹æ¶é´å段 |
| | | this.editFormFields.modifyDate = formattedDate; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | var param = rows[0].taskNum; |
| | | var warehouseId = rows[0].warehouseId; |
| | | this.http |
| | | .post("api/Task/TaskHandCancel?taskNum="+param+"&&warehouseId="+warehouseId, "æ°æ®å¤çä¸...") |
| | | .post("api/Task/TaskHandCancel?taskNum="+param, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('ä»»å¡åæ¶æå.'); |
| | |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | |
| | | { |
| | | field: "inboundOrderNo", |
| | | title: "åæ®ç¼å·", |
| | |
| | | align: "left", |
| | | bind: { key: "inboundState", data: [] }, |
| | | }, |
| | | |
| | | { |
| | | field: "createType", |
| | | title: "å建æ¹å¼", |
| | |
| | | bind: { key: "createType", data: [] }, |
| | | }, |
| | | { |
| | | field: "id", |
| | | title: "å
¥åºå主é®", |
| | | type: "int", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "设å¤ç¼å·", field: "deviceCode" }, |
| | | { title: "设å¤ç±»å", field: "deviceType" }, |
| | | { title: "设å¤ç¶æ", field: "deviceStatus" }, |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "ç©æåç§°", field: "materielName", type: "like" }, |
| | | { title: "å
¥åºå主é®", field: "orderId", type: "int" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | ], |
| | | [ |
| | | { |
| | | field: "orderDetailStatus",title: "订åæç»ç¶æ",type: "select",dataKey:"orderDetailStatusEnum", data: [] |
| | | }, |
| | | { title: "å建è
", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | bind: { key: "orderDetailStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | bind: { key: "createType", data: [] }, |
| | | }, |
| | | { |
| | | field: "id", |
| | | title: "åºåºå主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "departmentCode", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "string", |
| | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "设å¤ç¼å·", |
| | | title: "åºå主é®", |
| | | readonly:true, |
| | | field: "orderId", |
| | | type: "string", |
| | | }, |
| | | |
| | | { |
| | | title: "ç©æç¼å·", |
| | | required: true, |
| | | field: "deviceCode", |
| | | field: "materielCode", |
| | | type: "string", |
| | | readonly: true, |
| | | }, |
| | | { |
| | | title: "ç©æåç§°", |
| | | required: true, |
| | | field: "materielName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤åç§°", |
| | | required: true, |
| | | field: "deviceName", |
| | | title: "è¡å·", |
| | | readonly: true, |
| | | field: "rowNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç±»å", |
| | | required: true, |
| | | field: "deviceType", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç¶æ", |
| | | required: true, |
| | | field: "deviceStatus", |
| | | type: "string", |
| | | }, |
| | | |
| | | ], |
| | | [ |
| | | { title: "设å¤IP", required: true, field: "deviceIp", type: "string" }, |
| | | { |
| | | title: "设å¤ç«¯å£", |
| | | required: true, |
| | | field: "devicePort", |
| | | title: "æ¹æ¬¡å·", |
| | | field: "batchNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "PLCç±»å", |
| | | required: true, |
| | | field: "devicePlcType", |
| | | field: "orderQuantity", |
| | | title: "åæ®æ°é", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | readonly: true, |
| | | }, |
| | | { |
| | | title: "夿³¨", |
| | | field: "deviceRemark", |
| | | field: "lockQuantity", |
| | | title: "é宿°é", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | readonly: true, |
| | | }, |
| | | { |
| | | field: "overOutQuantity", |
| | | title: "å·²åºæ°é", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | readonly: true, |
| | | }, |
| | | |
| | | ], |
| | | [ |
| | | { |
| | | field: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "select",dataKey:"orderDetailStatusEnum", |
| | | data: [], |
| | | readonly: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | readonly:true, |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | readonly:true, |
| | | }, |
| | | ], |
| | | ]); |
| | |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "设å¤ç¼å·", field: "deviceCode" }, |
| | | { title: "设å¤ç±»å", field: "deviceType" }, |
| | | { title: "设å¤ç¶æ", field: "deviceStatus" }, |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "ç©æåç§°", field: "materielName", type: "like" }, |
| | | { title: "åºåºå主é®", field: "orderId", type: "int" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | ], |
| | | [ |
| | | { |
| | | field: "orderDetailStatus",title: "订åæç»ç¶æ",type: "select",dataKey:"orderDetailStatusEnum", data: [] |
| | | }, |
| | | { title: "å建è
", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | bind: { key: "orderDetailStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | {field:'palletCode',title:'æçç¼å·',type:'string'}, |
| | | {field:'locationCode',title:'è´§ä½ç¼å·',type:'string'}, |
| | | { title: "æçç¼å·", field: "palletCode", type :"string"}, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode",type:"string",readonly: true, }, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "select",dataKey: "warehouses",data: [],readonly: true,}, |
| | | {title: "åºåæç»ç¶æ",field: "stockStatus",type: "select",dataKey:"stockStatusEmun", data: [],readonly: true,}, |
| | | |
| | | ], |
| | | [ |
| | | { title: "æçç±»å", field: "palletType", type :"select",dataKey:"locationTypeEnum",data:[]}, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | readonly: true, |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | readonly: true, |
| | | }, |
| | | |
| | | ] |
| | | ]); |
| | | const searchFormFields = ref({ |
| | |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æçç¼å·", field: "palletCode" }, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode" }, |
| | | { title: "æçç¼å·", field: "palletCode", type :"like"}, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode",type:"like" }, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "select",dataKey: "warehouses",data: [],}, |
| | | {title: "åºåæç»ç¶æ",field: "status",type: "select",dataKey:"stockStatusEmun", data: []}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "id", |
| | | title: "åºå主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "palletCode", |
| | | title: "æçç¼å·", |
| | | type: "string", |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "palletType", |
| | | title: "æçç±»å", |
| | | type: "select", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "locationTypeEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockStatus", |
| | | title: "åºåæç»ç¶æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | // { |
| | | // field: "isFull", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden:true |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden:true |
| | | }, |
| | | { |
| | | field: "remark", |
| | |
| | | }, |
| | | { |
| | | title: "åºåºæ°é", |
| | | required: true, |
| | | field: "outboundQuantity", |
| | | type: "string", |
| | | readonly:true |
| | | }, |
| | | { |
| | | title: "åºåæç»ç¶æ", |
| | |
| | | field: "inboundOrderRowNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden:true |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden:true |
| | | }, |
| | | ], |
| | | |
| | | ]); |
| | |
| | | /// </summary> |
| | | [Description("QMSæ¥ææ£éªæ¥å£")] |
| | | WMS_QMSReceiveCheckApi, |
| | | |
| | | /// <summary> |
| | | /// åè°WCSä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("åè°WCSä»»å¡åæ¶")] |
| | | FeedBackWCSTaskHandCancel, |
| | | } |
| | | } |
| | |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="warehouseId"></param> |
| | | /// <returns></returns> |
| | | public Task<WebResponseContent> TaskHandCancel(int taskNum, int warehouseId); |
| | | public Task<WebResponseContent> TaskHandCancel(int taskNum); |
| | | } |
| | | } |
| | |
| | | var requestBody = new |
| | | { |
| | | msgtype = "text", |
| | | text = new { content = "å°æ´ä¸»äººè¯´: å°æ´è¦åå°å¦å¤©ä¸ç¬¬ä¸ææå¥½" }, |
| | | text = new { content = "ééæ¶æ¯æ¨é" }, |
| | | }; |
| | | var jsonBody = JsonConvert.SerializeObject(requestBody); |
| | | var content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); |
| | |
| | | if (task.TaskType == TaskTypeEnum.MesPalletLargeReturn.ObjToInt() || task.TaskType == TaskTypeEnum.MesPalletSmallReturn.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | stockInfo.Details.ForEach(x => |
| | | { |
| | | x.Status = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent InboundTaskHandCancel(int taskNum, int warehouseId) |
| | | public WebResponseContent InboundTaskHandCancel(int taskNum) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); |
| | | if (warehouse.WarehouseType == WarehouseTypEnum.æå.ToString()) |
| | | { |
| | | if(task.TaskType == TaskTypeEnum.EmptyProductBack.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | FeedBackWCSTaskHandCancel(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.èªå¨å é¤); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.proStockInfoDetails).First(); |
| | | if (proStockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¶æ¡ä¸º{task.PalletCode}ç»çä¿¡æ¯"); |
| | | } |
| | | Dt_LocationInfo prolocationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (prolocationInfo != null) |
| | | { |
| | | if (prolocationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | prolocationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | } |
| | | if(task.TaskType == TaskTypeEnum.InProduct.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | FeedBackWCSTaskHandCancel(taskNum); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.èªå¨å é¤); |
| | | _stockService.ProStockInfoService.Repository.DeleteAndMoveIntoHty(proStockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | | _stockService.ProStockInfoDetailService.Repository.DeleteAndMoveIntoHty(proStockInfo.proStockInfoDetails, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(prolocationInfo, proStockInfo.PalletType, LocationStatusEnum.Free, proStockInfo.WarehouseId); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | proStockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | proStockInfo.proStockInfoDetails.ForEach(x => |
| | | { |
| | | x.ProOutDetailStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | }); |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | FeedBackWCSTaskHandCancel(taskNum); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.èªå¨å é¤); |
| | | _stockService.ProStockInfoService.Repository.UpdateData(proStockInfo); |
| | | _stockService.ProStockInfoDetailService.Repository.UpdateData(proStockInfo.proStockInfoDetails); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(prolocationInfo, proStockInfo.PalletType, LocationStatusEnum.Free, proStockInfo.WarehouseId); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æç对åºçç»çä¿¡æ¯"); |
| | | } |
| | | if (!string.IsNullOrEmpty(stockInfo.LocationCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²ç»å®è´§ä½"); |
| | | } |
| | | if (stockInfo.Details.Count == 0 && stockInfo.PalletType != PalletTypeEnum.Empty.ObjToInt()) |
| | | { |
| | |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | FeedBackWCSTaskHandCancel(taskNum); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.èªå¨å é¤); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | | _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | } |
| | | Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); |
| | | Dt_InboundOrderDetail? inboundOrderDetail = null; |
| | | Dt_ReturnOrder? returnOrder = null; |
| | | //æ åå
¥åºæµç¨æ¥æ¾å
¥åºåæ® |
| | | if (inboundOrder != null && stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()&&(task.WarehouseId == WarehouseEnum.HA152.ObjToInt()|| task.WarehouseId == WarehouseEnum.HA58.ObjToInt())) |
| | | { |
| | | inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == stockInfo.Details.FirstOrDefault()?.InboundOrderRowNo); |
| | | foreach (var item in stockInfo.Details) |
| | | { |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | continue; |
| | | } |
| | | inboundOrderDetail.ReceiptQuantity -= item.StockQuantity; |
| | | } |
| | | //夿æ¯å¦ä¸ºéæå
¥åºå |
| | | if (inboundOrder.OrderType == InOrderTypeEnum.Return.ObjToInt()) |
| | | { |
| | | returnOrder = _inboundRepository.ReturnOrderRepository.Db.Queryable<Dt_ReturnOrder>().Where(x => x.OrderNo == inboundOrder.UpperOrderNo).Includes(x => x.Details).First(); |
| | | returnOrder.ReturnOrderStatus = ReturnOrderStatusEnum.Returned.ObjToInt(); |
| | | foreach (var item in inboundOrder.Details) |
| | | { |
| | | Dt_ReturnOrderDetail returnOrderDetail = returnOrder.Details?.FirstOrDefault(x => x.MCode == item.MaterielCode); |
| | | if (returnOrderDetail != null) |
| | | { |
| | | returnOrderDetail.ReturnQty -= item.ReceiptQuantity; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(task.WarehouseId == WarehouseEnum.HA154.ObjToInt()|| task.WarehouseId == WarehouseEnum.HA152.ObjToInt() || task.WarehouseId == WarehouseEnum.HA58.ObjToInt()) |
| | | { |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | | _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | | }else |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.ç»çæå.ObjToInt(); |
| | | } |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | FeedBackWCSTaskHandCancel(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.人工å é¤); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | if (inboundOrder != null && inboundOrderDetail != null) |
| | | { |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | } |
| | | if (returnOrder != null) |
| | | { |
| | | _inboundRepository.ReturnOrderRepository.UpdateData(returnOrder); |
| | | _inboundRepository.ReturnOrderDetailRepository.UpdateData(returnOrder.Details); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent OutboundTaskHandCancel(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); |
| | | if (warehouse.WarehouseType == WarehouseTypEnum.æå.ToString()) |
| | | { |
| | | |
| | | Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.proStockInfoDetails).First(); |
| | | if (proStockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¶æ¡ä¸º{task.PalletCode}ç»çä¿¡æ¯"); |
| | | } |
| | | Dt_LocationInfo prolocationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (prolocationInfo != null) |
| | | { |
| | | if (prolocationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | prolocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | } |
| | | proStockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | proStockInfo.proStockInfoDetails.ForEach(x => |
| | | { |
| | | x.ProOutDetailStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | x.OutboundQuantity = 0; |
| | | }); |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | FeedBackWCSTaskHandCancel(taskNum); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.èªå¨å é¤); |
| | | _stockService.ProStockInfoService.Repository.UpdateData(proStockInfo); |
| | | _stockService.ProStockInfoDetailService.Repository.UpdateData(proStockInfo.proStockInfoDetails); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(prolocationInfo, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æç对åºçç»çä¿¡æ¯"); |
| | | } |
| | | if (string.IsNullOrEmpty(stockInfo.LocationCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå¨ç«åºæªç»å®è´§ä½"); |
| | | } |
| | | if (stockInfo.Details.Count == 0 && stockInfo.PalletType != PalletTypeEnum.Empty.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æçåºåæç»ä¿¡æ¯"); |
| | | } |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | } |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | stockInfo.Details.ForEach(x => |
| | | { |
| | | x.Status = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | x.OutboundQuantity = 0; |
| | | }); |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | FeedBackWCSTaskHandCancel(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.人工å é¤); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent RelocationTaskHandCancel(Dt_Task task) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè´§ä½çåºåä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (locationInfoStart == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçèµ·ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationInfoEnd == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | FeedBackWCSTaskHandCancel(task.TaskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.人工å é¤ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å é¤); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | } |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åè°wcsæå¨åæ¶ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent FeedBackWCSTaskHandCancel(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_ApiInfo? url = _apiInfoRepository.QueryData(x => x.ApiCode == APIEnum.FeedBackWCSTaskHandCancel.ToString()).First(); |
| | | string? apiAddress = url.ApiAddress; |
| | | if (string.IsNullOrEmpty(apiAddress)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"{taskNum},æªæ¾å°WCSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | } |
| | | string responseStr = HttpHelper.Get(apiAddress + "?taskNum=" + taskNum); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡å®æè¿åå¼"); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="warehouseId"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum,int warehouseId) |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | return await Task.FromResult(InboundTaskCompleted(taskNum)); |
| | | return await Task.FromResult(InboundTaskHandCancel(taskNum)); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | return await Task.FromResult(OutboundTaskCompleted(taskNum)); |
| | | return await Task.FromResult(OutboundTaskHandCancel(taskNum)); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | return await Task.FromResult(RelocationTaskCompleted(task)); |
| | | return await Task.FromResult(RelocationTaskHandCancel(task)); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == needRelocationItem.LocationCode); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Db.Queryable<Dt_StockInfo>().Where(x => x.LocationCode == needRelocationItem.LocationCode).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè´§ä½çåºåä¿¡æ¯"); |
| | |
| | | TaskStatus = 0, |
| | | TaskType = TaskTypeEnum.Relocation.ObjToInt() |
| | | }; |
| | | |
| | | string MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode; |
| | | float Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity); |
| | | string BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo; |
| | | if (MaterielCode != null && Quantity != null && BatchNo != null) |
| | | { |
| | | newTask.MaterielCode = MaterielCode; |
| | | newTask.Quantity = Quantity; |
| | | newTask.BatchNo = BatchNo; |
| | | } |
| | | if (stockInfo.StockLength>0) |
| | | { |
| | | newTask.TaskLength = stockInfo.StockLength; |
| | |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("TaskHandCa"), AllowAnonymous] |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum ,int warehouseId) |
| | | [HttpPost, HttpGet, Route("TaskHandCancel"), AllowAnonymous] |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum) |
| | | { |
| | | return await Service.TaskHandCancel(taskNum,warehouseId); |
| | | return await Service.TaskHandCancel(taskNum); |
| | | } |
| | | } |
| | | } |