team-achievement.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>团队业绩-爽客邦</title>
  6. <meta name="keywords" content="团队业绩-爽客邦">
  7. <meta name="description" content="团队业绩-爽客邦">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="团队业绩-爽客邦">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back pb0">
  18. <div class="merchant_achievement" id="app" v-cloak>
  19. <van-nav-bar class="camp_title user_title_normal titlef16 left_icon_cfff" left-arrow title="团队业绩" v-if="toptitleisshow" @click-left="goback">
  20. <template #left>
  21. <van-icon name="arrow-left"> </van-icon>
  22. </template>
  23. </van-nav-bar>
  24. <div class="merchant_achievement_topblock"></div>
  25. <van-tabs class="toptab" v-model="active" @click="changetab" title-active-color="#FF5A32" title-inactive-color="#333" line-width="32" line-height="2">
  26. <van-tab>
  27. <template #title>
  28. <div @click="choosetime"><span>{{nowdate}}</span>
  29. <van-icon name="arrow"></van-icon>
  30. </div>
  31. </template>
  32. <van-row class="main rel" v-if="active === 0">
  33. <van-col class="bgcfff peoname abs">
  34. <van-sidebar v-model="activeKey" @change="onChange">
  35. <van-list v-model="loading2" :finished="finished2" finished-text="没有更多了" @load="onLoad2">
  36. <van-sidebar-item v-for="item in nameList" :title="item.MerchantName"></van-sidebar-item>
  37. </van-list>
  38. </van-sidebar>
  39. </van-col>
  40. <van-col class="infobox">
  41. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  42. <div class="panel bgcfff" v-for="obj in data">
  43. <div class="toppanel df">
  44. <div class="block"></div>
  45. <div class="f14 c333 b">{{obj.TradeDate}}</div>
  46. </div>
  47. <div class="mainpanel">
  48. <div class="title df c333 f16 flexsb">
  49. <div>总交易额</div>
  50. <div>{{obj.TradeAmount}}元</div>
  51. </div>
  52. <div class="type_panel df flexsb">
  53. <div>
  54. <div class="type c999">小额交易(元)</div>
  55. <div class="money f12">{{obj.TradeAmount}}</div>
  56. </div>
  57. <div class="line"></div>
  58. <div>
  59. <div class="type c999">大额交易(元)</div>
  60. <div class="money f12 tr">{{obj.TradeAmount}}</div>
  61. </div>
  62. </div>
  63. <div class="df c666 f12 flexsb" v-for="item in obj.ProductList" @click="gotransactiondetail(obj.TradeDate,item)">
  64. <div class="type">{{item.Name}}</div>
  65. <div class="num_personal df cm"><span>{{item.Amount}}元</span>
  66. <van-icon name="arrow"> </van-icon>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </van-list>
  72. </van-col>
  73. </van-row>
  74. </van-tab>
  75. <van-tab>
  76. <template #title><span>近半年</span></template>
  77. <van-row class="main ovh rel" v-if="active === 1">
  78. <van-col class="bgcfff peoname abs">
  79. <van-sidebar v-model="activeKey" @change="onChange">
  80. <van-list v-model="loading2" :finished="finished2" finished-text="没有更多了" @load="onLoad2" :immediate-check="false">
  81. <van-sidebar-item v-for="item in nameList" :title="item.MerchantName"></van-sidebar-item>
  82. </van-list>
  83. </van-sidebar>
  84. </van-col>
  85. <van-col class="infobox marginleft">
  86. <div class="panel bgcfff" v-for="obj in data">
  87. <div class="toppanel df">
  88. <div class="block"></div>
  89. <div class="f14 c333 b">{{obj.TradeMonth}}</div>
  90. </div>
  91. <div class="mainpanel">
  92. <div class="title df c333 f16 flexsb">
  93. <div>总交易额</div>
  94. <div>{{obj.TradeAmount}}元</div>
  95. </div>
  96. <div class="type_panel df flexsb">
  97. <div>
  98. <div class="type c999">小额交易(元)</div>
  99. <div class="money f12">{{obj.TradeAmount}}</div>
  100. </div>
  101. <div class="line"></div>
  102. <div>
  103. <div class="type c999">大额交易(元)</div>
  104. <div class="money f12 tr">{{obj.TradeAmount}}</div>
  105. </div>
  106. </div>
  107. <div class="df c666 f12 flexsb" v-for="item in obj.ProductList" @click="gotransactiondetail(obj.TradeMonth,item)">
  108. <div class="type">{{item.Name}}</div>
  109. <div class="num_personal df cm"><span>{{item.Amount}}元</span>
  110. <van-icon name="arrow"> </van-icon>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </van-col>
  116. </van-row>
  117. </van-tab>
  118. </van-tabs>
  119. <van-popup class="product_mymerchant_transaction" v-model="showDate" position="bottom" :style="{ height: '50%' }" v-cloak>
  120. <van-datetime-picker v-model="currentDate" type="year-month" title="选择年月" :min-date="minDate" :max-date="maxDate" @cancel="showDate = false" :formatter="formatter" @confirm="onConfirmDate"></van-datetime-picker>
  121. </van-popup>
  122. </div>
  123. <script src="./static/js/klm-vv.min.js"></script>
  124. <script src="./static/js/klm-axios-config.js"></script>
  125. <script>
  126. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  127. // 可以通过下面的方式手动注册
  128. Vue.use(vant.Lazyload);
  129. // 在 #app 标签下渲染一个按钮组件
  130. let app = new Vue({
  131. el: '#app',
  132. data() {
  133. return {
  134. toptitleisshow:true,
  135. active:0,
  136. activeKey: 0,
  137. loading: false,
  138. finished: false,
  139. loading2: false,
  140. finished2: false,
  141. pageinfo:{
  142. PageSize:10,
  143. PageNum:1
  144. },
  145. pageinfo2:{
  146. PageSize:10,
  147. PageNum:1
  148. },
  149. minDate: new Date(2020, 0, 1),
  150. maxDate: new Date(),
  151. currentDate: new Date(),
  152. nowdate:'',
  153. showDate: false,
  154. nameList:[
  155. {MerchantName:'全部',Id:''}
  156. ],
  157. data:[
  158. ],
  159. ismonth:true,
  160. merchantId:'',
  161. };
  162. },
  163. created() {
  164. this.onConfirmDate();
  165. this.getmerchantlist();
  166. },
  167. methods: {
  168. onChange(index) {
  169. const people = this.nameList.find((item,ind)=>ind === index);
  170. this.data = [];
  171. this.merchantId = people.Id;
  172. if(this.active === 0) {
  173. this.getmonthinfo(people.Id);
  174. }else{
  175. this.gethalfyearinfo(people.Id);
  176. };
  177. },
  178. onLoad() {
  179. this.pageinfo.PageNum++;
  180. this.getmonthinfo();
  181. },
  182. onLoad2() {
  183. this.pageinfo2.PageNum++;
  184. this.getmerchantlist();
  185. },
  186. changetab(){
  187. this.activeKey = 0;
  188. this.nameList = [{MerchantName:'全部',Id:''}];
  189. this.getmerchantlist();
  190. if(this.active === 0 && !this.ismonth) {
  191. this.data = []
  192. this.getmonthinfo('');
  193. this.ismonth = true;
  194. }
  195. if(this.active === 1){
  196. this.data = []
  197. this.gethalfyearinfo('');
  198. this.ismonth = false;
  199. };
  200. },
  201. choosetime(e){
  202. if(this.active === 0) {
  203. e.stopPropagation()
  204. }
  205. if(this.active !== 0) return
  206. this.showDate = true
  207. },
  208. formatter(type, val) {
  209. if (type === 'year') {
  210. return `${val}年`;
  211. } else if (type === 'month') {
  212. return `${val}月`;
  213. } else if (type === 'day') {
  214. return `${val}日`;
  215. }
  216. return val;
  217. },
  218. onConformateDate(){
  219. return formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  220. },
  221. onParamsDate(date){
  222. return formatDate(new Date(date).getFullYear(),new Date(date).getMonth() + 1);
  223. },
  224. onConfirmDate() {
  225. this.data = [];
  226. this.showDate = false;
  227. this.nowdate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1);
  228. this.getmonthinfo('');
  229. },
  230. async getmonthinfo(MerchantId){
  231. this.finished = false;
  232. const UserId = PublicLib.getCookieInfo('userId');
  233. const res = await getRequest('/api/v1/usertradedaysummary/teamperformanceforday',JSON.stringify({...this.pageinfo,TradeMonth:this.onConformateDate(),UserId,MerchantId}));
  234. if(res.status !== '1')return tips('月团队业绩获取失败!');
  235. if(res.data.length < this.pageinfo.PageSize) {
  236. this.finished = true
  237. };
  238. //- res.data[0].ProductList = [{Id:101,Name:'手动模拟标题',Amount:20526541.10}]
  239. //- res.data[0].TradeDate = '2020-05-03';
  240. this.data.push(...res.data);
  241. this.loading = false;
  242. },
  243. async gethalfyearinfo(MerchantId){
  244. const UserId = PublicLib.getCookieInfo('userId');
  245. const res = await getRequest('/api/v1/usertradedaysummary/teamperformancehalfyear',JSON.stringify({...this.pageinfo,UserId,MerchantId}));
  246. if(res.status !== '1')return tips('半年团队业绩获取失败!');
  247. this.data = res.data;
  248. },
  249. async getmerchantlist(){
  250. PublicLib.ShowLoading({Message:''});
  251. this.finished2 = false;
  252. const UserId = PublicLib.getCookieInfo('userId');
  253. const res = await getRequest('/api/v1/merchantinfo/teamperformancemerchants',JSON.stringify({...this.pageinfo2,UserId}));
  254. if(res.status !== '1')return tips('商户列表获取失败!');
  255. PublicLib.HideLoading();
  256. if(res.data.length < this.pageinfo2.PageSize) {
  257. this.finished2 = true
  258. };
  259. this.nameList.push(...res.data);
  260. this.loading2 = false;
  261. },
  262. goback(){
  263. PublicLib.GoBack({Level:1});
  264. },
  265. gotransactiondetail(date,item){
  266. PublicLib.putCookieInfo('paramstime', this.onParamsDate(date));
  267. PublicLib.putCookieInfo('transactiontype', '团队业绩');
  268. PublicLib.putCookieInfo('topshowtimetime', date);
  269. PublicLib.putCookieInfo('merchantName', item.Name);
  270. PublicLib.putCookieInfo('merchantTypeId', item.Id);
  271. PublicLib.Goto({Url:'transaction-detail'});
  272. }
  273. }
  274. });
  275. </script>
  276. </body>
  277. </html>