From bfe469c7fa604a6431d58ea5e5143c959d76bd86 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期二, 11 十一月 2025 16:09:38 +0800
Subject: [PATCH] #
---
src/main/webapp/views/components/WatchCrnCard.js | 199 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 156 insertions(+), 43 deletions(-)
diff --git a/src/main/webapp/views/components/WatchCrnCard.js b/src/main/webapp/views/components/WatchCrnCard.js
index f38e6c4..5a3c99e 100644
--- a/src/main/webapp/views/components/WatchCrnCard.js
+++ b/src/main/webapp/views/components/WatchCrnCard.js
@@ -1,7 +1,23 @@
-Vue.component('watch-crn-card', {
- template: `
+Vue.component("watch-crn-card", {
+ template: `
<div>
- <div>鍫嗗灈鏈虹洃鎺�</div>
+ <div style="display: flex;margin-bottom: 10px;">
+ <div style="width: 100%;">鍫嗗灈鏈虹洃鎺�</div>
+ <div style="width: 100%;text-align: right;display: flex;"><el-input size="mini" v-model="searchCrnNo" placeholder="璇疯緭鍏ュ爢鍨涙満鍙�"></el-input><el-button @click="getCrnStateInfo" size="mini">鏌ヨ</el-button></div>
+ </div>
+ <div style="margin-bottom: 10px;">
+ <div style="margin-bottom: 5px;">
+ <el-button @click="openControl" size="mini">鎺у埗涓績</el-button>
+ </div>
+ <div v-if="showControl" style="display: flex;justify-content: space-between;flex-wrap: wrap;">
+ <div style="margin-bottom: 10px;width: 33%;"><el-input size="mini" v-model="controlParam.crnNo" placeholder="鍫嗗灈鏈哄彿"></el-input></div>
+ <div style="margin-bottom: 10px;width: 33%;"><el-input size="mini" v-model="controlParam.sourceLocNo" placeholder="婧愮偣"></el-input></div>
+ <div style="margin-bottom: 10px;width: 33%;"><el-input size="mini" v-model="controlParam.targetLocNo" placeholder="鐩爣鐐�"></el-input></div>
+ <div style="margin-bottom: 10px;"><el-button @click="controlCommandTransport()" size="mini">鍙栨斁璐�</el-button></div>
+ <div style="margin-bottom: 10px;"><el-button @click="controlCommandMove()" size="mini">绉诲姩</el-button></div>
+ <div style="margin-bottom: 10px;"><el-button @click="controlCommandTaskComplete()" size="mini">浠诲姟瀹屾垚</el-button></div>
+ </div>
+ </div>
<el-collapse v-model="activeNames">
<el-collapse-item v-for="(item) in crnList" :name="item.crnNo">
<template slot="title">
@@ -42,46 +58,143 @@
</el-collapse>
</div>
`,
- props: ['param'],
- data() {
- return {
- crnList: [],
- activeNames: ''
+ props: ["param"],
+ data() {
+ return {
+ crnList: [],
+ activeNames: "",
+ searchCrnNo: "",
+ showControl: true,
+ controlParam: {
+ crnNo: "",
+ sourceLocNo: "",
+ targetLocNo: "",
+ },
+ };
+ },
+ created() {
+ setInterval(() => {
+ this.getCrnStateInfo();
+ }, 1000);
+ },
+ watch: {
+ param: {
+ handler(newVal, oldVal) {
+ if (newVal.crnNo != 0) {
+ this.activeNames = newVal.crnNo;
}
+ },
+ deep: true, // 娣卞害鐩戝惉宓屽灞炴��
+ immediate: true, // 绔嬪嵆瑙﹀彂涓�娆★紙鍙�夛級
},
- created() {
- setInterval(() => {
- this.getCrnStateInfo()
- },1000)
- },
- watch: {
- param: {
- handler(newVal, oldVal) {
- if(newVal.crnNo != 0) {
- this.activeNames = newVal.crnNo
- }
- },
- deep: true, // 娣卞害鐩戝惉宓屽灞炴��
- immediate: true // 绔嬪嵆瑙﹀彂涓�娆★紙鍙�夛級
- }
- },
- methods: {
- getCrnStateInfo() {
- let that = this
- $.ajax({
- url: baseUrl + "/crn/table/crn/state",
- headers: {
- 'token': localStorage.getItem('token')
- },
- method: "post",
- success: (res) => {
- // 鍫嗗灈鏈轰俊鎭〃鑾峰彇
- if (res.code == 200) {
- let list = res.data;
- that.crnList = list;
- }
- }
- })
+ },
+ methods: {
+ getCrnStateInfo() {
+ let that = this;
+ $.ajax({
+ url: baseUrl + "/crn/table/crn/state",
+ headers: {
+ token: localStorage.getItem("token"),
},
- }
-});
\ No newline at end of file
+ method: "post",
+ success: (res) => {
+ // 鍫嗗灈鏈轰俊鎭〃鑾峰彇
+ if (res.code == 200) {
+ let list = res.data;
+
+ if (that.searchCrnNo == "") {
+ that.crnList = list;
+ } else {
+ let tmp = [];
+ list.forEach((item) => {
+ if (item.crnNo == that.searchCrnNo) {
+ tmp.push(item);
+ }
+ });
+ that.crnList = tmp;
+ }
+ }
+ },
+ });
+ },
+ openControl() {
+ this.showControl = !this.showControl;
+ },
+ controlCommandTransport() {
+ let that = this;
+ //鍙栨斁璐�
+ $.ajax({
+ url: baseUrl + "/crn/command/take",
+ headers: {
+ token: localStorage.getItem("token"),
+ },
+ contentType: "application/json",
+ method: "post",
+ data: JSON.stringify(that.controlParam),
+ success: (res) => {
+ if (res.code == 200) {
+ that.$message({
+ message: res.msg,
+ type: "success",
+ });
+ } else {
+ that.$message({
+ message: res.msg,
+ type: "warning",
+ });
+ }
+ },
+ });
+ },
+ controlCommandMove() {
+ let that = this;
+ $.ajax({
+ url: baseUrl + "/crn/command/move",
+ headers: {
+ token: localStorage.getItem("token"),
+ },
+ contentType: "application/json",
+ method: "post",
+ data: JSON.stringify(that.controlParam),
+ success: (res) => {
+ if (res.code == 200) {
+ that.$message({
+ message: res.msg,
+ type: "success",
+ });
+ } else {
+ that.$message({
+ message: res.msg,
+ type: "warning",
+ });
+ }
+ },
+ });
+ },
+ controlCommandTaskComplete() {
+ let that = this;
+ $.ajax({
+ url: baseUrl + "/crn/command/taskComplete",
+ headers: {
+ token: localStorage.getItem("token"),
+ },
+ contentType: "application/json",
+ method: "post",
+ data: JSON.stringify(that.controlParam),
+ success: (res) => {
+ if (res.code == 200) {
+ that.$message({
+ message: res.msg,
+ type: "success",
+ });
+ } else {
+ that.$message({
+ message: res.msg,
+ type: "warning",
+ });
+ }
+ },
+ });
+ },
+ },
+});
--
Gitblit v1.9.1