complaintList.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <view class="content">
  3. <view class="top-fixed">
  4. <!-- 事项列表 -->
  5. <view class="filter">
  6. <view :class="isShow==false?'time-box':'time-box active'" @tap="openCalendar()">
  7. <view class="title">选择日期</view>
  8. <image :src="isShow==false?'/static/images/company/time_arrow_icon.png':'/static/images/company/time_arrow_blue_icon.png'" class="w24 h24"></image>
  9. </view>
  10. <!-- <view class="list-box">
  11. <image src="/static/images/company/list_matters_icon.png" class="w32 h32"></image>
  12. <view class="title">事项列表</view>
  13. </view> -->
  14. </view>
  15. </view>
  16. <u-popup :show="isShow" mode="top" :round="12" customStyle="top: 110rpx;" @close="close">
  17. <view class="calendar-box">
  18. <pushangyuqi-calendar @onDayClick="onDayClick"></pushangyuqi-calendar>
  19. </view>
  20. </u-popup>
  21. <mescroll-body top="110upx" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  22. <view class="sms-list">
  23. <view v-for="(item,index) in dataList" :key="index" class="item" @click="showDetail(item)">
  24. <view class="justify-between align-center">
  25. <view class="title">{{item.categoryName}}</view>
  26. <view class="state" :style="{'color':item.status==1?'#FF5030':item.status==2?'#FDBD27':'#2CAE5C'}">
  27. {{item.status==1?'待处理':item.status==2?'处理中':item.status==3?'已完成':'已关闭'}}</view>
  28. </view>
  29. <view class="personnel">
  30. {{utils.timeFormat(item.createTime,'yyyy-mm-dd hh:MM:ss')}}
  31. </view>
  32. </view>
  33. </view>
  34. <view class="h20"></view>
  35. </mescroll-body>
  36. </view>
  37. </template>
  38. <script>
  39. import pushangyuqiCalendar from '../components/pushangyuqi-calendar/pushangyuqi-calendar.vue'
  40. import {
  41. getComplaintList
  42. } from '@/api/companyUser.js'
  43. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  44. export default {
  45. mixins: [MescrollMixin],
  46. components:{
  47. pushangyuqiCalendar
  48. },
  49. data() {
  50. return {
  51. taskType: [{
  52. name: "全部",
  53. val: null
  54. },
  55. {
  56. name: "固定任务",
  57. val: 0
  58. },
  59. {
  60. name: "工作计划",
  61. val: 1
  62. },
  63. ],
  64. isShow:false,
  65. showType: null,
  66. mescroll: null,
  67. // 上拉加载的配置
  68. upOption: {
  69. onScroll: true,
  70. use: true, // 是否启用上拉加载; 默认true
  71. page: {
  72. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  73. size: 10 // 每页数据的数量,默认10
  74. },
  75. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  76. empty: {
  77. icon: 'https://user.test.ylrztop.com/images/empty_icon.png',
  78. tip: '暂无数据'
  79. }
  80. },
  81. dataList: [],
  82. }
  83. },
  84. onLoad(opt) {
  85. if(opt.type!==null){
  86. this.showType=opt.type
  87. }
  88. uni.$on('refreshComplaintList', () => {
  89. this.mescroll.resetUpScroll()
  90. })
  91. },
  92. methods: {
  93. //时间筛选
  94. openCalendar(){
  95. this.isShow=!this.isShow
  96. },
  97. close(){
  98. this.isShow=false
  99. },
  100. //日历
  101. onDayClick(data){
  102. this.curDate = data;
  103. this.isShow = false
  104. this.mescroll.resetUpScroll()
  105. },
  106. navgetTo(index) {
  107. uni.navigateTo({
  108. url: index == 0 ? '/pages_health/addServe' : '/pages_health/addCompetitors'
  109. })
  110. },
  111. // tab切换
  112. orderStatusChange(item) {
  113. this.showType = item.val
  114. this.mescroll.resetUpScroll()
  115. },
  116. mescrollInit(mescroll) {
  117. this.mescroll = mescroll;
  118. },
  119. /*下拉刷新的回调 */
  120. downCallback(mescroll) {
  121. mescroll.resetUpScroll()
  122. },
  123. upCallback(page) {
  124. //联网加载数据
  125. var that = this;
  126. var data = {
  127. startTime: this.curDate,
  128. pageNum: page.num,
  129. pageSize: page.size
  130. };
  131. getComplaintList(data).then(res => {
  132. if(res.code==200){
  133. //设置列表数据
  134. if (page.num == 1) {
  135. that.dataList = res.data;
  136. } else {
  137. that.dataList = that.dataList.concat(res.data);
  138. }
  139. that.mescroll.endBySize(res.data.length, res.data.total);
  140. }else{
  141. uni.showToast({
  142. icon:'none',
  143. title: "请求失败",
  144. });
  145. that.dataList = null;
  146. that.mescroll.endErr();
  147. }
  148. });
  149. },
  150. showDetail(item) {
  151. // if (item.orderType == 1) {
  152. uni.navigateTo({
  153. url: '/pages_company/complaintDetail?type=edit&id=' + item.id
  154. })
  155. // }
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss">
  161. page{
  162. background-color:#EFF3F7;
  163. background: #EFF3F7;
  164. }
  165. .calendar-box{
  166. padding:0 30rpx;
  167. }
  168. .content {
  169. padding: 20upx;
  170. .top-fixed {
  171. width: 100%;
  172. position: fixed;
  173. top: 0;
  174. left: 0;
  175. z-index:10076;
  176. }
  177. .top-fixed2 {
  178. width: 100%;
  179. position: fixed;
  180. top: 110rpx;
  181. left: 0;
  182. z-index: 10;
  183. }
  184. .filter{
  185. background: #FFFFFF;
  186. padding: 20rpx;
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-between;
  190. .time-box{
  191. display: flex;
  192. align-items: center;
  193. padding:16rpx 48rpx;
  194. background: #F5F7FA;
  195. border-radius: 32rpx 32rpx 32rpx 32rpx;
  196. .title{
  197. font-family: PingFang SC;
  198. font-weight: 400;
  199. font-size: 28rpx;
  200. color: #626468;
  201. text-align: center;
  202. padding-right: 20rpx;
  203. }
  204. &.active{
  205. background: #F0FAFF;
  206. .title{
  207. color:#008FD3
  208. }
  209. }
  210. }
  211. .list-box{
  212. display: flex;
  213. align-items: center;
  214. .title{
  215. font-family: PingFang SC;
  216. font-weight: 400;
  217. font-size: 28rpx;
  218. color: #222426;
  219. text-align: center;
  220. padding-left: 16rpx;
  221. }
  222. }
  223. }
  224. .pub-tab-box {
  225. box-sizing: border-box;
  226. width: 100%;
  227. padding: 0 20upx;
  228. background-color: #EFF3F7;
  229. .tab-inner {
  230. height: 110upx;
  231. line-height: 110upx;
  232. display: flex;
  233. align-items: center;
  234. // justify-content: space-between;
  235. overflow-x: auto;
  236. }
  237. .item {
  238. // flex: 1;
  239. font-size: 28upx;
  240. white-space: nowrap;
  241. line-height: 1;
  242. font-family: PingFang SC;
  243. font-weight: 400;
  244. color: #222426;
  245. margin-right: 16upx;
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. background: #FFFFFF;
  250. border-radius: 36rpx 36rpx 36rpx 36rpx;
  251. padding:16rpx 48rpx;
  252. &:last-child {
  253. margin-right: 0;
  254. }
  255. &.active {
  256. font-weight: bold;
  257. color: #fff;
  258. background: linear-gradient(120deg, #31A1FE 0%, #008FD3 100%);
  259. }
  260. .text {
  261. position: relative;
  262. z-index: 1;
  263. }
  264. .tab-bg {
  265. width: 72upx;
  266. height: 28upx;
  267. position: absolute;
  268. top: 17upx;
  269. left: 50%;
  270. transform: translateX(-36upx);
  271. z-index: -1;
  272. }
  273. }
  274. }
  275. .btn-box2 {
  276. z-index: 9999;
  277. width: 100%;
  278. padding: 30upx;
  279. position: fixed;
  280. bottom: 0;
  281. left: 0;
  282. box-sizing: border-box;
  283. // background: #FFFFFF;
  284. .sub-btn {
  285. width: 100%;
  286. height: 88upx;
  287. line-height: 88upx;
  288. text-align: center;
  289. font-size: 30upx;
  290. font-family: PingFang SC;
  291. font-weight: bold;
  292. color: #FFFFFF;
  293. background: #008FD3;
  294. border-radius: 44upx;
  295. display: flex;
  296. align-items: center;
  297. justify-content: center;
  298. image {
  299. margin-right: 16rpx;
  300. }
  301. }
  302. }
  303. .sms-list {
  304. .item {
  305. padding: 30rpx;
  306. background: #FFFFFF;
  307. border-radius: 16rpx 16rpx 16rpx 16rpx;
  308. margin-bottom: 20rpx;
  309. .title {
  310. font-family: PingFang SC;
  311. font-weight: 500;
  312. font-size: 32rpx;
  313. color: #222426;
  314. text-align: left;
  315. }
  316. .title {
  317. font-family: PingFang SC;
  318. font-weight: 500;
  319. font-size: 32rpx;
  320. color: #222426;
  321. text-align: left;
  322. }
  323. .state {
  324. font-family: PingFang SC;
  325. font-weight: 400;
  326. font-size: 26rpx;
  327. text-align: right;
  328. }
  329. .personnel {
  330. font-family: PingFang SC;
  331. font-weight: 400;
  332. font-size: 28rpx;
  333. color: #898E91;
  334. text-align: left;
  335. margin-top: 16rpx;
  336. }
  337. }
  338. }
  339. }
  340. </style>