Files
apt-nl/src/vuex/modules/data.js

48 lines
1.0 KiB
JavaScript
Raw Normal View History

2023-05-05 14:20:13 +08:00
import * as types from '../types'
2023-05-08 15:39:30 +08:00
import { getStore, setStore } from '@config/utils.js'
2023-05-05 14:20:13 +08:00
const state = {
materObj: {}, // 物料查询-盘点修改
2023-05-08 15:39:30 +08:00
hcxCheckObj: {}, // 缓存线盘点 - 盘点修改,
defaultActive: getStore('defaultActive') || '1',
sideActive: getStore('sideActive') || '1'
2023-05-05 14:20:13 +08:00
}
const getters = {
materObj: state => state.materObj,
2023-05-08 15:39:30 +08:00
hcxCheckObj: state => state.hcxCheckObj,
defaultActive: state => state.defaultActive
2023-05-05 14:20:13 +08:00
}
const actions = {
materObj ({commit}, res) {
commit(types.MATER_OBJ, res)
},
hcxCheckObj ({commit}, res) {
commit(types.HCX_CHECK_OBJ, res)
2023-05-08 15:39:30 +08:00
},
getDefaultActive ({commit}, res) {
setStore('defaultActive', res)
commit(types.GET_DEFAULT_ACTIVE, res)
2023-05-05 14:20:13 +08:00
}
}
const mutations = {
[types.MATER_OBJ] (state, res) {
state.materObj = res
},
[types.HCX_CHECK_OBJ] (state, res) {
state.hcxCheckObj = res
2023-05-08 15:39:30 +08:00
},
[types.GET_DEFAULT_ACTIVE] (state, res) {
state.defaultActive = res
2023-05-05 14:20:13 +08:00
}
}
export default {
state,
getters,
actions,
mutations
}