From 683b2620e0fbfba24787046e2630cbfed0337484 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期四, 04 七月 2024 17:32:44 +0800
Subject: [PATCH] qxtj

---
 src/views/system/tijian/index.vue   |  120 +++++++++++++++-
 src/views/doctor/checkAll/index.vue |   20 +-
 src/views/hosp/order/index.vue      |   77 +++++++++++
 vue.config.js                       |   12 +
 src/utils/request1.js               |  168 ++++++++++++++++++++++++
 src/api/system/tijian.js            |    9 +
 6 files changed, 386 insertions(+), 20 deletions(-)

diff --git a/src/api/system/tijian.js b/src/api/system/tijian.js
index 6eac46d..db75ad4 100644
--- a/src/api/system/tijian.js
+++ b/src/api/system/tijian.js
@@ -1,4 +1,5 @@
 import request from "@/utils/request";
+import request1 from "@/utils/request1";
 
 // 鏌ヨ浣撴濂楅鍒楄〃
 export function deptTreeSelect(cusSex) {
@@ -188,3 +189,11 @@
     params:{zhId:zhId}
   });
 }
+
+
+export function readCertCardInfos() {
+  return request1({
+    url: "/readCertCardInfos",
+    method: "get",
+  });
+}
\ No newline at end of file
diff --git a/src/utils/request1.js b/src/utils/request1.js
new file mode 100644
index 0000000..72586f2
--- /dev/null
+++ b/src/utils/request1.js
@@ -0,0 +1,168 @@
+import axios from 'axios'
+import { Notification, MessageBox, Message, Loading } from 'element-ui'
+import store from '@/store'
+import { getToken } from '@/utils/auth'
+import errorCode from '@/utils/errorCode'
+import { tansParams, blobValidate } from "@/utils/ruoyi";
+import cache from '@/plugins/cache'
+import { saveAs } from 'file-saver'
+
+let downloadLoadingInstance;
+// 鏄惁鏄剧ず閲嶆柊鐧诲綍
+export let isRelogin = { show: false };
+// let url = window.location.protocol + "//" + window.location.host+ ':6789';
+axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
+// 鍒涘缓axios瀹炰緥
+const service = axios.create({
+  // axios涓姹傞厤缃湁baseURL閫夐」锛岃〃绀鸿姹俇RL鍏叡閮ㄥ垎
+  // baseURL:url,
+  baseURL:'/douban',
+  // 瓒呮椂
+  timeout: 20000
+})
+
+// request鎷︽埅鍣�
+service.interceptors.request.use(config => {
+  // 鏄惁闇�瑕佽缃� token
+  const isToken = (config.headers || {}).isToken === false
+  // 鏄惁闇�瑕侀槻姝㈡暟鎹噸澶嶆彁浜�
+  const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
+  if (getToken() && !isToken) {
+    config.headers['Authorization'] = 'Bearer ' + getToken() // 璁╂瘡涓姹傛惡甯﹁嚜瀹氫箟token 璇锋牴鎹疄闄呮儏鍐佃嚜琛屼慨鏀�
+  }
+  // get璇锋眰鏄犲皠params鍙傛暟
+  if (config.method === 'get' && config.params) {
+    let url = config.url + '?' + tansParams(config.params);
+    url = url.slice(0, -1);
+    config.params = {};
+    config.url = url;
+  }
+  if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
+    const requestObj = {
+      url: config.url,
+      data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
+      time: new Date().getTime()
+    }
+    const sessionObj = cache.session.getJSON('sessionObj')
+    if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
+      cache.session.setJSON('sessionObj', requestObj)
+    } else {
+      const s_url = sessionObj.url;                  // 璇锋眰鍦板潃
+      const s_data = sessionObj.data;                // 璇锋眰鏁版嵁
+      const s_time = sessionObj.time;                // 璇锋眰鏃堕棿
+      const interval = 1000;                         // 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦
+      if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
+        // const message = '鏁版嵁姝e湪澶勭悊锛岃鍕块噸澶嶆彁浜�';
+        // const message = '';
+        // console.warn(`[${s_url}]: ` + message)
+        // return Promise.reject(new Error(message))
+        return Promise.reject()
+      } else {
+        cache.session.setJSON('sessionObj', requestObj)
+      }
+    }
+  }
+  return config
+}, error => {
+    // console.log(error)
+    Promise.reject(error)
+})
+
+// 鍝嶅簲鎷︽埅鍣�
+service.interceptors.response.use(res => {
+    // 鏈缃姸鎬佺爜鍒欓粯璁ゆ垚鍔熺姸鎬�
+    const code = res.data.code || 200;
+    // 鑾峰彇閿欒淇℃伅
+    const msg = errorCode[code] || res.data.msg || errorCode['default']
+    // 浜岃繘鍒舵暟鎹垯鐩存帴杩斿洖
+    if(res.request.responseType ===  'blob' || res.request.responseType ===  'arraybuffer'){
+      return res.data
+    }
+    if (code === 401) {
+      if (!isRelogin.show) {
+        isRelogin.show = true;
+        MessageBox.confirm('鐧诲綍鐘舵�佸凡杩囨湡锛屾偍鍙互缁х画鐣欏湪璇ラ〉闈紝鎴栬�呴噸鏂扮櫥褰�', '绯荤粺鎻愮ず', {
+          confirmButtonText: '閲嶆柊鐧诲綍',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning'
+        }
+      ).then(() => {
+        isRelogin.show = false;
+        store.dispatch('LogOut').then(() => {
+          location.href = '/index';
+        })
+      }).catch(() => {
+        isRelogin.show = false;
+      });
+    }
+      return Promise.reject('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�')
+    } else if (code === 500) {
+      Message({
+        message: msg,
+        type: 'error'
+      })
+      return Promise.reject(new Error(msg))
+    } else if (code === 601) {
+      Message({
+        message: msg,
+        type: 'warning'
+      })
+      return Promise.reject('error')
+    } else if (code !== 200) {
+      Notification.error({
+        title: msg
+      })
+      return Promise.reject('error')
+    } else {
+      return res.data
+    }
+  },
+  error => {
+    // console.log('err' + error)
+    let { message } = error;
+    if (message == "Network Error") {
+      message = "鍚庣鎺ュ彛杩炴帴寮傚父";
+    }
+    // else if (message.includes("timeout")) {
+    //   message = "鏁版嵁鍔犺浇澶辫触锛岃鍒锋柊椤甸潰";
+    // }
+    else if (message.includes("Request failed with status code")) {
+      message = "绯荤粺鎺ュ彛" + message.substr(message.length - 3) + "寮傚父";
+    }
+    Message({
+      message: message,
+      type: 'error',
+      duration: 5 * 1000
+    })
+    return Promise.reject(error)
+  }
+)
+
+// 閫氱敤涓嬭浇鏂规硶
+export function download(url, params, filename, config) {
+  downloadLoadingInstance = Loading.service({ text: "姝e湪涓嬭浇鏁版嵁锛岃绋嶅��", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
+  return service.post(url, params, {
+    transformRequest: [(params) => { return tansParams(params) }],
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+    responseType: 'blob',
+    ...config
+  }).then(async (data) => {
+    const isLogin = await blobValidate(data);
+    if (isLogin) {
+      const blob = new Blob([data])
+      saveAs(blob, filename)
+    } else {
+      const resText = await data.text();
+      const rspObj = JSON.parse(resText);
+      const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
+      Message.error(errMsg);
+    }
+    downloadLoadingInstance.close();
+  }).catch((r) => {
+    console.error(r)
+    Message.error('涓嬭浇鏂囦欢鍑虹幇閿欒锛岃鑱旂郴绠$悊鍛橈紒')
+    downloadLoadingInstance.close();
+  })
+}
+
+export default service
diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index 1b87ce6..bc6558e 100644
--- a/src/views/doctor/checkAll/index.vue
+++ b/src/views/doctor/checkAll/index.vue
@@ -95,6 +95,7 @@
         ref="table"
         border
         style="margin: 20px; width: 98%"
+        @current-change="handleCurrentChange"
       >
         <!-- <template slot="empty">鏁版嵁姝e湪鍔犺浇涓�</template> -->
         <el-table-column
@@ -297,14 +298,14 @@
         <el-row>
           <el-col :span="18">
             <div style="margin: 10px 10px">
-              <el-radio-group
+               <!--<el-radio-group
                 v-model="tjproject"
                 @input="radiotjprojectChange"
                 style="margin-left: 20px"
               >
                 <el-radio-button label="0">浣撴椤圭洰</el-radio-button>
                 <el-radio-button label="1">鍖栭獙椤圭洰</el-radio-button>
-              </el-radio-group>
+              </el-radio-group> -->
             </div>
           </el-col>
           <el-col :span="6">
@@ -385,14 +386,14 @@
                       {{
                         scope.row.standard.tjStandardGtValue +
                         "-" +
-                        scope.row.standard.tjStandardLtValue
+                        scope.row.standard.tjStandardLtValue || "/"
                       }}
                     </div>
-                    <div v-else>{{ scope.row.stanId }}</div>
+                    <div v-else>{{ scope.row.stanId || "/"}}</div>
                   </template>
                 </el-table-column>
               </el-table>
-              <table style="width: 100%">
+              <table style="width: 100%" v-if="tjproject!='1'">
                 <tr
                   style="border: 1px solid #dfe6ec; border-collapse: collapse"
                 >
@@ -467,7 +468,7 @@
               </table>
             </div>
 
-            <div style="margin: 0 0px 10px 15px">
+            <div style="margin: 0 0px 10px 15px" v-if="tjproject!='1'">
               <el-button type="primary" @click="propoChange"
                 >蹇嵎寤鸿</el-button
               >
@@ -480,6 +481,7 @@
               ref="numberValidateForm"
               label-width="80px"
               class="demo-ruleForm"
+              v-if="tjproject!='1'"
             >
               <el-form-item label="鎬绘寤鸿">
                 <el-input
@@ -1588,6 +1590,10 @@
       }
     },
 
+    handleCurrentChange(val){
+      this.handleClick(val)
+    },
+
     // 鐐瑰嚮璇︽儏
     handleClick(row) {
       this.$refs.Pre.open = false;
@@ -1626,6 +1632,7 @@
                     for (let i = 0; i < this.changedate.length; i++) {
                       this.remark = this.changedate[i].remark;
                     }
+                    console.log( this.changedate)
                     this.changedate.forEach((item) => {
                       // this.remark = item.remark;
                       item.sons.forEach((item3) => {
@@ -1636,7 +1643,6 @@
                           item3.standard.tjStandardLtValue = "";
                         }
                       });
-                      // item.remark = "";
                     });
                   } else {
                     this.$message({
diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 4635080..2c3440a 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -116,6 +116,16 @@
           >琛ュ綍椤圭洰</el-button
         >
       </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="primary"
+          size="mini"
+          @click="revokeProject"
+          :disabled="single"
+          v-hasPermi="['hosp:order:export']"
+          >鎾ら攢琛ュ綍</el-button
+        >
+      </el-col> -->
 
       <el-col :span="1.5">
         <el-button
@@ -863,6 +873,70 @@
         <el-button @click="cancel">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+
+    <!-- <el-dialog
+      :title="title"
+      :visible.sync="Projectopen"
+      width="1100px"
+      style="height: 860px"
+      append-to-body
+    >
+      <el-row type="flex" class="row-bg" justify="space-around">
+        <el-col :span="6">
+          <div
+            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
+          >
+            椤圭洰鍒楄〃
+          </div>
+          <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
+          </el-input>
+          <div class="tab3">
+            <el-table
+              :data="DataList"
+              border
+              style="width: 100%"
+              height="400"
+              :span-method="objectSpanMethod"
+            >
+              <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
+              </el-table-column>
+              <el-table-column prop="proPrice" label="鍘熶环" width="56px">
+              </el-table-column>
+              <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px">
+              </el-table-column>
+
+            
+            </el-table>
+          </div>
+        </el-col>
+       
+        <el-col :span="11">
+          <div class="grid-content bg-purple">
+            <div
+              style="text-align: center; margin-bottom: 10px; margin-top: 10px"
+            >
+              琛ュ綍椤圭洰
+            </div>
+            <el-table
+              :data="DataList"
+              border
+              style="width: 100%"
+              height="400"
+              :span-method="objectSpanMethod"
+            >
+              <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
+              </el-table-column>
+              <el-table-column prop="proPrice" label="鍘熶环" width="56px">
+              </el-table-column>
+              <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px">
+              </el-table-column>
+
+            
+            </el-table>
+          </div>
+        </el-col>
+      </el-row>
+    </el-dialog> -->
   </div>
 </template>
 
@@ -1405,6 +1479,9 @@
         this.loading = false;
       });
     },
+    revokeProject(){
+      
+    },
     // 琛ュ綍椤圭洰
     handleProject1() {
       this.loading = true;
diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index a77240f..01a76ae 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -1381,7 +1381,8 @@
   getByTjNum,
 } from "@/api/hosp/customer";
 import { getPrintSetUp } from "@/api/system/examcharge";
-
+import axios from "axios";
+import { getIp } from '@/utils/auth'
 import {
   deptTreeSelect,
   projectGetList,
@@ -1398,6 +1399,7 @@
   getIsRequired,
   getconfigKey,
   getHistryTjOrderProByCusIdCard,
+  readCertCardInfos,
 } from "@/api/system/tijian";
 import Packages from "@/components/Packages";
 import { MessageBox } from "element-ui";
@@ -1591,6 +1593,8 @@
         pacRemark: null,
       },
       valueUrl: "ws://127.0.0.1:18890",
+      valueUrls: "ws://127.0.0.1:6789/websocket",
+      // valueUrls: "ws://"+getIp() +":6789/websocket",
       WebSocket: null,
       // 韬唤璇侀渶瑕�
       // socket: null,
@@ -1655,11 +1659,12 @@
   },
   created() {
     this.getCurrentDateTime();
-
     this.startTimer();
     this.getList1();
     // this.getData();
   },
+ 
+
   methods: {
     getCurrentDateTime() {
       const currentDate = new Date();
@@ -2350,6 +2355,91 @@
               this.$refs.aaa.open = true;
               this.$refs.aaa.getAllList();
               this.$refs.aaa.title = "璇佷欢瀛楀吀";
+            } else if (res.msg == "S") {
+              var websocket = null;
+              var url = this.valueUrls;
+              // var url = 'ws://'+ getIp() +':6789/websocket'
+              console.log(url)
+              if ("WebSocket" in window) {
+                websocket = new WebSocket(url);
+              } else if ("MozWebSocket" in window) {
+                websocket = new MozWebSocket(url);
+              } else {
+                // console.log("SockJS");
+              }
+              if (websocket == null) {
+                alert("11111");
+              }
+              websocket.onopen = function () {
+                try {
+                websocket.send("鍙戦��");
+              } catch (err) {
+                var tryTime = 0;
+                // 閲嶈瘯10娆★紝姣忔涔嬮棿闂撮殧3绉�
+                if (tryTime < 1) {
+                  var t1 = setTimeout(function () {
+                    tryTime++;
+                  
+                websocket.send("鍙戦��");
+              
+                  }, 1 * 1000);
+                } else {
+                  console.error("閲嶈繛澶辫触.");
+                }
+              }
+              };
+              websocket.onclose = function () {
+                alert("璇诲崱鍣ㄨ繛鎺ュ叧闂�");
+              };
+              websocket.onmessage = function (event) {
+              
+                var resultObj =JSON.parse(event.data);
+               _this.form.cusName = resultObj.data.name;
+                    _this.form.cusSex =
+                    resultObj.data.sex;
+                    _this.form.cusNational =resultObj.data.mz;
+                    _this.form.cusBrithday = resultObj.data.csrq;
+                    if (_this.form.cusBrithday) {
+                      _this.form.cusBrithday = _this.form.cusBrithday.replace(
+                        /^(\d{4})(\d{2})(\d{2})$/,
+                        "$1-$2-$3"
+                      );
+                    }
+                    _this.form.cusAddr = resultObj.data.addres;
+                    _this.form.cusIdcard = resultObj.data.card;
+              };
+
+              //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉�
+              websocket.onerror = function () {
+                alert("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父");
+              };
+            
+              // let url = window.location.protocol + "//" + window.location.host;
+              // console.log(url);
+              // axios
+              //   .get("http://localhost:81/dev-api/readCertCardInfos")
+              //   .then((res) => {
+              //     console.log(res);
+              //   })
+              //   .catch((err) => {
+              //     console.log(err);
+              //   });
+
+              // readCertCardInfos().then((res) => {
+              //   _this.form.cusName = res.data.name;
+              //       _this.form.cusSex =
+              //       res.data.sex;
+              //       _this.form.cusNational = res.data.mz;
+              //       _this.form.cusBrithday = res.data.csrq;
+              //       if (_this.form.cusBrithday) {
+              //         _this.form.cusBrithday = _this.form.cusBrithday.replace(
+              //           /^(\d{4})(\d{2})(\d{2})$/,
+              //           "$1-$2-$3"
+              //         );
+              //       }
+              //       _this.form.cusAddr = res.data.addres;
+              //       _this.form.cusIdcard = res.data.card;
+              // });
             }
           }
         });
@@ -2559,7 +2649,7 @@
         this.tableData.forEach((item) => {
           this.tableData1.forEach((item1) => {
             item.tjProjectList.forEach((item2) => {
-              console.log(item1)
+              console.log(item1);
               if (item2.proId == item1.proPrantId && item1.pacName == "鍗曢」") {
                 this.$confirm(
                   "璇ュ椁愬寘鍚簡宸查�夊崟椤癸紝鏄惁纭閫夋嫨璇ュ椁愶紵",
@@ -2572,14 +2662,14 @@
                 )
                   .then(() => {
                     this.$message({
-                        type: "success",
-                        message: "璇锋敞鎰忔煡鐪嬩环鏍�",
-                      });
+                      type: "success",
+                      message: "璇锋敞鎰忔煡鐪嬩环鏍�",
+                    });
                   })
                   .catch((action) => {
                     if (action === "cancel") {
                       let del_row = selection.shift();
-                      this.$refs.tb.toggleRowSelection(del_row, false); 
+                      this.$refs.tb.toggleRowSelection(del_row, false);
                       this.$message({
                         type: "warning",
                         message: "宸插彇娑�",
@@ -2632,11 +2722,11 @@
     handleClick(tab, event) {
       if (this.activeNames == "second") {
         this.DataList = [];
-        this.checkedkey= [];
+        this.checkedkey = [];
         this.getDataList();
       } else if (this.activeNames == "third") {
         this.DataLists = [];
-        this.checkedkeys= [];
+        this.checkedkeys = [];
         getZhList().then((response) => {
           if (response.data) {
             this.packageList = response.data;
@@ -3415,11 +3505,17 @@
   width: 100%;
   display: flex;
 }
-
 .tab3 {
-  max-height: 400px;
+  border: 1px solid #dcdfe6;
+}
+
+.filter-tree {
+  /* max-height: 360px;
   overflow-y: auto;
-  border: 1px solid #d9d9d9;
+  border: 1px solid #d9d9d9; */
+  overflow: auto;
+  flex: 1;
+  height: 350px;
 }
 
 .tab2 {
diff --git a/vue.config.js b/vue.config.js
index 0ed21b6..2622179 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -53,7 +53,7 @@
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `https://ltpeis.xaltjdkj.cn:5801/`,
-        target: `http://192.168.1.113:5011/ltkj-admin`,
+        target: `http://192.168.1.113:5011`,
         // // target: `http://192.168.0.99:8080/ltkj-admin`,
         // target: `https://ltpeis.xaltjdkj.cn:5011/ltkj-admin`,
         // target: `http://10.168.0.9:5011`,
@@ -62,6 +62,16 @@
           ["^" + process.env.VUE_APP_BASE_API]: "",
         },
       },
+      '/douban':{
+        target:'http://192.168.1.82:6789',
+        changeOrigin:true,
+        ws: true,
+        pathRewrite: {
+          '^/douban': '',
+        },
+       
+      },
+
     },
     disableHostCheck: true,
   },

--
Gitblit v1.8.0