no message

This commit is contained in:
蔡玲
2024-12-24 15:11:45 +08:00
parent 2012487ac2
commit ff4b927e01
3 changed files with 42 additions and 28 deletions

View File

@@ -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 () {

View File

@@ -17,10 +17,6 @@
</el-select>
</div>
</div>
<div class="zd-col-18 zd-row jcflexend">
<button class="button btn-primary" :class="{'btn-info': !pkId}" :disabled="disabled" @click="_startOrder">开始</button>
<button class="button btn-primary mgl2" :class="{'btn-info': !pkId}" :disabled="disabled" @click="_forceFinish">强制完成</button>
</div>
</div>
<div class="contianer mgt2 grid_wraper">
<table>
@@ -33,8 +29,9 @@
<th>开工时间</th>
<th>站点编码</th>
<th>工单状态</th>
<th style="text-align: center">操作</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i" :class="{'tr_selected': pkId === e.mfg_order_name}" @click="toCheck(e)">
<tr v-for="(e, i) in dataList" :key="i">
<td>{{ e.mfg_order_name }}</td>
<td>{{ e.product_name }}</td>
<td>{{ e.description }}</td>
@@ -43,6 +40,13 @@
<td>{{ e.StartTime }}</td>
<td>{{ e.point_code }}</td>
<td>{{ e.status }}</td>
<td>
<div class="zd-row btn_wraper">
<button v-show="e.status === '开始'" class="grid_button" :disabled="disabled" @click="_startOrder(e)">开始</button>
<button v-show="e.status === '执行中'" class="grid_button" @click="toJump(e)">执行中</button>
<button class="grid_button" :disabled="disabled" @click="_forceFinish(e)">强制完成</button>
</div>
</td>
</tr>
</table>
</div>
@@ -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 {
<style lang="stylus" scoped>
// @import '~@style/mixin'
.btn_wraper
width 2.6rem
</style>

View File

@@ -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 {