exportApplication.vue 6.1 KB

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