Przeglądaj źródła

回退到质控类型关联前

zhouna 4 lat temu
rodzic
commit
f946add756

+ 4 - 6
src/components/qualityControl/AddCombineFeild.vue

@@ -157,20 +157,18 @@
     },
     methods:{
       getAllTypes(){
-        /*if(localStorage.getItem("qcModuleTypes")){
+        if(localStorage.getItem("qcModuleTypes")){
           this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
           this.fieldTypes = JSON.parse(localStorage.getItem("qcModuleTypes"));
           return ;
-        }*/
+        }
         //获取枚举信息
         api.getQcTypes().then((res)=>{
           if(res.data.code==="0"){
             const data = res.data.data;
-            /*localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
+            localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
             localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
-            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));*/
-            this.hisTypes = data[13];
-            this.fieldTypes =data[12];
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
           }else{
             this.warning("获取枚举信息失败");
           }

+ 70 - 51
src/components/qualityControl/AddQcType.vue

@@ -14,7 +14,7 @@
                                     v-for="item in hisTypes"
                                     :key="item.val"
                                     :label="item.name"
-                                    :value="item.val">
+                                    :value="Number(item.val)">
                             </el-option>
                         </el-select>
                     </el-form-item>
@@ -34,7 +34,7 @@
                       <span class="showInfo">{{form.defaultModule==1?'是':'否'}}</span>
                     </el-form-item> -->
 
-                    <el-form-item label="质控条目:" prop="qcItem" :class="spread?'qcitem-list':'qcitem-list-up'">
+                    <el-form-item label="质控条目:" prop="qcItem">
                         <el-collapse>
                             <el-collapse-item v-for="(item,i) in qcItemList" :title="i" :name="i">
                                 <el-table
@@ -70,15 +70,6 @@
                             </el-collapse-item>
                         </el-collapse>
                     </el-form-item>
-                    <img v-if="spread" src="../../images/up.png" class="spread-icon" @click="toggleSpread" title="收起" alt="收起"/>
-                    <img v-if="!spread" src="../../images/spread.png" class="spread-icon" @click="toggleSpread" title="展开" alt="展开"/>
-                    <el-form-item label="其他质控类型:" prop="typeIdList" class="formItem widthLarge">
-                    </el-form-item>
-                    <OtherQcTypePour :hospital="form.hospitalId"
-                                     :moduleName="form.entryId"
-                                     :typeId="form.id"
-                                     @changeActionData="moduleTypeChange"
-                                     :selectedTag="form.qcTypeSimpDTOList"></OtherQcTypePour>
                     <el-button class="disclButn" size="small" type="primary" :disabled = 'saveDisable' @click="comfirn('form')">确定</el-button>
                 </el-form>
             </div>
@@ -87,7 +78,6 @@
 </template>
 <script type="text/javascript">
   import api from '@api/qualityControl.js';
-  import OtherQcTypePour from './OtherQcTypePour.vue';
   export default {
     name:'AddQcType',
     data(){
@@ -96,16 +86,11 @@
         list:[],
         labelPosition:'left',
         title:'质控类型维护-添加质控类型',
-        spread:false,
-        hisTypes:[],
         form:{
           id:'',
-          hospitalId:'',
+          hospitalId:"",
           name:'',
           qcTypeCasesEntryVOList:[],
-          qcTypeSimpDTOList:[],
-          entryId:'',     //兼容
-          typeIdList:[],//其他质控类型id
           // defaultModule: 0
         },
         rules:{
@@ -127,9 +112,6 @@
         qcItemList:{},
       }
     },
-    components:{
-      OtherQcTypePour
-    },
     created(){
       this.getAllTypes();
       let {isCopy,info} = this.$route.params;
@@ -140,20 +122,16 @@
         this.qcItemList=infoCopy.entryMap;
         this.form = {
           id:isCopy?"":infoCopy.id,
-          hospitalId:''+infoCopy.hospitalId,
+          hospitalId:infoCopy.hospitalId,
           name:infoCopy.name,
           qcTypeCasesEntryVOList:[],
-          qcTypeSimpDTOList:isCopy?[]:infoCopy.qcTypeSimpDTOList,
           // defaultModule:+infoCopy.defaultModule
         };
         //this.getQcTypeItem({hospitalId:info.hospitalId});
       }else{
-        const that = this;
-        setTimeout(()=>{
-          let hospitalId = that.hisTypes[0].val;
-          that.form.hospitalId = hospitalId;
-          that.getQcTypeItem({hospitalId:hospitalId});
-        },100)
+        let hospitalId = localStorage.getItem("qcSelectHospital")||this.hisTypes[0].val;
+        this.form.hospitalId = +hospitalId;
+        this.getQcTypeItem({hospitalId:hospitalId});
       }
     },
     watch:{
@@ -174,12 +152,6 @@
     },
     methods:{
       handleTemChange() {},
-      toggleSpread(){
-        this.spread=!this.spread;
-      },
-      moduleTypeChange(list){
-        this.form.typeIdList=[...list];
-      },
       changeHospital(val){
         localStorage.setItem("qcSelectHospital",val);
         this.getQcTypeItem({hospitalId:val});
@@ -200,18 +172,17 @@
         });
       },
       getAllTypes(){
-        /*if(localStorage.getItem("qcHospitalTypes")){
+        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;
-            this.hisTypes =data[13];
-            /*localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
+            localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
             localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
-            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));*/
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
           }else{
             this.warning("获取枚举信息失败");
           }
@@ -221,10 +192,39 @@
         this.$refs[form].validate((valid) => {
           if (valid) {
             if(this.form.id){//修改
-              let param = Object.assign({},this.form,{qcTypeSimpDTOList:undefined});
+              let param = Object.assign({},this.form);
               param.name=param.name.trim();
               this.saveDisable = true;  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
               api.addQcType(param).then((res)=>{
+                // if (res.data.code === '-1') {
+                //   // 默认标准类型存在,是否替换
+                //   this.$alert('默认标准类型已存在,是否替换?', '提示', {
+                //     confirmButtonText: '确定',
+                //     type: 'warning'
+                //   })
+                //     .then(() => {
+                //       param = { ...param, defineType: 1 };
+                //       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'
+                //           });
+                //         }
+                //       });
+                //     })
+                //     .catch(() => {});
+                // } else 
                 if(res.data.code==0){
                   this.$message({
                     message:"修改成功",
@@ -248,6 +248,35 @@
               params.name=params.name.trim();
               this.saveDisable = true;  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
               api.addQcType(params).then((res)=>{
+                // if (res.data.code === '-1') {
+                //   // 默认标准类型存在,是否替换
+                //   this.$alert('默认标准类型已存在,是否替换?', '提示', {
+                //     confirmButtonText: '确定',
+                //     type: 'warning'
+                //   })
+                //     .then(() => {
+                //       params = { ...params, defineType: 1 };
+                //       api.addQcType(params).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'
+                //           });
+                //         }
+                //       });
+                //     })
+                //     .catch(() => {});
+                // } else 
                 if(res.data.code==0){
                   this.$message({
                     message:"添加成功",
@@ -308,14 +337,4 @@
     .showInfo {
       margin-left: 16px;
     }
-    .qcitem-list-up{
-        max-height: 150px;
-        overflow-y: hidden;
-    }
-    .spread-icon{
-        width: 20px;
-        height: 20px;
-        cursor: pointer;
-        margin-left: 448px;
-    }
 </style>

+ 8 - 6
src/components/qualityControl/AddQualityControlTemp.vue

@@ -232,22 +232,24 @@ export default {
       }
     },
     getAllTypes() {
-      /*if (localStorage.getItem('qcModuleTypes')) {
+      if (localStorage.getItem('qcModuleTypes')) {
         this.hospitalList = JSON.parse(localStorage.getItem('qcHospitalTypes'));
         this.moduleList = JSON.parse(localStorage.getItem('qcModuleTypes'));
         return new Promise(function(resolve, reject) {
           resolve();
         });
-      }*/
+      }
       //获取枚举信息
       return api.getQcTypes().then(res => {
         if (res.data.code === '0') {
           const data = res.data.data;
-          /*localStorage.setItem('qcFieldTypes', JSON.stringify(data[11]));
+          localStorage.setItem('qcFieldTypes', JSON.stringify(data[11]));
           localStorage.setItem('qcModuleTypes', JSON.stringify(data[12]));
-          localStorage.setItem('qcHospitalTypes', JSON.stringify(data[13]));*/
-          this.hospitalList = data[13];
-          this.moduleList = data[12];
+          localStorage.setItem('qcHospitalTypes', JSON.stringify(data[13]));
+          this.hospitalList = JSON.parse(
+            localStorage.getItem('qcHospitalTypes')
+          );
+          this.moduleList = JSON.parse(localStorage.getItem('qcModuleTypes'));
         } else {
           this.warning('获取枚举信息失败');
         }

+ 4 - 4
src/components/qualityControl/BaseFieldList.vue

@@ -152,18 +152,18 @@
         return field[0]?field[0].name:'';
       },
       getAllTypes(){
-        /*if(localStorage.getItem("qcModuleTypes")){
+        if(localStorage.getItem("qcModuleTypes")){
           this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
           this.fieldTypes = JSON.parse(localStorage.getItem("qcModuleTypes"));
           this.getDataList();
           return ;
-        }*/
+        }
         //获取枚举信息
         api.getQcTypes().then((res)=>{
           if(res.data.code==="0"){
             const data = res.data.data;
-            //localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
-            //localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
+            localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
             this.hisTypes =data[13];
             this.fieldTypes =data[12];
             this.getDataList();

+ 4 - 4
src/components/qualityControl/CombineFeildList.vue

@@ -133,18 +133,18 @@
         return field[0]?field[0].name:'';
       },
       getAllTypes(){
-        /*if(localStorage.getItem("qcModuleTypes")){
+        if(localStorage.getItem("qcModuleTypes")){
           this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
           this.fieldTypes = JSON.parse(localStorage.getItem("qcModuleTypes"));
           this.getDataList();
           return ;
-        }*/
+        }
         //获取枚举信息
         api.getQcTypes().then((res)=>{
           if(res.data.code==="0"){
             const data = res.data.data;
-            //localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
-            //localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
+            localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
             this.hisTypes =data[13];
             this.fieldTypes =data[12];
             this.getDataList();

+ 4 - 6
src/components/qualityControl/FieldMatch.vue

@@ -212,20 +212,18 @@
         });
       },
       getAllTypes(){
-        /*if(localStorage.getItem("qcModuleTypes")){
+        if(localStorage.getItem("qcModuleTypes")){
           this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
           this.fieldTypes = JSON.parse(localStorage.getItem("qcModuleTypes"));
           return ;
-        }*/
+        }
         //获取枚举信息
         api.getQcTypes().then((res)=>{
           if(res.data.code==="0"){
             const data = res.data.data;
-            this.hisTypes =data[13];
-            this.fieldTypes=data[12];
-            /*localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
+            localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
             localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
-            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));*/
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
           }else{
             this.warning("获取枚举信息失败");
           }

+ 4 - 5
src/components/qualityControl/ItemDataType.vue

@@ -161,21 +161,20 @@
         return it?it.name:'';
       },
       getAllTypes(){
-          /*if(localStorage.getItem("qcModuleTypes")){
+          if(localStorage.getItem("qcModuleTypes")){
               this.hospitalList = JSON.parse(localStorage.getItem("qcHospitalTypes"));
               return new Promise(function(resolve, reject){
                   resolve()
               });
-          }*/
+          }
           //获取枚举信息
           return api.getQcTypes().then((res)=>{
               if(res.data.code==="0"){
                   const data = res.data.data;
-                    this.hospitalList =data[13];
-                  /*localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
+                  localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
                   localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
                   localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
-                  this.hospitalList = JSON.parse(localStorage.getItem("qcHospitalTypes"));*/
+                  this.hospitalList = JSON.parse(localStorage.getItem("qcHospitalTypes"));
               }else{
                   this.warning("获取枚举信息失败");
               }

+ 4 - 6
src/components/qualityControl/ItemDataTypeRelation.vue

@@ -175,24 +175,22 @@ export default {
             
         },
         getAllTypes(){
-            /*if(localStorage.getItem("qcModuleTypes")){
+            if(localStorage.getItem("qcModuleTypes")){
                 this.hospitalList = JSON.parse(localStorage.getItem("qcHospitalTypes"));
                 this.moduleList = JSON.parse(localStorage.getItem("qcModuleTypes"));
                 return new Promise(function(resolve, reject){
                     resolve()
                 });
-            }*/
+            }
             //获取枚举信息
             return api.getQcTypes().then((res)=>{
                 if(res.data.code==="0"){
                     const data = res.data.data;
-                  this.hospitalList =data[13];
-                  this.moduleList = data[12];
-                    /*localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
+                    localStorage.setItem("qcFieldTypes",JSON.stringify(data[11]));
                     localStorage.setItem("qcModuleTypes",JSON.stringify(data[12]));
                     localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
                     this.hospitalList = JSON.parse(localStorage.getItem("qcHospitalTypes"));
-                    this.moduleList = JSON.parse(localStorage.getItem("qcModuleTypes"));*/
+                    this.moduleList = JSON.parse(localStorage.getItem("qcModuleTypes"));
                 }else{
                     this.warning("获取枚举信息失败");
                 }

+ 8 - 49
src/components/qualityControl/QCTypeMang.vue

@@ -56,11 +56,11 @@
                 <el-table-column
                         label="操作" width="150">
                     <template slot-scope="scope">
-                        <el-button type="text" size="small" @click="ifUnbindDialog(scope.row, 'modify')">修改</el-button>
+                        <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="ifUnbindDialog(scope.row)">删除</el-button>
+                        <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -160,16 +160,16 @@
         return field[0]?field[0].name:'';
       },
       getAllTypes(){
-        /*if(localStorage.getItem("qcHospitalTypes")){
+        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]));
+            localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
             this.hisTypes =data[13];
             this.getDataList();
           }else{
@@ -251,51 +251,16 @@
         })
       },
       showConfirmDialog(msg,resolve){
-        this.$confirm(msg, '提示', {
+        this.$alert(msg, '提示', {
           confirmButtonText: '确定',
-          cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
           resolve();
         }).catch(() => {});
       },
-      ifUnbindDialog(data,type){
-        api.ifNeedUnbind({id:data.id,hospitalId:data.hospitalId,cancel:null}).then((res)=>{
-        const {code,msg} = res.data;
-          if(code==='00000005'){
-            this.showConfirmDialog(msg,()=>{
-              this.unbindQcType(data,type);
-            });
-          }else{
-            if(type==='modify'){
-              this.toEditField(data,type);     //编辑
-            }else{
-              this.showDelDialog(data);     //删除
-            }
-          }
-        }).catch((error)=>{
-          this.warning(error);
-        })
-      },
-      unbindQcType(data,type){
-        api.ifNeedUnbind({id:data.id,hospitalId:data.hospitalId,cancel:1}).then((res)=>{
-          if(res.data.code=='00000005'){
-            this.warning(res.data.msg||'解绑成功','success');
-            if(type==='modify'){
-              this.toEditField(data,type);     //编辑
-            }else{
-              this.showDelDialog(data);     //删除
-            }
-          }else{
-            this.warning(res.data.msg);
-          }
-        }).catch((error)=>{
-          this.warning(error);
-        })
-      },
-      showDelDialog(row){
+      showDelDialog(id){
         this.showConfirmDialog('是否删除该质控类型?',()=>{
-          api.delQcType({ids:[row.id]}).then((res)=>{
+          api.delQcType({ids:[id]}).then((res)=>{
             if(res.data.code=='0'){
               this.warning(res.data.msg||'操作成功','success');
               this.getDataList();
@@ -316,10 +281,4 @@
     .delete{
         color: red !important;
     }
-    .el-message-box__btns .el-button--default span{
-        color: @adminBase;
-    }
-    .el-message-box__btns .el-button--primary span{
-        color: #fff;
-    }
 </style>

+ 8 - 6
src/components/qualityControl/QualityControlTemp.vue

@@ -196,22 +196,24 @@ export default {
       return it ? it.name : '';
     },
     getAllTypes() {
-      /*if (localStorage.getItem('qcModuleTypes')) {
+      if (localStorage.getItem('qcModuleTypes')) {
         this.hospitalList = JSON.parse(localStorage.getItem('qcHospitalTypes'));
         this.moduleList = JSON.parse(localStorage.getItem('qcModuleTypes'));
         return new Promise(function(resolve, reject) {
           resolve();
         });
-      }*/
+      }
       //获取枚举信息
       return api.getQcTypes().then(res => {
         if (res.data.code === '0') {
           const data = res.data.data;
-          /*localStorage.setItem('qcFieldTypes', JSON.stringify(data[11]));
+          localStorage.setItem('qcFieldTypes', JSON.stringify(data[11]));
           localStorage.setItem('qcModuleTypes', JSON.stringify(data[12]));
-          localStorage.setItem('qcHospitalTypes', JSON.stringify(data[13]));*/
-          this.hospitalList = data[13];
-          this.moduleList = data[12];
+          localStorage.setItem('qcHospitalTypes', JSON.stringify(data[13]));
+          this.hospitalList = JSON.parse(
+            localStorage.getItem('qcHospitalTypes')
+          );
+          this.moduleList = JSON.parse(localStorage.getItem('qcModuleTypes'));
         } else {
           this.warning('获取枚举信息失败');
         }