log.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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"> {{ parseTime(v.followDate,'{y}-{m}-{d}') }}</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. if (v.followDesc) {
  105. this.showModal = true
  106. this.content = v.followDesc
  107. }
  108. },
  109. searchList() {
  110. this.pageNum = 0
  111. this.getSuperviseData(true)
  112. },
  113. async getSuperviseData(reset) {
  114. this.loadStatus = 'loading'
  115. this.pageNum++
  116. let params = {
  117. IsMyself: '1',
  118. pageNum: this.pageNum,
  119. pageSize: this.pageSize,
  120. }
  121. const [err, res] = await to(followApi.followList(params))
  122. if (err) {
  123. this.loadStatus = 'nomore'
  124. return
  125. }
  126. if (res && res.code == 200) {
  127. if (reset) {
  128. this.followList = res.data.list || []
  129. } else {
  130. this.followList = [...this.followList, ...(res.data.list || [])]
  131. }
  132. this.followTotal = res.data.total
  133. this.loadStatus = this.followList.length == this.followTotal ? 'nomore' : 'loadmore'
  134. } else {
  135. this.loadStatus = 'nomore'
  136. }
  137. },
  138. // 改变tab
  139. changeTabs(data) {
  140. this.curTabIndex = data.status
  141. this.searchList(true)
  142. },
  143. setFollowStatus(status) {
  144. let statusObj = {
  145. 10: '待接收',
  146. 20: '进行中',
  147. 30: '已完成',
  148. }
  149. return statusObj[status]
  150. },
  151. },
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .supervise-main {
  156. height: 100%;
  157. .data-scroll-wrap {
  158. height: calc(100vh - 282rpx);
  159. padding: 30rpx 0;
  160. .data-list {
  161. width: 100%;
  162. height: 100%;
  163. background: #ffffff;
  164. overflow: auto;
  165. .todo-item {
  166. padding: 12rpx 40rpx 12rpx 46rpx;
  167. background: #f2f3f5;
  168. border-radius: 15rpx;
  169. margin-bottom: 32rpx;
  170. .tit-txt {
  171. font-size: 28rpx;
  172. font-weight: bold;
  173. color: #323232;
  174. }
  175. .content-txt {
  176. font-size: 28rpx;
  177. color: #646464;
  178. }
  179. .user-txt {
  180. font-size: 20rpx;
  181. color: #646464;
  182. }
  183. .header {
  184. .todo-img {
  185. flex: 0 0 24rpx;
  186. height: 24rpx;
  187. margin-right: 12rpx;
  188. }
  189. .do-status {
  190. width: 70rpx;
  191. height: 30rpx;
  192. border-radius: 0rpx 15rpx 0rpx 0rpx;
  193. text-align: center;
  194. line-height: 30rpx;
  195. font-size: 18rpx;
  196. }
  197. }
  198. .content {
  199. padding: 12rpx 0 12rpx 40rpx;
  200. font-size: 28rpx;
  201. color: #646464;
  202. }
  203. .content-footer {
  204. padding: 0 0 12rpx 40rpx;
  205. .date {
  206. font-size: 24rpx;
  207. color: #969696;
  208. }
  209. .user-img {
  210. width: 46rpx;
  211. height: 46rpx;
  212. border-radius: 50%;
  213. margin-right: 15rpx;
  214. }
  215. }
  216. }
  217. .status10 {
  218. color: #4096fb;
  219. background: rgba(64, 150, 251, 0.2);
  220. }
  221. .status20 {
  222. background: rgba(255, 184, 60, 0.2);
  223. color: #ffb83c;
  224. }
  225. .status30 {
  226. color: #fe6936;
  227. background: rgba(254, 105, 54, 0.2);
  228. }
  229. }
  230. }
  231. }
  232. </style>