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