index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view>
  3. <view class="banner"><image src="../../static/my2.png" mode="widthFix"></image></view>
  4. <view class="ccn" style="margin-top: -120px;">
  5. <view class="cn">
  6. <view class="rows">
  7. <view class="row" @click="go('/pages/index/index')">
  8. <view class="out">
  9. <view class="ioc" style="background-color: #2196F3;"><text class="icon">&#xe6f3;</text></view>
  10. <view class="tit omit">委托单列表</view>
  11. </view>
  12. </view>
  13. <view class="row" @click="go('/pages/model/index')">
  14. <view class="out">
  15. <view class="ioc" style="background-color: #2196F3;"><text class="icon">&#xe6f3;</text></view>
  16. <view class="tit omit">设备借还记录</view>
  17. </view>
  18. </view>
  19. <!--
  20. <view class="row" @click="go('/pages/test/index')">
  21. <view class="out">
  22. <view class="ioc" style="background-color: #2196F3;"><text class="icon">&#xe6f3;</text></view>
  23. <view class="tit omit">设备借还记录</view>
  24. </view>
  25. </view>
  26. <view class="row" @click="go('/pages/test/index')">
  27. <view class="out">
  28. <view class="ioc" style="background-color: #2196F3;"><text class="icon">&#xe6f3;</text></view>
  29. <view class="tit omit">设备借还记录</view>
  30. </view>
  31. </view>
  32. <view class="row" @click="go('/pages/model/index')">
  33. <view class="out">
  34. <view class="ioc" style="background-color: #2196F3;"><text class="icon">&#xe6f3;</text></view>
  35. <view class="tit omit">设备台账</view>
  36. </view>
  37. </view>
  38. <view class="row" @click="go('/pages/test/index')">
  39. <view class="out">
  40. <view class="ioc" style="background-color: #2196F3;"><text class="icon">&#xe6f3;</text></view>
  41. <view class="tit omit">设备借还记录</view>
  42. </view>
  43. </view>
  44. <view class="row" @click="go('/pages/test/index')">
  45. <view class="out">
  46. <view class="ioc" style="background-color: #2196F3;"><text class="icon">&#xe6f3;</text></view>
  47. <view class="tit omit">设备借还记录</view>
  48. </view>
  49. </view>-->
  50. <view class="clear"></view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="ccn">
  55. <view class="cn">
  56. <view class="lable">
  57. <text>审批中心</text>
  58. <text class="more" @click="go('/pages/home/list')">更多></text>
  59. </view>
  60. <view class="list">
  61. <view class="tab"><u-tabs :list="tab" :current="current" @click="click"></u-tabs></view>
  62. <view class="spitem" v-for="(item, index) in list" :key="index" @click="detail(item.formId, item.docId)">
  63. <view class="title">
  64. <text class="icon">&#xe602;</text>
  65. <text class="tit">[{{ item.flowName }}]</text>
  66. <view class="dev" v-if="item.subject">{{ item.subject.summaryText }}</view>
  67. </view>
  68. <view class="desc">
  69. <view class="name">{{ item.initiator }}</view>
  70. <view class="bm omit">{{ item.initiatorDept }}</view>
  71. <view class="date">{{ item.actionTime }}</view>
  72. </view>
  73. <view class="clear"></view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. export default {
  82. data() {
  83. return {
  84. user: {},
  85. current: 0,
  86. tab: [{ name: '待审批', badge: { value: 5 } }, { name: '已审批' }],
  87. list: [{}, {}, {}, {}, {}]
  88. };
  89. },
  90. onShow() {
  91. this.getData();
  92. },
  93. methods: {
  94. getData() {
  95. this.http.request({
  96. url: this.http.urls.myPending,
  97. success: res => {
  98. this.tab[0].badge.value = res.data.data.rowCount;
  99. this.list = res.data.data.datas;
  100. this.list.forEach(item => {
  101. if (item.subject) {
  102. item.subject = JSON.parse(item.subject);
  103. item.subject.summaryText = item.subject.summaryText.replace(/\r|\n/gi, '');
  104. }
  105. });
  106. }
  107. });
  108. },
  109. //跳转
  110. go(url) {
  111. uni.navigateTo({ url: url });
  112. },
  113. click(e) {},
  114. //跳转到详情
  115. detail(formId, id) {
  116. var url;
  117. if (formId == '__0FLGNncOS1lz0T9jsFn') {
  118. url = '/pages/index/detail?id=';
  119. } else if (formId == '__LcDaGhYHt5xOSeHMCs0') {
  120. url = '/pages/model/return?id=';
  121. } else if (formId == '__w9J1gxcIWgXmNw6pE1F') {
  122. url = '/pages/model/borrowing?id=';
  123. }
  124. uni.navigateTo({
  125. url: url + id + '&ste=1&formId=' + formId
  126. });
  127. },
  128. //退出登录
  129. exit() {
  130. uni.showModal({
  131. title: '提示',
  132. content: '确定退出登录?',
  133. success: res => {
  134. if (res.confirm) {
  135. uni.removeStorageSync('user');
  136. this.user = {};
  137. }
  138. }
  139. });
  140. }
  141. },
  142. //下拉刷新
  143. onPullDownRefresh() {
  144. setTimeout(() => {
  145. this.getData();
  146. uni.stopPullDownRefresh();
  147. }, 1000);
  148. }
  149. };
  150. </script>
  151. <style lang="scss">
  152. page {
  153. background-color: #f1f0f1;
  154. }
  155. .banner {
  156. image {
  157. width: 100%;
  158. }
  159. }
  160. .ccn {
  161. padding: 13px;
  162. overflow: hidden;
  163. position: relative;
  164. margin-top: -15px;
  165. .cn {
  166. background-color: white;
  167. border-radius: 8px;
  168. padding: 10px;
  169. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  170. .rows {
  171. margin-top: 3%;
  172. .row {
  173. float: left;
  174. width: 33.33%;
  175. text-align: center;
  176. .out {
  177. padding: 5px;
  178. .ioc {
  179. width: 40px;
  180. height: 40px;
  181. background-color: red;
  182. border-radius: 40%;
  183. text-align: center;
  184. margin: 0 auto;
  185. line-height: 40px;
  186. .icon {
  187. font-size: 19px;
  188. color: white;
  189. }
  190. }
  191. .tit {
  192. font-size: 14px;
  193. margin-top: 5px;
  194. color: #848484;
  195. }
  196. }
  197. }
  198. }
  199. .lable {
  200. font-size: 17px;
  201. color: $font-c;
  202. font-weight: bold;
  203. .more {
  204. float: right;
  205. font-size: 14px;
  206. font-weight: normal;
  207. color: #848484;
  208. }
  209. }
  210. .list {
  211. .tab {
  212. background-color: aliceblue;
  213. border-radius: 3px;
  214. margin-top: 7px;
  215. }
  216. }
  217. }
  218. }
  219. </style>