import { TCustomrModel, TCustomrQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取客户管理列表
 * @param data TCustomrQueryParam
 */
const QueryTCustomrList = (data: TCustomrQueryParam) =>
    request({
        url: '/TCustomrAction/list/' + data.page + '/' + data.rows,
        method: 'get'
    })

/**
* 新增客户管理
* @param data TCustomrModel
*/
const AddTCustomr = (data: TCustomrModel) =>
    request({
        url: '/TCustomrAction/saveTCustomr',
        method: 'post',
        data: data
    })

/**
* 编辑客户
* @param data TCustomrModel
*/
const EditTCustomr = (data: TCustomrModel) =>
    request({
        url: '/TCustomrAction/updateTCustomr',
        method: 'post',
        data: data
    })

/**
* 删除客户
* @param  id number
*/
const DeleteTCustomr = (id: number) =>
    request({
        url: '/TCustomrAction/deleteTCustomr/' + id,
        method: 'get',
    })

export default {
    QueryTCustomrList,
    AddTCustomr,
    EditTCustomr,
    DeleteTCustomr,
}