detail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="" >
  3. <public-module></public-module>
  4. <view class="headers ">
  5. <view class="dis a-c j-start ">
  6. <u-icon name="arrow-left" size="40" @tap="back"></u-icon>
  7. <text style="margin: auto;">{{pageTtile}}</text>
  8. </view>
  9. </view>
  10. <view class="querystyle body" style="padding-top: 70px;">
  11. <view class="statisticsDate dis a-c ">
  12. <view style="width: 180upx;flex-shrink: 0;" class="dis a-c j-c">
  13. <picker style="padding: 0;margin-right: 5px;" @change="bindPickerChange"
  14. :value="queryTimeTypeIndex" :range="queryTimeTypeArray">
  15. <view>{{queryTimeTypeArray[queryTimeTypeIndex]}}</view>
  16. </picker>
  17. <u-icon name="arrow-down-fill" color="#333" size="16"></u-icon>
  18. </view>
  19. <view class="d-flex a-center j-center flex-1" @click="onShowDatePicker">
  20. {{dateRange[0].replace('/','-')}} -
  21. {{dateRange[1]}}
  22. </view>
  23. <view class="d-flex a-center j-center" style="width: 60upx;flex-shrink: 0;">
  24. <view class="icon iconfont icon-search-1-copy"></view>
  25. </view>
  26. </view>
  27. <view class="teamStatistics">
  28. <view class="statisticsTitle">
  29. <view class="d-flex a-center j-start">团队成员</view>
  30. <view class="d-flex a-center j-center">报价次数</view>
  31. <view class="d-flex a-center j-center">核保笔数</view>
  32. <view class="d-flex a-center j-end">出单笔数</view>
  33. <view class="d-flex a-center j-end">签单保费</view>
  34. </view>
  35. <block v-for="(item,index) in SummaryList" :key="index">
  36. <view class="" style="padding: 0 10px;">
  37. <view class="statisticsContent " :class="index==teamTabIndex?'active':''">
  38. <view class="dis a-c j-start">{{item.userName}}</view>
  39. <view class="dis a-c j-c">{{item.quoteNum}}</view>
  40. <view class="dis a-c j-c">{{item.underwriteNum.toFixed(2)}}</view>
  41. <view class="dis a-c j-end">{{item.issueNum}}</view>
  42. <view class="dis a-c j-end">{{item.sumpremium}}</view>
  43. </view>
  44. </view>
  45. </block>
  46. <u-loadmore style="margin-top: 5px;" v-if="SummaryList.length!=0" :status="status" />
  47. <o-empty v-if="SummaryList.length==0" />
  48. </view>
  49. </view>
  50. <mx-date-picker :show="showDatePicker" type="range" :value="dateRange" :show-tips="true" @confirm="onSelected"
  51. @cancel="onSelected" />
  52. </view>
  53. </template>
  54. <script>
  55. import MxDatePicker from "@/components/modules/tools/team/mx-datepicker/mx-datepicker.vue";
  56. export default{
  57. data(){
  58. return{
  59. queryTimeTypeArray: ['本月查询', '本年查询', '自定义查询'],
  60. queryTimeTypeIndex: 0,
  61. dateRange: [new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-01', new Date()
  62. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
  63. ],
  64. showDatePicker: false,
  65. teamTabIndex: 0,
  66. SummaryList: [],
  67. pageTtile: "",
  68. deptId:'',
  69. totalPages:0,
  70. status: 'loadmore',
  71. pageRequest: { //查询的默认条件
  72. pageNum: 1,
  73. pageSize: 20,
  74. },
  75. }
  76. },
  77. components: {
  78. MxDatePicker
  79. },
  80. async onLoad(params) {
  81. this.deptId=params.deptId
  82. this.pageRequest.startTime=params.startTime
  83. this.pageTtile=params.deptName
  84. this.queryData()
  85. },
  86. methods:{
  87. onReachBottom() {
  88. if (this.pageRequest.pageNum >= this.totalPages) return;
  89. this.status = 'loading';
  90. this.pageRequest.pageNum = ++this.pageRequest.pageNum;
  91. setTimeout(async () => {
  92. let res = await this.$http.post('/agency/queryTeamUser', {
  93. ...this.pageRequest,
  94. "enddate": this.dateRange[1]+' 23:59:59',
  95. "beginTime": this.dateRange[0] +' 00:00:01',
  96. deptId:this.deptId
  97. });
  98. if (res.code == '200') {
  99. this.SummaryList = [...this.SummaryList, ...res.data.content];
  100. }
  101. if (this.pageRequest.pageNum >= this.totalPages) this.status = 'nomore';
  102. else this.status = 'loading';
  103. }, 1000)
  104. },
  105. //页面返回按钮
  106. back() {
  107. uni.navigateBack({
  108. delta: 1, // 返回的页面数,如果是1表示返回上一页
  109. success: function() {}
  110. });
  111. },
  112. bindPickerChange: function(e) {
  113. this.queryTimeTypeIndex = e.target.value
  114. if (e.target.value == 0) {
  115. this.dateRange = [new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + '01',
  116. new Date()
  117. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
  118. ];
  119. this.queryData();
  120. }
  121. if (e.target.value == 1) {
  122. this.dateRange = [new Date().getFullYear() + '-01-01', new Date().getFullYear() + '-12-31'];
  123. this.queryData();
  124. }
  125. if (e.target.value == 2) {
  126. this.showDatePicker = true;
  127. }
  128. },
  129. onSelected(e) { //选择
  130. this.showDatePicker = false;
  131. if (e) {
  132. this.dateRange = e.value;
  133. this.queryData();
  134. }
  135. },
  136. async queryData() {
  137. let params = {
  138. "enddate": this.dateRange[1]+' 23:59:59',
  139. "beginTime": this.dateRange[0] +' 00:00:01',
  140. deptId:this.deptId,
  141. ...this.pageRequest
  142. }
  143. let res = await this.$http.post('/agency/queryTeamUser', params);
  144. if (res.code == '200') {
  145. this.SummaryList=res.data.content
  146. this.totalPages = res.data.totalPages;
  147. if (this.pageRequest.pageNum >= res.data.totalPages) this.status = 'nomore';
  148. else this.status = 'loadmore';
  149. }
  150. },
  151. onShowDatePicker() { //显示
  152. this.showDatePicker = true;
  153. },
  154. }
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .teamStatistics {
  159. width: 100%;
  160. height: auto;
  161. background: #FFFFFF;
  162. box-shadow: 0px 4px 10px 0px #DAE3F4;
  163. border-radius: 6px;
  164. }
  165. .body .teamStatistics .statisticsTitle {
  166. height: 70upx;
  167. padding: 0px 15upx;
  168. margin-top: 10px;
  169. box-sizing: border-box;
  170. line-height: 70upx;
  171. font-size: 24rpx;
  172. border-radius: 6px 6px 0 0;
  173. color: #232832;
  174. }
  175. .body .teamStatistics .statisticsContent {
  176. box-sizing: border-box;
  177. height: 70upx;
  178. line-height: 70upx;
  179. font-size: 26rpx;
  180. color: #232832;
  181. }
  182. .body .teamStatistics .statisticsTitle,
  183. .body .teamStatistics .statisticsContent {
  184. display: flex;
  185. flex-wrap: nowrap;
  186. justify-content: space-between;
  187. }
  188. .body .teamStatistics .statisticsTitle>view,
  189. .body .teamStatistics .statisticsContent>view {
  190. width: 200upx;
  191. text-align: center;
  192. font-size: 12px;
  193. }
  194. .statisticsDate {
  195. color: rgba(51,51,51,0.8);
  196. height: 34px;
  197. background: rgba(255,255,255,0.4);
  198. border-radius: 6px;
  199. }
  200. .teamStatistics .statisticsTitle {
  201. height: 70upx;
  202. padding: 0px 30upx;
  203. margin-top: 10px;
  204. box-sizing: border-box;
  205. line-height: 70upx;
  206. font-size: 24rpx;
  207. background: linear-gradient( 180deg, #DAE0EE 0%, #E9ECF4 100%);
  208. border-radius: 6px 6px 0 0;
  209. color: #232832;
  210. }
  211. .headers {
  212. position: fixed;
  213. top: 0;
  214. left: 0;
  215. height: auto;
  216. width: 100%;
  217. z-index: 999999;
  218. padding: 16px;
  219. padding-top: 50px;
  220. height: auto;
  221. background: #E2E5FE;
  222. text {
  223. font-size: 18px;
  224. font-weight: bold;
  225. }
  226. }
  227. .querystyle {
  228. width: 100%;
  229. height: 200px;
  230. background: #F8FAFE;
  231. background: linear-gradient( 180deg, #E1E4FD 0%, rgba(248,250,254,0) 100%);
  232. padding: 0 16px;
  233. }
  234. </style>