Ver código fonte

质控类型维护

zhouna 5 anos atrás
pai
commit
d8bc23a444

+ 5 - 1
src/api/config.js

@@ -298,7 +298,6 @@ export default {
       'delQCTemp':'/api/mrman/qc/qcModuleInfo/delete', //删除模板
       'getQCTempDetail':'/api/mrman/qc/qcModuleInfo/getById', //获取模板详情
       'getQCName':'/api/mrman/qc/qcQuestionInfo/index', //获取字段名称
-      'delFieldMatch':"/api/mrman/qc/qcQuestionInfo/delete",    //删除字段映射
       'getQcFlawList':'/api/mrman/qcCasesEntry/indexCaseEntry',   //获取缺陷列表
       'getModuleTypeList':'/api/mrman/med/RecordModule/getAll', //获取模块类型列表
       'getRecordInpList':'/api/mrman/qcInputcases/getAllInputcases',//获取全部病历录入
@@ -316,6 +315,11 @@ export default {
       'getRecordItemDetail':'/api/mrman/qcCasesEntry/getUpdateInfo', //获取病例详情
       'getInputcasesDetial':'/api/mrman/qcInputcases/getInputcasesDetial', //获取标注病例详情
       'gethospitalModuleList': '/api/mrman/qcMode/getModes', //获取医院数据模块
+      'getQcTypeList': '/api/mrman/qc/qcType/page', //获取质控类型列表
+      'addQcType': '/api/mrman/qc/qcType/saveOrUpdate', //新增质控类型
+      'delQcType': '/api/mrman/qc/qcType/delete', //删除质控类型
+      'getQcTypeItem': '/api/mrman/qc/qcType/getEntryByHospital', //获取质控条目
+      'getQcTypeDetail':'/api/mrman/qc/qcType/getById', //获取质控类型明细
   },
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 15 - 0
src/api/qualityControl.js

@@ -38,5 +38,20 @@ export default {
   },
   getModuleTypeList(param){ //获取模块类型列表
     return axios.post(urls.getModuleTypeList,param);
+  },
+  getQcTypeList(param){ //获取质控类型列表
+    return axios.post(urls.getQcTypeList,param);
+  },
+  getQcTypeDetail(param){ //获取质控类型列表
+    return axios.post(urls.getQcTypeDetail,param);
+  },
+  addQcType(param){ //添加质控类型
+    return axios.post(urls.addQcType,param);
+  },
+  delQcType(param){ //删除质控类型
+    return axios.post(urls.delQcType,param);
+  },
+  getQcTypeItem(param){ //获取质控条目
+    return axios.post(urls.getQcTypeItem,param);
   }
 }

+ 246 - 0
src/components/qualityControl/AddQcType.vue

@@ -0,0 +1,246 @@
+<template>
+    <div>
+        <crumbs :title="title" :param="$route.params" linkTo="QCTypeMang"></crumbs>
+        <div class="contents">
+            <div class="content">
+                <el-form ref="form" :label-position="labelPosition" label-width="125px" :model="form" :rules="rules">
+                    <el-form-item label="所属医院:" prop="hospitalId">
+                        <el-select v-model="form.hospitalId"
+                                   placeholder="请选择"
+                                   :disabled="!!this.form.id"
+                                   @change="changeHospital"
+                                   size="small">
+                            <el-option
+                                    v-for="item in hisTypes"
+                                    :key="item.val"
+                                    :label="item.name"
+                                    :value="Number(item.val)">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="质控类型:" prop="name">
+                        <el-input type="text" placeholder="请输入质控类型" v-model="form.name"></el-input>
+                    </el-form-item>
+                    <el-form-item label="质控条目:" prop="qcItem">
+                        <el-collapse>
+                            <el-collapse-item v-for="(item,i) in qcItemList" :title="i" :name="i">
+                                <el-table
+                                        :data="item">
+                                    <el-table-column
+                                            label="操作"
+                                            align="center"
+                                            width="90">
+                                        <template slot-scope="scope">
+                                            <el-checkbox v-model="scope.row.sel" :checked="scope.row.sel?true:false" true-label="1" false-label="0"></el-checkbox>
+                                        </template>
+                                    </el-table-column>
+                                    </el-table-column>
+                                    <el-table-column
+                                            prop="name"
+                                            width="500"
+                                            label="质控条目">
+                                    </el-table-column>
+                                    <el-table-column
+                                            width="160"
+                                            label="是否启用">
+                                        <template slot-scope="scope">
+                                            {{scope.row.isUsed==="1"?"是":"否"}}
+                                        </template>
+                                    </el-table-column>
+                                </el-table>
+                            </el-collapse-item>
+                        </el-collapse>
+                    </el-form-item>
+                    <el-button class="disclButn" size="small" type="primary" :disabled = 'saveDisable' @click="comfirn('form')">确定</el-button>
+                </el-form>
+            </div>
+        </div>
+    </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/qualityControl.js';
+  export default {
+    name:'AddQcType',
+    data(){
+      return{
+        // data:{},
+        list:[],
+        labelPosition:'left',
+        title:'质控类型维护-添加质控类型',
+        form:{
+          id:'',
+          hospitalId:"",
+          name:'',
+          qcTypeCasesEntryVOList:[]
+        },
+        rules:{
+          hospitalId:{ required: true, message: '请选择所属医院', trigger: ['blur', 'change']},
+          //qcItem:{ required: true, message: '请选择质控条目', trigger: ['blur', 'change']},
+          name:{ required: true, message: '请输入质控类型', trigger: ['blur', 'change']},
+        },
+        copy:null,
+        saveDisable: false,  //保存按钮禁止点击
+        qcItemList:{},
+      }
+    },
+    created(){
+      this.getAllTypes();
+      let {isCopy,info} = this.$route.params;
+      this.copy=isCopy;
+      if(info){
+        const infoCopy =  Object.assign({},info);
+        this.title=isCopy?"质控类型维护-复制质控类型":'质控类型维护-修改质控类型';
+        this.qcItemList=infoCopy.entryMap;
+        this.form = {
+          id:isCopy?"":infoCopy.id,
+          hospitalId:infoCopy.hospitalId,
+          name:infoCopy.name,
+          qcTypeCasesEntryVOList:[]
+        };
+        //this.getQcTypeItem({hospitalId:info.hospitalId});
+      }else{
+        let hospitalId = localStorage.getItem("qcSelectHospital");
+        this.form.hospitalId = +hospitalId;
+        this.getQcTypeItem({hospitalId:hospitalId});
+      }
+    },
+    watch:{
+      "qcItemList":{
+        handler:function(val){
+          let list = [];
+          for(let it in val){
+            val[it].map((t)=>{
+              if(t.sel==='1'){
+                list.push({caseEntryId:t.id});
+              }
+            })
+          }console.log(list)
+          this.form.qcTypeCasesEntryVOList=list;
+        },
+        deep:true
+      }
+    },
+    methods:{
+      changeHospital(val){
+        localStorage.setItem("qcSelectHospital",val);
+        this.getQcTypeItem({hospitalId:val});
+      },
+      getQcTypeItem(){
+        const { hospitalId,name } = this.form;
+        if(hospitalId === ''){
+          return
+        }
+        const param={hospitalId:hospitalId,input:name,size:500};
+        api.getQcTypeItem(param).then((res)=>{
+          if(res.data.code==="0") {
+            const data = res.data.data;
+            this.qcItemList = data;console.log(this.qcItemList)
+          }else{
+            this.warning("获取缺陷条目失败");
+          }
+        });
+      },
+      getAllTypes(){
+        if(localStorage.getItem("qcHospitalTypes")){
+          this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
+          return ;
+        }
+        //获取枚举信息
+        api.getQcTypes().then((res)=>{
+          if(res.data.code==="0"){
+            const data = res.data.data;
+            localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
+            localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
+          }else{
+            this.warning("获取枚举信息失败");
+          }
+        });
+      },
+      comfirn(form){
+        this.$refs[form].validate((valid) => {
+          if (valid) {
+            if(this.form.id){//修改
+              const param = Object.assign({},this.form);
+              this.saveDisable = true;  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+              api.addQcType(param).then((res)=>{
+                if(res.data.code==0){
+                  this.$message({
+                    message:"修改成功",
+                    type:'success'
+                  });
+                  //返回带搜索条件的首页
+                  this.$router.push({
+                    name: 'QCTypeMang',
+                    params: Object.assign({}, this.$route.params, {currentPage: 1})
+                  });
+                }else{
+                  this.$message({
+                    message:res.data.msg,
+                    type:'warning'
+                  });
+                }
+                this.saveDisable = false
+              })
+            }else{//添加
+              const params = Object.assign({},this.form);
+              this.saveDisable = true;  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+              api.addQcType(params).then((res)=>{
+                if(res.data.code==0){
+                  this.$message({
+                    message:"添加成功",
+                    type:'success'
+                  });
+                  this.$router.push({name: 'QCTypeMang'});
+                }else{
+                  this.$message({
+                    message:res.data.msg,
+                    type:'warning'
+                  });
+                }
+                this.saveDisable = false
+              })
+            }
+          } else {
+            return false;
+          }
+        });
+      },
+      warning(msg, type,time) {
+        this.$message({
+          showClose: true,
+          message: msg,
+          type: type || 'warning',
+          duration:time || '3000'
+        })
+      },
+    }
+  }
+</script>
+<style>
+    .content .el-form-item.is-success .el-input__inner{
+        border-color: #ccc;
+    }
+    .content .el-form-item.is-success .el-input__inner:focus{
+        border-color: #48C5D7;
+    }
+</style>
+<style lang="less" scoped>
+    .content {
+        background: #fff;
+        padding: 20px 20px 50px;
+        color: #545455;
+        min-width: 980px;
+        position: relative;
+    .el-checkbox{
+        display: inline-block;
+        margin: 0;
+    }
+    }
+    .el-form-item{
+        width: 900px;
+    }
+    .el-select.big-select{
+        width: 360px;
+    }
+</style>

+ 236 - 0
src/components/qualityControl/QCTypeMang.vue

@@ -0,0 +1,236 @@
+<template>
+    <div>
+        <crumbs title="质控类型维护">
+            <el-form :inline="true" class="demo-form-inline">
+                <el-form-item label="所属医院:">
+                    <el-select size="mini" v-model="filter.hospitalId" placeholder="所属医院" clearable>
+                        <el-option v-for="item in hisTypes" :label="item.name" :value="item.val" :key="item.id"></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>
+                    <el-button size="mini" type="warning" @click="addBaseField">添加质控类型</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="id"
+                        width="100"
+                        label="质控ID">
+                </el-table-column>
+                <el-table-column
+                        prop="gmtModified"
+                        label="所属医院"
+                        :formatter="hisFormatter"
+                        :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column
+                        prop="name"
+                        label="质控类型">
+                </el-table-column>
+                <el-table-column
+                        label="操作" width="100">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="toEditField(scope.row, 'modify')">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" @click="toEditField(scope.row, 'copy')">复制</el-button>
+                        <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <el-pagination v-if="total>pageSize"
+                           :current-page.sync="currentPage"
+                           @current-change="currentChange"
+                           background
+                           :page-size="pageSize"
+                           layout="total,prev, pager, next, jumper"
+                           :total="total">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+
+<script>
+  import api from '@api/qualityControl.js';
+
+  export default {
+    name: 'QCTypeMang',
+    data: function () {
+      return {
+        list: [],
+        tagType:[1],
+        currentPage: 1,
+        pageSize: 10,
+        total: 0,
+        searched:false,
+        hisTypes:[],
+        filter: {
+          hospitalId:'',
+          name: ''
+        }
+      }
+    },
+    created() {
+      const _this=this;
+      setTimeout(function() {
+        _this.getAllTypes()
+      },100);
+    },
+    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: {
+      hisFormatter(item){
+        const field = this.hisTypes.filter((it)=>it.val==item.hospitalId);
+        return field[0]?field[0].name:'';
+      },
+      getAllTypes(){
+        if(localStorage.getItem("qcHospitalTypes")){
+          this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
+          this.getDataList();
+          return ;
+        }
+        //获取枚举信息
+        api.getQcTypes().then((res)=>{
+          if(res.data.code==="0"){
+            const data = res.data.data;
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
+            this.hisTypes =data[13];
+            this.getDataList();
+          }else{
+            this.warning("获取枚举信息失败");
+          }
+        });
+      },
+      addBaseField(){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        this.$router.push({name: 'AddQcType', params: pam});
+      },
+      toEditField(row,type){
+        api.getQcTypeDetail({hospitalId:row.hospitalId,id:row.id}).then((res)=>{
+          const {code,data,msg} = res.data;
+          if(code=='0'){
+            const item = Object.assign({},row,data);
+            const pam = this.searched ? {
+              currentPage: this.currentPage,
+              filter: this.filter
+            } : {currentPage: this.currentPage};
+            if(type == 'modify') {
+              this.$router.push({name: 'AddQcType', params: Object.assign(pam, {isEdit: true, info: item})});
+            } else if( type == 'copy') {
+              this.$router.push({name: 'AddQcType', params: Object.assign(pam, {isCopy: true, info: item})});
+            } else {
+              return
+            }
+          }else{
+            this.$message({
+              message: msg,
+              type: 'warning'
+            });
+          }
+        });
+        // this.$router.push({
+        //   name:'FieldMatch',
+        //   params: {info:row}
+        // })
+      },
+      filterDatas(){
+        this.currentPage = 1;
+        this.getDataList();
+      },
+      getDataList() {
+        const param = this.getFilterItems();
+        this.searched = true;
+        api.getQcTypeList(param).then((res) => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.list = data.records;
+            this.total = data.total;
+          }
+        }).catch((error) => {
+          console.log(error);
+        });
+      },
+      getFilterItems() {
+        const param = Object.assign({
+          current: this.currentPage,
+          size: this.pageSize
+        },this.filter);
+        return param;
+      },
+      indexMethod(index) {
+        return ((this.currentPage - 1) * this.pageSize) + index + 1;
+      },
+      currentChange(next) {
+        this.currentPage = next;
+        this.getDataList();
+      },
+      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(id){
+        this.showConfirmDialog('是否删除该字段映射?',()=>{
+          api.delQcType({ids:[id]}).then((res)=>{
+            if(res.data.code=='0'){
+              this.warning(res.data.msg||'操作成功','success');
+              this.getDataList();
+            }else{
+              this.warning(res.data.msg);
+            }
+          }).catch((error)=>{
+            this.warning(error);
+          })
+        });
+      }
+    }
+  }
+</script>
+
+<style lang="less">
+    @import "../../less/admin.less";
+    .delete{
+        color: red !important;
+    }
+</style>

+ 4 - 0
src/routes.js

@@ -129,6 +129,8 @@ import CombineFeild from '@components/qualityControl/CombineFeildList.vue';
 import AddCombineFeild from '@components/qualityControl/AddCombineFeild.vue';
 import QualityControlTemp from '@components/qualityControl/QualityControlTemp.vue';
 import AddQualityControlTemp from '@components/qualityControl/AddQualityControlTemp.vue';
+import QCTypeMang from '@components/qualityControl/QCTypeMang.vue';
+import AddQcType from '@components/qualityControl/AddQcType.vue';
 //病历录入
 import RecordInput from '@components/recordInput/RecordList.vue';
 import AddRecordInput from '@components/recordInput/AddRecord.vue';
@@ -328,6 +330,8 @@ export default [
       {path: 'LT-BLZK-BLTM',name:'RecordItemList', component: RecordItemList},//病例条目
       {path: 'LT-BLZK-TJBLTM',name:'AddRecordItem', component: AddRecordItem},//病例条目
       {path: 'LT-BLZK-PLGLBLTM',name:'ManageItemBatch', component: ManageItemBatch},//病例条目
+      {path:'LT-ZKYMSJWH-ZKLXWH',name:'QCTypeMang',component: QCTypeMang},  //质控类型
+      {path:'LT-ZKYMSJWH-TJZKLXWH',name:'AddQcType',component: AddQcType},  //添加质控类型
 
     ]
   }