<template>
    <a-modal
        :title="modalTitle"
        :width="850"
        :visible="visible"
        :confirmLoading="confirmLoading"
                    class="ant-modal2"
                @cancel="handleCancel"
    >
        <detail-list title="" :col="2">
                                                                                                    <detail-list-item term="采购申请ID">{{ model.purchaseApplyId }}</detail-list-item>
                                                                                                            <detail-list-item term="采购计划ID">{{ model.purchasePlanId }}</detail-list-item>
                                                                                                            <detail-list-item term="总需求计划主键">{{ model.demandPlanId }}</detail-list-item>
                                                                                                            <detail-list-item term="采购单ID">{{ model.purchaseOrderId }}</detail-list-item>
                                                                                                            <detail-list-item term="公司ID">{{ model.companyId }}</detail-list-item>
                                                                                                            <detail-list-item term="项目主键">{{ model.projectId }}</detail-list-item>
                                                                                                            <detail-list-item term="费用">{{ BaseTool.Amount.formatter(model.money) }}</detail-list-item>
                                                                                                            <detail-list-item term="币种">{{ BaseTool.Object.getField(moneyTypeMap,model.moneyType) }}</detail-list-item>
                                                                                                            <detail-list-item term="费用类别">{{ BaseTool.Object.getField(feeTypeMap,model.feeType) }}</detail-list-item>
                                                                                                            <detail-list-item term="删除标志">{{ model.delFlag }}</detail-list-item>
                                                                                                            <detail-list-item term="创建人">{{ model.createdUserId }}</detail-list-item>
                                                                                                                                                                    <detail-list-item term="更新人">{{ model.updateUserId }}</detail-list-item>
                                                                                                            <detail-list-item term="更新人名称">{{ model.updateUserName }}</detail-list-item>
                                                                                                            <detail-list-item term="更新时间">{{ model.updateTime }}</detail-list-item>
                                                                                                            <detail-list-item term="汇率">{{ BaseTool.Amount.formatter(model.exchangeRate) }}</detail-list-item>
                                                                                                            <detail-list-item term="">{{ BaseTool.Amount.formatter(model.accountMoney) }}</detail-list-item>
                                                                                                            <detail-list-item term="汇率">{{ BaseTool.Amount.formatter(model.dollarExchangeRate) }}</detail-list-item>
                                                        </detail-list>

        <template slot="footer">
            <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
        </template>
    </a-modal>
</template>

<script>
    import DetailList from '@/components/tools/DetailList'
    const DetailListItem = DetailList.Item

    export default {
        name: 'PurchaseDispatchFeeDetail',
        components: {
            DetailList,
            DetailListItem
        },
        data () {
            return {
                confirmLoading: false,
                mdl: {},
                modalTitle: null,
                visible: false,
                // 下拉框map
                                    moneyTypeMap: {},
                                    feeTypeMap: {},
                                model: {
                                                                                                                    'purchaseApplyId': null,
                                                                                                'purchasePlanId': null,
                                                                                                'demandPlanId': null,
                                                                                                'purchaseOrderId': null,
                                                                                                'companyId': null,
                                                                                                'projectId': null,
                                                                                                'money': null,
                                                                                                'moneyType': null,
                                                                                                'feeType': null,
                                                                                                'delFlag': null,
                                                                                                'createdUserId': null,
                                                                                                                                                                                        'updateUserId': null,
                                                                                                'updateUserName': null,
                                                                                                'updateTime': null,
                                                                                                'exchangeRate': null,
                                                                                                'accountMoney': null,
                                                                                                'dollarExchangeRate': null,
                                                            }
            }
        },
        created () {
            // 下拉框map
                            this.moneyTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_FEE_MONEY_TYPE)
                            this.feeTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_FEE_FEE_TYPE)
                    },
        methods: {
            base (record) {
                this.visible = true
                this.modalTitle = '详情'
                this.model = record
            },
            handleCancel () {
                this.visible = false
                this.confirmLoading = false
            }

        }
    }
</script>
