| | |
| | | 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)=> { |
| | | console.log(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: '%'}, |
| | | {name: '跟踪项目数量',content: res.data.progressCount,unit: '项'}, |
| | | {name: '跟踪项目金额',content: res.data.successCount,unit: '万元'}, |
| | | {name: '成交项目数量',content: res.data.progressMoney2,unit: '项'}, |
| | | {name: '成交项目金额',content: res.data.successMoney,unit: '万元'} |
| | | ] |
| | | item = { |
| | | code: res.code, |
| | | data: res.data |
| | | } |
| | | } else if(res.code === 403){ |
| | | item = {code: 403,msg: '请重新登录'} |
| | | } |
| | |
| | | |
| | | module.exports = { |
| | | getCompanyData, |
| | | getPersonData |
| | | getPersonData, |
| | | getStaffRank, |
| | | getCompanyPostList |
| | | } |