Browse Source

。。。

zhangxc 6 năm trước cách đây
mục cha
commit
ce2f203d90
2 tập tin đã thay đổi với 65 bổ sung56 xóa
  1. 48 38
      src/components/diagBase/AddDiagBase.vue
  2. 17 18
      src/components/diagBase/DiagBase.vue

+ 48 - 38
src/components/diagBase/AddDiagBase.vue

@@ -45,10 +45,10 @@
                             <el-option v-for="item in featureTypeList" :label="item.name" :value="item.key" :key="item.key"></el-option>
                         </el-select>
                     </td>
-                    <td class="FeatureNumber"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput" :class="item.codeError ? 'colorRed':''" type="text" v-model.trim="item.code" @input="handleInp(index,$event,'FeatureNumber')"></td>
-                    <td class="FeatureStand"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput" type="text" v-model.trim="item.standard" @input="handleInp(index,$event,'FeatureStand')"></td>
-                    <td class="FeatureRelate"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput" type="text" v-model.trim="item.relation" @input="handleInp(index,$event,'FeatureRelate')"></td>
-                    <td class="FeatureResult"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput" type="text" v-model.trim="item.result" @input="handleInp(index,$event,'FeatureResult')"></td>
+                    <td class="FeatureNumber"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput" :class="{borderRed:item.verifyCode, colorRed: item.codeError}" type="text" v-model.trim="item.code" @input="handleInp(index,$event,'FeatureNumber')"></td>
+                    <td class="FeatureStand"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput"  :class="{borderRed:item.verifyCode}" type="text" v-model.trim="item.standard" @input="handleInp(index,$event,'FeatureStand')"></td>
+                    <td class="FeatureRelate"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput" :class="{borderRed:item.verifyRelation}"  type="text" v-model.trim="item.relation" @input="handleInp(index,$event,'FeatureRelate')"></td>
+                    <td class="FeatureResult"  :class="item.notRequire ? 'borderRed':''"><input class="groupInput" :class="{borderRed:item.verifyResult}"  type="text" v-model.trim="item.result" @input="handleInp(index,$event,'FeatureResult')"></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>
@@ -70,7 +70,7 @@
                             <el-option v-for="item in formulaTypeList" :label="item.name" :value="item.key" :key="item.key"></el-option>
                         </el-select>
                     </td>
-                    <td class="FormulaNumber"><input class="groupInput" type="text" v-model.trim="item.formula" @input="handleInp(index,$event,'FormulaNumber')"></td>
+                    <td class="FormulaNumber"><input class="groupInput" :class="{borderRed:item.verifyFormula}" type="text" v-model.trim="item.formula" @input="handleInp(index,$event,'FormulaNumber')"></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>
@@ -79,21 +79,25 @@
                     <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 class="btn clearfix">
-             <el-button
-            type="primary"
-            @click="submitForm()"
-            >校验并保存数据</el-button>
-             <el-button
-            type="primary"
-            @click="exportDiagnosticAll"
-            >导出诊断依据</el-button>
-            <el-button
-            type="primary"
-            @click="updateNeo"
-            >更新图谱</el-button>
-        </div>
+             <div class="btn clearfix">
+                     <div class="btnBox">
+                         <el-button
+                                type="primary"
+                                @click="submitForm()"
+                                >校验并保存数据</el-button>
+                            <el-button
+                                type="primary"
+                                @click="exportDiagnosticAll"
+                                >导出诊断依据</el-button>
+                            <el-button
+                                type="primary"
+                                @click="updateNeo"
+                                >更新图谱</el-button>
+                     </div>
+                
+                </div>
         </div>
         
     </div>
@@ -110,10 +114,10 @@
     data() {
         return{
             
-            disId: '',  //诊断id
+            id: '',  //诊断id
             disName:'',  //诊断名称
             modifier: '', //操作人
-            titleText: '添加关联',
+            titleText: '添加',
             diagList: [],
             featureTypeList: [],
             formulaTypeList: [],
@@ -150,9 +154,12 @@
         if(isEdit) {
             if(isEdit) {
                 this.isEdit = isEdit;
-                // this.titleText = '修改关联';
-                // this.diseaseId = data.diseaseId
-                // this.diseaseName = data.diseaseName
+                this.titleText = '修改';
+                this.disName = data.disName
+                this.id = data.id
+                this.disFeatureList = data.disFeature
+                this.disFormulaList = data.disformula
+
             } 
         } else {
             
@@ -200,7 +207,6 @@
             })
         },
         selectDiag(item) {
-            this.disId = item.conceptId
             this.disName = item.name
             this.$refs['diagList'].style.display='none'
             this.searchDiagVal = ''
@@ -248,12 +254,11 @@
         },
         exportDiagnosticAll(){
             const param = {
-                diagnoseId: '53'
+                diagnoseId: 53
             }
             this.diagBaseVerifyData().then(() => {
-                console.log('param', param)
                  api.exportDiagnosticAll(param).then((res) => {
-                    utils.downloadExportedData(res.data.data,'诊断依据' )
+                    utils.downloadExportedData(res.data,'诊断依据' )
                 })
             })
            
@@ -273,7 +278,6 @@
                 }
             }
             this.disFeatureList = JSON.parse(JSON.stringify(disFeatureList))
-           console.log('notRequireList', notRequireList)
            if(notRequireList.length >0) {
                return
            }
@@ -302,11 +306,14 @@
                 disFeature: this.disFeatureList,
                 disName: this.disName,
                 disformula: this.disFormulaList,
-                id: '',
+                id: this.id,
                 modifier: this.modifier
             }
             return api.diagBaseVerifyData(param).then((res) => {
-                console.log(res)
+                const data = res.data.data
+                this.id = data.id
+                this.disFeatureList = data.disFeature
+                this.disFormulaList = data.disformula
             })
         },
 
@@ -357,7 +364,8 @@
                 // this.disFeatureList[index].standard = value.replace(/[^\d.]/g,'')
             } else if ( type === 'FormulaNumber') {
                 //计算公式只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十
-                this.disFormulaList[index].formula =  value.replace(/[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u53410-9\/\.+\(\)\(\)]/g,'').replace(/[\(]/g, '(').replace(/[\)]/g, ')')
+                this.disFormulaList[index].formula =  value.replace(/[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u53410-9\/\.+\(\)\(\)]/g,'').replace(/[\(]/g, '(').replace(/[\)]/g, ')').replace(/' '/g, '')
+                console.log(55555,this.disFormulaList[index].formula)
             }
             // const item = this.selectedIndexList[index].indexDesc;
             // e.target.value = value.replace(/[^\d]/g,'');
@@ -438,7 +446,7 @@
             position: relative;
             background-color: #fff;
              padding: 20px;
-             margin: 0px 20px 0px 20px;
+             margin: 0px 20px 40px 20px;
              min-height: 400px;
         }
         
@@ -475,16 +483,18 @@
         .btn {
             position: absolute;
             background-color: #fff;
-            margin: 0px 20px;
+            width: 100%;
+            margin: 20px 0;
             height: 40px;
-            padding: 20px;
-            float: right;
             bottom: 0px;
             right: 0px;
+            .btnBox {
+                position: absolute;
+                right: 0px;
+            }
             .el-button {
                 margin-right: 20px;
-                // position: absolute;
-                // right: 20px;
+               
             }
         }
         .tableTitle{

+ 17 - 18
src/components/diagBase/DiagBase.vue

@@ -191,24 +191,23 @@ export default {
                 const {code,data,msg} = res.data;
                 if(code=='0'){
                     const item = Object.assign({},row,data);
-                  const pam = this.searched ? {
-                    currentPage: this.currentPage,
-                    filter: this.filter
-                  } : {currentPage: this.currentPage};
-                  console.log('data', data)
-                    // if(type == 'modify') {
-                    //   this.$router.push({
-                    //     name: 'AddDiagBase',
-                    //     params: Object.assign(pam, {isEdit: true, data: item})
-                    //   });
-                    // } else if( type == 'copy') {
-                    //   this.$router.push({
-                    //     name: 'AddDiagBase',
-                    //     params: Object.assign(pam, {isCopy: true, data: item})
-                    //   });
-                    // } else {
-                    //     return
-                    // }
+                    const pam = this.searched ? {
+                      currentPage: this.currentPage,
+                      filter: this.filter
+                    } : {currentPage: this.currentPage};
+                    if(type == 'modify') {
+                      this.$router.push({
+                        name: 'AddDiagBase',
+                        params: Object.assign(pam, {isEdit: true, data: item})
+                      });
+                    } else if( type == 'copy') {
+                      this.$router.push({
+                        name: 'AddDiagBase',
+                        params: Object.assign(pam, {isCopy: true, data: item})
+                      });
+                    } else {
+                        return
+                    }
                 }else{
                     this.$message({
                     message: msg,