log.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-16 14:35:18
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-02-16 16:44:27
  6. * @Description: file content
  7. * @FilePath: \oms\pages\schedule\components\supervise.vue
  8. -->
  9. <template>
  10. <view class="supervise-main">
  11. <!-- <u-tabs
  12. :list="list"
  13. @change="changeTabs"
  14. :current="curTabIndex - 1"
  15. :scrollable="false"
  16. :activeStyle="{
  17. color: '#323232',
  18. fontWeight: 'bold',
  19. }"
  20. :inactiveStyle="{
  21. color: '#969696',
  22. }"></u-tabs> -->
  23. <!-- 列表 -->
  24. <view class="data-scroll-wrap">
  25. <u-empty mode="list" text="暂无督办数据" v-if="followList.length == 0"></u-empty>
  26. <scroll-view v-else class="data-list" :scroll-top="scrollTop" :scroll-y="true" @scrolltolower="lower">
  27. <view class="todo-item" v-for="(v, i) in followList" :key="i" @click="showDesc(v)">
  28. <u-row>
  29. <u-col span="12">
  30. <view class="header">
  31. <!-- <u-row>
  32. <u-col span="12">
  33. <view class="flex_l">
  34. <image class="todo-img" src="../../../static/images/todo-img.png" mode="scaleToFill" />
  35. <text class="tit-txt flex_1">
  36. {{ v.followTitle }}
  37. </text>
  38. <view class="do-status" :class="'status' + v.followStatus">
  39. {{ setFollowStatus(v.followStatus) }}
  40. </view>
  41. </view>
  42. </u-col>
  43. </u-row> -->
  44. <view class="content flex">
  45. <text class="content-txt">
  46. {{ v.followContent }}
  47. </text>
  48. </view>
  49. <view class="content-footer flex1">
  50. <text class="date">2022-12-15</text>
  51. </view>
  52. </view>
  53. </u-col>
  54. </u-row>
  55. </view>
  56. <u-loadmore :status="loadStatus" />
  57. </scroll-view>
  58. </view>
  59. <u-modal :show="showModal" :content="content" @confirm="showModal = false"></u-modal>
  60. </view>
  61. </template>
  62. <script>
  63. import followApi from '../../../api/follow'
  64. import to from 'await-to-js'
  65. export default {
  66. name: 'omsTodo',
  67. data() {
  68. return {
  69. curTabIndex: 1, //tabs状态
  70. loadStatus: '', //加载状态
  71. list: [
  72. {
  73. name: '我的待办',
  74. status: 1,
  75. },
  76. {
  77. name: '我发起的',
  78. status: 2,
  79. },
  80. {
  81. name: '我处理的',
  82. status: 3,
  83. },
  84. ],
  85. pageNum: 0,
  86. pageSize: 10,
  87. followList: [], //日志列表
  88. followTotal: 0, //列表元素数量
  89. showModal: false,
  90. content: '', //modal内容
  91. }
  92. },
  93. mounted() {
  94. this.getSuperviseData()
  95. },
  96. methods: {
  97. // 上拉滚动
  98. lower() {
  99. if (this.followList.length < this.followTotal && this.loadStatus != 'loading') {
  100. this.$u.throttle(this.getSuperviseData(), 2000, false)
  101. }
  102. },
  103. showDesc(v) {
  104. console.log(v.followDesc)
  105. if (v.followDesc) {
  106. this.showModal = true
  107. this.content = v.followDesc
  108. }
  109. },
  110. searchList() {
  111. this.pageNum = 0
  112. this.getSuperviseData(true)
  113. },
  114. async getSuperviseData(reset) {
  115. this.loadStatus = 'loading'
  116. this.pageNum++
  117. let params = {
  118. IsMyself: '1',
  119. pageNum: this.pageNum,
  120. pageSize: this.pageSize,
  121. }
  122. const [err, res] = await to(followApi.followList(params))
  123. if (err) {
  124. this.loadStatus = 'nomore'
  125. return
  126. }
  127. if (res && res.code == 200) {
  128. if (reset) {
  129. this.followList = res.data.list || []
  130. } else {
  131. this.followList = [...this.followList, ...(res.data.list || [])]
  132. }
  133. this.followTotal = res.data.total
  134. this.loadStatus = this.followList.length == this.followTotal ? 'nomore' : 'loadmore'
  135. console.log(this.loadStatus)
  136. } else {
  137. this.loadStatus = 'nomore'
  138. }
  139. },
  140. // 改变tab
  141. changeTabs(data) {
  142. console.log(data)
  143. this.curTabIndex = data.status
  144. this.searchList(true)
  145. },
  146. setFollowStatus(status) {
  147. let statusObj = {
  148. 10: '待接收',
  149. 20: '进行中',
  150. 30: '已完成',
  151. }
  152. return statusObj[status]
  153. },
  154. },
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .supervise-main {
  159. height: 100%;
  160. .data-scroll-wrap {
  161. height: calc(100vh - 282rpx);
  162. padding: 30rpx 0;
  163. .data-list {
  164. width: 100%;
  165. height: 100%;
  166. background: #ffffff;
  167. overflow: auto;
  168. .todo-item {
  169. padding: 12rpx 40rpx 12rpx 46rpx;
  170. background: #f2f3f5;
  171. border-radius: 15rpx;
  172. margin-bottom: 32rpx;
  173. .tit-txt {
  174. font-size: 28rpx;
  175. font-weight: bold;
  176. color: #323232;
  177. }
  178. .content-txt {
  179. font-size: 28rpx;
  180. color: #646464;
  181. }
  182. .user-txt {
  183. font-size: 20rpx;
  184. color: #646464;
  185. }
  186. .header {
  187. .todo-img {
  188. flex: 0 0 24rpx;
  189. height: 24rpx;
  190. margin-right: 12rpx;
  191. }
  192. .do-status {
  193. width: 70rpx;
  194. height: 30rpx;
  195. border-radius: 0rpx 15rpx 0rpx 0rpx;
  196. text-align: center;
  197. line-height: 30rpx;
  198. font-size: 18rpx;
  199. }
  200. }
  201. .content {
  202. padding: 12rpx 0 12rpx 40rpx;
  203. font-size: 28rpx;
  204. color: #646464;
  205. }
  206. .content-footer {
  207. padding: 0 0 12rpx 40rpx;
  208. .date {
  209. font-size: 24rpx;
  210. color: #969696;
  211. }
  212. .user-img {
  213. width: 46rpx;
  214. height: 46rpx;
  215. border-radius: 50%;
  216. margin-right: 15rpx;
  217. }
  218. }
  219. }
  220. .status10 {
  221. color: #4096fb;
  222. background: rgba(64, 150, 251, 0.2);
  223. }
  224. .status20 {
  225. background: rgba(255, 184, 60, 0.2);
  226. color: #ffb83c;
  227. }
  228. .status30 {
  229. color: #fe6936;
  230. background: rgba(254, 105, 54, 0.2);
  231. }
  232. }
  233. }
  234. }
  235. </style>