achievement.vue 11 KB

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