toDoList.vue 8.7 KB

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