myentry.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view>
  3. <!-- 搜索 -->
  4. <view class="cu-bar search bg-white solid-bottom echo-fixed-top">
  5. <view class="search-form round">
  6. <text class="cuIcon-search"></text>
  7. <input @input="bindInput" :adjust-position="false" type="text" placeholder="搜索姓名或手机号" confirm-type="search"></input>
  8. </view>
  9. <view class="action">
  10. <button class="cu-btn shadow-blur round" @click="btnSearch()">搜索</button>
  11. </view>
  12. <view class="action">
  13. <button class="cu-btn bg-blue shadow-blur round" @tap="goLPage('/pages/broker/setentry?entryid=0')">新增</button>
  14. </view>
  15. </view>
  16. <view class="echo-fixed-top-empty"></view>
  17. <sl-filter :ref="'slFilter'" :topFixed="false" :isTransNav="true" :navHeight="0" :color="titleColor" :themeColor="themeColor"
  18. :menuList="menuList" @result="result"></sl-filter>
  19. <view class="cu-list menu-avatar">
  20. <view class="cu-item" v-for="(item,index) in plist" :key="index">
  21. <view class="content">
  22. <view class="text-black">{{item.realname}} - {{item.mobile}}</view>
  23. <view class="text-gray text-sm text-cut">意向工厂:{{item.reportFactory.title}}</view>
  24. <view class="text-gray text-sm text-cut">报备时间:{{item.createtime}}</view>
  25. </view>
  26. <view class="action basis-xs">
  27. <view class="text-grey text-sm">{{statusarr[item.status]}}</view>
  28. <view class="cu-tag bg-blue margin-top-xs" @tap="goLPage('/pages/broker/setentry?entryid='+item.id)">查看详情</view>
  29. </view>
  30. </view>
  31. </view>
  32. <uni-load-more :status="pstatus"></uni-load-more>
  33. </view>
  34. </template>
  35. <script>
  36. import slFilter from '@/components/sl-filter/sl-filter.vue';
  37. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  38. var _this;
  39. export default {
  40. components: {
  41. slFilter,
  42. uniLoadMore
  43. },
  44. data() {
  45. return {
  46. brokerinfo: {},
  47. pstatus: 'more',
  48. ppage: 1,
  49. psize: 20,
  50. plist: [],
  51. searchval: "",
  52. themeColor: '#0081ff',
  53. titleColor: '#666666',
  54. filterResult: '',
  55. menuList: [{
  56. 'title': '报备状态',
  57. 'detailTitle': '请选择报备状态...',
  58. 'isMutiple': false,
  59. 'key': 'status',
  60. 'detailList': []
  61. },
  62. {
  63. 'title': '意向工厂',
  64. 'key': 'factoryid',
  65. 'isMutiple': false,
  66. 'detailTitle': '请选择意向工厂...',
  67. 'detailList': []
  68. }
  69. ],
  70. status: 0,
  71. factoryid: 0,
  72. statusarr: ['全部','待确认', '已确认', '已入职', '未通过']
  73. };
  74. },
  75. onLoad: function(){
  76. _this = this;
  77. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  78. if (_this.brokerinfo===false){
  79. uni.reLaunch({
  80. url: "/pages/my/my"
  81. });
  82. return false;
  83. }
  84. _this.$req.ajax({
  85. path: "broker/pageentry",
  86. data: {
  87. brokerid: _this.brokerinfo.id
  88. }
  89. }).then((data) => {
  90. _this.menuList[0].detailList = data.statuslist;
  91. _this.menuList[1].detailList = data.factorylist;
  92. _this.$refs.slFilter.resetMenuList(_this.menuList);
  93. _this.getMore();
  94. }).catch((err) => {
  95. console.log("err: " + JSON.stringify(err));
  96. });
  97. _this.getMore();
  98. },
  99. onPullDownRefresh: function() {
  100. _this.ppage = 1;
  101. _this.pstatus = 'more';
  102. _this.plist = [];
  103. _this.getMore();
  104. },
  105. onReachBottom: function() {
  106. if (_this.pstatus !== 'more') {
  107. return;
  108. }
  109. _this.getMore();
  110. },
  111. methods: {
  112. bindInput: function(e) {
  113. _this.searchval = e.detail.value;
  114. },
  115. btnSearch: function() {
  116. _this.pageRefresh();
  117. },
  118. getMore: function() {
  119. _this.$req.ajax({
  120. path: "broker/listentry",
  121. data: {
  122. ppage: _this.ppage,
  123. psize: _this.psize,
  124. brokerid: _this.brokerinfo.id,
  125. status: _this.status,
  126. factoryid: _this.factoryid,
  127. searchval: _this.searchval
  128. }
  129. }).then((data) => {
  130. _this.pstatus = data.pstatus;
  131. _this.plist = _this.plist.concat(data.plist);
  132. _this.ppage += 1;
  133. uni.stopPullDownRefresh();
  134. }).catch((err) => {
  135. uni.showModal({
  136. title: '信息提示',
  137. content: err,
  138. showCancel: false
  139. });
  140. });
  141. },
  142. pageRefresh: function() {
  143. _this.pstatus = 'more';
  144. _this.ppage = 1;
  145. _this.plist = [];
  146. _this.getMore();
  147. },
  148. result: function(e) {
  149. _this.status = e.status;
  150. _this.factoryid = e.factoryid;
  151. _this.pageRefresh();
  152. },
  153. goLPage: function(pageurl) {
  154. _this.userinfo = _this.checkLogin("/pages/my/my");
  155. if (_this.userinfo===false){
  156. return false;
  157. }
  158. uni.navigateTo({
  159. url: pageurl
  160. });
  161. },
  162. goNavPage: function(pageurl) {
  163. _this.userinfo = _this.checkLogin("/pages/my/my");
  164. if (_this.userinfo===false){
  165. return false;
  166. }
  167. uni.redirectTo({
  168. url: pageurl
  169. });
  170. },
  171. }
  172. }
  173. </script>
  174. <style>
  175. .cu-list.menu-avatar .cu-item{ height: 170rpx !important; }
  176. .cu-list.menu-avatar>.cu-item .content {
  177. left: 30rpx;
  178. width: calc(100% - 96rpx - 60rpx - 30rpx - 20rpx);
  179. }
  180. </style>