import request from '@/utils/request'
import state from '@/store'
import router from '@/router'

export function search1() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '3',
      name: `select SUM(开票金额) as 开票金额,replace(convert(varchar(5), 操作时间, 121),'-','') as 开票时间 from 合同信息管理_开票记录_视图 group by replace(convert(varchar(5), 操作时间, 121),'-','')`
    }
  })
}
export function search2() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '3',
      name: 'SELECT count(客户名称) as 客户数量,[省份] FROM [客户关系管理系统_客户_查询数据_MESWOR_视图]where [客户名称是否启用] = 1 group by [省份]'
    }
  })
}
export function search3() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '3',
      name: `select 项目名称,CONVERT(nvarchar(50),sum(已收金额)) as 已收金额,CONVERT(nvarchar(50),sum(应收金额)) as 应收金额,CONVERT(nvarchar(50),(sum(应收金额)-sum(已收金额))) as 待收金额 from 视图_分批资金查询 where 是否启用= 1 group by 项目流水号,项目名称`
    }
  })
}
