ソースを参照

添加诊断依据(未完成)

zhangxc 6 年 前
コミット
4fb61b8b77
1 ファイル変更152 行追加67 行削除
  1. 152 67
      src/components/diagBase/AddDiagBase.vue

+ 152 - 67
src/components/diagBase/AddDiagBase.vue

@@ -1,10 +1,6 @@
 <!-- 添加常见科室症状  -->
 <template>
     <div class="AddDiagBaseWrapper" @click="close">
-        <!-- <div class="groupTitle"><i
-            class="el-icon-back"
-            @click="back"
-        ></i> 量表管理维护--{{titleText}}</div> -->
         <crumbs
           :title="'诊断依据数据维护-'+titleText"
           class="topBack"
@@ -32,58 +28,82 @@
         </el-form>
         <div class="symptomList">
             <p>疾病特征:</p>
-            <table class="indexTab">
+            <table class="diagTable">
                 <tr class="tableTitle">
                     <td class="FeatureSort">排序</td>
-                    <td class="FeatureType">类型</td>
-                    <td class="FeatureNumber">序号</td>
-                    <td class="FeatureStand">标准词</td>
-                    <td class="FeatureELATE">关联词</td>
+                    <td class="FeatureType require">类型</td>
+                    <td class="FeatureNumber require">序号</td>
+                    <td class="FeatureStand require">标准词</td>
+                    <td class="FeatureRelate">关联词</td>
                     <td class="FeatureResult">结果</td>
+                    <td class="FeatureOpera"></td>
                 </tr>
-                <tr v-for="(item, index) in selectedIndexList" :key="item.indexUnique"> 
-                    <td class="FeatureType">{{index +1}}</td>
-                    <td class="FeatureNumber">序号</td>
-                    <td class="FeatureStand">标准词</td>
-                    <td class="FeatureELATE">关联词</td>
-                    <td class="FeatureResult">结果</td>
+                <tr v-for="(item, index) in disFeatureList" :key="item.indexUnique"> 
+                    <td class="FeatureSort">{{index+1}}</td>
+                    <td class="FeatureType">
+                        <el-select size="mini" v-model="item.type" placeholder="标签类型" clearable>
+                            <el-option v-for="item in typeList" :label="item.name" :value="item.val" :key="item.id"></el-option>
+                        </el-select>
+                    </td>
+                    <td class="FeatureNumber"><input class="groupInput" type="text" v-model="item.code" @input="handleInp(index,$event)"></td>
+                    <td class="FeatureStand"><input class="groupInput" type="text" v-model="item.standard" @input="handleInp(index,$event)"></td>
+                    <td class="FeatureRelate"><input class="groupInput" type="text" v-model="item.relation" @input="handleInp(index,$event)"></td>
+                    <td class="FeatureResult"><input class="groupInput" type="text" v-model="item.result" @input="handleInp(index,$event)"></td>
+                    <td class="FeatureOpera">
+                        <el-button type="text" size="small" class="delete" @click="addItem(index, 1)">增加</el-button>
+                        <el-button v-if="index !=0" type="text" size="small" class="delete" @click="delItem(index, 1)">删除</el-button>
+                    </td>
                 </tr>
             </table>
             <p>诊断公式:</p>
-            <table class="indexTab">
+            <table class="diagTable">
                 <tr class="tableTitle">
-                    <td class="FeatureSort">排序</td>
-                    <td class="FeatureType">类型</td>
-                    <td class="FeatureNumber">序号</td>
-                    <td class="FeatureStand">标准词</td>
-                    <td class="FeatureELATE">关联词</td>
-                    <td class="FeatureResult">结果</td>
+                    <td class="FormulaSort">排序</td>
+                    <td class="FormulaType">类型</td>
+                    <td class="FormulaNumber">公式</td>
+                    <td class="FormulaOpera"></td>
                 </tr>
-                <tr v-for="(item, index) in selectedIndexList" :key="item.indexUnique"> 
-                    <td class="FeatureType">{{index +1}}</td>
-                    <td class="FeatureNumber">序号</td>
-                    <td class="FeatureStand">标准词</td>
-                    <td class="FeatureELATE">关联词</td>
-                    <td class="FeatureResult">结果</td>
+                <tr v-for="(item, index) in disFormulaList" :key="item.indexUnique"> 
+                    <td class="FormulaSort">{{index +1}}</td>
+                    <td class="FormulaType">
+                        <el-select size="mini" v-model="item.type" placeholder="标签类型" clearable>
+                            <el-option v-for="item in typeList" :label="item.name" :value="item.val" :key="item.id"></el-option>
+                        </el-select>
+                    </td>
+                    <td class="FormulaNumber"><input class="groupInput" type="text" v-model="item.formula" @input="handleInp(index,$event)"></td>
+                   <td class="FeatureOpera">
+                        <el-button type="text" size="small" class="delete" @click="addItem(index, 2)">增加</el-button>
+                        <el-button v-if="index !=0" type="text" size="small" class="delete" @click="delItem(index, 2)">删除</el-button>
+                    </td>
                     <!-- <td class="selectedContent ">{{item.indexUnique}}</td>
                     <td class="selectedContentGroup"><input class="groupInput" type="text" v-model="item.indexDesc" @input="handleInp(index,$event)"></td>
                     <td class="selectedContentOpera"><el-button type="text" size="small" class="delete" @click="delSelectedIndex(item, index)">删除</el-button></td> -->
                 </tr>
             </table>
-        </div>
-        <div class="btn">
+            <div class="btn clearfix">
+             <el-button
+            type="primary"
+            @click="submitForm()"
+            >校验并保存数据</el-button>
+             <el-button
+            type="primary"
+            @click="exportDiagnosticAll"
+            >导出诊断依据</el-button>
             <el-button
             type="primary"
-            :disabled = 'saveDisable'
-            @click="submitForm('ruleForm')"
-            >确 定</el-button>
+            @click="updateNeo"
+            >更新图谱</el-button>
+        </div>
         </div>
+        
     </div>
     
 </template>
 
 <script>
   import api from '@api/diagBase.js';
+  import utils from '@api/utils.js';
+
   export default {
     name: 'AddChronicAndIndexRelation',
     data() {
@@ -95,8 +115,38 @@
             },
             titleText: '添加关联',
             diagList: [],
-            selectedIndexMap: [],   //已经选择过的指标
-            selectedIndexList: [],  //选择的指标列表
+            typeList: [
+                {
+                    id:'1',
+                    name: '症状',
+                    val: '1'
+                },
+                {
+                    id:'2',
+                    name: '化验',
+                    val: '2'
+                }
+            ],
+            disFeatureList: [
+                {
+                    type:'',
+                    code:'',
+                    standard:'',
+                    relation:'',
+                    result:'',
+                    formula:''
+                }
+            ],  //疾病特征列表
+            disFormulaList:[
+                {
+                    type:'',
+                    code:'',
+                    standard:'',
+                    relation:'',
+                    result:'',
+                    formula:''
+                }
+            ],
             searchDiagVal: '',
             isEdit: false,
             saveDisable: false 
@@ -110,10 +160,6 @@
                 this.titleText = '修改关联';
                 this.form.diseaseId = data.diseaseId
                 this.form.diseaseName = data.diseaseName
-                this.selectedIndexList = data.data
-                for (let i = 0; i < this.selectedIndexList.length; i++) {
-                    this.selectedIndexMap.push(this.selectedIndexList[i].indexUnique)
-                }
             } 
         } else {
             
@@ -162,36 +208,61 @@
             this.$refs['diagList'].style.display='none'
             
         },
-        delSelectedIndex(selectedItem, index) {
-            this.selectedIndexMap = this.selectedIndexMap.filter((item) => {return item != selectedItem.indexUnique})
-            this.selectedIndexList.splice(index, 1)
+        addItem(index, type) {
+            if(type == 1) {
+                const item = {
+                    type:index+1,
+                    code:'',
+                    standard:'',
+                    relation:'',
+                    result:'',
+                }
+                this.disFeatureList.splice(index+1, 0, item)
+            }else if(type == 2) {
+                 const item = {
+                    type:index+1,
+                    code:'',
+                    standard:'',
+                    relation:'',
+                    result:'',
+                }
+                this.disFormulaList.splice(index+1, 0, item)
+            }
+        },
+        delItem(index, type) {
+            if(type == 1) {
+                this.disFeatureList.splice(index, 1)
+            }else if(type == 2) {
+                this.disFormulaList.splice(index, 1)
+            }
         },
-        submitForm(formName) {
+        updateNeo() {
+            // const param = {
+
+            // }
+            // api.diagBaseUpdateNeo(param).then((res) =>{
+
+            // })
+        },
+        exportDiagnosticAll(){
+            // const param = {
+            //     disId: ''
+            // }
+            // api.exportDiagnosticAll(param).then((res) => {
+            //     utils.downloadExportedData(res.data.data,'诊断依据' )
+            // })
+        },
+        submitForm() {
             if(!this.form.diseaseId) {
                 this.warning('请选择诊断')
                 return
             }
-            if(this.selectedIndexList.length === 0) {
-                this.warning('请选择指标')
-                return
-            }
-            for (let i = 0; i < this.selectedIndexList.length; i++) {
-                if(!this.selectedIndexList[i].indexDesc) {
-                    this.warning('请填写内容分组')
-                    return
-                }
-            }
+            
             this.showDelDialog()
         },
         showDelDialog() {
-            this.selectedIndexList.map((item) => {
-                item.diseaseId = this.form.diseaseId
-                return item
-            })
-            const param ={
-                "diseaseId": this.form.diseaseId,
-                "indexConfigData": this.selectedIndexList
-            }
+           
+           
             this.showConfirmDialog('是否建立该关联?', () => {
                 const  url = this.isEdit ?api.updateIndexConfigList(param) : api.saveIndexConfigLists(param) 
                 this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
@@ -232,9 +303,9 @@
         },
         handleInp(index,e){ //分组不能输入负数
             const value =  e.target.value;
-            const item = this.selectedIndexList[index].indexDesc;
+            // const item = this.selectedIndexList[index].indexDesc;
             e.target.value = value.replace(/[^\d]/g,'');
-            this.selectedIndexList[index].indexDesc = item.replace(/[^\d]/g,'');
+            // this.selectedIndexList[index].indexDesc = item.replace(/[^\d]/g,'');
         }
     }
   }
@@ -306,13 +377,14 @@
             position: relative;
         }
         .symptomList {
+            position: relative;
             background-color: #fff;
              padding: 20px;
              margin: 0px 20px 0px 20px;
              min-height: 400px;
         }
         
-        .indexTab {
+        .diagTable {
             width: 100%;
             border-collapse: collapse;
             tr {
@@ -321,6 +393,10 @@
                     border: 1px solid #a9a9a9;
                     text-align: center;
                 }
+                .FormulaOpera, .FeatureOpera{
+                    background: #fff;
+                    border: none
+                }
             }
             .selectedContent {
                 width: 25%;
@@ -339,19 +415,28 @@
             width: 60%;
         }
         .btn {
-            position: relative;
+            position: absolute;
             background-color: #fff;
             margin: 0px 20px;
             height: 40px;
             padding: 20px;
+            float: right;
+            bottom: 0px;
+            right: 0px;
             .el-button {
-                position: absolute;
-                right: 20px;
+                margin-right: 20px;
+                // position: absolute;
+                // right: 20px;
             }
         }
         .tableTitle{
             background: rgba(239,243,249,1);
         }
+        .require::after{
+            content:"*";
+            color: red;
+        }
+        
     }
     
 </style>