Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

lmm 2 месяцев назад
Родитель
Сommit
6f3705c67d

+ 7 - 8
src/views/museums/museumsdocument/index.vue

@@ -46,14 +46,13 @@
 <!--        />-->
 <!--      </el-form-item>-->
       <el-form-item label="文件类型" prop="fileType">
-        <el-select
-          v-model="queryParams.fileType"
-          placeholder="请选择文件类型"
-          clearable
-          class="!w-240px"
-        >
-          <el-option label="请选择字典生成" value="" />
-        </el-select>
+          <el-input
+            v-model="queryParams.fileType"
+            placeholder="请输入文件类型"
+            clearable
+            @keyup.enter="handleQuery"
+            class="!w-240px"
+          />
       </el-form-item>
       <el-form-item label="上传时间" prop="uploadDate">
         <el-date-picker

+ 52 - 19
src/views/museums/specimeninfo/specimenDetails.vue

@@ -55,7 +55,9 @@
                     }}
                   </el-descriptions-item>
                   <el-descriptions-item label="国际命名:" label-align="right"
-                                        label-class-name="my-label" v-if="specimenData.specimenType !== 2 && specimenData.specimenType !== 0 && specimenData.specimenType !== 1 "> {{
+                                        label-class-name="my-label"
+                                        v-if="specimenData.specimenType !== 2 && specimenData.specimenType !== 0 && specimenData.specimenType !== 1 ">
+                    {{
                       specimenData.internationalName
                     }}
                   </el-descriptions-item>
@@ -88,7 +90,8 @@
                 >
 
                   <el-descriptions-item label="成分/化学式:" label-align="right"
-                                        label-class-name="my-label" v-if="specimenData.specimenType !== 2"> {{
+                                        label-class-name="my-label"
+                                        v-if="specimenData.specimenType !== 2"> {{
                       specimenData.composition
                     }}
                   </el-descriptions-item>
@@ -107,7 +110,9 @@
                                         label-class-name="my-label">{{ specimenData.meteoriteType }}
                   </el-descriptions-item>
                   <el-descriptions-item label="形成时代:" label-width="100px" label-align="right"
-                                        label-class-name="my-label" v-if="specimenData.specimenType !== 1 && specimenData.specimenType !== 3 ">{{
+                                        label-class-name="my-label"
+                                        v-if="specimenData.specimenType !== 1 && specimenData.specimenType !== 3 ">
+                    {{
                       specimenData.era
                     }}
                   </el-descriptions-item>
@@ -122,7 +127,8 @@
                     }}
                   </el-descriptions-item>
                   <el-descriptions-item label="重量(g):" label-width="100px" label-align="right"
-                                        label-class-name="my-label" v-if="specimenData.specimenType !== 2">{{
+                                        label-class-name="my-label"
+                                        v-if="specimenData.specimenType !== 2">{{
                       specimenData.weight
                     }}
                   </el-descriptions-item>
@@ -157,6 +163,11 @@
                       specimenData.specimenPrice
                     }}
                   </el-descriptions-item>
+                  <el-descriptions-item label="入馆时间:" label-class-name="my-label"
+                                        label-align="right">{{
+                      specimenData.acquisitionTime
+                    }}
+                  </el-descriptions-item>
                   <el-descriptions-item label="数量(件/套):" label-align="right"
                                         label-class-name="my-label">{{
                       specimenData.specimenAmount
@@ -168,12 +179,16 @@
                     }}
                   </el-descriptions-item>
                   <el-descriptions-item label="发现时间:" label-class-name="my-label"
-                                        label-align="right" v-if="specimenData.specimenType !== 2 && specimenData.specimenType !== 0 && specimenData.specimenType !== 1 "> {{
+                                        label-align="right"
+                                        v-if="specimenData.specimenType !== 2 && specimenData.specimenType !== 0 && specimenData.specimenType !== 1 ">
+                    {{
                       specimenData.discoveryTime
                     }}
                   </el-descriptions-item>
                   <el-descriptions-item label="降落时间:" label-class-name="my-label"
-                                        label-align="right" v-if="specimenData.specimenType !== 2 && specimenData.specimenType !== 0 && specimenData.specimenType !== 1 ">{{
+                                        label-align="right"
+                                        v-if="specimenData.specimenType !== 2 && specimenData.specimenType !== 0 && specimenData.specimenType !== 1 ">
+                    {{
                       specimenData.fallTime
                     }}
                   </el-descriptions-item>
@@ -182,7 +197,7 @@
               <el-card style="margin-bottom: 5px">
                 <template #header>
                   <div class="card-header" style="text-align: center">
-                    <h1 class="text1" style="">标本用途与状态</h1>
+                    <h1 class="text1" style="">标本用途与资料</h1>
                   </div>
                 </template>
                 <el-descriptions
@@ -192,18 +207,10 @@
                   :size="size"
                   border
                 >
-                  <el-descriptions-item label="入馆时间:" label-class-name="my-label"
-                                        label-align="right">{{
-                      specimenData.acquisitionTime
-                    }}
-                  </el-descriptions-item>
-                  <!--                <el-descriptions-item label="文献资料:" label-class-name="my-label" label-align="right">{{-->
-                  <!--                    specimenData.description-->
-                  <!--                  }}-->
-                  <!--                </el-descriptions-item>-->
+
                   <el-descriptions-item label="主要用途:" label-class-name="my-label"
                                         label-align="right">{{
-                      specimenData.mainPurpose
+                      mainPurposeText
                     }}
                   </el-descriptions-item>
                   <el-descriptions-item label="具体用途:" label-class-name="my-label"
@@ -216,6 +223,11 @@
                       specimenData.notes
                     }}
                   </el-descriptions-item>
+                  <el-descriptions-item label="文献资料:" label-class-name="my-label"
+                                        label-align="right">
+                    <div v-html="specimenData.description">
+                  </div>
+                  </el-descriptions-item>
                 </el-descriptions>
               </el-card>
             </el-col>
@@ -397,7 +409,7 @@ const preservationTypeText = computed(() => {
       return '';
   }
 });
-/**馆藏状态(在馆、借出)**/
+/**来源**/
 const sourceText = computed(() => {
   if (specimenData.value === null) {
     return '';
@@ -413,7 +425,28 @@ const sourceText = computed(() => {
       return '';
   }
 });
-
+/**主要用途**/
+const mainPurposeText = computed(() => {
+  if (specimenData.value === null) {
+    return '';
+  }
+  switch (specimenData.value.mainPurpose) {
+    case 0:
+      return '工业原料';
+    case 1:
+      return '药用';
+    case 2:
+      return '建材';
+    case 3:
+      return '科学研究';
+    case 4:
+      return '观赏';
+    case 5:
+      return '其他';
+    default:
+      return '';
+  }
+});
 // // 在组件加载时获取数据
 onMounted(async () => {
   await fetchData()

+ 9 - 5
src/views/museums/specimenoutbound/ApproalProcess.vue

@@ -29,7 +29,7 @@
       <el-form-item label="标本编号" prop="specimenNumber">
         <el-input
           v-model="queryParams.specimenNumber"
-          placeholder="请输入申请出库的标本编号"
+          placeholder="请输入标本编号"
           clearable
           @keyup.enter="handleQuery"
           class="!w-240px"
@@ -89,7 +89,7 @@
         <template #default="{ row }">
           <div v-if="row.attachments">
           <el-image
-            v-if="row.type && row.type.includes('image')"
+            v-if="isImage(row.attachments.type)"
             class="h-80px w-80px"
             lazy
             :src="row.attachments"
@@ -98,14 +98,14 @@
             fit="cover"
           />
           <el-link
-            v-else-if="row.type && row.type.includes('pdf')"
+            v-if="isPDF(row.attachments.type)"
             type="primary"
             :href="row.attachments"
             :underline="false"
             target="_blank"
           >预览</el-link
           >
-          <el-link v-else type="primary" download :href="row.attachments" :underline="false" target="_blank"
+          <el-link type="primary" download :href="row.attachments" :underline="false" target="_blank"
           >下载</el-link
           >
           </div>
@@ -214,7 +214,11 @@ 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

+ 1 - 1
src/views/museums/specimenoutbound/SpecimenOutboundForm.vue

@@ -143,7 +143,7 @@ const formRules = reactive({
   number: [{required: true, message: '标本编号不能为空', trigger: 'blur'}],
   applicantName: [{required: true, message: '申请人姓名不能为空', trigger: 'blur'}],
   applicationUsage: [{required: true, message: '申请单位不能为空', trigger: 'blur'}],
-  // projectName: [{required: true, message: '研究项目名称不能为空', trigger: 'blur'}],
+  phoneNumber: [{required: true, message: '电话号码不能为空', trigger: 'blur'}],
   startTime: [{required: true, message: '项目开始时间不能为空', trigger: 'blur'}],
   endTime: [{required: true, message: '项目结束时间不能为空', trigger: 'blur'}]
 })

+ 16 - 8
src/views/museums/specimenoutbound/approval.vue

@@ -9,8 +9,8 @@
      >
       <el-form-item>
         <el-radio-group  v-model="approvalStatus">
-          <el-radio :label="1">通过</el-radio>
-          <el-radio :label="2">驳回</el-radio>
+          <el-radio :label="1" :value="1">通过</el-radio>
+          <el-radio :label="2" :value="2">驳回</el-radio>
         </el-radio-group>
       </el-form-item>
 
@@ -71,12 +71,19 @@ const open = async (id?: number) => {
   approvalStatus.value = 1
   chkRemarks.value = '';
   formData.value.id = id;
-  resetForm()
+  // resetForm()
   console.log(id)
-
+  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
+    }
+  }
 }
-
-
 defineExpose({ open })// 提供 open 方法,用于打开弹窗
 
 /** 提交审批 */
@@ -113,12 +120,13 @@ const submitApproval = async () => {
     formLoading.value = true;
     let statusCode;
     let processInstanceId;
+    console.log('tj', approvalStatus.value)
     if (approvalStatus.value === 0) {
-      statusCode = formData.value.status === 0 ? 1 : 2 ;
+      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 : 6;
+      statusCode = formData.value.status === 1 ? 5 : 1;
       processInstanceId = formData.value.status === 2 ?
         formData.value.rejectionReasons : formData.value.processInstanceId;
     }