import request from '@/utils/request'

/**
 * 商品列表
 * @returns
 */
export function tbProductGet(params) {
    return request({
        url: '/api/tbProduct',
        method: 'get',
        params
    })
}

/**
 * 进销存类型字典
 * @returns
 */
export function dictDetail(params) {
    return request({
        url: `/api/dictDetail`,
        method: 'get',
        params
    })
}

/**
 * 库存记录列表
 * @returns
 */
export function tbProductStockDetail(data) {
    return request({
        url: `/api/tbProductStockDetail/stock`,
        method: 'post',
        data
    })
}

/**
 * 变动数量
 * @returns
 */
export function tbProductStockDetailSum(params) {
    return request({
        url: `/api/tbProductStockDetail/sum`,
        method: 'get',
        params
    })
}

/**
 * 供应商列表
 * @returns
 */
export function tbShopPurveyorGet(params) {
    return request({
        url: `/api/tbShopPurveyor`,
        method: 'get',
        params
    })
}

/**
 * 增加供应商
 * @returns
 */
export function tbShopPurveyor(data, method = 'post') {
    return request({
        url: `/api/tbShopPurveyor`,
        method: method,
        data
    })
}

/**
 * 进货/退货账目
 * @returns
 */
export function tbShopPurveyorTransactGet(params) {
    return request({
        url: `/api/tbShopPurveyorTransact`,
        method: 'get',
        params
    })
}

/**
 * 进货账目详情
 * @returns
 */
export function tbShopPurveyorTransactInfo(data) {
    return request({
        url: `/api/tbShopPurveyorTransact/info`,
        method: 'post',
        data
    })
}

/**
 * 进货账目汇总（单一供应商）
 * @returns
 */
export function tbShopPurveyorTransactSum(params) {
    return request({
        url: `/api/tbShopPurveyorTransact/sum`,
        method: 'get',
        params
    })
}

/**
 * 操作记录
 * @returns
 */
export function tbProductStockOperateList(data) {
    return request({
        url: `/api/tbProductStockOperate/list`,
        method: 'post',
        data
    })
}

/**
 * 操作记录详情
 * @returns
 */
export function tbProductStockOperateDetail(id) {
    return request({
        url: `/api/tbProductStockOperate/${id}`,
        method: 'get'
    })
}

/**
 * 操作出库/入库
 * @returns
 */
export function tbProductStockOperateOutAndOn(data) {
    return request({
        url: `/api/tbProductStockOperate/outAndOn`,
        method: 'post',
        data
    })
}


