Преглед на файлове

术语命名维护:新增状态检索;类型改平铺;复制功能;修改页面拼音可修改

liucf преди 6 години
родител
ревизия
5f404dd69c
променени са 2 файла, в които са добавени 103 реда и са изтрити 25 реда
  1. 71 12
      src/components/icss/AddMedicalName.vue
  2. 32 13
      src/components/icss/MedicalName.vue

+ 71 - 12
src/components/icss/AddMedicalName.vue

@@ -25,14 +25,28 @@
               <input type="text" v-model="data.spell" placeholder="请输入拼音" maxlength="50"  @input="handlePinyin">
             </td>
             <td>
-              <el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small" @change="selectType">
+              <!-- <el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small" @change="selectType">
                 <el-option
                   v-for="item in typeList"
                   :key="item.id"
                   :label="item.name"
                   :value="item.name">
                 </el-option>
-              </el-select>
+              </el-select> -->
+              <template v-if="!id">
+                <el-select v-model="data.type" filterable clearable placeholder="请选择" size="small" @change="selectType">
+                  <el-option-group
+                    v-for="group in options"
+                    :key="group.label">
+                    <el-option
+                      v-for="item in group.options"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.name">
+                    </el-option>
+                  </el-option-group>
+                </el-select>
+              </template>
               <span v-else>{{data.type}}</span>
             </td>
             <td class="desc">
@@ -58,14 +72,30 @@
                 <!-- <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small" @input.native="handleInput(2,index)"></el-input> -->
                 <input type="text" v-model="item.name" :title="item.name" placeholder="请输入术语" maxlength="50" @blur="handleBlur(2,index,99)" >
               </td>
-              <td v-if="!item.isEdit">
+              <!-- <td v-if="!item.isEdit">
                 {{item.spell}}
               </td>
-              <td v-else>
+              <td v-else> -->
+              <td>
                 <input type="text" v-model="item.spell" placeholder="请输入拼音" maxlength="50"  @input="handlePinyin" class="spell">
               </td>
               <td>
-                {{data.type}}
+                <!-- {{data.type}} -->
+                <template v-if="index==0&&copy">
+                  <el-select v-model="data.type" filterable placeholder="请选择" size="small" @change="selectType">
+                    <el-option-group
+                      v-for="group in options"
+                      :key="group.label">
+                      <el-option
+                        v-for="item in group.options"
+                        :key="item.id"
+                        :label="item.name"
+                        :value="item.name">
+                      </el-option>
+                    </el-option-group>
+                  </el-select>
+                </template>
+                <span v-else>{{data.type}}</span>
               </td>
               <td class="desc">
                 <input v-model="item.remark" placeholder="请输入术语说明" maxlength="120"></input>
@@ -209,14 +239,18 @@ import pinyin from '../../js/Convert_Pinyin.js';
           }
         ],
         unfit:false, //点确认时是否弹提示,
-        saveDisable: false  //保存按钮禁止点击
+        saveDisable: false,  //保存按钮禁止点击
+        options:[],
+        copy:null
       }
     },
     created(){
       this.getTypeList();
       const id = this.$route.params.id || '';
+      const copy = this.$route.params.copy || '';
+      this.copy = copy;
       if(id){
-        this.minTitle = '医学术语命名维护-修改';
+        this.minTitle = copy?'医学术语命名维护-复制':'医学术语命名维护-修改';
         this.id = id;
         this.colspan = 5;
         this.getDetail(id);
@@ -285,6 +319,17 @@ import pinyin from '../../js/Convert_Pinyin.js';
           if(data.code==0){
             // this.typeList = data.data.records;
             this.typeList = data.data;
+            // 类型改成平铺
+            if(data.data.length>0){
+              const total = data.data.length;
+              const average = parseInt(total/3);
+              const firstGroup = data.data.slice(0,average);
+              this.options.push({label:1,options:firstGroup});
+              const secGroup = data.data.slice(average,average*2);
+              this.options.push({label:2,options:secGroup});
+              const thirdGroup = data.data.slice(average*2,total-1);
+              this.options.push({label:3,options:thirdGroup});
+            }
           }else{
             this.$message({
               message:data.msg,
@@ -327,16 +372,17 @@ import pinyin from '../../js/Convert_Pinyin.js';
         }else if(type==2){
           // 修改时术语名称、拼音和类型均不能修改
           if(flg == 99){
-              if(this.synonymous[index-1].name && !pattern.test(this.synonymous[index-1].name)){
+              // if(this.synonymous[index-1].name && !pattern.test(this.synonymous[index-1].name)){
+              if(this.allwords[index].name && !pattern.test(this.allwords[index].name)){
               this.$message({
-                // message:'无法输入纯数字或者纯字符,请输入正确数据!',
                 message:'无法输入纯数字,请输入正确数据!',
                 type:'warning'
               });
               // this.synonymous[index-1].name = '';
               this.unfit = true;
             }else{
-              let current = this.synonymous[index-1];
+              // let current = this.synonymous[index-1];
+              let current = this.allwords[index];
               current.spell = pinyin.getCamelChars(current.name);
               this.unfit = false;
             }
@@ -484,7 +530,7 @@ import pinyin from '../../js/Convert_Pinyin.js';
             'name':this.data.name,
             'type':this.data.type,
             'detailList':detailList,
-            'conceptId':this.id,
+            'conceptId':this.copy?'':this.id,//复制当新增,把id置空
             'sexType':sexCode,
             'maxAge':this.maxAge,
             'minAge':this.minAge
@@ -494,7 +540,7 @@ import pinyin from '../../js/Convert_Pinyin.js';
             'name':this.data.name,
             'type':this.data.type,
             'detailList':detailList,
-            'conceptId':this.id
+            'conceptId':this.copy?'':this.id
           }
         }
         this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
@@ -538,6 +584,19 @@ import pinyin from '../../js/Convert_Pinyin.js';
      text-align: right;
      margin-left: 0;
    }
+   // 饿了么分组下拉
+    .el-scrollbar{
+     .el-select-dropdown__list{
+       .el-select-group__wrap{
+        min-width: 160px !important;
+        display: inline-block !important;
+        vertical-align: top !important;
+      }
+    }
+   }
+   .el-select-group__wrap::after{
+    background:#fff !important;
+   } 
    .displayColor {
      color: #ccc;
      cursor:not-allowed;

+ 32 - 13
src/components/icss/MedicalName.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <crumbs title="医学术语命名维护" minWidth="995px">
+        <crumbs title="医学术语命名维护" minWidth="995px" class="knowledgeTitle">
             <el-form :inline="true" class="demo-form-inline">
                 <el-form-item label="医学标准术语:">
                     <el-input size="mini" v-model="filter.term" placeholder="输入术语"></el-input>
@@ -22,7 +22,7 @@
                 <el-form-item label="同义词:">
                     <el-input size="mini" v-model="filter.libName" placeholder="输入同义词"></el-input>
                 </el-form-item>
-              <!--<el-form-item label="状态:">
+              <el-form-item label="状态:">
                 <el-select v-model="isState" clearable placeholder="请选择" size="mini">
                   <el-option
                     v-for="item in stateSelect"
@@ -31,18 +31,22 @@
                     :value="item.id">
                   </el-option>
                 </el-select>
-              </el-form-item>-->
+              </el-form-item>
                 <el-form-item>
-                    <el-button size="mini" @click="filterDatas">确认</el-button>
-                    <el-button size="mini" @click="uploadClick">导入</el-button>
-                    <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
-                    <router-link to="/admin/LT-YXSYKWH-TJYXSY" style="margin:0 10px">
-                        <el-button size="mini" type="warning">添加医学标准术语</el-button>
-                    </router-link>
+                  <el-button size="mini" @click="filterDatas">确认</el-button>
                 </el-form-item>
             </el-form>
+            <el-form class="secLine">
+              <el-form-item>
+                  <el-button size="mini" @click="uploadClick">导入</el-button>
+                  <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
+                  <router-link to="/admin/LT-YXSYKWH-TJYXSY" style="margin:0 10px">
+                      <el-button size="mini" type="warning">添加医学标准术语</el-button>
+                  </router-link>
+              </el-form-item>
+            </el-form>
         </crumbs>
-        <div class="contents">
+        <div class="contents knowledgeContents">
             <el-table :data="list"
                       border
                       style="width: 100%">
@@ -89,6 +93,8 @@
                     <template slot-scope="scope">
                         <el-button type="text" size="small" :disabled="scope.row.isDeleted != 'N'" @click="toEditProduct(scope.row)">修改</el-button>
                         <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" :disabled="scope.row.isDeleted != 'N'" @click="toEditProduct(scope.row,true)">复制</el-button>
+                        <span style="margin:0 3px;">|</span>
                         <el-button type="text" size="small" :class="scope.row.isDeleted == 'N'?'delete':'review'" @click="showDelDialog(scope.row)">{{scope.row.isDeleted == 'N'?'删除':'恢复'}}</el-button>
                     </template>
                 </el-table-column>
@@ -135,11 +141,11 @@
       this.getTypeList();
     },
     methods: {
-      toEditProduct(row){
+      toEditProduct(row,copy){
         this.$router.push({
           name:'AddMedicalName',
           // params: {info:row}
-          params: {id:row.conceptId}
+          params: {id:row.conceptId,copy:copy}
         })
       },
       filterDatas(){
@@ -180,7 +186,8 @@
           current: this.currentPage,
           size: this.pageSize,
           type:this.filter.type,
-          libName:this.filter.libName
+          libName:this.filter.libName,
+          isDeleted:this.isState
         };
         return param;
       },
@@ -284,6 +291,18 @@
 
 <style lang="less" scoped>
     @import "../../less/admin.less";
+    /deep/ .container.knowledgeTitle {
+      height: 80px;
+    }
+    /deep/ .contents.knowledgeContents {
+      padding: 104px 20px 0;
+    }
+    /deep/ .secLine.el-form {
+      float: right;
+      display: block;
+      position: relative;
+      top: -5px;
+    }
     .delete{
         color: red;
     }