3 changed files with 140 additions and 20 deletions
-
47src/components/doctorCheck/PatientRegisterBase2.vue
-
98src/components/doctorCheck/Question.vue
-
1src/store/index.js
@ -0,0 +1,98 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<div style="margin-top: -10px;overflow-y: auto;font-size: 16px;width:100%;height:500px;"> |
||||
|
<div v-for="(item,index) in questionDatas" key="index" style="margin: 0 0 10px 10px;"> |
||||
|
<div>{{ (index + 1).toString() + '、' + item.questionName }}</div> |
||||
|
<div style="color:black;font-weight: 700;margin-left: 40px;">{{ item.answersNew }}</div> |
||||
|
</div> |
||||
|
<div v-if="questionDatas.length == 0" style="text-align: center;"> |
||||
|
无调查问卷 |
||||
|
</div> |
||||
|
</div> |
||||
|
<div style="display: flex;justify-content: space-between;"> |
||||
|
<div></div> |
||||
|
<div style=" margin-top: 5px"> |
||||
|
<el-button type="primary" @click="btnRefresh" class="commonbutton">刷新</el-button> |
||||
|
<el-button type="danger" @click="dialogWin.question = false" class="commonbutton">关闭</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import moment from "moment"; |
||||
|
import { mapState } from "vuex"; |
||||
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
||||
|
import { arrayExistObj } from "@/utlis/proFunc"; |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
components: {}, |
||||
|
props: ["refParams"], |
||||
|
data() { |
||||
|
return { |
||||
|
questionDatas: [] |
||||
|
}; |
||||
|
}, |
||||
|
//<el-tree :data="$store.state.customerOrg.ref_tree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree> |
||||
|
computed: { |
||||
|
...mapState(["dialogWin"]), |
||||
|
}, |
||||
|
//创建组件后 |
||||
|
created() { }, |
||||
|
|
||||
|
//挂载组件完成 |
||||
|
mounted() { |
||||
|
console.log('this.refParams',this.refParams) |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 刷新 |
||||
|
btnRefresh() { |
||||
|
this.questionDatas = [] |
||||
|
if (!this.refParams.idNo) return |
||||
|
postapi('/api/app/QuestionRegister/GetQuestionRegisterListByPatientRegisterNo', { idNo: this.refParams.idNo }) |
||||
|
.then(res => { |
||||
|
if (res.code > -1) { |
||||
|
this.questionDatas = res.data |
||||
|
let answersNew = '' |
||||
|
this.questionDatas.forEach(e => { |
||||
|
answersNew = '' |
||||
|
e.answers.forEach(c => { |
||||
|
if(answersNew){ |
||||
|
answersNew += ';' + c.answer |
||||
|
}else{ |
||||
|
answersNew = c.answer |
||||
|
} |
||||
|
}); |
||||
|
e.answersNew = answersNew |
||||
|
}); |
||||
|
}else{ |
||||
|
this.dialogWin.question = false |
||||
|
} |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
this.dialogWin.question = false |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
watch: { |
||||
|
"refParams.refresh":{ |
||||
|
immediate:true, |
||||
|
handler(newVal, oldVal) { |
||||
|
console.log(`watch:调查问卷refParams.refresh newVal: ${newVal}, oldVal: ${oldVal}`,this.refParams); |
||||
|
if(newVal != oldVal) this.btnRefresh(); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
@import "../../assets/css/global_dialog.css"; |
||||
|
@import "../../assets/css/global_table.css"; |
||||
|
@import "../../assets/css/global_input.css"; |
||||
|
@import "../../assets/css/global.css"; |
||||
|
@import "../../assets/css/global_tree.css"; |
||||
|
|
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue