auth.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. onNavigationBarButtonTap() {
  81. uni.reLaunch({
  82. url: "/pages/index/index",
  83. });
  84. },
  85. methods: {
  86. async getProject(params) {
  87. let res = {};
  88. res = await queryAuth(params);
  89. this.pagination.currentPage == 1
  90. ? (this.projectList = res.data.list)
  91. : (this.projectList = this.projectList.concat(res.data.list));
  92. return res.data;
  93. },
  94. async onClickProject(project) {
  95. await this.$store.commit("setCurrentProject", project);
  96. uni.navigateTo({
  97. url: `./detail?id=${project.id}&auth=${true}`,
  98. });
  99. },
  100. selectChangeStatus(e) {
  101. const item = this.statusList[e.target.value];
  102. this.projectFilter.project_status = item.value;
  103. },
  104. async search() {
  105. this.projectFilter.project_code =
  106. this.projectFilter.project_code.toUpperCase();
  107. this.pagination.currentPage = 1;
  108. await this.initData();
  109. this.$refs.searchDrawer.closeDrawer();
  110. uni.pageScrollTo({
  111. scrollTop: 0,
  112. duration: 0,
  113. });
  114. },
  115. },
  116. };
  117. </script>
  118. <style lang="less" scoped>
  119. .content {
  120. display: flex;
  121. justify-content: center;
  122. flex-wrap: wrap;
  123. }
  124. .title {
  125. width: 100%;
  126. padding: 0 20px 20px 20px;
  127. position: fixed;
  128. background: #f8f8f8;
  129. font: 24px bold;
  130. }
  131. .list {
  132. width: 90%;
  133. margin-top: 60px;
  134. border-top: 2px solid gray;
  135. }
  136. .project {
  137. border-bottom: 2px solid gray;
  138. padding: 20px 0px;
  139. font-size: 18px;
  140. }
  141. .loadmore {
  142. padding: 20px 0px;
  143. font-size: 18px;
  144. color: gray;
  145. text-align: center;
  146. }
  147. .form {
  148. margin: 0 20px;
  149. }
  150. </style>