import request from "@/utils/request";


export async function handleGetCASHWORKERList(params?: any) {
    const data = await request(`/BaseInfo/GetCASHWORKERList`, {
        method: 'POST',
        data: params
    });

    if (data.Result_Code !== 100) {
        return {
            data: [],
            current: 1,
            pageSize: 10,
            total: 0,
            success: false
        }
    }

    return data.Result_Data.List;
}


// 获取收银人员详情
export async function handleGetCASHWORKERDetail(params?: any) {
    const data = await request(`/BaseInfo/GetCASHWORKERDetail`, {
        method: 'GET',
        params
    });

    if (data.Result_Code !== 100) {
        return {
            data: [],
            current: 1,
            pageSize: 10,
            total: 0,
            success: false
        }
    }

    return data.Result_Data;
}

// 同步收银人员表
export async function handleSynchroCASHWORKER(params?: any) {
    const data = await request(`/BaseInfo/SynchroCASHWORKER`, {
        method: 'POST',
        data: params
    });

    if (data.Result_Code !== 100) {
        return data
    }

    return data;
}

// 获得可以关联的门店列表
export async function handleGetServerpartShopList(params?: any) {
    const data = await request(`/BaseInfo/GetServerpartShopList`, {
        method: 'POST',
        data: params
    });

    if (data.Result_Code !== 100) {
        return {
            data: [],
            current: 1,
            pageSize: 10,
            total: 0,
            success: false
        }
    }

    return data.Result_Data.List;
}