toDoList.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view class="pagesCons">
  3. <!-- 自定义标题 -->
  4. <u-navbar title-color="#fff" back-icon-size="30" back-icon-color="#fff" :border-bottom="false" :background="background" id="navbar">
  5. <view class="slot-wrap">
  6. <view class="left-icon">待办单</view>
  7. <view class="right-icon" @click="intoAddPage">
  8. <u-icon name="plus-circle" color="#fff" size="32"></u-icon>新增
  9. </view>
  10. </view>
  11. </u-navbar>
  12. <view class="tab-body">
  13. <view>
  14. <u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
  15. swiperWidth="750"></u-tabs-swiper>
  16. </view>
  17. <view class="all-filter" v-show="current==2">
  18. <u-row>
  19. <text>发起时间</text>
  20. <view class="filter-icon">
  21. <u-icon name="arrow-up-fill" color="#888888" size="24"></u-icon>
  22. <u-icon name="arrow-down-fill" color="#2979ff" size="24"></u-icon>
  23. </view>
  24. </u-row>
  25. <u-row>
  26. <text>处理时间</text>
  27. <view class="filter-icon">
  28. <u-icon name="arrow-up-fill" color="#888888" size="24"></u-icon>
  29. <u-icon name="arrow-down-fill" color="#888888" size="24"></u-icon>
  30. </view>
  31. </u-row>
  32. <view @click="showSearch=true">
  33. <text>筛选</text>
  34. <u-icon name="shaixuan" custom-prefix="xd-icon" size="32" color="#888888"></u-icon>
  35. </view>
  36. </view>
  37. <swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
  38. <swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
  39. <scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
  40. <view
  41. class="check-order-list"
  42. v-if="index==current"
  43. v-for="(item,sindex) in list"
  44. :key="item.id"
  45. @click="viewRow(item)"
  46. >
  47. <view class="check-row">
  48. <view class="ellipsis-one">{{item.storeName}}</view>
  49. <view class="createDate">{{item.createDate}}</view>
  50. </view>
  51. <view class="check-row">
  52. <view class="ellipsis-one">
  53. {{item.clsName}}
  54. </view>
  55. <view class="text-right">
  56. <text>{{item.userName}}</text>
  57. </view>
  58. <view class="icon-xian" >
  59. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
  60. </view>
  61. </view>
  62. <view class="check-row">
  63. <view>
  64. {{item.sourceType}}
  65. </view>
  66. <view class="text-right">
  67. <text class="mark">
  68. 抄送
  69. </text>
  70. <view :class="['status',clsStatus(item.status)]">{{item.status}}</view>
  71. </view>
  72. </view>
  73. </view>
  74. <u-empty :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  75. <view v-if="index==current" style="padding: 20upx;">
  76. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  77. </view>
  78. </scroll-view>
  79. </swiper-item>
  80. </swiper>
  81. </view>
  82. <!-- 待办单查询弹框 -->
  83. <search-modal :visible="showSearch" @openPicke="openPicker" @refresh="refresh" @close="showSearch=false"></search-modal>
  84. </view>
  85. </template>
  86. <script>
  87. import { getBackLogList } from '@/api/backLog.js'
  88. import { getLookUpDatas, listLookUp } from '@/api/data'
  89. import searchModal from './searchModal.vue'
  90. export default {
  91. components: {
  92. searchModal
  93. },
  94. data() {
  95. return {
  96. showSearch: false, // 是否显示搜索弹框
  97. searchParams: null, // 查询数据参数
  98. status: 'loadmore',
  99. noDataText: '暂无数据',
  100. background: {
  101. // 渐变色
  102. backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
  103. },
  104. tabList: [
  105. {
  106. dispName: '发给我的',
  107. typeId: 3
  108. },
  109. {
  110. dispName: '我创建的',
  111. typeId: 1
  112. },
  113. {
  114. dispName: '全部',
  115. typeId: 2
  116. },
  117. ],
  118. current: 0,
  119. swiperCurrent: 0,
  120. pageNo: 1,
  121. pageSize: 10,
  122. list: [],
  123. total: 0,
  124. }
  125. },
  126. onLoad() {
  127. this.getRow()
  128. },
  129. methods:{
  130. // tabs通知swiper切换
  131. tabsChange(index) {
  132. this.swiperCurrent = index;
  133. this.resetPage()
  134. },
  135. swiperChange(event){
  136. this.list = [];
  137. this.status = 'loading'
  138. },
  139. // swiper-item左右移动,通知tabs的滑块跟随移动
  140. transition(e) {
  141. let dx = e.detail.dx;
  142. this.$refs.uTabs.setDx(dx);
  143. },
  144. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  145. // swiper滑动结束,分别设置tabs和swiper的状态
  146. animationfinish(e) {
  147. let current = e.detail.current;
  148. this.$refs.uTabs.setFinishCurrent(current);
  149. this.swiperCurrent = current;
  150. this.current = current;
  151. this.resetPage()
  152. },
  153. // scroll-view到底部加载更多
  154. onreachBottom() {
  155. console.log(this.list.length, this.total)
  156. if(this.list.length < this.total){
  157. this.pageNo += 1
  158. this.getRow()
  159. }else{
  160. this.status = "nomore"
  161. }
  162. },
  163. // 查询列表
  164. getRow (pageNo) {
  165. let _this = this
  166. if (pageNo) {
  167. this.pageNo = pageNo
  168. }
  169. let params = {
  170. pageNo: this.pageNo,
  171. pageSize: this.pageSize
  172. }
  173. this.status = "loading"
  174. getBackLogList(params).then(res => {
  175. if (res.code == 200 || res.status == 204 || res.status == 200) {
  176. if(_this.pageNo>1){
  177. _this.list = _this.list.concat(res.data.list || [])
  178. }else{
  179. _this.list = res.data.list || []
  180. }
  181. _this.total = res.data.count || 0
  182. } else {
  183. _this.list = []
  184. _this.total = 0
  185. _this.noDataText = res.message
  186. }
  187. _this.status = "loadmore"
  188. })
  189. },
  190. resetPage(){
  191. this.status = 'loading';
  192. this.list = [];
  193. this.getRow(1);
  194. },
  195. // 查询刷新
  196. refresh(params){
  197. console.log(params,'1111111111')
  198. this.searchParams = params
  199. this.getRow(1)
  200. },
  201. // 新增页
  202. intoAddPage() {
  203. uni.navigateTo({
  204. url: "/pages/toDoList/addBacklog"
  205. })
  206. },
  207. // 详细页
  208. viewRow(item){
  209. // 已完成的
  210. uni.navigateTo({
  211. url: "/pages/toDoList/backlogDetail?id="+item.id
  212. })
  213. },
  214. // 状态颜色处理
  215. clsStatus(status){
  216. if(status == '待审核'){
  217. return 'dsh'
  218. }
  219. if(status == '待整改'){
  220. return 'dzg'
  221. }
  222. if(status == '整改完成'){
  223. return 'ywc'
  224. }
  225. if(status == '已过期'){
  226. return 'ygq'
  227. }
  228. }
  229. }
  230. }
  231. </script>
  232. <style lang="scss" scoped>
  233. page{
  234. height: 100%;
  235. }
  236. /* 自定义导航栏样式 */
  237. .slot-wrap {
  238. display: flex;
  239. align-items: center;
  240. /* 如果您想让slot内容占满整个导航栏的宽度 */
  241. flex: 1;
  242. /* 如果您想让slot内容与导航栏左右有空隙 */
  243. padding: 0 30rpx 0 0;
  244. color: #fff;
  245. font-size: 28upx;
  246. .left-icon{
  247. flex-grow: 1;
  248. font-size: 32upx;
  249. }
  250. .right-icon{
  251. padding-left:50upx;
  252. }
  253. .uni-icons{
  254. margin-right: 10upx;
  255. }
  256. }
  257. .text-right {
  258. text-align: right;
  259. }
  260. .pagesCons{
  261. height: 100%;
  262. display: flex;
  263. flex-direction: column;
  264. .tab-body{
  265. flex: 1;
  266. display: flex;
  267. flex-direction: column;
  268. .check-list{
  269. flex: 1;
  270. overflow-y: scroll;
  271. .swiper-item{
  272. width: 100%;
  273. height: 100%;
  274. overflow: hidden;
  275. .scroll-view {
  276. width: 100%;
  277. height: 100%;
  278. overflow: auto;
  279. }
  280. }
  281. }
  282. // 全部筛选
  283. .all-filter{
  284. width: 100%;
  285. height: 100upx;
  286. display: flex;
  287. align-items: center;
  288. justify-content: space-around;
  289. box-shadow: 1px 1px 3px #EEEEEE;
  290. .filter-icon{
  291. display: flex;
  292. flex-direction: column;
  293. margin-left: 10upx;
  294. }
  295. }
  296. // 列表样式
  297. .check-order-list{
  298. background: #ffffff;
  299. padding: 10upx 20upx;
  300. margin: 25upx;
  301. border-radius: 6upx;
  302. box-shadow: 1px 1px 3px #EEEEEE;
  303. .check-row{
  304. display: flex;
  305. align-items: center;
  306. padding: 20upx 10upx;
  307. font-size: 28upx;
  308. .icon-xian{
  309. text-align: right;
  310. width: 40upx;
  311. }
  312. &:first-child{
  313. border-bottom: 1px dashed #F8F8F8;
  314. .createDate{
  315. // color: #666;
  316. font-size: 26upx;
  317. margin-left: 10upx;
  318. }
  319. }
  320. &:last-child{
  321. border-top: 1px dashed #F8F8F8;
  322. }
  323. > view{
  324. &:first-child{
  325. flex: 1;
  326. }
  327. }
  328. // 抄送标记
  329. .mark {
  330. color: #00C1DE;
  331. padding: 6upx;
  332. font-size: 24upx;
  333. border: 1px solid #00C1DE;
  334. border-radius: 6upx;
  335. margin-right: 10upx;
  336. }
  337. // 状态
  338. .status {
  339. display: inline-block;
  340. width: 150upx;
  341. }
  342. .dsh{
  343. color: red;
  344. }
  345. .dzg{
  346. color: #007AFF;
  347. }
  348. .ygq {
  349. color: #999;
  350. }
  351. .ywc {
  352. color: #10c71e;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. </style>