distributionOrders.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="page">
  3. <u-sticky zIndex="999">
  4. <!-- 筛选条件 -->
  5. <view class="headerFilter dis ">
  6. <view class="FilterItem dis a-c j-c " @click="dateShow=true">
  7. <text>{{info.signingTimeStart && info.signingTimeEnd? info.signingTimeStart +'-'+ info.signingTimeEnd : '全部'}}</text>
  8. <view class="tag"></view>
  9. </view>
  10. <view class="FilterItem dis a-c j-c " @click="commissionLevelShow=true">
  11. {{info.level?info.level==1?'一级佣金':info.level==2?'二级佣金':'三级佣金':'佣金等级'}}
  12. <view class="tag"></view>
  13. </view>
  14. <view class="FilterItem dis a-c j-c " @click="commissionStatusShow=true">
  15. {{info.auditStatus?info.auditStatus==0?'待结算':'已结算':"佣金状态"}}
  16. <view class="tag"></view>
  17. </view>
  18. </view>
  19. <!-- 统计数字 -->
  20. <view class="total dis a-c j-c ">
  21. <text>共有{{ordersList.orderCount}}笔订单,保费{{ordersList.premiumSum}}元,佣金{{ordersList.commissionSum}}元</text>
  22. </view>
  23. </u-sticky>
  24. <view class="content-list">
  25. <!-- 数据列表 -->
  26. <view class="item dis f-c mt-2" v-for="(item,index) in ordersList.distributionOrders" :key="index"
  27. v-if="ordersList.distributionOrders.length>0">
  28. <view class="above dis a-c j-s ">
  29. <view class="dis a-c">
  30. <image :src="`/static/image/tool/level${item.level}.png`" mode=""></image>
  31. <text class="license">{{item.licenseNo}}</text>
  32. <view class="status-tag dis a-c j-c">
  33. <text>{{item.auditStatus=='1'?'已结算':'未结算'}}</text>
  34. </view>
  35. </view>
  36. <text class="time">{{item.signingTime}}</text>
  37. </view>
  38. <view class="below mt-2 dis f-wrap">
  39. <view class="view">
  40. <text class="mr-3">保费</text>
  41. <text>{{item.premium}}</text>
  42. </view>
  43. <view class="view">
  44. <text class="mr-3">我的佣金</text>
  45. <text>{{item.commission}}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 日期组件 -->
  51. <uni-datePicker :show="dateShow" @close="dateShow=false" @customTime="customTime"
  52. @customMonth="customMonthchange"></uni-datePicker>
  53. <!-- 佣金等级 -->
  54. <uni-Popup :show="commissionLevelShow" @close='commissionLevelShow=false' headerTitle="佣金等级"
  55. :statusList="levelOptions" contentType="status" @statusConfirm='commissionLevelConfirm'>
  56. </uni-Popup>
  57. <!-- 佣金状态 -->
  58. <uni-Popup :show="commissionStatusShow" @close='commissionStatusShow=false' headerTitle="佣金状态"
  59. :statusList="statusOptions" contentType="status" @statusConfirm='commissionStatusConfirm'>
  60. </uni-Popup>
  61. </view>
  62. </template>
  63. <script>
  64. import {
  65. mapState,
  66. mapMutations
  67. } from "vuex"
  68. export default {
  69. data() {
  70. return {
  71. dateShow: false, //日期组件
  72. commissionLevelShow: false, //佣金等级
  73. commissionStatusShow: false, //佣金状态
  74. statusOptions: [{
  75. label: '全部',
  76. value: '',
  77. },
  78. {
  79. label: '待结算',
  80. value: "0",
  81. },
  82. {
  83. label: '已结算',
  84. value: "1",
  85. }
  86. ],
  87. levelOptions: [{
  88. label: '全部',
  89. value: '',
  90. },
  91. {
  92. label: '一级佣金',
  93. value: "1",
  94. },
  95. {
  96. label: '二级佣金',
  97. value: "2",
  98. },
  99. {
  100. label: '三级佣金',
  101. value: "3",
  102. },
  103. ],
  104. ordersList: [],
  105. info: {
  106. signingTimeStart: "",
  107. signingTimeEnd: "",
  108. level: "", //等级
  109. auditStatus: "", //状态
  110. },
  111. }
  112. },
  113. onShow() {
  114. },
  115. onLoad(options) {
  116. console.log(options);
  117. this.info.level = options.level;
  118. this.distributorDetails();
  119. },
  120. computed: {
  121. ...mapState(['userInfo']),
  122. },
  123. methods: {
  124. commissionStatusConfirm(value) {
  125. this.info.auditStatus = value;
  126. this.distributorDetails();
  127. this.commissionStatusShow = false;
  128. },
  129. commissionLevelConfirm(value) {
  130. this.info.level = value;
  131. this.distributorDetails();
  132. this.commissionLevelShow = false;
  133. },
  134. //分销订单
  135. async distributorDetails() {
  136. let res = await this.$http.post('/sysDistributionSetting/getDistributionOrder', {
  137. userId: this.userInfo.sysUser.infoId,
  138. ...this.info
  139. })
  140. if (res.code == 200) {
  141. this.ordersList = res.data;
  142. }
  143. },
  144. //日期月份回调
  145. customMonthchange(Month) {
  146. const currentMonth = this.getCurrentMonthRange(Month);
  147. this.info.signingTimeStart = currentMonth.start;
  148. this.info.signingTimeEnd = currentMonth.end;
  149. this.distributorDetails();
  150. this.dateShow = false;
  151. },
  152. //日期自定义时间回调
  153. customTime(start, end) {
  154. this.info.signingTimeStart = start;
  155. this.info.signingTimeEnd = end;
  156. this.distributorDetails();
  157. this.dateShow = false;
  158. },
  159. getCurrentMonthRange(time) {
  160. const today = new Date(time);
  161. const firstDay = new Date(today.getFullYear(), today.getMonth(), 1); // 本月第一天
  162. const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 本月最后一天
  163. // 格式化为 YYYY-MM-DD
  164. const formatDate = (date) => {
  165. const year = date.getFullYear();
  166. const month = String(date.getMonth() + 1).padStart(2, '0');
  167. const day = String(date.getDate()).padStart(2, '0');
  168. return `${year}-${month}-${day}`;
  169. };
  170. return {
  171. start: formatDate(firstDay),
  172. end: formatDate(lastDay)
  173. };
  174. },
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .page {
  180. background: #f8f8f8;
  181. height: 100vh;
  182. }
  183. /* 头部下拉筛选 */
  184. .headerFilter {
  185. background: #fff;
  186. border-top: 1rpx solid #eee;
  187. padding: 12rpx 30rpx;
  188. box-sizing: border-box;
  189. .FilterItem {
  190. width: 25%;
  191. font-size: 26rpx;
  192. color: #666;
  193. line-height: 2;
  194. /* 三角形 */
  195. .tag {
  196. width: 0;
  197. height: 0;
  198. border: 4px solid;
  199. border-color: #666666;
  200. border-bottom: 0 solid transparent;
  201. border-right: 3px solid transparent;
  202. border-left: 3px solid transparent;
  203. margin-left: 4rpx;
  204. }
  205. }
  206. .FilterItem:first-child {
  207. width: 50%;
  208. }
  209. }
  210. .total {
  211. padding: 8rpx 56rpx;
  212. box-sizing: border-box;
  213. background: #FFFBD7;
  214. border-radius: 0rpx 0rpx 0rpx 0rpx;
  215. font-size: 30rpx;
  216. color: #333;
  217. }
  218. .content-list {
  219. padding: 0 30rpx;
  220. box-sizing: border-box;
  221. .item {
  222. padding: 30rpx;
  223. box-sizing: border-box;
  224. background: #fff;
  225. border-radius: 10rpx;
  226. image {
  227. width: 40rpx;
  228. height: 36rpx;
  229. }
  230. .license {
  231. font-size: 32rpx;
  232. color: #333;
  233. font-weight: bold;
  234. margin: 0 6rpx;
  235. }
  236. .status-tag {
  237. padding: 2rpx 10rpx;
  238. box-sizing: border-box;
  239. background: #FFF4E1;
  240. border-radius: 20rpx 20rpx 20rpx 0rpx;
  241. font-size: 20rpx;
  242. font-weight: bold;
  243. color: #FFAC26;
  244. }
  245. .time {
  246. font-size: 22rpx;
  247. color: #999;
  248. }
  249. .below {
  250. .view {
  251. width: 50%;
  252. text:first-child {
  253. font-size: 28rpx;
  254. color: #999;
  255. }
  256. text:last-child {
  257. font-size: 30rpx;
  258. color: #333;
  259. }
  260. }
  261. }
  262. }
  263. }
  264. </style>