浏览代码

Merge remote-tracking branch 'origin/master'

lmm 2 月之前
父节点
当前提交
a87c68ec06
共有 2 个文件被更改,包括 56 次插入51 次删除
  1. 37 36
      src/views/museums/museumsdocument/index.vue
  2. 19 15
      src/views/museums/specimenoutbound/approval.vue

+ 37 - 36
src/views/museums/museumsdocument/index.vue

@@ -9,24 +9,24 @@
       :inline="true"
       label-width="68px"
     >
-      <el-form-item label="文件名称" prop="fileName">
+      <el-form-item label="文件名称" prop="name">
         <el-input
-          v-model="queryParams.fileName"
+          v-model="queryParams.name"
           placeholder="请输入文件名称"
           clearable
           @keyup.enter="handleQuery"
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="配置编号" prop="configId">
-        <el-input
-          v-model="queryParams.configId"
-          placeholder="请输入配置编号"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
+<!--      <el-form-item label="文件编号" prop="configId">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.id"-->
+<!--          placeholder="请输入配置编号"-->
+<!--          clearable-->
+<!--          @keyup.enter="handleQuery"-->
+<!--          class="!w-240px"-->
+<!--        />-->
+<!--      </el-form-item>-->
 <!--      <el-form-item label="路径" prop="path">-->
 <!--        <el-input-->
 <!--          v-model="queryParams.path"-->
@@ -45,35 +45,35 @@
 <!--          class="!w-240px"-->
 <!--        />-->
 <!--      </el-form-item>-->
-      <el-form-item label="文件类型" prop="fileType">
+      <el-form-item label="文件类型" prop="type">
           <el-input
-            v-model="queryParams.fileType"
+            v-model="queryParams.type"
             placeholder="请输入文件类型"
             clearable
             @keyup.enter="handleQuery"
             class="!w-240px"
           />
       </el-form-item>
-      <el-form-item label="上传时间" prop="uploadDate">
-        <el-date-picker
-          v-model="queryParams.uploadDate"
-          value-format="YYYY-MM-DD HH:mm:ss"
-          type="daterange"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-          class="!w-220px"
-        />
-      </el-form-item>
-      <el-form-item label="上传者" prop="uploadedBy">
-        <el-input
-          v-model="queryParams.uploadedBy"
-          placeholder="请输入上传者"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
+<!--      <el-form-item label="上传时间" prop="uploadDate">-->
+<!--        <el-date-picker-->
+<!--          v-model="queryParams.uploadDate"-->
+<!--          value-format="YYYY-MM-DD HH:mm:ss"-->
+<!--          type="daterange"-->
+<!--          start-placeholder="开始日期"-->
+<!--          end-placeholder="结束日期"-->
+<!--          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"-->
+<!--          class="!w-220px"-->
+<!--        />-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="上传者" prop="uploadedBy">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.uploadedBy"-->
+<!--          placeholder="请输入上传者"-->
+<!--          clearable-->
+<!--          @keyup.enter="handleQuery"-->
+<!--          class="!w-240px"-->
+<!--        />-->
+<!--      </el-form-item>-->
       <el-form-item label="创建时间" prop="createTime">
         <el-date-picker
           v-model="queryParams.createTime"
@@ -113,8 +113,9 @@
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" />
-      <el-table-column label="id" align="center" prop="id" width="80px"/>
+<!--      <el-table-column label="配置编号" align="center" prop="configId" width="80px"/>-->
       <el-table-column label="文件名称" align="center" prop="name" />
+<!--      <el-table-column label="上传者" align="center" prop="uploadedBy" />-->
 <!--      <el-table-column label="配置编号" align="center" prop="configId" />-->
 <!--      <el-table-column label="路径" align="center" prop="path" />-->
       <el-table-column label="文件 URL" align="center" prop="url" />
@@ -223,12 +224,12 @@ const total = ref(0) // 列表的总页数
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
-  fileName: undefined,
+  name: undefined,
   configId: undefined,
   path: undefined,
   url: undefined,
   fileSize: undefined,
-  fileType: undefined,
+  type: undefined,
   uploadDate: [],
   uploadedBy: undefined,
   createTime: []

+ 19 - 15
src/views/museums/specimenoutbound/approval.vue

@@ -6,6 +6,7 @@
   >
     <el-form
       v-loading="formLoading"
+      ref="formRef"
      >
       <el-form-item>
         <el-radio-group  v-model="approvalStatus">
@@ -71,7 +72,7 @@ const open = async (id?: number) => {
   approvalStatus.value = 1
   chkRemarks.value = '';
   formData.value.id = id;
-  await  resetForm()
+  resetForm()
 
   if (id) {
     formLoading.value = true
@@ -79,7 +80,8 @@ const open = async (id?: number) => {
       console.log('hhh', formData.value)
       // formData.value.id = id
       formData.value = await SpecimenOutboundApi.getSpecimenOutbound(id)
-
+      formData.value.processInstanceId = undefined
+      formData.value.rejectionReasons = undefined
     } finally {
       formLoading.value = false
     }
@@ -91,28 +93,24 @@ defineExpose({ open })// 提供 open 方法,用于打开弹窗
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 
 const submitApproval = async () => {
-  if (approvalStatus.value === 2 && !formData.value.rejectionReasons.trim()) {
+  if (approvalStatus.value === 2 && (formData.value.rejectionReasons == '' || formData.value.rejectionReasons == undefined) ) {
     message.error(t('请输入驳回原因'));
     return;
   }
   try {
     formLoading.value = true;
     let statusCode;
-    let processInstanceId;
-    let rejectionReasons;
     console.log('tj', approvalStatus.value)
     if (approvalStatus.value === 1) {
       statusCode = formData.value.status === 0 ? 1 : 5 ;
-      processInstanceId = formData.value.processInstanceId
-    } else  if (approvalStatus.value === 2){
+     } 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,
+      processInstanceId: formData.value.processInstanceId,
+      rejectionReasons: formData.value.rejectionReasons,
   };
     await SpecimenOutboundApi.ApprovalSpecimenOutbound(data);
     message.success(t('审批成功'));
@@ -122,11 +120,15 @@ const submitApproval = async () => {
     formLoading.value = false;
   }
 };
+const formRef = ref() // 表单 Ref
+
 /** 重置表单 */
-const resetForm = async (): Promise<void> => {
-  // 重置上传状态和文件
-  formLoading.value = false
-  await nextTick()
+const resetForm = () => {
+  console.log(123123,"wozhixingle")
+  console.log(formData.value)
+  // // 重置上传状态和文件
+  // formLoading.value = false
+  // await nextTick()
   // uploadRef.value?.clearFiles()
   formData.value = {
     id: undefined,
@@ -138,5 +140,7 @@ const resetForm = async (): Promise<void> => {
     approvalTime: null,
     twoApprovalTime: null,
   };
+  console.log(formData.value)
+  formRef.value?.resetFields()
 }
 </script>