achievement.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view>
  3. <service-widget @btnClick="btn_click"></service-widget>
  4. <view class="headers ">
  5. <view class="dis a-c j-start ">
  6. <u-icon name="arrow-left" color="#fff" size="40" @tap="back"></u-icon>
  7. <text style="margin: auto;">业绩管理</text>
  8. </view>
  9. </view>
  10. <view class="" style="padding-top: 98px;">
  11. <view class="summaryData">
  12. <view class="summarycount dis j-s ">
  13. <view class="sum dis a-c f-c j-c">
  14. <text>{{totalsumPremium}}</text>
  15. <text>年度签单保费</text>
  16. </view>
  17. <view class="sum dis a-c f-c j-c">
  18. <text>{{totalsumCount}}</text>
  19. <text>年度成交单数</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view style="padding:0 16px 16px;background-color: #F8FAFE;">
  25. <u-tabs :list="list" style="background-color:#F8FAFE;" :is-scroll="false" :current="current"
  26. @change="change"></u-tabs>
  27. <view class="dis j-end">
  28. <u-subsection :list="subsectionlist" :current="subsectioncurrent"
  29. style="width: 100px;margin-top: 5px;box-shadow: 0px 4px 10px 0px #DAE3F4;" buttonColor="#3D74FE"
  30. bgColor="#fff" active-color="#fff" @change="subsection"></u-subsection>
  31. </view>
  32. <view class="echarts">
  33. <view class="totalCount dis j-s" v-if="current==0">
  34. <view class="dis f-c a-c" style="font-size: 24rpx;">
  35. <text class="title1">总价</text>
  36. <text style="color: #426CF3;">{{sumPremium}}</text>
  37. </view>
  38. <view class="dis f-c a-c" style="font-size: 24rpx;">
  39. <text class="title2">交强</text>
  40. <text style="color: #EA754B;">{{jqPremium}}</text>
  41. </view>
  42. <view class="dis f-c a-c" style="font-size: 24rpx;">
  43. <text class="title3">商业</text>
  44. <text style="color: #56C073;">{{syPremium}}</text>
  45. </view>
  46. </view>
  47. <view class="totalCount dis j-c" v-if="current==1">
  48. <view class="dis f-c a-c" style="font-size: 24rpx;">
  49. <text class="title1">增增员人数</text>
  50. <text style="color: #426CF3;">{{employeeIncreaseCount}}</text>
  51. </view>
  52. </view>
  53. <view class="totalCount dis j-s" v-if="current==2">
  54. <view class="dis f-c a-c" style="font-size: 24rpx;">
  55. <text class="title1">手续费</text>
  56. <text style="color: #426CF3;">{{haldingAmount}}</text>
  57. </view>
  58. <view class="dis f-c a-c" style="font-size: 24rpx;">
  59. <text class="title2">非跟单</text>
  60. <text style="color: #EA754B;">{{documentaryAmount}}</text>
  61. </view>
  62. <view class="dis f-c a-c" style="font-size: 24rpx;">
  63. <text class="title3">推广费</text>
  64. <text style="color: #56C073;">{{promotionAmount}}</text>
  65. </view>
  66. </view>
  67. <view class="" style="height:300px;width: 100%;">
  68. <qiun-data-charts v-show="current==0" type="column" :opts="opts1" :chartData="chartData1"
  69. :ontouch="true" />
  70. <qiun-data-charts v-show="current==1" type="column" :opts="opts2" :chartData="chartData2"
  71. :ontouch="true" />
  72. <qiun-data-charts v-show="current==2" type="column" :opts="opts3" :chartData="chartData3"
  73. :ontouch="true" />
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. dataInfo: {
  84. searchDay: "",
  85. searchMonth: "",
  86. searchType: "1",
  87. searchYear: ""
  88. },
  89. chartData1: {},
  90. chartData2: {},
  91. chartData3: {},
  92. //您可以通过修改 config-ucharts.js 文件中下标为 ['column'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
  93. opts1: {
  94. dataLabel: false,
  95. color: ["#426CF3", "#EA754B", "#56C073"],
  96. padding: [15, 15, 0, 5],
  97. touchMoveLimit: 24,
  98. enableScroll: true,
  99. legend: {
  100. show: false,
  101. position: "top"
  102. },
  103. xAxis: {
  104. disableGrid: true,
  105. scrollShow: true,
  106. itemCount: 4
  107. },
  108. yAxis: {
  109. disableGrid: true,
  110. data: [{
  111. unit: '/元',
  112. }]
  113. },
  114. extra: {
  115. column: {
  116. type: "group",
  117. width: 8,
  118. activeBgColor: "#000000",
  119. activeBgOpacity: 0.08
  120. }
  121. }
  122. },
  123. opts2: {
  124. dataLabel: false,
  125. color: ["#426CF3", "#EA754B", "#56C073"],
  126. padding: [15, 15, 0, 5],
  127. touchMoveLimit: 24,
  128. enableScroll: true,
  129. legend: {
  130. show: false,
  131. position: "top"
  132. },
  133. xAxis: {
  134. disableGrid: true,
  135. scrollShow: true,
  136. itemCount: 4
  137. },
  138. yAxis: {
  139. disableGrid: true,
  140. data: [{
  141. unit: '/人',
  142. }]
  143. },
  144. extra: {
  145. column: {
  146. type: "group",
  147. width: 8,
  148. activeBgColor: "#000000",
  149. activeBgOpacity: 0.08
  150. }
  151. }
  152. },
  153. opts3: {
  154. dataLabel: false,
  155. color: ["#426CF3", "#EA754B", "#56C073"],
  156. padding: [15, 15, 0, 5],
  157. touchMoveLimit: 24,
  158. enableScroll: true,
  159. legend: {
  160. show: false,
  161. position: "top"
  162. },
  163. xAxis: {
  164. disableGrid: true,
  165. scrollShow: true,
  166. itemCount: 4
  167. },
  168. yAxis: {
  169. disableGrid: true,
  170. data: [{
  171. unit: '/元',
  172. }]
  173. },
  174. extra: {
  175. column: {
  176. type: "group",
  177. width: 8,
  178. activeBgColor: "#000000",
  179. activeBgOpacity: 0.08
  180. }
  181. }
  182. },
  183. list: [{
  184. name: '数据报表'
  185. }, {
  186. name: '增员报表'
  187. }, {
  188. name: '收入报表',
  189. }],
  190. subsectionlist: [{
  191. name: '年'
  192. },
  193. {
  194. name: '月'
  195. },
  196. {
  197. name: '日'
  198. }
  199. ],
  200. current: 0,
  201. subsectioncurrent: 0,
  202. jqPremium: "",
  203. sumPremium: "",
  204. syPremium: "",
  205. employeeIncreaseCount: "",
  206. haldingAmount: "",
  207. documentaryAmount: "",
  208. promotionAmount: "",
  209. totalsumPremium: "",
  210. totalsumCount: "",
  211. }
  212. },
  213. onReady() {
  214. this.getServerData1();
  215. },
  216. onLoad() {
  217. this.transformTime();
  218. this.totalsummt();
  219. },
  220. methods: {
  221. btn_click() {
  222. uni.navigateTo({
  223. url: '/pages/chat/chat'
  224. })
  225. },
  226. async totalsummt() {
  227. let res = await this.$http.get('/app/reporet/getAllpremium?year=' + this.dataInfo.searchYear);
  228. this.totalsumPremium = res.data.sumPremium;
  229. this.totalsumCount = res.data.sumCount;
  230. },
  231. async getServerData1() {
  232. let res = await this.$http.post('/app/reporet/premiumReport', this.dataInfo);
  233. if (res.code == '200') {
  234. this.jqPremium = res.data.jqPremium;
  235. this.sumPremium = res.data.sumPremium;
  236. this.syPremium = res.data.syPremium;
  237. let rualit = {
  238. categories: res.data.dateList,
  239. series: [{
  240. name: "总价",
  241. data: res.data.sumPremiumList
  242. },
  243. {
  244. name: "交强",
  245. data: res.data.jqPremiumList
  246. },
  247. {
  248. name: "商业",
  249. data: res.data.syPremiumList
  250. }
  251. ]
  252. };
  253. this.chartData1 = JSON.parse(JSON.stringify(rualit));
  254. }
  255. },
  256. async getServerData2() {
  257. let res = await this.$http.post('/app/reporet/employeeIncreaseReport', this.dataInfo);
  258. if (res.code == '200') {
  259. this.employeeIncreaseCount = res.data.employeeIncreaseCount;
  260. let rualit = {
  261. categories: res.data.dateList,
  262. series: [{
  263. name: "人数",
  264. data: res.data.employeeIncreaseReportList
  265. }, ]
  266. };
  267. this.chartData2 = JSON.parse(JSON.stringify(rualit));
  268. }
  269. },
  270. async getServerData3() {
  271. let res = await this.$http.post('/app/reporet/revenueReport', this.dataInfo);
  272. if (res.code == '200') {
  273. this.haldingAmount = res.data.haldingAmount;
  274. this.documentaryAmount = res.data.documentaryAmount;
  275. this.promotionAmount = res.data.promotionAmount;
  276. let rualit = {
  277. categories: res.data.dateList,
  278. series: [{
  279. name: "手续费金额",
  280. data: res.data.haldingAmountList
  281. }, {
  282. name: "非跟单金额",
  283. data: res.data.documentaryAmountList
  284. }, {
  285. name: "推广费金额",
  286. data: res.data.promotionAmountList
  287. }]
  288. };
  289. this.chartData3 = JSON.parse(JSON.stringify(rualit));
  290. }
  291. },
  292. change(index) {
  293. this.current = index;
  294. this.subsectioncurrent = 0;
  295. this.dataInfo.searchType = '1';
  296. if (index == 0) {
  297. this.getServerData1();
  298. } else if (index == 1) {
  299. this.getServerData2();
  300. } else {
  301. this.getServerData3();
  302. }
  303. },
  304. async subsection(index) {
  305. this.subsectioncurrent = index;
  306. switch (index) {
  307. case 0:
  308. this.dataInfo.searchType = '1';
  309. break;
  310. case 1:
  311. this.dataInfo.searchType = '2';
  312. break;
  313. case 2:
  314. this.dataInfo.searchType = '3';
  315. break;
  316. }
  317. if (this.current == 0) {
  318. this.getServerData1();
  319. } else if (this.current == 1) {
  320. this.getServerData2();
  321. } else {
  322. this.getServerData3();
  323. }
  324. },
  325. //页面返回按钮
  326. back() {
  327. uni.navigateBack({
  328. delta: 1, // 返回的页面数,如果是1表示返回上一页
  329. success: function() {}
  330. });
  331. },
  332. //当前时间
  333. transformTime(day) {
  334. var date = new Date();
  335. date.setFullYear(date.getFullYear());
  336. date.setTime(date.getTime());
  337. var strYear = date.getFullYear();
  338. var strDay = day ? date.getDate() - day : date.getDate();
  339. var strMonth = date.getMonth() + 1;
  340. if (strMonth < 10) {
  341. strMonth = "0" + strMonth;
  342. }
  343. if (strDay < 10) {
  344. strDay = "0" + strDay;
  345. }
  346. this.dataInfo.searchYear = strYear;
  347. this.dataInfo.searchMonth = strMonth;
  348. this.dataInfo.searchDay = strDay;
  349. },
  350. }
  351. }
  352. </script>
  353. <style lang="scss" scoped>
  354. page {
  355. background-color: #F8FAFE;
  356. height: 100vh;
  357. }
  358. .totalCount {
  359. padding: 0 10px;
  360. .title1 {
  361. &::before {
  362. content: "";
  363. display: inline-block;
  364. width: 6px;
  365. height: 6px;
  366. background-color: #426CF3;
  367. border-radius: 50%;
  368. margin-right: 4px;
  369. }
  370. }
  371. .title2 {
  372. &::before {
  373. content: "";
  374. display: inline-block;
  375. width: 6px;
  376. height: 6px;
  377. background-color: #EA754B;
  378. border-radius: 50%;
  379. margin-right: 4px;
  380. }
  381. }
  382. .title3 {
  383. &::before {
  384. content: "";
  385. display: inline-block;
  386. width: 6px;
  387. height: 6px;
  388. background-color: #56C073;
  389. border-radius: 50%;
  390. margin-right: 4px;
  391. }
  392. }
  393. }
  394. .echarts {
  395. width: 100%;
  396. height: auto;
  397. background: #FFFFFF;
  398. box-shadow: 0px 4px 10px 0px #DAE3F4;
  399. border-radius: 6px;
  400. margin-top: 10px;
  401. padding: 10px 0;
  402. }
  403. .headers {
  404. position: fixed;
  405. top: 0;
  406. left: 0;
  407. height: auto;
  408. width: 100%;
  409. z-index: 999999;
  410. padding: 16px;
  411. padding-top: 50px;
  412. height: auto;
  413. background: #3D74FE;
  414. text {
  415. font-size: 18px;
  416. font-weight: bold;
  417. color: #fff;
  418. }
  419. }
  420. .summaryData {
  421. width: 100%;
  422. height: auto;
  423. background: #F8FAFE;
  424. background-image: url("/static/image/team/bg2.png");
  425. background-size: 100% 100%;
  426. padding: 16px;
  427. .summarycount {
  428. width: 100%;
  429. height: 62px;
  430. background: #FFFFFF;
  431. box-shadow: 0px 4px 10px 0px #DAE3F4;
  432. border-radius: 6px;
  433. .sum {
  434. width: 50%;
  435. height: 100%;
  436. text:nth-child(1) {
  437. font-size: 32rpx;
  438. color: #232832;
  439. font-weight: bold;
  440. }
  441. text:nth-child(2) {
  442. font-size: 24rpx;
  443. color: rgba(51, 51, 51, 0.8);
  444. }
  445. }
  446. }
  447. }
  448. </style>