index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view>
  3. <view class="search" v-if="show">
  4. <u-divider text="展开搜索"></u-divider>
  5. <u--input v-model="param.title" placeholder="输入标题" class="input" clearable></u--input>
  6. <u--input v-model="param.wt_num" placeholder="输入委托单号" class="input" clearable></u--input>
  7. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  8. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  9. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  10. <view class="flex">
  11. <view class="f"><button class="btn c" @click="clear()">重置</button></view>
  12. <view class="f"><button class="btn" @click="search()">搜索</button></view>
  13. </view>
  14. </view>
  15. <view class="list">
  16. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id, '1',item.items.__oUywWKvn4BhpnBmxqYT.value)">
  17. <view class="title">
  18. <text class="tv">{{ item.items.__yZMMXcXNnmKq5pTTfPH.value }}</text>
  19. <text class="icon">&#xe631;</text>
  20. <view class="clear"></view>
  21. </view>
  22. <view class="con">
  23. <view class="it">
  24. <view class="label">委托单编号:</view>
  25. <view class="name">{{ item.items.__BFdnHQXCEaXwAC4nryK.value }}</view>
  26. </view>
  27. <view class="it">
  28. <view class="label">申请单位:</view>
  29. <view class="name">{{ item.items.__VP07fdxAVMa7bSHb8ZU.value }}</view>
  30. </view>
  31. <view class="it">
  32. <view class="label">试验部门:</view>
  33. <view class="name">{{ item.items.__DVAKyCmSOS9bvFpome2.value }}</view>
  34. </view>
  35. <view class="it">
  36. <view class="label">当前审批人:</view>
  37. <view class="name">{{ item.items.__hInQ1R0YkMQNrgTq3q0.value }}</view>
  38. </view>
  39. <view class="tag" v-if="item.items.__oUywWKvn4BhpnBmxqYT.value != ''">{{ item.items.__oUywWKvn4BhpnBmxqYT.value }}</view>
  40. </view>
  41. </view>
  42. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  43. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  44. </view>
  45. <view class="footer"><button class="btn" style="width: 30%;border-radius: 25px;" @click="detail('0', 2)">新建</button></view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. param: { appId: '__gAPYBW4YxB3UePM3lqO', containTitle: '申请单', opentarget: 'detail', viewId: '__km3aURKW95BHxp12XVt', _currpage: 1 },
  53. list: [],
  54. show: false,
  55. loadMore: true
  56. };
  57. },
  58. onLoad(e) {
  59. //this.getaccessToken();
  60. this.getData();
  61. },
  62. methods: {
  63. getaccessToken() {
  64. this.http.request({
  65. url: this.http.urls.accessToken,
  66. data: this.param,
  67. loading: 'false',
  68. success: res => {
  69. console.log('gfgh===1111' + JSON.stringify(res));
  70. if (res.data.errcode == 0) {
  71. uni.removeStorageSync('user');
  72. uni.setStorageSync('user', res.data.data);
  73. this.getData();
  74. console.log('res.data.resultCode===' + res.data.errcode);
  75. }
  76. }
  77. });
  78. },
  79. getData() {
  80. this.http.request({
  81. url: this.http.urls.wt_list,
  82. data: this.param,
  83. method: 'POST',
  84. loading: 'false',
  85. success: res => {
  86. let totalPage = res.data.data.row_count < 10 ? 1 : res.data.data.row_count / 10;
  87. this.loadMore = totalPage > this.param._currpage ? true : false;
  88. res.data.data.data.forEach(item => {
  89. this.list.push(item);
  90. });
  91. }
  92. });
  93. },
  94. //刷新数据
  95. refresh() {
  96. this.loadMore = true;
  97. this.param._currpage = 1;
  98. this.list = [];
  99. this.getData();
  100. },
  101. //跳转到详情
  102. detail(id, ste,sta) {
  103. uni.navigateTo({
  104. url: '/pages/index/detail?id=' + id + '&ste=' + ste+ '&sta=' + sta
  105. });
  106. },
  107. //跳转到详情
  108. add() {
  109. uni.navigateTo({
  110. url: '/pages/index/addwt'
  111. });
  112. }
  113. },
  114. //下拉刷新
  115. onPullDownRefresh() {
  116. setTimeout(() => {
  117. this.refresh();
  118. uni.stopPullDownRefresh();
  119. }, 1000);
  120. },
  121. //上拉加载
  122. onReachBottom() {
  123. if (this.loadMore) {
  124. this.param._currpage++;
  125. this.getData();
  126. }
  127. },
  128. //搜索
  129. search() {
  130. //console.log("asd:"+this.param.keyword);
  131. //this.param.name=this.param.keyword;
  132. this.list=[];
  133. //this.selectId=this.param.name;
  134. this.getData();
  135. },
  136. //展开搜索
  137. onNavigationBarButtonTap() {
  138. this.show = !this.show;
  139. }
  140. };
  141. </script>
  142. <style lang="scss">
  143. page {
  144. background-color: #f2f3f5;
  145. }
  146. .list {
  147. padding: 10px 15px 80px 15px;
  148. .item {
  149. margin-bottom: 10px;
  150. background-color: white;
  151. border-radius: 5px;
  152. overflow: hidden;
  153. padding-bottom: 5px;
  154. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  155. .title {
  156. border-bottom: 1px solid #efefef;
  157. padding: 12px;
  158. .tv {
  159. float: left;
  160. width: 90%;
  161. }
  162. .icon {
  163. float: right;
  164. }
  165. }
  166. .con {
  167. position: relative;
  168. .it {
  169. font-size: 14px;
  170. padding: 5px 12px 5px 12px;
  171. .label {
  172. float: left;
  173. color: #969696;
  174. }
  175. .name {
  176. color: $font-c;
  177. }
  178. }
  179. .tag {
  180. position: absolute;
  181. top: 10%;
  182. right: 0px;
  183. padding: 3px 10px;
  184. background-color: #e64340;
  185. color: white;
  186. border-radius: 15px 0px 0px 15px;
  187. }
  188. }
  189. }
  190. }
  191. </style>