Преглед на файлове

Merge remote-tracking branch 'origin/sonHospital1011'

# Conflicts:
#	src/api/cdss.js
zhouna преди 3 години
родител
ревизия
e98d004102
променени са 8 файла, в които са добавени 307 реда и са изтрити 30 реда
  1. 1 0
      .gitignore
  2. 8 2
      src/api/cdss.js
  3. 2 0
      src/api/config.js
  4. 289 22
      src/components/cdssManage/hospital/AddHospital.vue
  5. 5 4
      src/components/cdssManage/hospital/Hospital.vue
  6. BIN
      src/images/add-no.png
  7. BIN
      src/images/add-nob.png
  8. 2 2
      vue.config.js

+ 1 - 0
.gitignore

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

+ 8 - 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) {
     //医学数据-化验大小项与公表项维护-获取所有化验公表项
@@ -748,6 +748,12 @@ export default {
     //数据导入校验
     return axios.post(urls.importExcelDataVerify, param);
   },
+
+  getByhospitalInfoId(param) {
+    //获取医院信息
+    return axios.post(urls.getByhospitalInfoId, param);
+  },
+
   getResetFildF(param) {
     //数据导入校验
     return axios.post(urls.getResetFildF, param);

+ 2 - 0
src/api/config.js

@@ -494,6 +494,8 @@ export default {
     '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获取配置信息

+ 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>

+ 5 - 4
src/components/cdssManage/hospital/Hospital.vue

@@ -25,9 +25,10 @@
         <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,11 @@
           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>
+            <!-- <span style="margin:0 3px;">|</span>
             <el-button
               @click="resetFildF(scope.row)"
               v-if="scope.row.id !== -1"
@@ -61,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>

BIN
src/images/add-no.png


BIN
src/images/add-nob.png


+ 2 - 2
vue.config.js

@@ -1,6 +1,6 @@
 const path = require('path');
-const proxy_path = 'http://192.168.2.241:88';
-// const proxy_path = 'http://192.168.2.236:5050';
+//const proxy_path = 'http://192.168.2.241:88';
+const proxy_path = 'http://192.168.2.236:5050';
 // const proxy_path = 'http://192.168.3.101:5050';
 // const proxy_path = 'http://192.168.3.117:5050';//周铁刚
 // const proxy_path = 'http://192.168.3.113:5050'; //王峰