exportProcess.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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(this.current==0){
  108. this.carhelp.set("badgeList_outApproveList",res.data.recordsTotal)
  109. }
  110. if(val!='init'){
  111. uni.hideLoading();
  112. }
  113. }).catch(error => {
  114. uni.showToast({
  115. title: error,
  116. icon: "none"
  117. })
  118. })
  119. },
  120. myLoadmore(){
  121. this.list[this.current].pageIndex += 1;
  122. this.getList();
  123. },
  124. init(){
  125. this.current=0
  126. this.list[0].pageIndex=1
  127. this.list[1].pageIndex=1
  128. this.getList('init')
  129. },
  130. ckInfo(id,status){
  131. var url="./deliveryDetails?id="+id;
  132. if(status!=0){
  133. url="./deliveryInfo?id="+id;
  134. }
  135. uni.navigateTo({
  136. url:url,
  137. events: {
  138. refreshData: () => {
  139. this.init()
  140. }
  141. }
  142. })
  143. },
  144. change(index) {
  145. this.current = index;
  146. var list=this.list[this.current].list
  147. if(list.length==0){
  148. this.getList();
  149. }
  150. },
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. page{
  156. padding-bottom: 100rpx;
  157. }
  158. .head {
  159. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  160. /deep/.u-navbar {
  161. //background: 0!important;
  162. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  163. height: 210rpx;
  164. //padding: 0 32rpx;
  165. }
  166. /deep/.u-border-bottom:after {
  167. height: 0;
  168. }
  169. .tabs {
  170. padding: 0 32rpx
  171. }
  172. }
  173. .tabs{
  174. display: flex;
  175. justify-content: space-between;
  176. align-items: center;
  177. /deep/.u-tabs{
  178. background: 0 !important;
  179. width: 250rpx;
  180. }
  181. /deep/.u-tab-bar{
  182. background-color: #2A8EFB !important;
  183. }
  184. .screen{
  185. color: #415058;
  186. position: relative;
  187. font-family: Microsoft Yahei;
  188. /deep/.uicon-arrow-down{
  189. margin-left: 4rpx;
  190. }
  191. }
  192. .options{
  193. width: 120rpx;
  194. height: 60rpx;
  195. line-height: 60rpx;
  196. text-align: center;
  197. background-color: #fff;
  198. color: rgba(65, 80, 88, 1);
  199. font-family: Microsoft Yahei;
  200. position: absolute;
  201. top: 160rpx;
  202. right: 24rpx;
  203. box-shadow:5px 5px 10px gray;
  204. }
  205. }
  206. .list1,.list2{
  207. padding: 0 32rpx;
  208. margin-top: 60px;
  209. margin-bottom: 10px;
  210. .item{
  211. border-radius: 8px;
  212. background-color: rgba(255, 255, 255, 1);
  213. padding: 32rpx;
  214. margin-bottom: 24rpx;
  215. .title{
  216. color: rgba(51, 51, 51, 1);
  217. font-size: 36rpx;
  218. margin-bottom: 16rpx;
  219. }
  220. .group{
  221. display: flex;
  222. color: rgba(119, 119, 119, 1);
  223. margin-top: 16rpx;
  224. font-weight: bold;
  225. }
  226. }
  227. }
  228. .bottom{
  229. position: fixed;
  230. bottom: 0;
  231. left: 0;
  232. right: 0;
  233. background-color: #fff;
  234. padding: 16rpx 32rpx;
  235. uni-button{
  236. height: 88rpx;
  237. line-height: 88rpx;
  238. border-radius: 8px;
  239. background: linear-gradient(180deg, rgba(22,119,255,1) 0%,rgba(16,98,213,1) 100%);
  240. color: rgba(255, 255, 255, 1);
  241. font-size: 32rpx;
  242. font-family: Microsoft Yahei;
  243. }
  244. }
  245. </style>