<template>
    <div>
        <vxe-table :loading="loading" border :data="list">
            <!-- 序号 -->
            <vxe-column type="seq" width="60" title="序号" align="center" />
            <!-- 品名 -->
            <vxe-column title="品名" field="varietyName" min-width="100" :formatter="colNoData" />
            <!-- 规格 -->
            <vxe-column title="规格" field="specification" min-width="100" :formatter="colNoData" />
            <!-- 产地 -->
            <vxe-column title="产地价格（元/kg）" field="price" min-width="100" />
            <vxe-column title="对比近7天价格" min-width="100">
                <template #default="{ row }">{{ row.growthRate }}%</template>
            </vxe-column>
            <vxe-column title="积分" field="points" width="60" :formatter="colNoData" />
            <vxe-column title="上报人" field="createByName" width="100" :formatter="colNoData" />
            <vxe-column title="上报时间" field="createTime" min-width="100" :formatter="colNoData" />
            <vxe-column title="状态" fixed="right" width="110">
                <template #default="{ row }">
                    <div :class="['c-res-' + row?.auditStatus]">{{ selectDictLabel(check_status, row?.auditStatus) }}</div>
                </template>
            </vxe-column>
        </vxe-table>
    </div>
    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</template>
<script setup name="priceRepordLog" lang="ts">
import { colNoData } from '@/utils/noData';
import { listVipPayment } from '@/api/dgtmedicine/vipPayment/index';
import { originPriceDetail } from '@/api/price/report';
const { query }: any = useRoute()
const router = useRouter();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { check_status } = toRefs<any>(proxy?.useDict('check_status'));
// 字典
const list = ref<any[]>([]);
const loading = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const data = reactive<any>({
    queryParams: {
        pageNum: 1,
        pageSize: 10,
    }
});
const { queryParams } = toRefs(data);
/** 点击行上传发票 */

/** 查询会员信息列表 */
const getList = async () => {
    loading.value = true;
    const res = await originPriceDetail({ ...queryParams.value, cpyid: query?.cpyid });
    list.value = res.rows;
    total.value = res.total;
    loading.value = false;
};
/** 搜索按钮操作 */
const handleQuery = (level?: any) => {
    queryParams.value.pageNum = 1;
    getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
    queryFormRef.value?.resetFields();
    handleQuery();
};

onMounted(() => {
    getList();
});
</script>
