record.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view>
  3. <view class="px-20">
  4. <view class="w-full bg--w111-fff rd-24rpx flex-between-center mt-24 p-32"
  5. v-for="(item,index) in list" :key="index">
  6. <view>
  7. <view class="flex-y-center">
  8. <text class="fs-30 lh-42rpx max-300 line1">{{item.system_name}}</text>
  9. <text class="tag tag0 fs-22 ml-16" :class="'tag' + item.status">{{item.status | typeFilter}}</text>
  10. </view>
  11. <view class="fs-24 text--w111-999 mt-20">提交时间:{{item.add_time}}</view>
  12. <view class="fs-24 text--w111-999 mt-20" v-if="item.status==2">原因:{{item.fail_msg}}</view>
  13. </view>
  14. <text class="btn info-btn fs-24" @tap="lookUp(item)" v-if="item.status==1">查看</text>
  15. <text class="btn danger-btn fs-24" @tap="resubmit(item)" v-else-if="item.status==2">重新提交</text>
  16. <text class="btn info-btn fs-24" @tap="edit(item)" v-else>编辑</text>
  17. </view>
  18. <view class="mt-20" v-if="list.length == 0">
  19. <emptyPage title="暂无申请记录~" src="/statics/images/noOrder.gif"></emptyPage>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import { recordList } from '@/api/user.js';
  26. import colors from '@/mixins/color.js';
  27. import emptyPage from '@/components/emptyPage.vue';
  28. import home from '@/components/home';
  29. export default{
  30. mixins: [colors],
  31. components: {
  32. emptyPage,
  33. home
  34. },
  35. data(){
  36. return{
  37. list:[]
  38. }
  39. },
  40. filters:{
  41. typeFilter(val){
  42. let obj = {
  43. 0: '待审核',
  44. 1: '审核通过',
  45. 2: '审核未通过'
  46. };
  47. return obj[val]
  48. },
  49. },
  50. onLoad(){
  51. this.getList();
  52. },
  53. methods:{
  54. getList(){
  55. recordList().then(res=>{
  56. this.list = res.data;
  57. }).catch(err=>{
  58. return this.$util.Tips({
  59. title: err
  60. });
  61. })
  62. },
  63. edit(item){
  64. uni.navigateTo({
  65. url: '/pages/users/supplier/index?id='+ item.id
  66. })
  67. },
  68. resubmit(item){
  69. uni.navigateTo({
  70. url: '/pages/users/supplier/state?id='+ item.id+'&type=2'
  71. })
  72. },
  73. lookUp(item){
  74. uni.navigateTo({
  75. url: '/pages/users/supplier/state?id='+ item.id+'&type=1'
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style>
  82. .max-300{
  83. max-width: 300rpx;
  84. }
  85. .tag{
  86. height: 38rpx;
  87. padding: 0 8rpx;
  88. display: inline-flex;
  89. justify-content: center;
  90. align-items: center;
  91. border-radius: 8rpx;
  92. }
  93. .tag0{
  94. color: rgba(0, 122, 255, 1);
  95. background-color: rgba(0, 122, 255, 0.1);
  96. }
  97. .tag1{
  98. color: rgba(0, 180, 42, 1);
  99. background-color: rgba(0, 180, 42, 0.1);
  100. }
  101. .tag2{
  102. color: rgba(245, 63, 63, 1);
  103. background-color: rgba(245, 63, 63, 0.1);
  104. }
  105. .btn{
  106. height: 56rpx;
  107. padding: 0 24rpx;
  108. display: inline-flex;
  109. justify-content: center;
  110. align-items: center;
  111. border-radius: 30rpx;
  112. }
  113. .info-btn{
  114. border: 1px solid #ccc;
  115. color: #333;
  116. }
  117. .danger-btn{
  118. border: 1px solid #e93323;
  119. color: #e93323;
  120. }
  121. </style>