list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="page-detail">
  3. <view class="page-center">
  4. <uni-section title="已审批列表" type="line"> </uni-section>
  5. <uni-card
  6. v-for="item in list"
  7. :title="project[item.project_id] || '未知项目'"
  8. @click="toDetail(item)"
  9. >
  10. <view class="item">
  11. <view class="label">审批节点</view>
  12. <view class="value">{{
  13. item.TemplateNodeInfo ? item.TemplateNodeInfo.label : "-"
  14. }}</view>
  15. </view>
  16. <view class="item">
  17. <view class="label">清单名称</view>
  18. <view class="value"
  19. >{{ item.version_name }}.{{ item.version_no }}</view
  20. >
  21. </view>
  22. <view class="row">
  23. <view class="item">
  24. <view class="label">分类</view>
  25. <view class="value">{{
  26. classify[item.classify_id] || "未知分类"
  27. }}</view>
  28. </view>
  29. <view class="item">
  30. <view class="label">提交人</view>
  31. <view class="value">{{
  32. item.AuthorInfo && item.AuthorInfo.CName
  33. }}</view>
  34. </view>
  35. </view>
  36. </uni-card>
  37. <view style="text-align: center" v-if="list.length == 0">暂无审批项</view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. queryCheckedList,
  44. queryProjectList,
  45. queryClassify,
  46. } from "@/services/bom.js";
  47. import { queryUser } from "@/services/index";
  48. export default {
  49. data() {
  50. return {
  51. user: {},
  52. list: [],
  53. classify: {},
  54. project: {},
  55. pagination: {
  56. current: 1,
  57. pageSize: 10,
  58. total: 0,
  59. },
  60. };
  61. },
  62. mounted() {
  63. this.init();
  64. },
  65. onShow() {
  66. this.queryList();
  67. },
  68. methods: {
  69. async init() {
  70. let project = {},
  71. classify = {};
  72. const userInfo = await queryUser();
  73. if (userInfo?.data) {
  74. uni.setStorageSync("user", userInfo.data);
  75. }
  76. var { data: projectData } = await queryProjectList();
  77. var { data: classifyData } = await queryClassify();
  78. projectData.forEach((p) => {
  79. project[p.id] = p.project_name;
  80. });
  81. classifyData.forEach((item) => {
  82. classify[item.id] = item.name;
  83. });
  84. this.project = project;
  85. this.classify = classify;
  86. },
  87. async queryList() {
  88. let user = uni.getStorageSync("user");
  89. var { data: list } = await queryCheckedList(user.ID, {
  90. pageSize: 9999,
  91. });
  92. this.list = list.list;
  93. },
  94. toDetail(item) {
  95. uni.navigateTo({
  96. url: `./detail?templateNodeId=${item.TemplateNodeInfo.Id}&excel_id=${item.id}&projectId=${item.project_id}`,
  97. });
  98. },
  99. },
  100. };
  101. </script>
  102. <style lang="less" scoped>
  103. .page-detail {
  104. min-height: 100vh;
  105. padding: 20rpx 20rpx 40rpx;
  106. background: url("~@/static/index/bg.png") no-repeat center;
  107. background-size: cover;
  108. background-attachment: fixed;
  109. .page-center {
  110. padding: 20rpx;
  111. padding-top: 0;
  112. border-radius: 5px;
  113. background-color: #fff;
  114. }
  115. }
  116. .item {
  117. margin-bottom: 14px;
  118. .label {
  119. font-weight: bold;
  120. font-size: 16px;
  121. margin-bottom: 5px;
  122. }
  123. .value {
  124. font-size: 14;
  125. }
  126. }
  127. .row {
  128. display: flex;
  129. .item {
  130. width: 50%;
  131. display: flex;
  132. align-items: center;
  133. .label {
  134. margin-right: 12px;
  135. margin-bottom: 0;
  136. }
  137. }
  138. }
  139. </style>