institutional - 副本.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <view >
  3. <public-module></public-module>
  4. <view class=" flexd " style="z-index: 99;">
  5. <view class="search dis a-c j-s">
  6. <u-search v-model="pageRequest.deptName" @custom="custom" @search="search" :shape="shape"
  7. :height='68' bg-color="#fff"
  8. :input-style="{background:'transparent'}" placeholder-color="#ccc" :clearabled="clearabled"
  9. :show-action="showAction" :input-align="inputAlign" @clear="clear"
  10. :action-style="{background:'#fff'}" placeholder="请输入机构关键词"></u-search>
  11. <image src="/static/shaixuan.png" mode="" @click="searchPopup"></image>
  12. </view>
  13. </view>
  14. <o-empty v-if="pageResult.length==0" />
  15. <view style="padding-top:120upx" >
  16. <view class="institutional-list" v-for="item in pageResult" @click="closeDetail(item)">
  17. <view class="homepage" style="font-size: 13px;font-weight: 500;">
  18. <text>团队名称:{{item.deptName}}</text>
  19. <text>¥{{item.sumpremium}}</text>
  20. </view>
  21. <view class="dis j-s">
  22. <view class="homepage-title">
  23. <text class="button1">出单{{item.orderManNum}}人</text>
  24. <text class="button2">总人数{{item.deptManNum}}人</text>
  25. </view>
  26. <view>
  27. <u-button size="mini" type="primary" class="view-now" @click="closeDetail(item)">查看详情</u-button>
  28. </view>
  29. <!-- <text>团队人数:{{item.deptManNum}}</text>
  30. <text>出单人力:{{item.orderManNum}}</text> -->
  31. </view>
  32. <!-- <u-button class="view-now" >立即查看</u-button> -->
  33. </view>
  34. </view>
  35. <u-loadmore v-if="pageResult.length!=0" :status="status" />
  36. <!-- 普通弹窗 -->
  37. <u-popup ref="popup" :mask="true" mode="bottom">
  38. <view >
  39. <view class="tabs">
  40. <u-tabs style="justify-content: flex-start;" :show-bar="false"
  41. active-color="#232832" :is-scroll="false" :current="0" :list="tabslist"
  42. bar-width="60"></u-tabs>
  43. </view>
  44. <view class="dis a-c f-wrap j-s" style="margin: 10px;">
  45. <view class="status-data" :class="item.value==timespecifications? 'active':''"
  46. v-for="(item,index) in dateList" @tap="dateclick(index)" :key="index">
  47. {{item.label}}
  48. </view>
  49. <view class="dis a-c">
  50. <view class="status-data" :class="startShow? 'active' :''"
  51. @tap="startShowmethod()">
  52. <text v-if="pageRequest.beginTime!=''">{{pageRequest.beginTime}}</text>
  53. <text v-else>{{transformTime()}}</text>
  54. </view>
  55. <text style="margin: 0 8px;font-size: 12px;">至</text>
  56. <view class="status-data" :class="endShow? 'active' :''" @tap="endShowmethod()">
  57. <text v-if="pageRequest.endTime!=''">{{pageRequest.endTime}}</text>
  58. <text v-else>{{transformTime()}}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="dis a-c f-wrap j-s trading-foot">
  63. <text @click="$refs.popup.close()">取消</text>
  64. <text @click="confirm">确认</text>
  65. </view>
  66. </view>
  67. </u-popup>
  68. </view>
  69. </template>
  70. <script>
  71. import { log } from 'util';
  72. export default {
  73. name: 'name', //插件名称
  74. data() {
  75. return {
  76. //日期筛选list
  77. dateList: [{
  78. label: '全部',
  79. value: 0,
  80. },
  81. {
  82. label: '一周内',
  83. value: 1,
  84. },
  85. {
  86. label: '一个月内',
  87. value: 2,
  88. },
  89. {
  90. label: '三个月内',
  91. value: 3,
  92. },
  93. {
  94. label: '六个月内',
  95. value: 4,
  96. },
  97. ],
  98. rangeData:'',
  99. btnGetCode: {
  100. borderRadius: '7px',//驼峰命名注意----这里如果不规范,会整体失效,px,rpx作为单位都可以,一定要有引号
  101. height: '34px',
  102. },
  103. isLoading:false,
  104. clearabled: true,
  105. inputAlign: 'left',
  106. showAction: false,
  107. shape: 'square',
  108. pageRequest: { //查询的默认条件
  109. deptName: "",
  110. beginTime:'',
  111. endTime:'',
  112. pageNum: 1,
  113. pageSize: 20,
  114. },
  115. pageResult:[],
  116. tabslist: [{
  117. name: '时间筛选'
  118. }, ],
  119. timespecifications: null,
  120. startShow: false,
  121. endShow:false,
  122. totalPages: 0, //订单总页数
  123. status: 'loadmore',
  124. }
  125. },
  126. async onLoad(e) {
  127. // if(e.userId){
  128. // this.pageRequest.userId=e.userId
  129. // }
  130. this.getOrdersList(1, 20)
  131. },
  132. methods: {
  133. closeDetail(val){
  134. uni.navigateTo({
  135. url: `/pages/institutional/detail?deptId=${val.deptId}&deptName=${val.deptName}&startTime=${val.startTime}`
  136. })
  137. },
  138. onReachBottom() {
  139. if (this.pageRequest.pageNum >= this.totalPages) return;
  140. this.status = 'loading';
  141. this.pageRequest.pageNum = ++this.pageRequest.pageNum;
  142. setTimeout(async () => {
  143. let res = await this.$http.post('/agency/queryTeamInfoPage', this.pageRequest);
  144. if (res.code == '200') {
  145. this.pageResult = [...this.pageResult, ...res.data.content];
  146. }
  147. if (this.pageRequest.pageNum >= this.totalPages) this.status = 'nomore';
  148. else this.status = 'loading';
  149. }, 1000)
  150. },
  151. //当前时间
  152. transformTime(day) {
  153. var date = new Date();
  154. date.setFullYear(date.getFullYear());
  155. date.setTime(date.getTime());
  156. var strYear = date.getFullYear();
  157. var strDay = day ? date.getDate() - day : date.getDate();
  158. var strMonth = date.getMonth() + 1;
  159. if (strMonth < 10) {
  160. strMonth = "0" + strMonth;
  161. }
  162. if (strDay < 10) {
  163. strDay = "0" + strDay;
  164. }
  165. var datastr = strYear + "-" + strMonth + "-" + strDay;
  166. return datastr;
  167. },
  168. transformTime1(month) {
  169. var date = new Date();
  170. date.setFullYear(date.getFullYear());
  171. date.setTime(date.getTime());
  172. var strYear = date.getFullYear();
  173. var strDay = date.getDate();
  174. var strMonth = month ? (date.getMonth() + 1) - month : date.getMonth() + 1;
  175. if (strMonth < 10) {
  176. strMonth = "0" + strMonth;
  177. }
  178. if (strDay < 10) {
  179. strDay = "0" + strDay;
  180. }
  181. var datastr = strYear + "-" + strMonth + "-" + strDay;
  182. return datastr;
  183. },
  184. startShowmethod() {
  185. this.startShow = true;
  186. this.timespecifications = null;
  187. },
  188. endShowmethod() {
  189. this.endShow = true;
  190. this.timespecifications = null;
  191. },
  192. //日期筛选
  193. dateclick(e) {
  194. /* 0:全部 1:一周内 2:一个月内 3:三个月内 4:六个月内*/
  195. switch (e) {
  196. case 0:
  197. this.pageRequest.beginTime = "";
  198. this.pageRequest.endTime = "";
  199. break;
  200. case 1:
  201. this.pageRequest.beginTime = this.transformTime(7);
  202. this.pageRequest.endTime = this.transformTime();
  203. break;
  204. case 2:
  205. this.pageRequest.beginTime = this.transformTime1(1);
  206. this.pageRequest.endTime = this.transformTime();
  207. break;
  208. case 3:
  209. this.pageRequest.beginTime = this.transformTime1(3);
  210. this.pageRequest.endTime = this.transformTime();
  211. break;
  212. case 4:
  213. this.pageRequest.beginTime = this.transformTime1(6);
  214. this.pageRequest.endTime = this.transformTime();
  215. break;
  216. default:
  217. }
  218. this.timespecifications = e;
  219. },
  220. searchPopup() {
  221. this.$refs.popup.open()
  222. },
  223. search(e) {
  224. this.pageRequest.deptName=e
  225. this.getOrdersList(1, 20);
  226. },
  227. confirm() {
  228. this.getOrdersList(1, 20);
  229. this.$refs.popup.close()
  230. },
  231. async getOrdersList(page, size) {
  232. this.isLoading=true
  233. this.pageRequest.pageNum = page;
  234. this.pageRequest.pageSize = size;
  235. let res = await this.$http.post('/agency/queryTeamInfoPage', this.pageRequest);
  236. if (res.code == '200') {
  237. this.isLoading=false
  238. this.pageResult = res.data.content;
  239. this.totalPages = res.data.totalPages;
  240. }
  241. },
  242. }
  243. }
  244. </script>
  245. <style lang="scss" scoped>
  246. .flexd {
  247. position: fixed;
  248. left: 0;
  249. right: 0;
  250. background: linear-gradient( 180deg, #DAE0EE 0%, #E9ECF4 100%);
  251. }
  252. .homepage{
  253. display: flex;
  254. width: 100%;
  255. justify-content: space-between;
  256. }
  257. .search {
  258. padding: 13px 16px;
  259. image {
  260. width: 22px;
  261. height: 22px;
  262. margin-left: 20px;
  263. }
  264. }
  265. .institutional-list{
  266. background: #FFFFFF;
  267. padding: 20upx;
  268. font-size: 38upx;
  269. border-bottom: 1px solid #ccc;
  270. }
  271. .tabs {
  272. padding: 0 15px;
  273. border: 1px solid #f2f2f2;
  274. }
  275. .status-data {
  276. padding: 4px 10px;
  277. box-sizing: border-box;
  278. margin: 0 4px 4px 0;
  279. font-size: 12px;
  280. border: 1px solid #eee;
  281. cursor: pointer;
  282. }
  283. .active {
  284. position: relative;
  285. background: rgba(0, 82, 255, 0.1);
  286. color: #0052FF;
  287. border: 1px solid #0052FF;
  288. font-weight: 700;
  289. }
  290. .active::before {
  291. content: "";
  292. position: absolute;
  293. top: 0;
  294. left: 0;
  295. width: 10px;
  296. height: 10px;
  297. background-image: url("/static/image/car-insure/before.png");
  298. background-size: cover;
  299. }
  300. .trading-foot>text{
  301. width: 50%;
  302. text-align: center;
  303. background: #EAEAEA;
  304. color: #0052FF;
  305. line-height: 80upx;
  306. }
  307. .trading-foot>text:last-child{
  308. background: #343EEF;
  309. color: #FFFFFF;
  310. }
  311. .homepage-title{
  312. margin-top: 5px;
  313. button{
  314. background-color: #FEF0E1 ;
  315. color: #FE8F1C ;
  316. }
  317. }
  318. .homepage-title>button:last-child{
  319. background: #E6FAE3;
  320. color: #3AC716;
  321. margin-left: 10px;
  322. }
  323. .view-now{
  324. background: linear-gradient( 90deg, #7E99D1 0%, #4F78B1 100%);
  325. border-radius: 20px 20px 20px 20px;
  326. }
  327. .button1{
  328. background-color: #FEF0E1 ;
  329. color: #FE8F1C ;
  330. font-size: 11px;
  331. padding:5px 10px
  332. }
  333. .button2{
  334. background: #E6FAE3;
  335. color: #3AC716;
  336. margin-left: 10px;
  337. font-size: 11px;
  338. padding:5px 10px
  339. }
  340. </style>