<template>
    <mu-list-item button style="height: 80px;">
        <mu-list-item-content>
            <mu-list-item-title>
                <mu-row>
                    <mu-col>{{item.taskcode}}</mu-col>
                    <mu-col style="padding-left: 10px;">{{item.sptcode}}</mu-col>
                </mu-row>
                </mu-list-item-title>
            <mu-list-item-sub-title>
                <mu-row>
                    <mu-col span="7" class="lj-color-red">总计金额：{{item.billamt}}元</mu-col>
                    <mu-col>已付金额：{{item.payamt}}元</mu-col>
                </mu-row>
            </mu-list-item-sub-title>
            <mu-list-item-sub-title>
                <mu-row>
                    <mu-col span="7">交货日期：{{item.requiredate|dateFilter}}</mu-col>
                    <!--<mu-col>数量：{{item.qty}}</mu-col>-->
                </mu-row>
            </mu-list-item-sub-title>
        </mu-list-item-content>
        <mu-list-item-action>
            <mu-list-item-after-text><mu-badge :color="getChipColor(item.Status)" :content="item.Status"/></mu-list-item-after-text>
        </mu-list-item-action>
    </mu-list-item>
</template>

<script>

    export default {
        name: "test-spttask-item",
        props: {
            item: {
                // 传入数据
                type: Object
            }
        },
        data() {
            return {
            }
        },
        methods: {
            getChipColor(status) {
                switch (status) {
                    case '在进行':
                        return 'primary';
                    case '已暂停':
                        return 'warning';
                    case '已终止':
                        return 'error';
                    case '待审批':
                        return 'orange';
                    case '自动完成':
                        return 'custom';
                    case '手动完成':
                        return 'success';
                    default:
                        return 'track';
                }
            }
        }
        
    }    
</script>