Browse Source

Squashed commit of the following:

commit 57d6516317cf7caafc58af98a7625a7287fdda13
Author: luolei <16657115156@163.com>
Date:   Wed Aug 21 14:28:46 2019 +0800

    只有一个挂号信息直接跳到开始页

commit 5f723c17f8fa81a0a4e0e909af203bd2091ef878
Author: luolei <16657115156@163.com>
Date:   Wed Aug 21 14:21:14 2019 +0800

    登录校验

commit d7f51c272fad2159daa31c4a62d2a3fb5682e415
Author: luolei <16657115156@163.com>
Date:   Tue Aug 20 20:35:26 2019 +0800

    登陆页面交互

commit 79d7c94366e91217d1296bc3a8e56289f0379f3b
Author: luolei <16657115156@163.com>
Date:   Tue Aug 20 14:10:42 2019 +0800

    搜索bug

commit 14ce22ada5450c47bf78cf72629414d7f17de07f
Author: luolei <16657115156@163.com>
Date:   Tue Aug 20 13:39:07 2019 +0800

    保存数据处理

commit 2e4aee967bb3fda1e3eeff68420c772f2370edaf
Author: luolei <123>
Date:   Mon Aug 19 20:31:22 2019 +0800

    数据拼接

commit f9b280f18843b591e6c86ab1c97c338b6e97cb91
Author: luolei <123>
Date:   Mon Aug 19 20:08:45 2019 +0800

    保存数据处理

commit e12cfa78bcb3d89d43f3d983e6fb7da124a10ca6
Merge: 0bbaa8b 760b29d
Author: luolei <123>
Date:   Mon Aug 19 19:08:56 2019 +0800

    Merge branch 'new' into new_ll

commit 0bbaa8bca94ed0ec92334ba813815090b0aa0113
Author: luolei <123>
Date:   Mon Aug 19 19:08:11 2019 +0800

    1

commit 8d30cdc1def7efb06843b40711bbe19b26218229
Merge: 0545b65 4f63b17
Author: luolei <123>
Date:   Mon Aug 19 18:56:53 2019 +0800

    Merge branch 'btscroll' into new_ll

commit 0545b6511d6895270331c0d19d2ec1dd68fa46ef
Author: luolei <123>
Date:   Mon Aug 19 18:56:21 2019 +0800

    1

commit bf959bf4ba7864602116dec4a2e26ef8bff2272c
Author: snafm0 <900328>
Date:   Mon Aug 19 18:39:55 2019 +0800

    peizhi

commit 4f63b17c3482a31e940a881298414d2b0b9d825f
Author: snafm0 <900328>
Date:   Mon Aug 19 17:44:40 2019 +0800

    图片保存多了一层

commit 3087c7577567f23f3be9d9514200abd7d2f57730
Author: snafm0 <900328>
Date:   Mon Aug 19 15:25:14 2019 +0800

    提交新建文件

commit 163434fb13c53f7f5d3b0e1b1fee8846fd866750
Author: snafm0 <900328>
Date:   Mon Aug 19 11:12:08 2019 +0800

    多列填写bug修改

# Conflicts:
#	src/components/Department.vue
#	src/components/Login.vue
#	src/utils/tools.js
liucf 5 years ago
parent
commit
5ab9f8adc4

+ 1 - 1
build/webpack.dev.conf.js

@@ -29,7 +29,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
       ],
     },
     hot: true,
-    openPage:'?hospitalCode=A001&hospitalDeptCode=D01&doctorCode=YS001&patientCode=1600&recordId=44',//携带参数
+    // openPage:'?hospitalCode=A001&hospitalDeptCode=D01&doctorCode=YS001&patientCode=1600&recordId=44',//携带参数
     contentBase: false, // since we use CopyWebpackPlugin.
     compress: true,
     // host: HOST || config.dev.host,

+ 1 - 0
src/common/Submit.vue

@@ -112,6 +112,7 @@ export default {
 .submitFail {
   width: 6rem;
   height: 0.88rem;
+  font-size:.3rem;
   line-height: 0.88rem;
   z-index: 999;
   position: absolute;

+ 27 - 8
src/components/Department.vue

@@ -2,14 +2,14 @@
     <div class="department">
         <div class="departmentView">
             <div class="content">
-                <div class="list" @click="goStart">
+                <div class="list" v-for="(item,index) in departmentLis" @click="goStart(index)" :key="item.recordTime">
                     <div class="top">
-                        <p>挂号科室:急诊科 <img src="../images/right.png" alt=""></p>
+                        <p>挂号科室:{{item.hospitalDeptName}} <img src="../images/right.png" alt=""></p>
                     </div>
                     <div class="main">
-                        <p>预约时间:2019-8-18 14:00</p>
-                        <p>病历号:1234567</p>
-                        <p>挂号信息:1234567</p>
+                        <p>预约时间:{{item.recordTime}}</p>
+                        <p>病历号:{{item.recordId}}</p>
+                        <p>挂号信息:{{item.registerNum}}</p>
                     </div>
                 </div>
                 <div class="list">
@@ -33,18 +33,37 @@
         name: "Department",
         data(){
             return {
-                scroll:null
+                scroll:null,
+                departmentLis:[]
             }
         },
+        created(){
+            this.departmentLis = this.$route.params.result
+        },
         mounted(){
+            if(JSON.stringify(this.$route.params) == '{}'){
+                this.$router.replace({path:'/login'})
+                return
+            }
             this.$nextTick(()=>{
                 let scroll = setScroll(BScroll,true,'.departmentView')
                 this.scroll = scroll
             })
         },
         methods:{
-            goStart(){
-                this.$router.replace({path:'/'})
+            goStart(num){
+                let msg = this.departmentLis[num]
+                let params = {
+                    hospitalCode:msg.hospitalCode,
+                    hospitalDeptCode:msg.hospitalDeptCode,
+                    doctorCode:msg.doctorCode,
+                    patientCode:msg.patientCode,
+                    recordId:msg.recordId
+                }
+                this.$router.replace({
+                    path:'/',
+                    query:params
+                })
             }
         }
     }

+ 90 - 21
src/components/Login.vue

@@ -9,31 +9,42 @@
                 <p @click="handleShow">{{name}} <img src="../images/down.png" /></p>
                 <div class="slideType" v-if="show">
                     <ul>
-                        <li @click="handleType('手机号',1)">手机号</li>
-                        <li @click="handleType('身份证号',2)">身份证号</li>
-                        <li @click="handleType('病历号',3)">病历号</li>
-                        <li @click="handleType('市民卡号',4)" style="border:0 none">市民卡号</li>
+                        <li @click="handleType('手机号',103)">手机号</li>
+                        <li @click="handleType('身份证号',101)">身份证号</li>
+                        <li @click="handleType('病历号',102)">病历号</li>
+                        <li @click="handleType('市民卡号',104)" style="border:0 none">市民卡号</li>
                     </ul>
                 </div>
             </div>
             <div class="iptWrap number">
-                <input @blur="blur" :maxlength="type==1?11:type==2?18:type==3?7:type==4?9:30" v-model="value" @input="changeVal" :type="type!=2?'tel':'text'" class="input" type="text" :placeholder="'请输入'+name" >
+                <input @blur="blur" :maxlength="type==103?11:type==101?18:type==102?7:type==104?9:30" v-model="value" @input="changeVal" :type="type==101||type==104?'text':'tel'" class="input" type="text" :placeholder="'请输入'+name" >
             </div>
             <div :class="['btn',value?'btnClick':'btnDis']" @click="handleDepart">进入预问诊</div>
         </div>
         <div class="tip">
             注:建议您可先输入病情情况,方便医生提前了解情况
         </div>
+      <Submit
+        v-if="submit"
+        :showType="showType"
+        :fail="failMsg"
+        @showSubmit="showSubmit"
+      ></Submit>
     </div>
 </template>
 <script>
-    import {phoneTest,identify} from '@utils/tools.js';
+    import {phoneTest,identify,jgpattern} from '@utils/tools.js';
+    import Submit from '../common/Submit';
+    import api from '@utils/api.js';
     export default {
         name: "Login",
         data(){
             return {
+                showType: 'fail',
+                failMsg:'',
+                submit:false,
                 show:false,
-                type:'1',
+                type:'103',
                 name:'手机号',
                 value:''
             }
@@ -60,28 +71,86 @@
             },
             changeVal(){
                 document.activeElement.scrollIntoViewIfNeeded(true);
-                if(this.type != 2){
-                    this.value=this.value.replace(/[^\d]/g,'')
+                const {type,value} = this
+                if(type == 102||type == 103){
+                    this.value=value.replace(/[^\d]/g,'')
+                }else if(type == 101 || type == 104){
+                    this.value=value.replace(/[\u4e00-\u9fa5]/g,'')
                 }
             },
+            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);
+            },
+            showSubmit(flg) {
+                this.submit = flg
+            },
             handleDepart(){
                 const {type,value} = this
-                if(type == 1){
-                    console.log(phoneTest.test(value))
-                    if(!phoneTest.test(value)){//验证不通过
-
-                    }
-                }else if(type == 2){
 
-                }else if(type == 3){
-
-                }else if(type == 4){
-
-                }
                 if(value){
-                    this.$router.replace({path:'/department'})
+                  if(type == 103){
+                      console.log(phoneTest.test(value))
+                      if(!phoneTest.test(value)){//验证不通过
+                          this.defaultWaring('请输入正确的11位手机号码')
+                          return
+                      }
+                  }else if(type == 101){//身份证
+                      if(!identify.test(value)){//验证不通过
+                          this.defaultWaring('请输入正确的身份证号')
+                          return
+                      }
+                  }else if(type == 104){//病历号
+                      if(!jgpattern.test(value)){//验证不通过
+                          this.defaultWaring('请输入正确的市民卡号')
+                          return
+                      }
+                  }
+                  const param = {
+                      "patientInfo": this.value,
+                      "patientInfoType": this.type
+                  }
+                  api.signIn(param).then((res) => {
+                      const result = res.data;
+                      if (result.code == 0) {
+                          if(result.data.length>1){
+                              this.$router.replace({
+                                  name:'Department',
+                                  params:{"result":result.data}
+                              })
+                          }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
+                            }
+                            this.$router.replace({
+                                path:'/',
+                                query:params
+                            })
+                          }else{
+
+                          }
+                      }else{
+                        this.defaultWaring(res)
+                      }
+                  }).catch(()=>{
+                        this.defaultWaring('网络异常请稍后重试')
+                  })
                 }
             }
+        },
+        components:{
+          Submit
         }
     }
 </script>

+ 15 - 6
src/components/PathInfo.vue

@@ -107,12 +107,19 @@
     },
     methods:{
       getPathInfo(){
+        let query = this.$route.query
+        let hasQuery = JSON.stringify(query) == '{}'
         const params = {
-          'hospitalCode':getUrlArgObject('hospitalCode'),
-          'hospitalDeptCode':getUrlArgObject('hospitalDeptCode'),
-          'doctorCode':getUrlArgObject('doctorCode'),
-          'patientCode':getUrlArgObject('patientCode'),
-          'recordId':getUrlArgObject('recordId')
+          // 'hospitalCode':getUrlArgObject('hospitalCode'),
+          // 'hospitalDeptCode':getUrlArgObject('hospitalDeptCode'),
+          // 'doctorCode':getUrlArgObject('doctorCode'),
+          // 'patientCode':getUrlArgObject('patientCode'),
+          // 'recordId':getUrlArgObject('recordId')
+          'hospitalCode':!hasQuery&&query.hospitalCode||'',
+          'hospitalDeptCode':!hasQuery&&query.hospitalDeptCode||'',
+          'doctorCode':!hasQuery&&query.doctorCode||'',
+          'patientCode':!hasQuery&&query.patientCode||'',
+          'recordId':!hasQuery&&query.recordId||''
         }
         api.getPathInfo(params).then((res)=>{
           const result = res.data;
@@ -125,8 +132,10 @@
         })
       },
       getSysConfig(){
+        let query = this.$route.query
+        let hasQuery = JSON.stringify(query) == '{}'
         const param = {
-          'hospitalCode':getUrlArgObject('hospitalCode')
+          'hospitalCode':!hasQuery&&query.hospitalCode||'',
         }
         api.getSysConfig(param).then((res)=>{
           const result = res.data;

+ 4 - 0
src/utils/api.js

@@ -12,6 +12,7 @@ const urls = {
   uploadImageThum:'/api/prec/file/uploadImageThum',//单个文件上传同时生成缩略图
   uploadImageThums:'/api/prec/file/uploadImageThums',//多个文件上传同时生成缩略图
   getTagInfos:'/api/prec/retrieval/getTagInfos',//检索
+  signIn:'/api/prec/patientInfo/signIn',//登录
   // uploadImageThums:'http://192.168.3.1:8849/file/uploadImageThums',//多个文件上传同时生成缩略图
 }
 
@@ -49,4 +50,7 @@ export default {
   saveInquiry(param){
     return axios.post(urls.saveInquiry,param)
   },
+  signIn(param){
+    return axios.post(urls.signIn,param)
+  },
 }

+ 4 - 1
src/utils/tools.js

@@ -111,6 +111,8 @@ const patt = /\$\{[^\]]+\}/g;
 const phoneTest = /^[1]([3-9])[0-9]{9}$/;
 //身份证验证
 const identify =/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/;
+//只能是数字和字母
+const jgpattern =/^[A-Za-z0-9]+$/; 
 
 
 const getAllStr = (allData) =>{//获取界面数据,拼接字符串
@@ -321,7 +323,8 @@ module.exports =  {
   setScroll,
   isWX,
   phoneTest,
-  identify
+  identify,
+  jgpattern
 }