Browse Source

优化代码,检验检查自动填充值

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
6cb9493f94

+ 3 - 1
src/components/xiao-chan/select-v3/XcSelectV3.vue

@@ -414,7 +414,9 @@ const selectedStyle = {
 
 // 远程搜索
 const performASearch = functionDebounce(() => {
-  props.remoteMethod(inputData)
+  if (inputData) {
+    props.remoteMethod(inputData)
+  }
 }, 200)
 
 const focus = () => {

+ 32 - 12
src/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/EditInspection.vue

@@ -1,6 +1,10 @@
 <template>
-  <el-dialog v-model="dialog" title="编辑检验" @close="guanBi">
-    <el-pagination :current-page="index" :page-size="1" :total="count" background layout="total,  prev, pager, next"
+  <el-dialog v-model="dialog" title="编辑检验"
+             @close="guanBi">
+    <el-pagination :current-page="index"
+                   :page-size="1"
+                   :total="count"
+                   background layout="total,  prev, pager, next"
                    @current-change="bianJiFenYe"/>
     <el-form label-width="100px" size="small" :model="bianJiJianChaShuJu">
       <el-row>
@@ -61,8 +65,7 @@
                 active-color="#13ce66"
                 active-text="急诊"
                 inactive-color="#ff4949"
-                inactive-text="普通"
-            >
+                inactive-text="普通">
             </el-switch>
           </el-form-item>
         </el-col>
@@ -84,7 +87,9 @@
         </el-col>
         <el-col :span="24">
           <el-form-item v-if="!jianCha" class="bi_tian" label="标本:">
-            <el-select v-model="bianJiJianChaShuJu.inspectStuff" :remote-method="biaoBenSouSuo" clearable filterable
+            <el-select v-model="bianJiJianChaShuJu.inspectStuff"
+                       :remote-method="biaoBenSouSuo"
+                       clearable filterable
                        remote @change="bianBenMing">
               <el-option v-for="item in biaoBenShuJu" :key="item.code" :label="item.name" :value="item.code">
                 <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
@@ -116,7 +121,7 @@
           </el-form-item>
         </el-col>
         <el-col :offset="20" :span="24">
-          <el-button icon="Check" type="primary" @click="guanBi">确定</el-button>
+          <el-button icon="Check" type="primary" @click="fillData">确定</el-button>
         </el-col>
       </el-row>
     </el-form>
@@ -135,6 +140,8 @@ import {logoutShortcut, xcHotKey} from '@/utils/xckeydown'
 import XcSelectV3 from "@/components/xiao-chan/select-v3/XcSelectV3.vue";
 import XcCode from "@/components/xiao-chan/code/XcCode";
 import {huoQuZhiXinKeShi} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
+import {xuanZhongJianCha} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
+import {clone} from "@/utils/clone";
 
 const props = defineProps({
   jianCha: {
@@ -145,14 +152,27 @@ const props = defineProps({
 
 const emit = defineEmits(['fan-ye', 'dialogCloses'])
 
-const nextPage = () => {
-  bianJiFenYe(index.value === count.value ? 1 : (index.value += 1))
-}
+const fillData = () => {
+  let tData = bianJiJianChaShuJu.value
+  xuanZhongJianCha.value.data.forEach((item, i) => {
+    if (i !== index.value - 1) {
+      item.execDept = tData.execDept
+      item.execDeptName = tData.execDeptName
 
-const previousPage = () => {
-  bianJiFenYe(index.value === 1 ? count.value : (index.value -= 1))
-}
+      item.jzFlag = tData.jzFlag
+      item.ybSelfFlag = tData.ybSelfFlag
+
+      item.diagCode = tData.diagCode
+      item.diagText = tData.diagText
 
+      item.inspectStuff = tData.inspectStuff
+      item.inspectStuffName = tData.inspectStuffName
+
+      item.reqComment = tData.reqComment
+    }
+  })
+  guanBi()
+}
 const guanBi = () => {
   biaoBenShuJu.value = []
   linChuangZhenDuanShuJu.value = []

+ 22 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/JianChaShenQing.vue

@@ -102,7 +102,7 @@
                          :disabled="editor.index === addCheckList.length - 1">下一个
               </el-button>
             </el-button-group>
-            <el-button type="primary" @click="editor.dialog = false">确认</el-button>
+            <el-button type="primary" @click="fillData(editor.index,editor.data)">确认</el-button>
           </template>
         </xc-dialog-v2>
       </el-main>
@@ -319,6 +319,27 @@ const searchAdd = (data) => {
   addJcCheck(temp)
 }
 
+
+const fillData = (i, data) => {
+  addCheckList.value.forEach((item, index) => {
+    if (index !== i) {
+      item.execDept = data.execDept
+      item.execDeptName = data.execDeptName
+
+      item.jzFlag = data.jzFlag
+      item.ybSelfFlag = data.ybSelfFlag
+
+      item.diagCode = data.diagCode
+      item.diagText = data.diagText
+
+      item.reqComment = data.reqComment
+      item.reqTzComment = data.reqTzComment
+      item.reqOtherResult = data.reqOtherResult
+    }
+  })
+  editor.value.dialog = false
+}
+
 onActivated(() => {
   dianJiChaXunHuanZheJianCha(0)
 })