瀏覽代碼

Revert: 关联维护-弹窗通用组件

zhouna 4 年之前
父節點
當前提交
50a51622cf
共有 1 個文件被更改,包括 18 次插入89 次删除
  1. 18 89
      src/components/cdssManage/drug/DrugManage.vue

+ 18 - 89
src/components/cdssManage/drug/DrugManage.vue

@@ -61,9 +61,6 @@
         ></el-pagination>
       </div>
     </div>
-    <LtModal v-if="modalVisiable" :disabled="saveDisable" @confirm="submitForm" @close="closeModal">
-      <LinkContent :form="form" ref="relationForm" labelName="药品名称" termType="5" valName="drugNames"/>
-    </LtModal>
   </div>
 </template>
 
@@ -71,15 +68,9 @@
 import api from '@api/cdss.js';
 import config from '@api/config.js';
 import utils from '@api/utils.js';
-import LtModal from '@base/LtModal';
-import LinkContent from '@base/LinkContent';
 
 export default {
   name: 'DrugManage', //化验大小项和公表维护
-  components:{
-      LtModal,
-      LinkContent
-  },
   data: function() {
     return {
       list: [],
@@ -96,14 +87,7 @@ export default {
       uploadInfo: '导入',
       title: '药品关联维护 | ',
       hospitaiName: '',
-      hospitalId: '',
-      modalVisiable:false,  //弹窗显示状态
-      saveDisable:false,    //确定按钮禁用状态
-      form:{
-          searchText: '', //搜索字段
-          hisName: '',
-          icdCode: ''
-      }
+      hospitalId: ''
     };
   },
   created() {
@@ -249,7 +233,14 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.showModal()
+      this.$router.push({
+        name: 'AddDrug',
+        params: Object.assign(pam, {
+          isEdit: false,
+          data: { hospitalId: this.hospitalId },
+          hospitaiName: this.hospitaiName
+        })
+      });
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -261,7 +252,14 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.showModal()
+      this.$router.push({
+        name: 'AddDrug',
+        params: Object.assign(pam, {
+          isEdit: true,
+          data: { ...item, hospitalId: this.hospitalId },
+          hospitaiName: this.hospitaiName
+        })
+      });
     },
     currentChange(next) {
       this.currentPage = next;
@@ -457,76 +455,7 @@ export default {
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
-    },
-    showModal(){
-        this.modalVisiable=true
-    },
-    closeModal(){
-        this.modalVisiable=false
-    },
-    // 建立关联-参数处理
-    submitForm() {
-        this.$refs.relationForm.$refs.innerForm.validate(valid => {
-            if (valid) {
-                const { searchText, hisName, form } = this.form;
-                let params = {
-                    hisName: hisName,
-                    uniqueName: searchText,
-                    form: form,
-                    hospitalId: this.hospitalId
-                };
-                this.showSaveDialog(params);
-            } else {
-                console.log('error submit!!');
-                return false;
-            }
-        });
-    },
-    // 建立关联-映射关系是否已存在
-    showSaveDialog(params) {
-        this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
-        api
-            .drugIsExistRecord(params)
-            .then(res => {
-                if (!res.data.data) {
-                    // 不存在,创建新的关联
-                    // 如果是编辑时,需要携带id
-                    if (this.isEdit) {
-                        params = { ...params, id: this.editId };
-                    }
-                    this.saveLisMapping(params, '保存成功', 'success');
-                } else {
-                    // 已存在,提示修改
-                    this.warning('该条关联已存在,无法添加');
-                    this.saveDisable = false;
-                }
-            })
-            .catch(err => {
-                if (err.code === '900010001') {
-                    return false;
-                }
-                this.warning(err);
-            });
-    },
-
-    // 映射关系不存在-建立关联
-    saveLisMapping(params, msg, type) {
-        api.saveOrUpdateDrugRecord(params).then(res => {
-            if (res.data.code === '0') {
-                this.warning(res.data.msg || msg, type);
-                this.initForm();
-                this.$router.push({
-                    name: 'DrugManage',
-                    params: Object.assign({}, this.$route.params, {
-                        currentPage: 1
-                    })
-                });
-            } else {
-                this.warning(res.data.msg);
-            }
-            this.saveDisable = false;
-        });
-    },
+    }
   }
 };
 </script>