|
@@ -21,6 +21,7 @@
|
|
|
<script>
|
|
|
import OptionInp from '../common/OptionInp.vue';
|
|
|
import {concatVal,getExpStr} from '../utils/tools.js';
|
|
|
+ import api from '@utils/api.js';
|
|
|
export default {
|
|
|
props: ["symptomResult","num"],
|
|
|
data() {
|
|
@@ -76,17 +77,31 @@ export default {
|
|
|
},300)
|
|
|
}
|
|
|
},*/
|
|
|
- makeSuer() {
|
|
|
+ getExtQa(ids){
|
|
|
+ const userInfo = this.$store.state.pathInfo;
|
|
|
+ const param = {
|
|
|
+ age:userInfo.patientAge,
|
|
|
+ ids:ids,
|
|
|
+ sexType:userInfo.sexType
|
|
|
+ };
|
|
|
+ return new Promise((resolve,reject)=>{
|
|
|
+ api.getByIds(param).then((res)=>{
|
|
|
+ resolve(res);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async makeSuer() {
|
|
|
if(!this.sure){return}
|
|
|
let result = this.result;
|
|
|
// if(this.numPlus == 1){
|
|
|
- let tmpResult=[],tmpResultp=[];
|
|
|
+ let tmpResult=[],tmpResultp=[],subQas='';
|
|
|
for (let i = 0; i < result.length; i++) {
|
|
|
const text=result[i].name;
|
|
|
const textp=result[i].description||result[i].name;
|
|
|
const msg = getExpStr(text);
|
|
|
const msgp = getExpStr(text);
|
|
|
if(result[i].select){
|
|
|
+ subQas = subQas+","+result[i].subQuestion;
|
|
|
if(result[i].name.indexOf("${")!==-1){
|
|
|
tmpResult.push(msg.prefix+(result[i].value||"")+msg.suffix);
|
|
|
tmpResultp.push(msgp.prefix+(result[i].value||"")+msgp.suffix);
|
|
@@ -97,12 +112,24 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ subQas=subQas.replace(/^,|,$/g,'').replace(/,+/g,',');
|
|
|
+ if(subQas){
|
|
|
+ await this.getExtQa(subQas.split(",")).then((res)=>{
|
|
|
+ this.$emit("getExtQa",res.data.data,this.num);
|
|
|
+ });
|
|
|
+ }
|
|
|
//tmpIds=tmpIds.concat(staticArr)
|
|
|
//this.connectResult = tmpIds
|
|
|
//this.contentResult = tmpResult.join('、')
|
|
|
// }else{
|
|
|
|
|
|
// }
|
|
|
+ if(+this.symptomResult.flag===2){ //为诱因控件
|
|
|
+ const orgChoose = this.$store.state.symptom.choose;
|
|
|
+ orgChoose[0].reason = tmpResult||"无";
|
|
|
+ orgChoose[0].reasonP = tmpResultp||"无";
|
|
|
+ this.$store.commit('setChoose', { choose: orgChoose, type: 1 });
|
|
|
+ }
|
|
|
let number = this.num;
|
|
|
this.$emit("updataResult", this.symptomResult, {val:tmpResult.join('、'),valp:tmpResultp.join('、')},++number);
|
|
|
},
|