|  |  | 
 |  |  | function isEmpty(obj) { | 
 |  |  |    if (JSON.stringify(obj) === '{}') { | 
 |  |  |       return true | 
 |  |  |    } | 
 |  |  |    return  obj == "undefined" || obj == null || obj === "" || obj == {}; | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const baseUrl = 'http://127.0.0.1:9528' | 
 |  |  | import common from '@/static/js/common.js' | 
 |  |  |  | 
 |  |  | async function getCompanyData() { | 
 |  |  |    let _this = this,item = []; | 
 |  |  |    var ress = await uni.request({ | 
 |  |  |       url: `${baseUrl}/dashboard/companyData/auth`, | 
 |  |  |    let ress = await uni.request({ | 
 |  |  |       url: `${common.baseUrl}/dashboard/companyData/auth`, | 
 |  |  |       header:{'token':uni.getStorageSync('token')}, | 
 |  |  |    }).then((res)=> { | 
 |  |  |       res = res[1].data | 
 |  |  |       if (res.code === 200) { | 
 |  |  |          item = [ | 
 |  |  |             {name: '年度销售目标',content: res.data.yearTarget,unit: '万元'}, | 
 |  |  |             {name: '已完成销售任务',content: res.data.successMoney,unit: '万元'}, | 
 |  |  |             {name: '未完成销售任务',content: res.data.progressMoney,unit: '万元'}, | 
 |  |  |             {name: '完成率',content: res.data.yearTransactionRate,unit: '%'} | 
 |  |  |          ] | 
 |  |  |          item = { | 
 |  |  |             code: res.code, | 
 |  |  |             data: [ | 
 |  |  |                {name: '年度销售目标',content: res.data.yearTarget,unit: '万元'}, | 
 |  |  |                {name: '已完成销售任务',content: res.data.successMoney,unit: '万元'}, | 
 |  |  |                {name: '未完成销售任务',content: res.data.progressMoney,unit: '万元'}, | 
 |  |  |                {name: '完成率',content: res.data.yearTransactionRate,unit: '%'} | 
 |  |  |             ] | 
 |  |  |          } | 
 |  |  |       } else  if(res.code === 403){ | 
 |  |  |          item = {code: 403,msg: '请重新登录'} | 
 |  |  |       } | 
 |  |  |    },(result)=>{ | 
 |  |  |       // console.log(res); | 
 |  |  |    }) | 
 |  |  |    return item | 
 |  |  | } | 
 |  |  |  | 
 |  |  | async function getPersonData() { | 
 |  |  |    let item = []; | 
 |  |  |    let ress = await uni.request({ | 
 |  |  |       url: `${common.baseUrl}/dashboard/personData/auth`, | 
 |  |  |       header:{'token':uni.getStorageSync('token')}, | 
 |  |  |    }).then((res)=> { | 
 |  |  |       res = res[1].data | 
 |  |  |       if (res.code === 200) { | 
 |  |  |          item = { | 
 |  |  |             code:res.code, | 
 |  |  |             data:[ | 
 |  |  |                {name: '年度销售目标',content: res.data.yearTarget,unit: '万元'}, | 
 |  |  |                {name: '已完成销售任务',content: res.data.successMoney,unit: '万元'}, | 
 |  |  |                {name: '未完成销售任务',content: res.data.progressMoney,unit: '万元'}, | 
 |  |  |                {name: '完成率',content: res.data.yearTransactionRate,unit: '%'}, | 
 |  |  |                {name: '跟踪项目数量',content: res.data.progressCount,unit: '项'}, | 
 |  |  |                {name: '跟踪项目金额',content: res.data.successCount,unit: '万元'}, | 
 |  |  |                {name: '成交项目数量',content: res.data.progressMoney2,unit: '项'}, | 
 |  |  |                {name: '成交项目金额',content: res.data.successMoney,unit: '万元'} | 
 |  |  |             ] | 
 |  |  |          } | 
 |  |  |       } else  if(res.code === 403){ | 
 |  |  |          item = {code: 403,msg: '请重新登录'} | 
 |  |  |       } | 
 |  |  |    },(result)=>{ | 
 |  |  |       // console.log(res); | 
 |  |  |    }) | 
 |  |  |    return item | 
 |  |  | } | 
 |  |  |  | 
 |  |  | async function getStaffRank() { | 
 |  |  |    let item = []; | 
 |  |  |    let ress = await uni.request({ | 
 |  |  |       url: `${common.baseUrl}/dashboard/staffRank/auth`, | 
 |  |  |       header:{'token':uni.getStorageSync('token')}, | 
 |  |  |    }).then((res)=> { | 
 |  |  |       // console.log(res); | 
 |  |  |       res = res[1].data | 
 |  |  |       if (res.code === 200) { | 
 |  |  |          item = { | 
 |  |  |             code: res.code, | 
 |  |  |             data: res.data | 
 |  |  |          } | 
 |  |  |       } else  if(res.code === 403){ | 
 |  |  |          item = {code: 403,msg: '请重新登录'} | 
 |  |  |       } | 
 |  |  |    },(result)=>{ | 
 |  |  |       // console.log(res); | 
 |  |  |    }) | 
 |  |  |    return item | 
 |  |  | } | 
 |  |  |  | 
 |  |  | async function getCompanyPostList() { | 
 |  |  |    let item = []; | 
 |  |  |    let ress = await uni.request({ | 
 |  |  |       url: `${common.baseUrl}/companyPost/list/auth`, | 
 |  |  |       header: {'token':uni.getStorageSync('token')}, | 
 |  |  |       method: 'POST', | 
 |  |  |    }).then((res)=> { | 
 |  |  |       res = res[1].data | 
 |  |  |       if (res.code === 200) { | 
 |  |  |          item = { | 
 |  |  |             code: res.code, | 
 |  |  |             data: res.data | 
 |  |  |          } | 
 |  |  |       } else  if(res.code === 403){ | 
 |  |  |          item = {code: 403,msg: '请重新登录'} | 
 |  |  |       } | 
 |  |  |    },(result)=>{ | 
 |  |  |       // console.log(res); | 
 |  |  |    }) | 
 |  |  |    return item | 
 |  |  | } | 
 |  |  |  | 
 |  |  | async function getMonthData() { | 
 |  |  |    let item = []; | 
 |  |  |    let ress = await uni.request({ | 
 |  |  |       url: `${common.baseUrl}/dashboard/currentMonthData/auth`, | 
 |  |  |       header: {'token':uni.getStorageSync('token')}, | 
 |  |  |       method: 'POST', | 
 |  |  |    }).then((res)=> { | 
 |  |  |       console.log(res); | 
 |  |  |       res = res[1].data | 
 |  |  |       if (res.code === 200) { | 
 |  |  |          item = { | 
 |  |  |             code: res.code, | 
 |  |  |             data: res.data | 
 |  |  |          } | 
 |  |  |       } else  if(res.code === 403){ | 
 |  |  |          item = {code: 403,msg: '请重新登录'} | 
 |  |  |       } | 
 |  |  |    },(result)=>{ | 
 |  |  |       // console.log(res); | 
 |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  | module.exports = { | 
 |  |  |    getCompanyData: getCompanyData | 
 |  |  |     getCompanyData, | 
 |  |  |     getPersonData, | 
 |  |  |     getStaffRank, | 
 |  |  |     getCompanyPostList, | 
 |  |  |     getMonthData | 
 |  |  | } |