提交 a3534c08 authored 作者: lihuihui's avatar lihuihui

update

上级 cbae525d
...@@ -193,13 +193,20 @@ export default { ...@@ -193,13 +193,20 @@ export default {
// 表单提交company_id // 表单提交company_id
params.users_info.forEach(item => { params.users_info.forEach(item => {
if (item.company) { if (item.company) {
this.$store.state.allSettings.company_map.forEach(it => { console.log(this.$store.state.allSettings.company_map, 'gs')
if (item.company === it.company_name) { const companyData = this.$store.state.allSettings.company_map || JSON.parse(window.localStorage.allSetting).company_map
item.company_id = it.id const findData = companyData.find(name => name.company_name === item.company)
} else { if (findData) {
item.company_id = '' item.company_id = findData.id
} }
}) // companyData.forEach(it => {
// console.log(item.company, 'it', it.company_name)
// if (item.company === it.company_name) {
// item.company_id = it.id
// } else {
// item.company_id = ''
// }
// })
} }
}) })
let flag = false let flag = false
......
...@@ -62,6 +62,7 @@ const store = new Vuex.Store({ ...@@ -62,6 +62,7 @@ const store = new Vuex.Store({
// 获取所有项目列表 // 获取所有项目列表
getAllSetting({ commit }) { getAllSetting({ commit }) {
getAllSetting().then(res => { getAllSetting().then(res => {
window.localStorage.allSetting = JSON.stringify(res.data)
commit('setAllSettings', res.data) commit('setAllSettings', res.data)
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论