123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- <template>
- <div class="symp-wrap">
- <div
- class="choose"
- v-if="chooseSymp.length>0"
- >
- <p class="quest">已选症状</p>
- <p
- class="choo-symp"
- v-for="(v,i) in chooseSymp"
- >
- <span @click="showChecked(v)">{{v.name}}</span>
- <span @click="deletSymp(v,i)"><img
- src="../images/delete.png"
- alt=""
- ></span>
- </p>
- </div>
- <div class="label">
- <p class="quest">请问您有哪些不适?<img
- @click="search(true)"
- class="searchImg"
- src="../images/search.png"
- alt=""
- ></p>
- <span
- class="symp"
- v-for="(it,ind) in symp"
- :key="it.conceptId"
- @click="showDetil(it)"
- >{{it.name}}</span>
- </div>
- <div
- class="result"
- v-if="checkText.length>0"
- >
- <p class="title">症状情况</p>
- <p v-for="(value,index) in checkText">{{value.text}}</p>
- </div>
- <div :class="['footer',{'nofoot':chooseSymp.length==0}]"
- @click="toNext"
- >下一步</div>
- <div
- class="detail"
- v-if="show"
- >
- <DetailBox
- @close="closeDetal"
- :data="labelDetail"
- :moduleType="1"
- v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
- @pComplete="complete"
- @reload="reload"
- />
- </div>
- <Toast
- :message="delText"
- :show="showToast"
- @comfirn="comfirnDel"
- @cancel="cancelDel"
- />
- <Search
- v-if="searchShow"
- @search="search"
- @showDetil="showDetil"
- :age="age"
- :chooseSymp="chooseSymp"
- :sexType="sexType"
- ></Search>
- </div>
- </template>
- <script type="text/javascript">
- import api from '@utils/api.js';
- import DetailBox from './DetailBox.vue';
- import Toast from '../common/Toast.vue';
- import Search from './Search.vue';
- export default {
- name: 'Symptom',
- data() {
- let { datas, pathInfo } = this.$store.state;
- const { choose, text } = this.$store.state.symptom;
- return {
- age: pathInfo.patientAge,
- sexType: pathInfo.patientSex == '男' ? 1 : (pathInfo.patientSex == '女' ? 2 : 3),
- deptName: pathInfo.selfDeptName,
- hosCode: pathInfo.hospitalCode,
- choose: false,
- check: false,
- show: false, //显示明细
- chooseSymp: choose, //已选症状
- symp: [], //症状
- labelDetail: {}, //明细
- checkText: text, //症状情况文字
- questId: null, //id
- delText: "是否删除该信息?<br/> (已填内容将清除)",
- delIndex: null,
- showToast: false,
- finished: false, //是否填写了明细
- searchShow: false,//显示搜索界面
- }
- },
- created() {
- if (this.chooseSymp.length > 0) {
- // 推送
- const sympText = this.getSympText();
- this.getPush(sympText);
- } else {
- this.getSympList(); //常见
- }
- },
- methods: {
- searchVal(val) {
- console.log(val)
- },
- search(flg) {
- this.searchShow = flg
- },
- getSympList() {
- const param = {
- "age": this.age,
- "deptName": this.deptName,
- "sexType": this.sexType
- }
- api.getSymptom(param).then((res) => {
- const result = res.data;
- if (result.code == 0) {
- this.symp = result.data;
- }
- })
- },
- toNext() {
- // 把1切换成完成图标,且2高亮--判断有几个模块显示,1个--提交预览;1个以上--下一步
- // if (this.chooseSymp.length == 0) { return }
- this.$emit('next');
- // 把症状情况的数据存起-已选
- this.$store.commit('setChoose', { choose: this.chooseSymp, type: "1" });
- },
- showDetil(item) {
- this.chooseSymp.push(item);
- this.questId = item.questionId || item.id || item.conceptId;
- const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
- //将选中的name存到store中的text
- this.$store.commit('setText', { type: "1", text: item.name, pId: this.questId });
- if (id) {
- const param = {
- "age": this.age,
- "id": id,
- "sexType": this.sexType
- }
- api.getById(param).then((res) => {
- const result = res.data;
- if (result.code == 0) {
- const mapping = result.data.questionMapping;
- this.labelDetail = result.data;
- this.$store.commit('setOrigin', { type: "1", data: result.data });
- if (mapping && mapping.length > 0) {
- this.show = true;
- }
- }
- })
- } else {//没有questionId或id 就没有详情,则直接调推送
- const sympText = this.getSympText();
- this.getPush(sympText);
- this.checkText = this.$store.state.symptom.text;
- }
- },
- getSympText() {
- const text = this.$store.state.symptom.text;
- let msg = "";
- for (let i in text) {
- msg += text[i].text;
- }
- return msg;
- },
- getPush(symptoms) {//推理
- const param = {
- "age": this.age,
- "hosCode": this.hosCode,
- "sex": this.sexType,
- "symptom": symptoms //症状+选择的明细,string
- }
- api.getPush(param).then((res) => {
- const result = res.data;
- if (result.code == 0) {
- this.symp = result.data.symptom;
- }
- })
- },
- closeDetal() {
- // 推理
- const sympText = this.getSympText();
- this.getPush(sympText);
- this.show = false;
- this.questId = null;
- },
- deletSymp(item, index) {
- this.delIndex = index;
- this.questId = item.questionId || item.conceptId;
- if (this.chooseSymp.length == 1) {
- this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
- }
- this.showToast = true;
- },
- comfirnDel() {
- this.chooseSymp.splice(this.delIndex, 1);
- // delete(this.checkText[this.questId]);
- this.checkText.splice(this.delIndex, 1);
- this.$store.commit('delText', { type: "1", pId: this.questId })
- // 删除完-常见;其他-推送
- if (this.chooseSymp.length > 0) {
- const sympText = this.getSympText();
- this.getPush(sympText);//删除后重新调推理-入参:拼好的内容
- } else {
- this.getSympList();
- }
- this.cancelDel();
- },
- cancelDel() {
- this.showToast = false;
- this.delIndex = null;
- this.questId = null;
- this.delText = "是否删除该信息?<br/> (已填内容将清除)";
- },
- complete() {//明细填写完成
- this.checkText = this.$store.state.symptom.text;
- this.show = false;
- this.questId = null;
- // 推理
- const sympText = this.getSympText();
- this.getPush(sympText);
- },
- showChecked(item) {
- const origin = this.$store.state.symptom.origin;
- const read = this.$store.state.symptom.datas;
- const data = read[item.questionId] || origin[item.questionId];
- if (data.questionMapping && data.questionMapping.length > 0) {
- this.labelDetail = data;
- this.show = true;
- }
- },
- reload(id) {//清空重新赋值
- const read = this.$store.state.symptom.datas;
- const data = read[id];
- this.labelDetail = data;
- }
- },
- components: {
- DetailBox,
- Toast,
- Search
- },
- }
- </script>
- <style lang="less" scoped>
- @import "../less/base.less";
- .symp-wrap {
- font-size: 0.3rem;
- .quest {
- color: #000;
- margin-bottom: 0.36rem;
- font-weight: 700;
- .searchImg {
- width: 0.44rem;
- height: 0.44rem;
- float: right;
- }
- }
- }
- .choose{
- padding-bottom: .2rem;
- .choo-symp{
- display: inline-block;
- width:1.9rem;
- height: .74rem;
- background: linear-gradient(-270deg, #4F4FFF, #4F8BFF);
- box-shadow: 0 .08rem .16rem 0 rgba(79,129,255,0.40);
- border-radius: .08rem;
- white-space: nowrap;
- margin: 0 .3rem .3rem 0;
- span{
- display: inline-block;
- vertical-align: top;
- }
- span:first-child{
- width:1.34rem;
- height: .74rem;
- line-height: .74rem;
- text-align: center;
- color: #fff;
- }
- img{
- width:.56rem;
- height: .74rem;
- }
- .over{
- .over;
- }
- }
- }
- .label{
- .label;
- }
- .result{
- .title{
- color: #4F50FF;
- padding-left: .1rem;
- border-left: .08rem solid #4F50FF;
- margin-bottom: .19rem;
- font-weight: 700;
- }
- p{
- color: #666;
- line-height: .44rem;
- }
- }
- .footer{
- .footer;
- }
- .nofoot{
- opacity: 0.3;
- background: linear-gradient(-270deg,#4F4FFF, #4F8BFF);
- }
- .detail{
- .mask;
- z-index: 66;
- }
- </style>
|