<template>
  <view class="box">
    <view>{{ obj.supCusName }}</view>
    <view
      >结算时间：<text>{{ obj.settlementTime }}</text></view
    >
    <view
      >单据编号：<text>{{ obj.revenueNumber }}</text></view
    >
    <view
      >收款类型：<text>{{ getPayment(obj) }}</text></view
    >
    <view
      >结算金额：<text
        >￥ {{ obj.totalPrice }}</text
      >
    </view>
    <view
      >结算方式：<text>{{ getPaymentMethod(obj) }}</text></view
    >
    <view
      >收款人：<text>{{ obj.revenueName }}</text></view
    >
    <view v-if="obj.orderNumber"
      >出货单号：
      <text>{{ obj.orderNumber }}</text></view
    >
    <up-image :show-loading="true" v-for="(item, index) in list" :key="index" :src="item.url" width="80px" height="80px"></up-image>
  </view>
</template>
<script setup lang="ts">
import { FinanceApi, PictureApi } from "@/services";
import { ImagesType, OrderType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
const obj = ref<any>({
});
const list = ref<any>([])
const getPayment = (item: any) => {
  return ["出货单收款", "其他收款(手动)"][
    item.paymentType
  ];
};
const getPaymentMethod = (item: any) => {
  return ["", "现金", "转账", "微信", "支付宝"][item.paymentMethod];
};
onLoad((option: any) => {
  // 接收传递的标题参数
  FinanceApi.getRevenueDetailsById({ id: option.id }).then((res) => {
    if (res.code === 200) {
      obj.value = res.data;
    }
  });
  PictureApi.getAnnex({
      businessId: option.id,
      orderType: OrderType.Income,
      imagesType: ImagesType.NORMARL,
    }).then((res) => {
      if (res.code === 200) {
        list.value = res.data;
      }
    });
});
</script>
<style lang="scss" scoped>
.box {
  background: #ffffff;
  box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
  border-radius: 13rpx;
  font-size: 26rpx;
  margin: 26rpx;
  padding: 26rpx;
  line-height: 50rpx;
  text {
    font-size: 24rpx;
    color: rgba(0, 0, 0, 0.7);
  }
}
</style>
