浏览代码

修改套餐细项判断

wyq 3 年之前
父节点
当前提交
4948a45036
共有 1 个文件被更改,包括 40 次插入11 次删除
  1. 40 11
      src/components/common/LtModal.vue

+ 40 - 11
src/components/common/LtModal.vue

@@ -37,7 +37,7 @@
                     <el-input v-model.trim="form.hisCode" clearable style="minWidth: 240px"></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="16" v-if="type == 1">
+                <el-col :span="16" v-if="type == 2 || type == 1">
                   <el-form-item :label="detail+':'" prop="hisDetailName">
                     <el-input
                       v-model.trim="form.hisDetailName"
@@ -86,6 +86,8 @@
                   </el-form-item>
                   <el-form-item v-if="tableData.length >0">
                     <el-table
+                      :header-row-style="{height:'40px'}"
+                      :header-cell-style="{height:'40px',padding:'0'}"
                       :row-class-name="tableRowClassName"
                       :row-style="selectedstyle"
                       :data="tableData"
@@ -173,7 +175,7 @@ export default {
         conceptId: '',
         form: '',
         hisCode: '',
-        source:''
+        source: ''
       },
       showDrop: false, //下拉框显示文字
       saveDisable: false, //保存按钮禁止点击
@@ -192,12 +194,14 @@ export default {
       drugList: [],
       tableData: [],
       mapList: [],
-      getIndex: 6
+      getIndex: 6,
+      ty: this.type,
+      searchType: 2
     };
   },
   created() {
     //修改
-    if (this.data != {}) {
+    if (JSON.stringify(this.data) != '{}') {
       this.isEdit = true;
       this.editId = this.data.id;
       this.form.hisName = this.data.hisName;
@@ -245,9 +249,18 @@ export default {
         this.uniqueNameList = [];
         return;
       }
+      if (this.type == 1) {
+        const { hisName, hisDetailName } = this.form;
+        this.ty = 2; // 1-化验大项、2-化验小项
+        if (hisName !== '' && hisDetailName === '') {
+          this.ty = 1;
+        }
+        this.searchType = this.ty;
+      }
+      this.searchType = this.ty;
       this.showDrop = true;
       let params = {
-        type: this.type,
+        type: this.ty ? this.ty : this.type,
         inputStr: query,
         sex: 3,
         age: 0
@@ -284,7 +297,7 @@ export default {
     getRelatedMapping() {
       const { hisName, hisDetailName } = this.form;
       let params = {
-        type: this.type,
+        type: this.ty ? this.ty : this.type,
         hisDetailName: hisDetailName,
         hisName: hisName
       };
@@ -317,7 +330,7 @@ export default {
     },
     getTermMatching() {
       let params = {
-        type: this.type,
+        type: this.ty ? this.ty : this.type,
         inputStr: this.form.hisName
       };
       api.getTermMatching(params).then(res => {
@@ -340,9 +353,24 @@ export default {
             conceptId,
             formConceptId,
             source,
-            hisCode,
+            hisCode
           } = this.form;
           // 当标准术语是套餐时,细项必须为空
+          if (this.searchType === 1 && hisDetailName !== '') {
+            this.warning('医院术语与标准术语类型不匹配,请修改');
+            return;
+          }
+
+          // 当标准术语是细项时,医院术语套餐和细项均不能为空
+          if (this.searchType === 2) {
+            if (hisName === '') {
+              this.warning('医院术语与标准术语类型不匹配,请修改');
+              return;
+            } else if (hisDetailName === '') {
+              this.warning('医院术语与标准术语类型不匹配,请修改');
+              return;
+            }
+          }
           let params = {
             hisName: hisName,
             uniqueName: searchText,
@@ -351,7 +379,7 @@ export default {
             conceptId: conceptId,
             formConceptId: formConceptId,
             hisCode: hisCode,
-            source: source?source:1
+            source: source ? source : 1
           };
           this.showSaveDialog(params);
         } else {
@@ -394,7 +422,7 @@ export default {
       this.form.hisDetailName = '';
       this.form.form = '';
       this.form.conceptId = '';
-      this.form.source = ''
+      this.form.source = '';
     },
     // 映射关系不存在-建立关联
     saveLisMapping(params, msg, type) {
@@ -507,6 +535,7 @@ export default {
   //   top: 0;
   z-index: 999;
   margin-bottom: 15px;
+  margin-top: -18px;
 }
 // .tabs {
 //   max-width: 240px;
@@ -550,7 +579,7 @@ export default {
   width: 219px;
   cursor: pointer;
 }
-/deep/ .el-form-item__error{
+/deep/ .el-form-item__error {
   width: 150px;
 }
 /*********新增编辑***********/