Browse Source

fix: 关联已有和协议查看里的空顺丰运费显示月结

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 1 week ago
parent
commit
d259004f9d

+ 4 - 2
web-admin/src/components/business/sample-freight-pick-table/index.vue

@@ -51,7 +51,9 @@
         align="right"
         header-align="center"
       >
-        <template #default="{ row }">¥{{ formatMoneyDisplay(row.freightAmount) }}</template>
+        <template #default="{ row }">{{
+          freightAmountText(row.transportMode, row.freightAmount) || '—'
+        }}</template>
       </el-table-column>
       <el-table-column
         prop="linkedSampleCount"
@@ -118,7 +120,7 @@
 
 <script setup lang="ts">
   import type { SampleFreight } from '@/api/sample-freight'
-  import { formatMoneyDisplay } from '@/utils/money-format'
+  import { freightAmountText } from '@/utils/sf-express-freight'
   import {
     flattenSampleFreights,
     sampleFreightSpanMethod,

+ 51 - 44
web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue

@@ -175,11 +175,7 @@
                     </div>
                   </div>
                   <div
-                    v-if="
-                      row.freight?.id ||
-                      row.freight?.transportMode ||
-                      row.transport?.etaTime
-                    "
+                    v-if="row.freight?.id || row.freight?.transportMode || row.transport?.etaTime"
                     class="sample-card__section sample-card__section--transport"
                   >
                     <div class="sample-card__section-label">运输与运费</div>
@@ -194,9 +190,14 @@
                         <div class="data-label">运费(元)</div>
                         <div class="data-value"
                           >{{
-                            row.freight?.freightAmount != null
-                              ? '¥' + formatMoneyDisplay(row.freight.freightAmount)
-                              : '—'
+                            freightAmountText(
+                              row.freight?.transportMode,
+                              row.freight?.freightAmount
+                            ) === '月结'
+                              ? '月结'
+                              : row.freight?.freightAmount != null
+                                ? '¥' + formatMoneyDisplay(row.freight.freightAmount)
+                                : '—'
                           }}{{
                             Number(row.freight?.linkedSampleCount || 0) > 1 ? '(共用)' : ''
                           }}</div
@@ -523,12 +524,7 @@
                     <span v-else class="muted-dash">—</span>
                   </template>
                 </el-table-column>
-                <el-table-column
-                  label="备注"
-                  min-width="140"
-                  align="center"
-                  show-overflow-tooltip
-                >
+                <el-table-column label="备注" min-width="140" align="center" show-overflow-tooltip>
                   <template #default="{ row }">{{ row.remark || '—' }}</template>
                 </el-table-column>
                 <el-table-column
@@ -587,9 +583,7 @@
 
                   <div
                     class="data-grid"
-                    :class="
-                      String(sp.payMode) === 'fq' ? 'data-grid--6' : 'data-grid--3'
-                    "
+                    :class="String(sp.payMode) === 'fq' ? 'data-grid--6' : 'data-grid--3'"
                   >
                     <div class="data-item">
                       <div class="data-label">缴费模式</div>
@@ -660,7 +654,9 @@
 
                     <div class="sample-pay-readonly__tr-title">
                       转账记录
-                      <span v-if="(sch.transfers || []).length" class="sample-pay-readonly__tr-count"
+                      <span
+                        v-if="(sch.transfers || []).length"
+                        class="sample-pay-readonly__tr-count"
                         >({{ (sch.transfers || []).length }} 笔)</span
                       >
                     </div>
@@ -790,12 +786,7 @@
                   align="center"
                   show-overflow-tooltip
                 />
-                <el-table-column
-                  label="附件"
-                  min-width="280"
-                  align="left"
-                  header-align="center"
-                >
+                <el-table-column label="附件" min-width="280" align="left" header-align="center">
                   <template #default="{ row }">
                     <ProtocolAttachmentReadonly
                       v-if="refundRecordAttachments(row).length"
@@ -879,9 +870,7 @@
                       </div>
                       <div class="data-item">
                         <div class="data-label">每期间隔(月)</div>
-                        <div class="data-value">{{
-                          dash(payment?.installmentIntervalMonths)
-                        }}</div>
+                        <div class="data-value">{{ dash(payment?.installmentIntervalMonths) }}</div>
                       </div>
                       <div class="data-item">
                         <div class="data-label">分期开始时间</div>
@@ -1135,17 +1124,32 @@
                   align="center"
                   header-align="center"
                 />
-                <el-table-column label="变更类型" min-width="110" align="center" header-align="center">
+                <el-table-column
+                  label="变更类型"
+                  min-width="110"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">
                     <el-tag :type="statusChangeTagType(String(row.changeType || ''))" size="small">
                       {{ statusChangeTypeLabel(String(row.changeType || '')) }}
                     </el-tag>
                   </template>
                 </el-table-column>
-                <el-table-column label="变更时间" min-width="170" align="center" header-align="center">
+                <el-table-column
+                  label="变更时间"
+                  min-width="170"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">{{ dash(row.changeTime) }}</template>
                 </el-table-column>
-                <el-table-column label="状态流转" min-width="160" align="center" header-align="center">
+                <el-table-column
+                  label="状态流转"
+                  min-width="160"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">{{ statusChangeFlow(row) }}</template>
                 </el-table-column>
                 <el-table-column
@@ -1157,7 +1161,12 @@
                 >
                   <template #default="{ row }">{{ statusChangeDesc(row) }}</template>
                 </el-table-column>
-                <el-table-column label="操作人" min-width="120" align="center" header-align="center">
+                <el-table-column
+                  label="操作人"
+                  min-width="120"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">{{ dash(row.operatorUserName) }}</template>
                 </el-table-column>
               </el-table>
@@ -1228,6 +1237,7 @@
   } from '@/api/admin'
   import { downloadAttachmentFile } from '@/utils/download-attachment'
   import { formatMoneyDisplay } from '@/utils/money-format'
+  import { freightAmountText } from '@/utils/sf-express-freight'
   import {
     protocolStatusDisplayLabel,
     protocolStatusTagType,
@@ -1432,13 +1442,14 @@
    */
   const v1PayPeriods = computed(() => {
     const details = paymentDetails.value
-    if (!details.length) return [] as Array<{
-      scheduleNo: number
-      dueAmount: number | null
-      dueDate: string
-      paidAmount: number
-      transfers: Array<Record<string, any>>
-    }>
+    if (!details.length)
+      return [] as Array<{
+        scheduleNo: number
+        dueAmount: number | null
+        dueDate: string
+        paidAmount: number
+        transfers: Array<Record<string, any>>
+      }>
 
     const paidOf = (rows: Array<Record<string, any>>) =>
       rows
@@ -1456,9 +1467,7 @@
               : payment.value?.contractAmount != null
                 ? Number(payment.value.contractAmount)
                 : null,
-          dueDate: String(
-            payment.value?.lumpSumDeadline || details[0]?.installmentDueDate || ''
-          ),
+          dueDate: String(payment.value?.lumpSumDeadline || details[0]?.installmentDueDate || ''),
           paidAmount: paidOf(details),
           transfers: details
         }
@@ -1575,9 +1584,7 @@
   }
 
   const basicMotherNameDisplay = computed(() =>
-    dash(
-      partyCustomer.value?.motherName || props.listRow?.motherName || protocol.value?.motherName
-    )
+    dash(partyCustomer.value?.motherName || props.listRow?.motherName || protocol.value?.motherName)
   )
 
   const dialogTitle = computed(() => {

+ 33 - 7
web-admin/src/views/research-donation/list/DonationViewDialog.vue

@@ -152,9 +152,14 @@
                         <div class="data-label">运费(元)</div>
                         <div class="data-value"
                           >{{
-                            row.freight?.freightAmount != null
-                              ? '¥' + formatMoneyDisplay(row.freight.freightAmount)
-                              : '—'
+                            freightAmountText(
+                              row.freight?.transportMode,
+                              row.freight?.freightAmount
+                            ) === '月结'
+                              ? '月结'
+                              : row.freight?.freightAmount != null
+                                ? '¥' + formatMoneyDisplay(row.freight.freightAmount)
+                                : '—'
                           }}{{
                             Number(row.freight?.linkedSampleCount || 0) > 1 ? '(共用)' : ''
                           }}</div
@@ -443,17 +448,32 @@
                   align="center"
                   header-align="center"
                 />
-                <el-table-column label="变更类型" min-width="110" align="center" header-align="center">
+                <el-table-column
+                  label="变更类型"
+                  min-width="110"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">
                     <el-tag :type="statusChangeTagType(String(row.changeType || ''))" size="small">
                       {{ statusChangeTypeLabel(String(row.changeType || '')) }}
                     </el-tag>
                   </template>
                 </el-table-column>
-                <el-table-column label="变更时间" min-width="170" align="center" header-align="center">
+                <el-table-column
+                  label="变更时间"
+                  min-width="170"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">{{ dash(row.changeTime) }}</template>
                 </el-table-column>
-                <el-table-column label="状态流转" min-width="160" align="center" header-align="center">
+                <el-table-column
+                  label="状态流转"
+                  min-width="160"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">{{ statusChangeFlow(row) }}</template>
                 </el-table-column>
                 <el-table-column
@@ -465,7 +485,12 @@
                 >
                   <template #default="{ row }">{{ statusChangeDesc(row) }}</template>
                 </el-table-column>
-                <el-table-column label="操作人" min-width="120" align="center" header-align="center">
+                <el-table-column
+                  label="操作人"
+                  min-width="120"
+                  align="center"
+                  header-align="center"
+                >
                   <template #default="{ row }">{{ dash(row.operatorUserName) }}</template>
                 </el-table-column>
               </el-table>
@@ -512,6 +537,7 @@
   import { formatDisplayOrDash } from '@/utils/datetime-display'
   import { computed, nextTick, ref, watch } from 'vue'
   import { formatMoneyDisplay } from '@/utils/money-format'
+  import { freightAmountText } from '@/utils/sf-express-freight'
   import { Close } from '@element-plus/icons-vue'
   import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
   import SampleQcInfoGroupedPanel from '@/components/business/sample-qc-info-grouped-panel/index.vue'