Sfoglia il codice sorgente

独立填写单维护

zhouna 6 anni fa
parent
commit
94b6793fc9

+ 13 - 3
src/api/config.js

@@ -198,7 +198,7 @@ export default {
     'searchKnowledgeLis': 'api/knowledgeman/scaleContent/index', //量表结构检索
     'getknowledgeList': 'api/knowledgeman/dictionaryInfo/getList', //量表结构字典信息
     'getModuleType': 'api/icssman/moduleInfo/getModuleType',  //模板维护 -- 类型筛选
-	'indexByLexicon': 'api/knowledgeman/commonconcept/indexByLexicon',  //知识库标准化-根据名称和术语库词性类型搜索
+	  'indexByLexicon': 'api/knowledgeman/commonconcept/indexByLexicon',  //知识库标准化-根据名称和术语库词性类型搜索
     'getAssaySon': 'api/knowledgeman/lisSonContact/lisSonContactList',  //化验子项维护
     'getAssaySonDetail': 'api/knowledgeman/lisSonContact/relationContactDetail',  //化验子项维护-详情
     'getConceptInfoAssay': '/api/knowledgeman/concept/getAllForRelation',  //化验子项维护-搜索术语
@@ -212,7 +212,14 @@ export default {
     'removeRelationContact': 'api/knowledgeman/multContact/removeRelationContact', //知识库标准化-医学术语多层关联维护-删除或者恢复
     'relationContactDetail': 'api/knowledgeman/multContact/relationContactDetail', //知识库标准化-医学术语多层关联维护-详情
     'addMultRelation': 'api/knowledgeman/multContact/addRelation', //知识库标准化-医学术语多层关联维护-添加或者编辑
-	},
+	  /*********预问诊相关接口**********/
+	  'questionList':'/api/precman/questionInfo_prec/page',     //预问诊-填写单列表
+    'questionAdd':'/api/precman/questionInfo_prec/saveOrUpdate',      //预问诊-填写单添加
+    'questionSearch':'/api/precman/questionInfo_prec/index',    //预问诊-填写单检索
+    'preTypeList':'/api/precman/dictionaryInfo_prec/getList',   //类型枚举
+    'questionDel':'/api/precman/questionInfo_prec/delete',      //删除
+    'uploadImg':'/api/precman/file_prec/uploadImage',       //图片上传
+  },
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',
 		'YH-GDFW': 'el-icon-service',
@@ -239,5 +246,8 @@ export default {
     {controlType:[0,1,2],tagType:[1,2,3,4],notTagType:[2,8]}, //组合项标签(既往史)
     {controlType:[1,6],tagType:[],notTagType:[8]},    //化验组合
     {controlType:[1,2,99],tagType:[],notTagType:[8]},   //症状推送类型(添加症状)
-  ]
+  ],
+  msg:{
+    imgTip:'无法上传图片,图片大小不可超过2M'
+  }
 }

+ 21 - 0
src/api/preTreat.js

@@ -0,0 +1,21 @@
+import axios from 'axios';
+import config from '@api/config.js';
+
+const urls = config.urls;
+export default {
+  getQuestionList(param){
+    return axios.post(urls.questionList,param);
+  },
+  questionAdd(param){
+    return axios.post(urls.questionAdd,param);
+  },
+  questionSearch(param){
+    return axios.post(urls.questionSearch,param);
+  },
+  getPreTypeList(){
+    return axios.post(urls.preTypeList,{});
+  },
+  questionDel(param){
+    return axios.post(urls.questionDel,param);
+  }
+}

+ 242 - 0
src/components/preTreat/AddSimpleQuestion.vue

@@ -0,0 +1,242 @@
+<template>
+    <div class="NoiseTemplateWrapper TemplateWrapper">
+        <crumbs
+                :title="txt"
+                class="topBack"
+                linkTo="/admin/LT-YWZSJWH-DLTXDWH"
+        ></crumbs>
+        <PubIndeptQa
+                @changeVal="changeVal"
+                @changeSex="changeSex"
+                @changeType="changeType"
+                @validatePass="validatePass"
+                :editData="editData"
+                ref="submitForm"
+        ></PubIndeptQa>
+        <div class="main">
+            <p class="title" v-if="dataPub.region2==1||dataPub.region2==2|| dataPub.region2==11">
+                <i>*</i> 填写单明细:
+                <i v-if='dataPub.region2==2' style="margin-left:70px;color: #22ccc8; font-size: 12px;">所有选项必须都有或者都没有同“伴”/“无”标记</i>
+            </p>
+            <PubSelect v-if="dataPub.region2==1 || dataPub.region2==2 || dataPub.region2==11" :ascription="dataPub.region1" :sexType="dataPub.region7" :type="dataPub.region2" @pushValues="pushValues" :options="editData.questionDetailList"></PubSelect>
+            <div class="btn">
+                <el-button
+                        type="primary"
+                        @click="submitForm"
+                >确 定</el-button>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+  /**
+   * dataPub.region2  判断底部显示哪些
+   */
+  import PubIndeptQa from './PubIndeptQa';
+  import PubSelect from './PubSelect';
+  import api from '@api/icss.js';
+  import utils from '@api/utils.js';
+
+  export default {
+    name: 'addSimpleQuestion',
+    data() {
+      return {
+        txt:'独立填写单维护-添加独立填写单',
+        imgList:[],
+        dataPub: {},      //公用组件传的值都在这
+        itemsTypes:[1,2],            //有明细的类型
+        editData:{},                    //编辑数据
+        form: {
+          currentOrder: '0',     //标签成文顺序
+        },
+        rules: {
+          currentOrder: [
+            { required: true, message: '选择标签成文顺序', trigger: 'change' }
+          ]
+        },
+        options: [],           //标签明细右侧操作数据
+      }
+    },
+    beforeMount:function(){
+      const {isEdit,data} = this.$route.params;
+      if(isEdit){
+        this.txt = '独立填写单维护-修改独立填写单'
+        this.editData = data;
+      }
+    },
+    computed: {
+      newSign() {
+        return this.dataPub.region2;
+      },
+    },
+    watch: {
+      newSign(nextVal, prevVal) {
+        if (nextVal != prevVal) {
+          this.form.currentOrder = '0'
+        }
+      },
+    },
+    methods: {
+      back() { this.$router.go(-1) },
+      changeVal(val) {    //子组件数据改变传递到父组件
+        this.dataPub = val
+        console.log('公用组件传的值都在这', val)
+      },
+      changeSex(sex) {       //性别改变,清空填写单明细
+        //console.log(sex)
+      },
+      changeType(type) {        //填写单类型改变,标签明细左侧更新,右侧清空
+        // console.log('type',type)
+        this.options = [];
+      },
+      pushValues(its){
+        this.options = its;
+      },
+      submitForm() {      // 调用子组件的方法验证公用部分
+        this.$refs.submitForm.submitForm('groups');
+      },
+      validatePass() {      //验证成功回调,调取接口
+        //仍需验证填写单明细是否选择
+        let isNull = true
+        let options2 = []
+        const opts = this.options;
+        for (let i = 0; i < this.options.length; i++) {
+          if(this.options[i].name.trim() != '') {
+            isNull = false
+            options2.push(this.options[i])
+          }
+        }
+        this.options = options2;
+        if(this.itemsTypes.includes(+this.dataPub.region2)&&isNull) {
+          this.warning('至少填一个选项')
+          return;
+        }
+        let flag=true;
+        if(opts[0] && opts[0].code){
+          flag=opts.findIndex((it)=>{
+            return !it.code;
+          })==-1;
+        }else{
+          flag=opts.findIndex((it)=>{
+            return it.code;
+          })==-1;
+        }
+        if(!flag){
+          this.warning('所有选项必须都有或者都没有同“伴”/“无”标记')
+          return;
+        }
+        if(parseFloat(this.dataPub.region8) >= parseFloat(this.dataPub.region9)) {
+          this.warning('最小年龄不能大于或等于最大年龄')
+          return;
+        }
+        if(parseFloat(this.dataPub.minNormalVal) >= parseFloat(this.dataPub.maxNormalVal)) {
+          this.warning('最小正常值不能大于或等于最大正常值')
+          return;
+        }
+        const {isEdit,data} = this.$route.params;
+        let param = {
+          "questionWrapper": {
+            "controlType": this.dataPub.region2,                            //控件类型(0:默认值 1:下拉单选 2:下拉多选 6:文本框 7:数字键盘文本框 99:联合推送)
+            "id": isEdit?data.id:'',                                    //新增id置空
+            "type": this.dataPub.region1,                //填写单归属
+            "tagType": 1,             //填写单类型
+            "tagName": this.dataPub.region3,             //系统名称
+            "name": this.dataPub.region4,                //界面名称
+            "joint": this.dataPub.region5,               //标签间的连接符
+            // "subType": this.dataPub.region6,   	         //0:可以,1:不可以(当项目检索)  //这个字段暂时不用
+            "sexType": this.dataPub.region7,             //1:男,2:女,3:通用
+            "ageBegin": this.dataPub.region8,       		 //最小年龄
+            "ageEnd": this.dataPub.region9,              //最大年龄
+            "textGenerate": this.form.currentOrder,      //成文顺序 默认0
+            "copyType": this.dataPub.region2 == 6 ? this.dataPub.region10 : (this.dataPub.region2 == 3 ? this.dataPub.region11 : ''),                               //是否复制
+            "showAdd": 0,                                //是否显示加号血压
+            "itemType" :this.dataPub.region12,
+            "showInfo": 0,
+            "labelPrefix":this.dataPub.prefix,                                 //前缀
+            "labelSuffix":this.dataPub.suffix,                                 //后缀
+            "minValue": this.dataPub.minNormalVal,        //化验最小正常值
+            "maxValue": this.dataPub.maxNormalVal,         //化验最大正常值
+            "questionDetails": this.options,
+            "questionMappings": [],      //映射关系,
+            "formulaCode": isEdit?data.formulaCode : ''
+          }
+        };
+        this.showSaveDialog(param);
+      },
+      showSaveDialog(param) {
+        this.showConfirmDialog('是否保存该填写单?', () => {
+          api.saveOrUpdate(param).then((res) => {
+            if (res.data.code === '0') {
+              this.warning(res.data.msg || '保存成功', 'success');
+              this.$router.push("/admin/LT-YXSJWH-DLLXBQWH");
+            } else {
+              this.warning(res.data.msg)
+            }
+          }).catch((err) => {
+            this.warning(err);
+          })
+        });
+      },
+      showConfirmDialog(msg, resolve) {
+        this.$alert(msg, '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          resolve();
+        }).catch(() => {});
+      },
+      warning(msg, type) {
+        this.$message({
+          showClose: true,
+          message: msg,
+          type: type || 'warning'
+        })
+      },
+    },
+    components: {
+      PubIndeptQa,
+      PubSelect
+    }
+  }
+</script>
+<style lang="less">
+    @import "../../less/common.less";
+    .NoiseTemplateWrapper {
+    .groupTitle {
+        background-color: #fff;
+        height: 40px;
+        line-height: 40px;
+        padding-left: 20px;
+    }
+    .main {
+        background-color: #fff;
+        margin: 0 20px 20px;
+        padding: 20px;
+        border-top: 1px solid @icssBorder;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #606266;
+    .title {
+        margin-bottom: 20px;
+    i {
+        color: #f56c6c;
+    }
+    }
+    }
+    .btn {
+        text-align: right;
+    }
+    .order {
+        margin-bottom: 20px;
+    .el-input__inner {
+        line-height: 30px;
+        height: 30px;
+    }
+    }
+    }
+    .toast-cancel{
+        color: #22ccc8 !important;
+    // background: #22ccc8;
+    }
+</style>
+

+ 0 - 0
src/components/preTreat/CombinQuestion.vue


+ 562 - 0
src/components/preTreat/PubIndeptQa.vue

@@ -0,0 +1,562 @@
+<template>
+    <div class="PubTagGroupWrapper"
+         @click="closeNameLis(1)"
+    >
+        <el-form
+                class="groups"
+                :rules="rules"
+                ref="groups"
+                :model="form"
+                label-width="150px"
+        >
+            <el-form-item
+                    label="选择归属:"
+                    prop="region1"
+            >
+                <span class="changeTips">改变归属后,填写单明细将会恢复到默认状态</span>
+                <el-select
+                        v-model="form.region1"
+                        placeholder="请选择归属"
+                        :disabled="!!editData.id"
+                        @change="(e)=>readyChangeSelect(e,1)"
+                >
+                    <el-option
+                            v-for="item in Adscriptions"
+                            :label="item.name"
+                            :value="item.val"
+                            :key="item.id"
+                    ></el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item
+                    label="选择类型:"
+                    prop="region2"
+            >
+                <span class="changeTips">改变类型后,填写单明细将会恢复到默认状态</span>
+                <el-select
+                        v-model="form.region2"
+                        placeholder="请选择类型"
+                        :disabled="!!editData.id  || !form.region1"
+                        @change="(e)=>readyChangeSelect(e,2)"
+                >
+                    <el-option
+                            v-for="item in labelTypes"
+                            :label="item.name"
+                            :value="item.val"
+                            :key="item.id"
+                    ></el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item
+                    :label="'是否为主要内容'"
+                    prop="region5"
+            >
+                <el-select
+                        v-model="form.region12"
+                        @change="sendData"
+                >
+                    <el-option
+                            label="是"
+                            value="0"
+                    ></el-option>
+                    <el-option
+                            label="不是"
+                            value="1"
+                    ></el-option>
+                </el-select>
+            </el-form-item>
+
+            <el-form-item
+                    label="填写单系统名称:"
+                    prop="region3"
+            >
+                <div @click.stop style="display:inline-block;">
+                    <el-input
+                            v-model="form.region3"
+                            :disabled="!form.region1"
+                            maxLength="30"
+                            placeholder="请输入填写单系统名称"
+                            @change="sendData"
+                            @focus="focusSystemName"
+                    ></el-input>
+                    <ul
+                            class="systemNames"
+                            v-if="systemNameShow"
+                    >
+                        <li
+                                v-for="item in systemNameLis"
+                                class="ellipsis"
+                                :key="item.conceptId"
+                                @click="pushSystemName(item.name)"
+                        >{{item.name}}</li>
+                    </ul>
+                </div>
+                <span
+                        class="changeTips changeTipsName"
+                >当为症状时,填写单系统名称需要与医学标准术语内容相对应,如果没有可以先在医学标准术语中建立相关信息!未建立相关信息可能会影响系统使用!</span>
+            </el-form-item>
+            <el-form-item
+                    label="填写单医生界面展示标准内容:"
+                    prop="region4"
+            >
+                <el-input
+                        :disabled="!form.region1"
+                        v-model="form.region4"
+                        maxLength="30"
+                        placeholder="请输入填写单医生界面展示标准内容"
+                        @change="sendData"
+                ></el-input>
+            </el-form-item>
+            <el-form-item
+                    label="填写单患者界面展示通俗内容:"
+                    prop="region4"
+            >
+                <el-input
+                        :disabled="!form.region1"
+                        v-model="form.region4"
+                        maxLength="30"
+                        placeholder="请输入填写单患者界面展示通俗内容"
+                        @change="sendData"
+                ></el-input>
+            </el-form-item>
+            <el-form-item
+                    label="性别:"
+                    prop="region7"
+            >
+                <span class="changeTips">改变性别后,填写单明细将会恢复到默认状态</span>
+                <el-select
+                        v-model="form.region7"
+                        :disabled="!!editData.id || !form.region1 || form.region2 == '99'"
+                        @change="(e)=>readyChangeSelect(e,3)"
+                >
+                    <el-option
+                            label="通用"
+                            value="3"
+                    ></el-option>
+                    <el-option
+                            label="男"
+                            value="1"
+                    ></el-option>
+                    <el-option
+                            label="女"
+                            value="2"
+                    ></el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item
+                    label="年龄:"
+                    prop="region8"
+                    class="ages"
+            >
+                <el-input
+                        v-model.number="form.region8"
+                        :disabled="!form.region1 || form.region2 == '99'"
+                        type="number"
+                        ref="valage1"
+                        @input="sendData"
+                ></el-input>
+            </el-form-item> ~
+            <el-form-item
+                    prop="region9"
+                    class="ages maxAges"
+            >
+                <el-input
+                        v-model.number="form.region9"
+                        :disabled="!form.region1 || form.region2 == '99'"
+                        type="number"
+                        ref="valage2"
+                        @input="sendData"
+                ></el-input>
+            </el-form-item>
+            <el-form-item
+                    label="填写单图片内容:"
+                    prop="region4"
+            >
+                <el-upload
+                        class="upload-imgs"
+                        :limit="1"
+                        :action="uploadUrl"
+                        list-type="picture"
+                        :on-remove="handleRemove"
+                        :before-remove="beforeRemove"
+                        :on-success="handleSuccess"
+                        accept="image/*"
+                        name="upfile">
+                    <el-button size="small" type="primary">上传图片</el-button>
+                </el-upload>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+  import api from '@api/preTreat.js';
+  import utils from '@api/utils.js';
+  import config from '@api/config.js';
+
+  /**
+   * titlePar 顶部显示左(有默认值可不填)
+   * titleSub  顶部显示右(有默认值可不填)
+   * form 当前页面传到父组件的数据(region10,region11暂时不用)
+   * submitForm 基本信息验证必填项
+   * validatePass 基本信息必填项验证成功回调
+   * 父组件根据form.region2改变底部组件操作项
+   * searchTagList 函数的参数根据type变化
+   */
+
+  // 归属和填写单类型限制:
+
+// 症状情况(val:1):单选(val:1)、多选(val:2)、多列填写(val:3)、输入框(val:6)、数字输入框(val:7)、文本域(val:5)
+
+// 诊疗情况(val:51):单选(val:1)、多选(val:2)、多列填写(val:3)、输入框(val:6)、数字输入框(val:7)、文本域(val:5)、上传图片(val:4)
+
+// 其他史(val:3):单选(val:1)、多选(val:2)、多列填写(val:3)、输入框(val:6)、数字输入框(val:7)、文本域(val:5)
+
+// 补充内容(val:52):单选(val:1)、多选(val:2)、多列填写(val:3)、输入框(val:6)、数字输入框(val:7)、文本域(val:5)
+
+  export default {
+    props:['editData'],
+    data() {
+      var validatePass1 = (rule, value, callback) => {
+        this.validateSystomName(value,callback,1)
+      };
+      var validatePass2 = (rule, value, callback) => {
+        const editData = this.$props.editData;
+        if(editData.id && value == editData.tagName){ //修改系统名称没变就不再校验
+          callback();
+        }else{
+          this.validateSystomName(value,callback,2)
+        }
+      };
+      return {
+        form: {
+          region1: '',    //归属
+          region2: '',     //填写单类型
+          region3: '',      //系统名称
+          region4: '',      //医生界面名称
+          region5: '',      //选项之间的链接
+          region6: '0',      //是否可以检索
+          region7: '3',       //性别
+          region8: '0',          //最小年龄
+          region9: '200',         //最大年龄
+          minNormalVal: '',       //化验正常值最小值
+          maxNormalVal: '',       //化验正常值最大值
+          region12: '1',        //是否为查体推送
+          region13:'',
+          prefix:'',            //前缀
+          suffix:'',            //后缀
+          isNeedSearch: false, //是否需要查询(系统名称)
+        },
+        imgName:'',
+        imgUrl:'',
+        uploadUrl:config.urls.uploadImg,
+        labelTypesMaps: {       // 归属和填写单类型限制
+          '1':['1','2','3','5', '6','7'], //症状情况
+          '51':['1','2','3','4','5', '6','7'],    //诊疗情况
+          '3':['1','2','3','5', '6','7'],         //其他史
+          '52':['1','2','3','5', '6','7']            //补充内容
+        },
+        rules: {
+          region1: [
+            { required: true, message: '请选择归属', trigger: 'change' }
+          ],
+          region2: [
+            { required: true, message: '请选择填写单类型', trigger: 'change' }
+          ],
+          region3: [
+            { required: true, message: '请输入填写单系统名称', trigger: 'change' },
+            { validator: validatePass2, trigger: 'blur' },
+          ],
+          region4: [
+            { required: true, message: '请输入填写单界面名称', trigger: 'change' },
+            { validator: validatePass1, trigger: 'blur' },
+          ],
+          region6: [
+            { required: true, message: '请输入能否当项目检索', trigger: 'change' }
+          ],
+          region7: [
+            { required: true, message: '请选择性别', trigger: 'change' }
+          ],
+          region8: [
+            { required: true, message: '请输入最小年龄', trigger: 'change' }
+          ],
+          region9: [
+            { required: true, message: '请输入最大年龄', trigger: 'change' }
+          ],
+          region12: [
+            { required: true, message: '请选择是否为查体', trigger: 'change' }
+          ],
+        },
+        tmpSex: '通用',
+        tmpOwn: '',
+        tmpType: '',
+        Adscriptions: [],
+        labelTypes: [],
+        labelTypesList: [],
+        systemNameShow: false,//系统名称列表显示
+        type:'',
+        systom:null,      //填写单系统名称存在与否
+      }
+    },
+    computed: {
+      newSex() {
+        return this.form.region7;
+      },
+      newType() {
+        return this.form.region1;
+      },
+      newSign() {
+        return this.form.region2;
+      },
+      newName() {
+        return this.form.region3;
+      },
+    },
+    mounted() {
+      this.getDropList();
+      //编辑时赋值
+      const editData = this.$props.editData;
+      if(editData.id){
+        const trans = utils.transformKeys(editData);
+        this.form = Object.assign({},this.form,trans);
+      }
+
+      this.$emit('submitForm', 'groups', false);
+
+      this.$emit('changeVal', this.form, false);
+
+    },
+    watch: {
+      newSex(nextVal, prevVal) {
+        this.tmpSex = prevVal;
+      },
+      newName(nextVal, prevVal) {
+        if (this.isNeedSearch && nextVal != prevVal && (this.form.region12 == 0)) {
+          this.focusSystemName()
+        }
+      },
+    },
+    methods: {
+      handleRemove(){
+
+      },
+      beforeRemove(){
+
+      },
+      handleSuccess(response, file, fileList){
+        if(response.state==='SUCCESS'){
+          this.imgName = response.title;
+          this.imgUrl = response.url;
+        }else{
+          this.warning(response.msg);
+        }
+
+      },
+      getDropList() {
+        return api.getPreTypeList().then((res) => {
+          if (res.data.code === '0') {
+            this.Adscriptions = res.data.data[1];
+            this.labelTypesList = res.data.data[2];
+            this.labelTypes = this.labelTypesList.filter(item => Object.keys(this.labelTypesMaps).indexOf(item.val) > -1)
+          }
+        })
+      },
+      validateSystomName(name,callback,flg) {
+        if(flg == 1){
+          let tmpVal = this.form.region4;
+          if(tmpVal.trim() == ''){
+            callback(new Error('填写单界面名称不能为空'));
+          }else{
+            this.form.region4 = tmpVal.trim()
+            callback();
+          }
+        }else if(flg == 2){
+          let tmpVal = this.form.region3
+          if(tmpVal.trim() == ''){
+            callback(new Error('填写单系统名称不能为空'));
+          }else{
+            this.form.region3 = tmpVal.trim()
+            callback();
+          }
+        }
+      },
+      sendData() {
+        this.$emit('changeVal', this.form, false)
+      },
+      changeType(type){
+        this.$emit('changeVal', this.form, false);
+        this.$emit('changeType', type, false)
+      },
+      changeSex(data) {   //改变性别清空数据
+        this.$emit('changeVal', this.form, false);
+        this.$emit('changeSex', data, false);
+      },
+      readyChangeSelect(tmpData,type) {
+        if(type === 1) {
+          this.form.region2 = '';
+          this.labelTypes = this.labelTypesList.filter(item => this.labelTypesMaps[tmpData].indexOf(item.val) > -1)
+          this.initForm()
+        }
+        if(type === 2) {
+          this.initForm()
+          this.$emit('changeType', type, false)
+        }
+        //console.log(tmpData)
+        this.changeSex(tmpData);
+      },
+      submitForm(formName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            this.$emit('validatePass', this.form, false)
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+      },
+      focusSystemName() {
+        this.isNeedSearch = true
+        if (this.form.region3.trim() == '') {
+          this.systemNameShow = false
+          this.systemNameLis = []
+          return
+        }
+        if (this.form.region12 == 0) {
+          let tmpArr = [];
+          if (this.form.region1 == 1 && this.form.region2 == 4) {//症状
+            tmpArr = [1]
+          } else if (this.form.region1 == 4) {//查体
+            tmpArr = [33]
+          } else if (this.form.region1 == 5) {//化验
+            tmpArr = [12]
+          }
+          let params = {
+            "libType": tmpArr,
+            "name": this.form.region3
+          }
+          api.indexByLexicon(params).then((res) => {
+            if (res.data.code === '0') {
+              this.systemNameLis = res.data.data
+              if (res.data.data.length > 0) {
+                this.systemNameShow = true
+              } else {
+                this.systemNameShow = false
+              }
+            }
+          })
+        }
+      },
+      pushSystemName(val) {
+        this.form.region3 = val
+        this.systemNameShow = false
+        this.isNeedSearch = false
+      },
+      closeNameLis(flg) {
+        if (flg == 1) {
+          this.systemNameShow = false
+        } else if (flg == 2) {
+          if (this.systemNameLis.length > 0) {
+            this.systemNameShow = true
+          } else {
+            this.systemNameShow = false
+          }
+        }
+      },
+      warning(msg, type) {
+        this.$message({
+          showClose: true,
+          message: msg,
+          type: type || 'warning'
+        })
+      },
+      initForm() {
+        this.form.prefix = ''
+        this.form.suffix = ''
+        this.form.minNormalVal = ''
+        this.form.maxNormalVal = ''
+        this.form.region5 = ''
+        this.form.region12 = '1'
+      },
+    }
+  }
+</script>
+<style lang="less">
+    .normalVal .el-input{
+        width: auto;
+        display: inline-block;
+    .el-input__inner {
+        width: 40px;
+        padding: 0 5px;
+    }
+    }
+    .PubTagGroupWrapper .fix-inp .el-col .el-input__inner{
+        width: 100%;
+        display: inline-block;
+    }
+    .PubTagGroupWrapper .fix-inp .el-col-4{
+        text-align: center;
+    }
+    .PubTagGroupWrapper .fix-inp .el-col-8{
+        text-align: center;
+    }
+
+    .groups {
+        background-color: #fff;
+        padding: 20px;
+        margin: 20px 20px -20px 20px;
+    .el-form-item__content,
+    .el-input__inner {
+        height: 30px;
+        line-height: 30px;
+        width: 200px;
+    }
+    .el-form-item {
+        margin-bottom: 20px;
+    }
+    .el-form-item__error {
+        width: 200px;
+        top: 28px;
+    }
+    .el-form-item__label {
+        line-height: 30px;
+        text-align: left;
+    }
+    .el-input__icon {
+        line-height: 30px;
+    }
+    .ages .el-input {
+        display: inline-block;
+        width: auto;
+    .el-input__inner {
+        width: 40px;
+        padding: 0 5px;
+    }
+
+    .el-input__inner::-webkit-outer-spin-button,
+    .el-input__inner::-webkit-inner-spin-button {
+        -webkit-appearance: none;
+    }
+
+    .el-input__inner[type="number"] {
+        -moz-appearance: textfield;
+    }
+    }
+    .el-message-box__btns .el-button--default {
+        color: #606266 !important;
+    }
+    .cancelColor {
+        color: #22ccc8 !important;
+    }
+    .changeTips {
+        position: absolute;
+        left: 220px;
+    // min-width: 300px;
+        width: 200%;
+        color: #ea7777;
+        font-size: 12px;
+    }
+    }
+    .el-upload-list{
+        float: left;
+    }
+</style>
+

+ 229 - 0
src/components/preTreat/PubSelect.vue

@@ -0,0 +1,229 @@
+<template>
+    <div class="single-container">
+        <el-form>
+            <div class="operation-row">
+                <el-checkbox-group size="small" v-for="(it,i) in rows" v-if="type!=2&&(focusOn==i||(focusOn==-1&&i==0))" :key="1+i" v-model="rows[i].defaultSelect" @change="emitValues(i,'hasDefault',rows[i].defaultSelect)">
+                    <el-checkbox-button  v-if=" !(ascription == 5 && type == 1 || type == 2 || type == 11) " :label="i" :disabled="hasNone==i||hasBan==i|| hasError==i || (hasDefault!=-1&&hasDefault!=i)||focusOn==-1">默认选中</el-checkbox-button>
+                </el-checkbox-group>
+                <el-checkbox-group size="small" v-for="(it,i) in rows" v-if="type!=1&&(focusOn==i||(focusOn==-1&&i==0))" :key="2+i" v-model="rows[i].isNone" @change="emitValues(i,'hasNone',rows[i].isNone)">
+                    <el-checkbox-button  v-if=" !(ascription == 5 && type == 1 || type == 11)" :label="i" :disabled="rows[i].isBan || hasError==i ||focusOn==-1">同“无”类型</el-checkbox-button>
+                </el-checkbox-group>
+                <el-checkbox-group size="small" v-for="(it,i) in rows" v-if="type!=1&&(focusOn==i||(focusOn==-1&&i==0))" :key="3+i" v-model="rows[i].isBan" @change="emitValues(i,'hasBan',rows[i].isBan)">
+                    <el-checkbox-button v-if=" !(ascription == 5 && type == 1 || type == 11)" :label="i" :disabled="rows[i].isNone || hasError==i||focusOn==-1">同“伴”类型</el-checkbox-button>
+                </el-checkbox-group>
+                <el-checkbox-group size="small" v-for="(it,i) in rows" v-if="focusOn==i||(focusOn==-1&&i==0)" :key="4+i" v-model="rows[i].isError" @change="emitValues(i,'hasError',rows[i].isError)">
+                    <el-checkbox-button v-if="ascription==5 && (type == 1 || type != 11)" :label="i" :disabled="hasDefault==i||hasBan==i ||hasNone==i ||focusOn==-1">标记异常选项</el-checkbox-button>
+                </el-checkbox-group>
+                <span v-if="type == 11" class="tip">可输入中文全角括号"()", 当作可输入内容的占位符</span>
+                <el-button type="danger" size="small" class="del" @click="delRow">删除</el-button>
+
+            </div>
+            <div class="main-area">
+                <el-col v-for="(it,i) in rows" :key="i">
+                    <el-input v-model="rows[i].name"
+                              v-bind:class="{select:focusOn==i}"
+                              @focus="selectRow(i)"
+                              ref = "inputName"
+                              @input="HandleInputName(i, rows[i].name)"
+                              @blur="emitValues"></el-input>
+                    <el-tag type="info" size="mini" v-if="showTag(it)">{{showTag(it)}}</el-tag>
+                </el-col>
+                <el-button @click="addRow">+</el-button>
+            </div>
+        </el-form>
+    </div>
+</template>
+<style lang="less">
+    @import "../../less/common.less";
+    .el-checkbox-button--small .el-checkbox-button__inner{
+        font-size: 14px;
+    }
+    .el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{
+        border-color: @disableColor;
+        border-left-color: @disableColor;
+        color: @disableColor;
+    }
+    .el-checkbox-button:last-child .el-checkbox-button__inner{
+        border-radius: 3px;
+        border-color: @adminBase;
+        color: @adminBase;
+        margin-right: 15px;
+    }
+    .el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{
+        background-color:@adminBase;
+        border-left-color:@adminBase;
+        color:#fff;
+    }
+    .el-checkbox-group{
+        display: inline-block;
+    }
+    .operation-row{
+        margin-left:150px;
+    .del{
+        margin-left: 150px;
+    }
+    .tip {
+        color: #22ccc8;
+    }
+    }
+    .main-area{
+        width: 290px;
+        margin:20px 150px;
+    .el-tag{
+        margin-left: 10px;
+    }
+    .el-col .el-input {
+        width: 200px;
+        display: inline-block;
+    &.select{
+    input{
+        border-color: @adminBase;
+    }
+    }
+    }
+
+    .el-button{
+        width: 200px;
+    }
+    }
+</style>
+<script>
+  import utils from '@api/utils.js';
+  import Vue from 'vue';
+  export default {
+    props:['type','options','ascription','sexType'],
+    data(){
+      return {
+        maps:{isBan:'同“伴”',isNone:'同“无”',defaultSelect:'默认选中',isError:'异常选项'},
+        rows:[{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''}],
+        focusOn:-1
+      }
+    },
+    mounted(){
+      const {options} = this.$props;
+      if(options){
+        const arr = options.map((it)=>{
+          return {name:it.name,defaultSelect:it.defaultSelect=='1'?true:false,isBan:it.code==1?true:'',isNone:it.code==2?true:'',isError:it.abnormal==1?true:''};
+        });
+        const arrLen = arr.length;
+        if(arrLen < 4) {
+          for (let i = 0; i < 4 - arrLen; i++) {
+            arr.push({name:'',defaultSelect:'',isBan:'',isNone:'',isError:''})
+          }
+        }
+        this.rows = arr;
+        const items = utils.simpleOptionData(this.rows);
+        this.$emit('pushValues',items);
+      }
+    },
+    computed:{
+      showTag:function(){
+        return function(it){
+          let name = Object.keys(this.maps).find((item)=>{
+            return it[item];
+          });
+          return this.maps[name];
+        }
+      },
+      hasDefault:function(){               //是否有选项默认选中
+        let index =this.rows.findIndex((it)=>{
+          return it.defaultSelect;
+        });
+        return index;
+      },
+      hasNone:function(){                 //是否有选项同无
+        let index =this.rows.findIndex((it)=>{
+          return it.isNone;
+        });
+        return index;
+      },
+      hasBan:function(){                  //是否有选项同伴
+        let index =this.rows.findIndex((it)=>{
+          return it.isBan;
+        });
+        return index;
+      },
+      hasError:function(){        //是否为正确选项
+        let index =this.rows.findIndex((it)=>{
+          return it.isError;
+        });
+        return index;
+      }
+    },
+    watch: {
+      ascription(newVal, preVal) {
+        if (newVal != preVal) {
+          if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+            this.rows = [{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''}];
+          }
+        }
+      },
+      type(newVal, preVal) {
+        if (newVal != preVal) {
+          if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+            this.rows = [{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''}];
+          }
+        }
+      },
+      sexType(newVal, preVal) {
+        if (newVal != preVal) {
+          if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+            this.rows = [{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isError:''}];
+          }
+        }
+      },
+    },
+    methods:{
+      addRow(){
+        this.rows.push({name:'',defaultSelect:'',isBan:'',isNone:'',isError:''});
+      },
+      selectRow(index){
+        this.focusOn = index;
+
+      },
+      emitValues(i,type,flag){
+        if(typeof i =='number'&&this.focusOn == -1){
+          this.$message({
+            message: '请先选择要操作的行',
+            type: 'warning',
+            showClose: true,
+          });
+          return;
+        }
+        const items = utils.simpleOptionData(this.rows);
+        this.$emit('pushValues',items);
+      },
+      HandleInputName(i, name) {
+        if(name.length > 30) {
+          Vue.set(this.rows[i], 'name', this.rows[i].name.slice(0, 30))
+          this.$refs.inputName[i].currentValue = this.rows[i].name
+          this.$message({
+            message: '最多输入30个字',
+            type: 'warning',
+            showClose: true,
+          });
+          return
+        }
+
+      },
+      delRow(){
+        if(this.focusOn==-1){
+          this.$message({
+            message: '请先选择要删除的行',
+            type: 'warning',
+            showClose: true,
+          });
+          return;
+        }
+        this.$alert('确定要删除该行吗?', '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          this.rows.splice(this.focusOn,1);
+          this.focusOn = -1;
+          this.emitValues();
+        }).catch(() => {});
+      }
+    }
+  }
+</script>

+ 0 - 0
src/components/preTreat/QuestionGroup.vue


+ 241 - 0
src/components/preTreat/SimpleQuestion.vue

@@ -0,0 +1,241 @@
+<template>
+    <div class="NoiseTemplateWrapper TemplateWrapper">
+        <crumbs
+                :title="txt"
+                class="topBack"
+                linkTo="/admin/LT-YWZSJWH-DLTXDWH"
+        ></crumbs>
+        <PubIndeptQa
+                @changeVal="changeVal"
+                @changeSex="changeSex"
+                @changeType="changeType"
+                @validatePass="validatePass"
+                :editData="editData"
+                ref="submitForm"
+        ></PubIndeptQa>
+        <div class="main">
+            <p class="title" v-if="dataPub.region2==1||dataPub.region2==2|| dataPub.region2==11">
+                <i>*</i> 填写单明细:
+                <i v-if='dataPub.region2==2' style="margin-left:70px;color: #22ccc8; font-size: 12px;">所有选项必须都有或者都没有同“伴”/“无”标记</i>
+            </p>
+            <PubSelect v-if="dataPub.region2==1 || dataPub.region2==2 || dataPub.region2==11" :ascription="dataPub.region1" :sexType="dataPub.region7" :type="dataPub.region2" @pushValues="pushValues" :options="editData.questionDetailList"></PubSelect>
+            <div class="btn">
+                <el-button
+                        type="primary"
+                        @click="submitForm"
+                >确 定</el-button>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+  /**
+   * dataPub.region2  判断底部显示哪些
+   */
+  import PubIndeptQa from './PubIndeptQa';
+  import PubSelect from './PubSelect';
+  import api from '@api/icss.js';
+  import utils from '@api/utils.js';
+
+  export default {
+    name: 'addSimpleQuestion',
+    data() {
+      return {
+        txt:'独立填写单维护-添加独立填写单',
+        dataPub: {},      //公用组件传的值都在这
+        itemsTypes:[1,2],            //有明细的类型
+        editData:{},                    //编辑数据
+        form: {
+          currentOrder: '0',     //标签成文顺序
+        },
+        rules: {
+          currentOrder: [
+            { required: true, message: '选择标签成文顺序', trigger: 'change' }
+          ]
+        },
+        options: [],           //标签明细右侧操作数据
+      }
+    },
+    beforeMount:function(){
+      const {isEdit,data} = this.$route.params;
+      if(isEdit){
+        this.txt = '独立填写单维护-修改独立填写单'
+        this.editData = data;
+      }
+    },
+    computed: {
+      newSign() {
+        return this.dataPub.region2;
+      },
+    },
+    watch: {
+      newSign(nextVal, prevVal) {
+        if (nextVal != prevVal) {
+          this.form.currentOrder = '0'
+        }
+      },
+    },
+    methods: {
+      back() { this.$router.go(-1) },
+      changeVal(val) {    //子组件数据改变传递到父组件
+        this.dataPub = val
+        console.log('公用组件传的值都在这', val)
+      },
+      changeSex(sex) {       //性别改变,清空填写单明细
+        //console.log(sex)
+      },
+      changeType(type) {        //填写单类型改变,标签明细左侧更新,右侧清空
+        // console.log('type',type)
+        this.options = [];
+      },
+      pushValues(its){
+        this.options = its;
+      },
+      submitForm() {      // 调用子组件的方法验证公用部分
+        this.$refs.submitForm.submitForm('groups');
+      },
+      validatePass() {      //验证成功回调,调取接口
+        //仍需验证填写单明细是否选择
+        let isNull = true
+        let options2 = []
+        const opts = this.options;
+        for (let i = 0; i < this.options.length; i++) {
+          if(this.options[i].name.trim() != '') {
+            isNull = false
+            options2.push(this.options[i])
+          }
+        }
+        this.options = options2;
+        if(this.itemsTypes.includes(+this.dataPub.region2)&&isNull) {
+          this.warning('至少填一个选项')
+          return;
+        }
+        let flag=true;
+        if(opts[0] && opts[0].code){
+          flag=opts.findIndex((it)=>{
+            return !it.code;
+          })==-1;
+        }else{
+          flag=opts.findIndex((it)=>{
+            return it.code;
+          })==-1;
+        }
+        if(!flag){
+          this.warning('所有选项必须都有或者都没有同“伴”/“无”标记')
+          return;
+        }
+        if(parseFloat(this.dataPub.region8) >= parseFloat(this.dataPub.region9)) {
+          this.warning('最小年龄不能大于或等于最大年龄')
+          return;
+        }
+        if(parseFloat(this.dataPub.minNormalVal) >= parseFloat(this.dataPub.maxNormalVal)) {
+          this.warning('最小正常值不能大于或等于最大正常值')
+          return;
+        }
+        const {isEdit,data} = this.$route.params;
+        let param = {
+          "questionWrapper": {
+            "controlType": this.dataPub.region2,                            //控件类型(0:默认值 1:下拉单选 2:下拉多选 6:文本框 7:数字键盘文本框 99:联合推送)
+            "id": isEdit?data.id:'',                                    //新增id置空
+            "type": this.dataPub.region1,                //填写单归属
+            "tagType": 1,             //填写单类型
+            "tagName": this.dataPub.region3,             //系统名称
+            "name": this.dataPub.region4,                //界面名称
+            "joint": this.dataPub.region5,               //标签间的连接符
+            // "subType": this.dataPub.region6,   	         //0:可以,1:不可以(当项目检索)  //这个字段暂时不用
+            "sexType": this.dataPub.region7,             //1:男,2:女,3:通用
+            "ageBegin": this.dataPub.region8,       		 //最小年龄
+            "ageEnd": this.dataPub.region9,              //最大年龄
+            "textGenerate": this.form.currentOrder,      //成文顺序 默认0
+            "copyType": this.dataPub.region2 == 6 ? this.dataPub.region10 : (this.dataPub.region2 == 3 ? this.dataPub.region11 : ''),                               //是否复制
+            "showAdd": 0,                                //是否显示加号血压
+            "itemType" :this.dataPub.region12,
+            "showInfo": 0,
+            "labelPrefix":this.dataPub.prefix,                                 //前缀
+            "labelSuffix":this.dataPub.suffix,                                 //后缀
+            "minValue": this.dataPub.minNormalVal,        //化验最小正常值
+            "maxValue": this.dataPub.maxNormalVal,         //化验最大正常值
+            "questionDetails": this.options,
+            "questionMappings": [],      //映射关系,
+            "formulaCode": isEdit?data.formulaCode : ''
+          }
+        };
+        this.showSaveDialog(param);
+      },
+      showSaveDialog(param) {
+        this.showConfirmDialog('是否保存该填写单?', () => {
+          api.saveOrUpdate(param).then((res) => {
+            if (res.data.code === '0') {
+              this.warning(res.data.msg || '保存成功', 'success');
+              this.$router.push("/admin/LT-YXSJWH-DLLXBQWH");
+            } else {
+              this.warning(res.data.msg)
+            }
+          }).catch((err) => {
+            this.warning(err);
+          })
+        });
+      },
+      showConfirmDialog(msg, resolve) {
+        this.$alert(msg, '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          resolve();
+        }).catch(() => {});
+      },
+      warning(msg, type) {
+        this.$message({
+          showClose: true,
+          message: msg,
+          type: type || 'warning'
+        })
+      },
+    },
+    components: {
+      PubIndeptQa,
+      PubSelect
+    }
+  }
+</script>
+<style lang="less">
+    @import "../../less/common.less";
+    .NoiseTemplateWrapper {
+    .groupTitle {
+        background-color: #fff;
+        height: 40px;
+        line-height: 40px;
+        padding-left: 20px;
+    }
+    .main {
+        background-color: #fff;
+        margin: 0 20px 20px;
+        padding: 20px;
+        border-top: 1px solid @icssBorder;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #606266;
+    .title {
+        margin-bottom: 20px;
+    i {
+        color: #f56c6c;
+    }
+    }
+    }
+    .btn {
+        text-align: right;
+    }
+    .order {
+        margin-bottom: 20px;
+    .el-input__inner {
+        line-height: 30px;
+        height: 30px;
+    }
+    }
+    }
+    .toast-cancel{
+        color: #22ccc8 !important;
+    // background: #22ccc8;
+    }
+</style>
+

+ 12 - 0
src/routes.js

@@ -85,6 +85,12 @@ import AddConceptRelation from '@components/icss/AddConceptRelation.vue'  //医
 import MedicalMultRelation from '@components/icss/MedicalMultRelation.vue'  //医学术语--医学术语多层关联维护
 import AddMedicalMultRelation from '@components/icss/AddMedicalMultRelation.vue' //医学术语--添加医学术语多层关联维护
 import MedicalType from '@components/icss/MedicalType.vue'//医学术语维护-类型维护
+//预问诊
+import SimpleQuestion from '@components/preTreat/SimpleQuestion.vue';
+import CombinQuestion from '@components/preTreat/CombinQuestion.vue';
+import QuestionGroup from '@components/preTreat/QuestionGroup.vue';
+import AddSimpleQuestion from '@components/preTreat/AddSimpleQuestion.vue';
+
 export default [
   {
     path: '/',
@@ -236,6 +242,12 @@ export default [
 
       {path:'LT-YXSYKWH-YXSYDCGLWH',component:MedicalMultRelation,name:'MedicalMultRelation'},   //医学术语--医学术语多层关联维护
       {path:'LT-YXSYKWH-TJYXSYDCGL',component:AddMedicalMultRelation,name:'AddMedicalMultRelation'},   //医学术语--添加医学术语多层关联
+
+      {path:'LT-YWZSJWH-DLTXDWH',component:SimpleQuestion,name:'SimpleQuestion'},  //预问诊-独立填写单
+      {path:'LT-YWZSJWH-ZHTXDWH',component:CombinQuestion,name:'CombinQuestion'},  //预问诊-组合填写单
+      {path:'LT-YWZSJWH-MBWH',component:QuestionGroup,name:'QuestionGroup'},  //预问诊-模板
+      {path:'LT-YWZSJWH-TJDLTXD',component:AddSimpleQuestion,name:'AddSimpleQuestion'},  //预问诊-添加独立填写单
+
     ]
   }
 ]