import server from '@/utils/request'

//新增
interface Addobj{
    ownerType:String	                    //户主类型：1-个人，2-企业
    ownerId:String	                      //户主ID
    accName?:String                       //户主名称
    stationCode?:String	                  //引入站点
    pkId?:String
    totalAmount?:String|Number	          //账户总金额，分：总金额=充值金额+赠送金额
    rechargeAmount?:String|Number	        //充值余额，分
    giftAmount?:String|Number	            //赠送金额，分
    point?:String|Number	                //积分余额
    deposit?:String|Number	              //押金
    snCode?:String	                      //SN码
    rent?:String|Number	                  //租金
}

export function addhdz(data:Addobj) {
  return server.request({
    url: '/cloud/wallet/add',
    method: 'post',
    data
  })
}

//修改
export function update(data:Addobj) {
  return server.request({
    url: '/cloud/wallet/update',
    method: 'post',
    data
  })
}

//查询
interface Querydata{
  pageSize:String|number,	    //每页条数
  pageNo:String|number	        //页数
  ownerType?:String	            //户主类型：1-个人，2-企业
  ownerId?:String	            //户主ID
  code?:String	                //编码
  stationCode?:String	        //引入站点
}
export function getjqrlist(params:Querydata) {
  return server.request({
    url: '/cloud/wallet/list',
    method: 'get',
    params
  })
}

//删除
export function delhdz(id:string) {
  return server.request({
    url: '/cloud/wallet/del',
    method: 'post',
    data:{
      id
    }
  })
}

//分账 
export function getyysfz(params:any) {
  return server.request({
    url: '/cloud/independent/account/list',
    method: 'get',
    params
  })
}
