xizhong преди 9 месеца
родител
ревизия
973a4a471f
променени са 6 файла, в които са добавени 139 реда и са изтрити 4 реда
  1. 2 1
      .env.development
  2. 1 0
      .env.production
  3. 10 0
      src/api/qc.js
  4. 103 0
      src/utils/request_api.js
  5. 16 3
      src/views/recordsRoom/qc/caseViews.vue
  6. 7 0
      vue.config.js

+ 2 - 1
.env.development

@@ -3,4 +3,5 @@ ENV = 'development'
 
 # base api
 VUE_APP_BASE_API = '/dev-api'
-VUE_APP_BASE_API2 = '/bazb'
+VUE_APP_BASE_API2 = '/bazb'
+VUE_APP_BASE_API3 = '/api'

+ 1 - 0
.env.production

@@ -4,3 +4,4 @@ ENV = 'production'
 # base api
 VUE_APP_BASE_API = '/admin'
 VUE_APP_BASE_API2 = '/bazb'
+VUE_APP_BASE_API3 = '/api'

+ 10 - 0
src/api/qc.js

@@ -1,5 +1,7 @@
 import request from '@/utils/request'
 import request2 from '@/utils/request_bazb'
+import request3 from '@/utils/request_api'
+
 // 病案室-质控列表
 export function getBlZkList(data) {
   return request({
@@ -17,6 +19,14 @@ export function getBlMenuList(data) {
     data: data
   })
 }
+// 病案室-病案详情-左侧菜单
+export function getTreeList(data) {
+  return request3({
+    url: '/getTree',
+    method: 'post',
+    data: data
+  })
+}
 
 // 病案室-病案详情-右侧质控栏
 export function getCaseQuality(data) {

+ 103 - 0
src/utils/request_api.js

@@ -0,0 +1,103 @@
+import axios from 'axios'
+import { Message } from 'element-ui'
+import { getToken, removeToken } from '@/utils/auth'
+import router, { resetRouter } from '@/router'
+
+// create an axios instance
+const service = axios.create({
+  baseURL: process.env.VUE_APP_BASE_API3, // url = base url + request url
+  timeout: 10000 // request timeout
+  // transformRequest: [function(data) { // 转换数据
+  //   const form = new FormData()
+  //   if (!data) {
+  //     return form
+  //   }
+  //   Object.keys(data).forEach(k => {
+  //     const v = (data[k] !== 0 && !data[k] || data[k] === null ? '' : data[k])
+  //     if (Array.isArray(v) && v !== null) {
+  //       Object.keys(v).forEach(key => {
+  //         const vv = (!v[key] || v[key] === null ? '' : v[key])
+  //         form.append(`${k}[${key}]`, vv)
+  //       })
+  //     } else {
+  //       form.append(k, v)
+  //     }
+  //   })
+  //   return form
+  // }],
+  // headers: {
+  //   'Content-Type': 'application/x-www-form-urlencoded'
+  // }
+})
+
+// request interceptor
+service.interceptors.request.use(
+  config => {
+    // do something before request is sent
+
+    if (getToken()) {
+      // console.log(config, getToken())
+      // let each request carry token
+      // ['X-Token'] is a custom headers key
+      // please modify it according to the actual situation
+      config.headers['token'] = getToken()
+    }
+    // 在请求发送之前做一些处理
+    const jsonStr = config.data
+    const data = jsonStr
+    config.data = data
+    return config
+  },
+  error => {
+    // 发送失败
+    Promise.reject(error)
+  }
+)
+
+// response interceptor
+service.interceptors.response.use(
+  /**
+   * If you want to get http information such as headers or status
+   * Please return  response => response
+  */
+
+  /**
+   * Determine the request status by custom code
+   * Here is just an example
+   * You can also judge the status by HTTP Status Code
+   */
+  response => {
+    const dataAxios = response.data
+    const { code } = dataAxios
+    // 根据 code 进行判断}
+    if (code === 200) {
+      // 如果没有 code 代表这不是项目后端开发的接口 比如可能是 VXAdmin 请求最新版本
+      return dataAxios
+    } else {
+      if (code === -1) {
+        Message({
+          message: `${dataAxios.msg}`,
+          type: 'error',
+          duration: 3 * 1000
+        })
+        removeToken()
+        resetRouter()
+        router.push(`/login`)
+        return
+      }
+      return Promise.reject(dataAxios.data)
+      //   //  发送的接口为response.config.url,进行报错处理
+    }
+  },
+  error => {
+    console.log('err' + error) // for debug
+    Message({
+      message: error.message,
+      type: 'error',
+      duration: 5 * 1000
+    })
+    return Promise.reject(error)
+  }
+)
+
+export default service

+ 16 - 3
src/views/recordsRoom/qc/caseViews.vue

@@ -174,7 +174,7 @@ import OutHospitalRecord from './components/OutHospitalRecord.vue'
 import CaseQualityBox from './components/CaseQualityBox2.vue'
 import DeathText from './components/DeathText.vue'
 import CreateControlResultDialogVue from './components/CreateControlResultDialog.vue'
-import { getCaseQuality, getCasePlatform, getAllCase, getLong, getTemporary, getPacsData, getBcData, getHomeData, getSurgeryData, getBlInfo } from '@/api/qc'
+import { getTreeList,getBlMenuList,getCaseQuality, getCasePlatform, getAllCase, getLong, getTemporary, getPacsData, getBcData, getHomeData, getSurgeryData, getBlInfo } from '@/api/qc'
 import { getCaseExamineAppeal } from '@/api/admin'
 import { getToken, removeToken } from '@/utils/auth'
 
@@ -324,6 +324,7 @@ export default {
       this.funQuery()
       this.getCaseQualityResults()
     }
+    this.getTree()
   },
 
   methods: {
@@ -356,8 +357,8 @@ export default {
       console.log(e)
       let that = this;
       that.appealInfo = e;
-      that.alertForm.case_document = e.case_document?e.case_document:'';
-      that.alertForm.case_docter = e.case_docter?e.case_docter:'';
+      that.alertForm.case_document = localStorage.getItem('KSMC');
+      that.alertForm.case_docter = localStorage.getItem('realname');
       if(e.status == 1){
         // 通过
         that.editSubmit();
@@ -461,6 +462,18 @@ export default {
         this.is_active_blbh = this.mainHomeData.MED_REC_ID
       })
     },
+    getTree() {
+      const that = this
+      const pramse = {
+        id: this.valData
+      }
+      getTreeList(pramse).then(res => {
+        that.treeList = res.data
+        // const { p } = res
+        // 初始化blbh
+        // that.is_active_blbh = p[0].blbh
+      })
+    },
     clickTree(b, n, item) {
       if (item) {
         if (item.blbh) {

+ 7 - 0
vue.config.js

@@ -54,6 +54,13 @@ module.exports = {
           ['^' + process.env.VUE_APP_BASE_API2]: '/bazb/'
         }
       },
+      [process.env.VUE_APP_BASE_API3]: {
+        target: 'http://182.43.50.128:8083',
+        changeOrigin: true,
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_BASE_API3]: '/api/'
+        }
+      },
     },
     port: port,
     open: true,