<template>
  <div>
    <Des :list="desList" />
  </div>

</template>

<script lang="ts">
import { defineComponent, PropType, watchEffect } from 'vue';
import { formatValue } from '@/common/methods';
import { Des, handleDesList } from '@/common/components/commonDes';
import { QhjTradeGoodsPickup } from '@/services/go/ermcp/qhj/interface';
import { getPickUpStateName, getTakeStateName } from '@/common/constants/enumsName';

export default defineComponent({
    name: 'custom-detail-desc',
    components: { Des },
    props: {
        selectedRow: {
            type: Object as PropType<QhjTradeGoodsPickup>,
            default: {},
        },
    },
    setup(props) {
        const { desList, getDesList } = handleDesList();
        watchEffect(() => {
            if (props.selectedRow.takeorderid) {
                const data = props.selectedRow;
                // 个人
                const list = [
                    { label: '账号', value: formatValue(data.logincode) },
                    { label: '名称', value: formatValue(data.username) },
                    { label: '账户类型', value: data.userinfotype === 1 ? '个人' : '企业' },
                    { label: '提货商品', value: formatValue(data.pickupgoodsname) },
                    { label: '提货数量', value: formatValue(data.pickupgoodsqty) },
                    { label: '交易商品', value: formatValue(data.goodsname) },
                    { label: '商品数量', value: formatValue(data.qty + data.enumdicname) },
                    { label: '收货方式', value: formatValue(getTakeStateName(data.takemode)) },
                    { label: '提货人/收货人', value: formatValue(data.recivername) },
                    { label: '提货地址/收货地址', value: formatValue(data.provincename + data.cityname + data.districtname + data.address) },
                    { label: '物流信息', value: formatValue(data.expresscompany + '-' + data.expressnum) },
                    { label: '状态', value: getPickUpStateName(data.takeorderstatus) },
                    { label: '申请时间', value: formatValue(data.updatetime) },
                ];
                getDesList(list);
            }
        });
        return {
            desList,
        };
    },
});
</script>

<style lang="less">
.custom-detail {
    .ant-form.inlineForm {
        margin-top: 20px;
    }
    .upload {
        .look {
            margin-left: 0;
        }
    }
}
</style>;
