morphone1995 4 anos atrás
pai
commit
fa18639d15

+ 27 - 0
src/api/cdss.js

@@ -274,4 +274,31 @@ export default {
   getHospitalPageCDSS(param) {
     return axios.post(urls.getHospitalPageCDSS, param);
   },
+  saveOrUpdateHosRecordCDSS(param) {
+    return axios.post(urls.saveOrUpdateHosRecordCDSS, param);
+  },
+  deleteHosRecordCDSS(param) {
+    return axios.post(urls.deleteHosRecordCDSS, param);
+  },
+  getUserRoleCDSS(param) {
+    return axios.post(urls.getUserRoleCDSS, param);
+  },
+  cancelUserRoleCDSS(param) {
+    return axios.post(urls.cancelUserRoleCDSS, param);
+  },
+  addUserRoleCDSS(param) {
+    return axios.post(urls.addUserRoleCDSS, param);
+  },
+  getVersionInfoAllsCDSS(param) {
+    return axios.post(urls.getVersionInfoAllsCDSS, param);
+  },
+  saveVersionInfoAllsCDSS(param) {
+    return axios.post(urls.saveVersionInfoAllsCDSS, param);
+  },
+  cancelVersionInfoAllsCDSS(param) {
+    return axios.post(urls.cancelVersionInfoAllsCDSS, param);
+  },
+  updateVersionInfoAllsCDSS(param) {
+    return axios.post(urls.updateVersionInfoAllsCDSS, param);
+  },
 };

+ 14 - 10
src/api/config.js

@@ -422,18 +422,17 @@ export default {
     'exportDeptRecordCDSS': '/api/cdssman/tran/deptConfig/exportExcel',   //科室-数据导出
     'importDeptRecordCDSS': '/api/cdssman/tran/deptConfig/importExcel',   //科室-数据导入
     'exportDeptModuleCDSS': '/api/cdssman/tran/deptConfig/exportExcelModule',   //科室-数据导入模板导出
-
-
-
-    
-
-
-    // 'getHospitalInfoCDSS': '/api/cdssman/tran/hospitalInfo/getHospitalInfo',   //医院信息——获取医院信息
+   
     // 'saveHospitalInfoRecordCDSS': '/api/cdssman/tran/hospitalInfo/saveRecord',   //医院信息——修改医院信息
 
     'modifyConnectStatusCDSS': '/api/cdssman/hospitalInfo/modifyConnectStatus',   //医院信息——修改医院信息 
     'getHospitalPageCDSS': '/api/cdssman/hospitalInfo/getPage',   //医院信息——分页查询
-    // 'saveHospitalInfoRecordCDSS': '/api/cdssman/hospitalInfo/saveOrUpdateRecord',   //医院信息——保存或修改映射关系
+    'saveOrUpdateHosRecordCDSS': '/api/cdssman/hospitalInfo/saveOrUpdateRecord',   //医院信息——保存或修改映射关系
+    'deleteHosRecordCDSS': '/api/cdssman/hospitalInfo/deleteRecord',   //医院信息——删除映射关系
+    'getHospitalInfoCDSS': '/api/cdssman/hospitalInfo/getHospitalInfo',   //医院信息——获取医院信息
+    'getUserRoleCDSS': '/api/cdssman/userRole/getUserRole',   //医院管理员列表
+    'cancelUserRoleCDSS': '/api/cdssman/userRole/cancelUserRole',   //删除医院管理员
+    'addUserRoleCDSS': '/api/cdssman/userRole/addUserRole',   //添加医院管理员
 
 
     'cancelPlanDatasCDSS': '/api/cdssman/plan/cancelPlanDatas',   //删除方案配置信息
@@ -444,6 +443,11 @@ export default {
     'revStopPlansCDSS': '/api/cdssman/plan/revStopPlans',   //停用启用方案配置
     'savePlanInfoDatasCDSS': '/api/cdssman/plan/savePlanInfoDatas',   //保存更新方案配置信息
 
+    'getVersionInfoAllsCDSS': '/api/cdssman/versionInfo/getVersionInfoAlls',   //获取版本信息
+    'saveVersionInfoAllsCDSS': '/api/cdssman/versionInfo/saveVersionInfoAlls',   //保存版本信息
+    'cancelVersionInfoAllsCDSS': '/api/cdssman/versionInfo/cancelVersionInfoAlls',   //删除版本信息
+    'updateVersionInfoAllsCDSS': '/api/cdssman/versionInfo/updateVersionInfoAlls',   //更新版本信息
+
 
   },
   menuIconList: { //菜单对应图标
@@ -527,11 +531,11 @@ export default {
       "name": "药品",
       "key": 2
     },
-  
+
     {
       "name": "检查子项",
       "key": 6
-    }, 
+    },
     {
       "name": "手术和操作",
       "key": 7

+ 68 - 11
src/components/cdssManage/hospital/AddHospital.vue

@@ -9,15 +9,15 @@
     <div class="AddPlanBox">
       <el-row :gutter="20">
         <el-col :span="16">
-          <el-form ref="form" :model="form" label-width="80px" :rules="rules">
-            <el-form-item label="医院名称" prop="hoipitalName">
-              <el-input v-model="form.hoipitalName" placeholder="2-30位,可输入汉字、字母、数字和下划线"></el-input>
+          <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位,可输入汉字、字母、数字和下划线"></el-input>
             </el-form-item>
             <el-form-item label="医院名称拼音">
               <el-input v-model="form.spell" placeholder="请输入医院名称拼音"></el-input>
             </el-form-item>
-            <el-form-item label="医院编码" prop="hoipitalCode">
-              <el-input v-model="form.hoipitalCode" placeholder="4-15位,可输入字母、数字和下划线"></el-input>
+            <el-form-item label="医院编码" prop="hospitalCode">
+              <el-input v-model="form.hospitalCode" placeholder="4-15位,可输入字母、数字和下划线"></el-input>
             </el-form-item>
             <el-form-item label="医院地址">
               <el-input type="textarea" :rows="2" v-model="form.address" placeholder="请输入医院地址"></el-input>
@@ -34,6 +34,7 @@
 </template>
 
 <script>
+import api from '@api/cdss.js';
 export default {
   name: 'AddHospital',
   data() {
@@ -55,30 +56,86 @@ export default {
     };
     return {
       form: {
-        hoipitalName: '',
+        hospitalName: '',
         spell: '',
-        hoipitalCode: '',
+        hospitalCode: '',
         address: ''
       },
       rules: {
-        hoipitalName: [
+        hospitalName: [
           { required: true, message: '医院名称不能为空', trigger: 'change' },
           { min: 2, max: 30, message: '长度2-30位', trigger: 'blur' },
           { required: true, validator: validatePass, trigger: 'blur' }
         ],
-        hoipitalCode: [
+        hospitalCode: [
           { required: true, message: '医院编码不能为空', trigger: 'change' },
           { min: 2, max: 30, message: '长度4-15位', trigger: 'blur' },
           { required: true, validator: validatePass1, trigger: 'blur' }
         ]
       },
+      hospitalId: '',
       isEdit: false,
       saveDisable: false
     };
   },
-  
+  created() {
+    const { isEdit, data } = this.$route.params;
+    console.log(this.$route.params, '11111111');
+    this.isEdit = isEdit;
+    if (isEdit) {
+      this.form.hospitalName = data.name;
+      this.form.spell = data.spell;
+      this.form.hospitalCode = data.code;
+      this.form.address = data.address;
+      this.hospitalId = data.id;
+    }
+  },
+
   methods: {
-    onSubmit() {}
+    onSubmit() {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          this.saveDisable = true;
+          let params = {
+            connect: 1,
+            address: this.form.address,
+            name: this.form.hospitalName,
+            spell: this.form.spell,
+            code: this.form.hospitalCode
+          };
+          if (this.isEdit) {
+            params = Object.assign({}, params, {
+              id: this.hospitalId
+            });
+          }
+          api.saveOrUpdateHosRecordCDSS(params).then(res => {
+            if (res.data.code === '0') {
+              this.$message({
+                showClose: true,
+                message: '保存成功',
+                type: 'success',
+                duration: 1000
+              });
+              this.isSaveSuccess = true; // 保存成功,可正常退出
+              this.$router.push({
+                name: 'HospitalCDSS',
+                params: Object.assign({}, this.$route.params, {
+                  currentPage: 1
+                })
+              });
+            } else {
+              this.$message({
+                showClose: true,
+                message: res.data.msg,
+                type: 'error',
+                duration: 1000
+              });
+            }
+            this.saveDisable = false;
+          });
+        }
+      });
+    }
   }
 };
 </script>

+ 28 - 12
src/components/cdssManage/hospital/Hospital.vue

@@ -2,8 +2,16 @@
   <div>
     <crumbs title="医院管理" linkTo="MedicalTermCDSS" style="min-width: 1300px">
       <el-form :inline="true" class="demo-form-inline">
-        <el-form-item label="医院名称:">
-          <el-input size="mini" v-model="filter.hospitalName" placeholder="请输入" clearable></el-input>
+
+        <el-form-item label="医院名称:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.hospitalName" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in HospitalInfoList"
+              :label="item.name"
+              :value="item.name"
+              :key="item.id"
+            ></el-option>
+          </el-select>
         </el-form-item>
 
         <el-form-item class="dododo">
@@ -24,12 +32,7 @@
           <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>
+            <el-button @click="showDelDialog(scope.row)" class="delete" type="text" size="small">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -67,7 +70,8 @@ export default {
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
       pageLayout: config.pageLayout,
-      total: 0
+      total: 0,
+      HospitalInfoList: []
     };
   },
   created() {
@@ -80,6 +84,8 @@ export default {
     if (Object.keys(this.$route.params).length !== 0) {
       this.currentPage = this.$route.params.currentPage;
     }
+
+    this._getHospitalInfo();
   },
   watch: {
     filter: {
@@ -146,6 +152,15 @@ export default {
       return param;
     },
 
+    // 获取医院下拉列表
+    _getHospitalInfo() {
+      api.getHospitalInfo().then(res => {
+        if (res.data.code === '0') {
+          this.HospitalInfoList = res.data.data;
+        }
+      });
+    },
+
     filterDatas() {
       this.currentPage = 1;
       this.getDataList();
@@ -191,7 +206,7 @@ export default {
     // 清空搜索参数
     clearFilter() {
       this.filter = {
-        hospitaiName: ''
+        hospitalName: ''
       };
     },
 
@@ -222,11 +237,12 @@ export default {
         .catch(() => {});
     },
     // 删除关联
-    showDelDialog(id) {
+    showDelDialog(row) {
       this.showConfirmDialog('是否删除该关联?', () => {
         api
-          .deleteDrugRecord({ id: id })
+          .deleteHosRecordCDSS({ id: row.id })
           .then(res => {
+            console.log(res, '=============');
             if (res.data.code == '0') {
               if (!this.searched) {
                 //未点确认时清空搜索条件

+ 245 - 4
src/components/cdssManage/hospitalUser/AddHospitalUser.vue

@@ -1,13 +1,254 @@
 <template>
-  <div>vue</div>
+  <div class="AddPlanWrapper clearfix">
+    <crumbs title="医院用户管理-添加用户" class="topBack" :param="$route.params" linkTo="HospitalUserCDSS"></crumbs>
+    <div class="AddPlanBox">
+      <el-row :gutter="20">
+        <el-col :span="16">
+          <el-form ref="form" :model="form" label-width="110px" :rules="rules">
+            <el-form-item label="所属医院:" class="selectMedicine">
+              <el-select v-model="form.hospitalId" placeholder="请选择" clearable style="width: 100%">
+                <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="用户名" prop="userName">
+              <el-input v-model="form.userName" placeholder="用作登录,6-20位,可输入字母、数字和符号"></el-input>
+            </el-form-item>
+
+            <el-form-item label="联系人姓名">
+              <el-input v-model="form.linkman" placeholder="请输入"></el-input>
+            </el-form-item>
+
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit" :disabled="saveDisable">确定</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
 </template>
 
 <script>
+import api from '@api/cdss.js';
 export default {
+  name: 'AddHospitalUserCDSS',
+  data() {
+    var numreg = /^[a-zA-Z0-9_\u4e00-\u9fa5]+$/;
+    var numreg1 = /^[0-9a-zA-Z_]{1,}$/;
+    var validatePass = (rule, value, callback) => {
+      if (!numreg.test(value)) {
+        callback(new Error('汉字、字母、数字和下划线'));
+      } else {
+        callback();
+      }
+    };
+    var validatePass1 = (rule, value, callback) => {
+      if (!numreg1.test(value)) {
+        callback(new Error('字母、数字和下划线'));
+      } else {
+        callback();
+      }
+    };
+    return {
+      form: {
+        hospitalId: '',
+        userName: '',
+        linkman: ''
+      },
+      rules: {
+        userName: [
+          { required: true, message: '用户名不能为空', trigger: 'change' },
+          { min: 6, max: 20, message: '长度6-20位', trigger: 'blur' },
+          { required: true, validator: validatePass, trigger: 'blur' }
+        ]
+        // hospitalCode: [
+        //   { required: true, message: '医院编码不能为空', trigger: 'change' },
+        //   { min: 2, max: 30, message: '长度4-15位', trigger: 'blur' },
+        //   { required: true, validator: validatePass1, trigger: 'blur' }
+        // ]
+      },
 
-}
-</script>
+      saveDisable: false,
+      HospitalInfoList: []
+    };
+  },
+  created() {
+    this._getHospitalInfo();
+  },
+
+  methods: {
+    onSubmit() {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          this.saveDisable = true;
+          let params = {
+            hospitalId: this.form.hospitalId,
+            linkman: this.form.linkman,
+            username: this.form.userName
+          };
 
-<style>
+          api.addUserRoleCDSS(params).then(res => {
+            if (res.data.code === '0') {
+              this.$message({
+                showClose: true,
+                message: '保存成功',
+                type: 'success',
+                duration: 1000
+              });
+              this.isSaveSuccess = true; // 保存成功,可正常退出
+              this.$router.push({
+                name: 'HospitalUserCDSS',
+                params: Object.assign({}, this.$route.params, {
+                  currentPage: 1
+                })
+              });
+            } else {
+              this.$message({
+                showClose: true,
+                message: res.data.msg,
+                type: 'error',
+                duration: 1000
+              });
+            }
+            this.saveDisable = false;
+          });
+        }
+      });
+    },
 
+    // 获取医院下拉列表
+    _getHospitalInfo() {
+      api.getHospitalInfo().then(res => {
+        if (res.data.code === '0') {
+          this.HospitalInfoList = res.data.data;
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.AddPlanWrapper {
+  min-width: 940px;
+  .AddPlanBox {
+    padding: 20px 60px 120px 60px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .title {
+    background-color: #f2f2f2;
+    display: flex;
+    .handleIcon {
+      width: 30px;
+      cursor: pointer;
+      height: 40px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      img {
+        width: 20px;
+        height: 20px;
+      }
+      .open {
+        transform: rotate(180deg);
+      }
+      .close {
+        transform: rotate(0deg);
+      }
+    }
+    .titlwSwitch {
+      width: 120px;
+    }
+    h4 {
+      flex: 1;
+    }
+    .titlwSwitchStatus {
+      margin-left: 16px;
+    }
+  }
+  .sub {
+    .planItem {
+      display: flex;
+      .sort {
+        width: 60px;
+        display: flex;
+        .top {
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          width: 30px;
+          cursor: pointer;
+          img {
+            width: 10px;
+            height: 14px;
+          }
+        }
+        .down {
+          width: 30px;
+          cursor: pointer;
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          img {
+            width: 10px;
+            height: 14px;
+          }
+        }
+      }
+      .openOrClose {
+        display: flex;
+        flex: 1;
+        .planInfo {
+          width: 140px;
+        }
+        .switch {
+        }
+        .planStatus {
+          margin-left: 16px;
+        }
+      }
+      .showNum {
+        display: flex;
+        width: 160px;
+        /deep/.el-input--small {
+          width: 60px;
+        }
+      }
+    }
+  }
+  .el-button {
+    float: right;
+  }
+  .plus-icon-enter-active {
+    transition: all 0.8s;
+  }
+  .plus-icon-enter {
+    opacity: 0;
+    margin-top: 12px;
+  }
+  .plus-icon-leave-active {
+    transition: all 0.8s;
+  }
+  .plus-icon-leave-active {
+    opacity: 0;
+    margin-top: 12px;
+  }
+}
+.leaveBox {
+  /deep/ .leaveBtn {
+    // margin-right: 46px;
+    background-color: #d7d7d7 !important;
+    border-color: transparent;
+  }
+}
 </style>

+ 330 - 3
src/components/cdssManage/hospitalUser/HospitalUser.vue

@@ -1,13 +1,340 @@
 <template>
-  <div>vue</div>
+  <div>
+    <crumbs title="医院管理" linkTo="MedicalTermCDSS" style="min-width: 1300px">
+      <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 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>
+    </crumbs>
+    <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="gmModified" label="操作时间" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="modifier" label="操作人" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hospitalName" label="所属医院" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="username" label="用户名" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="linkman" label="联系人姓名" show-overflow-tooltip></el-table-column>
+        <el-table-column
+          :resizable="false"
+          prop="planStatus"
+          label="状态"
+          show-overflow-tooltip
+          width="180"
+        >
+          <template slot-scope="scope">{{scope.row.status == 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">修改</el-button>
+            <span style="margin:0 3px;">|</span>-->
+            <el-button @click="showDelDialog(scope.row)" 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>
+  </div>
 </template>
 
 <script>
+import api from '@api/cdss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
 export default {
+  name: 'HospitalUserCDSS',
+  data: function() {
+    return {
+      list: [],
+      searched: false,
+      filter: {
+        hospitalId: '' // 医院id
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      HospitalInfoList: []
+    };
+  },
+  created() {
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+    this._getHospitalInfo();
+  },
+  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();
+    },
 
-}
+    // 获取列表数据
+    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.getUserRoleCDSS(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;
+        }
+      });
+    },
+
+    // 获取医院下拉列表
+    _getHospitalInfo() {
+      api.getHospitalInfo().then(res => {
+        if (res.data.code === '0') {
+          this.HospitalInfoList = res.data.data;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hospitalId: this.filter.hospitalId
+        // pages: 1
+      };
+      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: 'AddHospitalUserCDSS',
+        params: Object.assign(pam, {
+          isEdit: false
+        })
+      });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    // 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: 'AddHospitalCDSS',
+    //     params: Object.assign(pam, {
+    //       isEdit: true,
+    //       data: { ...item }
+    //       // hospitaiName: this.hospitaiName
+    //     })
+    //   });
+    // },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hospitalId: ''
+      };
+    },
+
+    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(row) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .cancelUserRoleCDSS({
+            hospitalId: row.hospitalId,
+            id: row.id,
+            userId: row.userId
+          })
+          .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);
+          });
+      });
+    }
+  }
+};
 </script>
 
-<style>
 
+<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;
+}
+.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;
+  }
+}
+.selectMedicine {
+  /deep/ .el-input__suffix-inner {
+    position: relative;
+    top: -1px;
+  }
+  /deep/ .el-icon-circle-close {
+    position: relative;
+    top: -2px;
+  }
+}
 </style>

+ 236 - 8
src/components/cdssManage/version/AddVersion.vue

@@ -1,13 +1,241 @@
 <template>
-  <div>vue</div>
+  <div>
+    <crumbs :title="title" :param="$route.params" linkTo="VersionCDSS"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <!-- <el-form ref="form" :label-position="labelPosition" label-width="95px" class="add-admin-form" :model="form" :rules="rules"> -->
+        <el-form ref="form" :label-position="labelPosition" label-width="108px" class="add-version-form" :model="form" :rules="rules">
+          <!-- <el-form-item label="版本号归属:" prop="productType">
+            <el-select v-model="form.productType" 
+                      placeholder="请选择" 
+                      size="small"
+                      :disabled="id && !copy?true:false">
+              <el-option 
+                v-for="item in typeList"
+                :key="item.key"
+                :label="item.name"
+                :value="item.key">
+              </el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="版本号:" prop="name" class="version-num">
+              <el-input v-model="form.name" placeholder="请输入版本号" maxlength="31"></el-input>
+          </el-form-item>
+          <el-form-item label="版本时间:" prop="refreshTime">
+            <el-date-picker
+              v-model="form.refreshTime"
+              type="date"
+              placeholder="选择日期"
+              value-format="yyyy-MM-dd"
+              :clearable='false'>
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="版本备注:" prop="remark" class="discDesc">
+              <el-input type="textarea" :rows="3" placeholder="请输入版本备注" v-model="form.remark" maxlength="121"></el-input>
+          </el-form-item>
+          <el-form-item label="版本说明:" v-if="list&&list.length>0">
+          </el-form-item>
+          <VersionDesc :detail="list" :versionId="id" :isFirst="isFirst" :isCopy="copy" @func="getDetailList"/>
+          <el-button class="disclButn" size="small" type="primary" :disabled = 'saveDisable' @click="comfirn('form')">确定</el-button>
+        </el-form>
+        <!-- <VersionDesc :detail="list" :versionId="id" :isFirst="isFirst" :isCopy="copy" @func="getDetailList"/>
+        <el-button class="disclButn" size="small" type="primary" @click="comfirn">确定</el-button> -->
+      </div>    
+    </div>
+  </div>
 </template>
-
-<script>
-export default {
-
-}
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  import VersionDesc from './VersionDesc.vue';
+  export default {
+    name:'AddVersionCDSS',
+    data(){
+      const titleVaild = (rule, value, callback) => {
+        if (!value) {
+          return callback(new Error('请输入版本号'));
+        }
+        if (value.length > 30) {
+           this.form.name = value.substr(0, 30);
+           this.$message({
+             showClose: true,
+             type: 'warning',
+             message: '版本号已超过最大限制30字'
+           })
+        }
+        callback();
+      };
+      const remarkVaild = (rule, value, callback) => {
+        if (value.length > 120) {
+           this.form.remark = value.substr(0, 120);
+           this.$message({
+             showClose: true,
+             type: 'warning',
+             message: '版本备注已超过最大限制120字'
+           })
+        }
+        callback();
+      };
+      return{
+        // data:{},
+        list:[],
+        labelPosition:'left',
+        isFirst:true,
+        title:'版本信息维护-添加版本信息',
+        form:{
+          name:'',
+          refreshTime:'',
+          remark:'',
+          // productType:null
+        },
+        id:null,
+        rules:{
+          name:[{ required: true, validator: titleVaild, trigger: [ 'change'] },
+                { required: true, message: '请输入版本号',trigger: ['blur', 'change'] }],
+          remark:{ required: false, validator: remarkVaild, trigger: [ 'change'] },
+          refreshTime:{ required: true, message: '请选择时间', trigger: ['blur', 'change'] },
+          // productType:{ required: true, message: '请选择版本号归属', trigger: ['blur', 'change'] },
+        },
+        pickerOptions1:{
+          disabledDate(time) {
+            return time.getTime() < Date.now();
+          },
+        },
+        copy:null,
+        saveDisable: false,  //保存按钮禁止点击
+        typeList:[]
+      }
+    },
+    created(){
+      let info = this.$route.params.info;
+      this.copy = this.$route.params.copy;
+      if(info){
+        this.id = info.id;
+        this.form.name = info.name;
+        this.form.refreshTime = info.refreshTime;
+        this.form.remark = info.remark;
+        // this.form.productType = info.productType && !this.copy?info.productType:null;
+        this.title = this.copy?"版本信息维护-复制版本信息":"版本信息维护-修改版本信息";
+        // this.getList();
+        this.list = info.detail;
+      }
+      // let typeList = JSON.parse(localStorage.getItem("knowledgeEnumsData"));
+      // this.typeList = typeList.productTypeEnum;
+    },
+    methods:{
+      /*getList(){
+        api.getVersionDetlInfo({id:this.id}).then((res)=>{
+          const result = res.data;
+          if(result.code==0){
+            this.list = result.data;
+          }else{
+            this.$message({
+              message:result.msg,
+              type:'warning'
+            });
+          }
+        })
+      },*/
+      getDetailList(data){//子组件数据
+        this.list = data;
+      },
+      comfirn(form){
+        /*if(!this.form.name.trim() || !this.form.refreshTime.trim()){
+          this.$message({
+            message:'请填写相关内容',
+            type:'warning'
+          });
+          return
+        }*/
+        this.$refs[form].validate((valid) => {
+          if (valid) {
+            if(this.id && !this.copy){//修改
+              const param = Object.assign({},this.form,{id:this.id})
+              this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+              api.updateVersInfo(param).then((res)=>{
+                if(res.data.code==0){
+                  this.$message({
+                    message:"修改成功",
+                    type:'success'
+                  });
+                  //返回带搜索条件的首页
+                  this.$router.push({
+                    name: 'VersionInfo',
+                    params: Object.assign({}, this.$route.params, {currentPage: 1})
+                  });
+                }else{
+                  this.$message({
+                    message:res.data.msg,
+                    type:'warning'
+                  });
+                }
+                this.saveDisable = false
+              })
+            }else{//添加
+              // 复制时把list多余字段过滤掉,如id等
+              const detail = this.list;
+              let copyDetail=[];
+              let item={};
+              if(detail && detail.length>0){
+                for(let i=0; i<detail.length; i++){
+                  item.title = detail[i].title;
+                  item.description = detail[i].description;
+                  copyDetail.push(item);
+                  item={};
+                }
+              }
+              const params = Object.assign({},this.form,{'versionDetail':copyDetail});
+              // api.addVersInfo(this.form).then((res)=>{
+              this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+              api.addVersInfo(params).then((res)=>{
+                if(res.data.code==0){
+                  this.$message({
+                    message:"添加成功",
+                    type:'success'
+                  })
+                  // this.$router.push({path: 'LT-GBBXXWH-BBXXWH'});
+                  this.$router.push({name: 'VersionInfo'});
+                }else{
+                  this.$message({
+                    message:res.data.msg,
+                    type:'warning'
+                  });
+                }
+                this.saveDisable = false
+              })
+            }  
+          } else {
+            return false;
+          }
+        });   
+      },
+    },
+    components:{
+      VersionDesc
+    }
+  }
 </script>
-
-<style>
+<style lang="less">
+  @import "../../../less/admin.less";
+  .content{
+    background: #fff;
+    // padding: 20px 20px 30px;
+    padding: 20px 20px 50px;
+    color: #545455;
+    min-width: 980px;
+    position: relative;
+    .discDesc{
+      margin-bottom: 20px;
+    }
+    .disclButn{
+      position: absolute;
+      right: 80px;
+      bottom: 10px;
+    }
+  }
+  .add-version-form{
+    .version-num{
+      width: 500px;
+    }
+  }
 
 </style>

+ 257 - 0
src/components/cdssManage/version/Version.vue

@@ -0,0 +1,257 @@
+<template>
+  <div>
+    <crumbs title="版本信息维护">
+      <el-form :inline="true" class="demo-form-inline">
+        <!-- <el-form-item label="版本号归属:">
+          <el-select v-model="filter.type" placeholder="请选择" size="mini" clearable>
+            <el-option
+              v-for="item in typeList"
+              :key="item.key"
+              :label="item.name"
+              :value="item.key"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="版本号:">
+          <el-input size="mini" v-model="filter.name" placeholder="输入版本号"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+          <!-- <router-link to="/admin/LT-YXSJWH-TJBBXX" style="margin:0 10px">
+                      <el-button size="mini" type="warning">添加版本信息</el-button>
+          </router-link>-->
+          <el-button size="mini" type="warning" style="margin:0 10px" @click="addVersion">添加版本信息</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column prop="gmtCreate" label="操作时间" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column prop="name" label="版本号" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="refreshTime" label="版本时间"></el-table-column>
+        <!-- <el-table-column label="版本号归属">
+          <template slot-scope="scope">
+            <span>{{getProdType(scope.row)}}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column prop="modifierid" label="操作人"></el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <!-- <el-button type="text" size="small" :class="{forbid:scope.row.id != canModiId}" @click="scope.row.id ==canModiId?toEditVersion(scope.row,false):''">修改</el-button> -->
+            <el-button
+              type="text"
+              size="small"
+              :class="{forbid:scope.row.status != 1}"
+              @click="scope.row.status == 1?toEditVersion(scope.row,false):''"
+            >修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="{forbid:scope.row.status != 1}"
+              @click="scope.row.status ==1?toEditVersion(scope.row,true):''"
+            >复制</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="详情">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="getDetail(scope.row)">详情</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <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>
+</template>
+
+<script>
+import api from '@api/cdss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'VersionCDSS',
+  data: function() {
+    return {
+      list: [],
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      searched: false,
+      filter: {
+        name: '',
+        // type: null
+      },
+      canModiId: null, //标识列表中的第一个可修改和复制项,区分分页和搜索
+      flag: true,
+      // typeList: []
+    };
+  },
+  created() {
+      this.$nextTick(()=>{
+        this.getDataList();
+        // let typeList = JSON.parse(localStorage.getItem("knowledgeEnumsData"));
+        // this.typeList = typeList.productTypeEnum;
+    })
+  },
+  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();
+    },
+    // getProdType(item) {
+    //   let name = '';
+    //   let type = item.productType;
+    //   for (let i in this.typeList) {
+    //     if (this.typeList[i].key == type) {
+    //       name = this.typeList[i].name;
+    //     }
+    //   }
+    //   return name;
+    // },
+    addVersion() {
+      // 添加版本信息
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddVersionCDSS',
+        params: pam
+      });
+    },
+    toEditVersion(row, flag) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddVersionCDSS',
+        params: Object.assign(pam, { info: row, copy: flag })
+      });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    getDataList(isTurnPage) {
+      const param = 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
+        .getVersionInfoAllsCDSS(param)
+        .then(res => {
+          // console.log(res,'=========');
+          // return 
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.list = data.records;
+            this.cacheData[param.current] = data.records;
+            this.total = data.total;
+            if (this.flag) {
+              this.canModiId = this.list[0].id;
+            }
+            this.flag = false;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
+            }
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    getDetail(item) {
+      //详情页内不能修改明细 4-11
+      // let isFirst = item.id==this.list[0].id?true:false;
+      let isFirst = false;
+      this.$router.push({
+        name: 'VersionDetailCDSS',
+        params: { info: item, isFirst }
+      });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.filter.name = '';
+        this.filter.type = null;
+      }
+      const param = {
+        name: this.filter.name.trim(),
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        // productType: this.filter.type ? this.filter.type : 0
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      if (this.cacheData[next]) {
+        //如果已请求过该页数据,则使用缓存不重复请求
+        this.list = this.cacheData[next];
+      } else {
+        this.getDataList(true);
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red !important;
+}
+.forbid {
+  color: #bfbfbf !important;
+}
+</style>

+ 411 - 0
src/components/cdssManage/version/VersionDesc.vue

@@ -0,0 +1,411 @@
+<template>
+  <div class="version-desc">
+    <el-table v-if="list&&list.length>0" 
+              :data="list"
+              border
+              style="width: 100%">
+        <el-table-column
+                type="index"
+                :index="indexMethod"
+                label="编号"
+                width="60">
+        </el-table-column>
+        <el-table-column
+                v-if="!isCopy"
+                prop="gmtCreate"
+                label="建立时间"
+                :show-overflow-tooltip="true">
+        </el-table-column>
+        <el-table-column
+                prop="title"
+                label="标题">
+        </el-table-column>
+        <el-table-column
+                v-if="!isCopy"
+                prop="modifierid"
+                label="操作人">
+        </el-table-column>
+        <el-table-column v-if="isFirst"
+                label="操作">
+            <template slot-scope="scope">
+                <el-button type="text" size="small" @click="toEditDesc(scope.row,scope.$index)">修改</el-button>
+                <span style="margin:0 3px;">|</span>
+                <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row,scope.row.id,scope.$index)">删除</el-button>
+            </template>
+        </el-table-column>
+        <el-table-column
+                label="详情">
+            <template slot-scope="scope">
+                <el-button type="text" size="small" @click="getDetail(scope.row)">明细</el-button>
+            </template>
+        </el-table-column>
+    </el-table>
+    <el-button v-if="isFirst" class="disclButn1" size="small" type="primary" @click="addDesc">+ 添加说明</el-button>
+    <div class="boxMark" v-if="showBox">
+        <el-form ref="form" :model="form" :rules="showDesc?{}:rules" label-width="65px" class="add-desc-form">
+          <p class="top">
+            {{minTitle}}
+            <span v-if="tip" class="tip">(&lt;br /&gt;代表换行符,如果需要可在需要处输入)</span>
+            <img src="../../../images/close.png" height="12" width="12" @click="cancel">
+          </p>
+          <el-form-item label="标题:" prop="title">
+            <p v-if="showDesc" class="cont">{{form.title}}</p>
+            <el-input v-else v-model="form.title" placeholder="请输入标题" maxlength="31"></el-input>
+          </el-form-item>
+          <el-form-item label="内容:" prop="description" class="discDesc">
+            <p v-if="showDesc" v-html="form.description" class="cont">{{form.description}}</p>
+            <el-input v-else type="textarea" :rows="3" placeholder="请输入内容" v-model="form.description" maxlength="501" @keydown.native="contentInp"></el-input>
+          </el-form-item>
+          <el-button class="disclButn1" size="small" type="primary" :disabled="confirmDisable" @click="comfirn('form')">确定</el-button>
+          <!-- <el-button class="disclButn can" size="small" type="primary" @click="cancel">取消</el-button> -->
+      </el-form>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  export default {
+    name:'VersionDesc',
+    data(){
+      const titleVaild = (rule, value, callback) => {
+        if (!value) {
+          return callback(new Error('请输入标题'));
+        }
+        if (value.length > 30) {
+           this.form.title = value.substr(0, 30);
+           this.$message({
+             showClose: true,
+             type: 'warning',
+             message: '标题已超过最大限制30字'
+           })
+        }
+        callback();
+      };
+      const descVaild = (rule,value,callback) => {
+        if(!value){
+          return callback(new Error('请输入内容'));
+        }
+        if (value.length > 500) {
+           this.form.description = value.substr(0, 500);
+           this.$message({
+             showClose: true,
+             type: 'warning',
+             message: '内容已超过最大限制500字'
+           })
+        }
+        callback();
+      }
+      return{
+        list:[],//版本说明列表
+        form:{
+          title:'',
+          description:''
+        },
+        rules: {
+          title:[
+            { required: true, validator: titleVaild, trigger: [ 'change'] },
+            { required: true, message: '请输入标题', trigger: ['blur', 'change'] }
+          ],
+          description:[
+            { required: true, validator: descVaild, trigger: [ 'change'] },
+            { required: true, message: '请输入内容', trigger: ['blur', 'change'] }
+          ]
+        },
+        minTitle:'',
+        showBox:false,
+        modiId:null,
+        showDesc:false,
+        tip:true,
+        modiIndex:null,
+        confirmDisable: false
+      }
+    },
+    created(){
+      // if(this.versionId){
+      //   this.getList();
+      // }
+    },
+    mounted(){
+      this.list = JSON.parse(JSON.stringify(this.detail));
+    },
+    props:['detail','versionId','isFirst','isCopy'],
+    methods:{
+      // 按回车添加换行<br />
+      contentInp(e){
+        if(e.keyCode==13){
+          this.form.description += '<br />'
+        }
+      },
+      //用于修改时及时更新明细信息,若用本地信息,建立时间和操作人无法及时更新。
+      getList(){
+        api.getVersionDetlInfo({id:this.versionId}).then((res)=>{
+          const result = res.data;
+          if(result.code==0){
+            this.list = result.data;
+          }else{
+            this.$message({
+              message:result.msg,
+              type:'warning'
+            });
+          }
+        })
+      },
+      indexMethod(index) {
+        return index + 1;
+      },
+      toEditDesc(item,index){//修改备注
+        this.minTitle='修改说明';
+        this.showBox = true;
+        this.form.title = item.title;
+        this.form.description = item.description;
+        this.modiId = item.id;
+        this.modiIndex = index;
+      },
+      addDesc(){//添加备注
+        this.minTitle='添加说明';
+        this.showBox = true;
+      },
+      comfirn(form){//记得清空modiId
+        /*if(!this.form.title.trim() || !this.form.description.trim()){
+          this.$message({
+            message:'请填写相关信息',
+            type:'warning'
+          });
+          return
+        }*/
+        this.$refs[form].validate((valid) => {
+          if (valid) {
+              // 修改--直接调修改接口;复制--新增
+            this.confirmDisable = true
+            if(this.modiId){//修改
+              if(!this.isCopy){
+                const param = {
+                  title:this.form.title,
+                  description:this.form.description,
+                  detailId:this.modiId
+                }
+                api.modiVersionInfo(param).then((res)=>{
+                   this.confirmDisable = false
+                  if(res.data.code==0){
+                    this.$message({
+                      message:"修改成功",
+                      type:'success'
+                    })
+                    this.getList();
+                    /*for(let i in this.list){
+                      if(this.list[i].id==this.modiId){
+                        this.list[i].title=this.form.title;
+                        this.list[i].description=this.form.description;
+                      }
+                    }*/
+                   
+                    this.reset();
+                  }else{
+                    this.$message({
+                      message:res.data.msg,
+                      type:'warning'
+                    });
+                  }
+                })
+              }else{
+                for(let i in this.list){
+                  if(this.list[i].id==this.modiId){
+                    this.list[i].title=this.form.title;
+                    this.list[i].description=this.form.description;
+                  }
+                }
+                this.$emit('func',this.list);//向父组件传明细
+                this.reset();
+              }
+              
+            }else if(this.showDesc){//明细
+              this.reset();
+            }else{//添加
+              const item = {
+                description: this.form.description,
+                title: this.form.title,
+              }
+              if(!this.isCopy && this.versionId){
+                const params = {
+                  versionDetail: [
+                    item
+                  ],
+                  versionInfoId: this.versionId
+                }
+                api.addVersionInfo(params).then((res)=>{
+                   this.confirmDisable = false
+                  if(res.data.code==0){
+                    this.$message({
+                      message:"添加成功",
+                      type:'success'
+                    })
+                    this.getList();
+                    /*this.list.push(item);*/
+                    this.reset();
+                  }else{
+                    this.$message({
+                      message:res.data.msg,
+                      type:'warning'
+                    });
+                  }
+                })
+              }else{//仅添加到本地list
+                this.confirmDisable = false
+                if(this.modiIndex !==null){
+                  this.list[this.modiIndex].description = this.form.description;
+                  this.list[this.modiIndex].title = this.form.title;
+                }else{
+                  this.list.push(item);
+                }
+                this.$emit('func',this.list);
+                this.reset();
+              } 
+            }
+            // this.reset();
+          } else {
+            return false;
+          }
+        }); 
+           
+      },
+      reset(){//关闭弹窗复原数据
+        this.showBox = false;
+        this.showDesc = false;
+        this.form.title = "";
+        this.form.description = "";
+        this.modiId = null;
+        this.minTitle= "";
+        this.tip = true;
+        this.modiIndex = null;
+      },
+      cancel(){
+        this.reset();
+      },
+      getDetail(item){//明细
+        this.minTitle='说明明细';
+        this.tip = false;
+        this.showDesc = true;
+        this.showBox = true;
+        this.form.title = item.title;
+        this.form.description = item.description;
+      },
+      warning(msg,type){
+        this.$message({
+          showClose: true,
+          message:msg,
+          type:type||'warning'
+        })
+      },
+      showConfirmDialog(msg,resolve){
+        this.$alert(msg, '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          resolve();
+        }).catch(() => {});
+      },
+      showDelDialog(item,id,index){
+        console.log('cancel',item,id,index)
+        this.showConfirmDialog('是否删除该版本说明?',()=>{
+          if(!this.isCopy&&id){
+            api.delVersionInfo({id}).then((res)=>{
+              if(res.data.code=='0'){
+                this.warning(res.data.msg||'操作成功','success');
+                this.getList();
+                /*let newList = JSON.parse(JSON.stringify(this.list));
+                for(let i in newList){
+                  if(newList[i].id==id){
+                    this.list.splice(i,1);
+                  }
+                }*/
+              }else{
+                this.warning(res.data.msg);
+              }
+            }).catch((error)=>{
+              this.warning(error);
+            })
+          }else{
+            let newList = JSON.parse(JSON.stringify(this.list));
+            for(let i in newList){
+              if(id && newList[i].id==id){
+                this.list.splice(i,1);
+              }else {//新增的没有id
+                this.list.splice(index,1);
+              }
+            }
+            this.$emit('func',this.list);
+          }
+          
+        });
+      },
+    },
+    watch:{
+      list:function(newVal,oldVal){
+        return newVal;
+      }
+    }
+  }
+</script>
+<style lang="less" >
+  @import "../../../less/admin.less";
+  .disclButn1{
+    margin: 30px 0 10px;
+  }
+  .boxMark{
+    position: fixed;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    text-align: center;
+    // background: #808080;
+    background-color:rgba(0,0,0,0.3);
+    z-index: 1001;
+  }
+  // .el-form{
+  .add-desc-form{
+    width: 680px;
+    position: absolute;
+    top: 15%;
+    left: 50%;
+    // margin-top: -143px;
+    margin-left: -340px;
+    background: #fff;
+    padding: 20px;
+    max-height: 660px;
+    overflow-y: auto;
+  }
+  .top{
+    font-size: 15px;
+    font-weight: bold;
+    color: #545455;
+    text-align: left;
+    // padding-bottom: 10px;
+    margin-bottom: 15px;
+    // border-bottom: 1px solid #C9C9C9;
+    position: relative;
+    img{
+      position: absolute;
+      right: 5px;
+    }
+  }
+  .can,.can:hover{
+    background: #9B9B9B;
+    border-color: #9B9B9B;
+  }
+  .cont{
+    text-align: left;
+  }
+  .version-desc .el-table__body-wrapper{
+    max-height: 340px;
+    overflow-y: auto;
+  }
+  .version-desc .el-table th{
+    padding: 0px;
+  }
+  .tip{
+    font-weight: normal;
+    font-size: 13px;
+    color:#22ccc8;
+  }
+</style>

+ 58 - 0
src/components/cdssManage/version/VersionDetail.vue

@@ -0,0 +1,58 @@
+<template>
+  <div>
+    <crumbs title="版本信息维护-明细" linkTo="VersionCDSS"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <el-form ref="form" :label-position="labelPosition" label-width="85px" class="add-admin-form">
+          <el-form-item label="版本号:">
+              <p>{{data.name}}</p>
+          </el-form-item>
+          <el-form-item label="版本时间:">
+              <p>{{data.refreshTime}}</p>
+          </el-form-item>
+          <el-form-item label="版本备注:">
+              <p>{{data.remark}}</p>
+          </el-form-item>
+          <el-form-item label="版本说明:" v-if="list.length>0">
+              <!-- <p>{{data.remark}}</p> -->
+          </el-form-item>
+        </el-form>
+        <!-- 只有第一条可修改,内部的说明也是 -->
+        <VersionDesc :detail="list" :versionId="data.id" :isFirst="isFirst"/>
+      </div>    
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  import VersionDesc from './VersionDesc.vue';
+  export default {
+    name:'VersionDetailCDSS',
+    data(){
+      return{
+        data:{},
+        list:[],
+        labelPosition:'left',
+        isFirst:null
+      }
+    },
+    created(){
+      const info = this.$route.params.info;
+      this.data = info;
+      this.list = info.detail?info.detail:[];
+      this.isFirst = this.$route.params.isFirst;
+    },
+    components:{
+      VersionDesc
+    }
+  }
+</script>
+<style lang="less" scoped>
+  @import "../../../less/admin.less";
+  .content{
+    background: #fff;
+    padding: 20px 20px 30px;
+    color: #545455;
+    min-width: 980px;
+  }
+</style>

+ 2 - 0
src/routes.js

@@ -177,6 +177,7 @@ import HospitalUserCDSS from '@components/cdssManage/hospitalUser/HospitalUser.v
 import AddHospitalUserCDSS from '@components/cdssManage/hospitalUser/AddHospitalUser.vue';  //医院用户管理--添加用户
 import VersionCDSS from '@components/cdssManage/version/Version.vue';  //CDSS版本信息维护
 import AddVersionCDSS from '@components/cdssManage/version/AddVersion.vue';  //CDSS版本信息维护--新增编辑
+import VersionDetailCDSS from '@components/cdssManage/version/VersionDetail.vue';  //CDSS版本信息维护--新增编辑
 import DisclaimerCDSS from '@components/cdssManage/disclaimer/Disclaimer.vue';  //免责声明维护
 import AddDisclaimerCDSS from '@components/cdssManage/disclaimer/AddDisclaimer.vue';  //免责声明维护--新增编辑
 
@@ -410,6 +411,7 @@ export default [
       { path: 'LT-CDSSSJWH-YYYHGLEDIT', component: AddHospitalUserCDSS, name: 'AddHospitalUserCDSS' }, //医院用户管理--添加用户
       { path: 'LT-CDSSSJWH-BBWH', component: VersionCDSS, name: 'VersionCDSS' }, //CDSS版本信息维护
       { path: 'LT-CDSSSJWH-BBWHEDIT', component: AddVersionCDSS, name: 'AddVersionCDSS' }, //CDSS版本信息维护--新增编辑
+      { path: 'LT-CDSSSJWH-BBWHDETAIL', component: VersionDetailCDSS, name: 'VersionDetailCDSS' }, //CDSS版本信息维护--详情
       { path: 'LT-CDSSSJWH-MZSMWH', component: DisclaimerCDSS, name: 'DisclaimerCDSS' }, //免责声明维护
       { path: 'LT-CDSSSJWH-MZSMWHEDIT', component: AddDisclaimerCDSS, name: 'AddDisclaimerCDSS' }, //免责声明维护--新增编辑