eight
2024-09-10 08c5612cb1bfc239428b5bb1bf073b62eda012cd
装机逻辑修改
已修改1个文件
已重命名1个文件
已复制1个文件
90 ■■■■■ 文件已修改
src/views/ecg/doctor/components/DevDismantlePanel.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/ecg/doctor/components/DevInstallPanel.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/ecg/doctor/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/ecg/doctor/components/DevDismantlePanel.vue
ÎļþÃû´Ó src/views/ecg/doctor/components/DevRentPanel.vue ÐÞ¸Ä
@@ -40,7 +40,6 @@
      </el-form-item>
    </el-form>
    <el-button @click="submitForm" type="primary" :disabled="formLoading">装机</el-button>
    <el-button @click="submitDismantleForm" type="primary" :disabled="formLoading">拆机</el-button>
    <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
</template>
@@ -131,10 +130,6 @@
  } finally {
    formLoading.value = false
  }
}
const submitDismantleForm = async () => {
}
/** é‡ç½®è¡¨å• */
src/views/ecg/doctor/components/DevInstallPanel.vue
copy from src/views/ecg/doctor/components/DevRentPanel.vue copy to src/views/ecg/doctor/components/DevInstallPanel.vue
Îļþ´Ó src/views/ecg/doctor/components/DevRentPanel.vue ¸´ÖÆ
@@ -8,7 +8,7 @@
      v-loading="formLoading"
    >
      <el-form-item label="设备编号" prop="devId">
        <el-input v-model="formData.devId" placeholder="请输入设备编号" @input="searchRentInfo"/>
        <el-input v-model="formData.devId" placeholder="请输入设备编号" />
      </el-form-item>
      <el-form-item label="装机时间" prop="rentTime">
        <el-date-picker
@@ -40,7 +40,6 @@
      </el-form-item>
    </el-form>
    <el-button @click="submitForm" type="primary" :disabled="formLoading">装机</el-button>
    <el-button @click="submitDismantleForm" type="primary" :disabled="formLoading">拆机</el-button>
    <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
</template>
@@ -51,16 +50,9 @@
import {isStringEmpty} from "@/utils/stringUtil";
/** è£…机拆机 è¡¨å• */
defineComponent({ name: 'DevRentPanel' })
defineComponent({ name: 'DevInstallPanel' })
const emit = defineEmits(['success']) // å®šä¹‰ success äº‹ä»¶ï¼Œç”¨äºŽæ“ä½œæˆåŠŸåŽçš„å›žè°ƒ
const  props = defineProps({
  patient: {
    type: Object as PropType<QueueVO>,
    required: true
  }
})
const { t } = useI18n() // å›½é™…化
const message = useMessage() // æ¶ˆæ¯å¼¹çª—
@@ -69,12 +61,18 @@
const formLoading = ref(false) // è¡¨å•的加载中:1)修改时的数据加载;2)提交的按钮禁用
const formType = ref('create') // è¡¨å•的类型:create - æ–°å¢žï¼›update - ä¿®æ”¹
const patient = ref<QueueVO>({
  patId: '',
  patName: ''
})
const formData = ref({
  id: undefined,
  devId: undefined,
  patId: props.patient.patId,
  patName: props.patient.patName,
  rentTime: undefined,
  patId: patient.value.patId,
  patName: patient.value.patName,
  rentTime: new Date().getTime(),
  returnTime: undefined,
  interference: undefined,
  baseline: undefined,
@@ -88,25 +86,7 @@
})
const formRef = ref() // è¡¨å• Ref
/** æ‰“开弹窗 */
const open = async (type: string, id?: number) => {
  dialogVisible.value = true
  formType.value = type
  resetForm()
  // ä¿®æ”¹æ—¶ï¼Œè®¾ç½®æ•°æ®
  if (id) {
    formLoading.value = true
    try {
      formData.value = await DevRentApi.getDevRent(id)
    } finally {
      formLoading.value = false
    }
  }
}
defineExpose({ open }) // æä¾› open æ–¹æ³•,用于打开弹窗
/** æäº¤è¡¨å• */
const submitForm = async () => {
  // æ ¡éªŒè¡¨å•
  await formRef.value.validate()
@@ -114,12 +94,11 @@
  formLoading.value = true
  try {
    const data = formData.value as unknown as DevRentVO
    data.id = null
    data.patId = props.patient.patId
    data.patName = props.patient.patName
    if (formType.value === 'create') {
    data.patId = patient.value.patId
    data.patName = patient.value.patName
    if (formData.value.id === null || formData.value.id === undefined) {
      const result = await DevRentApi.createDevRent(data)
      formData.value.id = result.data
      formData.value.id = result
      message.success(t('common.createSuccess'))
    } else {
      await DevRentApi.updateDevRent(data)
@@ -133,18 +112,14 @@
  }
}
const submitDismantleForm = async () => {
}
/** é‡ç½®è¡¨å• */
const resetForm = () => {
  formData.value = {
    id: undefined,
    devId: undefined,
    patId: props.patient.patId,
    patName: props.patient.patName,
    rentTime: undefined,
    patId: patient.value.patId,
    patName: patient.value.patName,
    rentTime: new Date().getTime(),
    returnTime: undefined,
    interference: undefined,
    baseline: undefined,
@@ -154,13 +129,11 @@
  formRef.value?.resetFields()
}
const searchRentInfo = async () => {
  const result = await DevRentApi.getLatestRent(formData.value.patId, formData.value.devId!)
  console.info( result )
  if (null != result.data) {
    formData.value = result.data
const setPatient = (queueVO: QueueVO) => {
  patient.value = queueVO
  formData.value.id = undefined
  }
}
defineExpose({ setPatient }) // æä¾› setPatient æ–¹æ³•,用于设置患者
</script>
src/views/ecg/doctor/index.vue
@@ -5,7 +5,7 @@
import {useUserStore} from "@/store/modules/user";
import {QueueVO} from "@/api/ecg/queue";
import {ElNotification} from "element-plus";
import DevRentPanel from "@/views/ecg/doctor/components/DevRentPanel.vue";
import DevInstallPanel from "@/views/ecg/doctor/components/DevInstallPanel.vue";
const userStore = useUserStore();
@@ -58,9 +58,9 @@
const getOnstagePatient = () => {
  const tempPatient : QueueVO | undefined = patientList.value.find(item => item.status === 30)
  if (tempPatient !== undefined) {
  if (tempPatient !== undefined && tempPatient.patId !== onStagePatient.value.patId) {
    onStagePatient.value= tempPatient
    //onStagePatient.value.patName = tempPatient.patName
    setOnStagePatient(tempPatient)
  }
}
@@ -138,6 +138,12 @@
  console.info("onDevRentPanelEvent...")
}
/** æ‚£è€…变更操作 */
const devInstallPanelRef = ref()
const setOnStagePatient = (tempPatient: QueueVO) => {
  devInstallPanelRef.value.setPatient(tempPatient)
}
</script>
<template>
@@ -147,7 +153,7 @@
    </el-header>
    <el-container>
      <el-main>
        <DevRentPanel :patient="onStagePatient"  @success="onEvent"/>
        <DevInstallPanel ref="devInstallPanelRef" @success="onEvent"/>
      </el-main>
      <el-aside width="300px" style="background-color: var(--el-color-primary-light-7);">
        <QueuePanel :queue="patientList"/>