index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div>
  3. <button @click="jumpReport()" class="mt10 top_buttom">
  4. <van-icon name="plus" />
  5. 新增年度计划
  6. </button>
  7. <div class="list">
  8. <div
  9. class="list-row"
  10. v-for="(item, index) in list"
  11. @click="junmpMyMechantsDetails(item.id)"
  12. :key="index"
  13. >
  14. <div class="cell_1">
  15. <div class="width100 height44rpx">
  16. <div class="first_title">
  17. {{ item.attributiveYear }}年 {{ " " + item.companyName }}
  18. </div>
  19. </div>
  20. </div>
  21. <img
  22. src="../../../static/mine/youjiantou.png"
  23. style="width: 40rpx; height: 40rpx"
  24. alt=""
  25. />
  26. </div>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import { findSafetySelfCheckingPlanList, getByCodes } from "@/js_sdk/http";
  32. export default {
  33. data() {
  34. return {
  35. search: {
  36. pageSize: 20,
  37. pageNum: 1,
  38. },
  39. list: [],
  40. };
  41. },
  42. onShow() {
  43. this.search = { pageSize: 20, pageNum: 1 };
  44. this.findSafetySelfCheckingPlanList();
  45. },
  46. methods: {
  47. async getMoreListData() {
  48. let that = this;
  49. that.search.pageNum = that.search.pageNum + 1;
  50. let data = await findSafetySelfCheckingPlanList(this.search);
  51. if (data.rows == 0) {
  52. that.$showToast("没有更多数据了");
  53. } else {
  54. data.rows.forEach((e) => {
  55. that.list.push(e);
  56. });
  57. }
  58. },
  59. onReachBottom() {
  60. this.getMoreListData();
  61. }, //下拉执行的时候触发 (下拉刷新)
  62. async findSafetySelfCheckingPlanList() {
  63. let data = await findSafetySelfCheckingPlanList(this.search);
  64. this.list = data.rows;
  65. },
  66. jumpReport() {
  67. uni.navigateTo({
  68. url: "/pages/subPackages/secureselfplan/addplan?id=" + null,
  69. });
  70. },
  71. junmpMyMechantsDetails(id) {
  72. uni.navigateTo({
  73. url: "/pages/subPackages/secureselfplan/addplan?id=" + id,
  74. });
  75. },
  76. },
  77. };
  78. </script>
  79. <style>
  80. .top_buttom {
  81. background: #1d18bc;
  82. color: white;
  83. /* width: 240rpx; */
  84. float: right;
  85. padding: 25rpx;
  86. margin-right: 32rpx;
  87. margin-bottom: 32rpx;
  88. }
  89. </style>