<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.purchasePlanId }}</detail-list-item>
                                                                                                            <detail-list-item term="采购申请ID">{{ model.purchaseApplyId }}</detail-list-item>
                                                                                                            <detail-list-item term="采购单ID">{{ model.purchaseOrderId }}</detail-list-item>
                                                                                                            <detail-list-item term="发运单ID">{{ model.dispatchOrderId }}</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.integratedPrice) }}</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.taxMoney) }}</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.Amount.formatter(model.dispatchedQuantity) }}</detail-list-item>
                                                                                                            <detail-list-item term="未发运数量">{{ BaseTool.Amount.formatter(model.notDispatchQuantity) }}</detail-list-item>
                                                                                                            <detail-list-item term="产地">{{ model.producePlace }}</detail-list-item>
                                                                                                            <detail-list-item term="重量">{{ BaseTool.Amount.formatter(model.weight) }}</detail-list-item>
                                                                                                            <detail-list-item term="体积">{{ BaseTool.Amount.formatter(model.volume) }}</detail-list-item>
                                                                                                            <detail-list-item term="外形尺寸">{{ model.dimension }}</detail-list-item>
                                                                                                            <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
                                                                                                            <detail-list-item term="状态">{{ BaseTool.Object.getField(statusMap,model.status) }}</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>

        <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: 'PurchaseDispatchOrderListDetail',
        components: {
            DetailList,
            DetailListItem
        },
        data () {
            return {
                confirmLoading: false,
                mdl: {},
                modalTitle: null,
                visible: false,
                // 下拉框map
                                    unitMap: {},
                                    statusMap: {},
                                model: {
                                                                                                                    'demandPlanId': null,
                                                                                                'purchasePlanId': null,
                                                                                                'purchaseApplyId': null,
                                                                                                'purchaseOrderId': null,
                                                                                                'dispatchOrderId': null,
                                                                                                'no': null,
                                                                                                'type': null,
                                                                                                'name': null,
                                                                                                'specs': null,
                                                                                                'unit': null,
                                                                                                'price': null,
                                                                                                'integratedPrice': null,
                                                                                                'quantity': null,
                                                                                                'totalMoney': null,
                                                                                                'taxMoney': null,
                                                                                                'brand': null,
                                                                                                'suitableModel': null,
                                                                                                'vin': null,
                                                                                                'engineNum': null,
                                                                                                'dispatchedQuantity': null,
                                                                                                'notDispatchQuantity': null,
                                                                                                'producePlace': null,
                                                                                                'weight': null,
                                                                                                'volume': null,
                                                                                                'dimension': null,
                                                                                                'remark': null,
                                                                                                'status': null,
                                                                                                'delFlag': null,
                                                                                                'createdUserId': null,
                                                                                                                                                                                        'updateUserId': null,
                                                                                                'updateUserName': null,
                                                                                                'updateTime': null,
                                                            }
            }
        },
        created () {
            // 下拉框map
                            this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_LIST_UNIT)
                            this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_LIST_STATUS)
                    },
        methods: {
            base (record) {
                this.visible = true
                this.modalTitle = '详情'
                this.model = record
            },
            handleCancel () {
                this.visible = false
                this.confirmLoading = false
            }

        }
    }
</script>
