zhangxc 5 роки тому
батько
коміт
22e8320141
1 змінених файлів з 19 додано та 4 видалено
  1. 19 4
      src/components/qualityControl/ItemDataType.vue

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

@@ -17,7 +17,7 @@
                 </el-form-item>
                 <el-form-item label="所属模块:">
                      <el-select size="mini" v-model.trim="filter.casesId"  placeholder="所属模块" clearable>
-                        <el-option v-for="item in moduleList" :label="item.name" :value="item.val" :key="item.id" ></el-option>
+                        <el-option v-for="item in moduleList" :label="item.name" :value="item.id" :key="item.id" ></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item label="条目编码:">
@@ -98,7 +98,8 @@
 </template>
 
 <script>
-    import api from '@api/qualityControl.js';
+  import api from '@api/qualityControl.js';
+  import apis from '@api/records.js';
   import config from '@api/config.js';
   import utils from '@api/utils.js'
   export default {
@@ -127,6 +128,7 @@
     created() {
       const _this=this;
       this.getTypeNameList()
+      this.getModuleList()
       setTimeout(function(){
         _this.getAllTypes().then(()=>{
           _this.getDataList()
@@ -161,7 +163,6 @@
       getAllTypes(){
           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()
               });
@@ -174,12 +175,12 @@
                   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"));
               }else{
                   this.warning("获取枚举信息失败");
               }
           });
       },
+      
       getTypeNameList(hospitalId){
         api.getQcEntryTypeByHospital({hospitalId:hospitalId}).then((res) => {
           if(res.data.code == 0){
@@ -189,6 +190,20 @@
           }
           
         })
+      },
+       getModuleList(){
+        return apis.getRecordCases({}).then((res)=>{
+          const result = res.data;
+          if(result.code==0){
+            this.moduleList = result.data
+          }else{
+            this.$message({
+              message:result.msg,
+              type:'warning',
+              showClose: true
+            });
+          }
+        })
       },
       handleSizeChange(val){
         this.pageSize = val;