exportProcess.vue 5.5 KB

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