From ff4b927e01191cd810805549d446bcfb32e909d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=94=A1=E7=8E=B2?=
<8702040+cai-ling@user.noreply.gitee.com>
Date: Tue, 24 Dec 2024 15:11:45 +0800
Subject: [PATCH] no message
---
src/components/time.vue | 2 +-
src/pages/index.vue | 58 +++++++++++++++++++++++++----------------
src/style/layout.styl | 10 ++++---
3 files changed, 42 insertions(+), 28 deletions(-)
diff --git a/src/components/time.vue b/src/components/time.vue
index 75ff130..4bd1e5f 100644
--- a/src/components/time.vue
+++ b/src/components/time.vue
@@ -21,7 +21,7 @@ export default {
},
mounted () {
this.updateTime()
- // this.timer = window.setInterval(this.updateTime, 1000)
+ this.timer = window.setInterval(this.updateTime, 1000)
},
methods: {
updateTime () {
diff --git a/src/pages/index.vue b/src/pages/index.vue
index dad52eb..462f182 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -17,10 +17,6 @@
-
-
-
-
@@ -33,8 +29,9 @@
| 开工时间 |
站点编码 |
工单状态 |
+ 操作 |
-
+
| {{ e.mfg_order_name }} |
{{ e.product_name }} |
{{ e.description }} |
@@ -43,6 +40,13 @@
{{ e.StartTime }} |
{{ e.point_code }} |
{{ e.status }} |
+
+
+
+
+
+
+ |
@@ -62,17 +66,26 @@ export default {
},
data () {
return {
- timer: null,
value: '',
options: [],
dataList: [],
- pkId: '',
disabled: false
}
},
+ beforeRouteLeave (to, from, next) {
+ if (to.path === '/home' || to.path === '/setup') {
+ this.$store.dispatch('setKeepAlive', [])
+ }
+ next()
+ },
mounted () {
this._queryDevices()
},
+ activated () {
+ if (this.value) {
+ this._queryOrders(this.value)
+ }
+ },
methods: {
async _queryDevices () {
let res = await queryDevices()
@@ -87,37 +100,34 @@ export default {
this._queryOrders(e)
}
},
- toCheck (e) {
- this.pkId = this.pkId === e.mfg_order_name ? '' : e.mfg_order_name
- },
- async _startOrder () {
+ async _startOrder (e) {
this.disabled = true
- if (!this.pkId) {
- this.disabled = false
- return
- }
try {
- let res = await startOrder(this.value, this.pkId)
+ let res = await startOrder(this.value, e.mfg_order_name)
if (res.message) {
this.disabled = false
this.$store.dispatch('setKeepAlive', ['index'])
this.$router.push({
path: '/task',
- query: {order: this.pkId}
+ query: {order: e.mfg_order_name}
})
}
} catch (e) {
this.disabled = false
}
},
- async _forceFinish () {
+ toJump (e) {
+ this.$store.dispatch('setKeepAlive', ['index'])
+ this.$router.push({
+ path: '/task',
+ query: {order: e.mfg_order_name}
+ })
+ },
+ async _forceFinish (e) {
this.disabled = true
- if (!this.pkId) {
- this.disabled = false
- return
- }
try {
- let res = await forceFinish(this.pkId)
+ let res = await forceFinish(e.mfg_order_name)
+ this._queryOrders(this.value)
this.$message({
message: res.message,
type: 'success'
@@ -133,4 +143,6 @@ export default {
diff --git a/src/style/layout.styl b/src/style/layout.styl
index 2a69018..4c6cd7d 100644
--- a/src/style/layout.styl
+++ b/src/style/layout.styl
@@ -141,10 +141,10 @@ header
line-height:.35rem;
height: .82rem;
color: #fff;
-.grid_wraper table .tr:nth-child(odd) td
- background: rgba(31,46,73,0.3);
-.grid_wraper table .tr:nth-child(even) td
- background: rgba(31,46,73,0.5);
+// .grid_wraper table .tr:nth-child(odd) td
+// background: rgba(31,46,73,0.3);
+// .grid_wraper table .tr:nth-child(even) td
+// background: rgba(31,46,73,0.5);
.grid_wraper table .tr_selected td
background: rgba(63,106,202,0.3);
.grid_wraper table th:first-child
@@ -170,6 +170,8 @@ header
margin 0 .1rem;
background: transparent;
border: 0;
+ &:disabled
+ color: #ff803c
// 下拉框
.el-select {