1178232204@qq.com 3 yıl önce
ebeveyn
işleme
a4f4094665

+ 8 - 4
src/common/Toast.vue

@@ -7,8 +7,8 @@
                 <!-- {{message||msg}} -->
               </div>
               <div class="btn">
-                <span @click="comfirn" :class="title == '去填写'?'canc comf':'comf'">{{title}}</span>
-                <span @click="cancel" class="canc">{{title2}}</span>
+                <span @click="comfirn" :class="title == '去填写'?'canc comf':type==1?'comf tips':'comf'">{{title}}</span>
+                <span @click="cancel" class="canc" v-if="type!=1">{{title2}}</span>
               </div>
             </div>
             <div class="mask" @click="cancel"></div>
@@ -21,10 +21,11 @@ import $ from 'jquery';
     name:'Toast',
     data(){
       return {
-        msg:"是否删除该信息?"
+        msg:"是否删除该信息?",
+
       }
     },
-    props:['message','show','labShow','title','title2'],
+    props:['message','show','labShow','title','title2','type'],
     mounted() {
       console.log(this.title)
     },
@@ -94,6 +95,9 @@ import $ from 'jquery';
         .canc{
           color: #333333;
         }
+        .tips{
+          width: 100%
+        }
       }
     }
     .mask{

Dosya farkı çok büyük olduğundan ihmal edildi
+ 489 - 327
src/components/MainPage.vue


+ 21 - 28
src/components/PathInfo.vue

@@ -50,7 +50,14 @@
       </div>
       <p class="explain">注:请核对您的挂号信息,如有错误请到窗口询问</p>
       <div class="btmContent" @click="getStart">确认并继续</div>
-      <div class="btmScale" @click="goScale">
+      <div
+        class="btmScale"
+        @click="goScale"
+        v-if="
+          pathInfo.hospitalDeptName == '呼吸内科/咳嗽/戒烟门诊xs' ||
+          pathInfo.hospitalDeptName == '呼吸内科/咳嗽/戒烟门诊'
+        "
+      >
         <img src="../images/scale.png" />
         评估
       </div>
@@ -66,7 +73,7 @@
       title="确认"
       title2="取消"
       @comfirn="comfirnDel"
-      @cancel="cancelDel"
+      type="1"
     />
     <Submit v-if="submit" :fail="tipMsg" showType="fail"></Submit>
     <StartPage v-if="showStart" :showStart="showStart" />
@@ -86,7 +93,7 @@ import {
 import StartPage from "../common/HomePage";
 import BScroll from "better-scroll";
 import { mapState } from "vuex";
-
+import Tiptoast from "../common/Tiptoast.vue";
 export default {
   name: "PathInfo",
   data() {
@@ -108,7 +115,7 @@ export default {
       time: "",
       params: {},
       showToast: false,
-      message: "",
+      message: "您已完成一次填写,重新填写将会覆盖原有内容。",
       showStart: false,
       allMoudles: {},
       scaleCount: 0,
@@ -138,14 +145,7 @@ export default {
   },
   methods: {
     comfirnDel() {
-      if (this.i == 1) {
-        this.goNext();
-      } else {
-        this.$router.push({
-          path: "/chooseScale",
-          query: JSON.parse(localStorage.getItem("loginParam")),
-        });
-      }
+      this.showToast = false;
     },
     cancelDel() {
       this.showToast = false;
@@ -192,6 +192,7 @@ export default {
           this.$store.commit("savePathInfo", result.data);
           this.getAll(); //获取模板
           this.getUsualSymptom(); //获取科室常用症状
+          this.recordCheck();
         }
       });
     },
@@ -256,21 +257,12 @@ export default {
         if (result.code == 0) {
           let data = result.data;
           if (
-            (data.detailCount > 0 && data.physicalCount > 0 && i == 1) ||
-            (data.scaleCount > 0 && i == 2)
+            data.detailCount > 0 ||
+            data.physicalCount > 0 ||
+            data.scaleCount > 0
           ) {
             //有预问诊信息
             this.showToast = true;
-            this.i = i;
-          } else {
-            if (i == 1) {
-              this.goNext();
-            } else {
-              this.$router.push({
-                path: "/chooseScale",
-                query: JSON.parse(localStorage.getItem("loginParam")),
-              });
-            }
           }
         }
       });
@@ -283,8 +275,10 @@ export default {
       }
     },
     goScale() {
-      this.message = "您已完成一次评估,是否重新录入?";
-      this.recordCheck(2);
+      this.$router.push({
+        path: "/chooseScale",
+        query: JSON.parse(localStorage.getItem("loginParam")),
+      });
     },
     getAll() {
       const param = {
@@ -316,8 +310,7 @@ export default {
         this.defaultWaring("网络异常请稍后重试");
         return;
       }
-      this.message = "您已完成一次预问诊,是否重新录入?";
-      this.recordCheck(1); //校验是否填过
+      this.goNext();
     },
     defaultWaring(msg) {
       this.submit = true;

+ 2 - 2
src/components/Preview.vue

@@ -70,7 +70,7 @@
               <div v-if="scaleInfo">
                 <p>{{ scaleInfo[0].scaleName }}</p>
                 <p>得分:{{ scaleInfo[0].score }}</p>
-                <p>结果为{{ scaleInfo[0].result }}</p>
+                <p>结果为{{ scaleInfo[0].result }}</p>
               </div>
             </li>
             <li v-if="tabType[moduleCP['other']] == 1 && others.text.length>0">
@@ -231,7 +231,7 @@ export default {
     }),
   },
   created() {
-    console.log(this.scaleInfo);
+    console.log(this.addContentDate);
     this.getTime();
     if (this.config.length == 0) {
       //登录进去返回到列表页,扫码返回到开始页

+ 28 - 19
src/components/ScaleDetail.vue

@@ -11,7 +11,7 @@
         :key="index"
       >
         <p><i>*</i>{{ item.title }}</p>
-        <van-radio-group v-model="item.checked">
+        <van-radio-group v-model="item.checked" >
           <van-radio
             v-for="(it, i) in item.scaleList"
             :key="i"
@@ -27,7 +27,7 @@
       :message="message"
       :show="showToast"
       title="去填写"
-      title2="提交并预览病"
+      title2="提交并预览病"
       @comfirn="comfirn"
       @cancel="cancel"
     />
@@ -36,6 +36,7 @@
 <script>
 import { data } from "@utils/data.js";
 import Toast from "../common/Toast.vue";
+import { mapState } from "vuex";
 export default {
   data() {
     return {
@@ -44,39 +45,40 @@ export default {
       showToast: false,
       message: "量表填写成功,预问诊未填写是否去填写?",
       isSure: false,
+      score:0
     };
   },
+  mounted() {
+    this.list = JSON.parse(JSON.stringify(data.asthmaScale));
+  },
+  components: {
+    Toast,
+  },
   computed: {
-    score() {
+    ...mapState({
+      istrue: (state) => state.istrue,
+    }),
+  },
+  methods: {
+    getscore() {
       let score = 0;
       for (let i in this.list.list) {
         score += parseInt(this.list.list[i].checked);
       }
       return score;
     },
-    result() {
+    getresult() {
       if (this.score < 20) {
         return "未达到目标在过去4周内,哮喘可能没有得到控制。可以制订一个哮喘管理计划,帮助改善哮喘控制。";
-      } else if (this.score < 24 && this.score > 20) {
+      } else if (this.score < 25 && this.score > 19) {
         return "接近目标在过去4周内,哮喘已得到良好控制,但还没有完全控制。";
       } else if (this.score >= 25) {
         return "在过去4周内,哮喘已得到完全控制。没有哮喘症状,生活也不受哮喘所限制。";
       }
     },
-  },
-  mounted() {
-    this.list = JSON.parse(JSON.stringify(data.asthmaScale))
-  },
-  components: {
-    Toast,
-  },
-  methods: {
     goback() {
       this.$router.go(-1);
     },
-    onChange(item, i) {
-      this.list.list[i].checked = item.score;
-    },
     comfirn() {
       this.$router.push({
         path: "/tab",
@@ -99,13 +101,20 @@ export default {
           const scaleList = [
             {
               dataJson: JSON.stringify(this.list.list),
-              result: this.result,
+              result: this.getresult(),
               scaleName: this.list.title,
-              score: this.score,
+              score: this.getscore(),
             },
           ];
+          console.log(scaleList);
           this.$store.commit("saveScaleInfo", scaleList);
-          this.showToast = true;
+          if (this.istrue) {
+            this.$router.push({
+              path: "/preview",
+            });
+          } else {
+            this.showToast = true;
+          }
         }
       }, 0);
     },

+ 5 - 0
src/store.js

@@ -10,6 +10,7 @@ const store = new Vuex.Store({
     scaleInfo:null,//量表信息
     sysConfig:[], //系统配置项
     allMoudles:[], //模板
+    istrue:false,//是否填写预问诊
     extPushSymptom:[],      //后台维护的伴随症状
     scroll:{
       x:0,y:0
@@ -63,6 +64,7 @@ const store = new Vuex.Store({
       "52": 0,
     },
     addBuriedSomeList:[],//买点数据
+    deptName:'',//科室名字
   },
   mutations:{
     setShowDoctor(state,flag){
@@ -154,6 +156,9 @@ const store = new Vuex.Store({
     setSearchShow(state,flg){//搜索显示与否
       state.searchShow = flg;
     },
+    setistrue(state,flg){
+      state.istrue = flg
+    },
     setSymptomDatas(state,data){
       const temp = formatSymptomData(data);
       state.symptom.origin = temp.newArr;