auth.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="content">
  3. <view class="title"> 审核列表 </view>
  4. <view class="list">
  5. <view
  6. class="project"
  7. v-for="project in projectList"
  8. :key="project.id"
  9. @click="onClickProject(project)"
  10. >
  11. {{ `${project.project_name}(${project.project_full_code})` }}
  12. </view>
  13. <view class="loadmore">{{ loadMoreText }}</view>
  14. </view>
  15. <search-drawer title="查询项目" ref="searchDrawer" @onOk="search">
  16. <uni-forms :modelValue="projectFilter" label-position="top" class="form">
  17. <uni-forms-item label="项目名称">
  18. <uni-easyinput
  19. type="text"
  20. class="input"
  21. v-model="projectFilter.project_name"
  22. />
  23. </uni-forms-item>
  24. <uni-forms-item label="项目编号">
  25. <uni-easyinput
  26. type="text"
  27. class="input"
  28. v-model="projectFilter.project_code"
  29. />
  30. </uni-forms-item>
  31. <uni-forms-item label="状态">
  32. <picker
  33. @change="selectChangeStatus"
  34. :range="statusList"
  35. :range-key="'label'"
  36. >
  37. <view class="select">
  38. {{
  39. projectFilter.project_status != null
  40. ? statusList[projectFilter.project_status + 1].label
  41. : "全部"
  42. }}
  43. </view>
  44. </picker>
  45. </uni-forms-item>
  46. </uni-forms>
  47. </search-drawer>
  48. </view>
  49. </template>
  50. <script>
  51. import { queryAuth } from "@/services/project";
  52. import { mapState } from "vuex";
  53. import mixin from "@/utils/listMixin";
  54. const statusList = [
  55. { value: null, label: "全部" },
  56. { value: 0, label: "售前" },
  57. { value: 1, label: "转执行" },
  58. { value: 2, label: "转运营" },
  59. { value: 3, label: "转质保" },
  60. ];
  61. export default {
  62. mixins: [mixin],
  63. computed: {
  64. ...mapState(["currentProject"]),
  65. },
  66. data() {
  67. return {
  68. projectList: [],
  69. projectFilter: {
  70. project_name: "",
  71. project_code: "",
  72. project_status: null,
  73. },
  74. statusList,
  75. };
  76. },
  77. onShow() {
  78. this.initData();
  79. },
  80. methods: {
  81. async getProject(params) {
  82. let res = {};
  83. res = await queryAuth(params);
  84. this.pagination.currentPage == 1
  85. ? (this.projectList = res.data.list)
  86. : (this.projectList = this.projectList.concat(res.data.list));
  87. return res.data;
  88. },
  89. async onClickProject(project) {
  90. await this.$store.commit("setCurrentProject", project);
  91. uni.navigateTo({
  92. url: `./detail?id=${project.id}&auth=${true}`,
  93. });
  94. },
  95. selectChangeStatus(e) {
  96. const item = this.statusList[e.target.value];
  97. this.projectFilter.project_status = item.value;
  98. },
  99. async search() {
  100. this.projectFilter.project_code =
  101. this.projectFilter.project_code.toUpperCase();
  102. this.pagination.currentPage = 1;
  103. await this.initData();
  104. this.$refs.searchDrawer.closeDrawer();
  105. },
  106. },
  107. };
  108. </script>
  109. <style lang="less" scoped>
  110. .content {
  111. display: flex;
  112. justify-content: center;
  113. flex-wrap: wrap;
  114. }
  115. .title {
  116. width: 100%;
  117. padding: 0 20px 20px 20px;
  118. position: fixed;
  119. background: #f8f8f8;
  120. font: 24px bold;
  121. }
  122. .list {
  123. width: 90%;
  124. margin-top: 60px;
  125. border-top: 2px solid gray;
  126. }
  127. .project {
  128. border-bottom: 2px solid gray;
  129. padding: 20px 0px;
  130. font-size: 18px;
  131. }
  132. .loadmore {
  133. padding: 20px 0px;
  134. font-size: 18px;
  135. color: gray;
  136. text-align: center;
  137. }
  138. .form {
  139. margin: 0 20px;
  140. }
  141. </style>