toDoList.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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-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. // tabs通知swiper切换
  158. tabsChange(index) {
  159. this.swiperCurrent = index;
  160. this.list = []
  161. },
  162. swiperChange(event){
  163. console.log(event.detail)
  164. this.list = []
  165. },
  166. // swiper-item左右移动,通知tabs的滑块跟随移动
  167. transition(e) {
  168. let dx = e.detail.dx;
  169. this.$refs.uTabs.setDx(dx);
  170. },
  171. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  172. // swiper滑动结束,分别设置tabs和swiper的状态
  173. animationfinish(e) {
  174. let current = e.detail.current;
  175. if(current != this.current){
  176. this.$refs.uTabs.setFinishCurrent(current);
  177. this.swiperCurrent = current;
  178. this.current = current;
  179. this.getRow()
  180. }
  181. },
  182. // scroll-view到底部加载更多
  183. onreachBottom() {
  184. console.log(this.list.length, this.total)
  185. if(this.list.length < this.total){
  186. this.pageNo += 1
  187. this.getRow()
  188. }else{
  189. this.status = "nomore"
  190. }
  191. },
  192. // 查询列表
  193. getRow (pageNo) {
  194. let _this = this
  195. if (pageNo) {
  196. this.pageNo = pageNo
  197. }
  198. let params = {
  199. pageNo: this.pageNo,
  200. pageSize: this.pageSize
  201. }
  202. this.status = "loading"
  203. getBackLogList(params).then(res => {
  204. if (res.code == 200 || res.status == 204 || res.status == 200) {
  205. if(_this.pageNo>1){
  206. _this.list = _this.list.concat(res.data.list || [])
  207. }else{
  208. _this.list = res.data.list || []
  209. }
  210. _this.total = res.data.count || 0
  211. } else {
  212. _this.list = []
  213. _this.total = 0
  214. _this.noDataText = res.message
  215. }
  216. _this.status = "loadmore"
  217. })
  218. },
  219. // 查询刷新
  220. refresh(params){
  221. console.log(params,'1111111111')
  222. this.searchParams = params
  223. this.getRow(1)
  224. },
  225. // 新增页
  226. intoAddPage() {
  227. uni.navigateTo({
  228. url: "/pages/toDoList/addBacklog"
  229. })
  230. },
  231. // 详细页
  232. viewRow(item){
  233. // 已完成的
  234. uni.navigateTo({
  235. url: "/pages/toDoList/backlogDetail?id="+item.id
  236. })
  237. },
  238. }
  239. }
  240. </script>
  241. <style lang="scss" scoped>
  242. page{
  243. height: 100%;
  244. }
  245. /* 自定义导航栏样式 */
  246. .slot-wrap {
  247. display: flex;
  248. align-items: center;
  249. /* 如果您想让slot内容占满整个导航栏的宽度 */
  250. flex: 1;
  251. /* 如果您想让slot内容与导航栏左右有空隙 */
  252. padding: 0 30rpx 0 0;
  253. color: #fff;
  254. font-size: 28upx;
  255. .left-icon{
  256. flex-grow: 1;
  257. font-size: 32upx;
  258. }
  259. .right-icon{
  260. padding-left:50upx;
  261. }
  262. .uni-icons{
  263. margin-right: 10upx;
  264. }
  265. }
  266. .text-right {
  267. text-align: right;
  268. }
  269. .pagesCons{
  270. height: 100%;
  271. display: flex;
  272. flex-direction: column;
  273. .tab-body{
  274. flex: 1;
  275. display: flex;
  276. flex-direction: column;
  277. .check-list{
  278. flex: 1;
  279. overflow-y: scroll;
  280. .swiper-item{
  281. width: 100%;
  282. height: 100%;
  283. overflow: hidden;
  284. .scroll-view {
  285. width: 100%;
  286. height: 100%;
  287. overflow: auto;
  288. }
  289. }
  290. }
  291. // 全部筛选
  292. .all-filter{
  293. width: 100%;
  294. height: 100upx;
  295. display: flex;
  296. align-items: center;
  297. justify-content: space-around;
  298. box-shadow: 1px 1px 3px #EEEEEE;
  299. .filter-icon{
  300. display: flex;
  301. flex-direction: column;
  302. margin-left: 10upx;
  303. }
  304. }
  305. // 列表样式
  306. .check-order-list{
  307. background: #ffffff;
  308. padding: 10upx 20upx;
  309. margin: 25upx;
  310. border-radius: 6upx;
  311. box-shadow: 1px 1px 3px #EEEEEE;
  312. .check-row{
  313. display: flex;
  314. align-items: center;
  315. padding: 20upx 10upx;
  316. font-size: 28upx;
  317. .icon-xian{
  318. text-align: right;
  319. width: 40upx;
  320. }
  321. &:first-child{
  322. border-bottom: 1px dashed #F8F8F8;
  323. .createDate{
  324. // color: #666;
  325. font-size: 26upx;
  326. margin-left: 10upx;
  327. }
  328. }
  329. &:last-child{
  330. border-top: 1px dashed #F8F8F8;
  331. }
  332. > view{
  333. &:first-child{
  334. flex: 1;
  335. }
  336. }
  337. // 抄送标记
  338. .mark {
  339. color: #00C1DE;
  340. padding: 6upx;
  341. font-size: 24upx;
  342. border: 1px solid #00C1DE;
  343. border-radius: 6upx;
  344. margin-right: 10upx;
  345. }
  346. // 状态
  347. .status {
  348. display: inline-block;
  349. width: 150upx;
  350. color: red;
  351. }
  352. }
  353. }
  354. }
  355. }
  356. </style>