<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="总需求计划主键">{{ model.demandPlanId }}</detail-list-item>
                                                                                                            <detail-list-item term="">{{ model.demandPlanAddId }}</detail-list-item>
                                                                                                            <detail-list-item term="编号">{{ model.no }}</detail-list-item>
                                                                                                            <detail-list-item term="类别">{{ model.type }}</detail-list-item>
                                                                                                            <detail-list-item term="名称">{{ model.name }}</detail-list-item>
                                                                                                            <detail-list-item term="规格">{{ model.specs }}</detail-list-item>
                                                                                                            <detail-list-item term="单位">{{ BaseTool.Object.getField(unitMap,model.unit) }}</detail-list-item>
                                                                                                            <detail-list-item term="单价">{{ BaseTool.Amount.formatter(model.price) }}</detail-list-item>
                                                                                                            <detail-list-item term="数量">{{ BaseTool.Amount.formatter(model.quantity) }}</detail-list-item>
                                                                                                            <detail-list-item term="总价">{{ BaseTool.Amount.formatter(model.totalMoney) }}</detail-list-item>
                                                                                                            <detail-list-item term="控制金额">{{ BaseTool.Amount.formatter(model.controlMoney) }}</detail-list-item>
                                                                                                            <detail-list-item term="合同项目ID">{{ model.contractId }}</detail-list-item>
                                                                                                            <detail-list-item term="合同项目名称">{{ model.contractName }}</detail-list-item>
                                                                                                            <detail-list-item term="合同项目数量">{{ BaseTool.Amount.formatter(model.contractQuantity) }}</detail-list-item>
                                                                                                            <detail-list-item term="合同总金额">{{ BaseTool.Amount.formatter(model.contractMoney) }}</detail-list-item>
                                                                                                            <detail-list-item term="合同项目单位">{{ BaseTool.Object.getField(contractProjectUnitMap,model.contractProjectUnit) }}</detail-list-item>
                                                                                                            <detail-list-item term="项目单位">{{ BaseTool.Object.getField(projectUnitMap,model.projectUnit) }}</detail-list-item>
                                                                                                            <detail-list-item term="已购数量">{{ BaseTool.Amount.formatter(model.boughtQuantity) }}</detail-list-item>
                                                                                                            <detail-list-item term="已用金额">{{ BaseTool.Amount.formatter(model.usedMoney) }}</detail-list-item>
                                                                                                            <detail-list-item term="备注">{{ model.remark }}</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="货物ID">{{ model.goodsId }}</detail-list-item>
                                                                                                            <detail-list-item term="品牌">{{ model.brand }}</detail-list-item>
                                                                                                            <detail-list-item term="适用车型">{{ model.suitableModel }}</detail-list-item>
                                                                                                            <detail-list-item term="车架号">{{ model.vin }}</detail-list-item>
                                                                                                            <detail-list-item term="发动机号">{{ model.engineNum }}</detail-list-item>
                                                                                                            <detail-list-item term="产地">{{ BaseTool.Object.getField(producePlaceMap,model.producePlace) }}</detail-list-item>
                                                                                                            <detail-list-item term="已到数量">{{ BaseTool.Amount.formatter(model.arrivedQuantity) }}</detail-list-item>
                                                                                                            <detail-list-item term="增补数量">{{ BaseTool.Amount.formatter(model.addQuantity) }}</detail-list-item>
                                                                                                            <detail-list-item term="">{{ BaseTool.Amount.formatter(model.addTotalMoney) }}</detail-list-item>
                                                                                                            <detail-list-item term="">{{ BaseTool.Amount.formatter(model.addControlMoney) }}</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: 'PurchaseDemandPlanListAddDetail',
        components: {
            DetailList,
            DetailListItem
        },
        data () {
            return {
                confirmLoading: false,
                mdl: {},
                modalTitle: null,
                visible: false,
                // 下拉框map
                                    unitMap: {},
                                    contractProjectUnitMap: {},
                                    projectUnitMap: {},
                                    producePlaceMap: {},
                                model: {
                                                                                                                    'demandPlanId': null,
                                                                                                'demandPlanAddId': null,
                                                                                                'no': null,
                                                                                                'type': null,
                                                                                                'name': null,
                                                                                                'specs': null,
                                                                                                'unit': null,
                                                                                                'price': null,
                                                                                                'quantity': null,
                                                                                                'totalMoney': null,
                                                                                                'controlMoney': null,
                                                                                                'contractId': null,
                                                                                                'contractName': null,
                                                                                                'contractQuantity': null,
                                                                                                'contractMoney': null,
                                                                                                'contractProjectUnit': null,
                                                                                                'projectUnit': null,
                                                                                                'boughtQuantity': null,
                                                                                                'usedMoney': null,
                                                                                                'remark': null,
                                                                                                'delFlag': null,
                                                                                                'createdUserId': null,
                                                                                                                                                                                        'updateUserId': null,
                                                                                                'updateUserName': null,
                                                                                                'updateTime': null,
                                                                                                'goodsId': null,
                                                                                                'brand': null,
                                                                                                'suitableModel': null,
                                                                                                'vin': null,
                                                                                                'engineNum': null,
                                                                                                'producePlace': null,
                                                                                                'arrivedQuantity': null,
                                                                                                'addQuantity': null,
                                                                                                'addTotalMoney': null,
                                                                                                'addControlMoney': null,
                                                            }
            }
        },
        created () {
            // 下拉框map
                            this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DEMAND_PLAN_LIST_ADD_UNIT)
                            this.contractProjectUnitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DEMAND_PLAN_LIST_ADD_CONTRACT_PROJECT_UNIT)
                            this.projectUnitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DEMAND_PLAN_LIST_ADD_PROJECT_UNIT)
                            this.producePlaceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DEMAND_PLAN_LIST_ADD_PRODUCE_PLACE)
                    },
        methods: {
            base (record) {
                this.visible = true
                this.modalTitle = '详情'
                this.model = record
            },
            handleCancel () {
                this.visible = false
                this.confirmLoading = false
            }

        }
    }
</script>
