index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <view class="collector">
  3. <u-navbar ref="uNavbar" :border-bottom="false" :title-width="340" :back-icon-color="setNav.backColor" :is-back="setNav.isdisPlayNavTitle"
  4. :title-size="setNav.size" :title-bold="setNav.bold" :title="setNav.navTitle" :title-color="setNav.color" :background="setNav"></u-navbar>
  5. <view class="topNav" :style="{top: topNav + 'px'}">
  6. <view class="item">
  7. <view class="text" :class="yidu == 0?'active':''" @click="onNav(0)">全部</view>
  8. </view>
  9. <view class="item">
  10. <view class="text" :class="yidu == 1?'active':''" @click="onNav(1)">已读</view>
  11. </view>
  12. <view class="item">
  13. <view class="text" :class="yidu == 2?'active':''" @click="onNav(2)">未读</view>
  14. </view>
  15. </view>
  16. <view class="title">
  17. 已发文给 <text>{{totals}}人</text>;其中有 <text>{{read}}人</text> 已读; <text>{{notRead}}人</text> 未读
  18. </view>
  19. <view class="table">
  20. <view class="thead">
  21. <view class="tr">
  22. <view class="th">收文员</view>
  23. <view class="th">单位</view>
  24. <view class="th">发文时间</view>
  25. <view class="th">收文时间</view>
  26. <view class="th">状态</view>
  27. </view>
  28. </view>
  29. <view class="tbody" v-if="data.length">
  30. <view class="tr" v-for="(item, index) in data" :key="index">
  31. <view class="td">
  32. {{item.receive_user_name}}
  33. </view>
  34. <view class="td">
  35. {{item.receive_dept_name}}
  36. </view>
  37. <view class="td">
  38. {{item.send_message_time}}
  39. </view>
  40. <view class="td">
  41. {{item.receive_time == null ? '未结束' : item.receive_time}}
  42. </view>
  43. <view :class="[item.status != '未读' ? 'yes' : 'no', 'td']">
  44. {{item.status}}
  45. </view>
  46. </view>
  47. </view>
  48. <view class="no-data" v-else>暂无数据</view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. checked: false,
  57. topNav: 0,
  58. yidu: 0,
  59. setNav: {
  60. backgroundColor: '#fff', //背景色
  61. color: '#333', //字体颜色
  62. bold: true,
  63. size: '36',
  64. backColor: '#333',
  65. isdisPlayNavTitle: true, //是否显示返回按钮
  66. navTitle: '查看进度' //导航标题
  67. },
  68. data: [],
  69. id: '',
  70. name: '',
  71. pageNo: 1,
  72. total: 0,
  73. "totals": 0,
  74. "notRead": 0,
  75. "read": 0
  76. }
  77. },
  78. onReachBottom() {
  79. if (this.data.length >= this.total) {
  80. return
  81. }
  82. this.pageNo += 1
  83. this.statistic()
  84. },
  85. onLoad(options) {
  86. this.id = options.id
  87. this.name = options.name
  88. this.statistic()
  89. this.init()
  90. setTimeout(() => {
  91. this.topNav = (this.$refs.uNavbar.navbarHeight) + (this.$refs.uNavbar.statusBarHeight)
  92. }, 10)
  93. },
  94. methods: {
  95. onNav(val) {
  96. this.yidu = val
  97. this.pageNo = 1
  98. this.statistic()
  99. },
  100. checkboxChange: function(e) {
  101. var items = this.data,
  102. values = e.detail.value;
  103. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  104. const item = items[i]
  105. if (values.includes(item.value)) {
  106. this.$set(item, 'checked', true)
  107. } else {
  108. this.$set(item, 'checked', false)
  109. }
  110. }
  111. },
  112. async statistic() {
  113. //
  114. let res = await this.$u.post('boman-web-core/p/cs/queryList', {
  115. "table": "boman_message_receive",
  116. "pageNo": this.pageNo,
  117. "isUi": false,
  118. "pageSize": 20,
  119. "orderBy": "status desc",
  120. "fixedData": {
  121. "condition": {
  122. "visible": "Y",
  123. "message_id": this.id,
  124. "status": this.yidu == 0 ? '' : this.yidu == 1 ? 'Y' : 'N',
  125. "is_del":"N"
  126. }
  127. }
  128. })
  129. if (res.data && res.data.rows) {
  130. if (this.pageNo == 1) {
  131. this.data = res.data.rows
  132. this.total = res.data.total
  133. } else {
  134. this.data = this.data.concat(res.data.rows)
  135. }
  136. }
  137. },
  138. async init() {
  139. //
  140. let res = await this.$u.get('boman-web-core/messageReceive/recieve/statistic/'+ this.id)
  141. if (res.code == 200) {
  142. this.totals = res.data.total
  143. this.notRead = res.data.notRead
  144. this.read = res.data.read
  145. }
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. .collector {
  152. width: 100%;
  153. height: 100%;
  154. background: #fff;
  155. .topNav{
  156. display: flex;
  157. align-items: center;
  158. background: #FFFFFF;
  159. height: 90rpx;
  160. box-shadow: 0px 14rpx 10rpx 0px rgba(218, 218, 218, 0.35);
  161. position: sticky;
  162. width: 100%;
  163. left: 0;
  164. z-index: 9;
  165. .item{
  166. flex: 1;
  167. display: flex;
  168. align-items: center;
  169. justify-content: center;
  170. .text{
  171. font-size: 26rpx;
  172. color: #191919;
  173. font-weight: 600;
  174. }
  175. .active{
  176. position: relative;
  177. &::after{
  178. content: '';
  179. position: absolute;
  180. width: 28rpx;
  181. height: 6rpx;
  182. background: #009FE8;
  183. border-radius: 6rpx;
  184. bottom: -14rpx;
  185. left: 50%;
  186. transform: translate(-50%,0);
  187. }
  188. }
  189. }
  190. }
  191. /deep/ .u-navbar-inner {
  192. box-shadow: none;
  193. }
  194. .title {
  195. height: 56rpx;
  196. background: #FFFFFF;
  197. line-height: 56rpx;
  198. font-size: 24rpx;
  199. color: #343434;
  200. padding-left: 32rpx;
  201. margin-top: 30rpx;
  202. text {
  203. color: #FF3131;
  204. margin: 0 6rpx;
  205. &:nth-child(1) {
  206. color: #009FE8;
  207. }
  208. &:nth-child(2) {
  209. color: #54BA10;
  210. }
  211. }
  212. }
  213. .btns {
  214. position: fixed;
  215. bottom: 0;
  216. height: 84rpx;
  217. display: flex;
  218. width: 100%;
  219. border-top: 1px solid #E5E5E5;
  220. /deep/ .left {
  221. width: 190rpx;
  222. background: #FFFFFF;
  223. text-align: center;
  224. font-size: 28rpx;
  225. font-weight: 500;
  226. color: #343434;
  227. line-height: 84rpx;
  228. uni-checkbox {
  229. margin-right: 20rpx;
  230. }
  231. }
  232. .right {
  233. flex: 1;
  234. background: #009FE8;
  235. color: #fff;
  236. text-align: center;
  237. line-height: 84rpx;
  238. }
  239. }
  240. .table {
  241. .tr {
  242. display: flex;
  243. .th,
  244. .td {
  245. flex: 1;
  246. text-align: center;
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. max-width: 20%;
  251. }
  252. .td {
  253. padding: 20rpx 0;
  254. font-size: 20rpx;
  255. color: #333333;
  256. border-bottom: 1px solid #E5E5E5;
  257. }
  258. .yes {
  259. color: #54BA10;
  260. }
  261. .no {
  262. color: #FF0000;
  263. }
  264. }
  265. .thead {
  266. padding: 33rpx 0;
  267. font-size: 24rpx;
  268. font-weight: bold;
  269. color: #333333;
  270. }
  271. }
  272. /deep/ .check-td,
  273. .check-th {
  274. max-width: 8%;
  275. .uni-checkbox-input {
  276. margin: 0 auto;
  277. width: 0rpx;
  278. height: 0rpx;
  279. padding: 12rpx;
  280. &.uni-checkbox-input-checked {
  281. background-color: #009FE8;
  282. border: 1px solid #009FE8;
  283. }
  284. &.uni-checkbox-input-checked:before {
  285. font-size: 20rpx;
  286. }
  287. }
  288. }
  289. }
  290. </style>