|
@@ -2,8 +2,9 @@ import Vue from 'vue'
|
|
|
import Vuex from 'vuex'
|
|
|
import publicType from './publicType.js' // 公共的类型
|
|
|
import { reqWorkerList, reqBuildList } from "@/api/fileInfo.js";
|
|
|
-import { reqBasicsInfoList} from "@/api/material.js";
|
|
|
+import { reqBasicsInfoList } from "@/api/material.js";
|
|
|
import { reqBatchList } from "@/api/production.js";
|
|
|
+import { reqStoreList } from "@/api/material.js";
|
|
|
|
|
|
Vue.use(Vuex)
|
|
|
|
|
@@ -11,15 +12,16 @@ export default new Vuex.Store({
|
|
|
strict: true,
|
|
|
state: {
|
|
|
token: localStorage.getItem("token"),
|
|
|
- workerList: [{id:1}], // 员工列表 (加{id:1} 是为了防止刷新时报错,因为设置默认值时用到过)
|
|
|
- areaList: [{id:1}], // 栋舍列表
|
|
|
- drugBasicsList: [{id:1}], // 基础药品列表
|
|
|
+ workerList: [{ id: 1 }], // 员工列表 (加{id:1} 是为了防止刷新时报错,因为设置默认值时用到过)
|
|
|
+ areaList: [{ id: 1 }], // 栋舍列表
|
|
|
+ drugBasicsList: [{ id: 1 }], // 基础药品列表
|
|
|
batchList: [], // 批次列表
|
|
|
+ storeList: [], // 批次列表
|
|
|
...publicType
|
|
|
},
|
|
|
getters: {},
|
|
|
mutations: {
|
|
|
- setState(state, [key,val]) {
|
|
|
+ setState(state, [key, val]) {
|
|
|
state[key] = val
|
|
|
}
|
|
|
},
|
|
@@ -63,6 +65,16 @@ export default new Vuex.Store({
|
|
|
}).then(res => {
|
|
|
commit('setState', ['batchList', res.content])
|
|
|
})
|
|
|
+ },
|
|
|
+ /* 获取库存列表 登录后在 storeList.vue时调用了*/
|
|
|
+ getStoreList({ commit }) {
|
|
|
+ reqStoreList({
|
|
|
+ searchStr: '',
|
|
|
+ pageSize: 1000,
|
|
|
+ pageNum: 1
|
|
|
+ }).then(res => {
|
|
|
+ commit('setState', ['storeList', res.content])
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|