修改传参

This commit is contained in:
lijiarao
2021-08-27 16:07:09 +08:00
parent 768031ab73
commit b4ce240f11
4 changed files with 12 additions and 4 deletions
+9 -2
View File
@@ -18,8 +18,15 @@ export default new Vuex.Store({
enhance, enhance,
online online
}, },
state: {}, state: {
mutations: {}, // 当前的项目
currentProjetcInfo:{}
},
mutations: {
"SET_CURRENTPROJECT":(state,info) =>{
state.currentProjetcInfo = Object.assign({},info)
}
},
actions: {}, actions: {},
getters getters
}); });
@@ -147,7 +147,7 @@ export default {
record:JSON.stringify(record) record:JSON.stringify(record)
} }
}) })
} },
} }
} }
</script> </script>
@@ -203,6 +203,7 @@ export default {
created() { created() {
this.currentInfo = Object.assign({},JSON.parse(this.$route.query.record)) this.currentInfo = Object.assign({},JSON.parse(this.$route.query.record))
console.log("=====",this.currentInfo) console.log("=====",this.currentInfo)
this.$store.commit('SET_CURRENTPROJECT', this.currentInfo )
}, },
methods: { methods: {
/* /*
@@ -255,7 +255,7 @@ export default {
} }
const formData = Object.assign(this.model, values) const formData = Object.assign(this.model, values)
formData.companyId = values.companyId.id formData.companyId = values.companyId.id
console.log('表单提交数据', formData) formData.projectId = this.$store.state.currentProjetcInfo.id
httpAction(httpurl, formData, method).then((res) => { httpAction(httpurl, formData, method).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)