Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

Signed-off-by: wwj <2760333092@qq.com>
lmm 2 ay önce
ebeveyn
işleme
9826ad92ac

+ 54 - 33
src/views/museums/specimeninfo/index.vue

@@ -470,13 +470,13 @@
     <div>
       <el-form-item label="尺寸">
         <el-radio-group v-model="formData.size">
-          <el-radio :value="1">90:54</el-radio>
-          <el-radio :value="2">90:50</el-radio>
-          <el-radio :value="3">5:5</el-radio>
+          <el-radio :value="1">7.5 : 5.5</el-radio>
+          <el-radio :value="2">9 : 6</el-radio>
+          <el-radio :value="3">12 : 8</el-radio>
         </el-radio-group>
       </el-form-item>
       <el-form :model="formData" label-width="auto" style="max-width: 750px">
-        <el-form-item label="标题">
+        <el-form-item label="标题">
           <el-select v-model="formData.content" placeholder="请选择字段">
             <el-option
               v-for="item in optionsLabel"
@@ -486,6 +486,16 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="副标题:">
+          <el-select v-model="formData.content2" placeholder="请选择字段">
+            <el-option
+              v-for="item in optionsLabel"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
 
         <div v-for="(item, index) in formData.contentItems" :key="index" style="margin-top: 10px">
           <el-form-item>
@@ -583,13 +593,14 @@ const queryParams = reactive({
 //标签打印的表单
 const formData = ref({
   content: undefined,
+  content2:undefined,
   selectedData: [] as SpecimenInfoVO[],
   contentItems: [] as { label: string; value: string }[],
   size:1,
   sizeMap: {
-    1: { width: 900, height: 540 },
-    2: { width: 900, height: 500 },
-    3: { width: 500, height: 500 }
+    1: { width: 750, height: 550 },
+    2: { width: 900, height: 600 },
+    3: { width: 1200, height: 800 }
   }
 })
 const queryFormRef = ref() // 搜索的表单
@@ -693,27 +704,29 @@ const optionsLabel = [
     label: '中文名称',
   },
   {
-    value: 'specimenNumber',
-    label: '标本编号',
+    value: 'englishName',
+    label: '英文名称',
   },
   {
-    value: 'specimenType',
-    label: '标本类型',
+    value: 'specimenNumber',
+    label: '标本编号',
   },
   {
     value: 'storageLocation',
     label: '存放位置',
   },
   {
-    value: 'englishName',
-    label: '英文名称',
+    value: 'provider',
+    label: '标本提供者',
+  },
+  {
+    value: 'acquisitionTime',
+    label: '入藏时间',
   },
-
   {
     value: 'composition',
     label: '成分',
   },
-
   {
     value: 'origin',
     label: '产地',
@@ -730,15 +743,10 @@ const optionsLabel = [
     value: 'meteoriteType',
     label: '陨石类型',
   },
-
   {
     value: 'internationalName',
     label: '国际命名',
   },
-  {
-    value: 'preservationType',
-    label: '保存类型',
-  },
   {
     value: 'size',
     label: '尺寸',
@@ -755,19 +763,12 @@ const optionsLabel = [
     value: 'source',
     label: '来源',
   },
-  {
-    value: 'provider',
-    label: '标本提供者',
-  },
+
   {
     value: 'purpose',
     label: '用途',
   },
 
-  {
-    value: 'acquisitionTime',
-    label: '入藏时间',
-  },
 
 ]
 
@@ -844,7 +845,11 @@ const onSubmit = async () => {
       const content = formData.value.contentItems
         .map(contentItem => {
           const label = optionsLabel.find(opt => opt.value === contentItem.value)?.label
-          const value = item[contentItem.value]
+          let value = item[contentItem.value]
+          // 如果是时间字段,进行格式化
+          if (['acquisitionTime'].includes(contentItem.value) && value) {
+            value = formatDate(value as number,'YYYY年MM月DD日');
+          }
           if (value !== null && value !== undefined && value !== '') {
             return `${label}:${value}`
           }
@@ -852,9 +857,11 @@ const onSubmit = async () => {
         })
         .filter(Boolean) // 过滤掉空字符串
         .join('\n') // 每个内容项换行
-
+      console.log('content',content)
+      const subtitle = formData.value.content2  ? '(' + item[formData.value.content2] + ')' : ''
       return {
         title: item[formData.value.content],
+        subtitle:subtitle, // 添加副标题
         content: content,
         specimenNumber: item.specimenNumber
       }
@@ -875,16 +882,30 @@ const onSubmit = async () => {
         // 设置文本对齐方式为居中
         ctx.textAlign = 'center'
         // 设置字体样式
-        ctx.font = `${(size.width+size.height) * 0.06}px Arial`
+        ctx.font = `${(size.width+size.height) * 0.06}px 方正黑体简`
         // 设置文本颜色
         ctx.fillStyle = 'black'
         // 绘制标题
-        ctx.fillText(label.title, canvas.width / 2, size.height * 0.3)
+        if (label.subtitle && label.subtitle !== '') {
+          ctx.fillText(label.title, canvas.width / 2, size.height * 0.2)
+        }else {
+          ctx.fillText(label.title, canvas.width / 2, size.height * 0.3)
+        }
+
+
+        // 添加副标题
+        if (label.subtitle && label.subtitle !== '') {
+        ctx.textAlign = 'center'
+        ctx.font = `${(size.width + size.height) * 0.03}px Times New Roman`
+        ctx.fillStyle = 'black'
+        ctx.fillText(label.subtitle, canvas.width / 2, size.height * 0.3)
+        }
+
 
         // 设置文本对齐方式为左对齐
         ctx.textAlign = 'left'
         // 设置字体样式
-        ctx.font = `${(size.width+size.height) * 0.03}px Arial`
+        ctx.font = `${(size.width+size.height) * 0.03}px 方正黑体简`
         // 绘制内容
         const lines = label.content.split('\n')
         let y = size.height * 0.45

+ 28 - 77
src/views/museums/specimenoutbound/OutboundForm/outboundDetail.vue

@@ -112,67 +112,26 @@
                     label-class-name="my-label"
                     class-name="my-content"
                   >
-                    <div v-if="outboundData.attachments && outboundData.attachments.type && outboundData.attachments.type.includes('image')" class="image-container">
-                      <el-image
-                        class="h-80px w-80px"
-                        lazy
-                        :src="outboundData.attachments"
-                        :preview-src-list="outboundData.attachments ? [outboundData.attachments] : []"
-                        preview-teleported
-                        fit="cover"
-                      />
-                    </div>
-                    <el-link
-                      v-else-if="outboundData.attachments"
-                      type="primary"
-                      :href="outboundData.attachments"
-                      :underline="false"
-                      target="_blank"
-                    >下载</el-link>
-
-<!--                    <div v-if="outboundData.attachments && outboundData.attachments.type('image')" class="image-container">-->
+<!--                    <div v-if="outboundData.attachments && outboundData.attachments.type && outboundData.attachments.type.includes('image')" class="image-container">-->
 <!--                      <el-image-->
 <!--                        class="h-80px w-80px"-->
 <!--                        lazy-->
-<!--                        :src="outboundData.attachments.url"-->
-<!--                        :preview-src-list="[attachments]"-->
+<!--                        :src="outboundData.attachments"-->
+<!--                        :preview-src-list="outboundData.attachments ? [outboundData.attachments] : []"-->
 <!--                        preview-teleported-->
 <!--                        fit="cover"-->
 <!--                      />-->
 <!--                    </div>-->
 <!--                    <el-link-->
-<!--                      v-else-if="outboundData.attachments && outboundData.attachments.type.includes('pdf')"-->
-<!--                      type="primary"-->
-<!--                      :href="outboundData.attachments"-->
-<!--                      :underline="false"-->
-<!--                      target="_blank"-->
-<!--                    >预览</el-link>-->
-<!--                    <el-link-->
-<!--                      v-else-->
+<!--                      v-else-if="outboundData.attachments"-->
 <!--                      type="primary"-->
-<!--                      download-->
 <!--                      :href="outboundData.attachments"-->
 <!--                      :underline="false"-->
 <!--                      target="_blank"-->
 <!--                    >下载</el-link>-->
-
-
-                    <!--                    <div class="demo-image__preview" v-if="outboundData" >-->
-
-                    <!--                      <el-image-->
-                    <!--                        style="width: 40px; height:40px;margin-right: 5px"-->
-                    <!--                        class="h-80px w-80px"-->
-                    <!--                        lazy-->
-                    <!--                        :src="outboundData.attachments"-->
-                    <!--                        :preview-src-list="outboundData.attachments"-->
-                    <!--                        preview-teleported-->
-                    <!--                        fit="cover"-->
-
-
-                    <!--                      />-->
-
-                    <!--                  </div>-->
-
+                    <div class="demo-image__preview" v-if="outboundData">
+                      <a :href="outboundData.attachments" target="_blank">下载附件</a>
+                    </div>
                   </el-descriptions-item>
                   <el-descriptions-item
                     :rowspan="4"
@@ -181,37 +140,29 @@
                     align="center"
                     label-class-name="my-label"
                     class-name="my-content"
-                  ><div class="demo-image__preview" v-if="outboundData" >
-
-<!--                    <el-image-->
-<!--                      style="width: 40px; height:40px;margin-right: 5px"-->
-<!--                      class="h-80px w-80px"-->
-<!--                      lazy-->
-<!--                      :src="outboundData.sampleStatus"-->
-<!--                      :preview-src-list="outboundData.sampleStatus"-->
-<!--                      preview-teleported-->
-<!--                      fit="cover"-->
-
+                  >
 
-<!--                    />-->
-                    <div v-if="outboundData.sampleStatus && outboundData.sampleStatus.type && outboundData.sampleStatus.type.includes('image')" class="image-container">
-                      <el-image
-                        class="h-80px w-80px"
-                        lazy
-                        :src="outboundData.sampleStatus"
-                        :preview-src-list="outboundData.sampleStatus ? [outboundData.sampleStatus] : []"
-                        preview-teleported
-                        fit="cover"
-                      />
+                    <div class="demo-image__preview" v-if="outboundData">
+                      <a :href="outboundData.sampleStatus" target="_blank">下载附件</a>
                     </div>
-                    <el-link
-                      v-else-if="outboundData.sampleStatus"
-                      type="primary"
-                      :href="outboundData.sampleStatus"
-                      :underline="false"
-                      target="_blank"
-                    >下载</el-link>
-                  </div>
+<!--                    <div v-if="outboundData.sampleStatus && outboundData.sampleStatus.type && outboundData.sampleStatus.type.includes('image')" class="image-container">-->
+<!--                      <el-image-->
+<!--                        class="h-80px w-80px"-->
+<!--                        lazy-->
+<!--                        :src="outboundData.sampleStatus"-->
+<!--                        :preview-src-list="outboundData.sampleStatus ? [outboundData.sampleStatus] : []"-->
+<!--                        preview-teleported-->
+<!--                        fit="cover"-->
+<!--                      />-->
+<!--                    </div>-->
+<!--                    <el-link-->
+<!--                      v-else-if="outboundData.sampleStatus"-->
+<!--                      type="primary"-->
+<!--                      :href="outboundData.sampleStatus"-->
+<!--                      :underline="false"-->
+<!--                      target="_blank"-->
+<!--                    >下载</el-link>-->
+<!--                  </div>-->
 
                   </el-descriptions-item>
                 </el-descriptions>

+ 1 - 1
src/views/museums/specimenoutbound/OutboundForm/specimenReturnForm.vue

@@ -60,7 +60,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
 const formType = ref('') // 表单的类型:create - 新增;update - 修改
 
 const formData = ref({
-  id: -1,
+  id: undefined,
   infoId: undefined,
   chineseName: undefined,
   specimenNumber: undefined,

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

@@ -9,7 +9,7 @@
 
     >
             <div v-if="formData.status === 6 ||  formData.status === 2">
-              <div style="margin-bottom: 20px;color: red;font-size: 20px">
+              <div style="margin-bottom: 20px;margin-left:40px;color: #c54545;font-size: 20px">
                 申请驳回原因:{{formData.processInstanceId}}
               </div>
                   <div style="margin-bottom: 20px;margin-left: 70px;font-size: 18px; font-weight: bold">请重新申请</div>