Browse Source

流程,数据拼接,伴随修改

luolei 5 years ago
parent
commit
54210577af

+ 2 - 2
config/index.js

@@ -4,8 +4,8 @@
 
 const path = require('path')
 // const proxy_path = 'http://192.168.2.236:80';
-// const proxy_path = 'http://192.168.2.236:5050';
-const proxy_path = 'http://192.168.2.241:5050';
+const proxy_path = 'http://192.168.2.236:5050';
+// const proxy_path = 'http://192.168.2.241:5050';
 
 module.exports = {
   dev: {

+ 31 - 0
package-lock.json

@@ -3539,6 +3539,14 @@
         "entities": "^1.1.1"
       }
     },
+    "dom7": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/dom7/-/dom7-2.1.3.tgz",
+      "integrity": "sha512-QTxHHDox+M6ZFz1zHPAHZKI3JOHY5iY4i9BK2uctlggxKQwRhO3q3HHFq1BKsT25Bm/ySSj70K6Wk/G4bs9rMQ==",
+      "requires": {
+        "ssr-window": "^1.0.1"
+      }
+    },
     "domain-browser": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
@@ -10575,6 +10583,11 @@
         "tweetnacl": "~0.14.0"
       }
     },
+    "ssr-window": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-1.0.1.tgz",
+      "integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg=="
+    },
     "ssri": {
       "version": "5.3.0",
       "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz",
@@ -10858,6 +10871,15 @@
         }
       }
     },
+    "swiper": {
+      "version": "4.5.1",
+      "resolved": "https://registry.npmjs.org/swiper/-/swiper-4.5.1.tgz",
+      "integrity": "sha512-se6I7PWWu950NAMXXT+ENtF/6SVb8mPyO+bTfNxbQBILSeLqsYp3Ndap+YOA0EczOIUlea274PKejT6gKZDseA==",
+      "requires": {
+        "dom7": "^2.1.3",
+        "ssr-window": "^1.0.1"
+      }
+    },
     "tapable": {
       "version": "0.2.9",
       "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.9.tgz",
@@ -11377,6 +11399,15 @@
       "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz",
       "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ=="
     },
+    "vue-awesome-swiper": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-3.1.3.tgz",
+      "integrity": "sha512-E7suzkyApO8vNZbgdEnjSmnpsmQZyRvSVXJ7sey3XYwKPOkLhH3+GnHroBw+5PZIQXvWBwdCeQsPG1xQ1r1Rhg==",
+      "requires": {
+        "object-assign": "^4.1.1",
+        "swiper": "^4.0.7"
+      }
+    },
     "vue-hot-reload-api": {
       "version": "2.3.3",
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz",

+ 1 - 0
package.json

@@ -21,6 +21,7 @@
     "portal-vue": "^2.1.6",
     "vant": "^2.2.10",
     "vue": "^2.5.2",
+    "vue-awesome-swiper": "^3.1.3",
     "vue-photo-preview": "^1.1.3",
     "vue-router": "^3.0.1",
     "vuex": "^3.1.1",

+ 4 - 1
src/common/PickTime.vue

@@ -5,12 +5,14 @@
       <p v-show="val" :class="['ptab',{'check':val != '请选择'}]" @click="showPicker">{{val}}</p>
       <p v-show="val != '请选择'" class="tip">点击可修改</p>
       <Picker ref="picker" :show="showTime" @comfirn="getTimeVal" @cancel="close" :picIndex="picIndex"/>
+      <!-- <carrousel ref="picker"  v-if="showTime" :show="showTime" @comfirn="getTimeVal" @cancel="close" :picIndex="picIndex"></carrousel> -->
     </div> 
   <!-- </transition> -->
 </template>
 <script type="text/javascript">
   import $ from 'jquery';
   import Picker from './Picker.vue';
+  import carrousel from './PickSlide.vue';
   export default {
     name:'PickTime',
     props:{
@@ -70,7 +72,8 @@
       }
     },
     components:{
-      Picker
+      Picker,
+      // carrousel
     },
     watch:{
       item:{

+ 6 - 4
src/common/Picker.vue

@@ -20,8 +20,8 @@
 </template>
 <script type="text/javascript">
   import $ from 'jquery';
-  const num = [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9];
-  const unit = ['分钟', '小时', '天', '周', '月','年','分钟', '小时', '天', '周', '月','年'];
+  let num = [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9];
+  let unit = ['分钟', '小时', '天', '周', '月','年','分钟', '小时', '天', '周', '月','年'];
   export default {
     name:'Picker',
     data() {
@@ -78,9 +78,11 @@
         this.showTip = false;
         for(let i=0;i<3;i++){
           if(i == 2){
-            this.columIndx[i] = unit.lastIndexOf(value[i]);
+            let tmpVal = unit.lastIndexOf(value[i]);
+            this.columIndx[i] = tmpVal;
           }else{
-            this.columIndx[i] = num.lastIndexOf(value[i]);
+            let tmpVal = num.lastIndexOf(value[i]);
+            this.columIndx[i] = tmpVal;
           }
         }
       },

+ 104 - 13
src/components/Department.vue

@@ -16,33 +16,88 @@
                 </div>
             </div>
         </div>
+        <Submit v-if="submit" :showType="showType" :fail="failMsg" @showSubmit="showSubmit"></Submit>
+        <Tiptoast
+            :show="showTip"
+            @close="close"
+            :data="message"/>
     </div>
 </template>
 <script>
-  import {setScroll,compare} from '@utils/tools.js';
-  import BScroll from 'better-scroll';
+    import {setScroll,compare} from '@utils/tools.js';
+    import BScroll from 'better-scroll';
+    import Submit from "../common/Submit";
+    import Tiptoast from "../common/Tiptoast";
+    import api from "@utils/api.js";
     export default {
         name: "Department",
         data(){
             return {
                 scroll:null,
-                departmentLis:[]
+                departmentLis:[],
+                showTip: false,
+                showType: "fail",
+                failMsg: "",
+                message:{
+                    title: "",
+                    text: ""
+                },
+                submit: false,
+                show: false,
             }
         },
         created(){
-            let tmpList = JSON.parse(localStorage.getItem('loginData'))
-            let tmpTime = JSON.parse(localStorage.getItem('recordTime'))
-            let sortArr = tmpList.sort(compare("recordTime"));
-            if(tmpTime){
-                for(let j = 0;j < tmpTime.length;j++){
-                    for(let i = 0;i < sortArr.length;i++){
-                        if(tmpTime[j] == (new Date((sortArr[i].recordTime).replace(/\-/g, "/"))).getTime()){
-                            sortArr[i].dided = 1
+            let query = this.$route.query;
+            let type = query.patientInfoType,name = query.patientName,value = query.patientInfo,code=query.hospitalCode;
+            if(value&&name&&type&&code){
+                const param = {
+                    patientInfo: value,
+                    patientInfoType: type,
+                    hospitalCode: code,
+                    patientName:name
+                };
+                api.signIn(param).then(res => {
+                    let result = res.data;
+                    if (result.code == 0) {
+                        // result.data.splice(0,1);//测试只有一条数据
+                        localStorage.setItem('loginData',JSON.stringify(result.data))//保存登陆信息,扫码进入徐删除该参数
+                        if (result.data.length > 1) {
+                            this.departmentLis = this.sortPart();
+                        } else if (result.data.length == 1) {
+                            let msg = result.data[0];
+                            let params = {
+                                hospitalCode: msg.hospitalCode,
+                                hospitalDeptCode: msg.hospitalDeptCode,
+                                doctorCode: msg.doctorCode,
+                                patientCode: msg.patientCode,
+                                recordId: msg.recordId,
+                                time:(new Date((msg.recordTime).replace(/\-/g, "/"))).getTime()
+                            };
+                            localStorage.setItem('loginParam',JSON.stringify(params))//保存登陆信息,扫码进入删除该参数
+                            this.$router.push({
+                                path: "/home",
+                                query: params
+                            });
+                        } else {
+                            this.message.title = '温馨提示'
+                            this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
+                            this.showTip = true
+                        }
+                    } else {
+                        if(res.msg.indexOf('暂无今日挂号信息') != -1){
+                            this.message.title = '温馨提示'
+                            this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
+                            this.showTip = true
+                        }else{
+                            this.defaultWaring(res.msg);
                         }
                     }
-                }
+                }).catch(() => {
+                    this.defaultWaring("网络异常请稍后重试");
+                });
+            }else{
+                this.departmentLis = this.sortPart();
             }
-            this.departmentLis = sortArr
         },
         mounted(){
             this.$nextTick(()=>{
@@ -51,7 +106,39 @@
             })
         },
         methods:{
+            sortPart(){
+                let tmpList = JSON.parse(localStorage.getItem('loginData'));
+                let tmpTime = JSON.parse(localStorage.getItem('recordTime'));
+                let sortArr = tmpList.sort(compare("recordTime"));
+                if(tmpTime){
+                    for(let j = 0;j < tmpTime.length;j++){
+                        for(let i = 0;i < sortArr.length;i++){
+                            if(tmpTime[j] == (new Date((sortArr[i].recordTime).replace(/\-/g, "/"))).getTime()){
+                                sortArr[i].dided = 1
+                            }
+                        }
+                    }
+                }
+                return sortArr;
+            },
+            showSubmit(flg){
+                this.submit = flg;
+            },
+            close() {
+                this.showTip = false;
+            },
+            defaultWaring(msg) {
+                this.$store.commit("handleToggleShow", false);
+                this.showType = "fail";
+                this.failMsg = msg;
+                this.submit = true;
+                let timer = setTimeout(() => {
+                    this.submit = false;
+                    clearTimeout(timer);
+                }, 2000);
+            },
             goStart(num,time){
+                this.show = !this.show
                 let msg = this.departmentLis[num]
                 let params = {
                     hospitalCode:msg.hospitalCode,
@@ -67,6 +154,10 @@
                     query:params
                 })
             }
+        },
+        components:{
+            Submit,
+            Tiptoast
         }
     }
 </script>

+ 20 - 13
src/components/Detail.vue

@@ -90,12 +90,14 @@ import $ from 'jquery';
   export default {
     name:'Detail',
     data(){
+    let { pathInfo } = this.$store.state;
       return{
         checkDatas:{},
-        imgUrl:imageUrlPrefix
+        imgUrl:imageUrlPrefix,
+        age: pathInfo.patientAge,
       }
     },
-    props:['datas','data','checkF','tips'],
+    props:['datas','data','checkF','tips','sex'],
     created(){
       this.checkDatas = JSON.parse(JSON.stringify(this.datas));
     },
@@ -161,11 +163,6 @@ import $ from 'jquery';
       },
       slideToggle(e,idx){
         document.activeElement.blur();
-        // let y = this.$store.state.scroll.y
-        // if(idx==this.checkDatas.questionMapping.length-1){
-        //   this.scroll.scrollToElement(this.$refs.btm,0,true,true)
-        //   this.scroll.scrollTo(0,0,this.scroll.maxScrollY)
-        // }
         let mapping = this.checkDatas.questionMapping;
         let num = 0;
         for(let i in mapping){
@@ -245,6 +242,7 @@ import $ from 'jquery';
         let textP = "";//患者
         let special = ""; //拼到主诉
         let specialP = "";
+        let bj1 = "",bjP1 = "",bj2 = "",bjP2 = "",bj3="",bjP3="";
         for(let i in datas){
           // 校验必填项
          /* if(datas[i].required==1 && !datas[i].value){
@@ -257,8 +255,16 @@ import $ from 'jquery';
             specialP += datas[i].valueP;
           }
           if(datas[i].value){
-            text += datas[i].value+',';
-            textP += datas[i].valueP+',';
+            if(datas[i].flag == 1){
+              bj1 += '于'+datas[i].value+'前';
+              bjP1 += '于'+datas[i].valueP+'前';
+            }else if(datas[i].flag == 2){
+              bj2 += datas[i].value;
+              bjP2 += datas[i].valueP;
+            }else{
+              bj3 += datas[i].value+',';
+              bjP3 += datas[i].valueP+',';
+            }
           }
         }
         if(special){//拼接到主诉的内容存到chooseSymp
@@ -270,8 +276,8 @@ import $ from 'jquery';
           }
         }
         
-        let msg = this.checkDatas.name+ ',' + text;
-        let msgP = (this.checkDatas.description || this.checkDatas.name)+ ',' + textP;
+        let msg =  (this.age>18?'患者':'患儿')+bj1+bj2+'出现'+this.checkDatas.name+ ','+bj3;
+        let msgP =  (this.age>18?'患者':'患儿')+bjP1+bjP2+'出现'+(this.checkDatas.description || this.checkDatas.name)+ ','+bjP3;
         let newMsg = "";
         let newMsgP = "";
         if(msg[msg.length-1] == ','){
@@ -283,13 +289,14 @@ import $ from 'jquery';
         }
         this.$store.commit('setDatas',{data:this.checkDatas,pId:id,type:this.data.moduleType,ppId:this.data.ppId});
         // flag是区分点开已选症状 未点完成
-        this.$store.commit('setText',{text:trimDots(newMsg),textP:trimDots(newMsgP),pId:id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index});
+        this.$store.commit('setText',{text:trimDots(newMsg),textP:trimDots(newMsgP),pId:id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index,idx:1});
         // 关闭详情
         this.$store.commit('setDetail',{detail:{}})
       },
       clearData(){//清空
         // const datas = this.checkDatas.questionMapping;
         const datas = JSON.parse(JSON.stringify(this.checkDatas.questionMapping))
+        let chooseSymp = this.$store.state.symptom.choose;
         let reqFlag = false;//必填项标识
         for(let i in datas){
           // 时间控件需要清除缓存的index
@@ -327,7 +334,7 @@ import $ from 'jquery';
           this.$store.commit('setDatas',{data:Object.assign({},this.checkDatas,{select:1}),pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
         }
         
-        this.$store.commit('setText',{text:msg,textP:msgP,pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index});
+        this.$store.commit('setText',{text:msg,textP:msgP,pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index,idx:1});
       },
       check(){// 校验是否有已填项
         const datas = this.checkDatas.questionMapping;

+ 0 - 4
src/components/DetailBox.vue

@@ -3,7 +3,6 @@
     <div class="detailBoxMask"></div>
     <div class="detailBox-wrap">
       <div class="content detailBoxMain" ref="detailBox">
-        <!-- <div class="tmpDom"></div> -->
         <div class="main">
           <Detail :datas="privateData" 
                   ref="detail"
@@ -16,13 +15,10 @@
                   @handleClear="handleClear($event)"
                   @checkReq="changeFins($event)"/>
         </div>
-        <!-- <div class="foot" @click="complete">完成</div> -->
       </div>
     </div>
-    <!-- <div :class="['foot',{'noCheck':!checkF}]" @click="complete">完成</div> -->
     <div style="position:absolute" class="foot">
       <div class="slide" @click="slideAll">{{btnTxt}}</div>
-      <!-- <div class="nextBtn compete" :class="{'noCheck':!checkF || !reqFinish}" @click="complete">完成</div> -->
       <div class="nextBtn compete" @click="complete">完成</div>
     </div>
     <Toast :message="clearTxt" 

+ 89 - 16
src/components/Login.vue

@@ -7,8 +7,19 @@
       <h4>欢迎使用智能预问诊</h4>
     </div>
     <div class="main">
-      <div class="iptWrap choose">
-        <p @click="handleShow">
+      <div class="iptWrap choose" v-if="hospitalShow">
+        <p @click="handleShow(1)">
+          {{hospitalName}}
+          <img src="../images/down.png" />
+        </p>
+        <div class="slideType">
+          <ul>
+            <li v-for="(item,idx) in hospitalList" :key="idx"  @click="handleCode(item,idx)" :style="{'border':(idx == (hospitalList.length-1))?'0 none':''}">{{item.hospitalName}}</li>
+          </ul>
+        </div>
+      </div>
+      <div class="iptWrap choose iptWrapS">
+        <p @click="handleShow(2)">
           {{name}}
           <img src="../images/down.png" />
         </p>
@@ -72,6 +83,7 @@ export default {
       failMsg: "",
       submit: false,
       show: false,
+      showH:false,
       type: "102",
       name: "病历号",
       patName:'',
@@ -83,10 +95,26 @@ export default {
       code:'',
       allow:true,
       canClick:false,
+      hospitalName:'',
+      hospitalNum:'',
+      hospitalList:[],
+      hospitalShow:false
     };
   },
   created(){
-    this.code = this.$route.query.hospitalCode||''
+    let query = this.$route.query;
+    let type = query.patientInfoType,name = query.patientName,value = query.patientInfo,code=query.hospitalCode,sonHospitalCode=query.sonHospitalCode,sonHospitalName=query.sonHospitalName;
+    this.code = code||'';
+    if(value&&name&&type&&code){
+      this.type = type
+      this.name = type == 101?'身份证号':type == 102?'病历号':type == 104?'市民卡号':''
+      this.value = value
+      this.patName = name
+      this.hospitalNum=sonHospitalCode
+      this.hospitalName=sonHospitalName
+    }
+    this.getSysConfig(code)
+    this.getHospitalList(code)
   },
   watch:{
     value:{
@@ -116,7 +144,39 @@ export default {
     }
     next();
   },
+  
   methods: {
+    getHospitalList(code){
+      api.getHospitalDatas({'hospitalCode':'A010'}).then(res => {
+        let result = res.data;
+        if (result.code == 0) {
+          let tmpMain = result.data.superiorsInfo;
+          let tmpLis = result.data.juniorHospital;
+          tmpLis.unshift(tmpMain)
+          this.hospitalList = tmpLis
+          this.hospitalName = tmpLis[0].hospitalName
+          this.hospitalNum = tmpLis[0].hospitalCode
+        }
+      })
+    },
+    getSysConfig(code){
+      const param = {
+        'hospitalCode':code,
+      }
+      api.getSysConfig(param).then((res)=>{
+        const result = res.data;
+        if(result.code==0){
+          const datas = result.data;
+          this.child = datas.filter((item)=>{return item.code == "constitution_show"})
+          this.$store.commit('saveSysConfig',datas)
+          for(let i = 0;i < datas.length;i++){
+            if(datas[i].code == 'junior_show'){
+              this.hospitalShow = +datas[i].value==1?true:false
+            }
+          }
+        }
+      })
+    },
     close() {
       this.showTip = false;
     },
@@ -129,9 +189,18 @@ export default {
       }
       this.show = false;
     },
-    handleShow() {
-      const { show } = this;
-      this.show = !show;
+    handleCode(item,idx) {
+      this.hospitalName = item.hospitalName
+      this.hospitalNum = item.hospitalCode
+      this.showH = false;
+    },
+    handleShow(flg) {
+      const { show,showH } = this;
+      if(flg == 1){
+        this.showH = !showH;
+      }else{
+        this.show = !show;
+      }
     },
     focus(){   
       // iscanscrollpage = false; 
@@ -170,18 +239,18 @@ export default {
       this.submit = flg;
     },
     handleDepart(){
-      const { type, value,patName,allow } = this;
+      const { type, value,patName,allow,hospitalNum,hospitalName,code } = this;
       this.allow = false
       if (value&&patName&&allow) {
         let timer = setTimeout(() => {
           if (type == 102) {
-            if (!jgpattern.test(value)) {//验证不通过
+            if (!jgpattern.test(value) || value.length > 20) {//验证不通过
               this.defaultWaring("请输入正确的病历号");
               this.allow = true
               return;
             }
           } else if (type == 101) {//身份证
-            if (!identify.test(value)) {//验证不通过
+            if (!identify.test(value) || value.length > 18) {//验证不通过
               this.defaultWaring("请输入正确的身份证号");
               this.allow = true
               return;
@@ -201,12 +270,13 @@ export default {
           const param = {
             patientInfo: this.value,
             patientInfoType: this.type,
-            hospitalCode:this.code,
-            patientName:patName
+            hospitalCode:code,
+            hospitalName:this.hospitalList[0].hospitalName||'',
+            patientName:patName,
+            sonHospitalCode: code==hospitalNum?'':hospitalNum||'',
+            sonHospitalName: code==hospitalNum?'':hospitalName||''
           };
-          api
-          .signIn(param)
-          .then(res => {
+          api.signIn(param).then(res => {
             let result = res.data;
             if (result.code == 0) {
               // result.data.splice(0,1);//测试只有一条数据
@@ -247,8 +317,7 @@ export default {
               }
               clearTimeout(timer)
             }
-          })
-          .catch(() => {
+          }).catch(() => {
             this.allow = true
             clearTimeout(timer)
             this.defaultWaring("网络异常请稍后重试");
@@ -310,6 +379,10 @@ export default {
       padding: 0.23rem 0.3rem;
       box-sizing: border-box;
     }
+
+    .iptWrapS{
+      margin-top: 0.3rem;
+    }
     .choose {
       position: relative;
       p {

+ 1 - 1
src/components/PathInfo.vue

@@ -54,7 +54,7 @@
   import api from '@utils/api.js'
   import Submit from '../common/Submit';
   import Toast from '../common/Toast.vue';
-  import {getUrlArgObject,setScroll,dateParser} from '@utils/tools.js'
+  import {setScroll,dateParser} from '@utils/tools.js'
   import BScroll from 'better-scroll';
   export default {
     name:'PathInfo',

+ 21 - 11
src/components/Preview.vue

@@ -24,21 +24,23 @@
         </div>
         <div class="personMsg personMsg2">
           <ul class="previewParts">
-            <!-- <li v-if="symptom.choose.length>0"> -->
             <li>
               <h4><i></i> 主诉:</h4>
               <p>
-                <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">
-                {{item.specialP?(item.description||item.name)+item.specialP+(idx == symptom.choose.length-1?'':','):(item.description||item.name)+(idx == symptom.choose.length-1?'':',')}}
-                </span>
+                <template v-for="(value,index) in checkText">
+                  <span :key="index" v-if="index==0&&value.idx==1">{{value.textP.split(',')[0]}}</span>
+                </template>
               </p>
             </li>
-            <!-- <li v-if="diagnose.text.length>0||symptom.choose.length>0"> -->
             <li>
               <h4><i></i> 现病史:</h4>
-              <p v-for="item in symptom.text">{{item.textP}}</p>
               <p>
-                <span>{{getDetailText(diagnose.text,false).view}}</span>
+                <template v-for="(value,index) in checkText">
+                  <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
+                  <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.textP}}{{checkText.length==1?'':','}}</span>
+                  <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.textP}}{{checkText.length==2?'':'、'}}</span>
+                  <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
+                </template>
               </p>
             </li>
             <li v-if="showLis[moduleCP['other']]==1">
@@ -91,14 +93,20 @@
               <li>
                 <h4><i></i> 主诉:</h4>
                 <p>
-                  <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">{{item.special?item.name+item.special+(idx == symptom.choose.length-1?'':','):item.name+(idx == symptom.choose.length-1?'':',')}}</span>
-                </p>
+                  <template v-for="(value,index) in checkText">
+                    <span :key="index" v-if="index==0&&value.idx==1">{{value.text.split(',')[0]}}</span>
+                  </template>
+                </p>                
               </li>
               <li>
                 <h4><i></i> 现病史:</h4>
-                <p v-for="item in symptom.text">{{item.text}}</p>
                 <p>
-                  <span>{{getDetailText(diagnose.text,false).content}}</span>
+                  <template v-for="(value,index) in checkText">
+                    <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
+                    <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.textP}}{{checkText.length==1?'':','}}</span>
+                    <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.textP}}{{checkText.length==2?'':'、'}}</span>
+                    <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
+                  </template>
                 </p>
               </li>
               <li v-if="showLis[moduleCP['other']]==1">
@@ -133,6 +141,7 @@ export default {
   props: ['preName','showLis','loadingShow'],
   data() {
     const { pathInfo, originDatas,loadingShow } = this.$store.state;
+
     let symptomDate = this.$store.state.symptom;
     let diagnoseDate = this.$store.state.diagnose;
     let othersDate = this.$store.state.others;
@@ -144,6 +153,7 @@ export default {
       diagnose: diagnoseDate,
       others: othersDate,
       addContent: addContentDate,
+      checkText: symptomDate.text, //症状情况文字
       submit: false,
       showType: 'fail',
       imgList:[],

+ 67 - 13
src/components/Symptom.vue

@@ -29,8 +29,8 @@
             class="symp"
             v-for="(it,ind) in symp"
             :key="it.conceptId"
-            @touchstart.prevent="touchstart(it)"
-            @touchend.prevent="touchend(it)"
+            @touchstart.prevent="touchstart(it,ind)"
+            @touchend.prevent="touchend(it,ind)"
           >{{it.description || it.name}}</span>
         </div>
         <p class="tip" v-show="chooseSymp.length==0">长按症状按钮可显示症状解释说明 <span @click="slideToggle" v-show="slide">{{slideTxt}}</span></p>
@@ -41,7 +41,12 @@
       >
         <p class="title"><span class="line"></span>{{nameStr}}</p>
         <div class="bgResult">
-          <p v-for="(value,index) in checkText">{{value.textP}}</p>
+          <template v-for="(value,index) in checkText">
+            <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
+            <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.textP}}{{checkText.length==1?'':','}}</span>
+            <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.textP}}{{checkText.length==2?'':'、'}}</span>
+            <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
+          </template>
         </div>
       </div>
     </div>
@@ -116,7 +121,8 @@ export default {
       start:{},
       end:{},
       slide:false,
-      slideTxt:'展开'
+      slideTxt:'展开',
+      staticSymp:[]
     }
   },
   created() {
@@ -141,7 +147,9 @@ export default {
       handler(newVal,oldVal){
         const sympText = this.getSympText();
         if(sympText){
-          this.getPush(sympText);
+          if(this.chooseSymp.length>1){
+            this.getPush(sympText);
+          }
           this.quesText = "请问您还有其他不适吗?";
         }else{
           this.getSympList();
@@ -170,6 +178,9 @@ export default {
       }
       let endTime = +new Date();
       if(endTime - this.startTime < 500){//点击事件
+        if(this.chooseSymp.length == 0){
+          item.idx = 1
+        }
         this.common(item,flg);
         this.slideTxt = '展开'
       }
@@ -189,7 +200,6 @@ export default {
             that.message.title = "";
             that.message.text = "暂无资料";
           }
-          
         },600)
     },
     closeTip(){
@@ -235,11 +245,14 @@ export default {
       }
     },
     common(item,flg){
+      if(this.chooseSymp.length>12){
+        this.$store.commit('setSearchShow', false);
+        return
+      }
       this.questId = item.questionId || item.id || item.conceptId;
       const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
       //将选中的name存到store中的text
-      this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId });
-      if (id) {
+      if (id&&this.chooseSymp.length == 0) {//只有第一次
         const param = {
           "age": this.age,
           "id": id,
@@ -252,24 +265,44 @@ export default {
             this.labelDetail = result.data;
             if(this.chooseSymp.length == 0){
               result.data.idx = 1
+              this.$store.commit('setText', { type: moduleCP['symp'], text: '患者出现'+item.name,textP: '患者出现'+(item.description||item.name), pId: this.questId,idx:flg });
+            }else{
+              this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId,idx:flg });
             }
             this.$store.commit('setOrigin', { type: moduleCP['symp'], data: result.data });
             if (mapping && mapping.length > 0) {
-              this.$store.commit('setDetail',{detail:result.data,ppId:null,moduleType:moduleCP['symp'],sign:1,idx:this.chooseSymp.length})
-              if(flg){
-                return
+              for(let i = 0;i < mapping.length;i++){
+                if(mapping[i].flag == 3){
+                  this.staticSymp = mapping[i].questionDetailList
+                }
               }
+              this.$store.commit('setDetail',{detail:result.data,ppId:null,moduleType:moduleCP['symp'],sign:1,idx:this.chooseSymp.length})
               this.$store.commit('setSearchShow', false);
               this.chooseSymp.push(item);
             } else { 
               this.chooseSymp.push(item);
               this.$store.commit('setSearchShow', false);
             }
+            const sympText = this.getSympText();
+            this.getPush(sympText);
+          }
+        }).catch(()=>{
+          if(this.chooseSymp.length == 1){
+            const sympText = this.getSympText();
+            this.getPush(sympText);
           }
         })
       } else {//没有questionId或id 
+        if(this.chooseSymp.length == 0){
+          item.idx = 1
+          this.$store.commit('setText', { type: moduleCP['symp'], text: '患者出现'+item.name,textP: '患者出现'+(item.description||item.name), pId: this.questId,idx:flg });
+        }else{
+          this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId,idx:flg });
+        }
         this.chooseSymp.push(item);
-        this.checkText = this.$store.state.symptom.text;
+        const sympText = this.getSympText();
+        this.getPush(sympText);
+        // this.checkText = this.$store.state.symptom.text;
       }
     },
     showDetil(item,flg) {//搜索点开的详情
@@ -297,9 +330,30 @@ export default {
       api.getPush(param).then((res) => {
         const result = res.data;
         if (result.code == 0) {
-          this.symp = result.data.symptom;
+          let symp = result.data.symptom;
+          let symped = JSON.parse(JSON.stringify(this.chooseSymp));//已选症状
+          let sympStic = JSON.parse(JSON.stringify(this.staticSymp));//首次有无症状
+          let sympAll = sympStic.concat(symp);
+          var obj = {};
+          sympAll = sympAll.reduce(function(item, next) {
+            obj[next.name] ? '' : obj[next.name] = true && item.push(next);
+            return item;
+          }, []);
+          // console.log(sympAll,symped)
+          for(let i = 0;i < sympAll.length;i++){//去掉已选的已选症状
+            for(let j = 0;j < symped.length;j++){//去掉
+              if(symped[j].name == sympAll[i].name){
+                sympAll.splice(i,1)
+              }
+            }
+          }
+
+          this.symp = sympAll.slice(0,12);
+          // this.symp = symp;
           this.$refs.showHide.style.height = 'auto'
         }
+      }).catch(()=>{
+
       })
     },
     deletSymp(item, index) {

+ 13 - 0
src/main.js

@@ -4,12 +4,25 @@ import store from './store.js';
 import App from './App.vue';
 import preview from 'vue-photo-preview';
 import 'vue-photo-preview/dist/skin.css';
+import VueAwesomeSwiper from 'vue-awesome-swiper'
+import 'swiper/dist/css/swiper.css'
 import PortalVue from 'portal-vue';
 import './utils/getfile.js';
 // import {Picker} from 'vant';
 import Picker from 'vant/lib/picker';
 import 'vant/lib/picker/style';
+
+
 Vue.use(PortalVue);
+
+Vue.use(VueAwesomeSwiper,{
+  direction:'vertical',
+  // loop:true,
+  slidesPerView: 3,
+  spaceBetween: 0,
+  freeMode: false,
+})
+
 Vue.use(preview);
 Vue.use(Picker);
 Vue.config.productionTip = false;

+ 4 - 0
src/utils/api.js

@@ -3,6 +3,7 @@ import axios from 'axios';
 const urls = {
   getPathInfo:'/api/prec/patientInfo/getTopPatientInfo',//患者信息
   getSysConfig:'/api/prec/sysSet/getSysSetInfoDatas',//配置项
+  getHospitalDatas:'/api/prec/sysSet/getHospitalDatas',//获取医院列表
   recordCheck:'/api/prec/inquiryInfo/recordCheck',//校验是否已做过
   getAll:'/api/prec/moduleInfo/getAll',//获取模板
   getSymptom:'/api/prec/questionUsual/getQuestionUsual',//常用症状
@@ -18,6 +19,9 @@ const urls = {
 }
 
 export default {
+  getHospitalDatas(param){
+    return axios.post(urls.getHospitalDatas,param)
+  },
   getPathInfo(param){
     return axios.post(urls.getPathInfo,param)
   },