wlzboy
2026-03-31 61c4c3f45e4257e2e7662f033e2719e62366c632
app/pages/mine/invoice/index.vue
@@ -57,7 +57,7 @@
      </view>
      
      <!-- 发票列表 -->
      <view v-for="(item, index) in list" :key="index" class="invoice-item bg-white margin-sm padding-sm radius shadow">
      <view v-for="(item, index) in list" :key="index" class="invoice-item bg-white margin-sm padding-sm radius shadow" @click="handleDetail(item)">
        <view class="flex justify-between border-bottom padding-bottom-xs margin-bottom-xs">
          <text class="text-bold">服务单号: {{ item.serviceCode || item.legacyServiceOrderId || '未知' }}</text>
          <text :class="item.status === 0 ? 'text-orange' : item.status === 1 ? 'text-green' : item.status === 2 ? 'text-red' : 'text-gray'">{{ item.status === 0 ? '待审核' : item.status === 1 ? '已通过' : item.status === 2 ? '已驳回' : '未知' }}</text>
@@ -79,8 +79,9 @@
          <text class="value">{{ item.invoiceNo }}</text>
        </view>
        
        <view class="action-bar margin-top-sm flex justify-end" v-if="item.invoiceUrl">
          <button class="cu-btn sm bg-green" @click="handleDownload" :data-url="item.invoiceUrl">查看发票</button>
        <view class="action-bar margin-top-sm flex justify-end">
          <button v-if="item.invoiceUrl" class="cu-btn sm bg-green margin-right-xs" @click.stop="handleDownload" :data-url="item.invoiceUrl">查看发票</button>
          <button v-if="item.status === 0 || item.status === 2" class="cu-btn sm bg-blue" @click.stop="handleEdit(item)">编辑</button>
        </view>
        <view v-if="item.status === 2 && item.auditRemarks" class="margin-top-xs padding-xs bg-gray radius">
          <text class="text-sm text-red">驳回原因: {{ item.auditRemarks }}</text>
@@ -165,6 +166,13 @@
    },
    handleApply() {
      this.$tab.navigateTo('/pages/mine/invoice/apply')
    },
    handleDetail(item) {
      this.$tab.navigateTo(`/pages/mine/invoice/detail?invoiceId=${item.invoiceId}`)
    },
    handleEdit(item) {
      const invoiceInfo = encodeURIComponent(JSON.stringify(item))
      this.$tab.navigateTo(`/pages/mine/invoice/edit?invoiceInfo=${invoiceInfo}`)
    },
    handleDownload(e) {
      const url = e.currentTarget.dataset.url
@@ -378,6 +386,10 @@
  }
  
  .invoice-item {
    cursor: pointer;
    transition: box-shadow 0.2s;
    &:active { opacity: 0.85; }
    .border-bottom {
      border-bottom: 1rpx solid #eee;
    }