From 05c827fea632f004821cc746ba73880769fab7cd Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期一, 14 七月 2025 10:06:43 +0800
Subject: [PATCH] gx1868 日期选择和排班患者查询条件,默认显示当天的已排班患者

---
 src/views/home/components/dietary_survey.vue |   32 +++++++++-----------------------
 1 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/src/views/home/components/dietary_survey.vue b/src/views/home/components/dietary_survey.vue
index 44516e1..03ebfac 100644
--- a/src/views/home/components/dietary_survey.vue
+++ b/src/views/home/components/dietary_survey.vue
@@ -2,16 +2,16 @@
     <div class="dietarySurvey-home" >
         <el-row v-if="patientsInfo.id"  style="padding-left: 10px;">
             <el-form size="small" :inline="true" :model="state.formInline"> 
-                <el-form-item label="调差表">
+                <!-- <el-form-item label="调差表">
                     <el-select style="width: 120px;"
                         v-model="state.formInline.formTableName"
                         placeholder="不选默认查全部"
                         clearable
                     >
-                        <el-option label="营养膳食调查表" value="营养膳食调查表" />
+                        <el-option label="膳食生活调查表" value="膳食生活调查表" />
                         <el-option label="膳食调查表" value="膳食调查表" />
                     </el-select>
-                </el-form-item>
+                </el-form-item> -->
                 <el-form-item label="填报日期">
                     <el-date-picker
                         v-model="state.formInline.date"
@@ -80,7 +80,6 @@
         </div>
         <el-empty v-if="!patientsInfo.id" description="无数据,请先选择患者"></el-empty>
         <editDietary  @shuaxin="onSubmit" ref="editDietaryRef"></editDietary>
-        <editDietary2  @shuaxin="onSubmit" ref="editDietaryRef2"></editDietary2>
     </div>
 </template>
 
@@ -97,7 +96,6 @@
 const { patientsInfo } = storeToRefs(storesPat);
 const props = defineProps(['tableHeight'])
 const editDietaryRef=ref()
-const editDietaryRef2=ref()
 const router = useRouter()
 const shortcuts = [
   {
@@ -136,7 +134,7 @@
     loading: false,
     formInline:{
         user: '',
-        formTableName:'',
+        formTableName:'膳食生活调查表',
         date: [],
     },
     dialogTableVisible:false
@@ -163,10 +161,10 @@
         wherecondition:`survery_form_type=0 and patient_code='${patientsInfo.value.code}'`,
         ordercondition: 'survery_time desc'
     }
-    if(state.formInline.date.length===2){
+    if(state.formInline?.date?.length===2){
         pasm.wherecondition+=` and survery_time BETWEEN '${state.formInline.date[0]} 00:00:00' AND '${state.formInline.date[1]} 23:59:59'`
     }
-    if(state.formInline.formTableName){
+    if(state.formInline?.formTableName){
         pasm.wherecondition+=`and suvery_form_name='${state.formInline.formTableName}'`
     }
     const loading = ElLoading.service({
@@ -183,15 +181,7 @@
 }
 const addItem=()=>{
     
-    if(state.formInline.formTableName){  
-        if(state.formInline.formTableName==='膳食调查表'){
-            editDietaryRef.value.openShow('add')
-        }else if(state.formInline.formTableName==='营养膳食调查表'){
-            editDietaryRef2.value.openShow('add')
-        }
-    }else{
-        ElMessage.warning('请先选择你要添加的表单名称!')
-    }
+    editDietaryRef.value.openShow('add')
     // router.push({path:'/tiaochabiao1',query:{type:'add',id:0}})
 }
 // 第一步:定义子组件里面的方法
@@ -202,7 +192,7 @@
         wherecondition:`survery_form_type=0 and patient_code='${patientsInfo.value.code}'`,
         ordercondition:'survery_time DESC'
     }
-    if(state.formInline.date.length===2){
+    if(state.formInline?.date?.length===2){
         pasm.wherecondition+=`and survery_time BETWEEN '${state.formInline.date[0]} 00:00:00' AND '${state.formInline.date[1]} 23:59:59'`
     }
     if(state.formInline.formTableName){
@@ -232,11 +222,7 @@
  */
 const handleEdit = (index: number, row: any) => {
   console.log(index, row,state.formInline.formTableName)
-  if(row.suveryFormName==='膳食调查表'){
-        editDietaryRef.value.openShow('update',row)
-    }else if(row.suveryFormName==='营养膳食调查表'){
-        editDietaryRef2.value.openShow('update',row)
-    }
+  editDietaryRef.value.openShow('update',row)
 }
 const handleDelete = (index: number, row: any) => {
   console.log(index, row)

--
Gitblit v1.8.0