<template>
    <div class="nav_detail">
        <Table
            ref="owerFormTable"
            :tableParams="tableParams"
            @selectionChange="handleSelectionChange"
            :btnRole="btnRole"
            :right-btn="[]"
        >
        </Table>
    </div>
</template>

<script setup lang="ts">
import {ownerRecordList} from '@/api/customer';
import Table from '@/components/Table/index.vue'
import { tableTypes } from '@/components/Table/types'
import auth from "@/plugins/auth";
const props = defineProps({
    perPrefix: {
        type: String
    },
	customerId: {
		type: String
	}
})

const btnRole = ref([
    { type: 'export', hasPermi: `${ props.perPrefix }:detail:tab_gsjl_dc` }
])

const tableParams = reactive({
	tableColumn: [
        { show: true, label: '目前归属', prop: 'nowOwnerByName' },
        { show: true, label: '原来归属', prop: 'oldOwnerByName'},
        { show: true, label: '客户类型', prop: 'customerTypeName' },
        { show: true, label: '客户状态', prop: 'customerStatusName' },
        { show: true, label: '所属行业', prop: 'industry' },
        { show: true, label: '操作方式', prop: 'operatingTypeName' },
        { show: true, label: '操作人', prop: 'createByName' },
        { show: true, label: '操作时间', prop: 'createTime', sortable: true },
	],
	queryParams: {
		customerId: props.customerId,
	},
	listFn: ownerRecordList,
	keyId: 'id',
    exportCode: 'EXPORT_BELONG_EXCEL',
    commonQueryOrderBy: 'createTime'
})

const { queryParams } = toRefs(tableParams);

const router = useRouter()



/** 多选框选中数据 */
const ids = refAutoReset([])
const handleSelectionChange = (selection) => {
    ids.value = selection
}

const owerFormTable = ref()


</script>
