ソースを参照

详情页新增提示信息,input组件number类型限制不能输入非数字

liucf 5 年 前
コミット
89d77a0075

+ 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: {

+ 4 - 1
src/common/Input.vue

@@ -19,8 +19,11 @@
     },
     props:['item'],
     methods:{
-      changeVal(){
+      changeVal(e){
         this.borColor = true;
+        if(this.item.controlType==7){//数字键盘
+          this.val = e.target.value=e.target.value.replace(/[^\d]/g,'')
+        }
       },
       blur(){
         this.borColor = false;

+ 7 - 1
src/common/OptionInp.vue

@@ -6,7 +6,8 @@
       <input :type="msg.type=='number'?'tel':'text'" 
               :placeholder="msg.placeholder"
               v-model="txt"
-              @blur="handleBlur">
+              @blur="handleBlur"
+              @input="changeVal">
     </div>
     <span class="suffix" v-if="msg.suffix">{{msg.suffix}}</span>
   </div>
@@ -26,6 +27,11 @@ import { getExpStr } from '@utils/tools';
       this.msg = getExpStr(this.item.name);
     },
     methods:{
+      changeVal(e){
+        if(this.msg.type=='number'){//数字键盘
+          this.txt = e.target.value=e.target.value.replace(/[^\d]/g,'')
+        }
+      },
       handleBlur(){
         // 如果该项未选中,则不存值
       const select = this.item.select;

+ 14 - 2
src/components/DetailBox.vue

@@ -6,6 +6,7 @@
       </span>
       <span class="name">{{privateData.name+'详情'}}</span>
       <span @click="handleClear">清空</span>
+      <i>{{tips}}</i>
     </div>
     <div class="main">
       <Detail :datas="privateData" 
@@ -31,7 +32,8 @@
         privateData:{},
         compFlag:false,
         clearTxt:"是否清空当前已选内容?",
-        showToast:false
+        showToast:false,
+        tips:"(请完成病情预问诊可让医生提前了解病情)"
       }
     },
     created(){
@@ -86,7 +88,8 @@
     // animation: wave .4s ease-in;
     animation: wave .4s linear;
     .head{
-      height: .88rem;
+      // height: .88rem;
+      height: 1rem; //增加了提示
       line-height: .88rem;
       display: flex;
       justify-content: space-between;
@@ -94,6 +97,15 @@
       padding: 0 .4rem 0 .32rem;
       font-size: .28rem;
       color: #7C828E;
+      i{
+        position: absolute;
+        top:0.35rem;
+        left:0;
+        font-size: .22rem;
+        width:100%;
+        display: inline-block;
+        text-align: center;
+      }
       .icon{
         display: inline-block;
         height: 100%;

+ 3 - 3
src/components/Symptom.vue

@@ -97,7 +97,7 @@ export default {
       labelDetail: {}, //明细
       checkText: text, //症状情况文字
       questId: null, //id
-      delText: "是否删除该信息?<br/> (已填内容将清除)",
+      delText: "是否删除该信息?<br/>(已填内容将清除)",
       delIndex: null,
       showToast: false,
       searchShow: false,//显示搜索界面
@@ -218,7 +218,7 @@ export default {
       this.delIndex = index;
       this.questId = item.questionId || item.conceptId;
       if (this.chooseSymp.length == 1) {
-        this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
+        this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>(已填内容将清除)"
       }
       this.showToast = true;
     },
@@ -240,7 +240,7 @@ export default {
       this.showToast = false;
       this.delIndex = null;
       this.questId = null;
-      this.delText = "是否删除该信息?<br/> (已填内容将清除)";
+      this.delText = "是否删除该信息?<br/>(已填内容将清除)";
     },
     complete() {//明细填写完成
       if(this.isSearch){

+ 3 - 3
src/utils/tools.js

@@ -1,7 +1,7 @@
 
 const qs = require('qs');
-// const imageUrlPrefix = 'http://192.168.2.241:82' //后台图片地址
-const imageUrlPrefix = 'http://192.168.2.236:82' //后台图片地址
+const imageUrlPrefix = 'http://192.168.2.241:82' //后台图片地址
+// const imageUrlPrefix = 'http://192.168.2.236:82' //后台图片地址
 
 const getUrlArgObject = (parm) => {
     let query = window.location.search;
@@ -41,7 +41,7 @@ const getExpStr = (str) =>{
 // 多行输入 多个输入框
 const getModelExpStr = (str,txt) =>{
   let result = {}
-  console.log(str,txt,44444)
+  // console.log(str,txt,44444)
   if(str.match(/\${number_(.*})/)){//数字输入框
     let matchStr = str.match(/\${number_(.*})/)[0]
     let tmpHolder = matchStr.split('${number_')[1].split('}')[0]