exportApplication.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view>
  3. <u-navbar title="出库申请" class="head">
  4. <view class="tabs" slot="bottom">
  5. <u-tabs bar-width="80" inactive-color="#777777" active-color="#101010" :list="list" :is-scroll="false"
  6. :current="current" @change="change"></u-tabs>
  7. <view class="screen" @click="changeShow()">
  8. 筛选<u-icon size="24" name="arrow-down" color="#777777"></u-icon>
  9. </view>
  10. <view class="options" v-if="this.show==true" @click="changeShow()">
  11. 选项3
  12. </view>
  13. </view>
  14. </u-navbar>
  15. <scroll-view scroll-y="true" @scrolltolower="onReachBottom()">
  16. <view class="list1">
  17. <view class="item" v-for="(item,i) in list[current].list" @click="ckInfo(item.id)" :key="i">
  18. <view class="title">
  19. <span v-if="current==1"
  20. style="margin-right: 6px;"
  21. :style="{color:recordStatusColor(item.status)}">[{{recordStatus(item.status)}}]</span>
  22. {{item.projectName}}
  23. </view>
  24. <view class="group">
  25. <view class="name">
  26. 申请人:
  27. </view>
  28. <view class="value">
  29. {{item.createByName}}
  30. </view>
  31. </view>
  32. <view class="group">
  33. <view class="name">
  34. 申请时间:
  35. </view>
  36. <view class="value">
  37. {{item.createTime}}
  38. </view>
  39. </view>
  40. </view>
  41. <u-divider v-if="list[current].recordsTotal==list[current].list.length"
  42. :isnone="list[current].recordsTotal==0" nonetext="没有找到相关内容"
  43. border-color="#CFD2D5">已经到底了</u-divider>
  44. </view>
  45. </scroll-view>
  46. <view class="bottom">
  47. <u-button type="primary" @click="addInfo">填写出库申请</u-button>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import * as API from '@/apis/pagejs/projectDepartment.js'
  53. import {
  54. recordStatus,
  55. recordStatusColor
  56. } from '@/apis/status.js'
  57. export default {
  58. data() {
  59. return {
  60. list: [{
  61. name: '审批中',
  62. pageIndex: 1,
  63. pageSize: 20,
  64. recordsTotal: 1,
  65. status: "0",
  66. list: []
  67. }, {
  68. name: '已审批',
  69. pageIndex: 1,
  70. pageSize: 20,
  71. recordsTotal: 1,
  72. status: "1",
  73. list: []
  74. }],
  75. current: 0,
  76. show: false
  77. }
  78. },
  79. onReachBottom() {
  80. var obj = this.list[this.current]
  81. if (obj.list.length < obj.recordsTotal) {
  82. this.myLoadmore();
  83. }
  84. },
  85. onReady() {
  86. this.getList()
  87. },
  88. methods: {
  89. recordStatus,
  90. recordStatusColor,
  91. getList() {
  92. uni.showLoading({
  93. title: "加载中",
  94. mask: true,
  95. })
  96. var list = this.list[this.current].list
  97. var obj = this.list[this.current]
  98. var listForm = {
  99. ...obj
  100. }
  101. delete listForm.list
  102. API.outApplyList(listForm).then((res) => {
  103. if (listForm.pageIndex == 1) {
  104. list = res.data.data;
  105. } else {
  106. list = [
  107. ...list,
  108. ...res.data.data
  109. ];
  110. }
  111. // list = [
  112. // ...list,
  113. // ...res.data.data
  114. // ];
  115. // list = [
  116. // ...list,
  117. // ...res.data.data
  118. // ];
  119. // list = [
  120. // ...list,
  121. // ...res.data.data
  122. // ];
  123. this.list[this.current].list = list
  124. this.list[this.current].recordsTotal = res.data.recordsTotal;
  125. uni.hideLoading();
  126. }).catch(error => {
  127. uni.showToast({
  128. title: error,
  129. icon: "none"
  130. })
  131. })
  132. },
  133. myLoadmore() {
  134. this.list[this.current].pageIndex += 1;
  135. this.getList();
  136. },
  137. init() {
  138. this.current = 0
  139. this.list[0].pageIndex = 1
  140. this.list[1].pageIndex = 1
  141. this.getList()
  142. },
  143. ckInfo(id) {
  144. var url = "./deliveryDetails?id=" + id;
  145. uni.navigateTo({
  146. url: url,
  147. events: {
  148. refreshData: () => {
  149. this.init()
  150. }
  151. }
  152. })
  153. },
  154. addInfo() {
  155. var url = "./deliveryFrom";
  156. uni.navigateTo({
  157. url: url,
  158. events: {
  159. refreshData: () => {
  160. this.init()
  161. }
  162. }
  163. })
  164. },
  165. change(index) {
  166. this.current = index;
  167. var list = this.list[this.current].list
  168. if (list.length == 0) {
  169. this.getList();
  170. }
  171. },
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. page {
  177. padding-bottom: 100rpx;
  178. }
  179. .head {
  180. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  181. /deep/.u-navbar {
  182. //background: 0!important;
  183. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  184. height: 210rpx;
  185. //padding: 0 32rpx;
  186. }
  187. /deep/.u-border-bottom:after {
  188. height: 0;
  189. }
  190. .tabs {
  191. padding: 0 32rpx
  192. }
  193. }
  194. .tabs {
  195. display: flex;
  196. justify-content: space-between;
  197. align-items: center;
  198. /deep/.u-tabs {
  199. background: 0 !important;
  200. width: 250rpx;
  201. }
  202. /deep/.u-tab-bar {
  203. background-color: #2A8EFB !important;
  204. }
  205. .screen {
  206. color: #415058;
  207. position: relative;
  208. font-family: Microsoft Yahei;
  209. /deep/.uicon-arrow-down {
  210. margin-left: 4rpx;
  211. }
  212. }
  213. .options {
  214. width: 120rpx;
  215. height: 60rpx;
  216. line-height: 60rpx;
  217. text-align: center;
  218. background-color: #fff;
  219. color: rgba(65, 80, 88, 1);
  220. font-family: Microsoft Yahei;
  221. position: absolute;
  222. top: 160rpx;
  223. right: 24rpx;
  224. box-shadow: 5px 5px 10px gray;
  225. }
  226. }
  227. .list1,
  228. .list2 {
  229. padding: 0 32rpx;
  230. margin-top: 60px;
  231. margin-bottom: 10px;
  232. .item {
  233. border-radius: 8px;
  234. background-color: rgba(255, 255, 255, 1);
  235. padding: 32rpx;
  236. margin-bottom: 24rpx;
  237. .title {
  238. color: rgba(51, 51, 51, 1);
  239. font-size: 36rpx;
  240. margin-bottom: 16rpx;
  241. }
  242. .group {
  243. display: flex;
  244. color: rgba(119, 119, 119, 1);
  245. margin-top: 16rpx;
  246. font-weight: bold;
  247. }
  248. }
  249. }
  250. .bottom {
  251. position: fixed;
  252. bottom: 0;
  253. left: 0;
  254. right: 0;
  255. background-color: #fff;
  256. padding: 16rpx 32rpx;
  257. uni-button {
  258. height: 88rpx;
  259. line-height: 88rpx;
  260. border-radius: 8px;
  261. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 0%, rgba(16, 98, 213, 1) 100%);
  262. color: rgba(255, 255, 255, 1);
  263. font-size: 32rpx;
  264. font-family: Microsoft Yahei;
  265. }
  266. }
  267. </style>