record.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <oa-scroll
  3. v-if="dataStatus"
  4. customClass="repairReport-record-container scroll-height"
  5. :pageSize="pageSize"
  6. :total="total"
  7. :isSticky="false"
  8. :refresherLoad="true"
  9. :refresherEnabled="true"
  10. :refresherDefaultStyle="'none'"
  11. :refresherThreshold="44"
  12. :refresherBackground="'#f5f6f7'"
  13. @load="load"
  14. @refresh="refresh"
  15. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  16. >
  17. <template #default>
  18. <view class="menu-list m0">
  19. <view class="list-cell" style="color: #666666; line-height: 25px" v-for="(base, index) in dataList" :key="index">
  20. <view class="content-area-top menu-item">
  21. <view class="content-area-top-time">
  22. {{ base.repairStatus == 1 ? (base.createTime ? base.createTime.replace("T", " ") : "") : base.handleTime ? base.handleTime.replace("T", " ") : "" }}
  23. </view>
  24. <view class="content-area-top-status" v-if="base.repairStatus == 1" style="background-color: #23dedc"> 受理中 </view>
  25. <view class="content-area-top-status" v-if="base.repairStatus == 2" style="background-color: #12c100"> 处理完成 </view>
  26. </view>
  27. <view class="content-area-row_wrap menu-item">
  28. <view class="content-area-row_wrap-view"> 项目名称:{{ base.projectName }} </view>
  29. <view class="content-area-row_wrap-view"> {{ jd ? "填报" : "报修" }}人:{{ base.reflectName }} </view>
  30. <view class="content-area-row_wrap-view"> {{ jd ? "填报" : "报修" }}人电话:{{ base.reflectPhone }} </view>
  31. <view class="content-area-row_wrap-view"> 报修内容:{{ base.repairContent }} </view>
  32. <view class="content-area-row_wrap-view"> 报修地址:{{ base.projectAddress }} </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. </oa-scroll>
  38. </template>
  39. <script setup>
  40. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll, onBackPress, onUnload } from "@dcloudio/uni-app";
  41. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  42. import { getToken, setToken, removeToken } from "@/utils/auth";
  43. import { useStores, commonStores } from "@/store/modules/index";
  44. import { getHistory } from "@/api/business/fireIot/repairReport.js";
  45. import config from "@/config";
  46. const { proxy } = getCurrentInstance();
  47. const useStore = useStores();
  48. const commonStore = commonStores();
  49. const jd = ref(config.baseUrl.indexOf("manager.juedatech.com") > -1) //觉大环境判断
  50. const dataList = ref([]);
  51. const dataStatus = ref(false);
  52. const pageSize = ref(20);
  53. const current = ref(1);
  54. const total = ref(0);
  55. const data = reactive({
  56. phone: getToken() ? useStore.phonenumber : undefined,
  57. verify: undefined,
  58. });
  59. const { phone, verify } = toRefs(data);
  60. /**
  61. * @页面初始化
  62. */
  63. function init() {
  64. getSelectListApi();
  65. }
  66. /**
  67. * @列表查询
  68. * @api接口查询
  69. */
  70. function getSelectListApi() {
  71. dataStatus.value = true;
  72. getHistory({
  73. size: pageSize.value,
  74. current: current.value,
  75. phone: phone.value,
  76. verify: verify.value,
  77. }).then((requset) => {
  78. if (requset.status === "SUCCESS") {
  79. dataList.value = requset.data.records;
  80. total.value = requset.data.total;
  81. }
  82. });
  83. }
  84. /**
  85. * @scrollView加载数据
  86. */
  87. function load() {
  88. pageSize.value += 10;
  89. init();
  90. }
  91. /**
  92. * @scrollView刷新数据
  93. */
  94. function refresh() {
  95. pageSize.value = 20;
  96. init();
  97. }
  98. onReady(() => {});
  99. onShow(() => {
  100. //调用系统主题颜色
  101. proxy.$settingStore.systemThemeColor([1]);
  102. });
  103. onLoad((options) => {
  104. if ("statusBool" in options && "phone" in options) {
  105. dataStatus.value = options.statusBool;
  106. phone.value = options.phone;
  107. }
  108. if (!getToken() && !dataStatus.value) {
  109. proxy.$tab.redirectTo(`/pages/common/phoneVerify/index?path=${"/pages/business/fireIot/repairReport/record"}`);
  110. } else {
  111. init();
  112. }
  113. if(jd.value){
  114. wx.setNavigationBarTitle({
  115. title: "历史记录"
  116. });
  117. }else{
  118. wx.setNavigationBarTitle({
  119. title: "报修历史"
  120. });
  121. }
  122. });
  123. </script>
  124. <style lang="scss" scoped>
  125. .repairReport-record-container {
  126. .content-area {
  127. &-top {
  128. font-size: 16px;
  129. font-weight: 600;
  130. color: #000000;
  131. &-time {
  132. max-width: 70%;
  133. margin: auto 0;
  134. font-size: 14px;
  135. color: rgb(102, 102, 102);
  136. }
  137. &-name {
  138. max-width: 70%;
  139. color: #000;
  140. }
  141. &-status {
  142. max-width: 30%;
  143. margin: auto 0 auto auto;
  144. font-size: 12px;
  145. color: #ffffff;
  146. padding: 0 5px;
  147. border-radius: 20px;
  148. line-height: 20px;
  149. }
  150. }
  151. &-row_wrap {
  152. font-size: 13px;
  153. flex-flow: row wrap;
  154. &-view {
  155. display: flex;
  156. min-width: 50%;
  157. > .iconfont {
  158. font-size: 14px;
  159. color: #909399;
  160. margin-left: 5px;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. </style>