4人一屏 通过watch来解决失败

This commit is contained in:
qianhao.xu
2024-02-02 16:53:11 +08:00
parent 9c0e859f2f
commit 195bcdba6c
3 changed files with 72 additions and 79 deletions

View File

@@ -19,8 +19,8 @@ const getters = {
onlineUserNum: (state) => state.socket.onlineNum,
noticeList: (state) => state.socket.noticeList,
//质量管理模块
currentWorkOrder_first: (state) => state.socket.currentWorkOrder_first,
currentWorkOrder_again: (state) => state.socket.currentWorkOrder_again,
currentWorkOrder_thirty: (state) => state.socket.currentWorkOrder_thirty,
currentWorkOrder_first: (state) => state.quality.currentWorkOrder_first,
currentWorkOrder_again: (state) => state.quality.currentWorkOrder_again,
currentWorkOrder_thirty: (state) => state.quality.currentWorkOrder_thirty,
}
export default getters

View File

@@ -1,4 +1,8 @@
// 质量模块 共享变量
import { get_next_current_workorder, get_previous_current_workorder } from '@/api/qualityManagement/firstFQC.js'
import { Message, Notify } from 'element-ui'
const state = {
currentWorkOrder_first: null, // 当前工单(首检)
currentWorkOrder_again: null, // 当前工单(二检)
@@ -18,21 +22,47 @@ const mutations = {
}
const actions = {
change__currentWorkOrder_first({ commit }, data) {
commit('SET_currentWorkOrder_first', data)
/* 首检 */
// 获取上一个工单
Get_previous_currentWorkOrder_first({ commit }, data) {
get_previous_current_workorder().then((res) => {
if (res.code == 200) {
if (res.data != null) {
commit('SET_currentWorkOrder_first', res.data)
Message.success('获取工单号成功')
} else {
Notify.warning('没有生产工单')
}
} else if (res.code == 210) {
Notify.warning('没有生产工单')
}
})
},
change__currentWorkOrder_again({ commit }, data) {
commit('SET_currentWorkOrder_again', data)
//获取下一个工单
Get_next_current_workorder_first({ commit }, data) {
get_next_current_workorder().then((res) => {
if (res.code == 200) {
if (res.data != null) {
commit('SET_currentWorkOrder_first', res.data)
Message.success('获取工单号成功')
} else {
Notify.warning('已经是最后一个工单,没有工单了')
}
} else if (res.code == 210) {
Notify.warning('已经是最后一个工单,没有工单了')
}
})
},
change__currentWorkOrder_thirty({ commit }, data) {
commit('SET_currentWorkOrder_thirty', data)
},
}
export default {
namespaced: true,
state,
mutations,
actions
}
namespaced: true,
state,
mutations,
actions,
}