<template>
    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
        
        <el-table-column label="订单编号" prop="order_sn">
            <template #default="scope">
                {{scope.row.order_sn}}
            </template>
        </el-table-column>
        <el-table-column label="订单金额" prop="time">
            <template #default="scope">
                {{ $TOOL.money(scope.row.money) }}
            </template>
        </el-table-column>
        <el-table-column label="支付类型" prop="money">
            <template #default="scope">
                微信
            </template>
        </el-table-column>
        <el-table-column label="支付时间" prop="pay_at">
            <template #default="scope">
                {{ scope.row.pay_at?scope.row.pay_at:'-' }}
            </template>
        </el-table-column>
        <el-table-column label="创建时间" prop="create_at">
            <template #default="scope">
                {{ scope.row.create_at }}
            </template>
        </el-table-column>
    </scTable>
</template>

<script>
export default {
    props: {
        type: { type: String, default: "1" }
    },
    data(){
        return {
            colorData:['','彩色','黑白'],
            duplexData:['','单面','双面'],
            list: {
                apiObj: this.$API.mQrcode.list
            },
            visible:false,
            dataSelect:[],
            dataSelectFull:[],
            searchKey:{
                type:this.type
            }
        }
    },
    methods:{
        table_edit(data){
            this.$nextTick(() => {
                this.$refs.formMain.open("edit",this.type).setData(data)
            })
        },
        table_del(data){
            this.$confirm("确定要删除该数据吗？","删除确认",{type: 'warning'}).then(async ()=>{
                var resp = await this.$API.mPrice.del.post({"id":data.id,"type":""});
                if (resp.code == 0) {
                    return this.$message.error(resp.msg)
                }
                this.$message.success(resp.msg)
                this.$refs.table.refresh()
            }).catch(()=>{});
        },
        refresh(){
            this.$refs.table.refresh()
        },
        upData(data){
            this.$refs.table.upData(data)
        },
        handleSuccess(){
            this.$refs.table.refresh()
        },
    }
}
</script>