toDoList.vue 8.9 KB

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