3
0

2 Коміти 6f3705c67d ... 4293025d1f

Автор SHA1 Опис Дата
  lmm 4293025d1f Merge remote-tracking branch 'origin/master' 2 місяців тому
  lmm 8fba6c32a7 Merge remote-tracking branch 'origin/master' 2 місяців тому

+ 10 - 10
src/views/museums/photogroup/PhotosIndex.vue

@@ -26,16 +26,16 @@
 <!--          class="!w-240px"-->
 <!--        />-->
 <!--      </el-form-item>-->
-      <el-form-item label="上传时间" prop="createdAt">
-        <el-date-picker
-          v-model="queryParams.createdAt"
-          value-format="YYYY-MM-DD"
-          type="date"
-          placeholder="选择上传时间"
-          clearable
-          class="!w-240px"
-        />
-      </el-form-item>
+<!--      <el-form-item label="上传时间" prop="createdAt">-->
+<!--        <el-date-picker-->
+<!--          v-model="queryParams.createdAt"-->
+<!--          value-format="YYYY-MM-DD"-->
+<!--          type="date"-->
+<!--          placeholder="选择上传时间"-->
+<!--          clearable-->
+<!--          class="!w-240px"-->
+<!--        />-->
+<!--      </el-form-item>-->
       <el-form-item label="创建时间" prop="createTime">
         <el-date-picker
           v-model="queryParams.createTime"

+ 2 - 18
src/views/museums/specimenoutbound/ApproalProcess.vue

@@ -88,24 +88,12 @@
       <el-table-column label="附件" align="center" prop="attachments" >
         <template #default="{ row }">
           <div v-if="row.attachments">
-          <el-image
-            v-if="isImage(row.attachments.type)"
-            class="h-80px w-80px"
-            lazy
-            :src="row.attachments"
-            :preview-src-list="[row.attachments]"
-            preview-teleported
-            fit="cover"
-          />
           <el-link
-            v-if="isPDF(row.attachments.type)"
             type="primary"
+            download
             :href="row.attachments"
             :underline="false"
             target="_blank"
-          >预览</el-link
-          >
-          <el-link type="primary" download :href="row.attachments" :underline="false" target="_blank"
           >下载</el-link
           >
           </div>
@@ -214,11 +202,7 @@ const getList = async () => {
     loading.value = false
   }
 }
-const isImage = (type: string): boolean => {
-  // 这里定义哪些MIME类型被认为是图片
-  const imageTypes = ['image/jpeg', 'image/png', 'image/gif'];
-  return imageTypes.includes(type);
-};
+
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.pageNo = 1

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

@@ -8,7 +8,7 @@
       v-loading="formLoading"
 
     >
-            <div v-if="formData.status === 6 &&  formData.status === 2">
+            <div v-if="formData.status === 6 ||  formData.status === 2">
               <div style="margin-bottom: 20px;color: red;font-size: 20px">
                 申请驳回原因:{{formData.processInstanceId}}
               </div>
@@ -241,7 +241,8 @@ const resetForm = () => {
     startTime: undefined,
     endTime:undefined,
     projectName:undefined,
-    phoneNumber:undefined
+    phoneNumber:undefined,
+    outboundRemarks:undefined
   }
   formRef.value?.resetFields()
 }

+ 25 - 36
src/views/museums/specimenoutbound/approval.vue

@@ -46,7 +46,7 @@ import { ref, defineEmits, nextTick  } from 'vue'
 
 import {SpecimenOutboundApi} from "@/api/museums/specimenoutbound";
 const {t} = useI18n() // 国际化
-const approvalStatus = ref(0);
+const approvalStatus = ref(1);
 // const uploadRef = ref()
 const formLoading = ref(false) // 表单的加载中
 const dialogVisible = ref(false) // 弹窗的是否展示
@@ -71,14 +71,15 @@ const open = async (id?: number) => {
   approvalStatus.value = 1
   chkRemarks.value = '';
   formData.value.id = id;
-  // resetForm()
-  console.log(id)
+  await  resetForm()
+
   if (id) {
     formLoading.value = true
     try {
       console.log('hhh', formData.value)
-      formData.value.id = id
+      // formData.value.id = id
       formData.value = await SpecimenOutboundApi.getSpecimenOutbound(id)
+
     } finally {
       formLoading.value = false
     }
@@ -88,29 +89,7 @@ defineExpose({ open })// 提供 open 方法,用于打开弹窗
 
 /** 提交审批 */
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
-// const submitApproval = async () => {
-//   // 检查是否有驳回原因
-//   if (approvalStatus.value === 2   && !formData.value.rejectionReasons.trim()) {
-//     message.error(t('请输入驳回原因'))
-//     return// 阻止表单提交
-//   }
-//   try {
-//     formLoading.value = true;
-//     const data = {
-//       ...formData.value,
-//      status: approvalStatus.value, // 确保传入审批状态
-//       processInstanceId:  approvalStatus.value === 2 ? formData.value.rejectionReasons : formData.value.processInstanceId // 如果是驳回,则传入驳回原因
-//     };
-//     console.log(data,"wozaizheli")
-//     await SpecimenOutboundApi.ApprovalSpecimenOutbound(data)
-//     message.success(t('审批成功'));
-//     dialogVisible.value = false
-//     // 发送操作成功的事件
-//     emit('success')
-//   } finally {
-//     formLoading.value = false
-//   }
-// }
+
 const submitApproval = async () => {
   if (approvalStatus.value === 2 && !formData.value.rejectionReasons.trim()) {
     message.error(t('请输入驳回原因'));
@@ -120,21 +99,21 @@ const submitApproval = async () => {
     formLoading.value = true;
     let statusCode;
     let processInstanceId;
+    let rejectionReasons;
     console.log('tj', approvalStatus.value)
-    if (approvalStatus.value === 0) {
-      statusCode = formData.value.status === 1 ? 1 : 2 ;
-      processInstanceId = formData.value.status === 1 ?
-        formData.value.processInstanceId : formData.value.rejectionReasons;
-    } else  if (approvalStatus.value === 1){
-      statusCode = formData.value.status === 1 ? 5 : 1;
-      processInstanceId = formData.value.status === 2 ?
-        formData.value.rejectionReasons : formData.value.processInstanceId;
+    if (approvalStatus.value === 1) {
+      statusCode = formData.value.status === 0 ? 1 : 5 ;
+      processInstanceId = formData.value.processInstanceId
+    } else  if (approvalStatus.value === 2){
+      statusCode = formData.value.status === 0 ? 2 : 6;
+     rejectionReasons = formData.value.rejectionReasons
     }
     const data = {
       ...formData.value,
       status: statusCode,
       processInstanceId: processInstanceId,
-    };
+      rejectionReasons: rejectionReasons,
+  };
     await SpecimenOutboundApi.ApprovalSpecimenOutbound(data);
     message.success(t('审批成功'));
     dialogVisible.value = false;
@@ -149,5 +128,15 @@ const resetForm = async (): Promise<void> => {
   formLoading.value = false
   await nextTick()
   // uploadRef.value?.clearFiles()
+  formData.value = {
+    id: undefined,
+    status: 0,
+    processInstanceId: undefined,
+    rejectionReasons: undefined,
+    approveUsers: undefined,
+    twoApproveUsers: undefined,
+    approvalTime: null,
+    twoApprovalTime: null,
+  };
 }
 </script>