|  | @@ -2,7 +2,8 @@
 | 
	
		
			
				|  |  |    <page-layer>
 | 
	
		
			
				|  |  |      <template #header>
 | 
	
		
			
				|  |  |        <el-button type="primary" icon="RefreshLeft" @click="genNewReport">填写新报告</el-button>
 | 
	
		
			
				|  |  | -      <el-button type="primary" icon="Edit" @click="beforeSubmit" :disabled="disableSubmit">提交/修改当前报告</el-button>
 | 
	
		
			
				|  |  | +      <el-button type="primary" icon="Edit" @click="beforeSubmit" :disabled="disableSubmit">提交/修改当前报告
 | 
	
		
			
				|  |  | +      </el-button>
 | 
	
		
			
				|  |  |      </template>
 | 
	
		
			
				|  |  |      <template #aside>
 | 
	
		
			
				|  |  |        <el-table :data="histories" stripe highlight-current-row :height="tableHeight" @row-click="fetchReportDetail">
 | 
	
	
		
			
				|  | @@ -30,14 +31,16 @@
 | 
	
		
			
				|  |  |                <div></div>
 | 
	
		
			
				|  |  |                <el-select v-model="report.category" placeholder="请选择" style="width: 100%">
 | 
	
		
			
				|  |  |                  <el-option-group v-for="group in dict.categories" :key="group.id" :label="group.name">
 | 
	
		
			
				|  |  | -                  <el-option v-for="item in group.children" :key="item.id" :label="item.name" :value="group.name + ' - ' + item.name"> </el-option>
 | 
	
		
			
				|  |  | +                  <el-option v-for="item in group.children" :key="item.id" :label="item.name"
 | 
	
		
			
				|  |  | +                             :value="group.name + ' - ' + item.name"></el-option>
 | 
	
		
			
				|  |  |                  </el-option-group>
 | 
	
		
			
				|  |  |                </el-select>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |              <el-col :span="9">
 | 
	
		
			
				|  |  |                <el-tag type="info">发生日期:</el-tag>
 | 
	
		
			
				|  |  |                <div></div>
 | 
	
		
			
				|  |  | -              <el-date-picker v-model="report.occurDatetime" type="datetime" placeholder="选择日期时间" style="width: 100%"> </el-date-picker>
 | 
	
		
			
				|  |  | +              <el-date-picker v-model="report.occurDatetime" type="datetime" placeholder="选择日期时间"
 | 
	
		
			
				|  |  | +                              style="width: 100%"></el-date-picker>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |              <el-col :span="7">
 | 
	
		
			
				|  |  |                <el-tag type="info">发生科室:</el-tag>
 | 
	
	
		
			
				|  | @@ -60,7 +63,8 @@
 | 
	
		
			
				|  |  |                <el-tag type="info">职称:</el-tag>
 | 
	
		
			
				|  |  |                <div></div>
 | 
	
		
			
				|  |  |                <el-select v-model="report.userLevel" placeholder="请选择" style="width: 100%">
 | 
	
		
			
				|  |  | -                <el-option v-for="item in dict.positions" :key="item.id" :label="item.name" :value="item.name"></el-option>
 | 
	
		
			
				|  |  | +                <el-option v-for="item in dict.positions" :key="item.id" :label="item.name"
 | 
	
		
			
				|  |  | +                           :value="item.name"></el-option>
 | 
	
		
			
				|  |  |                </el-select>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |              <el-col :span="8">
 | 
	
	
		
			
				|  | @@ -75,11 +79,13 @@
 | 
	
		
			
				|  |  |        <el-row :gutter="5">
 | 
	
		
			
				|  |  |          <el-col :span="12">
 | 
	
		
			
				|  |  |            <el-tag>事件经过</el-tag>
 | 
	
		
			
				|  |  | -          <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="report.course" maxlength="200" show-word-limit style="width: 100%"> </el-input>
 | 
	
		
			
				|  |  | +          <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="report.course" maxlength="200"
 | 
	
		
			
				|  |  | +                    show-word-limit style="width: 100%"></el-input>
 | 
	
		
			
				|  |  |          </el-col>
 | 
	
		
			
				|  |  |          <el-col :span="12">
 | 
	
		
			
				|  |  |            <el-tag>事件结果与补救措施</el-tag>
 | 
	
		
			
				|  |  | -          <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="report.result" maxlength="100" show-word-limit style="width: 100%"> </el-input>
 | 
	
		
			
				|  |  | +          <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="report.result" maxlength="100"
 | 
	
		
			
				|  |  | +                    show-word-limit style="width: 100%"></el-input>
 | 
	
		
			
				|  |  |          </el-col>
 | 
	
		
			
				|  |  |        </el-row>
 | 
	
		
			
				|  |  |        <div style="height: 10px"></div>
 | 
	
	
		
			
				|  | @@ -175,13 +181,15 @@
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script setup>
 | 
	
		
			
				|  |  | -import { computed, onMounted, ref } from 'vue'
 | 
	
		
			
				|  |  | -import { dict } from '@/data/adverse-event'
 | 
	
		
			
				|  |  | -import { ElMessage, ElMessageBox } from 'element-plus'
 | 
	
		
			
				|  |  | -import { getAllDepts, getHistories, getReportDetail, submitNewReport } from '@/api/adverse-event'
 | 
	
		
			
				|  |  | -import { formatDatetime } from '@/utils/date'
 | 
	
		
			
				|  |  | +import {computed, onMounted, ref} from 'vue'
 | 
	
		
			
				|  |  | +import {dict} from '@/data/adverse-event'
 | 
	
		
			
				|  |  | +import {ElMessage, ElMessageBox} from 'element-plus'
 | 
	
		
			
				|  |  | +import {getAllDepts, getHistories, getReportDetail, submitNewReport} from '@/api/adverse-event'
 | 
	
		
			
				|  |  | +import {formatDatetime} from '@/utils/date'
 | 
	
		
			
				|  |  |  import PageLayer from "@/layout/PageLayer";
 | 
	
		
			
				|  |  | +import {useUserStore} from "@/pinia/user-store";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +const userInfo = useUserStore().userInfo
 | 
	
		
			
				|  |  |  const tableHeight = window.innerHeight - 5
 | 
	
		
			
				|  |  |  const depts = ref([])
 | 
	
		
			
				|  |  |  const histories = ref([])
 | 
	
	
		
			
				|  | @@ -220,20 +228,21 @@ const beforeSubmit = () => {
 | 
	
		
			
				|  |  |      confirmButtonText: '确定',
 | 
	
		
			
				|  |  |      cancelButtonText: '取消',
 | 
	
		
			
				|  |  |    }).then(() => {
 | 
	
		
			
				|  |  | -        report.value.isModify = isModify.value
 | 
	
		
			
				|  |  | -        report.value.occurDatetime = formatDatetime(report.value.occurDatetime)
 | 
	
		
			
				|  |  | -        submitNewReport(report.value).then(() => {
 | 
	
		
			
				|  |  | -          ElMessage({
 | 
	
		
			
				|  |  | -            message: '提交成功。',
 | 
	
		
			
				|  |  | -            type: 'success',
 | 
	
		
			
				|  |  | -            duration: 2000,
 | 
	
		
			
				|  |  | -            showClose: true,
 | 
	
		
			
				|  |  | -          })
 | 
	
		
			
				|  |  | -          fetchHistories()
 | 
	
		
			
				|  |  | -          genNewReport()
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | +    report.value.isModify = isModify.value
 | 
	
		
			
				|  |  | +    report.value.occurDatetime = formatDatetime(report.value.occurDatetime)
 | 
	
		
			
				|  |  | +    submitNewReport(report.value).then(() => {
 | 
	
		
			
				|  |  | +      ElMessage({
 | 
	
		
			
				|  |  | +        message: '提交成功。',
 | 
	
		
			
				|  |  | +        type: 'success',
 | 
	
		
			
				|  |  | +        duration: 2000,
 | 
	
		
			
				|  |  | +        showClose: true,
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +      fetchHistories()
 | 
	
		
			
				|  |  | +      genNewReport()
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +      .catch(() => {
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  | -      .catch(() => {})
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  const disableSubmit = computed(() => {
 | 
	
	
		
			
				|  | @@ -247,10 +256,11 @@ onMounted(() => {
 | 
	
		
			
				|  |  |    })
 | 
	
		
			
				|  |  |  })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  function initReport() {
 | 
	
		
			
				|  |  |    return ref({
 | 
	
		
			
				|  |  | -    deptCode: userStore.deptCode,
 | 
	
		
			
				|  |  | -    userName: userStore.name,
 | 
	
		
			
				|  |  | +    deptCode: userInfo.deptCode,
 | 
	
		
			
				|  |  | +    userName: userInfo.name,
 | 
	
		
			
				|  |  |      category: null,
 | 
	
		
			
				|  |  |      occurDatetime: null,
 | 
	
		
			
				|  |  |      userLevel: '护士',
 |