morphone1995 4 years ago
parent
commit
c8e3d71d99

+ 5 - 1
src/api/config.js

@@ -431,13 +431,17 @@ export default {
     'addUserRoleCDSS': '/api/cdssman/userRole/addUserRole',   //添加医院管理员
 
     'cancelPlanDatasCDSS': '/api/cdssman/plan/cancelPlanDatas',   //删除方案配置信息
-    'getDefaultPlansCDSS': '/api/cdssman/plan/getDefaultPlans',   //获取默认方案配置
     'getPlanInfoIdsCDSS': '/api/cdssman/plan/getPlanInfoIds',   //根据方案id获取配置信息
     'getPlanInfoPagesCDSS': '/api/cdssman/plan/getPlanInfoPages',   //分页获取方案配置信息
+    'getDefaultPlansCDSS': '/api/cdssman/plan/getPlansDefault',   //获取默认方案配置
     'getSysPlanInfoDatasCDSS': '/api/cdssman/plan/getSysPlanInfoDatas',   //根据医院获取方案配置信息
     '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',   //删除版本信息

+ 2 - 5
src/components/cdssManage/disclaimer/Disclaimer.vue

@@ -30,13 +30,13 @@
               :class="{forbid:scope.row.status==0}"
               @click="toOpen(scope.row)"
             >启用</el-button>
-            <span style="margin:0 3px;">|</span>
+            <!-- <span style="margin:0 3px;">|</span>
             <el-button
               type="text"
               size="small"
               :class="['delete',{'forbid':scope.row.status==1}]"
               @click="toClose(scope.row)"
-            >停用</el-button>
+            >停用</el-button> -->
           </template>
         </el-table-column>
         <el-table-column label="操作">
@@ -264,15 +264,12 @@ export default {
       });
     },
     toOpen(item) {
-      console.log(1231321, item);
       // status=0停用,status=1启用
       if (item.status == 0) {
         this.showConfirmDialog('是否启用该免责声明?', () => {
           api
             .startDisclaimerInformationsCDSS({ id: item.id })
             .then(res => {
-              console.log(res, '============================');
-              return;
               if (res.data.code == 0) {
                 //恢复成功后跳转到筛选条件的首页
                 this.currentPage = 1;

+ 59 - 18
src/components/cdssManage/plan/AddPlan.vue

@@ -11,8 +11,23 @@
         <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-form-item label="医院名称" prop="hoipitalName">
                 <el-input v-model="form.planName" placeholder="2-30位,可输入汉字、字母、数字和下划线"></el-input>
+              </el-form-item>-->
+              <el-form-item label="医院名称" class="selectMedicine" prop="hospitalId">
+                <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="planName">
                 <el-input v-model="form.planName" placeholder="2-30位,可输入汉字、字母、数字和下划线"></el-input>
@@ -175,6 +190,7 @@ export default {
     };
     return {
       form: {
+        hospitalId: '',
         planName: '',
         planCode: ''
       },
@@ -185,10 +201,10 @@ export default {
           { min: 2, max: 30, message: '长度2-30位', trigger: 'blur' },
           { required: true, validator: validatePass, trigger: 'blur' }
         ],
-        hoipitalName: [
-          { required: true, message: '方案名称不能为空', trigger: 'change' },
-          { min: 2, max: 30, message: '长度2-30位', trigger: 'blur' },
-          { required: true, validator: validatePass, trigger: 'blur' }
+        hospitalId: [
+          { required: true, message: '医院名称不能为空', trigger: 'change' }
+          // { min: 2, max: 30, message: '长度2-30位', trigger: 'blur' },
+          // { required: true, validator: validatePass, trigger: 'blur' }
         ],
         planCode: [
           { required: true, message: '方案编码不能为空', trigger: 'change' },
@@ -197,7 +213,7 @@ export default {
         ]
       },
       planDefaultList: [],
-      hospitalId: '',
+      // hospitalId: '',
       isEdit: false, // 是否处于编辑页面 false--新增   true--编辑
       switchSubStatus: 0, // 辅助信息
       switchMedStatus: 0, // 医学知识
@@ -207,12 +223,14 @@ export default {
       isTopLight: -1,
       flag: 1,
       editCount: -1, // 页面会否被编辑 >0被编辑   =0 未编辑
-      isSaveSuccess: false // 是否保存成功
+      isSaveSuccess: false, // 是否保存成功
+      HospitalInfoList: []
     };
   },
   beforeRouteLeave(to, from, next) {
+    console.log(this.editCount,'this.editCount');
     if (
-      (this.editCount > 2 && !this.isSaveSuccess && this.isEdit) ||
+      (this.editCount > 3 && !this.isSaveSuccess && this.isEdit) ||
       (this.editCount > 1 && !this.isSaveSuccess && !this.isEdit)
     ) {
       // console.log('页面被编辑了');
@@ -252,13 +270,15 @@ export default {
   async created() {
     const { isEdit, data } = this.$route.params;
     console.log(data, '编辑页传递的data');
-    let res = await api.getHospitalInfo(); // 同步获取医院信息
-    this.hospitalId = res.data.data.id;
+    this._getHospitalInfo(); // 获取医院下拉列表
+    // let res = await api.getHospitalInfo(); // 同步获取医院信息
+    // this.hospitalId = res.data.data.id;
     if (isEdit) {
       // 编辑页面
       this.isEdit = true;
+      this.form.hospitalId = data.hospitalId
       let params = {
-        hospitalId: res.data.data.id,
+        hospitalId: data.hospitalId,
         id: data.id
       };
       this._getPlanInfoIds(params);
@@ -269,7 +289,14 @@ export default {
   },
   methods: {
     close() {},
-
+    // 获取医院下拉列表
+    _getHospitalInfo() {
+      api.getHospitalInfo().then(res => {
+        if (res.data.code === '0') {
+          this.HospitalInfoList = res.data.data;
+        }
+      });
+    },
     // 方案配置排序
     sortPlan(item, index, type) {
       // console.log('排序', item, index, type);
@@ -353,7 +380,7 @@ export default {
     // 获取默认方案配置
     _getDefaultPlans() {
       api.getDefaultPlans().then(res => {
-        // console.log(res, '获取默认的方案配置');
+        console.log(res, '获取默认的方案配置');
         if (res.data.code === '0') {
           this.planDefaultList =
             res.data.data &&
@@ -388,6 +415,7 @@ export default {
           res.data.data.planDetailDefault[0].planDetails;
       }
       let res1 = await api.getPlanInfoIds(params);
+      console.log(res1, '==================');
       if (res1.data.code === '0') {
         newPlan = res1.data.data[0].sysSetInfo[0].planDetails;
         this.form.planName = res1.data.data[0].planName;
@@ -430,7 +458,8 @@ export default {
       TempPlanDetail = this.planDefaultList.map((item, index) => {
         return {
           code: item.code,
-          hospitalId: this.hospitalId,
+          hospitalId: this.form.hospitalId,
+          // hospitalId: this.hospitalId,
           name: item.name,
           number: item.number,
           orderNo: item.orderNo,
@@ -447,12 +476,12 @@ export default {
     // 处理保存活动信息参数
     _getParams() {
       let params = {
-        hospitalId: this.hospitalId,
+        hospitalId: this.form.hospitalId,
         planCode: this.form.planCode,
         planDetailParent: [
           {
             code: 'auxiliary',
-            hospitalId: this.hospitalId,
+            hospitalId: this.form.hospitalId,
             name: '辅助信息',
             number: 0,
             orderNo: 1,
@@ -461,7 +490,7 @@ export default {
           },
           {
             code: 'medical',
-            hospitalId: this.hospitalId,
+            hospitalId: this.form.hospitalId,
             name: '医学知识',
             orderNo: 3,
             planDetailSub: [{}],
@@ -469,7 +498,7 @@ export default {
           },
           {
             code: 'followup',
-            hospitalId: this.hospitalId,
+            hospitalId: this.form.hospitalId,
             name: '随访计划',
             orderNo: 4,
             planDetailSub: [{}],
@@ -492,6 +521,8 @@ export default {
         if (valid) {
           this.saveDisable = true;
           let params = this._getParams();
+          // console.log(params, 'params');
+          // return;
           api.savePlanInfoDatas(params).then(res => {
             if (res.data.code === '0') {
               this.$message({
@@ -649,4 +680,14 @@ export default {
     border-color: transparent;
   }
 }
+.selectMedicine {
+  /deep/ .el-input__suffix-inner {
+    position: relative;
+    top: -1px;
+  }
+  /deep/ .el-icon-circle-close {
+    position: relative;
+    top: -2px;
+  }
+}
 </style>

+ 25 - 11
src/components/cdssManage/plan/Plan.vue

@@ -58,7 +58,7 @@
             <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)"
+              @click="showDelDialog(scope.row.id,scope.row.planStatus,scope.row.planName,scope.row)"
               class="delete"
               type="text"
               size="small"
@@ -266,16 +266,16 @@ export default {
         })
         .catch(() => {});
     },
-    // 获取医院信息
-    _getHospital() {
-      api.getHospitalInfo().then(res => {
-        if (res.data.code === '0') {
-          this.hospitalId = res.data.data.id;
-        }
-      });
-    },
+    // // 获取医院信息
+    // _getHospital() {
+    //   api.getHospitalInfo().then(res => {
+    //     if (res.data.code === '0') {
+    //       this.hospitalId = res.data.data.id;
+    //     }
+    //   });
+    // },
     // 删除关联
-    showDelDialog(id, status, info) {
+    showDelDialog(id, status, info, row) {
       if (status === 1) {
         this.$confirm(`${info}正在启用中,无法删除。`, '提示', {
           confirmButtonText: '确定',
@@ -290,12 +290,26 @@ export default {
         return false;
       }
 
+      if (id === -1) {
+        this.$confirm(`该方案为默认方案,无法删除。`, '提示', {
+          confirmButtonText: '确定',
+          // cancelButtonText: '取消',
+          cancelButtonClass: 'cancelSureL',
+          confirmButtonClass: 'sureL',
+          customClass: 'exportBoxL',
+          type: 'warning'
+        })
+          .then(() => {})
+          .catch(() => {});
+        return false;
+      }
+      // return
       this.showConfirmDialog(
         '是否删除该方案配置?',
         () => {
           let params = {
             planId: id,
-            hospitalId: this.hospitalId
+            hospitalId: row.hospitalId
           };
           api
             .cancelPlanDatas(params)