浏览代码

Merge remote-tracking branch 'origin/master' into referMaster

zhouna 3 年之前
父节点
当前提交
2690c11571

+ 1 - 0
.gitignore

@@ -13,6 +13,7 @@ yarn-debug.log*
 yarn-error.log*
 
 # Editor directories and files
+.history
 .idea
 .vscode
 *.suo

+ 548 - 0
.history/src/components/cdssManage/plan/Plan_20211018144152.vue

@@ -0,0 +1,548 @@
+<template>
+  <div>
+    <crumbs title="电子病历方案配置" style="min-width: 980px">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="所属医院:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.hospitalId" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in HospitalInfoList"
+              :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.planName" 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">
+      <el-table :data="list" border style="width: 100%" ref="">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column :resizable="false" prop="hospitalId" label="医院ID" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="hospitalName" label="医院名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="hospitalId" label="医院编码"></el-table-column> -->
+        <el-table-column :resizable="false" prop="planName" label="方案名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="planCode" label="方案编码" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="planDetail" label="模块配置" show-overflow-tooltip></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtCreate"
+          label="创建时间"
+          show-overflow-tooltip
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="planStatus"
+          label="状态"
+          show-overflow-tooltip
+          width="180"
+        >
+          <template slot-scope="scope">{{scope.row.planStatus == 1 ? '已启用': '已禁用'}}</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"
+              v-if="scope.row.planStatus === 1"
+              class="disable"
+            >修改</el-button>
+            <el-button plain type="text" size="small" v-else disabled>修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="codeArr.includes(scope.row.planCode) ? 'active-t': 'active'"
+              :disabled = 'codeArr.includes(scope.row.planCode)'
+              @click="enableOrAble(scope.row,0)"
+              v-if="scope.row.planStatus === 1"
+            >禁用</el-button>
+
+            <el-button type="text" size="small" @click="enableOrAble(scope.row,1)" v-else>启用</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              v-if="scope.row.planStatus !== 1"
+              @click="showDelDialog(scope.row.id,scope.row.planStatus,scope.row.planName,scope.row)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+            <el-button class="deleteBtn" plain type="text" size="small" v-else disabled>删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination">
+        <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>
+  </div>
+</template>
+
+<script>
+import api from "@api/cdss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+
+export default {
+  name: "Plan",
+  data: function() {
+    return {
+      list: [],
+      searched: false,
+      filter: {
+        planName: "", //标准诊断名称
+        hospitalId: ""
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      hospitalId: "",
+      HospitalInfoList: [],
+      disablelist: [],
+      codeArr: []
+    };
+  },
+  created(row) {
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDisabel()
+      that.getDataList();
+      that._getHospitalInfo();
+    });
+    // 非首页 编辑页返回 设置 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: {
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取医院下拉列表
+    _getHospitalInfo() {
+      api.getHospitalInfo().then(res => {
+        if (res.data.code === "0") {
+          this.HospitalInfoList = res.data.data;
+          console.log("医院列表>>", this.HospitalInfoList);
+        }
+      });
+    },
+
+    // 使plan_default禁用
+    async getDisabel(row){
+      const res = await api.getListBack()
+         if(res.data.code === '0'){
+            this.disablelist = res.data.data[60]
+            console.log('禁用2', this.codeArr);
+            this.codeArr = this.disablelist.map(item => {
+              if(item.val == 'plan_default'){
+                return item.val
+              }
+            })
+         }
+    },
+
+
+    // 获取列表数据
+    async getDataList(isTurnPage) {
+
+      let params = await this.getFilterItems(isTurnPage);
+      // return;
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
+      api.getPlanInfoPages(params).then(res => {
+        console.log("列表数据", res);
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+          console.log("hello>>", this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 返回字典信息数据
+
+    // 处理列表请求数据参数
+    async getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      // let planName = this.filter.planName.trim();
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        planName: this.filter.planName.trim(),
+        hospitalId: this.filter.hospitalId
+      };
+      return param;
+    },
+
+    escapeRegExp(text) {
+      return text.replace(/[-[\]{}()*+?._,\\^$|#\s]/g, "\\$&");
+    },
+
+    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: "AddPlan", 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: "AddPlan",
+        params: Object.assign(pam, { isEdit: true, data: item, codeArr: this.codeArr})
+      });
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        planName: ""
+      };
+    },
+
+    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, type) {
+      let showInfo = "启用";
+      let btnNameClass = "confirmBtn2";
+      if (type === "Del") {
+        showInfo = "禁用";
+        btnNameClass = "delBtn";
+      } else if (type === "Del1") {
+        showInfo = "删除";
+        btnNameClass = "delBtn";
+      }
+
+      this.$alert(msg, "提示", {
+        confirmButtonText: showInfo,
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: btnNameClass,
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // // 获取医院信息
+    // _getHospital() {
+    //   api.getHospitalInfo().then(res => {
+    //     if (res.data.code === '0') {
+    //       this.hospitalId = res.data.data.id;
+    //     }
+    //   });
+    // },
+    // 删除关联
+    showDelDialog(id, status, info, row) {
+      if (status === 1) {
+        this.$alert(`${info}正在启用中,无法删除。`, "提示", {
+          confirmButtonText: "确定",
+          // cancelButtonText: '取消',
+          // cancelButtonClass: 'cancelSureL',
+          // confirmButtonClass: 'sureL',
+          // customClass: 'exportBoxL',
+          type: "warning"
+        })
+          .then(() => {})
+          .catch(() => {});
+        return false;
+      }
+
+      if (id === -1) {
+        this.$alert(`该方案为默认方案,无法删除。`, "提示", {
+          confirmButtonText: "确定",
+          // cancelButtonText: '取消',
+          // cancelButtonClass: 'cancelSureL',
+          // confirmButtonClass: 'sureL',
+          // customClass: 'exportBoxL',
+          type: "warning"
+        })
+          .then(() => {})
+          .catch(() => {});
+        return false;
+      }
+      // return
+      this.showConfirmDialog(
+        "是否删除该方案配置?",
+        () => {
+          let params = {
+            planId: id,
+            hospitalId: row.hospitalId
+          };
+          api
+            .cancelPlanDatas(params)
+            .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);
+            });
+        },
+        "Del1"
+      );
+    },
+
+    // 启用/禁用 数据请求
+    sendAbleOrEn(row, type) {
+      api
+        .revStopPlans({
+          id: row.id,
+          status: type
+        })
+        .then(res => {
+          console.log("禁用", res);
+          if (res.data.code === "0") {
+            this.$message({
+              showClose: true,
+              message: "操作成功",
+              type: "success",
+              duration: 1000
+            });
+            this.getDataList();
+          }
+        })
+        .catch(err => {});
+    },
+
+    // 启用/禁用
+    enableOrAble(row, type) {
+      console.log("启用planName", row, type);
+      if (type === 1) {
+        // 启用
+        this.showConfirmDialog(
+          `确定要启用${row.planName}吗?`,
+          () => {
+            this.sendAbleOrEn(row, type);
+          },
+          "Reuse"
+        );
+      } else {
+        // 禁用
+        this.showConfirmDialog(
+          `方案禁用后前端页面将无法正常显示内容,确定要禁用${row.planName}吗?`,
+          () => {
+            this.sendAbleOrEn(row, type);
+          },
+          "Del"
+        );
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import "../../../less/admin.less";
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.disable {
+  border-color: transparent;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/ .delBtn {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+  /deep/ .confirmBtn2 {
+    position: relative;
+    right: 0px !important;
+  }
+}
+.exportBoxL {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    text-align: left;
+  }
+  /deep/ .el-message-box__btns {
+    // text-align: center;
+    margin-bottom: 24px;
+  }
+  /deep/ .leftbtn {
+    margin-right: 46px;
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/ .cancelSureL {
+    // text-align: center;
+    display: none;
+  }
+  /deep/ .sureL {
+    float: right;
+  }
+}
+.contents {
+  .is-plain {
+    color: #dad7d7;
+  }
+  .is-plain:hover {
+    color: #dad7d7;
+  }
+}
+
+.el-table__row {
+  /deep/ .is-disabled {
+    border-color: transparent !important;
+  }
+}
+.selectMedicine {
+  /deep/ .el-input__suffix-inner {
+    position: relative;
+    top: -1px;
+  }
+  /deep/ .el-icon-circle-close {
+    position: relative;
+    top: -2px;
+  }
+}
+
+.el-button.is-disabled[data-v-7f43c814] {
+  color: #dad7d7;
+}
+
+.el-button.is-disabled[data-v-7f43c814]:hover {
+  color: #ff0000;
+}
+
+.contents .is-plain[data-v-7f43c814] {
+  border: none;
+  background-color: transparent;
+}
+
+.contents .is-plain[data-v-7f43c814]:hover {
+  background-color: transparent;
+}
+
+.active {
+  color: #ff0000;
+}
+.active-t {
+  color: #dddddd;
+}
+.active-t:hover {
+  color: #ff0000;
+}
+</style>

+ 548 - 0
.history/src/components/cdssManage/plan/Plan_20211018144621.vue

@@ -0,0 +1,548 @@
+<template>
+  <div>
+    <crumbs title="电子病历方案配置" style="min-width: 980px">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="所属医院:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.hospitalId" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in HospitalInfoList"
+              :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.planName" 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">
+      <el-table :data="list" border style="width: 100%" ref="">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column :resizable="false" prop="hospitalId" label="医院ID" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="hospitalName" label="医院名称" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column :resizable="false" prop="hospitalId" label="医院编码"></el-table-column> -->
+        <el-table-column :resizable="false" prop="planName" label="方案名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="planCode" label="方案编码" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="planDetail" label="模块配置" show-overflow-tooltip></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="gmtCreate"
+          label="创建时间"
+          show-overflow-tooltip
+          width="180"
+        ></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="planStatus"
+          label="状态"
+          show-overflow-tooltip
+          width="180"
+        >
+          <template slot-scope="scope">{{scope.row.planStatus == 1 ? '已启用': '已禁用'}}</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"
+              v-if="scope.row.planStatus === 1"
+              class="disable"
+            >修改</el-button>
+            <el-button plain type="text" size="small" v-else disabled>修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="codeArr.includes(scope.row.planCode) ? 'active-t': 'active'"
+              :disabled = 'codeArr.includes(scope.row.planCode)'
+              @click="enableOrAble(scope.row,0)"
+              v-if="scope.row.planStatus === 1"
+            >禁用</el-button>
+
+            <el-button type="text" size="small" @click="enableOrAble(scope.row,1)" v-else>启用</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              v-if="scope.row.planStatus !== 1"
+              @click="showDelDialog(scope.row.id,scope.row.planStatus,scope.row.planName,scope.row)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+            <el-button class="deleteBtn" plain type="text" size="small" v-else disabled>删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination">
+        <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>
+  </div>
+</template>
+
+<script>
+import api from "@api/cdss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
+
+export default {
+  name: "Plan",
+  data: function() {
+    return {
+      list: [],
+      searched: false,
+      filter: {
+        planName: "", //标准诊断名称
+        hospitalId: ""
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      hospitalId: "",
+      HospitalInfoList: [],
+      disablelist: [],
+      codeArr: []
+    };
+  },
+  created(row) {
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDisabel()
+      that.getDataList();
+      that._getHospitalInfo();
+    });
+    // 非首页 编辑页返回 设置 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: {
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取医院下拉列表
+    _getHospitalInfo() {
+      api.getHospitalInfo().then(res => {
+        if (res.data.code === "0") {
+          this.HospitalInfoList = res.data.data;
+          console.log("医院列表>>", this.HospitalInfoList);
+        }
+      });
+    },
+
+    // 使plan_default禁用
+    async getDisabel(row){
+      const res = await api.getListBack()
+         if(res.data.code === '0'){
+            this.disablelist = res.data.data[60]
+            console.log('禁用2', this.codeArr);
+            this.codeArr = this.disablelist.map(item => {
+              if(item.val == 'plan_default'){
+                return item.val
+              }
+            })
+         }
+    },
+
+
+    // 获取列表数据
+    async getDataList(isTurnPage) {
+
+      let params = await this.getFilterItems(isTurnPage);
+      // return;
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
+      api.getPlanInfoPages(params).then(res => {
+        console.log("列表数据", res);
+        loading.close();
+        if (res.data.code === "0") {
+          this.list = res.data.data && res.data.data.records;
+          console.log("hello>>", this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 返回字典信息数据
+
+    // 处理列表请求数据参数
+    async getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      // let planName = this.filter.planName.trim();
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        planName: this.filter.planName.trim(),
+        hospitalId: this.filter.hospitalId
+      };
+      return param;
+    },
+
+    escapeRegExp(text) {
+      return text.replace(/[-[\]{}()*+?._,\\^$|#\s]/g, "\\$&");
+    },
+
+    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: "AddPlan", 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: "AddPlan",
+        params: Object.assign(pam, { isEdit: true, data: item, codeArr: this.codeArr})
+      });
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: "",
+        planName: ""
+      };
+    },
+
+    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, type) {
+      let showInfo = "启用";
+      let btnNameClass = "confirmBtn2";
+      if (type === "Del") {
+        showInfo = "禁用";
+        btnNameClass = "delBtn";
+      } else if (type === "Del1") {
+        showInfo = "删除";
+        btnNameClass = "delBtn";
+      }
+
+      this.$alert(msg, "提示", {
+        confirmButtonText: showInfo,
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: btnNameClass,
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // // 获取医院信息
+    // _getHospital() {
+    //   api.getHospitalInfo().then(res => {
+    //     if (res.data.code === '0') {
+    //       this.hospitalId = res.data.data.id;
+    //     }
+    //   });
+    // },
+    // 删除关联
+    showDelDialog(id, status, info, row) {
+      if (status === 1) {
+        this.$alert(`${info}正在启用中,无法删除。`, "提示", {
+          confirmButtonText: "确定",
+          // cancelButtonText: '取消',
+          // cancelButtonClass: 'cancelSureL',
+          // confirmButtonClass: 'sureL',
+          // customClass: 'exportBoxL',
+          type: "warning"
+        })
+          .then(() => {})
+          .catch(() => {});
+        return false;
+      }
+
+      if (id === -1) {
+        this.$alert(`该方案为默认方案,无法删除。`, "提示", {
+          confirmButtonText: "确定",
+          // cancelButtonText: '取消',
+          // cancelButtonClass: 'cancelSureL',
+          // confirmButtonClass: 'sureL',
+          // customClass: 'exportBoxL',
+          type: "warning"
+        })
+          .then(() => {})
+          .catch(() => {});
+        return false;
+      }
+      // return
+      this.showConfirmDialog(
+        "是否删除该方案配置?",
+        () => {
+          let params = {
+            planId: id,
+            hospitalId: row.hospitalId
+          };
+          api
+            .cancelPlanDatas(params)
+            .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);
+            });
+        },
+        "Del1"
+      );
+    },
+
+    // 启用/禁用 数据请求
+    sendAbleOrEn(row, type) {
+      api
+        .revStopPlans({
+          id: row.id,
+          status: type
+        })
+        .then(res => {
+          console.log("禁用", res);
+          if (res.data.code === "0") {
+            this.$message({
+              showClose: true,
+              message: "操作成功",
+              type: "success",
+              duration: 1000
+            });
+            this.getDataList();
+          }
+        })
+        .catch(err => {});
+    },
+
+    // 启用/禁用
+    enableOrAble(row, type) {
+      console.log("启用planName", row, type);
+      if (type === 1) {
+        // 启用
+        this.showConfirmDialog(
+          `确定要启用${row.planName}吗?`,
+          () => {
+            this.sendAbleOrEn(row, type);
+          },
+          "Reuse"
+        );
+      } else {
+        // 禁用
+        this.showConfirmDialog(
+          `方案禁用后前端页面将无法正常显示内容,确定要禁用${row.planName}吗?`,
+          () => {
+            this.sendAbleOrEn(row, type);
+          },
+          "Del"
+        );
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import "../../../less/admin.less";
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.disable {
+  border-color: transparent;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/ .delBtn {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+  /deep/ .confirmBtn2 {
+    position: relative;
+    right: 0px !important;
+  }
+}
+.exportBoxL {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    text-align: left;
+  }
+  /deep/ .el-message-box__btns {
+    // text-align: center;
+    margin-bottom: 24px;
+  }
+  /deep/ .leftbtn {
+    margin-right: 46px;
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/ .cancelSureL {
+    // text-align: center;
+    display: none;
+  }
+  /deep/ .sureL {
+    float: right;
+  }
+}
+.contents {
+  .is-plain {
+    color: #dad7d7;
+  }
+  .is-plain:hover {
+    color: #dad7d7;
+  }
+}
+
+.el-table__row {
+  /deep/ .is-disabled {
+    border-color: transparent !important;
+  }
+}
+.selectMedicine {
+  /deep/ .el-input__suffix-inner {
+    position: relative;
+    top: -1px;
+  }
+  /deep/ .el-icon-circle-close {
+    position: relative;
+    top: -2px;
+  }
+}
+
+.el-button.is-disabled[data-v-7f43c814] {
+  color: #dad7d7;
+}
+
+.el-button.is-disabled[data-v-7f43c814]:hover {
+  color: #ff0000;
+}
+
+.contents .is-plain[data-v-7f43c814] {
+  border: none;
+  background-color: transparent;
+}
+
+.contents .is-plain[data-v-7f43c814]:hover {
+  background-color: transparent;
+}
+
+.active {
+  color: #ff0000;
+}
+.active-t {
+  color: #dddddd;
+}
+.active-t:hover {
+  color: #ff0000;
+}
+</style>

+ 1 - 1
src/App.vue

@@ -12,7 +12,7 @@
   import utils from '@api/utils.js';
   import api from './api/user.js';
   import icss from './api/icss.js';
-  document.title='朗通云平台';         //修改标签页标题
+  document.title='朗通云平台'; //修改标签页标题
   export default {
     name: 'app',
     created() {

+ 14 - 2
src/api/cdss.js

@@ -28,8 +28,8 @@ export default {
     //医学数据-化验大小项与公表项维护-单个删除
     return axios.post(urls.delLisMappingByIdCDSS, param);
   },
-  getConceptInfoAssay(param) {
-    return axios.post(urls.getConceptInfoAssayCDSS, param); //化验子项-搜索术语
+  getConceptInfoAssay(param) { //化验子项-搜索术语
+    return axios.post(urls.getConceptInfoAssayCDSS, param); 
   },
   getAllLisConcept(param) {
     //医学数据-化验大小项与公表项维护-获取所有化验公表项
@@ -749,4 +749,16 @@ export default {
     return axios.post(urls.importExcelDataVerify, param);
   },
 
+  getByhospitalInfoId(param) {
+    //获取医院信息
+    return axios.post(urls.getByhospitalInfoId, param);
+  },
+
+  getResetFildF(param) {
+    //数据导入校验
+    return axios.post(urls.getResetFildF, param);
+  },
+  getListBack(param) {    //禁用
+    return axios.post(urls.getListBack, param)
+},
 };

+ 3 - 0
src/api/config.js

@@ -491,8 +491,11 @@ export default {
     'deleteHosRecordCDSS': '/api/cdssman/hospitalInfo/deleteRecord',   //医院信息——删除映射关系
     'getHospitalInfoCDSS': '/api/cdssman/hospitalInfo/getHospitalInfo',   //医院信息——获取医院信息
     'getUserRoleCDSS': '/api/cdssman/userRole/getUserRole',   //医院管理员列表
+    'getResetFildF': '/api/cdssman/sys/plan/addDefaultPlans', // 医院管理-方案重置
     'cancelUserRoleCDSS': '/api/cdssman/userRole/cancelUserRole',   //删除医院管理员
     'addUserRoleCDSS': '/api/cdssman/userRole/addUserRole',   //添加医院管理员
+    'getByhospitalInfoId': '/api/cdssman/hospitalInfo/getById',//获取医院信息
+
 
     'cancelPlanDatasCDSS': '/api/cdssman/plan/cancelPlanDatas',   //删除方案配置信息
     'getPlanInfoIdsCDSS': '/api/cdssman/plan/getPlanInfoIds',   //根据方案id获取配置信息

+ 2 - 1
src/api/icss.js

@@ -436,5 +436,6 @@ export default {
     },
     paramDelete(param) {    //药品删除
         return axios.post(urls.paramDelete, param)
-    },
+    }
+    
 }

+ 289 - 22
src/components/cdssManage/hospital/AddHospital.vue

@@ -8,21 +8,129 @@
     ></crumbs>
     <div class="AddPlanBox">
       <el-row :gutter="20">
-        <el-col :span="16">
+        <el-col :span="24">
           <el-form ref="form" :model="form" label-width="110px" :rules="rules">
-            <el-form-item label="医院名称" prop="hospitalName">
-              <el-input v-model="form.hospitalName" placeholder="2-30位,可输入汉字、字母、数字和下划线" @blur="handlePinyin($event)"></el-input>
-            </el-form-item>
-            <el-form-item label="医院名称拼音" prop="spell">
-              <el-input v-model="form.spell" placeholder="请输入医院名称拼音"></el-input>
-            </el-form-item>
+            <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="医院名称" prop="hospitalName" style="width:100%">
+                  <el-input
+                    v-model="form.hospitalName"
+                    placeholder="2-30位,可输入汉字、字母、数字和下划线"
+                    @blur="handlePinyin($event)"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="12">
+                <el-form-item label="医院名称拼音" prop="spell" style="width:100%">
+                  <el-input v-model="form.spell" placeholder="请输入医院名称拼音"></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+
             <!-- <el-form-item label="医院编码" prop="hospitalCode">
               <el-input v-model="form.hospitalCode" placeholder="4-15位,可输入字母、数字和下划线"></el-input>
-            </el-form-item> -->
-            <el-form-item label="医院地址" prop="address">
-              <el-input type="textarea" :rows="2" v-model="form.address" placeholder="请输入医院地址"></el-input>
+            </el-form-item>-->
+            <el-form-item label="医院地址">
+              <el-input v-model="form.address" placeholder="请输入医院地址" maxlength="100"></el-input>
+            </el-form-item>
+            <p
+              style="text-align: center;padding-bottom: 14px;width: 100%;font-size:16px;font-weight: bold;"
+            >关联子医院</p>
+            <el-form-item>
+              <el-table
+                size="mini"
+                :data="form.hospitalRelationVOList"
+                border
+                :style="form.hospitalRelationVOList.length > 0?'min-height: 200px':'60px'"
+                :height="form.hospitalRelationVOList.length > 0?'calc(100vh - 390px)':'60px'"
+                class="tabs"
+                ref="tableList"
+                :header-row-style="{height:'40px',cursor: 'pointer',fontSize:'14px'}"
+                :row-style="{height:'40px',cursor: 'pointer',fontSize:'14px'}"
+                :header-cell-style="{height:'40px',borderColor:'#DCDFE6',fontSize:'14px'}"
+              >
+                <el-table-column label="序号" type="index" width="80">
+                  <template slot="header" slot-scope="scope">
+                    <span class="name">序号</span>
+                  </template>
+                  <template slot-scope="scope">
+                    <el-form-item>
+                      <i
+                        class="el-icon-warning"
+                        style="color:#e6a23c;margin-right:3px"
+                        v-if="form.hospitalRelationVOList[scope.$index].errorCurrent"
+                      ></i>
+                      <i
+                        class="el-icon-warning"
+                        style="color:#fe6c6f;margin-right:3px"
+                        v-if="form.hospitalRelationVOList[scope.$index].errorOther"
+                      ></i>
+                      <span>{{scope.$index+1}}</span>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column label="医院名称">
+                  <template slot="header" slot-scope="scope">
+                    <span class="star">*</span>
+                    <span class="name">医院名称</span>
+                  </template>
+                  <template slot-scope="scope">
+                    <el-form-item
+                      class="is-request"
+                      :prop="'hospitalRelationVOList.' + scope.$index + '.name'"
+                      :rules="{
+                        required: true,message: '请输入医院名称', trigger: 'blur'
+                      }"
+                    >
+                      <el-input
+                        class="inp-name"
+                        placeholder="请输入医院名称"
+                        maxlength="50"
+                        v-model.trim="form.hospitalRelationVOList[scope.$index].name"
+                      ></el-input>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column label="编码">
+                  <template slot="header" slot-scope="scope">
+                    <span class="star">*</span>
+                    <span class="name">编码</span>
+                  </template>
+                  <template slot-scope="scope">
+                    <el-form-item
+                      :prop="'hospitalRelationVOList.' + scope.$index + '.code'"
+                      :rules="{
+                        required: true,message: '请输入编码', trigger: 'blur'
+                      }"
+                    >
+                      <el-input
+                        class="inp-name"
+                        placeholder="请输入编码"
+                        maxlength="50"
+                        v-model.trim="form.hospitalRelationVOList[scope.$index].code"
+                      ></el-input>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column label="操作" width="150" align="center">
+                  <template slot-scope="scope">
+                    <div class="operation">
+                      <el-button @click="addIndex(scope.$index)" type="text" size="small">
+                        <img src="../../../images/icon-add.png" alt="新增" />
+                      </el-button>
+                      <el-button @click="delIndex(scope.$index)" type="text" size="small">
+                        <img src="../../../images/icon-delete.png" alt="删除" />
+                      </el-button>
+                    </div>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <div class="add" v-if="form.hospitalRelationVOList.length == 0">
+                <!--<el-button icon="el-icon-plus"></el-button>-->
+                <p class="add-border" @click="add"></p>
+              </div>
             </el-form-item>
-
             <el-form-item>
               <el-button type="primary" @click="onSubmit" :disabled="saveDisable">确定</el-button>
             </el-form-item>
@@ -30,6 +138,20 @@
         </el-col>
       </el-row>
     </div>
+    <el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
+      <div class="diag-center">
+        <p class="diag-title">操作失败,请检查“医院名称+医院编码”重复项</p>
+        <p class="title-warning">
+          <i class="el-icon-warning" style="color:#e6a23c"></i>标记为当前父医院的“子医院+子医院编码”重复项
+        </p>
+        <p class="title-warning title-warning-2">
+          <i class="el-icon-warning" style="color:#fe6c6f"></i>标记为与其它父医院的“子医院+子医院编码”重复项
+        </p>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -60,8 +182,10 @@ export default {
         hospitalName: '',
         spell: '',
         // hospitalCode: '',
-        address: ''
+        address: '',
+        hospitalRelationVOList: []
       },
+      tableData: [],
       rules: {
         hospitalName: [
           { required: true, message: '医院名称不能为空', trigger: 'change' },
@@ -73,16 +197,16 @@ export default {
         //   { min: 4, max: 15, message: '长度4-15位', trigger: 'blur' },
         //   { required: true, validator: validatePass1, trigger: 'blur' }
         // ],
-        address:[
-          {  max: 200, message: '长度最多200字', trigger: 'change' },
-        ],
-        spell:[
-          {  max: 30, message: '医院名称拼音长度最多30位', trigger: 'change' },
-        ],
+        address: [{ max: 200, message: '长度最多200字', trigger: 'change' }],
+        spell: [
+          { max: 30, message: '医院名称拼音长度最多30位', trigger: 'change' }
+        ]
       },
       hospitalId: '',
       isEdit: false,
-      saveDisable: false
+      saveDisable: false,
+      dialogVisible: false,
+      list: []
     };
   },
   created() {
@@ -94,10 +218,23 @@ export default {
       // this.form.hospitalCode = data.code;
       this.form.address = data.address;
       this.hospitalId = data.id;
+      this.getByhospitalInfoId(data.id);
     }
   },
 
   methods: {
+    getByhospitalInfoId(id) {
+      api.getByhospitalInfoId({ id: id }).then(res => {
+        if (res.data.code === '0') {
+          const data = res.data.data;
+          data.hospitalRelationDTOList.forEach((item, index) => {
+            item.errorOther = false;
+            item.errorCurrent = false;
+          });
+          this.form.hospitalRelationVOList = data.hospitalRelationDTOList;
+        }
+      });
+    },
     onSubmit() {
       this.$refs.form.validate(valid => {
         if (valid) {
@@ -107,8 +244,13 @@ export default {
             address: this.form.address,
             name: this.form.hospitalName,
             spell: this.form.spell,
+            hospitalRelationVOList: this.form.hospitalRelationVOList
             // code: this.form.hospitalCode
           };
+          this.form.hospitalRelationVOList.forEach((item, index) => {
+            item.errorOther = false;
+            item.errorCurrent = false;
+          });
           if (this.isEdit) {
             params = Object.assign({}, params, {
               id: this.hospitalId
@@ -129,6 +271,19 @@ export default {
                   currentPage: 1
                 })
               });
+            } else if (res.data.code === '20020009') {
+              const data = res.data.data;
+              this.dialogVisible = true;
+              let errorOtherList = [];
+              let errorCurrentList = [];
+              this.getIndex(data.errorOther, errorOtherList);
+              this.getIndex(data.errorCurrent, errorCurrentList);
+              errorOtherList.forEach(i => {
+                this.form.hospitalRelationVOList[i].errorOther = true;
+              });
+              errorCurrentList.forEach(i => {
+                this.form.hospitalRelationVOList[i].errorCurrent = true;
+              });
             } else {
               this.$message({
                 showClose: true,
@@ -139,14 +294,60 @@ export default {
             }
             this.saveDisable = false;
           });
+        } else {
+          this.locateToErr();
+          return false;
         }
       });
     },
-
+    locateToErr() {
+      setTimeout(() => {
+        const errorDiv = document.getElementsByClassName('is-error');
+        errorDiv[0].scrollIntoView();
+      }, 0);
+    },
+    getIndex(data, list) {
+      let hospitalRelationVOList = JSON.parse(
+        JSON.stringify(this.form.hospitalRelationVOList)
+      );
+      hospitalRelationVOList.forEach(it => {
+        delete it.errorOther;
+        delete it.errorCurrent;
+      });
+      hospitalRelationVOList.forEach((item, index) => {
+        data.forEach((it, i) => {
+          if (item.name == it.name && item.code == it.code) {
+            list.push(index);
+          }
+        });
+      });
+    },
     // 处理拼音转换
-    handlePinyin(e){
+    handlePinyin(e) {
       // console.log(e.target.value,'==========');
-      this.form.spell = pinyin.getCamelChars(e.target.value)
+      this.form.spell = pinyin.getCamelChars(e.target.value);
+    },
+    add() {
+      this.form.hospitalRelationVOList.push({
+        name: '',
+        code: '',
+        errorOther: false,
+        errorCurrent: false
+      });
+    },
+    addIndex(i) {
+      this.form.hospitalRelationVOList.splice(i + 1, 0, {
+        name: '',
+        code: '',
+        errorOther: false,
+        errorCurrent: false
+      });
+      this.$nextTick(() => {
+        this.$refs.tableList.bodyWrapper.scrollTop += 55;
+      });
+    },
+    delIndex(i) {
+      this.form.hospitalRelationVOList.splice(i, 1);
     }
   }
 };
@@ -270,4 +471,70 @@ export default {
     border-color: transparent;
   }
 }
+.tabs {
+  max-width: 100%;
+  min-width: 100%;
+  border-bottom:1px solid #dcdfe6;
+  .star {
+    color: #ff545b;
+  }
+  /deep/.el-input__inner {
+    height: 32px;
+    margin-bottom: 18px;
+    font-size: 12px;
+  }
+  /deep/ .is-error .el-form-item__error {
+    top: 34px;
+  }
+  .operation {
+    display: flex;
+    justify-content: center;
+  }
+}
+.add-border {
+  border: 1px #48c5d7 dashed;
+  width: 96%;
+  height: 30px;
+  text-align: center;
+  line-height: 30px;
+  cursor: pointer;
+  background: url('../../../images/add-nob.png') no-repeat center center;
+  background-size: 16px 16px;
+}
+.add {
+  width: 100%;
+  height: 80px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border: 1px solid #ebeef5;
+  border-top: none;
+  box-sizing: border-box;
+}
+.diag-center {
+  text-align: center;
+  .diag-title {
+    font-size: 16px;
+    margin-bottom: 5px;
+    color: #ff545b;
+  }
+  .title-warning {
+    display: block;
+    margin: 10px 0;
+  }
+  .title-warning-2 {
+    padding-left: 13px;
+  }
+}
+.dialog-footer {
+  display: flex;
+  overflow: hidden;
+  justify-content: center;
+}
+/deep/.el-form-item.is-success .el-input__inner,
+.el-form-item.is-success .el-input__inner:focus,
+.el-form-item.is-success .el-textarea__inner,
+.el-form-item.is-success .el-textarea__inner:focus {
+  border-color: #ccc;
+}
 </style>

+ 100 - 55
src/components/cdssManage/hospital/Hospital.vue

@@ -22,12 +22,13 @@
     <div class="contents">
       <el-table :data="list" border style="width: 100%">
         <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
-         <el-table-column :resizable="false" prop="id" label="医院ID"></el-table-column>
+        <el-table-column :resizable="false" prop="id" label="医院ID"></el-table-column>
         <el-table-column :resizable="false" prop="name" label="医院名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="spell" label="医院名称拼音" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="sonHospital" label="关联子医院" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="address" label="医院地址" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           :resizable="false"
           prop="status"
           label="状态"
@@ -35,11 +36,20 @@
           width="180"
         >
           <template slot-scope="scope">{{scope.row.status == 1 ? '已启用': '已禁用'}}</template>
-        </el-table-column>
+        </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="resetFildF(scope.row)"
+              v-if="scope.row.id !== -1"
+              :style="scope.row.id !== -1? 'color: #48c5d7;' : 'color: #bfbfbf;'"
+              type="text"
+              size="small"
+            >方案重置</el-button>
+            <el-button type="text" size="small" v-else disabled>方案重置</el-button>
+            <!-- <span style="margin:0 3px;">|</span>
             <el-button
               @click="startOrEndHos(scope.row,'start')"
               type="text"
@@ -52,7 +62,7 @@
               type="text"
               size="small"
               v-if="scope.row.status === 1"
-            >禁用</el-button>
+            >禁用</el-button> -->
             <span style="margin:0 3px;">|</span>
             <el-button @click="showDelDialog(scope.row)" class="delete" type="text" size="small">删除</el-button>
           </template>
@@ -75,18 +85,18 @@
 </template>
 
 <script>
-import api from '@api/cdss.js';
-import config from '@api/config.js';
-import utils from '@api/utils.js';
+import api from "@api/cdss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
 
 export default {
-  name: 'HospitalCDSS',
+  name: "HospitalCDSS",
   data: function() {
     return {
       list: [],
       searched: false,
       filter: {
-        hospitalName: '' // 医院名称
+        hospitalName: "" // 医院名称
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -137,9 +147,9 @@ export default {
 
     // 启用/禁用医院
     startOrEndHos(row, type) {
-      let msg = '';
+      let msg = "";
       let status = 1;
-      if (type === 'start') {
+      if (type === "start") {
         msg = `确定要启用${row.name}吗?`;
         status = 1;
       } else {
@@ -147,9 +157,9 @@ export default {
         status = 0;
       }
 
-      this.$alert(msg, '提示', {
-        confirmButtonText: '确定',
-        type: 'warning'
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
       })
         .then(() => {
           api
@@ -158,12 +168,12 @@ export default {
               status: status
             })
             .then(res => {
-              if (res.data.code === '0') {
+              if (res.data.code === "0") {
                 this.getDataList();
                 this.$message({
                   showClose: true,
-                  message: '保存成功',
-                  type: 'success',
+                  message: "保存成功",
+                  type: "success",
                   duration: 1000
                 });
               }
@@ -178,13 +188,14 @@ export default {
       this.searched = true;
       const loading = this.$loading({
         lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
       });
       api.getHospitalPageCDSS(params).then(res => {
         loading.close();
-        if (res.data.code === '0') {
+        console.log('数据列表???', res);
+        if (res.data.code === "0") {
           this.list = res.data.data && res.data.data.records;
         }
         this.total = res.data.data && res.data.data.total;
@@ -213,7 +224,7 @@ export default {
     // 获取医院下拉列表
     _getHospitalInfo() {
       api.getHospitalInfo().then(res => {
-        if (res.data.code === '0') {
+        if (res.data.code === "0") {
           this.HospitalInfoList = res.data.data;
         }
       });
@@ -232,7 +243,7 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       this.$router.push({
-        name: 'AddHospitalCDSS',
+        name: "AddHospitalCDSS",
         params: Object.assign(pam, {
           isEdit: false
         })
@@ -249,7 +260,7 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       this.$router.push({
-        name: 'AddHospitalCDSS',
+        name: "AddHospitalCDSS",
         params: Object.assign(pam, {
           isEdit: true,
           data: { ...item }
@@ -264,7 +275,7 @@ export default {
     // 清空搜索参数
     clearFilter() {
       this.filter = {
-        hospitalName: ''
+        hospitalName: ""
       };
     },
 
@@ -278,16 +289,16 @@ export default {
       this.$message({
         showClose: true,
         message: msg,
-        type: type || 'warning'
+        type: type || "warning"
       });
     },
     showConfirmDialog(msg, resolve) {
-      this.$alert(msg, '提示', {
-        confirmButtonText: '删除',
+      this.$alert(msg, "提示", {
+        confirmButtonText: "删除",
         // cancelButtonText: '取消',
         // cancelButtonClass: 'cancelBtn',
         // confirmButtonClass: 'confirmC',
-        type: 'warning'
+        type: "warning"
       })
         .then(() => {
           resolve();
@@ -296,36 +307,70 @@ export default {
     },
     // 删除关联
     showDelDialog(row) {
-      // console.log(row); return 
-      this.showConfirmDialog(`医院删除后无法恢复,确定要删除${row.name}吗?`, () => {
-        api
-          .deleteHosRecordCDSS({ id: row.id })
-          .then(res => {
-            // console.log(res, '=============');
-            if (res.data.code == '0') {
-              if (!this.searched) {
-                //未点确认时清空搜索条件
-                this.clearFilter();
+      // console.log(row); return
+      this.showConfirmDialog(
+        `医院删除后无法恢复,确定要删除${row.name}吗?`,
+        () => {
+          api
+            .deleteHosRecordCDSS({ id: row.id })
+            .then(res => {
+              // console.log(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._getHospitalInfo(); // 更新下拉列表
+                this.warning(res.data.msg || "操作成功", "success");
+              } else {
+                this.warning(res.data.msg);
               }
-              if (this.list.length == 1) {
-                //当前在最后一页且只有一条数据时,删除后跳到前一页
-                this.currentPage =
-                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+            })
+            .catch(error => {
+              if (error.code === "900010001") {
+                return false;
               }
+              this.warning(error);
+            });
+        }
+      );
+    },
+    // 方案重置
+    resetFildF(row) {
+      this.$confirm(`此操作将重置${row.name}数据, 是否继续?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          api.getResetFildF({
+            hospitalId: row.id
+          }).then(res => {
+            console.log("重置数据", res);
+            const tokenStr = JSON.parse(localStorage.getItem("token"));
+            if (res.data.code === "0" && tokenStr) {
               this.getDataList();
-              this._getHospitalInfo();  // 更新下拉列表
-              this.warning(res.data.msg || '操作成功', 'success');
-            } else {
-              this.warning(res.data.msg);
+              this.$message({
+                showClose: true,
+                message: "重置成功",
+                type: "success",
+                duration: 1000
+              });
             }
-          })
-          .catch(error => {
-            if (error.code === '900010001') {
-              return false;
-            }
-            this.warning(error);
           });
-      });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消重置"
+          });
+        });
     }
   }
 };
@@ -333,7 +378,7 @@ export default {
 
 
 <style lang="less" scoped>
-@import '../../../less/admin.less';
+@import "../../../less/admin.less";
 .delete {
   color: red;
 }

+ 9 - 3
src/components/cdssManage/plan/AddPlan.vue

@@ -158,12 +158,14 @@
               <el-input
                 v-model="form.planName"
                 placeholder="2-30位,可输入汉字、字母、数字和下划线"
+                :disabled="needDisable"
               ></el-input>
             </el-form-item>
             <el-form-item label="方案编码" prop="planCode">
               <el-input
                 v-model="form.planCode"
                 placeholder="可输入字母、数字和下划线"
+                :disabled="needDisable"
               ></el-input>
             </el-form-item>
             <el-form-item label="方案配置">
@@ -380,6 +382,8 @@ export default {
       downActive: null,
       isEdit: false,
       hospitalId: null,
+      planCode:'',
+      needDisable:false,
       form: {
         hospitalId: "",
         planName: "",
@@ -392,7 +396,7 @@ export default {
         planName: [
           { required: true, message: "方案名称不能为空", trigger: "change" },
           { min: 2, max: 30, message: "长度2-30位", trigger: "blur" },
-          { required: true, validator: validatePass, trigger: "blur" }
+          // { required: true, validator: validatePass, trigger: "blur" }
         ],
         hospitalId: [
           { required: true, message: "医院名称不能为空", trigger: "change" }
@@ -652,12 +656,14 @@ export default {
   created() {
     // this.getHospitalInfo();
     // this.getDefaultPlans();
-    const { isEdit, data } = this.$route.params;
+    const { isEdit, data, needDisable } = this.$route.params;
+    this.needDisable = needDisable;
     this.getHospitalInfo(); // 获取医院下拉列表
     if (isEdit) {
       // 编辑页面
       this.isEdit = true;
-
+      this.hospitalId = data.hospitalId
+      this.planCode = data.planCode
       let params = {
         hospitalId: data.hospitalId,
         id: data.id

+ 85 - 54
src/components/cdssManage/plan/Plan.vue

@@ -22,7 +22,7 @@
       </el-form>
     </crumbs>
     <div class="contents">
-      <el-table :data="list" border style="width: 100%">
+      <el-table :data="list" border style="width: 100%" ref="">
         <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
         <el-table-column :resizable="false" prop="hospitalId" label="医院ID" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="hospitalName" label="医院名称" show-overflow-tooltip></el-table-column>
@@ -56,15 +56,17 @@
               v-if="scope.row.planStatus === 1"
               class="disable"
             >修改</el-button>
-            <el-button plain type="text" size="small" v-else disabled>修改</el-button>
+            <el-button type="text" size="small" v-else disabled>修改</el-button>
             <span style="margin:0 3px;">|</span>
             <el-button
               type="text"
               size="small"
-              class="delete"
+              :class="scope.row.hospitalId===-1&&codeArr.includes(scope.row.planCode) ? 'active-t': 'delete'"
+              :disabled = 'scope.row.hospitalId===-1&&codeArr.includes(scope.row.planCode)'
               @click="enableOrAble(scope.row,0)"
               v-if="scope.row.planStatus === 1"
             >禁用</el-button>
+
             <el-button type="text" size="small" @click="enableOrAble(scope.row,1)" v-else>启用</el-button>
             <span style="margin:0 3px;">|</span>
             <el-button
@@ -74,7 +76,7 @@
               type="text"
               size="small"
             >删除</el-button>
-            <el-button plain type="text" size="small" v-else disabled>删除</el-button>
+            <el-button type="text" size="small" v-else disabled>删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -95,33 +97,36 @@
 </template>
 
 <script>
-import api from '@api/cdss.js';
-import config from '@api/config.js';
-import utils from '@api/utils.js';
+import api from "@api/cdss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
 
 export default {
-  name: 'Plan',
+  name: "Plan",
   data: function() {
     return {
       list: [],
       searched: false,
       filter: {
-        planName: '', //标准诊断名称
-        hospitalId: ''
+        planName: "", //标准诊断名称
+        hospitalId: ""
       },
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
       pageLayout: config.pageLayout,
       total: 0,
-      hospitalId: '',
-      HospitalInfoList: []
+      hospitalId: "",
+      HospitalInfoList: [],
+      disablelist: [],
+      codeArr: []
     };
   },
-  created() {
+  created(row) {
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
+      that.getDisabel()
       that.getDataList();
       that._getHospitalInfo();
     });
@@ -159,27 +164,46 @@ export default {
     // 获取医院下拉列表
     _getHospitalInfo() {
       api.getHospitalInfo().then(res => {
-        if (res.data.code === '0') {
+        if (res.data.code === "0") {
           this.HospitalInfoList = res.data.data;
+          console.log("医院列表>>", this.HospitalInfoList);
         }
       });
     },
 
+    // 使plan_default禁用
+    async getDisabel(row){
+      const res = await api.getListBack()
+         if(res.data.code === '0'){
+            this.disablelist = res.data.data[60]
+            console.log('禁用2', this.codeArr);
+            this.codeArr = this.disablelist.map(item => {
+                return item.val
+            })
+            console.log('禁用2021', this.codeArr);
+
+         }
+    },
+
+
     // 获取列表数据
     async getDataList(isTurnPage) {
+
       let params = await this.getFilterItems(isTurnPage);
       // return;
       this.searched = true;
       const loading = this.$loading({
         lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
       });
       api.getPlanInfoPages(params).then(res => {
+        console.log("列表数据", res);
         loading.close();
-        if (res.data.code === '0') {
+        if (res.data.code === "0") {
           this.list = res.data.data && res.data.data.records;
+          console.log("hello>>", this.list);
         }
         this.total = res.data.data && res.data.data.total;
         if (this.inCurrentPage !== undefined) {
@@ -189,6 +213,8 @@ export default {
       });
     },
 
+    // 返回字典信息数据
+
     // 处理列表请求数据参数
     async getFilterItems(isTurnPage) {
       //翻页时筛选条件没点确定则清空
@@ -206,7 +232,7 @@ export default {
     },
 
     escapeRegExp(text) {
-      return text.replace(/[-[\]{}()*+?._,\\^$|#\s]/g, '\\$&');
+      return text.replace(/[-[\]{}()*+?._,\\^$|#\s]/g, "\\$&");
     },
 
     filterDatas() {
@@ -221,7 +247,7 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      this.$router.push({ name: 'AddPlan', params: pam });
+      this.$router.push({ name: "AddPlan", params: pam });
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -234,8 +260,8 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       this.$router.push({
-        name: 'AddPlan',
-        params: Object.assign(pam, { isEdit: true, data: item })
+        name: "AddPlan",
+        params: Object.assign(pam, { isEdit: true, data: item, needDisable: row.hospitalId===-1&&this.codeArr.includes(row.planCode)})
       });
     },
     currentChange(next) {
@@ -250,8 +276,8 @@ export default {
     // 清空搜索参数
     clearFilter() {
       this.filter = {
-        hisName: '',
-        planName: ''
+        hisName: "",
+        planName: ""
       };
     },
 
@@ -265,26 +291,26 @@ export default {
       this.$message({
         showClose: true,
         message: msg,
-        type: type || 'warning'
+        type: type || "warning"
       });
     },
     showConfirmDialog(msg, resolve, type) {
-      let showInfo = '启用';
-      let btnNameClass = 'confirmBtn2';
-      if (type === 'Del') {
-        showInfo = '禁用';
-        btnNameClass = 'delBtn';
-      } else if (type === 'Del1') {
-        showInfo = '删除';
-        btnNameClass = 'delBtn';
+      let showInfo = "启用";
+      let btnNameClass = "confirmBtn2";
+      if (type === "Del") {
+        showInfo = "禁用";
+        btnNameClass = "delBtn";
+      } else if (type === "Del1") {
+        showInfo = "删除";
+        btnNameClass = "delBtn";
       }
 
-      this.$alert(msg, '提示', {
+      this.$alert(msg, "提示", {
         confirmButtonText: showInfo,
         // cancelButtonText: '取消',
         // cancelButtonClass: 'cancelBtn',
         // confirmButtonClass: btnNameClass,
-        type: 'warning'
+        type: "warning"
       })
         .then(() => {
           resolve();
@@ -302,13 +328,13 @@ export default {
     // 删除关联
     showDelDialog(id, status, info, row) {
       if (status === 1) {
-        this.$alert(`${info}正在启用中,无法删除。`, '提示', {
-          confirmButtonText: '确定',
+        this.$alert(`${info}正在启用中,无法删除。`, "提示", {
+          confirmButtonText: "确定",
           // cancelButtonText: '取消',
           // cancelButtonClass: 'cancelSureL',
           // confirmButtonClass: 'sureL',
           // customClass: 'exportBoxL',
-          type: 'warning'
+          type: "warning"
         })
           .then(() => {})
           .catch(() => {});
@@ -316,13 +342,13 @@ export default {
       }
 
       if (id === -1) {
-        this.$alert(`该方案为默认方案,无法删除。`, '提示', {
-          confirmButtonText: '确定',
+        this.$alert(`该方案为默认方案,无法删除。`, "提示", {
+          confirmButtonText: "确定",
           // cancelButtonText: '取消',
           // cancelButtonClass: 'cancelSureL',
           // confirmButtonClass: 'sureL',
           // customClass: 'exportBoxL',
-          type: 'warning'
+          type: "warning"
         })
           .then(() => {})
           .catch(() => {});
@@ -330,7 +356,7 @@ export default {
       }
       // return
       this.showConfirmDialog(
-        '是否删除该方案配置?',
+        "是否删除该方案配置?",
         () => {
           let params = {
             planId: id,
@@ -339,7 +365,7 @@ export default {
           api
             .cancelPlanDatas(params)
             .then(res => {
-              if (res.data.code == '0') {
+              if (res.data.code == "0") {
                 if (!this.searched) {
                   //未点确认时清空搜索条件
                   this.clearFilter();
@@ -350,19 +376,19 @@ export default {
                     this.currentPage === 1 ? 1 : this.currentPage - 1;
                 }
                 this.getDataList();
-                this.warning(res.data.msg || '操作成功', 'success');
+                this.warning(res.data.msg || "操作成功", "success");
               } else {
                 this.warning(res.data.msg);
               }
             })
             .catch(error => {
-              if (error.code === '900010001') {
+              if (error.code === "900010001") {
                 return false;
               }
               this.warning(error);
             });
         },
-        'Del1'
+        "Del1"
       );
     },
 
@@ -374,11 +400,12 @@ export default {
           status: type
         })
         .then(res => {
-          if (res.data.code === '0') {
+          console.log("禁用", res);
+          if (res.data.code === "0") {
             this.$message({
               showClose: true,
-              message: '操作成功',
-              type: 'success',
+              message: "操作成功",
+              type: "success",
               duration: 1000
             });
             this.getDataList();
@@ -389,7 +416,7 @@ export default {
 
     // 启用/禁用
     enableOrAble(row, type) {
-      // console.log('启用planName', row, type);
+      console.log("启用planName", row, type);
       if (type === 1) {
         // 启用
         this.showConfirmDialog(
@@ -397,7 +424,7 @@ export default {
           () => {
             this.sendAbleOrEn(row, type);
           },
-          'Reuse'
+          "Reuse"
         );
       } else {
         // 禁用
@@ -406,7 +433,7 @@ export default {
           () => {
             this.sendAbleOrEn(row, type);
           },
-          'Del'
+          "Del"
         );
       }
     }
@@ -416,7 +443,7 @@ export default {
 
 
 <style lang="less" scoped>
-@import '../../../less/admin.less';
+@import "../../../less/admin.less";
 .delete {
   color: red;
 }
@@ -477,7 +504,7 @@ export default {
 }
 
 .el-table__row {
-  /deep/ .is-disabled {
+  /deep/ .is-disabled,.el-button.is-disabled.is-plain {
     border-color: transparent !important;
   }
 }
@@ -491,4 +518,8 @@ export default {
     top: -2px;
   }
 }
+
+/deep/.el-button.is-disabled.active-t {
+  color: #dad7d7;
+}
 </style>

+ 1 - 0
src/components/login/Login.vue

@@ -157,6 +157,7 @@
         this.$refs.ruleFormReg.validate((valid) => {
           if (valid) {
             api.loginMess(params).then((res) => {
+              console.log('登录???', res);
               if (res.status == 200) {
 								// console.log(res)
                 if (res.data.code == '10020000') { //未注册

二进制
src/images/add-no.png


二进制
src/images/add-nob.png