repairDetailsList.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
  3. <u-tabs
  4. :list="tabsList"
  5. :current="tabsCurrent"
  6. @click="tabsClick"
  7. lineColor="#333"
  8. :activeStyle="{ color: '#333', fontSize: '14px' }"
  9. :inactiveStyle="{ color: '#909399', fontSize: '14px' }"
  10. :scrollable="false"
  11. ></u-tabs>
  12. </u-sticky>
  13. <oa-scroll
  14. customClass="repairManage-container scroll-height"
  15. :pageSize="pageSize"
  16. :total="total"
  17. :isSticky="true"
  18. :refresherLoad="true"
  19. :refresherEnabled="true"
  20. :refresherDefaultStyle="'none'"
  21. :refresherThreshold="44"
  22. :lowerThreshold="44"
  23. :refresherBackground="'#f5f6f7'"
  24. @load="load"
  25. @refresh="refresh"
  26. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  27. >
  28. <template #default>
  29. <view class="menu-list m0">
  30. <view class="list-cell list-cell-arrow" style="color: #666666; line-height: 25px" v-for="(base, index) in dataList" :key="index" @click="handleToDetails(base)">
  31. <view class="content-area-top menu-item">
  32. <view class="content-area-top-time">
  33. {{ base.repairStatus == 1 ? (base.createTime ? base.createTime.replace("T", " ") : "") : base.handleTime ? base.handleTime.replace("T", " ") : "" }}
  34. </view>
  35. <view class="content-area-top-status" v-if="base.repairStatus == 1" style="background-color: #23dedc"> 受理中 </view>
  36. <view class="content-area-top-status" v-if="base.repairStatus == 2" style="background-color: #16bf00"> 处理完成 </view>
  37. </view>
  38. <view class="content-area-row_wrap menu-item">
  39. <view class="content-area-row_wrap-view"> 项目名称:{{ base.projectName }} </view>
  40. <view class="content-area-row_wrap-view"> 报修人:{{ base.reflectName }} </view>
  41. <view class="content-area-row_wrap-view"> 报修人电话:{{ base.reflectPhone }} </view>
  42. <view class="content-area-row_wrap-view"> 报修内容:{{ base.repairContent }} </view>
  43. <view class="content-area-row_wrap-view"> 报修地址:{{ base.projectAddress }} </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. </oa-scroll>
  49. </template>
  50. <script setup>
  51. /*----------------------------------依赖引入-----------------------------------*/
  52. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  53. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  54. /*----------------------------------接口引入-----------------------------------*/
  55. import { page } from "@/api/business/fireIot/repairManage.js";
  56. /*----------------------------------组件引入-----------------------------------*/
  57. /*----------------------------------store引入-----------------------------------*/
  58. import { useStores, commonStores } from "@/store/modules/index";
  59. /*----------------------------------公共方法引入-----------------------------------*/
  60. /*----------------------------------公共变量-----------------------------------*/
  61. const { proxy } = getCurrentInstance();
  62. const commonStore = commonStores(); //全局公共Store
  63. /*----------------------------------变量声明-----------------------------------*/
  64. const state = reactive({
  65. tabsList: [
  66. { name: "全部", value: "" },
  67. { name: "受理中", value: 1 },
  68. { name: "处理完成", value: 2 },
  69. ],
  70. tabsCurrent: 1,
  71. dataList: [],
  72. pageSize: 20,
  73. current: 1,
  74. total: 0,
  75. });
  76. const { tabsList, tabsCurrent, dataList, pageSize, current, total } = toRefs(state);
  77. /**
  78. * @页面初始化
  79. */
  80. function init() {
  81. selectListApi();
  82. }
  83. /**
  84. * @列表查询
  85. * @api接口查询
  86. */
  87. function selectListApi() {
  88. page({
  89. repairStatus: state.tabsList[state.tabsCurrent].value,
  90. current: state.current,
  91. size: state.pageSize,
  92. }).then((requset) => {
  93. if (requset.status === "SUCCESS") {
  94. state.dataList = requset.data.records;
  95. state.total = requset.data.total;
  96. }
  97. });
  98. }
  99. /**
  100. * @跳转详情事件
  101. */
  102. function handleToDetails(e) {
  103. proxy.$tab.navigateTo(`/pages/business/fireIot/repairManage/repairDetails?repairCode=${e.repairCode}`);
  104. }
  105. /**
  106. * @scrollView加载数据
  107. */
  108. function load() {
  109. state.pageSize += 10;
  110. init();
  111. }
  112. /**
  113. * @scrollView刷新数据
  114. */
  115. function refresh() {
  116. state.pageSize = 20;
  117. init();
  118. }
  119. /**
  120. * @tabs点击事件
  121. */
  122. function tabsClick(e) {
  123. state.tabsCurrent = e.index;
  124. init();
  125. }
  126. onReady(() => {});
  127. onShow(() => {
  128. //调用系统主题颜色
  129. proxy.$settingStore.systemThemeColor([1]);
  130. });
  131. onLoad((options) => {
  132. init();
  133. });
  134. </script>
  135. <style lang="scss" scoped>
  136. .repairManage-container {
  137. .content-area {
  138. &-top {
  139. padding-right: 10px;
  140. font-size: 16px;
  141. font-weight: 600;
  142. color: #000000;
  143. &-time {
  144. max-width: 70%;
  145. margin: auto 0;
  146. font-size: 14px;
  147. color: rgb(102, 102, 102);
  148. }
  149. &-name {
  150. max-width: 70%;
  151. color: #000;
  152. }
  153. &-status {
  154. max-width: 30%;
  155. margin: auto 0 auto auto;
  156. font-size: 12px;
  157. color: #ffffff;
  158. padding: 0 5px;
  159. border-radius: 20px;
  160. line-height: 20px;
  161. }
  162. }
  163. &-row_wrap {
  164. padding-right: 10px;
  165. font-size: 13px;
  166. flex-flow: row wrap;
  167. &-view {
  168. display: flex;
  169. min-width: 50%;
  170. > .iconfont {
  171. font-size: 14px;
  172. color: #909399;
  173. margin-left: 5px;
  174. }
  175. }
  176. }
  177. }
  178. }
  179. </style>