Browse Source

初步走通

zhouna 5 years ago
parent
commit
0fb70954b8

+ 1 - 1
config/index.js

@@ -5,7 +5,7 @@
 const path = require('path')
 const path = require('path')
 // const proxy_path = 'http://192.168.2.236:80';
 // 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.236:5050';
-const proxy_path = 'http://192.168.2.241:5050';
+const proxy_path = 'http://192.168.2.236:5050';
 
 
 module.exports = {
 module.exports = {
   dev: {
   dev: {

+ 24 - 20
src/common/ComTextArea.vue

@@ -1,11 +1,14 @@
 <template>
 <template>
   <div class="comArea" :style="getStyle(detail,slide)">
   <div class="comArea" :style="getStyle(detail,slide)">
-    <textarea @input="changeVal" 
-            :style="{width:width,height:height}" 
-            v-model="txt" 
+    <textarea
+            :style="{width:width,height:height}"
+            v-model="txt"
             placeholder="请输入"
             placeholder="请输入"
             @focus="focus"
             @focus="focus"
             @blur="blur"></textarea>
             @blur="blur"></textarea>
+    <div :class="txt?'realSure sure':'sure'" @click="makeSuer">
+      确定
+    </div>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -15,6 +18,9 @@ import $ from 'jquery'
 export default {
 export default {
   name:'ComTextArea',
   name:'ComTextArea',
   props: {
   props: {
+    num:{
+      default:0
+    },
     width: {
     width: {
       default: '100%',
       default: '100%',
       type: String
       type: String
@@ -23,10 +29,6 @@ export default {
       default: '2rem',
       default: '2rem',
       type: String
       type: String
     },
     },
-    item:{
-      type:Object,
-      require: true
-    },
     slide:{
     slide:{
       default:false,
       default:false,
       type:Boolean
       type:Boolean
@@ -38,8 +40,9 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
-      txt:this.item.value || '' //回读用
-      // txt:'' 
+      txt: '', //回读用
+      sure:false,
+      // txt:''
     }
     }
   },
   },
   methods:{
   methods:{
@@ -55,9 +58,10 @@ export default {
       }
       }
     },
     },
     changeVal(){
     changeVal(){
-      this.$emit('changeAreaVal',this.txt)
+      /*this.$emit('changeAreaVal',this.txt)
       const newData = Object.assign({},this.item,{value:this.txt,valueP:this.txt});
       const newData = Object.assign({},this.item,{value:this.txt,valueP:this.txt});
-      this.$emit("updata",newData);
+      this.$emit("updata",newData);*/
+
     },
     },
     blur(){
     blur(){
       setTimeout(()=>{
       setTimeout(()=>{
@@ -70,22 +74,22 @@ export default {
           $(".foot").css({'display':'none'})
           $(".foot").css({'display':'none'})
         }, 150);
         }, 150);
       }
       }
+    },
+    makeSuer(){
+      let n = this.num;
+      this.$emit("updata",'',this.txt,++n);
     }
     }
   },
   },
-  watch:{
-    item:{//清空时更新数据
-      handler(newVal,oldVal){
-        this.txt = newVal.value;
-      },
-      deep:true
-    }
-  }
 }
 }
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
 @import '../less/base.less';
 @import '../less/base.less';
   .comArea {
   .comArea {
-    .bgques;
+    width: 100%;
+    position:fixed;
+    bottom:0;
+    background:#fff;
+    padding: 0 4%;
     textarea {
     textarea {
       color: #4F50FF;
       color: #4F50FF;
       resize: none;
       resize: none;

+ 17 - 2
src/common/Dialog.vue

@@ -7,10 +7,15 @@
       </div>
       </div>
     </div>
     </div>
     <div class="right clearfix" v-if="item.content">
     <div class="right clearfix" v-if="item.content">
-      <img src="../images/patient.png" alt class="fr" />
-      <div class="content fr">
+      <img v-if="typeof(item.content)==='string'" src="../images/patient.png" alt class="fr" />
+      <div v-if="typeof(item.content)==='string'" class="content fr">
         <p>{{item.content}}</p>
         <p>{{item.content}}</p>
       </div>
       </div>
+      <div v-else class="imgs-list">
+        <p>
+          <img v-for="img in item.content" :src="img" alt=""/>
+        </p>
+      </div>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -52,6 +57,16 @@ export default {
   padding-top: 0.2rem;
   padding-top: 0.2rem;
   margin-bottom: 0.12rem;
   margin-bottom: 0.12rem;
   padding-right: 0.24rem;
   padding-right: 0.24rem;
+  .imgs-list{
+    max-width: 80%;
+    text-align: right;
+    float: right;
+    margin-right: 0.8rem;
+    img{
+      width: 1.5rem;
+      height: 1.5rem;
+    }
+  }
   .content {
   .content {
     max-width: 5rem;
     max-width: 5rem;
     background-color: #colors[theme];
     background-color: #colors[theme];

+ 6 - 6
src/common/Label.vue

@@ -4,9 +4,9 @@
       <span>{{it.description||it.name}}</span>
       <span>{{it.description||it.name}}</span>
       <span v-if="it.select==1" @click="deletSymp($event,it,index)"><img src="../images/del.png" alt=""></span>
       <span v-if="it.select==1" @click="deletSymp($event,it,index)"><img src="../images/del.png" alt=""></span>
     </p>
     </p>
-    <Toast :message="delText" 
+    <Toast :message="delText"
           :show="showToast"
           :show="showToast"
-          @comfirn="comfirnDel" 
+          @comfirn="comfirnDel"
           @cancel="cancelDel"/>
           @cancel="cancelDel"/>
   </div>
   </div>
 </template>
 </template>
@@ -31,7 +31,7 @@
     created(){
     created(){
       this.datas = this.item;
       this.datas = this.item;
       // 回读互斥项标识
       // 回读互斥项标识
-      const arr = this.datas.questionMapping;
+      const arr = this.datas.questionMapping;console.log(this.item,this.datas.questionMapping)
       const filArr = arr.filter(it=>it.select==1);
       const filArr = arr.filter(it=>it.select==1);
       if(filArr.length > 0){
       if(filArr.length > 0){
         this.exclusion = filArr[0].exclusionType;
         this.exclusion = filArr[0].exclusionType;
@@ -43,7 +43,7 @@
     methods:{
     methods:{
       handleClick(it,index,flg){
       handleClick(it,index,flg){
         if(flg){
         if(flg){
-          document.activeElement.blur();      
+          document.activeElement.blur();
           document.activeElement.scrollIntoViewIfNeeded(true);
           document.activeElement.scrollIntoViewIfNeeded(true);
           setTimeout(()=>{
           setTimeout(()=>{
             document.activeElement.scrollIntoViewIfNeeded(true);
             document.activeElement.scrollIntoViewIfNeeded(true);
@@ -176,5 +176,5 @@
       // background:#E3E4E8;
       // background:#E3E4E8;
     }
     }
   }
   }
-  
-</style>
+
+</style>

+ 22 - 25
src/common/Picker.vue

@@ -11,9 +11,9 @@
                 <!-- <div class="selected">
                 <!-- <div class="selected">
                 </div> -->
                 </div> -->
             </div>
             </div>
-            <div class="conBtn">
-                <div class="confirm" @click="onConfirm">确定</div>
-            </div>
+          <div :class="'realSure sure'" @click="onConfirm">
+            确定
+          </div>
         </div>
         </div>
     </div>
     </div>
 
 
@@ -22,39 +22,36 @@
 <script>
 <script>
 export default {
 export default {
     name:"Picker",
     name:"Picker",
-    props: ["defaultIndex","num"],
-    data() {
-        let num = [];
-        for(let i = 1; i <=60; i++) {
-          num.push(i)
+    props: {
+      defaultIndex:{default:0},
+      num:{default:0},
+      defaultVal:{default:"37.3°C"},
+      columns:{
+        default:function() {
+          return ['37.3°C', '37.4°C', '37.5°C', '37.6°C', '37.7°C', '37.8°C', '37.9°C', '38.0°C',
+            '38.1°C', '38.2°C', '38.3°C', '38.4°C', '38.5°C', '38.6C', '38.7°C', '38.8°C', '38.9°C',
+            '39.0°C', '39.1°C', '39.2°C', '39.3°C', '39.4°C', '39.5°C', '39.6°C', '39.7°C', '39.8°C',
+            '39.9°C', '40.0°C', '40.1°C', '40.2°C', '40.3°C', '40.4°C', '40.5°C', '40.6°C', '40.7°C',
+            '40.8°C', '40.9°C', '41.0°C', '41.1°C', '41.2°C', '41.3°C', '41.4°C', '41.5°C', '41.6°C',
+            '41.7°C', '41.8°C', '41.9°C', '42.0°C'];
         }
         }
-        let unit = ['分钟', '小时', '天', '周', '月','年'];
+      }
+      },
+    data() {
         return {
         return {
-            columns: [
-              {
-                values:num,
-                className:'column1',
-                defaultIndex: 0
-              },
-              {
-                values:unit,
-                className:'column2',
-                defaultIndex: 2
-              },
-            ],
             time: 100,
             time: 100,
             selectIndex: 0,
             selectIndex: 0,
-            selectValue: "1天"
+            selectValue: this.defaultVal
         }
         }
     },
     },
     methods: {
     methods: {
         changeTemp(picker, value, index) {
         changeTemp(picker, value, index) {
             this.selectIndex = index;
             this.selectIndex = index;
-            this.selectValue = value.join("");
+            this.selectValue = typeof(value)==="string"?value:value.join("");
         },
         },
         onConfirm() {
         onConfirm() {
             let number = this.num;
             let number = this.num;
-            this.$emit('confirm', this.selectValue, this.selectIndex,++number)
+            this.$emit('confirm','', this.selectValue, ++number)
         },
         },
 
 
     }
     }
@@ -65,7 +62,7 @@ export default {
 .pickerBox{
 .pickerBox{
     position: fixed;
     position: fixed;
     width: 100%;
     width: 100%;
-    height: 230px;
+    height: 5.3rem;
     border-radius: 10px 10px 0 0;
     border-radius: 10px 10px 0 0;
     background: #fff;
     background: #fff;
     overflow-y: hidden;
     overflow-y: hidden;

+ 18 - 20
src/common/Radio.vue

@@ -3,10 +3,9 @@
   <div class="select">
   <div class="select">
     <ul class="clearfix">
     <ul class="clearfix">
       <li
       <li
-
         v-for="(item,idx) in result"
         v-for="(item,idx) in result"
         :class="[{'liSelect':item.select,'noBorder':((item.description||item.name).indexOf('${'))!=-1}]"
         :class="[{'liSelect':item.select,'noBorder':((item.description||item.name).indexOf('${'))!=-1}]"
-        :key="item.value"
+        :key="item.id"
         @click="selectResult(item,idx)"
         @click="selectResult(item,idx)"
       >
       >
         <span v-if="((item.description||item.name).indexOf('${'))==-1">{{item.description||item.name}}</span>
         <span v-if="((item.description||item.name).indexOf('${'))==-1">{{item.description||item.name}}</span>
@@ -21,6 +20,7 @@
 </template>
 </template>
 <script>
 <script>
   import OptionInp from '../common/OptionInp.vue';
   import OptionInp from '../common/OptionInp.vue';
+  import {concatVal} from '../utils/tools.js';
 export default {
 export default {
   props: ["symptomResult","num"],
   props: ["symptomResult","num"],
   data() {
   data() {
@@ -35,7 +35,8 @@ export default {
   },
   },
   mounted() {
   mounted() {
     this.numPlus = this.num;
     this.numPlus = this.num;
-    this.result = this.symptomResult;
+    const list = this.symptomResult.questionDetailList;
+    this.result = list.length>0?list:this.symptomResult.questionMapping;
   },
   },
   watch:{
   watch:{
     result: {
     result: {
@@ -57,6 +58,17 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
+    inpVal(val,index){//输入框失焦处理
+      // 输入框回读
+      let detailList = this.result;
+      let currItem = detailList[index];
+      currItem.value = val;
+      // 输入框失焦重新拼接父级的value
+      let temp = concatVal(detailList);
+      /*this.datas.value = temp.value;
+      this.datas.valueP = temp.valueP;
+      this.$emit("updata",this.datas);*/
+    },
     handleClick(it,index,flg,ipt){
     handleClick(it,index,flg,ipt){
       if(flg){
       if(flg){
         document.activeElement.blur();
         document.activeElement.blur();
@@ -90,14 +102,14 @@ export default {
     },
     },
     makeSuer() {
     makeSuer() {
       if(!this.sure){return}
       if(!this.sure){return}
-      let result = this.result;console.log(result)
+      let result = this.result;
       let number = this.numPlus,tmpResult='';
       let number = this.numPlus,tmpResult='';
       for (let i = 0; i < result.length; i++) {
       for (let i = 0; i < result.length; i++) {
           if(result[i].select){
           if(result[i].select){
-            tmpResult=result[i].name
+            tmpResult=result[i].description||result[i].name
           }
           }
         }
         }
-        this.contentResult = tmpResult
+        this.contentResult = tmpResult;
       this.$emit("updataResultSingle", this.result, this.contentResult,++number);
       this.$emit("updataResultSingle", this.result, this.contentResult,++number);
     },
     },
     selectResult(item,idx) {
     selectResult(item,idx) {
@@ -153,19 +165,5 @@ export default {
     background-color: #colors[btn];
     background-color: #colors[btn];
     border-color:  #colors[btn];
     border-color:  #colors[btn];
   }
   }
-  .sure {
-    width: 100%;
-    height: 0.88rem;
-    font-size: .28rem;
-    background-color: #colors[btn];
-    line-height: 0.88rem;
-    margin-top: 0.8rem;
-    text-align: center;
-    color: #fff;
-    opacity: 0.5;
-    &.realSure {
-      opacity: 1;
-    }
-  }
 }
 }
 </style>
 </style>

+ 6 - 19
src/common/Select.vue

@@ -5,7 +5,7 @@
       <li
       <li
         v-for="(item,idx) in result"
         v-for="(item,idx) in result"
         :class="[{'liSelect':item.select}]"
         :class="[{'liSelect':item.select}]"
-        :key="item.value"
+        :key="item.id"
         @click="selectResult(item,idx)"
         @click="selectResult(item,idx)"
       >
       >
       {{item.description||item.name}}
       {{item.description||item.name}}
@@ -32,7 +32,8 @@ export default {
   },
   },
   mounted() {
   mounted() {
     //this.numPlus = this.num
     //this.numPlus = this.num
-    this.result = this.symptomResult;
+    console.log(this.symptomResult.questionDetailList)
+    this.result = this.symptomResult.questionDetailList;
   },
   },
   watch:{
   watch:{
     result: {
     result: {
@@ -61,11 +62,11 @@ export default {
       if(!this.sure){return}
       if(!this.sure){return}
       let result = this.result;
       let result = this.result;
       // if(this.numPlus == 1){
       // if(this.numPlus == 1){
-        let tmpIds = [],tmpResult=[],staticArr=['2001','2002'];
+        let tmpResult=[];
         for (let i = 0; i < result.length; i++) {
         for (let i = 0; i < result.length; i++) {
           if(result[i].select){
           if(result[i].select){
             //tmpIds=tmpIds.concat(result[i].connectId)
             //tmpIds=tmpIds.concat(result[i].connectId)
-            tmpResult.push(result[i].name)
+            tmpResult.push(result[i].description||result[i].name);
           }
           }
         }
         }
         //tmpIds=tmpIds.concat(staticArr)
         //tmpIds=tmpIds.concat(staticArr)
@@ -75,7 +76,7 @@ export default {
 
 
       // }
       // }
       let number = this.num;
       let number = this.num;
-      this.$emit("updataResult", this.result,  this.contentResult,number == 0?0:++number);
+      this.$emit("updataResult", this.result,  this.contentResult,++number);
     },
     },
     selectResult(item,idx) {
     selectResult(item,idx) {
       const { exclusion, select } = item;
       const { exclusion, select } = item;
@@ -135,19 +136,5 @@ export default {
     background-color: #colors[btn];
     background-color: #colors[btn];
     border-color:  #colors[btn];
     border-color:  #colors[btn];
   }
   }
-  .sure {
-    width: 100%;
-    height: 0.88rem;
-    font-size: .28rem;
-    background-color: #colors[btn];
-    line-height: 0.88rem;
-    margin-top: 0.8rem;
-    text-align: center;
-    color: #fff;
-    opacity: 0.5;
-    &.realSure {
-       opacity: 1;
-     }
-  }
 }
 }
 </style>
 </style>

+ 80 - 13
src/common/UploadImg.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
-  <div class="img-wrap bgques">
+  <div class="img-wrap">
     <div class="box">
     <div class="box">
-      
+
       <ul class="upload-imgs">
       <ul class="upload-imgs">
         <li v-for='(value, key) in imgs' class="imgLis">
         <li v-for='(value, key) in imgs' class="imgLis">
           <p class="imgbox">
           <p class="imgbox">
@@ -32,11 +32,15 @@
           <p>点击上传</p>
           <p>点击上传</p>
         </li>
         </li>
       </ul>
       </ul>
+      <div :class="imgLen>0?'realSure sure':'sure'" @click="saveAllImage">
+        确认上传
+      </div>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 <script type="text/javascript">
 <script type="text/javascript">
-import {isIos,isWX,isQQ} from '@utils/tools';
+import {isIos,isWX,isQQ} from '../utils/tools';
+import api from '../utils/api.js';
 import $ from 'jquery';
 import $ from 'jquery';
 export default {
 export default {
   name: 'UploadImg',
   name: 'UploadImg',
@@ -45,17 +49,18 @@ export default {
       mag: "上传图片",
       mag: "上传图片",
       imgs: {},
       imgs: {},
       imgLen: 0,
       imgLen: 0,
-      flag:true //图片处理完成后才可以再次点击上传
+      flag:true, //图片处理完成后才可以再次点击上传
+      sure:false,
     }
     }
   },
   },
-  props: ['item', 'moduleType', 'imgList'],
+  props: ['item', 'moduleType', 'imgList','num'],
   mounted() {
   mounted() {
     this.imgs = this.imgList; //回读
     this.imgs = this.imgList; //回读
     this.imgLen = Object.keys(this.imgList).length;
     this.imgLen = Object.keys(this.imgList).length;
     this.$previewRefresh();//预览刷新
     this.$previewRefresh();//预览刷新
     /*if(isIos()){
     /*if(isIos()){
       $('.upload').removeAttr("capture")
       $('.upload').removeAttr("capture")
-    }else if(!isWX()){ 
+    }else if(!isWX()){
     // 微信端添加这个属性直接调拍照
     // 微信端添加这个属性直接调拍照
     //安卓手机且非微信端添加相机属性,否则QQ浏览器打不开相机
     //安卓手机且非微信端添加相机属性,否则QQ浏览器打不开相机
       $('.upload').attr("capture","camera")
       $('.upload').attr("capture","camera")
@@ -67,12 +72,52 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
-    handleUpload() {
+    saveAllImage() {
+      let n = this.num;
+      this.$emit("updataResult",this.item,this.imgs,++n);
+      return;
+      let formData = new FormData();
+      let imgList = this.$store.state.diagnose.imgFile;
+      if (imgList.length > 0) {//有图片先上传图片
+        this.$store.commit('handleToggleShow', true);
+        for (let i = 0; i < imgList.length; i++) {
+          formData.append('upfiles', imgList[i].file);
+          formData.append('type', imgList[i].type);
+        }
+        api.uploadImageThums(formData).then((res) => {//获取图片
+          let data = res.data;
+          if (data.code == 0) {//图片提交成功再保存数据
+            let reportList = [];
+            let result = data.data;
+            for(let i = 0;i < result.length;i++){
+              let obg = {}
+              obg.originalImage = result[i].url+'?width='+imgList[i].imgWidth+'&height='+imgList[i].imgHeight
+              obg.originalName = result[i].original
+              obg.orderNum = i+1
+              obg.type = result[i].type
+              reportList.push(obg)
+            }
+            this.imgList = reportList
+            // alert('图片上传完成:'+dayDiff+'s')
+            //this.saveAllDate()
+          } else {//提交失败提示
+            this.defaultWaring(res)
+          }
+        }).catch((err)=>{
+          this.defaultWaring(err)
+        })
+        return;
+      } else {//没有图片直接保存数据
+        this.$store.commit('handleToggleShow', true);
+        //this.saveAllDate();
+      }
+    },
+    /*handleUpload() {
       const inp = this.$refs.inp;
       const inp = this.$refs.inp;
       if(this.flag){
       if(this.flag){
         inp.click();
         inp.click();
-      } 
-    },
+      }
+    },*/
     delImg(key) {
     delImg(key) {
       let obj = this.imgs;
       let obj = this.imgs;
       delete (obj[key]);
       delete (obj[key]);
@@ -190,12 +235,18 @@ export default {
 }
 }
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
+  @import "../less/base.less";
 .img-wrap {
 .img-wrap {
   font-size: 0.3rem;
   font-size: 0.3rem;
+  position:fixed;
+  bottom:0;
+  background:#fff;
+  width:100%;
   .upload-imgs {
   .upload-imgs {
-    margin-bottom: 0.2rem;
+    margin:0 1rem 0.2rem;
+    height: 3.5rem;
     .upload{
     .upload{
-      width: 1.9rem;
+      width: 1.5rem;
       height: 100%;
       height: 100%;
       position: absolute;
       position: absolute;
       left: 0;
       left: 0;
@@ -204,6 +255,8 @@ export default {
     }
     }
     .uploadBox {
     .uploadBox {
       // border: 1px solid #dfe0e4;
       // border: 1px solid #dfe0e4;
+      width: 1.5rem;
+      height: 1.5rem;
       box-sizing: border-box;
       box-sizing: border-box;
       text-align: center;
       text-align: center;
       background: url('../images/addimg.png') no-repeat;
       background: url('../images/addimg.png') no-repeat;
@@ -222,8 +275,8 @@ export default {
       }
       }
     }
     }
     li {
     li {
-      width: 1.9rem;
-      height: 1.9rem;
+      width: 1.5rem;
+      height: 1.5rem;
       display: inline-block;
       display: inline-block;
       position: relative;
       position: relative;
       vertical-align: top;
       vertical-align: top;
@@ -262,4 +315,18 @@ export default {
     }
     }
   }
   }
 }
 }
+  .sure {
+    width: 100%;
+    height: 0.88rem;
+    font-size: .28rem;
+    background-color: #colors[btn];
+    line-height: 0.88rem;
+    margin-top: 0.8rem;
+    text-align: center;
+    color: #fff;
+    opacity: 0.5;
+  &.realSure {
+     opacity: 1;
+   }
+  }
 </style>
 </style>

+ 6 - 3
src/common/UsualSymptom.vue

@@ -1,14 +1,14 @@
 <template>
 <template>
   <div class="usual-symptom">
   <div class="usual-symptom">
     <p class="title-bar">
     <p class="title-bar">
-      <a href="javascript:void(0)"><img src="../images/back.png" alt="返回"/></a>
+      <a href="javascript:void(0)" @click="back"><img src="../images/back.png" alt="返回"/></a>
       <span>您哪里不舒服?</span>
       <span>您哪里不舒服?</span>
     </p>
     </p>
     <ul class="radio-item clearfix">
     <ul class="radio-item clearfix">
       <li
       <li
         v-for="(item,idx) in symptoms"
         v-for="(item,idx) in symptoms"
         :class="[{'liSelect':item.select}]"
         :class="[{'liSelect':item.select}]"
-        :key="item.value"
+        :key="idx"
         @click="selectResult(item,idx)"
         @click="selectResult(item,idx)"
         @touchstart.prevent="touchstart(item,idx)"
         @touchstart.prevent="touchstart(item,idx)"
         @touchend.prevent="touchend(item,idx+1)"
         @touchend.prevent="touchend(item,idx+1)"
@@ -47,6 +47,9 @@
       }
       }
     },
     },
     methods:{
     methods:{
+      back(){
+        this.$router.go(-1);
+      },
       touchend(item,flg) {//症状点开详情
       touchend(item,flg) {//症状点开详情
         clearTimeout(this.timer);
         clearTimeout(this.timer);
         this.end = this.$store.state.scroll
         this.end = this.$store.state.scroll
@@ -84,7 +87,7 @@
         },600)
         },600)
       },
       },
       formatData(data){
       formatData(data){
-        data.length=10;
+        data.length=data.length>10?10:data.length;
         return data.map((i)=>{
         return data.map((i)=>{
           return Object.assign({},i,{
           return Object.assign({},i,{
             name:i.name,
             name:i.name,

+ 151 - 210
src/components/MainPage.vue

@@ -2,9 +2,9 @@
   <div class="page">
   <div class="page">
     <div class="progress-bar">
     <div class="progress-bar">
       <div class="title">
       <div class="title">
-        <span class="active">症状情况</span>
-        <span>诊疗情况</span>
-        <span>其他情况</span>
+        <span :class="{'active':activeTab===0}">症状情况</span>
+        <span :class="{'active':activeTab===1}">诊疗情况</span>
+        <span :class="{'active':activeTab===2}">其他情况</span>
       </div>
       </div>
       <div class="progress">
       <div class="progress">
         <p :style="{width:progress}"></p>
         <p :style="{width:progress}"></p>
@@ -37,57 +37,95 @@
             <p>{{selectedSymptom.description||selectedSymptom.name}}</p>
             <p>{{selectedSymptom.description||selectedSymptom.name}}</p>
           </div>
           </div>
         </div>
         </div>
-        <div v-for="(item,idx) in allquestionLis" :key="idx">
+        <div v-for="(item,idx) in allquestionLis" :key="'0'+item.id" v-if="activeTab>-1">
+          <Dialog :idx="idx" v-if="item.show" :item="item" @selectToggle="selectToggle"/>
+        </div>
+        <div v-for="(item,idx) in diagQasList" :key="'1'+item.id" v-if="activeTab>0">
+          <Dialog :idx="idx" v-if="item.show" :item="item" @selectToggle="selectToggle"/>
+        </div>
+        <div v-for="(item,idx) in otherQasList" :key="'2'+item.id" v-if="activeTab>1">
           <Dialog :idx="idx" v-if="item.show" :item="item" @selectToggle="selectToggle"/>
           <Dialog :idx="idx" v-if="item.show" :item="item" @selectToggle="selectToggle"/>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
-    <Select @updataResult="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 2"></Select>
+    <Select @updataResult="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 2||type==8"></Select>
     <Radio @updataResultSingle="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 1"></Radio>
     <Radio @updataResultSingle="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 1"></Radio>
-    <Picker v-if="type == 9" @confirm="pickerConfirm" :num="num" :defaultIndex = "defaultIndex"></Picker>
+    <!--普通单列拨盘-->
+    <Picker v-if="type==10" @confirm="updataResultSingle" :num="num" :defaultIndex = "defaultIndex"></Picker>
+    <!--时间拨盘,拨盘内容写死-->
+    <Picker v-if="type == 9" :columns="getTimeColumns()" :defaultVal="pickDVal" @confirm="updataResultSingle" :num="num" :defaultIndex = "defaultIndex"></Picker>
+    <!-- 上传图片 -->
+    <UploadImg v-if="type==4"
+               :num="num"
+               :item="symptomResult"
+               :moduleType="symptomResult.type"
+               @updataResult="updataResultSingle"
+               :imgList="imgs"/>
+    <!-- 输入框 -->
+    <Input v-if="type==7"
+           :num="num"
+           :item="symptomResult"
+           :key="symptomResult.id"
+           @updata="updataResultSingle"/>
+    <!-- 文本域 -->
+    <ComTextArea v-if="type==6 || type == 5"
+                 :num="num"
+                 :item="symptomResult"
+                 width="92%"
+                 @updata="updataResultSingle"/>
+    <div class="submit" v-if="showPreview">
+      <a href="javascript:void(0)" @click="previewRes">提交并预览</a>
+    </div>
     <div v-if="wrong" class="tip">{{waring}}</div>
     <div v-if="wrong" class="tip">{{waring}}</div>
-    <!--<ConfirmBox :show="showConfirm" @confirmDialog="confirmDialog" @cancelDialog = "cancelDialog"></ConfirmBox>-->
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
 import BScroll from 'better-scroll';
 import BScroll from 'better-scroll';
-import {data} from '../utils/data.js'
-import Radio from '../common/Radio'
-import Select from '../common/Select'
-import Dialog from '../common/Dialog'
-import Picker from '../common/Picker'
+import Radio from '../common/Radio';
+import Select from '../common/Select';
+import Dialog from '../common/Dialog';
+import Picker from '../common/Picker';
+import Label from '../common/Label.vue';
+import ComTextArea from '../common/ComTextArea.vue';
+import Input from '../common/Input.vue';
+import PickTime from '../common/PickTime.vue';
+import UploadImg from '../common/UploadImg.vue';
 import ConfirmBox from '../common/ConfirmBox'
 import ConfirmBox from '../common/ConfirmBox'
 import UsualSymptom from '../common/UsualSymptom';
 import UsualSymptom from '../common/UsualSymptom';
 import api from "../utils/api.js";
 import api from "../utils/api.js";
+import {mapState} from 'vuex';
 
 
 export default {
 export default {
   name:'MainPage',
   name:'MainPage',
   data(){
   data(){
-    let tmpDatas = JSON.parse(JSON.stringify(data));
     return {
     return {
-      disData:data,//所有的数据
-      result:'诊断结果',
       num:0,//题目计数
       num:0,//题目计数
-      show:false,
-      showUsual:false,
+      pickDVal:'1天',    //时间控件默认值
+      showUsual:false,    //常用症状显示
+      activeTab:0,      //当前模块
       scroll:null,
       scroll:null,
-      type :-1,
-      tmpSymptom:'',
+      type :-1,       //当前显示的控件类型
+      showPreview:false,//显示预览按钮
       selectedSymptom:{},
       selectedSymptom:{},
-      tmpDatas:tmpDatas,
       symptomResult:'',//症状选择
       symptomResult:'',//症状选择
       connectResult:[],//关联问题的id
       connectResult:[],//关联问题的id
       contentResult:'',//选中的结果name
       contentResult:'',//选中的结果name
-      rules:[],//规则所需数据value
-      allquestionLis:[],//所有的问题
-      current:0,//第几题
+      allquestionLis:[],//症状详情所有的问题
+      diagQasList:[], //诊疗详情所有问题
+      otherQasList:[],//其他情况所有问题
+      listMap:{
+        0:'allquestionLis',
+        1:'diagQasList',
+        2:'otherQasList'
+      },
+      moduleMap:{
+        0:'symptom',
+        1:'diagnose',
+        2:'others'
+      },
       defaultIndex: 0, //温度默认值
       defaultIndex: 0, //温度默认值
-      selectTemp: '', //选择的温度
       order:0,
       order:0,
-      arr1:[],//规则数据1.....
-      arr2:[],//规则数据2.....
       userInfo: {}, //用户信息
       userInfo: {}, //用户信息
-      lastDis:'',//诊断
       pdbm:'8.5rem',
       pdbm:'8.5rem',
       waring:'',
       waring:'',
       wrong:false,
       wrong:false,
@@ -110,31 +148,30 @@ export default {
       this.scroll = bs
       this.scroll = bs
     })
     })
     // this.tmpSymptom = JSON.parse(JSON.stringify(data))
     // this.tmpSymptom = JSON.parse(JSON.stringify(data))
-    this.symptomResult = data.symptom.result;
+    //this.symptomResult = data.symptom.result;
   },
   },
   computed:{
   computed:{
+    ...mapState({
+      imgs: state => state.diagnose.imgSrc,
+    }),
     progress(){
     progress(){
       if(!this.num){
       if(!this.num){
         return '0.1px';
         return '0.1px';
       }
       }
-      const precent = this.num/(this.allquestionLis.length+1);
+      const moduleName = this.listMap[this.activeTab];
+      const precent = this.num/(this[moduleName].length+1);
       return precent*100+"%";
       return precent*100+"%";
     }
     }
   },
   },
   methods:{
   methods:{
+    previewRes(){
+      this.$router.push({
+        path:'/preview'
+      })
+    },
     updata(){
     updata(){
-      let tmpData = data
-      tmpData.symptom.content = ''
-      this.disData = this.tmpDatas
-
-      this.symptomResult = this.tmpDatas.symptom.result
-      this.connectResult = []
-      this.rules = []
-      this.allquestionLis = []
-      this.arr1 = []
-      this.arr2 = []
+      this.allquestionLis = [];
       this.pdbm = '8.5rem'
       this.pdbm = '8.5rem'
-      //this.type = 1;
       this.showUsual=true;
       this.showUsual=true;
       this.num = 0;
       this.num = 0;
     },
     },
@@ -145,16 +182,63 @@ export default {
       }
       }
       this.symptomResult = result
       this.symptomResult = result
       this.type = type
       this.type = type
-      this.current = idx
       this.order = order
       this.order = order
       this.scrollDown()
       this.scrollDown()
     },
     },
+    getTimeColumns(){
+      let num = [];
+      for(let i = 1; i <=60; i++) {
+        num.push(i)
+      }
+      let unit = ['分钟', '小时', '天', '周', '月','年'];
+      return [
+        {
+          values:num,
+          className:'column1',
+          defaultIndex: 0
+        },
+        {
+          values:unit,
+          className:'column2',
+          defaultIndex: 2
+        },
+      ]
+    },
     updataResultSingle(result,contentResult,num){
     updataResultSingle(result,contentResult,num){
       this.num = num;
       this.num = num;
       this.type = -1;
       this.type = -1;
-      let tmpArr = JSON.parse(JSON.stringify(this.allquestionLis));
-      let tmpArrDetailResult = JSON.parse(JSON.stringify(this.allquestionLis[num].questionDetailList));
+      let moduleName = this.listMap[this.activeTab];
+      let tmpArr = JSON.parse(JSON.stringify(this[moduleName]));
       tmpArr[num-1].content = contentResult;
       tmpArr[num-1].content = contentResult;
+      this[moduleName] = tmpArr;
+      if(+num===this[moduleName].length){
+        console.log(this.$store.state);   //最后一题答完
+        if(this.activeTab>1){         //模块配置待修改
+          this.showPreview=true;
+          return;
+        }
+        const state = this.$store.state;
+        this.activeTab++;   //进入下一个阶段问题
+        this.num = 0;
+        moduleName = this.listMap[this.activeTab];
+        const mDataName = this.moduleMap[this.activeTab];
+        this[moduleName] = JSON.parse(JSON.stringify(state[mDataName].datas));
+        let tmpArrDetail1 = JSON.parse(JSON.stringify(this[moduleName][0]));
+        this[moduleName][0] = tmpArrDetail1;
+        const tmpNowItem = this[moduleName][this.num];
+        let timer = setTimeout(() => {
+          this.type = tmpNowItem.controlType;
+          tmpNowItem.show = true;
+          console.log(tmpNowItem)
+          this.symptomResult = tmpNowItem;
+        });
+        this.$nextTick(()=>{
+          this.scroll.refresh()
+          this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
+        })
+        return;
+      }
+      let tmpArrDetailResult = JSON.parse(JSON.stringify(this[moduleName][num]));
       let tmpArrDetail = JSON.parse(JSON.stringify(tmpArr[num]));
       let tmpArrDetail = JSON.parse(JSON.stringify(tmpArr[num]));
 
 
       let timer = setTimeout(() => {
       let timer = setTimeout(() => {
@@ -165,147 +249,11 @@ export default {
         clearTimeout(timer)
         clearTimeout(timer)
       }, this.time);
       }, this.time);
 
 
-      this.allquestionLis = tmpArr;
-      this.$nextTick(()=>{
-        this.scroll.refresh()
-        this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
-      })
-    },
-    updataResult(result,connectResult,contentResult,num){
-      this.num = num;
-      this.type = -1;
-      let tmpAllData = this.disData;
-      let tmpAllquestion = this.disData.allquestion,tmpArr = [],cur = this.current;
-      for(let i = 0;i < tmpAllquestion.length;i++){//根据选择的答案需要添加问题
-        for(let k = 0;k < connectResult.length;k++){
-          if(connectResult[k] == tmpAllquestion[i].id){
-            tmpAllquestion[i].order = k
-            tmpArr.push(tmpAllquestion[i])
-          }
-        }
-      }
-      if(num == 0){//第一题完成
-        let tmpSymptom = this.disData.symptom
-        tmpSymptom.content = contentResult
-        tmpSymptom.result = result
-        this.disData.symptom = tmpSymptom
-        tmpAllData.symptom = tmpSymptom
-        let timer = setTimeout(() => {
-          tmpArr[0].show = true
-          this.type = tmpArr[0].type
-          this.symptomResult = tmpArr[0].result
-          this.allquestionLis = tmpArr
-          clearTimeout(timer)
-        }, this.time);
-        let tmpArr1 = []
-        for(let i = 0;i < result.length;i++){
-          if(result[i].select){
-            tmpArr1.push(result[i].value)
-          }
-        }
-        this.arr1 = tmpArr1
-      }else{//最后一道题多选,答完匹配规则
-        let tmpAllquestion = this.disData.allquestion,tmpArrs = JSON.parse(JSON.stringify(this.allquestionLis));
-        let tmpArr1 = []
-        tmpArrs[num-1].content = contentResult
-        tmpAllquestion.result = result
-        this.allquestionLis = tmpArrs
-        tmpAllquestion[tmpAllquestion.length-1].content = contentResult
-        tmpAllData.allquestion = tmpAllquestion
-
-        for(let i = 0;i < result.length;i++){
-          if(result[i].select){
-            tmpArr1.push(result[i].value)
-          }
-        }
-
-        this.arr2 = tmpArr1
-        this.getDis()
-        let detailArr=[];
-        let obj = {
-          "question":tmpAllData.symptom.question,
-          "answer":tmpAllData.symptom.content
-        };
-
-        detailArr.push(obj)
-        for(let k = 0;k < tmpArrs.length;k++){
-          let tmpObj = {}
-          tmpObj.question = tmpArrs[k].question
-          tmpObj.answer = tmpArrs[k].content
-          detailArr.push(tmpObj)
-        }
-        let params =	{
-          "doctorId": this.userInfo.doctorId,
-	        "mpiId": this.userInfo.mpiId,
-	        "appId": this.userInfo.appId,
-	        "diagnosis": this.lastDis,
-          "detailList": detailArr,
-          "department":this.userInfo.department,
-          "doctorName": this.userInfo.doctorName,
-          "organName": this.userInfo.organName,
-          "patientAge": this.userInfo.patientAge,
-          "patientName": this.userInfo.patientName,
-          "patientSex": this.userInfo.patientSex
-        }
-        this.saveInfo(params)
-      }
-      this.disData = tmpAllData
-      // this.symptomResult = result
-      this.contentResult = contentResult
       this.$nextTick(()=>{
       this.$nextTick(()=>{
         this.scroll.refresh()
         this.scroll.refresh()
         this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
         this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
       })
       })
     },
     },
-    saveInfo(params){
-      api.saveInfo(params).then((res)=>{
-        let data = res.data;
-        if(data.code == 0){
-          let url = data.data.body
-          window.location.href = url
-        }else{
-          this.waring = data.msg
-          this.wrong = true
-          setTimeout(() => {
-            this.wrong = false
-          }, 2000);
-        }
-      })
-    },
-    getDis(){//规则匹配诊断结果诊断结果获取
-      const result1 = this.arr1;
-      const result2 = this.arr2;
-      const resultList = data.resultList;
-      let resultIndex = -1
-      for(let i = 0; i < resultList.length; i++) {
-        if(this.hasResult(resultList[i].result1,result1)&&this.hasResult(resultList[i].result2,result2)) {
-          resultIndex = i
-          break;
-        }
-      }
-      if(resultIndex == 0){
-        this.lastDis = '建议立刻发热门诊就诊,并且佩戴好口罩做好防护。佩戴医用外科口罩或N95口罩,避免乘坐公共交通工具。'
-      }else if(resultIndex == 1){
-        this.lastDis = '结合你提供的病情症状及接触史特点,建议继续在家监测体温,可适当服用治疗感冒的中成药,注意手卫生,多饮水,休息为主。若体温持续不退或体温大于38℃或不适症状加重,及时就诊。'
-      }else if(resultIndex == 2){
-        this.lastDis = '建议你们全家及密切接触者居家隔离至少2周,在家期间建议戴口罩交流,条件允许时,尽量单独居住或居住在通风良好的单人房间。多休息,多饮水,注意手卫生和常用物品卫生消毒。若出现发热及呼吸道症状,需马上前往医院就诊。'
-      }else if(resultIndex == 3){
-        this.lastDis = '建议您戴口罩、勤洗手,避免人群聚集,减少不必要外出。'
-      }
-    },
-    hasResult(arr1, arr2) {
-      let result = false;
-      for(let i = 0; i < arr2.length; i++) {
-        if(arr1.findIndex((item) => {return item === arr2[i]}) >-1) {
-          result = true;
-        }
-      }
-      return result;
-    },
-    back(){
-      this.showConfirm = true
-      // this.$router.go(-1)
-    },
     selectUsual(sym){
     selectUsual(sym){
       this.getSymptomQas(sym.questionId);     //获取症状下的关联问题
       this.getSymptomQas(sym.questionId);     //获取症状下的关联问题
       this.selectedSymptom = sym;   //设置搜索选中症状
       this.selectedSymptom = sym;   //设置搜索选中症状
@@ -324,10 +272,11 @@ export default {
           if(!data){
           if(!data){
             return ;
             return ;
           }
           }
-          const qaLis = data.questionMapping;
+          let qaLis = data.questionMapping;
+          //qaLis.length=2;     //开发测试代码,要删除
           qaLis[0].show=true;   //第一题自动显示
           qaLis[0].show=true;   //第一题自动显示
           this.type = qaLis[0].controlType;
           this.type = qaLis[0].controlType;
-          this.symptomResult = qaLis[0].questionDetailList;
+          this.symptomResult = qaLis[0];
           this.allquestionLis = qaLis;
           this.allquestionLis = qaLis;
         }else{
         }else{
 
 
@@ -337,41 +286,17 @@ export default {
     scrollDown(){
     scrollDown(){
       this.scroll.scrollTo(0, this.scroll.maxScrollY)
       this.scroll.scrollTo(0, this.scroll.maxScrollY)
     },
     },
-    pickerConfirm(value,index,num){
-      this.defaultIndex = index
-      this.type = -1;
-      this.num = num;
-      let tmpArr = JSON.parse(JSON.stringify(this.allquestionLis));
-      tmpArr[num-1].content = value;
-      let timer = setTimeout(() => {
-        tmpArr[num].show = true;
-        this.type = tmpArr[num].controlType;
-        this.symptomResult = tmpArr[num].questionDetailList;
-        clearTimeout(timer)
-      }, this.time);
-
-      this.allquestionLis = tmpArr;
-      this.$nextTick(()=>{
-        this.scroll.refresh();
-        this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
-      })
-    },
-    confirmDialog(){
-      this.$router.replace({
-        path:'/',
-        query:this.userInfo
-      })
-      // this.$router.go(-1)
-    },
-    cancelDialog(){
-      this.showConfirm = false
-    }
   },
   },
   components:{
   components:{
     Radio,
     Radio,
     Select,
     Select,
     Dialog,
     Dialog,
     Picker,
     Picker,
+    Label,
+    ComTextArea,
+    Input,
+    PickTime,
+    UploadImg,
     ConfirmBox,
     ConfirmBox,
     UsualSymptom
     UsualSymptom
   }
   }
@@ -475,5 +400,21 @@ export default {
   transform: translateX(-50%);
   transform: translateX(-50%);
   color: #fff;
   color: #fff;
 }
 }
+  .submit{
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    a{
+      display: inline-block;
+      width: 100%;
+      height: 0.88rem;
+      font-size: .28rem;
+      background-color: #colors[btn];
+      line-height: 0.88rem;
+      margin-top: 0.8rem;
+      text-align: center;
+      color: #fff;
+    }
+  }
 
 
 </style>
 </style>

+ 17 - 66
src/components/Preview.vue

@@ -62,26 +62,29 @@
             </li>
             </li>
           </ul>
           </ul>
         </div>
         </div>
-        <div class="doctorData" @click="handleClick(true)">医生端数据展示</div>
+        <!--<div class="doctorData" @click="handleClick(true)">医生端数据展示</div>-->
       </div>
       </div>
     </div>
     </div>
-    <div class="foot">
+    <!--<div class="foot">
         <span
         <span
           class="back"
           class="back"
           @click="back"
           @click="back"
         >上一步</span>
         >上一步</span>
         <span
         <span
-          class="next"
+          class="submit-btn"
           @click="saveAllImage"
           @click="saveAllImage"
-        >提 交</span>
-      </div>
+        >提交给医生</span>
+      </div>-->
+    <div class="realSure sure" @click="saveAllDate">
+    提交给医生
+  </div>
       <Submit
       <Submit
         v-if="submit"
         v-if="submit"
         :showType="showType"
         :showType="showType"
         @showSubmit="showSubmit"
         @showSubmit="showSubmit"
       ></Submit>
       ></Submit>
       <Loading v-if="this.$store.state.loadingShow"></Loading>
       <Loading v-if="this.$store.state.loadingShow"></Loading>
-      <div class="personMsgDoc" v-show="showDoc">
+      <!--<div class="personMsgDoc" v-show="showDoc">
         <div class="personMsgDocModal" @click="handleClick(false)"></div>
         <div class="personMsgDocModal" @click="handleClick(false)"></div>
         <div class="personMsgDocDetail">
         <div class="personMsgDocDetail">
           <img class="close" src="../images/small-close.png" alt="" @click="handleClick(false)">
           <img class="close" src="../images/small-close.png" alt="" @click="handleClick(false)">
@@ -93,13 +96,13 @@
                   <span v-for="(item,idx) in symptom.choose" :key="item.name+idx" v-if="item.idx == 1">
                   <span v-for="(item,idx) in symptom.choose" :key="item.name+idx" v-if="item.idx == 1">
                     {{item.special?item.name+item.special:item.name}}
                     {{item.special?item.name+item.special:item.name}}
                   </span>
                   </span>
-                </p>                
+                </p>
               </li>
               </li>
               <li>
               <li>
                 <h4><i></i> 现病史:</h4>
                 <h4><i></i> 现病史:</h4>
                 <p>
                 <p>
                   <template v-for="(value,index) in checkText">
                   <template v-for="(value,index) in checkText">
-                    <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
+                    &lt;!&ndash; 患者于时间单位前诱因出现症状,其余题目的内容; &ndash;&gt;
                     <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.text}}{{checkText.length==1?'':','}}</span>
                     <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.text}}{{checkText.length==1?'':','}}</span>
                     <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.text}}{{checkText.length==2?'':'、'}}</span>
                     <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.text}}{{checkText.length==2?'':'、'}}</span>
                     <span :key="index" v-if="index>1">{{value.text}}{{index == checkText.length-1?'':'、'}}</span>
                     <span :key="index" v-if="index>1">{{value.text}}{{index == checkText.length-1?'':'、'}}</span>
@@ -126,7 +129,7 @@
             </ul>
             </ul>
           </div>
           </div>
         </div>
         </div>
-      </div>
+      </div>-->
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -213,63 +216,6 @@ export default {
     back() {
     back() {
       this.$router.go(-1);
       this.$router.go(-1);
     },
     },
-    saveAllImage() {
-      let formData = new FormData();
-      let imgList = this.diagnose.imgFile;
-      // let tmpNum = this.tmpNum;
-      // var dateBegin = new Date();//获取当前时间
-      if (imgList.length > 0) {//有图片先上传图片
-        this.$store.commit('handleToggleShow', true);
-        for (let i = 0; i < imgList.length; i++) {
-          let pageFile = imgList[i].file
-          formData.append('upfiles', imgList[i].file);
-          // formData.append('upfile', imgList[i].file);
-          formData.append('type', imgList[i].type);
-          // api.uploadImageThum(formData).then((res)=>{
-          //   console.log(res)
-          //   let result = res.data;
-          //   if (result.code == 0) {
-          //     this.tmpNum = ++tmpNum
-          //     if(this.tmpNum == imgList.length){
-          //       var dateEnd = new Date();//获取当前时间
-          //       var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
-          //       var dayDiff = dateDiff / 1000;//计算出秒数
-          //       alert('图片上传完成:'+dayDiff+'s')
-          //     }
-          //   }
-          // })
-        }
-        api.uploadImageThums(formData).then((res) => {//获取图片
-          let data = res.data;
-          if (data.code == 0) {//图片提交成功再保存数据
-            let reportList = [];
-            let result = data.data;
-            for(let i = 0;i < result.length;i++){
-              let obg = {}
-              obg.originalImage = result[i].url+'?width='+imgList[i].imgWidth+'&height='+imgList[i].imgHeight
-              obg.originalName = result[i].original
-              obg.orderNum = i+1
-              obg.type = result[i].type
-              reportList.push(obg)
-            }
-            this.imgList = reportList
-                // var dateEnd = new Date();//获取当前时间
-                // var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
-                // var dayDiff = dateDiff / 1000;//计算出秒数
-                // alert('图片上传完成:'+dayDiff+'s')
-            this.saveAllDate()
-          } else {//提交失败提示
-            this.defaultWaring(res)
-          }
-        }).catch((err)=>{
-          this.defaultWaring(err)
-        })
-        return;
-      } else {//没有图片直接保存数据
-        this.$store.commit('handleToggleShow', true);
-        this.saveAllDate();
-      }
-    },
     getDetailText(textArr,flg){
     getDetailText(textArr,flg){
       let msg = "",obg={},msgP = "";
       let msg = "",obg={},msgP = "";
       if(flg == 1){
       if(flg == 1){
@@ -575,4 +521,9 @@ export default {
   padding: 8px;
   padding: 8px;
   z-index: 1001;
   z-index: 1001;
 }
 }
+  .sure{
+    position: fixed;
+    bottom: 0;
+    z-index: 100;
+  }
 </style>
 </style>

+ 14 - 0
src/less/base.less

@@ -176,3 +176,17 @@
 .displayNone {
 .displayNone {
   display: none !important;
   display: none !important;
 }
 }
+.sure {
+  width: 100%;
+  height: 0.88rem;
+  font-size: .28rem;
+  background-color: #colors[btn];
+  line-height: 0.88rem;
+  margin-top: 0.8rem;
+  text-align: center;
+  color: #fff;
+  opacity: 0.5;
+  &.realSure {
+    opacity: 1;
+  }
+}