微调,下拉联动

This commit is contained in:
@fawn-nine
2023-09-01 13:20:22 +08:00
parent 2f73d642c3
commit 163df2be57
2 changed files with 51 additions and 8 deletions

View File

@@ -57,7 +57,7 @@
df_jour: [],
addVisible: false,
addForm: {
journal_id: 0,
journal_id: this.$route.query.journal_id - 0,
journal_title: '',
group_name: ''
},
@@ -71,9 +71,9 @@
}
};
},
created() {
created() {
this.getJour();
},
},
methods: {
// 获取期刊列表
getJour() {
@@ -84,8 +84,14 @@
.then(res => {
if (res.code == 0) {
this.df_jour = res.data.journals;
this.addForm.journal_id = this.df_jour[0].journal_id
this.addForm.journal_title = this.df_jour[0].title
this.df_jour.map(item => {
if(this.addForm.journal_id == item.journal_id){
this.addForm.journal_title = item.journal_id
this.addForm.journal_title = item.title
}
})
//this.addForm.journal_id = this.df_jour[0].journal_id
//this.addForm.journal_title = this.df_jour[0].title
this.getDate();
} else {
this.$message.error(res.msg);
@@ -131,6 +137,7 @@
// 保存添加
saveAdd(addForm) {
console.log(this.addForm,'this.addForm')
this.$refs.add_Form.validate((valid) => {
if (valid) {
this.$api