瀏覽代碼

麻醉关联维护

zsw007 3 年之前
父節點
當前提交
ec8e3f3152
共有 59 個文件被更改,包括 30586 次插入0 次删除
  1. 0 0
      .history/src/components/icss/hemp/Hemp_20211027113434.vue
  2. 751 0
      .history/src/components/icss/hemp/Hemp_20211027113906.vue
  3. 751 0
      .history/src/components/icss/hemp/Hemp_20211027114002.vue
  4. 751 0
      .history/src/components/icss/hemp/Hemp_20211027114456.vue
  5. 750 0
      .history/src/components/icss/hemp/Hemp_20211027114507.vue
  6. 751 0
      .history/src/components/icss/hemp/Hemp_20211027114914.vue
  7. 751 0
      .history/src/components/icss/hemp/Hemp_20211027114950.vue
  8. 751 0
      .history/src/components/icss/hemp/Hemp_20211027115046.vue
  9. 751 0
      .history/src/components/icss/hemp/Hemp_20211027115102.vue
  10. 751 0
      .history/src/components/icss/hemp/Hemp_20211027115110.vue
  11. 0 0
      .history/src/components/icss/hemp/Hemp_20211027121424.vue
  12. 789 0
      .history/src/components/icss/hemp/Hemp_20211027121607.vue
  13. 789 0
      .history/src/components/icss/hemp/Hemp_20211027121947.vue
  14. 789 0
      .history/src/components/icss/hemp/Hemp_20211027122101.vue
  15. 789 0
      .history/src/components/icss/hemp/Hemp_20211027122118.vue
  16. 790 0
      .history/src/components/icss/hemp/Hemp_20211027122153.vue
  17. 790 0
      .history/src/components/icss/hemp/Hemp_20211027122218.vue
  18. 790 0
      .history/src/components/icss/hemp/Hemp_20211027131645.vue
  19. 790 0
      .history/src/components/icss/hemp/Hemp_20211027131803.vue
  20. 790 0
      .history/src/components/icss/hemp/Hemp_20211027131823.vue
  21. 790 0
      .history/src/components/icss/hemp/Hemp_20211027131920.vue
  22. 790 0
      .history/src/components/icss/hemp/Hemp_20211027132007.vue
  23. 689 0
      .history/src/components/icss/hemp/Hemp_20211027134352.vue
  24. 673 0
      .history/src/components/icss/hemp/Hemp_20211027134545.vue
  25. 673 0
      .history/src/components/icss/hemp/Hemp_20211027134605.vue
  26. 673 0
      .history/src/components/icss/hemp/Hemp_20211027134650.vue
  27. 673 0
      .history/src/components/icss/hemp/Hemp_20211027134753.vue
  28. 673 0
      .history/src/components/icss/hemp/Hemp_20211027135451.vue
  29. 673 0
      .history/src/components/icss/hemp/Hemp_20211027135622.vue
  30. 674 0
      .history/src/components/icss/hemp/Hemp_20211027141056.vue
  31. 0 0
      .history/src/components/icss/hemp/addHemp_20211027113446.vue
  32. 446 0
      .history/src/components/icss/hemp/addHemp_20211027121609.vue
  33. 446 0
      .history/src/components/icss/hemp/addHemp_20211027121610.vue
  34. 446 0
      .history/src/components/icss/hemp/addHemp_20211027132151.vue
  35. 446 0
      .history/src/components/icss/hemp/addHemp_20211027133228.vue
  36. 446 0
      .history/src/components/icss/hemp/addHemp_20211027133411.vue
  37. 446 0
      .history/src/components/icss/hemp/addHemp_20211027133723.vue
  38. 446 0
      .history/src/components/icss/hemp/addHemp_20211027134056.vue
  39. 447 0
      .history/src/components/icss/hemp/addHemp_20211027134216.vue
  40. 446 0
      .history/src/components/icss/hemp/addHemp_20211027134305.vue
  41. 432 0
      .history/src/components/icss/hemp/addHemp_20211027134348.vue
  42. 400 0
      .history/src/components/icss/hemp/addHemp_20211027134543.vue
  43. 400 0
      .history/src/components/icss/hemp/addHemp_20211027134832.vue
  44. 400 0
      .history/src/components/icss/hemp/addHemp_20211027134942.vue
  45. 400 0
      .history/src/components/icss/hemp/addHemp_20211027134948.vue
  46. 400 0
      .history/src/components/icss/hemp/addHemp_20211027135012.vue
  47. 400 0
      .history/src/components/icss/hemp/addHemp_20211027135021.vue
  48. 400 0
      .history/src/components/icss/hemp/addHemp_20211027135029.vue
  49. 400 0
      .history/src/components/icss/hemp/addHemp_20211027135331.vue
  50. 400 0
      .history/src/components/icss/hemp/addHemp_20211027135355.vue
  51. 100 0
      .history/src/routes_20211025110249.js
  52. 101 0
      .history/src/routes_20211027113646.js
  53. 102 0
      .history/src/routes_20211027113735.js
  54. 103 0
      .history/src/routes_20211027113839.js
  55. 104 0
      .history/src/routes_20211027132840.js
  56. 105 0
      .history/src/routes_20211027132935.js
  57. 400 0
      src/components/icss/hemp/AddHemp.vue
  58. 674 0
      src/components/icss/hemp/Hemp.vue
  59. 5 0
      src/routes.js

+ 0 - 0
.history/src/components/icss/hemp/Hemp_20211027113434.vue


+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027113906.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs :title="title + hospitaiName" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/cdss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@base/LtModal';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027114002.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/cdss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@base/LtModal';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027114456.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@base/LtModal';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 750 - 0
.history/src/components/icss/hemp/Hemp_20211027114507.vue

@@ -0,0 +1,750 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027114914.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@base/LtModal';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027114950.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '../../base/LtModal.vue';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027115046.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '../../icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '../../base/LtModal.vue';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027115102.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '../../base/LtModal.vue';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 751 - 0
.history/src/components/icss/hemp/Hemp_20211027115110.vue

@@ -0,0 +1,751 @@
+<template>
+  <div>
+    <crumbs title="title" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="匹配状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in matchList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="医院麻醉名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准麻醉名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column> -->
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :hospitalId="hospitalId"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@/base/LtModal.vue';
+export default {
+  name: 'Hemp', //化验大小项和公表维护
+  data: function() {
+    return {
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: '',
+        formStatus: ''
+      },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '麻醉关联维护 | ',
+      hospitaiName: '',
+      hospitalId: '',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 5);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDrugVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDrugDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '药品关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDrugPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('获取列表数据', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: false,
+      //     data: { hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, {
+      //     isEdit: true,
+      //     data: { ...item, hospitalId: this.hospitalId },
+      //     hospitaiName: this.hospitaiName
+      //   })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部药品关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 14,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '药品导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 120px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 80px;
+    flex: 1;
+    background-color: #fff;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 0 - 0
.history/src/components/icss/hemp/Hemp_20211027121424.vue


+ 789 - 0
.history/src/components/icss/hemp/Hemp_20211027121607.vue

@@ -0,0 +1,789 @@
+<template>
+  <div>
+    <crumbs
+      title="药品关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院药品名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item label="标准药品名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 5, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 789 - 0
.history/src/components/icss/hemp/Hemp_20211027121947.vue

@@ -0,0 +1,789 @@
+<template>
+  <div>
+    <crumbs
+      title="药品关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 5, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 789 - 0
.history/src/components/icss/hemp/Hemp_20211027122101.vue

@@ -0,0 +1,789 @@
+<template>
+  <div>
+    <crumbs
+      title="药品关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 5, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 789 - 0
.history/src/components/icss/hemp/Hemp_20211027122118.vue

@@ -0,0 +1,789 @@
+<template>
+  <div>
+    <crumbs
+      title="药品关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 5, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 790 - 0
.history/src/components/icss/hemp/Hemp_20211027122153.vue

@@ -0,0 +1,790 @@
+<template>
+  <div>
+    <crumbs
+      title="药品关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 5, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 790 - 0
.history/src/components/icss/hemp/Hemp_20211027122218.vue

@@ -0,0 +1,790 @@
+<template>
+  <div>
+    <crumbs
+      title="麻醉关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准药品名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 5, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 790 - 0
.history/src/components/icss/hemp/Hemp_20211027131645.vue

@@ -0,0 +1,790 @@
+<template>
+  <div>
+    <crumbs
+      title="麻醉关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <!-- <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 5, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 790 - 0
.history/src/components/icss/hemp/Hemp_20211027131803.vue

@@ -0,0 +1,790 @@
+<template>
+  <div>
+    <crumbs
+      title="麻醉关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <!-- <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 14, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 5 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 790 - 0
.history/src/components/icss/hemp/Hemp_20211027131823.vue

@@ -0,0 +1,790 @@
+<template>
+  <div>
+    <crumbs
+      title="麻醉关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <!-- <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="5"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 14, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 14);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 790 - 0
.history/src/components/icss/hemp/Hemp_20211027131920.vue

@@ -0,0 +1,790 @@
+<template>
+  <div>
+    <crumbs
+      title="麻醉关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <!-- <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="14"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 5,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 14, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 14);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 790 - 0
.history/src/components/icss/hemp/Hemp_20211027132007.vue

@@ -0,0 +1,790 @@
+<template>
+  <div>
+    <crumbs
+      title="麻醉关联维护"
+      style="min-width: 980px"
+      class="knowledgeTitle"
+    >
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="剂型术语状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in formstatusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select
+            size="mini"
+            v-model="filter.match"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in matchList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.hisName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input
+            size="mini"
+            v-model="filter.uniqueName"
+            placeholder="请输入"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule"
+            >导入模板下载</el-button
+          >
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFile"
+            @change="uploadFile($event)"
+          />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin: 0 10px">{{
+            uploadInfo
+          }}</el-button>
+          <input
+            type="file"
+            name="uploadfile "
+            id="upFileMatch"
+            @change="uploadFileMatch($event)"
+          />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation"
+            >添加关联</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column
+          :resizable="false"
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="hisName"
+          label="医院麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准麻醉名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <!-- <el-table-column
+          :resizable="false"
+          prop="form"
+          label="药品剂型"
+          show-overflow-tooltip
+        ></el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName != ''">{{
+              scope.row.status == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isMatch == 0 ? "未匹配" : "已匹配" }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              @click="modifyRelation(scope.row)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'药品名称'"
+      :standard="'药品名称'"
+      :tip="'药品关联'"
+      :type="14"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+import LtModal from "@components/common/LtModal";
+export default {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
+    return {
+      list: [],
+      matchList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
+      ],
+      statusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      formstatusList: [
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
+      ],
+      searched: false,
+      filter: {
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: "导入",
+      modalVisiable: false,
+      data: {},
+    };
+  },
+  components: {
+    LtModal,
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function () {
+        this.searched = false;
+      },
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById("upFileMatch");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 14);
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "预匹配中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
+      // 导入数据接口
+      api.dataDiseaseVerify(formData, header).then((res) => {
+        if (res.data.code === "00020007" || res.data.code === "00020004") {
+          loading.close();
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                "药品关联数据(预匹配).xls"
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      // 加载动画效果
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      api.getDrugPage(params).then((res) => {
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: "",
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus,
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+
+    // 点击添加关联
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+
+      this.data = {};
+      this.showModal(); // 控制弹出框的显示隐藏
+      // this.$router.push({ name: 'AddDrug', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter,
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDrug',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        uniqueName: "",
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning",
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog("是否删除该关联?", () => {
+        api
+          .deleteDrugRecord({ id: id })
+          .then((res) => {
+            if (res.data.code == "0") {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || "操作成功", "success");
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportDrugRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '药品关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDrugRecord({ type: 14, isMatch: this.filter.match })
+            .then((res) => {
+              if (res.status === 200) {
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDrugModule({ type: 14 }).then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById("upFile");
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
+        return;
+      }
+      e.preventDefault(); // 阻止默认行为
+      let formData = new FormData();
+      formData.append("file", fileInfo);
+      formData.append("type", 14);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
+      formData.append(
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
+      );
+      const header = {
+        headers: {
+          "Content-Type": "multipart/form-data",
+        },
+      };
+      this.importDrugRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFile");
+      inp.value = "";
+    },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function () {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === "00020004" || code.code === "00020007") {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: "warning",
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: "success",
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers["content-disposition"];
+      var fileName = decodeURI(
+        disposition.split("filename=")[1].split(";filename*=")[0]
+      );
+      let blob = new Blob([res.data], { type: "application/.xls" }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement("a");
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == "close") {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    },
+  },
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 689 - 0
.history/src/components/icss/hemp/Hemp_20211027134352.vue

@@ -0,0 +1,689 @@
+<template>
+  <div>
+    <crumbs title="科室关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院科室名称:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准科室名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisCode" label="医院科室编码" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院科室名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准科室名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'科室名称'"
+      :standard="'科室名称'"
+      :tip="'科室关联'"
+      :type="7"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'DeptManage',
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      fileName: '',
+      formData: {},
+      headers: {},
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  methods: {
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 7);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '科室关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getDeptPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 7,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddDept', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddDept',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteDeptRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部科室关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     // instance.confirmButtonText = '导出中...';
+        //     done()
+        //     api.exportDeptRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '科室关联数据.xls');
+        //           // done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportDeptRecord({ type: 7, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '科室关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {});
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportDeptModule({ type: 7 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '科室导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      // this.fileName = e.target.files[0].name; // 表单同步显示
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 7);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importDeptRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDeptRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDeptRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDeptRecord(formData, header) {
+      let that = this;
+      api.importDeptRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+  /deep/.el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.exportConfirm {
+  .cancelSure {
+    display: none;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 673 - 0
.history/src/components/icss/hemp/Hemp_20211027134545.vue

@@ -0,0 +1,673 @@
+<template>
+  <div>
+    <crumbs title="输血关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院输血类型:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准输血术语:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院输血类型" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准输血类型" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'输血类型'"
+      :standard="'输血类型'"
+      :tip="'输血关联'"
+      :type="8"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 8,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 8, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 8 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 673 - 0
.history/src/components/icss/hemp/Hemp_20211027134605.vue

@@ -0,0 +1,673 @@
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院输血类型:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准输血术语:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院输血类型" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准输血类型" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'输血类型'"
+      :standard="'输血类型'"
+      :tip="'输血关联'"
+      :type="8"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 8,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 8, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 8 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 673 - 0
.history/src/components/icss/hemp/Hemp_20211027134650.vue

@@ -0,0 +1,673 @@
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院输血类型" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准输血类型" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'输血类型'"
+      :standard="'输血类型'"
+      :tip="'输血关联'"
+      :type="8"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 8,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 8, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 8 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 673 - 0
.history/src/components/icss/hemp/Hemp_20211027134753.vue

@@ -0,0 +1,673 @@
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'输血类型'"
+      :standard="'输血类型'"
+      :tip="'输血关联'"
+      :type="8"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 8,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 8, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 8 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 673 - 0
.history/src/components/icss/hemp/Hemp_20211027135451.vue

@@ -0,0 +1,673 @@
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'麻醉类型'"
+      :standard="'麻醉类型'"
+      :tip="'麻醉关联'"
+      :type="14"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 8,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 8, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 8 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 8);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 673 - 0
.history/src/components/icss/hemp/Hemp_20211027135622.vue

@@ -0,0 +1,673 @@
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'麻醉类型'"
+      :standard="'麻醉类型'"
+      :tip="'麻醉关联'"
+      :type="14"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 14, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 674 - 0
.history/src/components/icss/hemp/Hemp_20211027141056.vue

@@ -0,0 +1,674 @@
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'麻醉类型'"
+      :standard="'麻醉类型'"
+      :tip="'麻醉关联'"
+      :type="14"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('麻醉列表数据:', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 14, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 0 - 0
.history/src/components/icss/hemp/addHemp_20211027113446.vue


+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027121609.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '药品关联维护--修改关联' : '药品关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 5, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027121610.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '药品关联维护--修改关联' : '药品关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 5, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027132151.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '药品关联维护--修改关联' : '药品关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 5, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027133228.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 5, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027133411.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 5, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027133723.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 5, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027134056.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 14, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 447 - 0
.history/src/components/icss/hemp/addHemp_20211027134216.vue

@@ -0,0 +1,447 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 14, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+            console.log('搜索列表数据:', this.uniqueNameList);
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 446 - 0
.history/src/components/icss/hemp/addHemp_20211027134305.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DrugManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="药品名称:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item.name"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="药品名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="药品剂型:">
+                <el-select
+                  v-model="form.form"
+                  placeholder="请选择"
+                  clearable
+                  style="width:100%;minWidth: 240px"
+                >
+                  <el-option
+                    v-for="item in drugList"
+                    :key="item.val"
+                    :label="item.name"
+                    :value="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import config from '@api/config';
+export default {
+  name: 'AddDrug',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        form: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入药品名称', trigger: 'change' },
+          { max: 80, message: '药品名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择药品名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      drugForm: config.drugForm,
+      drugList: []
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    this.getDicList();
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.form = data.form;
+    }
+  },
+  methods: {
+    getDicList() {
+      api.getDicList().then(res => {
+        // console.log(res, '字典类型');
+        // if (res.data.code === '0') {
+
+        //   this.drugList = res.data.data && res.data.data['9'];
+
+        // }
+
+        if (res.data.code === '0') {
+          let dragData = [];
+          res.data.data &&
+            res.data.data['9'].forEach(item => {
+              if (item.val !== '0') {
+                dragData.push(item);
+              }
+            });
+          this.drugList = dragData;
+        }
+      });
+    },
+
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 14, //药品
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.drugNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, form } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            form: form
+          };
+          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;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 432 - 0
.history/src/components/icss/hemp/addHemp_20211027134348.vue

@@ -0,0 +1,432 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '科室关联维护--修改关联' : '科室关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="DeptManage"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="科室名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="科室名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+              <el-form-item label="科室编码:" prop="hisCode">
+                <el-input v-model="form.hisCode" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="科室名称:" prop="searchText">
+                <el-select
+                  style="width:100%; minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="科室名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddDept',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        hisCode: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入科室名称', trigger: 'change' },
+          { max: 80, message: '科室名称最多80字', trigger: 'change' }
+        ],
+        hisCode: [{ max: 80, message: '科室编码最多80字', trigger: 'change' }],
+        searchText: [
+          { required: true, message: '请选择科室名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      searchInfo: ''
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    // console.log(data, 'data');
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.hisCode = data.hisCode;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.searchInfo = query;
+      this.showDrop = true;
+      let params = {
+        type: 7, //科室
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.deptNames;
+        }
+      });
+    },
+    changeWord(newVal) {
+      console.log(newVal);
+    },
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, hisCode } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            hisCode: hisCode
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .deptIsExistRecord(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.saveOrUpdateDeptRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'DeptManage',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+body {
+  .el-select-dropdown {
+    /deep/ .el-select-dropdown__item {
+      span {
+        color: #333;
+      }
+    }
+    ul {
+      max-width: 300px;
+    }
+
+    /deep/ .el-scrollbar {
+      border: 1px solid #dcdfe6;
+    }
+    /deep/ .popper__arrow {
+      border-bottom-color: #a5a5a5 !important;
+    }
+  }
+  /deep/ .el-popper[x-placement^='bottom'] {
+    margin-top: 8px !important;
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027134543.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '输血关联维护--修改关联' : '输血关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入输血类型', trigger: 'change' },
+          { max: 80, message: '输血类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择输血类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 8, //输血
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027134832.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入输血类型', trigger: 'change' },
+          { max: 80, message: '输血类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择输血类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 8, //输血
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027134942.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入输血类型', trigger: 'change' },
+          { max: 80, message: '输血类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择输血类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 8, //输血
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027134948.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入输血类型', trigger: 'change' },
+          { max: 80, message: '输血类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择输血类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 8, //输血
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027135012.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入输血类型', trigger: 'change' },
+          { max: 80, message: '输血类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择输血类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 8, //输血
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027135021.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入输血类型', trigger: 'change' },
+          { max: 80, message: '输血类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择输血类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 8, //输血
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027135029.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入输血类型', trigger: 'change' },
+          { max: 80, message: '输血类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择输血类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 8, //输血
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027135331.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="输血类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="输血类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入麻醉类型', trigger: 'change' },
+          { max: 80, message: '麻醉类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择麻醉类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 14, //麻醉
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 400 - 0
.history/src/components/icss/hemp/addHemp_20211027135355.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入麻醉类型', trigger: 'change' },
+          { max: 80, message: '麻醉类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择麻醉类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 14, //麻醉
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 100 - 0
.history/src/routes_20211025110249.js

@@ -0,0 +1,100 @@
+import Login from '@components/login/Login.vue';
+import HomePage from '@components/common/HomePage.vue';
+import MedicinePrompt from '@components/icss/MedicinePrompt.vue'   //医学术语静态知识
+import AddMedicinePrompt from '@components/icss/AddMedicinePrompt.vue'   //医学术语静态知识
+import ChemicalAndCommonMapping from '@components/icss/disease/ChemicalAndCommonMapping.vue'; //诊断关联维护
+import AddChemicalAndCommonMapping from '@components/icss/disease/AddChemicalAndCommonMapping.vue';  //诊断关联维护--添加关联
+import Lis from '@components/icss/lis/Lis.vue'; //检验关联维护
+import AddLis from '@components/icss/lis/AddLis.vue';  //检验关联维护--添加关联
+import Pacs from '@components/icss/pacs/Pacs.vue'; //检查关联维护
+import AddPacs from '@components/icss/pacs/AddPacs.vue';  //检查关联维护--添加关联
+import DrugManage from '@components/icss/drug/DrugManage.vue'; //药品关联维护
+import AddDrug from '@components/icss/drug/AddDrug.vue';  //药品关联维护--添加关联
+import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联维护
+import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
+import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
+import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
+import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
+import AddFusion from '@components/icss/fusion/AddFusion.vue';  //输血关联维护--添加关联
+import DeptManage from '@components/icss/dept/DeptManage.vue'; //科室关联维护
+import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--添加关联
+import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
+import Nursing from '@components/icss/nursing/nursing.vue';  //护理关联维护
+import AddNursing from '@components/icss/nursing/Addnursing.vue';  //护理关联维护--添加关联
+import Tcmdisease from '@components/icss/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
+import AddTcmdisease from '@components/icss/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
+import Tcmdrome from '@components/icss/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
+import AddTcmdrome from '@components/icss/tcmdrome/AddTcmdrome.vue';  //中医疾病关联维护--添加关联
+
+import Plan from '@components/icss/plan/Plan.vue';  //关联维护设置
+import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
+import Bill from '@components/icss/bill/Bill.vue';  //开单
+import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
+import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
+import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
+import SonHospital from '@components/icss/sonhospital/SonHospital.vue';  //子医院维护
+
+export default [
+  {
+    path: '/',
+    name: 'login',
+    component: Login,
+  },
+  {
+    //朗通后台
+    path: '/admin',
+    component: HomePage,
+    meta: {
+      requireAuth: true,
+    },
+    children: [
+      { path: 'YXSYK-JTZSWH', component: MedicinePrompt, name: 'MedicinePrompt' }, //医学术语提示信息维护
+      { path: 'LT-YXSYKWH-TJYXSYJTZS', component: AddMedicinePrompt, name: 'AddMedicinePrompt' }, //医学术语提示信息维护添加
+      { path: 'YXSYK-ZDGLWH', component: ChemicalAndCommonMapping, name: 'ChemicalAndCommonMapping', }, //诊断关联维护
+      { path: 'LT-ZDGLWH-TJHYDXXYGBXDY', component: AddChemicalAndCommonMapping, name: 'AddChemicalAndCommonMapping', }, //诊断关联维护--添加关联
+      { path: 'YXSYK-JYGLWH', component: Lis, name: 'Lis' }, //检验关联维护
+      { path: 'LT-JYGLWH-TJHYDXXYGBXDY', component: AddLis, name: 'AddLis' }, //检验关联维护--添加关联
+      { path: 'YXSYK-JCGLWH', component: Pacs, name: 'Pacs' }, //检查关联维护
+      { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
+      { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
+      { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+      { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+      { path: 'LT-YPLBWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
+      { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
+      { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
+      { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护
+      { path: 'LT-SXGLWH-TJHYDXXYGBXDY', component: AddFusion, name: 'AddFusion' }, //输血关联维护--添加关联
+      { path: 'YXSYK-KSGLWH', component: DeptManage, name: 'DeptManage' }, //科室关联维护
+      { path: 'LT-KSGLWH-TJHYDXXYGBXDY', component: AddDept, name: 'AddDept' }, //科室关联维护--添加关联
+      { path: 'YXSYK-HLGLWH', component: Nursing, name: 'Nursing' }, //护理关联维护
+      { path: 'LT-HLGLWH-TJHYDXXYGBXDY', component: AddNursing, name: 'AddNursing' }, //护理关联维护--添加关联
+      { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
+      { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
+      { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
+      { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+
+
+      { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
+      { path: 'XTPZ-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
+      { path: 'LT-DZBLFAPZ-EDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑
+      { path: 'GZWH-KDHLXGZWH', component: Bill, name: 'Bill' }, //开单
+      { path: 'GZWH-KDHLXGZWH-EDIT', component: AddBill, name: 'AddBill' }, //开单
+      {
+        path: 'GZWH-GZWH',
+        component: ZskRuleManager,
+        name: 'ZskRuleManager',
+      },
+      {
+        path: 'GZWH-GZWH-TJGZ',
+        component: AddZskRule,
+        name: 'AddZskRule',
+      },
+      ,
+      {
+        path: 'XTPZ-ZYYWH',
+        component: SonHospital,
+        name: 'SonHospital',
+      },
+    ],
+  },
+];

+ 101 - 0
.history/src/routes_20211027113646.js

@@ -0,0 +1,101 @@
+import Login from '@components/login/Login.vue';
+import HomePage from '@components/common/HomePage.vue';
+import MedicinePrompt from '@components/icss/MedicinePrompt.vue'   //医学术语静态知识
+import AddMedicinePrompt from '@components/icss/AddMedicinePrompt.vue'   //医学术语静态知识
+import ChemicalAndCommonMapping from '@components/icss/disease/ChemicalAndCommonMapping.vue'; //诊断关联维护
+import AddChemicalAndCommonMapping from '@components/icss/disease/AddChemicalAndCommonMapping.vue';  //诊断关联维护--添加关联
+import Lis from '@components/icss/lis/Lis.vue'; //检验关联维护
+import AddLis from '@components/icss/lis/AddLis.vue';  //检验关联维护--添加关联
+import Pacs from '@components/icss/pacs/Pacs.vue'; //检查关联维护
+import AddPacs from '@components/icss/pacs/AddPacs.vue';  //检查关联维护--添加关联
+import DrugManage from '@components/icss/drug/DrugManage.vue'; //药品关联维护
+import AddDrug from '@components/icss/drug/AddDrug.vue';  //药品关联维护--添加关联
+import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联维护
+import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
+import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
+import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
+import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
+import AddFusion from '@components/icss/fusion/AddFusion.vue';  //输血关联维护--添加关联
+import DeptManage from '@components/icss/dept/DeptManage.vue'; //科室关联维护
+import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--添加关联
+import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
+import Nursing from '@components/icss/nursing/nursing.vue';  //护理关联维护
+import AddNursing from '@components/icss/nursing/Addnursing.vue';  //护理关联维护--添加关联
+import Tcmdisease from '@components/icss/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
+import AddTcmdisease from '@components/icss/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
+import Tcmdrome from '@components/icss/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
+import AddTcmdrome from '@components/icss/tcmdrome/AddTcmdrome.vue';  //中医疾病关联维护--添加关联
+
+import Plan from '@components/icss/plan/Plan.vue';  //关联维护设置
+import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
+import Bill from '@components/icss/bill/Bill.vue';  //开单
+import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
+import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
+import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
+import SonHospital from '@components/icss/sonhospital/SonHospital.vue';  //子医院维护
+
+export default [
+  {
+    path: '/',
+    name: 'login',
+    component: Login,
+  },
+  {
+    //朗通后台
+    path: '/admin',
+    component: HomePage,
+    meta: {
+      requireAuth: true,
+    },
+    children: [
+      { path: 'YXSYK-JTZSWH', component: MedicinePrompt, name: 'MedicinePrompt' }, //医学术语提示信息维护
+      { path: 'LT-YXSYKWH-TJYXSYJTZS', component: AddMedicinePrompt, name: 'AddMedicinePrompt' }, //医学术语提示信息维护添加
+      { path: 'YXSYK-ZDGLWH', component: ChemicalAndCommonMapping, name: 'ChemicalAndCommonMapping', }, //诊断关联维护
+      { path: 'LT-ZDGLWH-TJHYDXXYGBXDY', component: AddChemicalAndCommonMapping, name: 'AddChemicalAndCommonMapping', }, //诊断关联维护--添加关联
+      { path: 'YXSYK-JYGLWH', component: Lis, name: 'Lis' }, //检验关联维护
+      { path: 'LT-JYGLWH-TJHYDXXYGBXDY', component: AddLis, name: 'AddLis' }, //检验关联维护--添加关联
+      { path: 'YXSYK-JCGLWH', component: Pacs, name: 'Pacs' }, //检查关联维护
+      { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
+      { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
+      { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+      { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+      { path: 'LT-YPLBWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
+      { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
+      { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
+      { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护
+      { path: 'LT-SXGLWH-TJHYDXXYGBXDY', component: AddFusion, name: 'AddFusion' }, //输血关联维护--添加关联
+      { path: 'YXSYK-KSGLWH', component: DeptManage, name: 'DeptManage' }, //科室关联维护
+      { path: 'LT-KSGLWH-TJHYDXXYGBXDY', component: AddDept, name: 'AddDept' }, //科室关联维护--添加关联
+      { path: 'YXSYK-HLGLWH', component: Nursing, name: 'Nursing' }, //护理关联维护
+      { path: 'LT-HLGLWH-TJHYDXXYGBXDY', component: AddNursing, name: 'AddNursing' }, //护理关联维护--添加关联
+      { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
+      { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
+      { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
+      { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+      { path: 'YXSYK-MZGLWH', component: Hemp, name: 'Hemp' },
+
+
+      { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
+      { path: 'XTPZ-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
+      { path: 'LT-DZBLFAPZ-EDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑
+      { path: 'GZWH-KDHLXGZWH', component: Bill, name: 'Bill' }, //开单
+      { path: 'GZWH-KDHLXGZWH-EDIT', component: AddBill, name: 'AddBill' }, //开单
+      {
+        path: 'GZWH-GZWH',
+        component: ZskRuleManager,
+        name: 'ZskRuleManager',
+      },
+      {
+        path: 'GZWH-GZWH-TJGZ',
+        component: AddZskRule,
+        name: 'AddZskRule',
+      },
+      ,
+      {
+        path: 'XTPZ-ZYYWH',
+        component: SonHospital,
+        name: 'SonHospital',
+      },
+    ],
+  },
+];

+ 102 - 0
.history/src/routes_20211027113735.js

@@ -0,0 +1,102 @@
+import Login from '@components/login/Login.vue';
+import HomePage from '@components/common/HomePage.vue';
+import MedicinePrompt from '@components/icss/MedicinePrompt.vue'   //医学术语静态知识
+import AddMedicinePrompt from '@components/icss/AddMedicinePrompt.vue'   //医学术语静态知识
+import ChemicalAndCommonMapping from '@components/icss/disease/ChemicalAndCommonMapping.vue'; //诊断关联维护
+import AddChemicalAndCommonMapping from '@components/icss/disease/AddChemicalAndCommonMapping.vue';  //诊断关联维护--添加关联
+import Lis from '@components/icss/lis/Lis.vue'; //检验关联维护
+import AddLis from '@components/icss/lis/AddLis.vue';  //检验关联维护--添加关联
+import Pacs from '@components/icss/pacs/Pacs.vue'; //检查关联维护
+import AddPacs from '@components/icss/pacs/AddPacs.vue';  //检查关联维护--添加关联
+import DrugManage from '@components/icss/drug/DrugManage.vue'; //药品关联维护
+import AddDrug from '@components/icss/drug/AddDrug.vue';  //药品关联维护--添加关联
+import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联维护
+import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
+import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
+import Hemp from '@components/icss/hemp/Hemp.vue'; // 麻醉关联维护
+import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
+import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
+import AddFusion from '@components/icss/fusion/AddFusion.vue';  //输血关联维护--添加关联
+import DeptManage from '@components/icss/dept/DeptManage.vue'; //科室关联维护
+import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--添加关联
+import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
+import Nursing from '@components/icss/nursing/nursing.vue';  //护理关联维护
+import AddNursing from '@components/icss/nursing/Addnursing.vue';  //护理关联维护--添加关联
+import Tcmdisease from '@components/icss/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
+import AddTcmdisease from '@components/icss/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
+import Tcmdrome from '@components/icss/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
+import AddTcmdrome from '@components/icss/tcmdrome/AddTcmdrome.vue';  //中医疾病关联维护--添加关联
+
+import Plan from '@components/icss/plan/Plan.vue';  //关联维护设置
+import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
+import Bill from '@components/icss/bill/Bill.vue';  //开单
+import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
+import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
+import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
+import SonHospital from '@components/icss/sonhospital/SonHospital.vue';  //子医院维护
+
+export default [
+  {
+    path: '/',
+    name: 'login',
+    component: Login,
+  },
+  {
+    //朗通后台
+    path: '/admin',
+    component: HomePage,
+    meta: {
+      requireAuth: true,
+    },
+    children: [
+      { path: 'YXSYK-JTZSWH', component: MedicinePrompt, name: 'MedicinePrompt' }, //医学术语提示信息维护
+      { path: 'LT-YXSYKWH-TJYXSYJTZS', component: AddMedicinePrompt, name: 'AddMedicinePrompt' }, //医学术语提示信息维护添加
+      { path: 'YXSYK-ZDGLWH', component: ChemicalAndCommonMapping, name: 'ChemicalAndCommonMapping', }, //诊断关联维护
+      { path: 'LT-ZDGLWH-TJHYDXXYGBXDY', component: AddChemicalAndCommonMapping, name: 'AddChemicalAndCommonMapping', }, //诊断关联维护--添加关联
+      { path: 'YXSYK-JYGLWH', component: Lis, name: 'Lis' }, //检验关联维护
+      { path: 'LT-JYGLWH-TJHYDXXYGBXDY', component: AddLis, name: 'AddLis' }, //检验关联维护--添加关联
+      { path: 'YXSYK-JCGLWH', component: Pacs, name: 'Pacs' }, //检查关联维护
+      { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
+      { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
+      { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+      { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+      { path: 'LT-YPLBWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
+      { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
+      { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
+      { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护
+      { path: 'LT-SXGLWH-TJHYDXXYGBXDY', component: AddFusion, name: 'AddFusion' }, //输血关联维护--添加关联
+      { path: 'YXSYK-KSGLWH', component: DeptManage, name: 'DeptManage' }, //科室关联维护
+      { path: 'LT-KSGLWH-TJHYDXXYGBXDY', component: AddDept, name: 'AddDept' }, //科室关联维护--添加关联
+      { path: 'YXSYK-HLGLWH', component: Nursing, name: 'Nursing' }, //护理关联维护
+      { path: 'LT-HLGLWH-TJHYDXXYGBXDY', component: AddNursing, name: 'AddNursing' }, //护理关联维护--添加关联
+      { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
+      { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
+      { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
+      { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+      { path: 'YXSYK-MZGLWH', component: Hemp, name: 'Hemp' },
+
+
+      { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
+      { path: 'XTPZ-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
+      { path: 'LT-DZBLFAPZ-EDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑
+      { path: 'GZWH-KDHLXGZWH', component: Bill, name: 'Bill' }, //开单
+      { path: 'GZWH-KDHLXGZWH-EDIT', component: AddBill, name: 'AddBill' }, //开单
+      {
+        path: 'GZWH-GZWH',
+        component: ZskRuleManager,
+        name: 'ZskRuleManager',
+      },
+      {
+        path: 'GZWH-GZWH-TJGZ',
+        component: AddZskRule,
+        name: 'AddZskRule',
+      },
+      ,
+      {
+        path: 'XTPZ-ZYYWH',
+        component: SonHospital,
+        name: 'SonHospital',
+      },
+    ],
+  },
+];

+ 103 - 0
.history/src/routes_20211027113839.js

@@ -0,0 +1,103 @@
+import Login from '@components/login/Login.vue';
+import HomePage from '@components/common/HomePage.vue';
+import MedicinePrompt from '@components/icss/MedicinePrompt.vue'   //医学术语静态知识
+import AddMedicinePrompt from '@components/icss/AddMedicinePrompt.vue'   //医学术语静态知识
+import ChemicalAndCommonMapping from '@components/icss/disease/ChemicalAndCommonMapping.vue'; //诊断关联维护
+import AddChemicalAndCommonMapping from '@components/icss/disease/AddChemicalAndCommonMapping.vue';  //诊断关联维护--添加关联
+import Lis from '@components/icss/lis/Lis.vue'; //检验关联维护
+import AddLis from '@components/icss/lis/AddLis.vue';  //检验关联维护--添加关联
+import Pacs from '@components/icss/pacs/Pacs.vue'; //检查关联维护
+import AddPacs from '@components/icss/pacs/AddPacs.vue';  //检查关联维护--添加关联
+import DrugManage from '@components/icss/drug/DrugManage.vue'; //药品关联维护
+import AddDrug from '@components/icss/drug/AddDrug.vue';  //药品关联维护--添加关联
+import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联维护
+import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
+import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
+import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
+import Hemp from '@components/icss/hemp/Hemp.vue'; // 麻醉关联维护
+import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
+import AddFusion from '@components/icss/fusion/AddFusion.vue';  //输血关联维护--添加关联
+import DeptManage from '@components/icss/dept/DeptManage.vue'; //科室关联维护
+import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--添加关联
+import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
+import Nursing from '@components/icss/nursing/nursing.vue';  //护理关联维护
+import AddNursing from '@components/icss/nursing/Addnursing.vue';  //护理关联维护--添加关联
+import Tcmdisease from '@components/icss/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
+import AddTcmdisease from '@components/icss/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
+import Tcmdrome from '@components/icss/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
+import AddTcmdrome from '@components/icss/tcmdrome/AddTcmdrome.vue';  //中医疾病关联维护--添加关联
+
+import Plan from '@components/icss/plan/Plan.vue';  //关联维护设置
+import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
+import Bill from '@components/icss/bill/Bill.vue';  //开单
+import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
+import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
+import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
+import SonHospital from '@components/icss/sonhospital/SonHospital.vue';  //子医院维护
+
+export default [
+  {
+    path: '/',
+    name: 'login',
+    component: Login,
+  },
+  {
+    //朗通后台
+    path: '/admin',
+    component: HomePage,
+    meta: {
+      requireAuth: true,
+    },
+    children: [
+      { path: 'YXSYK-JTZSWH', component: MedicinePrompt, name: 'MedicinePrompt' }, //医学术语提示信息维护
+      { path: 'LT-YXSYKWH-TJYXSYJTZS', component: AddMedicinePrompt, name: 'AddMedicinePrompt' }, //医学术语提示信息维护添加
+      { path: 'YXSYK-ZDGLWH', component: ChemicalAndCommonMapping, name: 'ChemicalAndCommonMapping', }, //诊断关联维护
+      { path: 'LT-ZDGLWH-TJHYDXXYGBXDY', component: AddChemicalAndCommonMapping, name: 'AddChemicalAndCommonMapping', }, //诊断关联维护--添加关联
+      { path: 'YXSYK-JYGLWH', component: Lis, name: 'Lis' }, //检验关联维护
+      { path: 'LT-JYGLWH-TJHYDXXYGBXDY', component: AddLis, name: 'AddLis' }, //检验关联维护--添加关联
+      { path: 'YXSYK-JCGLWH', component: Pacs, name: 'Pacs' }, //检查关联维护
+      { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
+      { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
+      { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+      { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+      { path: 'LT-YPLBWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
+      { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
+      { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
+      { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护
+      { path: 'LT-SXGLWH-TJHYDXXYGBXDY', component: AddFusion, name: 'AddFusion' }, //输血关联维护--添加关联
+      { path: 'YXSYK-KSGLWH', component: DeptManage, name: 'DeptManage' }, //科室关联维护
+      { path: 'LT-KSGLWH-TJHYDXXYGBXDY', component: AddDept, name: 'AddDept' }, //科室关联维护--添加关联
+      { path: 'YXSYK-HLGLWH', component: Nursing, name: 'Nursing' }, //护理关联维护
+      { path: 'LT-HLGLWH-TJHYDXXYGBXDY', component: AddNursing, name: 'AddNursing' }, //护理关联维护--添加关联
+      { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
+      { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
+      { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
+      { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+      { path: 'YXSYK-MZGLWH', component: Hemp, name: 'Hemp' },
+      
+
+
+      { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
+      { path: 'XTPZ-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
+      { path: 'LT-DZBLFAPZ-EDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑
+      { path: 'GZWH-KDHLXGZWH', component: Bill, name: 'Bill' }, //开单
+      { path: 'GZWH-KDHLXGZWH-EDIT', component: AddBill, name: 'AddBill' }, //开单
+      {
+        path: 'GZWH-GZWH',
+        component: ZskRuleManager,
+        name: 'ZskRuleManager',
+      },
+      {
+        path: 'GZWH-GZWH-TJGZ',
+        component: AddZskRule,
+        name: 'AddZskRule',
+      },
+      ,
+      {
+        path: 'XTPZ-ZYYWH',
+        component: SonHospital,
+        name: 'SonHospital',
+      },
+    ],
+  },
+];

+ 104 - 0
.history/src/routes_20211027132840.js

@@ -0,0 +1,104 @@
+import Login from '@components/login/Login.vue';
+import HomePage from '@components/common/HomePage.vue';
+import MedicinePrompt from '@components/icss/MedicinePrompt.vue'   //医学术语静态知识
+import AddMedicinePrompt from '@components/icss/AddMedicinePrompt.vue'   //医学术语静态知识
+import ChemicalAndCommonMapping from '@components/icss/disease/ChemicalAndCommonMapping.vue'; //诊断关联维护
+import AddChemicalAndCommonMapping from '@components/icss/disease/AddChemicalAndCommonMapping.vue';  //诊断关联维护--添加关联
+import Lis from '@components/icss/lis/Lis.vue'; //检验关联维护
+import AddLis from '@components/icss/lis/AddLis.vue';  //检验关联维护--添加关联
+import Pacs from '@components/icss/pacs/Pacs.vue'; //检查关联维护
+import AddPacs from '@components/icss/pacs/AddPacs.vue';  //检查关联维护--添加关联
+import DrugManage from '@components/icss/drug/DrugManage.vue'; //药品关联维护
+import AddDrug from '@components/icss/drug/AddDrug.vue';  //药品关联维护--添加关联
+import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联维护
+import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
+import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
+import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
+import Hemp from '@components/icss/hemp/Hemp.vue'; // 麻醉关联维护
+import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
+import AddFusion from '@components/icss/fusion/AddFusion.vue';  //输血关联维护--添加关联
+import DeptManage from '@components/icss/dept/DeptManage.vue'; //科室关联维护
+import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--添加关联
+import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
+import Nursing from '@components/icss/nursing/nursing.vue';  //护理关联维护
+import AddNursing from '@components/icss/nursing/Addnursing.vue';  //护理关联维护--添加关联
+import Tcmdisease from '@components/icss/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
+import AddTcmdisease from '@components/icss/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
+import Tcmdrome from '@components/icss/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
+import AddTcmdrome from '@components/icss/tcmdrome/AddTcmdrome.vue';  //中医疾病关联维护--添加关联
+
+import Plan from '@components/icss/plan/Plan.vue';  //关联维护设置
+import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
+import Bill from '@components/icss/bill/Bill.vue';  //开单
+import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
+import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
+import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
+import SonHospital from '@components/icss/sonhospital/SonHospital.vue';  //子医院维护
+
+export default [
+  {
+    path: '/',
+    name: 'login',
+    component: Login,
+  },
+  {
+    //朗通后台
+    path: '/admin',
+    component: HomePage,
+    meta: {
+      requireAuth: true,
+    },
+    children: [
+      { path: 'YXSYK-JTZSWH', component: MedicinePrompt, name: 'MedicinePrompt' }, //医学术语提示信息维护
+      { path: 'LT-YXSYKWH-TJYXSYJTZS', component: AddMedicinePrompt, name: 'AddMedicinePrompt' }, //医学术语提示信息维护添加
+      { path: 'YXSYK-ZDGLWH', component: ChemicalAndCommonMapping, name: 'ChemicalAndCommonMapping', }, //诊断关联维护
+      { path: 'LT-ZDGLWH-TJHYDXXYGBXDY', component: AddChemicalAndCommonMapping, name: 'AddChemicalAndCommonMapping', }, //诊断关联维护--添加关联
+      { path: 'YXSYK-JYGLWH', component: Lis, name: 'Lis' }, //检验关联维护
+      { path: 'LT-JYGLWH-TJHYDXXYGBXDY', component: AddLis, name: 'AddLis' }, //检验关联维护--添加关联
+      { path: 'YXSYK-JCGLWH', component: Pacs, name: 'Pacs' }, //检查关联维护
+      { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
+      { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
+      { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+      { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+      { path: 'LT-YPLBWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
+      { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
+      { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
+      { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护
+      { path: 'LT-SXGLWH-TJHYDXXYGBXDY', component: AddFusion, name: 'AddFusion' }, //输血关联维护--添加关联
+      { path: 'YXSYK-KSGLWH', component: DeptManage, name: 'DeptManage' }, //科室关联维护
+      { path: 'LT-KSGLWH-TJHYDXXYGBXDY', component: AddDept, name: 'AddDept' }, //科室关联维护--添加关联
+      { path: 'YXSYK-HLGLWH', component: Nursing, name: 'Nursing' }, //护理关联维护
+      { path: 'LT-HLGLWH-TJHYDXXYGBXDY', component: AddNursing, name: 'AddNursing' }, //护理关联维护--添加关联
+      { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
+      { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
+      { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
+      { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+      { path: 'YXSYK-MZGLWH', component: Hemp, name: 'Hemp' }, // 麻醉关联维护
+      { path: 'LT-MZGLWH-TJHYDXXYGBXDY', component: AddHemp, name: 'AddHemp' }, // 麻醉关联维护--添加关联
+
+
+
+      { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
+      { path: 'XTPZ-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
+      { path: 'LT-DZBLFAPZ-EDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑
+      { path: 'GZWH-KDHLXGZWH', component: Bill, name: 'Bill' }, //开单
+      { path: 'GZWH-KDHLXGZWH-EDIT', component: AddBill, name: 'AddBill' }, //开单
+      {
+        path: 'GZWH-GZWH',
+        component: ZskRuleManager,
+        name: 'ZskRuleManager',
+      },
+      {
+        path: 'GZWH-GZWH-TJGZ',
+        component: AddZskRule,
+        name: 'AddZskRule',
+      },
+      ,
+      {
+        path: 'XTPZ-ZYYWH',
+        component: SonHospital,
+        name: 'SonHospital',
+      },
+    ],
+  },
+];

+ 105 - 0
.history/src/routes_20211027132935.js

@@ -0,0 +1,105 @@
+import Login from '@components/login/Login.vue';
+import HomePage from '@components/common/HomePage.vue';
+import MedicinePrompt from '@components/icss/MedicinePrompt.vue'   //医学术语静态知识
+import AddMedicinePrompt from '@components/icss/AddMedicinePrompt.vue'   //医学术语静态知识
+import ChemicalAndCommonMapping from '@components/icss/disease/ChemicalAndCommonMapping.vue'; //诊断关联维护
+import AddChemicalAndCommonMapping from '@components/icss/disease/AddChemicalAndCommonMapping.vue';  //诊断关联维护--添加关联
+import Lis from '@components/icss/lis/Lis.vue'; //检验关联维护
+import AddLis from '@components/icss/lis/AddLis.vue';  //检验关联维护--添加关联
+import Pacs from '@components/icss/pacs/Pacs.vue'; //检查关联维护
+import AddPacs from '@components/icss/pacs/AddPacs.vue';  //检查关联维护--添加关联
+import DrugManage from '@components/icss/drug/DrugManage.vue'; //药品关联维护
+import AddDrug from '@components/icss/drug/AddDrug.vue';  //药品关联维护--添加关联
+import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联维护
+import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
+import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
+import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
+import Hemp from '@components/icss/hemp/Hemp.vue'; // 麻醉关联维护
+import AddHemp from '@components/icss/hemp/AddHemp.vue'; // 麻醉关联维护-添加关联
+import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
+import AddFusion from '@components/icss/fusion/AddFusion.vue';  //输血关联维护--添加关联
+import DeptManage from '@components/icss/dept/DeptManage.vue'; //科室关联维护
+import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--添加关联
+import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
+import Nursing from '@components/icss/nursing/nursing.vue';  //护理关联维护
+import AddNursing from '@components/icss/nursing/Addnursing.vue';  //护理关联维护--添加关联
+import Tcmdisease from '@components/icss/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
+import AddTcmdisease from '@components/icss/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
+import Tcmdrome from '@components/icss/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
+import AddTcmdrome from '@components/icss/tcmdrome/AddTcmdrome.vue';  //中医疾病关联维护--添加关联
+
+import Plan from '@components/icss/plan/Plan.vue';  //关联维护设置
+import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
+import Bill from '@components/icss/bill/Bill.vue';  //开单
+import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
+import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
+import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
+import SonHospital from '@components/icss/sonhospital/SonHospital.vue';  //子医院维护
+
+export default [
+  {
+    path: '/',
+    name: 'login',
+    component: Login,
+  },
+  {
+    //朗通后台
+    path: '/admin',
+    component: HomePage,
+    meta: {
+      requireAuth: true,
+    },
+    children: [
+      { path: 'YXSYK-JTZSWH', component: MedicinePrompt, name: 'MedicinePrompt' }, //医学术语提示信息维护
+      { path: 'LT-YXSYKWH-TJYXSYJTZS', component: AddMedicinePrompt, name: 'AddMedicinePrompt' }, //医学术语提示信息维护添加
+      { path: 'YXSYK-ZDGLWH', component: ChemicalAndCommonMapping, name: 'ChemicalAndCommonMapping', }, //诊断关联维护
+      { path: 'LT-ZDGLWH-TJHYDXXYGBXDY', component: AddChemicalAndCommonMapping, name: 'AddChemicalAndCommonMapping', }, //诊断关联维护--添加关联
+      { path: 'YXSYK-JYGLWH', component: Lis, name: 'Lis' }, //检验关联维护
+      { path: 'LT-JYGLWH-TJHYDXXYGBXDY', component: AddLis, name: 'AddLis' }, //检验关联维护--添加关联
+      { path: 'YXSYK-JCGLWH', component: Pacs, name: 'Pacs' }, //检查关联维护
+      { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
+      { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
+      { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+      { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+      { path: 'LT-YPLBWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
+      { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
+      { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
+      { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护
+      { path: 'LT-SXGLWH-TJHYDXXYGBXDY', component: AddFusion, name: 'AddFusion' }, //输血关联维护--添加关联
+      { path: 'YXSYK-KSGLWH', component: DeptManage, name: 'DeptManage' }, //科室关联维护
+      { path: 'LT-KSGLWH-TJHYDXXYGBXDY', component: AddDept, name: 'AddDept' }, //科室关联维护--添加关联
+      { path: 'YXSYK-HLGLWH', component: Nursing, name: 'Nursing' }, //护理关联维护
+      { path: 'LT-HLGLWH-TJHYDXXYGBXDY', component: AddNursing, name: 'AddNursing' }, //护理关联维护--添加关联
+      { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
+      { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
+      { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
+      { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+      { path: 'YXSYK-MZGLWH', component: Hemp, name: 'Hemp' }, // 麻醉关联维护
+      { path: 'LT-MZGLWH-TJHYDXXYGBXDY', component: AddHemp, name: 'AddHemp' }, // 麻醉关联维护--添加关联
+
+
+
+      { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
+      { path: 'XTPZ-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
+      { path: 'LT-DZBLFAPZ-EDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑
+      { path: 'GZWH-KDHLXGZWH', component: Bill, name: 'Bill' }, //开单
+      { path: 'GZWH-KDHLXGZWH-EDIT', component: AddBill, name: 'AddBill' }, //开单
+      {
+        path: 'GZWH-GZWH',
+        component: ZskRuleManager,
+        name: 'ZskRuleManager',
+      },
+      {
+        path: 'GZWH-GZWH-TJGZ',
+        component: AddZskRule,
+        name: 'AddZskRule',
+      },
+      ,
+      {
+        path: 'XTPZ-ZYYWH',
+        component: SonHospital,
+        name: 'SonHospital',
+      },
+    ],
+  },
+];

+ 400 - 0
src/components/icss/hemp/AddHemp.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="麻醉类型:" prop="searchText">
+                <el-select
+                  style="width:100%;minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入麻醉类型', trigger: 'change' },
+          { max: 80, message: '麻醉类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择麻醉类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 14, //麻醉
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+</style>

+ 674 - 0
src/components/icss/hemp/Hemp.vue

@@ -0,0 +1,674 @@
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医院麻醉名称:">
+          <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="标准麻醉名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'麻醉类型'"
+      :standard="'麻醉类型'"
+      :tip="'麻醉关联'"
+      :type="14"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '输血关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('麻醉列表数据:', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({
+      //   name: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportFusionRecord({ type: 14, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '输血关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 14 }).then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '输血导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<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;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 5 - 0
src/routes.js

@@ -14,6 +14,8 @@ import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联
 import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
 import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
 import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
+import Hemp from '@components/icss/hemp/Hemp.vue'; // 麻醉关联维护
+import AddHemp from '@components/icss/hemp/AddHemp.vue'; // 麻醉关联维护-添加关联
 import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
 import AddFusion from '@components/icss/fusion/AddFusion.vue';  //输血关联维护--添加关联
 import DeptManage from '@components/icss/dept/DeptManage.vue'; //科室关联维护
@@ -72,6 +74,9 @@ export default [
       { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
       { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
       { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+      { path: 'YXSYK-MZGLWH', component: Hemp, name: 'Hemp' }, // 麻醉关联维护
+      { path: 'LT-MZGLWH-TJHYDXXYGBXDY', component: AddHemp, name: 'AddHemp' }, // 麻醉关联维护--添加关联
+
 
 
       { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置