toDoList.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view class="pagesCons">
  3. <!-- 自定义标题 -->
  4. <u-navbar :is-back="false" :border-bottom="false" :background="background" id="navbar">
  5. <view class="slot-wrap">
  6. <view class="back-icon" @click="goBack">
  7. <u-icon name="arrow-left" color="#fff" size="32"></u-icon>
  8. </view>
  9. <view class="left-icon">待办单</view>
  10. <view class="right-icon">
  11. <u-icon name="plus-circle" color="#fff" size="32"></u-icon>新增
  12. </view>
  13. </view>
  14. </u-navbar>
  15. <view class="tab-body">
  16. <view>
  17. <u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
  18. swiperWidth="750"></u-tabs-swiper>
  19. </view>
  20. <view class="all-filter" v-show="current==2">
  21. <u-row>
  22. <text>发起时间</text>
  23. <view class="filter-icon">
  24. <u-icon name="arrow-up-fill" color="#888888" size="24"></u-icon>
  25. <u-icon name="arrow-down-fill" color="#2979ff" size="24"></u-icon>
  26. </view>
  27. </u-row>
  28. <u-row>
  29. <text>处理时间</text>
  30. <view class="filter-icon">
  31. <u-icon name="arrow-up-fill" color="#888888" size="24"></u-icon>
  32. <u-icon name="arrow-down-fill" color="#888888" size="24"></u-icon>
  33. </view>
  34. </u-row>
  35. <view @click="showSearch=true">
  36. <text>筛选</text>
  37. <u-icon name="shaixuan" custom-prefix="xd-icon" size="32" color="#888888"></u-icon>
  38. </view>
  39. </view>
  40. <swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
  41. <swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
  42. <scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
  43. <view
  44. class="check-order-list"
  45. v-for="(item,index) in list"
  46. :key="item.id"
  47. >
  48. <view class="check-row" @click="viewRow(item)">
  49. <view class="ellipsis-one">{{item.storeName}}</view>
  50. <view class="createDate">{{item.createDate}}</view>
  51. </view>
  52. <view class="check-row" @click="viewRow(item)">
  53. <view class="ellipsis-one">
  54. {{item.clsName}}
  55. </view>
  56. <view class="text-right">
  57. <text>{{item.userName}}</text>
  58. </view>
  59. <view class="icon-xian" >
  60. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
  61. </view>
  62. </view>
  63. <view class="check-row">
  64. <view>
  65. {{item.sourceType}}
  66. </view>
  67. <view class="text-right">
  68. <text class="mark">
  69. 抄送
  70. </text>
  71. <view class="status">{{item.status}}</view>
  72. </view>
  73. </view>
  74. </view>
  75. <u-empty :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  76. <view style="padding: 20upx;">
  77. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  78. </view>
  79. </scroll-view>
  80. </swiper-item>
  81. </swiper>
  82. </view>
  83. <search-modal :visible="showSearch" @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. 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. },
  130. {
  131. storeName: '常青二路店',
  132. createDate: '2020-08-08 16:12:00',
  133. clsName: '正常营业',
  134. userName: '张三',
  135. sourceType: '视频巡店',
  136. status: '待整改'
  137. },
  138. {
  139. storeName: '常青二路店',
  140. createDate: '2020-08-08 16:12:00',
  141. clsName: '正常营业',
  142. userName: '张三',
  143. sourceType: '视频巡店',
  144. status: '待整改'
  145. }
  146. ],
  147. total: 0,
  148. }
  149. },
  150. onLoad() {
  151. this.getRow()
  152. },
  153. methods:{
  154. message(title){
  155. uni.showToast({
  156. icon:'none',
  157. title: title
  158. })
  159. },
  160. // tabs通知swiper切换
  161. tabsChange(index) {
  162. this.swiperCurrent = index;
  163. // this.list = []
  164. // this.status = "loading"
  165. },
  166. swiperChange(event){
  167. console.log(event.detail)
  168. // this.list = []
  169. // this.status = "loading"
  170. },
  171. // swiper-item左右移动,通知tabs的滑块跟随移动
  172. transition(e) {
  173. let dx = e.detail.dx;
  174. this.$refs.uTabs.setDx(dx);
  175. },
  176. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  177. // swiper滑动结束,分别设置tabs和swiper的状态
  178. animationfinish(e) {
  179. let current = e.detail.current;
  180. if(current != this.current){
  181. this.$refs.uTabs.setFinishCurrent(current);
  182. this.swiperCurrent = current;
  183. this.current = current;
  184. this.getRow()
  185. }
  186. },
  187. // scroll-view到底部加载更多
  188. onreachBottom() {
  189. console.log(this.list.length, this.total)
  190. if(this.list.length < this.total){
  191. this.pageNo += 1
  192. this.getRow()
  193. }else{
  194. this.status = "nomore"
  195. }
  196. },
  197. // 查询列表
  198. getRow (pageNo) {
  199. let _this = this
  200. if (pageNo) {
  201. this.pageNo = pageNo
  202. }
  203. let params = {
  204. pageNo: this.pageNo,
  205. pageSize: this.pageSize
  206. }
  207. // this.status = "loading"
  208. // orderQueryLike(params).then(res => {
  209. // if (res.code == 200 || res.status == 204 || res.status == 200) {
  210. // if(_this.pageNo>1){
  211. // _this.list = _this.list.concat(res.data.list || [])
  212. // }else{
  213. // _this.list = res.data.list || []
  214. // }
  215. // _this.total = res.data.count || 0
  216. // } else {
  217. // _this.list = []
  218. // _this.total = 0
  219. // _this.noDataText = res.message
  220. // }
  221. // _this.status = "loadmore"
  222. // })
  223. },
  224. // 重置
  225. resetForm(){
  226. this.queryWord = ''
  227. this.beginDate = ''
  228. this.endDate = ''
  229. this.pageInit(true)
  230. },
  231. // 详细页
  232. viewRow(item){
  233. // 已完成的
  234. uni.navigateTo({
  235. url: "/pages/workOrder/orderDetails?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;
  253. color: #fff;
  254. font-size: 28upx;
  255. .left-icon {
  256. flex-grow: 1;
  257. font-size: 32upx;
  258. margin-right: 10upx;
  259. text-align: center;
  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>