|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
|
|
|
- <Dialog :title="dialogTitle" v-model="dialogVisible" v-loading="formLoading">
|
|
|
+ <Dialog :title="dialogTitle" v-model="dialogVisible" v-loading="formLoading" style="width: 850px">
|
|
|
<el-form
|
|
|
ref="formRef"
|
|
|
:model="formData"
|
|
@@ -14,17 +14,25 @@
|
|
|
<el-form-item label="点收人" prop="receiver">
|
|
|
<el-input v-model="formData.receiver" placeholder="请输入点收人"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="退还日期" prop="returnDate">
|
|
|
- <el-date-picker
|
|
|
- v-model="formData.returnDate"
|
|
|
- type="date"
|
|
|
- value-format="x"
|
|
|
- placeholder="选择退还日期"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
+<!-- <el-form-item label="退还日期" prop="returnDate">-->
|
|
|
+<!-- <el-date-picker-->
|
|
|
+<!-- v-model="formData.returnDate"-->
|
|
|
+<!-- type="date"-->
|
|
|
+<!-- value-format="x"-->
|
|
|
+<!-- placeholder="选择退还日期"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
<el-form-item label="标本情况" prop="specimenCondition">
|
|
|
<el-input v-model="formData.specimenCondition" placeholder="请输入标本情况"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="附件上传" prop="sampleStatus" >
|
|
|
+ <UploadFile
|
|
|
+ v-model="formData.sampleStatus"
|
|
|
+ :limit="1"
|
|
|
+ class="min-w-80px"
|
|
|
+ />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="备注信息" prop="remarks">
|
|
|
<el-input v-model="formData.remarks" placeholder="备注信息"/>
|
|
|
</el-form-item>
|
|
@@ -52,7 +60,10 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
|
|
const formData = ref({
|
|
|
+ id: -1,
|
|
|
infoId: undefined,
|
|
|
+ chineseName: undefined,
|
|
|
+ specimenNumber: undefined,
|
|
|
applicantName: undefined,
|
|
|
applicationDate: undefined,
|
|
|
applicationUsage: undefined,
|
|
@@ -64,6 +75,7 @@ const formData = ref({
|
|
|
returner: undefined,
|
|
|
receiver: undefined,
|
|
|
returnDate: undefined,
|
|
|
+ outgoingTime: undefined,
|
|
|
specimenCondition: undefined,
|
|
|
sampleStatus: undefined
|
|
|
})
|
|
@@ -77,14 +89,15 @@ const formRules = reactive({
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
-const open = async (type: string, id?: number) => {
|
|
|
+const open = async ( id?: number) => {
|
|
|
dialogVisible.value = true
|
|
|
dialogTitle.value = t('回库表单')
|
|
|
- formType.value = type
|
|
|
resetForm()
|
|
|
if (id) {
|
|
|
formLoading.value = true
|
|
|
try {
|
|
|
+ console.log('hhh',formData.value)
|
|
|
+ formData.value.id = id
|
|
|
formData.value = await SpecimenOutboundApi.getSpecimenOutbound(id)
|
|
|
} finally {
|
|
|
formLoading.value = false
|
|
@@ -94,39 +107,41 @@ const open = async (type: string, id?: number) => {
|
|
|
defineExpose({open}) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
/** 重置表单 */
|
|
|
-// const resetForm = () => {
|
|
|
-// formData.value = {
|
|
|
-// id: undefined,
|
|
|
-// infoId: undefined,
|
|
|
-// chineseName: undefined,
|
|
|
-// specimenNumber: undefined,
|
|
|
-// applicantName: undefined,
|
|
|
-// applicationDate: undefined,
|
|
|
-// applicationUsage: undefined,
|
|
|
-// attachments: undefined,
|
|
|
-// status: undefined,
|
|
|
-// remarks: undefined,
|
|
|
-// processInstanceId: undefined,
|
|
|
-// operator: undefined,
|
|
|
-// outgoingTime: undefined,
|
|
|
-// returner: undefined,
|
|
|
-// receiver: undefined,
|
|
|
-// returnDate: undefined,
|
|
|
-// specimenCondition: undefined,
|
|
|
-// sampleStatus: undefined
|
|
|
-// }
|
|
|
-// formRef.value?.resetFields()
|
|
|
-// }
|
|
|
-const formRef = ref() // 表单 Ref
|
|
|
const resetForm = () => {
|
|
|
- if (formRef.value) {
|
|
|
-
|
|
|
- formRef.value.resetFields();
|
|
|
+ formData.value = {
|
|
|
+ id: undefined,
|
|
|
+ infoId: undefined,
|
|
|
+ chineseName: undefined,
|
|
|
+ specimenNumber: undefined,
|
|
|
+ applicantName: undefined,
|
|
|
+ applicationDate: undefined,
|
|
|
+ applicationUsage: undefined,
|
|
|
+ attachments: undefined,
|
|
|
+ status: undefined,
|
|
|
+ remarks: undefined,
|
|
|
+ processInstanceId: undefined,
|
|
|
+ operator: undefined,
|
|
|
+ outgoingTime: undefined,
|
|
|
+ returner: undefined,
|
|
|
+ receiver: undefined,
|
|
|
+ returnDate: undefined,
|
|
|
+ specimenCondition: undefined,
|
|
|
+ sampleStatus: undefined
|
|
|
}
|
|
|
-};
|
|
|
+ formRef.value?.resetFields()
|
|
|
+}
|
|
|
+const formRef = ref() // 表单 Ref
|
|
|
+// const resetForm = () => {
|
|
|
+// if (formRef.value) {
|
|
|
+//
|
|
|
+// formRef.value.resetFields();
|
|
|
+// }
|
|
|
+// };
|
|
|
/** 提交回库表单 */
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
const submitForm = async () => {
|
|
|
+ // 校验表单
|
|
|
+ await formRef.value.validate()
|
|
|
// 提交请求
|
|
|
formLoading.value = true
|
|
|
try {
|