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 () { mounted () {
this.updateTime() this.updateTime()
// this.timer = window.setInterval(this.updateTime, 1000) this.timer = window.setInterval(this.updateTime, 1000)
}, },
methods: { methods: {
updateTime () { updateTime () {

View File

@@ -17,10 +17,6 @@
</el-select> </el-select>
</div> </div>
</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>
<div class="contianer mgt2 grid_wraper"> <div class="contianer mgt2 grid_wraper">
<table> <table>
@@ -33,8 +29,9 @@
<th>开工时间</th> <th>开工时间</th>
<th>站点编码</th> <th>站点编码</th>
<th>工单状态</th> <th>工单状态</th>
<th style="text-align: center">操作</th>
</tr> </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.mfg_order_name }}</td>
<td>{{ e.product_name }}</td> <td>{{ e.product_name }}</td>
<td>{{ e.description }}</td> <td>{{ e.description }}</td>
@@ -43,6 +40,13 @@
<td>{{ e.StartTime }}</td> <td>{{ e.StartTime }}</td>
<td>{{ e.point_code }}</td> <td>{{ e.point_code }}</td>
<td>{{ e.status }}</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> </tr>
</table> </table>
</div> </div>
@@ -62,17 +66,26 @@ export default {
}, },
data () { data () {
return { return {
timer: null,
value: '', value: '',
options: [], options: [],
dataList: [], dataList: [],
pkId: '',
disabled: false disabled: false
} }
}, },
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/setup') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
mounted () { mounted () {
this._queryDevices() this._queryDevices()
}, },
activated () {
if (this.value) {
this._queryOrders(this.value)
}
},
methods: { methods: {
async _queryDevices () { async _queryDevices () {
let res = await queryDevices() let res = await queryDevices()
@@ -87,37 +100,34 @@ export default {
this._queryOrders(e) this._queryOrders(e)
} }
}, },
toCheck (e) { async _startOrder (e) {
this.pkId = this.pkId === e.mfg_order_name ? '' : e.mfg_order_name
},
async _startOrder () {
this.disabled = true this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
try { try {
let res = await startOrder(this.value, this.pkId) let res = await startOrder(this.value, e.mfg_order_name)
if (res.message) { if (res.message) {
this.disabled = false this.disabled = false
this.$store.dispatch('setKeepAlive', ['index']) this.$store.dispatch('setKeepAlive', ['index'])
this.$router.push({ this.$router.push({
path: '/task', path: '/task',
query: {order: this.pkId} query: {order: e.mfg_order_name}
}) })
} }
} catch (e) { } catch (e) {
this.disabled = false 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 this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
try { try {
let res = await forceFinish(this.pkId) let res = await forceFinish(e.mfg_order_name)
this._queryOrders(this.value)
this.$message({ this.$message({
message: res.message, message: res.message,
type: 'success' type: 'success'
@@ -133,4 +143,6 @@ export default {
<style lang="stylus" scoped> <style lang="stylus" scoped>
// @import '~@style/mixin' // @import '~@style/mixin'
.btn_wraper
width 2.6rem
</style> </style>

View File

@@ -141,10 +141,10 @@ header
line-height:.35rem; line-height:.35rem;
height: .82rem; height: .82rem;
color: #fff; color: #fff;
.grid_wraper table .tr:nth-child(odd) td // .grid_wraper table .tr:nth-child(odd) td
background: rgba(31,46,73,0.3); // background: rgba(31,46,73,0.3);
.grid_wraper table .tr:nth-child(even) td // .grid_wraper table .tr:nth-child(even) td
background: rgba(31,46,73,0.5); // background: rgba(31,46,73,0.5);
.grid_wraper table .tr_selected td .grid_wraper table .tr_selected td
background: rgba(63,106,202,0.3); background: rgba(63,106,202,0.3);
.grid_wraper table th:first-child .grid_wraper table th:first-child
@@ -170,6 +170,8 @@ header
margin 0 .1rem; margin 0 .1rem;
background: transparent; background: transparent;
border: 0; border: 0;
&:disabled
color: #ff803c
// //
.el-select { .el-select {