Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

wwj 4 mesi fa
parent
commit
c6d18750be

+ 8 - 5
src/api/museums/specimenoutbound/index.ts

@@ -54,13 +54,16 @@ export const SpecimenOutboundApi = {
   exportSpecimenOutbound: async (params) => {
     return await request.download({ url: `/museums/specimen-outbound/export-excel`, params })
   },
-
+  // 审批通过标本出库回库
+  ApprovalPassSpecimenOutbound: async (data: SpecimenOutboundVO) => {
+    return await request.post({ url: `/museums/specimen-outbound/approve`, data })
+  },
   // 审批驳回标本出库回库
- ApprovalSpecimenOutbound: async (id: number) => {
-    return await request.put({ url: `/museums/specimen-outbound/reject?id=` + id })
+ ApprovalSpecimenOutbound: async (data: SpecimenOutboundVO) => {
+    return await request.post({ url: `/museums/specimen-outbound/reject`, data })
   },
   // 确认回标本出库
-  ConfirmSpecimenOutbound: async (id: number) => {
-    return await request.put({ url: `/museums/specimen-outbound/confirmOutbound?id=` + id })
+  ConfirmSpecimenOutbound: async (data: SpecimenOutboundVO) => {
+    return await request.post({ url: `/museums/specimen-outbound/confirmOutbound?id=`, data})
   },
 }

+ 2 - 0
src/views/museums/museumsdocument/index.vue

@@ -1,4 +1,5 @@
 <template>
+  <el-skeleton :loading="loading" animated>
   <ContentWrap>
     <!-- 搜索工作栏 -->
     <el-form
@@ -190,6 +191,7 @@
 
   <!-- 表单弹窗:添加/修改 -->
   <DocumentForm ref="formRef" @success="getList" />
+  </el-skeleton>
 </template>
 
 <script setup lang="ts">

+ 5 - 2
src/views/museums/photos/PhotosForm.vue

@@ -1,4 +1,5 @@
 <template>
+  <el-skeleton :loading="loading" animated>
   <Dialog :title="dialogTitle" v-model="dialogVisible">
     <el-form
       ref="formRef"
@@ -27,16 +28,18 @@
       <el-button @click="dialogVisible = false">取 消</el-button>
     </template>
   </Dialog>
+    </el-skeleton>
 </template>
 <script setup lang="ts">
 import { PhotosApi, PhotosVO } from '@/api/museums/photos'
+import {ref} from "vue";
 
 /** 博物馆照片 表单 */
 defineOptions({ name: 'PhotosForm' })
 
 const { t } = useI18n() // 国际化
 const message = useMessage() // 消息弹窗
-
+const loading = ref(true) // 列表的加载中
 const dialogVisible = ref(false) // 弹窗的是否展示
 const dialogTitle = ref('') // 弹窗的标题
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
@@ -105,4 +108,4 @@ const resetForm = () => {
   }
   formRef.value?.resetFields()
 }
-</script>
+</script>

+ 4 - 0
src/views/museums/specimeninfo/SpecimenImportForm.vue

@@ -1,4 +1,5 @@
 <template>
+  <el-skeleton :loading="loading" animated>
   <Dialog v-model="dialogVisible" title="标本信息导入" width="600">
     <el-upload
       ref="uploadRef"
@@ -66,6 +67,7 @@
       <el-button @click="dialogVisible = false">取 消</el-button>
     </template>
   </Dialog>
+  </el-skeleton>
 </template>
 
 <script lang="ts" setup>
@@ -74,8 +76,10 @@ import { getAccessToken, getTenantId } from '@/utils/auth'
 import {SpecimenInfoApi} from "@/api/museums/specimeninfo";
 import {UploadFilled} from "@element-plus/icons-vue";
 import {useUpload} from "@/components/UploadFile/src/useUpload";
+import {ref} from "vue";
 
 defineOptions({ name: 'SpecimenImportForm' })
+const loading = ref(true) // 列表的加载中
 const dialogVisible = ref(false) // 弹窗的是否展示
 const formLoading = ref(false) // 表单的加载中
 const uploadRef = ref()

+ 4 - 1
src/views/museums/specimeninfo/imageImportForm.vue

@@ -1,4 +1,5 @@
 <template>
+  <el-skeleton :loading="loading" animated>
   <Dialog v-model="dialogVisible" title="标本图片批量导入" width="500" >
     <el-upload
       ref="uploadRef"
@@ -31,7 +32,7 @@
       <el-button @click="dialogVisible = false">取 消</el-button>
     </template>
   </Dialog>
-
+    </el-skeleton>
 </template>
 
 <script lang="ts" setup>
@@ -39,6 +40,7 @@ import {UploadFilled} from "@element-plus/icons-vue";
 
 import { useUpload } from '@/components/UploadFile/src/useUpload'
 import {getAccessToken, getTenantId} from "@/utils/auth";
+import {ref} from "vue";
 const importUrl =
   import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/museums/specimen-info/import-specimen-images'
 defineOptions({ name: 'imageImportForm' })
@@ -48,6 +50,7 @@ const uploadRef = ref()
 const message = useMessage() // 消息弹窗
 const updateSupport = ref(0) // 是否更新已经存在的用户数据
 const fileList = ref([]) // 文件列表
+const loading = ref(true) // 列表的加载中
 const uploadHeaders = ref() // 上传 Header 头
 /** 打开弹窗 */
 const open = () => {

+ 19 - 32
src/views/museums/specimeninfo/index.vue

@@ -28,21 +28,21 @@
           class="!w-240px"
         />
       </el-form-item>
-<!--      <el-form-item label="标本类型" prop="specimenType">-->
-<!--        <el-select-->
-<!--          v-model="queryParams.specimenType"-->
-<!--          placeholder="请选择标本类型(矿物、岩石矿石、化石、陨石)"-->
-<!--          clearable-->
-<!--          class="!w-240px"-->
-<!--        >-->
-<!--          <el-option-->
-<!--            v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SPECIMEN_TYPE)"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
+      <el-form-item label="标本类型" prop="specimenType">
+        <el-select
+          v-model="queryParams.specimenType"
+          placeholder="请选择标本类型(矿物、岩石矿石、化石、陨石)"
+          clearable
+          class="!w-240px"
+        >
+          <el-option
+            v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SPECIMEN_TYPE)"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
 <!--      <el-form-item label="资产号" prop="assetNumber">-->
 <!--        <el-input-->
 <!--          v-model="queryParams.assetNumber"-->
@@ -340,8 +340,6 @@
 
   <!-- 列表 -->
   <ContentWrap>
-    <el-segmented  block  v-model="queryParams.specimenType" :options="options" size="large"  @update:modelValue="handleSegmentedChange"/>
-
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
 
 <!--      <el-table-column label="序号" align="center" prop="id" />-->
@@ -392,6 +390,7 @@
         <template #default="{ row }">
         <div class="demo-image__preview" v-if="queryParams">
           <el-image
+
             style="width: 40px; height:40px"
             class="h-80px w-80px"
             lazy
@@ -427,7 +426,6 @@
             @click="openForm('update', scope.row.id)"
             v-hasPermi="['museums:specimen-info:update']"
           >
-
             编辑
           </el-button>
           <el-button
@@ -471,21 +469,14 @@ defineOptions({ name: 'SpecimenInfo' })
 
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
-const options = [
-  { label: '总表', value: '' },
-  { label: '矿物', value: '0' },
-  { label: '岩石', value: '1' },
-  { label: '矿石', value: '2' },
-  { label: '化石', value: '3' },
-  { label: '陨石', value: '4' }
-]
+
 const loading = ref(true) // 列表的加载中
 const list = ref<SpecimenInfoVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
-  specimenType:'',
+  specimenType: undefined,
   specimenNumber: undefined,
   assetNumber: undefined,
   storageLocation: undefined,
@@ -605,10 +596,6 @@ const viewDetails=(dataId: number) => {
     }
   })
 }
-/** 处理 el-segmented 变化事件 */
-const handleSegmentedChange = (value: string) => {
-  queryParams.specimenType = value
-  handleQuery()
-}
+
 </script>
 

+ 3 - 2
src/views/museums/specimeninfo/specimenDetails.vue

@@ -158,13 +158,14 @@
         <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" class="mb-8px">
           <div class="demo-image__preview" v-if="specimenData ">
             <el-image
+
               style=" align-items: center"
               :src="specimenData.imagePath"
               :zoom-rate="1.2"
               :max-scale="7"
               :min-scale="0.2"
-              :preview-src-list="specimenData.imagePath"
-              :initial-index="4"
+              :preview-src-list="specimenData.imagePaths"
+              :initial-index="index"
               fit="cover"
             />
           </div>

+ 7 - 6
src/views/museums/specimenoutbound/ApproalProcess.vue

@@ -1,4 +1,5 @@
 <template>
+  <el-skeleton :loading="loading" animated>
   <ContentWrap>
     <!-- 搜索工作栏 -->
     <el-form
@@ -99,6 +100,7 @@
         width="180px"
       />
       <el-table-column label="用途" align="center" prop="applicationUsage" />
+      <el-table-column label="附件" align="center" prop="attachments" />
 <!--      <el-table-column label="审批状态" align="center" prop="status" >-->
 <!--        <template #default="scope">-->
 <!--          <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status" />-->
@@ -121,7 +123,7 @@
 <!--      <el-table-column label="标本情况" align="center" prop="specimenCondition" />-->
       <el-table-column label="审批状态" align="center" prop="sampleStatus" >
         <template #default="scope">
-          <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status" />
+          <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" min-width="150px">
@@ -144,6 +146,7 @@
       />
    </ContentWrap>
   <Approval ref="ApprovalRef" @success="getList" />
+  </el-skeleton>
 </template>
 
 
@@ -157,7 +160,7 @@ import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
 
 defineOptions({ name: 'ApproalProcess' })
 const message = useMessage() // 消息弹窗
-//const { t } = useI18n() // 国际化
+const { t } = useI18n() // 国际化
 const loading = ref(true) // 列表的加载中
 const list = ref<SpecimenOutboundVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
@@ -218,11 +221,9 @@ const resetQuery = () => {
 /** 审批按钮操作 */
 
 // 检查用户权限的方法
-
-
 const ApprovalRef = ref()
-const handleApproval = (type: string, id?: number) => {
-  ApprovalRef.value.open(type, id)
+const handleApproval = ( id?: number) => {
+  ApprovalRef.value.open( id)
 
 }
 /** 导出按钮操作 */

+ 3 - 1
src/views/museums/specimenoutbound/OutboundApplication.vue

@@ -1,4 +1,5 @@
 <template>
+  <el-skeleton :loading="loading" animated>
   <ContentWrap>
   <!-- 搜索工作栏 -->
   <el-form
@@ -125,7 +126,7 @@
         width="180px"
       />
       <el-table-column label="标本情况" align="center" prop="specimenCondition" />
-      <el-table-column label="标本状态" align="center" prop="sampleStatus"/>
+      <el-table-column label="申请附件" align="center" prop="attachments"/>
         <el-table-column label="审批状态" align="center" prop="sampleStatus" >
           <template #default="scope">
             <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status" />
@@ -164,6 +165,7 @@
   <!-- 表单弹窗:审批 -->
   <SpecimenOutboundForm ref="formRef" @success="getList" />
   <Approval ref="ApprovalRef" @success="getList" />
+  </el-skeleton>
 </template>
 
 

+ 9 - 45
src/views/museums/specimenoutbound/OutboundForm/outboundDetail.vue

@@ -1,5 +1,5 @@
 <template>
-
+  <el-skeleton :loading="loading" animated>
   <el-row :gutter="8" justify="space-between">
     <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
       <div>
@@ -8,17 +8,14 @@
 
             <template #header>
               <div class="card-header" style="text-align: center">
-                <h1 class="text1">标本出库申请详情</h1>
+                <h1 class="text1">标本出库入库申请详情</h1>
               </div>
             </template>
             <el-descriptions
-
               v-if="outboundData"
               :column="3"
               :size="small"
               border
-
-
             >
               <el-descriptions-item label="标本ID:"    label-align="right" >{{ outboundData.infoId }}</el-descriptions-item>
               <el-descriptions-item label="标本编号"    label-align="right">{{
@@ -73,43 +70,10 @@
               </div>
             </el-descriptions>
           </el-card>
-<!--          <el-card >-->
-<!--              <template #header>-->
-<!--                <div class="card-header" style="text-align: center">-->
-<!--                  <h1 class="text1">标本出库入库详情</h1>-->
-<!--                </div>-->
-<!--              </template>-->
-<!--            <el-descriptions-->
-<!--              v-if="outboundData"-->
-<!--              :column="3"-->
-<!--              :size="small"-->
-<!--              border-->
-<!--            >-->
-<!--              <div >-->
-<!--              <el-descriptions-item label="出库时间:" label-align="right" >{{ outboundData.outgoingTime }}</el-descriptions-item>-->
-<!--              <el-descriptions-item label="出库员:">{{  outboundData.operator}}-->
-<!--              </el-descriptions-item>-->
-
-<!--              <el-descriptions-item label="退还日期" label-align="right" >{{-->
-<!--                  outboundData.returnDate-->
-<!--                }}-->
-<!--              </el-descriptions-item>-->
-<!--              <el-descriptions-item label="点收人:" label-align="right" >{{-->
-<!--                  outboundData.receiver-->
-<!--                }}-->
-<!--              </el-descriptions-item>-->
-
-
-<!--              <el-descriptions-item label="退还人" label-align="right">{{-->
-<!--                  outboundData.returner-->
-<!--                }}-->
-<!--              </el-descriptions-item>-->
-<!--              </div>-->
-<!--            </el-descriptions>-->
-<!--            </el-card>-->
+
 
             <ContentWrap>
-              <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+              <el-table  :data="list" :stripe="true" :show-overflow-tooltip="true">
                 <el-table-column label="标本ID" align="center" prop="infoId" />
                 <el-table-column label="中文名称" align="center" prop="chineseName" />
                 <el-table-column label="标本编号" align="center" prop="specimenNumber" />
@@ -128,14 +92,15 @@
       </div>
     </el-col>
   </el-row>
-
+  </el-skeleton>
 </template>
 <script setup lang="ts">
 import {ElCol} from "element-plus";
 import {ref} from "vue";
-
 import {SpecimenOutboundApi, SpecimenOutboundVO} from "@/api/museums/specimenoutbound";
-import {dateFormatter, formatDate} from "@/utils/formatTime";
+import { formatDate} from "@/utils/formatTime";
+
+
 defineOptions({ name: 'outboundDetail' })
 const {query} = useRoute() // 查询参数
 const loading = ref(true) // 列表的加载中
@@ -159,10 +124,9 @@ const queryParams = reactive({
 const getList = async () => {
   loading.value = true
   try {
-    const data = await SpecimenOutboundApi.getSpecimenOutbound(queryParams)
+    const data = await SpecimenOutboundApi.getSpecimenOutbound(query.dataId)
     list.value = data.list
     total.value = data.total
-
   } finally {
     loading.value = false
   }

+ 36 - 25
src/views/museums/specimenoutbound/OutboundForm/specimenReturnForm.vue

@@ -1,11 +1,12 @@
 <template>
-  <Dialog :title="dialogTitle" v-model="dialogVisible" ref="formRef" >
+
+  <Dialog :title="dialogTitle" v-model="dialogVisible" ref="formRef"  v-loading="formLoading">
     <el-form
       ref="formRef"
       :model="formData"
       :rules="formRules"
       label-width="100px"
-      v-loading="formLoading">
+      >
       <el-form-item label="退还人" prop="returner">
         <el-input v-model="formData.returner" placeholder="请输入退还人"/>
       </el-form-item>
@@ -29,9 +30,11 @@
       <el-button @click="dialogVisible = false">取 消</el-button>
     </template>
   </Dialog>
+
 </template>
 
 <script setup lang="ts">
+// import { onMounted } from 'vue';
 import {SpecimenOutboundApi, SpecimenOutboundVO} from '@/api/museums/specimenoutbound'
 import {ref,reactive} from "vue"
 /** 标本出库回库信息 表单 */
@@ -42,6 +45,7 @@ const dialogTitle = ref('') // 弹窗的标题
 const message = useMessage() // 消息弹窗
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
 const formType = ref('') // 表单的类型:create - 新增;update - 修改
+
 const formData = ref({
 id: undefined,
 infoId: undefined,
@@ -89,30 +93,35 @@ 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 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
+  if (formRef.value ) {
+    formRef.value?.resetFields();
   }
-  formRef.value?.resetFields()
-}
-
+};
 /** 提交回库表单 */
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 const submitForm = async () => {
@@ -136,5 +145,7 @@ const submitForm = async () => {
   }
 }
 
-
+// onMounted(() => {
+//   resetForm();
+// })
 </script>

+ 20 - 17
src/views/museums/specimenoutbound/OutboundManagement.vue

@@ -1,4 +1,6 @@
 <template>
+  <div>
+  <el-skeleton :loading="loading" animated>
   <ContentWrap>
     <!-- 搜索工作栏 -->
     <el-form
@@ -59,16 +61,16 @@
             :value="dict.value" />
         </el-select>
       </el-form-item>
-      <el-form-item label="标本状态" prop="sampleStatus">
-        <el-select
-          v-model="queryParams.sampleStatus"
-          placeholder="请选择标本状态"
-          clearable
-          class="!w-240px"
-        >
-          <el-option label="请选择字典生成" value="" />
-        </el-select>
-      </el-form-item>
+<!--      <el-form-item label="标本状态" prop="sampleStatus">-->
+<!--        <el-select-->
+<!--          v-model="queryParams.sampleStatus"-->
+<!--          placeholder="请选择标本状态"-->
+<!--          clearable-->
+<!--          class="!w-240px"-->
+<!--        >-->
+<!--          <el-option label="请选择字典生成" value="" />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
       <el-form-item>
         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
@@ -122,7 +124,7 @@
         width="180px"
       />
 <!--      <el-table-column label="标本情况" align="center" prop="specimenCondition" />-->
-      <el-table-column label="标本状态" align="center" prop="sampleStatus" />
+<!--      <el-table-column label="标本状态" align="center" prop="sampleStatus" />-->
       <el-table-column label="操作" align="center" min-width="150px">
         <template #default="scope" >
           <el-button
@@ -160,12 +162,14 @@
 
   <!-- 表单弹窗:回库 -->
   <specimenReturnForm ref="formRef" @success="getList" />
+  </el-skeleton>
+  </div>
 </template>
 
 <script setup lang="ts">
 import download from '@/utils/download'
 import { dateFormatter } from '@/utils/formatTime'
-import {defineComponent, ref} from "vue";
+import {defineComponent, ref,reactive} from "vue";
 import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
 import specimenReturnForm from '@/views/museums/specimenoutbound/OutboundForm/specimenReturnForm.vue'
  defineComponent({name:'OutboundManagement'})
@@ -256,25 +260,24 @@ const detail=(dataId: number) => {
 }
 
 /** 出库操作 */
-const handleOutbound = async (id: number) => {
+const handleOutbound = async (data: SpecimenOutboundVO) => {
   try {
     // 出库的二次确认
     await message.OutboundConfirm()
     // 发起出库
-    await  SpecimenOutboundApi.ConfirmSpecimenOutbound(id)
-    message.success(t('common.outboundSuccess'))
+    await  SpecimenOutboundApi.ConfirmSpecimenOutbound(data)
+    message.success(t('出库成功'))
     // 刷新列表
     await getList()
   } catch {}
 }
 
 /** 回库 */
-const formRef = ref
+const formRef = ref(null)
 const openForm = (type: string, id?: number) => {
   formRef.value.open(type, id)
 }
 
-
 /** 初始化 **/
 onMounted(() => {
   getList()

+ 3 - 4
src/views/museums/specimenoutbound/SpecimenOutboundForm.vue

@@ -31,10 +31,7 @@
         <el-input v-model="formData.applicationUsage" placeholder="请输入申请出库的用途" />
       </el-form-item>
       <el-form-item label="附件上传" prop="attachments">
-        <el-upload v-model="formData.attachments" placeholder="请输入附件上传" >
-          <el-icon class="el-icon--upload"><upload-filled /></el-icon>
-          <div class="el-upload__text"> 将文件拖到此处,或 <em>点击上传</em></div>
-        </el-upload>
+          <UploadImg v-model="formData.attachments" />
       </el-form-item>
 <!--      <el-form-item label="审批状态" prop="status">-->
 <!--        <el-select v-model="formData.status" placeholder="请选择审批状态">-->
@@ -86,10 +83,12 @@
       <el-button @click="dialogVisible = false">取 消</el-button>
     </template>
   </Dialog>
+
 </template>
 <script setup lang="ts">
 import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
 import { UploadFilled } from '@element-plus/icons-vue'
+import {ref} from "vue";
 /** 标本出库回库信息 表单 */
 defineOptions({ name: 'SpecimenOutboundForm' })
 

+ 54 - 35
src/views/museums/specimenoutbound/approval.vue

@@ -5,8 +5,8 @@
     width="800"
   >
     <el-form
-
-      :action="approvalUrl + '?updateSupport=' + updateSupport">
+      v-loading="formLoading"
+     >
       <el-form-item>
         <el-radio-group  v-model="approvalStatus">
           <el-radio :label="1">通过</el-radio>
@@ -15,13 +15,12 @@
       </el-form-item>
       <el-form-item  v-if="approvalStatus === 2">
         <el-input
-          v-model="chkRemarks"
+          v-model="formData.remarks"
           style="width:800px ;height: 200px"
           placeholder="请输入驳回原因"
           type="textarea"
           autosize
         />
-
       </el-form-item>
     </el-form>
 
@@ -30,67 +29,87 @@
         <el-button type="danger" @click="dialogVisible = false">取消</el-button>
     </div>
   </Dialog>
+
 </template>
 
 
 
 <script setup lang="ts">
-import { getAccessToken, getTenantId } from '@/utils/auth'
-import { ref } from 'vue'
-const approvalUrl =
-  import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/museums/specimen-outbound/reject'
+import { ref, defineEmits, nextTick  } from 'vue'
 
+import {SpecimenOutboundApi} from "@/api/museums/specimenoutbound";
 const {t} = useI18n() // 国际化
 const approvalStatus = ref(0);
 const uploadRef = ref()
 const formLoading = ref(false) // 表单的加载中
 const dialogVisible = ref(false) // 弹窗的是否展示
-const dialogTitle = ref('') // 弹窗的标题
+
 const chkRemarks = ref('')
 const message = useMessage() // 消息弹窗
-const processInstanceId = ref([]) // 文件列表
-const uploadHeaders = ref() // 上传 Header 头
-const updateSupport = ref(0) // 是否更新已经存在的用户数据
+// const processInstanceId = ref([]) // 文件列表
+
+// const updateSupport = ref(0) // 是否更新已经存在的标本数据
+const formData = ref({
+  id: undefined,
+  processInstanceId:undefined,
+  remarks : undefined
+})
 /** 打开弹窗 */
-const open = async (type: string, ) => {
+const open = async (id?: number) => {
   dialogVisible.value = true
-  formLoading.value = true
+  // formLoading.value = true
   approvalStatus.value = 0
-  dialogVisible.value = true
-  updateSupport.value = 0
-  dialogTitle.value = t('action.' + type)
-  processInstanceId.value = []
+
+  // updateSupport.value = 0
+  // processInstanceId.value = []
+  chkRemarks.value = '';
+  formData.value.id = id
   resetForm()
+  console.log(id)
+  // if (id) {
+  //   // console.log(id,formData)
+  //   formData.value.id = id
+  //   console.log(formData.value)
+  //   formLoading.value = true
+  //   // try {
+  //   //   // formData.value = await SpecimenOutboundApi.ApprovalSpecimenOutbound(id)
+  //   // }
+  //   finally {
+  //     formLoading.value = false
+  //   }
+  // }
 }
 defineExpose({ open })// 提供 open 方法,用于打开弹窗
 
 
+
 /** 提交审批 */
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 const submitApproval = async () => {
+
+  // const id= formData.value as unknown as SpecimenOutboundVO
   if (approvalStatus.value === 2 && !chkRemarks.value.trim()) {
-    message.error('请输入驳回原因')
-    formLoading.value = false
-    return
-  }
-  // 提交请求
-  uploadHeaders.value  = {
-    Authorization: 'Bearer ' + getAccessToken(),
-    'tenant-id': getTenantId()
+    // await SpecimenOutboundApi.ApprovalSpecimenOutbound(formData.value.id)
+    message.error(t('请输入驳回原因'))
+    return// 阻止表单提交
   }
-  formLoading.value = true
-
+  // formLoading.value = true;
   try {
-    // 这里应该添加实际的请求发送代码,例如使用 axios 或其他 HTTP 库
-    // await axios.post(approvalUrl, { approvalStatus, chkRemarks, updateSupport }, { headers })
-    console.log('提交审批请求...')
-    dialogVisible.value = false;
-  } catch (error) {
-    message.error('审批提交失败')
+    formLoading.value = true;
+    if (approvalStatus.value === 1) {
+      await SpecimenOutboundApi.ApprovalPassSpecimenOutbound(formData.value)
+    } else {
+      await SpecimenOutboundApi.ApprovalSpecimenOutbound(formData.value);
+    }
+    message.success(t('common.updateSuccess'));
+    dialogVisible.value = false
+    // 发送操作成功的事件
+    emit('success')
   } finally {
     formLoading.value = false
-
   }
 }
+
 /** 重置表单 */
 const resetForm = async (): Promise<void> => {
   // 重置上传状态和文件

+ 3 - 1
src/views/museums/specimenoutbound/index.vue

@@ -1,4 +1,5 @@
 <template>
+  <el-skeleton :loading="loading" animated>
   <ContentWrap>
     <!-- 搜索工作栏 -->
     <el-form
@@ -290,9 +291,10 @@
     />
   </ContentWrap>
 
-  <!-- 表单弹窗:添加/修改 -->
+  <!-- 表单弹窗:出库/审批 -->
   <SpecimenOutboundForm ref="formRef" @success="getList" />
   <Approval ref="ApprovalRef" @success="getList" />
+  </el-skeleton>
 </template>
 
 <script setup lang="ts">