order.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view>
  3. <mescroll-body top="30" bottom="40" @init="mescrollInit" @down="downCallback" @up="upCallback" :option="{}">
  4. <view class="common-list">
  5. <view class="common-item" v-for="(item,index) in list" :key="item.id">
  6. <view class="title">{{item.name}}</view>
  7. <view class="date">{{item.date}}</view>
  8. <view>
  9. <view class="space" v-for="(node,index) in item.roomMap" :key="index">{{node}}</view>
  10. </view>
  11. <view class="other">
  12. <view class="item" v-if="type === 3">
  13. <view class="label">合同编码</view>
  14. <view class="value">{{item.contractCode}}</view>
  15. </view>
  16. <view class="item" v-if="type !== 3">
  17. <view class="label">关联租客</view>
  18. <view class="value">{{item.tenantType === 1 ? item.merchantName: item.clientName}}</view>
  19. </view>
  20. <view class="item" v-if="type !== 3">
  21. <view class="label">服务方式</view>
  22. <view class="value">
  23. {{type === 1?$field.findTypeName('serviceWorkWay',item.workWay):$field.findTypeName('clearWorkWay',item.workWay)}}
  24. </view>
  25. </view>
  26. </view>
  27. <view class="state">
  28. <view class="create">
  29. <uni-icons class="inherit-icons" type="staff-filled" color="#08979c" size="18"></uni-icons>
  30. <text class="name hui-ellipsis">{{item.followUpPersonName || '-'}}</text>
  31. </view>
  32. <view class="tag">
  33. <div class="status-tag info" v-if="!item.status">待提交</div>
  34. <div class="status-tag primary" v-else-if="item.status === 1">待处理</div>
  35. <div class="status-tag warning" v-else-if="item.status === 2">处理中</div>
  36. <div class="status-tag success" v-else>已处理</div>
  37. </view>
  38. </view>
  39. <view class="icon">
  40. <uni-icons custom-prefix="iconfont" :type="menu.iconClass" color="#08979c" size="30">
  41. </uni-icons>
  42. </view>
  43. </view>
  44. </view>
  45. </mescroll-body>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. getOrderPageListByQuery
  51. } from '@/request/api/order.js'
  52. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  53. export default {
  54. mixins: [MescrollMixin], // 使用mixin
  55. data() {
  56. return {
  57. list: [],
  58. type: '',
  59. menu: {}
  60. }
  61. },
  62. onLoad(body) {
  63. this.type = parseInt(body.type);
  64. this.menu = this.title();
  65. uni.setNavigationBarTitle({
  66. title: this.menu.title
  67. });
  68. },
  69. methods: {
  70. title() {
  71. let str = {
  72. title: '',
  73. iconClass: 'icon-weixiugongdan'
  74. };
  75. switch (this.type) {
  76. case 1:
  77. str = {
  78. title: '维修工单',
  79. iconClass: 'icon-weixiugongdan'
  80. };
  81. break;
  82. case 2:
  83. str = {
  84. title: '保洁工单',
  85. iconClass: 'icon-jinribaojie'
  86. };
  87. break;
  88. case 3:
  89. str = {
  90. title: '运维工单',
  91. iconClass: 'icon-yunwei-jiancebaogao'
  92. };
  93. break;
  94. default:
  95. break;
  96. }
  97. return str;
  98. },
  99. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  100. upCallback(page) {
  101. getOrderPageListByQuery({
  102. currPage: page.num,
  103. pageSize: 10,
  104. organizationId: this.$store.getters.organization.id,
  105. projectId: this.$store.getters.project.id,
  106. type: this.type
  107. }).then(res => {
  108. if (res.code === 200) {
  109. this.mescroll.endBySize(res.data.dataList.length, res.data.totalCount);
  110. if (page.num == 1) this.list = []; //如果是第一页需手动制空列表
  111. let data = res.data.dataList;
  112. this.list = this.list.concat(data); //追加新数据
  113. } else {
  114. this.mescroll.endErr();
  115. }
  116. }).catch(() => {
  117. //联网失败, 结束加载
  118. this.mescroll.endErr();
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style>
  125. </style>