修改bug 55897 没有自动带出分类以及标准信息

This commit is contained in:
hanshaozhuang
2022-06-24 15:49:00 +08:00
parent 8cfccdb522
commit 894d891b46
2 changed files with 36 additions and 12 deletions
@@ -1321,6 +1321,7 @@ export default {
answerList: [], answerList: [],
standList: [], standList: [],
questionsList: [], questionsList: [],
standMap: new Map()
} }
}, },
mounted(){ mounted(){
@@ -1352,6 +1353,12 @@ export default {
} }
}, },
methods:{ methods:{
refreshStandMap(){
this.standMap = new Map()
this.standList.forEach(item=>{
this.standMap.set(item.standardId,item)
})
},
checkedRole(data){ checkedRole(data){
if(data[0].id){ if(data[0].id){
let asdId = sessionStorage.getItem('queId') let asdId = sessionStorage.getItem('queId')
@@ -1666,15 +1673,16 @@ export default {
queBtn(){ queBtn(){
this.fileList = [] this.fileList = []
// 清空提问 // 清空提问
this.standType = "INLAND" const selectedStand = this.activestand == '0' ? this.standList[0] : this.standMap.get(this.activestand)
this.standType = selectedStand.classification
this.questionForm = { this.questionForm = {
pubQue : '',//公共问题 pubQue : selectedStand.classification === "OTHER" ? selectedStand.standardId : '',//公共问题
classification: 'INLAND', //标准类型 classification: selectedStand.classification, //标准类型
problemDescription: '', //问题 problemDescription: '', //问题
questioner: this.$store.getters.userInfo.userId, //提问人 questioner: this.$store.getters.userInfo.userId, //提问人
standardEncdoing: '', //标准编号 standardEncdoing: selectedStand.standardEncdoing, //标准编号
standardName: '', //标准名称 standardName: selectedStand.standardName, //标准名称
standardId:'', //标准id standardId: selectedStand.standardId, //标准id
fileList: '', fileList: '',
} }
this.dialogVisible = true this.dialogVisible = true
@@ -1720,6 +1728,7 @@ export default {
_this: this _this: this
}, res => { }, res => {
this.standList = res.data this.standList = res.data
this.refreshStandMap()
}) })
}, },
//问题查询 //问题查询
@@ -1742,6 +1751,7 @@ export default {
_this: this, _this: this,
}, res => { }, res => {
this.standList = res.data this.standList = res.data
this.refreshStandMap()
this.questionClick() this.questionClick()
}) })
}, },
@@ -1754,6 +1764,7 @@ export default {
_this: this _this: this
}, res => { }, res => {
this.standList = res.data this.standList = res.data
this.refreshStandMap()
this.questionClick() this.questionClick()
}, e =>{ }, e =>{
@@ -1765,6 +1776,7 @@ export default {
_this: this _this: this
}, res =>{ }, res =>{
this.standList = res.data this.standList = res.data
this.refreshStandMap()
this.questionClick() this.questionClick()
}, e => { }, e => {
@@ -777,6 +777,7 @@ export default {
standList: [], standList: [],
standIdList: [], standIdList: [],
questionsList: [], questionsList: [],
standMap: new Map()
} }
}, },
mounted(){ mounted(){
@@ -819,6 +820,12 @@ export default {
}); });
}, },
methods:{ methods:{
refreshStandMap(){
this.standMap = new Map()
this.standList.forEach(item=>{
this.standMap.set(item.standardId,item)
})
},
changeInput:debounce(function(val){ changeInput:debounce(function(val){
if(val.length){ if(val.length){
this.$http.get('lawss/AskQuestions/resemblance',{ this.$http.get('lawss/AskQuestions/resemblance',{
@@ -1040,15 +1047,16 @@ export default {
//提问按钮 //提问按钮
queBtn(){ queBtn(){
this.fileList = [] this.fileList = []
this.standType = "INLAND" const selectedStand = this.activestand == '0' ? this.standList[0] : this.standMap.get(this.activestand)
this.standType = selectedStand.classification
this.questionForm = { this.questionForm = {
pubQue : '',//公共问题 pubQue : selectedStand.classification === "OTHER" ? selectedStand.standardId : '',//公共问题
classification: 'INLAND', //标准类型 classification: selectedStand.classification, //标准类型
problemDescription: '', //问题 problemDescription: '', //问题
questioner: this.$store.getters.userInfo.userId, //提问人 questioner: this.$store.getters.userInfo.userId, //提问人
standardEncdoing: '', //标准编号 standardEncdoing: selectedStand.standardEncdoing, //标准编号
standardName: '', //标准名称 standardName: selectedStand.standardName, //标准名称
standardId:'', //标准id standardId: selectedStand.standardId, //标准id
fileList: '', fileList: '',
} }
this.dialogVisible = true this.dialogVisible = true
@@ -1076,6 +1084,7 @@ export default {
_this: this _this: this
}, res => { }, res => {
this.standList = res.data this.standList = res.data
this.refreshStandMap()
}) })
}, },
//问题查询 //问题查询
@@ -1107,6 +1116,7 @@ export default {
_this: this _this: this
}, res =>{ }, res =>{
this.standList = res.data this.standList = res.data
this.refreshStandMap()
if(this.$route.query.queId){ if(this.$route.query.queId){
this.activestand = this.standList[0].standardId this.activestand = this.standList[0].standardId
this.queSearch() this.queSearch()
@@ -1129,6 +1139,7 @@ export default {
}) })
if(queNumber === 0){ if(queNumber === 0){
this.standList = res.data this.standList = res.data
this.refreshStandMap()
} }
}, e => { }, e => {
@@ -1235,6 +1246,7 @@ export default {
this.standSearch2() this.standSearch2()
break break
} }
this.queSearch()
}, e => { }, e => {
}) })