|  | @@ -0,0 +1,189 @@
 | 
	
		
			
				|  |  | +<template>
 | 
	
		
			
				|  |  | +  <div class="common-layout">
 | 
	
		
			
				|  |  | +    <el-container>
 | 
	
		
			
				|  |  | +      <el-header>
 | 
	
		
			
				|  |  | +        <el-row :gutter="10">
 | 
	
		
			
				|  |  | +          <el-col :span="6">
 | 
	
		
			
				|  |  | +            <el-select   filterable v-model="queryParam.wardCode" clearable style="width: 130px;" size="small" @change="selectPatList">
 | 
	
		
			
				|  |  | +              <el-option v-for="item in ward" :key="item.code" :label="item.name" :value="item.code">
 | 
	
		
			
				|  |  | +                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
 | 
	
		
			
				|  |  | +                <el-divider direction="vertical"></el-divider>
 | 
	
		
			
				|  |  | +                <span>{{ item.name }}</span>
 | 
	
		
			
				|  |  | +              </el-option>
 | 
	
		
			
				|  |  | +            </el-select>
 | 
	
		
			
				|  |  | +          </el-col>
 | 
	
		
			
				|  |  | +          <el-col :span="8">
 | 
	
		
			
				|  |  | +            住院号:
 | 
	
		
			
				|  |  | +            <el-popover :visible="visible" width="690" placement="right-end" trigger="click">
 | 
	
		
			
				|  |  | +              <template #reference>
 | 
	
		
			
				|  |  | +               <el-input v-model="queryParam.inpatientNo"    @click="visible = true" style="width: 100px" clearable />
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <div style="width: 670px;">
 | 
	
		
			
				|  |  | +                <div style="text-align: right">
 | 
	
		
			
				|  |  | +                  <el-button icon="CloseBold" @click="visible = false"></el-button>
 | 
	
		
			
				|  |  | +                </div>
 | 
	
		
			
				|  |  | +                <el-table :data="patList" style="width: 100%" @row-click="fetchPatInfo"  height="400">
 | 
	
		
			
				|  |  | +                  <el-table-column  property="inpatientNo" label="住院号" />
 | 
	
		
			
				|  |  | +                  <el-table-column  property="name" label="姓名" />
 | 
	
		
			
				|  |  | +                  <el-table-column  property="sexName" label="性别" />
 | 
	
		
			
				|  |  | +                  <el-table-column  property="bedNo" label="床号" />
 | 
	
		
			
				|  |  | +                </el-table>
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +              <div style="text-align: center">
 | 
	
		
			
				|  |  | +                <el-button size="small" type="danger" @click="visible = false">关闭</el-button>
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +            </el-popover>
 | 
	
		
			
				|  |  | +          </el-col>
 | 
	
		
			
				|  |  | +          <el-col :span="3">
 | 
	
		
			
				|  |  | +            <el-button type="success" icon="Money" @click="addBaby">增加</el-button>
 | 
	
		
			
				|  |  | +          </el-col>
 | 
	
		
			
				|  |  | +          <el-col>
 | 
	
		
			
				|  |  | +            <div  style="color: red;"> 增加BB时,请补充相应的BB信息(如性别,出生日期)</div>
 | 
	
		
			
				|  |  | +          </el-col>
 | 
	
		
			
				|  |  | +        </el-row>
 | 
	
		
			
				|  |  | +      </el-header>
 | 
	
		
			
				|  |  | +      <el-main>
 | 
	
		
			
				|  |  | +         <div>
 | 
	
		
			
				|  |  | +           <PatientInfo :patientInfo="patientInfo"></PatientInfo>
 | 
	
		
			
				|  |  | +         </div>
 | 
	
		
			
				|  |  | +         <div>
 | 
	
		
			
				|  |  | +           <div style="margin-top: 10px">
 | 
	
		
			
				|  |  | +             <el-tag>婴儿补充信息</el-tag>
 | 
	
		
			
				|  |  | +           </div>
 | 
	
		
			
				|  |  | +           <div >
 | 
	
		
			
				|  |  | +             <el-table :data="babyList" style="width: 100%"   :height="getWindowSize.h-170">
 | 
	
		
			
				|  |  | +               <el-table-column  property="inpatientNo" label="住院号" />
 | 
	
		
			
				|  |  | +               <el-table-column  property="name" label="姓名" />
 | 
	
		
			
				|  |  | +               <el-table-column  property="sexName" label="性别" />
 | 
	
		
			
				|  |  | +               <el-table-column  property="birthDate" label="出生日期" />
 | 
	
		
			
				|  |  | +               <el-table-column label="操作">
 | 
	
		
			
				|  |  | +                 <template #default="scope">
 | 
	
		
			
				|  |  | +                   <el-button  icon="Delete" type="danger" @click="delBaBy(scope.$index,scope.row)">删除</el-button>
 | 
	
		
			
				|  |  | +                 </template>
 | 
	
		
			
				|  |  | +               </el-table-column>
 | 
	
		
			
				|  |  | +             </el-table>
 | 
	
		
			
				|  |  | +           </div>
 | 
	
		
			
				|  |  | +         </div>
 | 
	
		
			
				|  |  | +      </el-main>
 | 
	
		
			
				|  |  | +    </el-container>
 | 
	
		
			
				|  |  | +  </div>
 | 
	
		
			
				|  |  | +  <el-dialog v-model="editBabyDialog" title="增加婴儿信息" width="400">
 | 
	
		
			
				|  |  | +    <el-form :model="editBaByInfo">
 | 
	
		
			
				|  |  | +      <el-form-item label="性别" >
 | 
	
		
			
				|  |  | +        <el-select v-model="editBaByInfo.sex">
 | 
	
		
			
				|  |  | +          <el-option label="男" value="1" />
 | 
	
		
			
				|  |  | +          <el-option label="女" value="2" />
 | 
	
		
			
				|  |  | +        </el-select>
 | 
	
		
			
				|  |  | +      </el-form-item>
 | 
	
		
			
				|  |  | +      <el-form-item label="出生日期" >
 | 
	
		
			
				|  |  | +        <el-date-picker v-model="editBaByInfo.birthDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"  />
 | 
	
		
			
				|  |  | +      </el-form-item>
 | 
	
		
			
				|  |  | +    </el-form>
 | 
	
		
			
				|  |  | +    <template #footer>
 | 
	
		
			
				|  |  | +      <span class="dialog-footer">
 | 
	
		
			
				|  |  | +        <el-button type="danger" @click="editBabyDialog = false">取消</el-button>
 | 
	
		
			
				|  |  | +        <el-button type="success"  @click="saveData"> 保存</el-button>
 | 
	
		
			
				|  |  | +      </span>
 | 
	
		
			
				|  |  | +    </template>
 | 
	
		
			
				|  |  | +  </el-dialog>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<script setup lang="ts" name = "addBabyInfo">
 | 
	
		
			
				|  |  | +import PatientInfo from "@/components/medical-advice/PatientInfo.vue";
 | 
	
		
			
				|  |  | +import {onMounted, ref} from "vue";
 | 
	
		
			
				|  |  | +import {getWindowSize} from "@/utils/window-size";
 | 
	
		
			
				|  |  | +import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
 | 
	
		
			
				|  |  | +import {getPatientBaseInfo,queryPatientInfo} from "@/api/medical-advice/medical-advice-management";
 | 
	
		
			
				|  |  | +import {queryBabyInfo,deleteBaby,saveBabyInfo} from "@/api/medical-advice/patient-info";
 | 
	
		
			
				|  |  | +import {ElMessageBox} from "element-plus";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const patientInfo  =ref<object>({})
 | 
	
		
			
				|  |  | +const queryParam  = ref<object>({
 | 
	
		
			
				|  |  | +  wardCode:'',
 | 
	
		
			
				|  |  | +  inpatientNo:'',
 | 
	
		
			
				|  |  | +  admissTimes:null,
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const editBaByInfo =ref({
 | 
	
		
			
				|  |  | +  name:'',
 | 
	
		
			
				|  |  | +  inpatientNo:'',
 | 
	
		
			
				|  |  | +  sex:'',
 | 
	
		
			
				|  |  | +  birthDate:'',
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const saveData=()=>{
 | 
	
		
			
				|  |  | +  editBaByInfo.value.name = patientInfo.value.name
 | 
	
		
			
				|  |  | +  editBaByInfo.value.inpatientNo= queryParam.value.inpatientNo
 | 
	
		
			
				|  |  | +  saveBabyInfo(editBaByInfo.value).then((res)=>{
 | 
	
		
			
				|  |  | +   editBabyDialog.value = false
 | 
	
		
			
				|  |  | +    queryBaby()
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const editBabyDialog  = ref(false)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const visible = ref<boolean>(false)
 | 
	
		
			
				|  |  | +const patList  =ref([])
 | 
	
		
			
				|  |  | +const fetchPatInfo = (row)=>{
 | 
	
		
			
				|  |  | +    queryParam.value.inpatientNo = row.inpatientNo
 | 
	
		
			
				|  |  | +    queryParam.value.admissTimes = row.admissTimes
 | 
	
		
			
				|  |  | +    visible.value = false
 | 
	
		
			
				|  |  | +   queryInfo()
 | 
	
		
			
				|  |  | +  queryBaby()
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const queryBaby=()=>{
 | 
	
		
			
				|  |  | +  queryBabyInfo(queryParam.value).then((res:any)=>{
 | 
	
		
			
				|  |  | +    babyList.value = res
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const addBaby = ()=>{
 | 
	
		
			
				|  |  | +   editBabyDialog.value = true
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +const babyList = ref()
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const selectPatList = ()=>{
 | 
	
		
			
				|  |  | +  queryPatientInfo('',queryParam.value.wardCode,'0').then((res:any) => {
 | 
	
		
			
				|  |  | +    if(res.length > 0){
 | 
	
		
			
				|  |  | +      patList.value = res.filter(item=>(!item.inpatientNo.includes('$')))
 | 
	
		
			
				|  |  | +    }else {
 | 
	
		
			
				|  |  | +      patList.value = []
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const ward = ref<any>([])
 | 
	
		
			
				|  |  | +onMounted(()=>{
 | 
	
		
			
				|  |  | +  getAllWards().then((res:any)=>{
 | 
	
		
			
				|  |  | +    ward.value =res
 | 
	
		
			
				|  |  | +    queryParam.value.wardCode = res[0].code
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const delBaBy = (index,row) =>{
 | 
	
		
			
				|  |  | +  ElMessageBox.confirm('确认删除婴儿信息?', '提示', {
 | 
	
		
			
				|  |  | +    confirmButtonText: '确认',
 | 
	
		
			
				|  |  | +    cancelButtonText: '取消',
 | 
	
		
			
				|  |  | +    distinguishCancelAndClose: true
 | 
	
		
			
				|  |  | +  }).then(() => {
 | 
	
		
			
				|  |  | +      deleteBaby(row).then((res)=>{
 | 
	
		
			
				|  |  | +        queryBaby()
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +const queryInfo = ()=>{
 | 
	
		
			
				|  |  | +  let params = {inpatientNo:queryParam.value.inpatientNo,
 | 
	
		
			
				|  |  | +    admissTimes:queryParam.value.admissTimes,inOutStatusFlag:'0'}
 | 
	
		
			
				|  |  | +  getPatientBaseInfo(params).then((res:any)=>{
 | 
	
		
			
				|  |  | +    patientInfo.value =res
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +<style scoped lang="scss">
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +</style>
 |