toDoList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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 >
  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.carModelName}}</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.vehicleNumber}}
  55. </view>
  56. <view class="text-right">
  57. <text>{{item.customMobile}}</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.orderSource}}
  66. </view>
  67. <view class="text-right">
  68. <text class="mark">
  69. 抄送
  70. </text>
  71. <view class="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. <!-- 全部筛选 -->
  84. <u-popup v-model="showSearch" class="search-popup" mode="right" :custom-style="{top:'var(--status-bar-height)'}" length="80%">
  85. <view class="search-title">待办单查询</view>
  86. <view class="uni-list">
  87. <view class="uni-list-cell">
  88. <view class="uni-list-cell-left">
  89. 关键词:
  90. </view>
  91. <view class="uni-list-cell-db">
  92. <input class="uni-input" v-model="queryWord" placeholder="工单、客户姓名、手机号、车牌号" />
  93. </view>
  94. </view>
  95. </view>
  96. <view class="uni-list">
  97. <view class="uni-list-cell">
  98. <view class="uni-list-cell-left">
  99. 开始时间:
  100. </view>
  101. <view class="uni-list-cell-db">
  102. <picker mode="date" v-model="beginDate" :end="endDate" @change="bindBeginDateChange">
  103. <view class="uni-input">{{beginDate}}</view>
  104. </picker>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="uni-list">
  109. <view class="uni-list-cell">
  110. <view class="uni-list-cell-left">
  111. 结束时间:
  112. </view>
  113. <view class="uni-list-cell-db">
  114. <picker mode="date" v-model="endDate" :start="beginDate" @change="bindEndDateChange">
  115. <view class="uni-input">{{endDate}}</view>
  116. </picker>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="uni-list-btns">
  121. <button type="primary" @click="pageInit(false)">查询</button>
  122. <button type="info" @click="resetForm">重置</button>
  123. </view>
  124. </u-popup>
  125. </view>
  126. </template>
  127. <script>
  128. import {getCheckResult, deleteCheckResult} from '@/api/backLog.js'
  129. import { getLookUpDatas, listLookUp } from '@/api/data'
  130. import { orderQueryLike, deleteOrder, finishOrder, smAddSerPerson } from '@/api/order'
  131. import { clzConfirm } from '@/libs/tools.js'
  132. export default {
  133. components: {
  134. },
  135. data() {
  136. return {
  137. showSearch: false,
  138. status: 'loadmore',
  139. canEdit: false,
  140. canFinish: false,
  141. canDel: false,
  142. canView: false,
  143. canPay: false,
  144. noDataText: '暂无数据',
  145. background: {
  146. // 渐变色
  147. backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
  148. },
  149. tabList: [
  150. {
  151. dispName: '发给我的',
  152. typeId: 3
  153. },
  154. {
  155. dispName: '我创建的',
  156. typeId: 1
  157. },
  158. {
  159. dispName: '全部',
  160. typeId: 2
  161. },
  162. ],
  163. current: 0,
  164. swiperCurrent: 0,
  165. // 查询条件
  166. queryWord: '',
  167. beginDate: '',
  168. endDate: '',
  169. typeId: '',
  170. finishFlag: '',
  171. orderFlag: '',
  172. orderFlags: [],
  173. pageNo: 1,
  174. pageSize: 10,
  175. list: [],
  176. total: 0,
  177. openAddServerStaff: false, // 是否打开选择服务人员弹框
  178. smOrderId: '', // 移动扫码洗车服务id
  179. }
  180. },
  181. onLoad() {
  182. this.getRow()
  183. },
  184. methods:{
  185. message(title){
  186. uni.showToast({
  187. icon:'none',
  188. title: title
  189. })
  190. },
  191. // tabs通知swiper切换
  192. tabsChange(index) {
  193. this.swiperCurrent = index;
  194. this.list = []
  195. this.status = "loading"
  196. },
  197. swiperChange(event){
  198. console.log(event.detail)
  199. this.list = []
  200. this.status = "loading"
  201. },
  202. // swiper-item左右移动,通知tabs的滑块跟随移动
  203. transition(e) {
  204. let dx = e.detail.dx;
  205. this.$refs.uTabs.setDx(dx);
  206. },
  207. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  208. // swiper滑动结束,分别设置tabs和swiper的状态
  209. animationfinish(e) {
  210. let current = e.detail.current;
  211. if(current != this.current){
  212. this.$refs.uTabs.setFinishCurrent(current);
  213. this.swiperCurrent = current;
  214. this.current = current;
  215. this.getRow()
  216. }
  217. },
  218. // scroll-view到底部加载更多
  219. onreachBottom() {
  220. console.log(this.list.length, this.total)
  221. if(this.list.length < this.total){
  222. this.pageNo += 1
  223. this.getRow()
  224. }else{
  225. this.status = "nomore"
  226. }
  227. },
  228. // 查询列表
  229. getRow (pageNo) {
  230. let _this = this
  231. if (pageNo) {
  232. this.pageNo = pageNo
  233. }
  234. let params = {
  235. pageNo: this.pageNo,
  236. pageSize: this.pageSize,
  237. queryWord: this.queryWord,
  238. queryBeginDate: this.beginDate,
  239. queryEndDate: this.endDate,
  240. typeId: this.typeId,
  241. finishFlag: this.finishFlag,
  242. orderFlag: this.orderFlag,
  243. orderFlags: this.orderFlags,
  244. orderSource: this.orderSource
  245. }
  246. this.status = "loading"
  247. orderQueryLike(params).then(res => {
  248. if (res.code == 200 || res.status == 204 || res.status == 200) {
  249. if(_this.pageNo>1){
  250. _this.list = _this.list.concat(res.data.list || [])
  251. }else{
  252. _this.list = res.data.list || []
  253. }
  254. _this.total = res.data.count || 0
  255. } else {
  256. _this.list = []
  257. _this.total = 0
  258. _this.noDataText = res.message
  259. }
  260. _this.status = "loadmore"
  261. })
  262. },
  263. // 查询条件
  264. openSearch(){
  265. this.showSearch = true
  266. },
  267. bindBeginDateChange(e){
  268. this.beginDate = e.target.value
  269. },
  270. bindEndDateChange(e){
  271. this.endDate = e.target.value
  272. },
  273. // 重置
  274. resetForm(){
  275. this.queryWord = ''
  276. this.beginDate = ''
  277. this.endDate = ''
  278. this.pageInit(true)
  279. },
  280. // 详细页
  281. viewRow(item){
  282. // 已完成的
  283. uni.navigateTo({
  284. url: "/pages/workOrder/orderDetails?id="+item.id
  285. })
  286. },
  287. }
  288. }
  289. </script>
  290. <style lang="scss" scoped>
  291. page{
  292. height: 100%;
  293. }
  294. /* 自定义导航栏样式 */
  295. .slot-wrap {
  296. display: flex;
  297. align-items: center;
  298. /* 如果您想让slot内容占满整个导航栏的宽度 */
  299. flex: 1;
  300. /* 如果您想让slot内容与导航栏左右有空隙 */
  301. padding: 0 30rpx;
  302. color: #fff;
  303. font-size: 28upx;
  304. .left-icon {
  305. flex-grow: 1;
  306. font-size: 32upx;
  307. margin-right: 10upx;
  308. text-align: center;
  309. }
  310. .right-icon {
  311. padding-left: 50upx;
  312. }
  313. .uni-icons {
  314. margin-right: 10upx;
  315. }
  316. }
  317. .text-right {
  318. text-align: right;
  319. }
  320. .pagesCons{
  321. height: 100%;
  322. display: flex;
  323. flex-direction: column;
  324. .tab-body{
  325. flex: 1;
  326. display: flex;
  327. flex-direction: column;
  328. .check-list{
  329. flex: 1;
  330. overflow-y: scroll;
  331. .swiper-item{
  332. width: 100%;
  333. height: 100%;
  334. overflow: hidden;
  335. .scroll-view {
  336. width: 100%;
  337. height: 100%;
  338. overflow: auto;
  339. }
  340. }
  341. }
  342. // 全部筛选
  343. .all-filter{
  344. width: 100%;
  345. height: 100upx;
  346. display: flex;
  347. align-items: center;
  348. justify-content: space-around;
  349. box-shadow: 1px 1px 3px #EEEEEE;
  350. .filter-icon{
  351. display: flex;
  352. flex-direction: column;
  353. margin-left: 10upx;
  354. }
  355. }
  356. // 列表样式
  357. .check-order-list{
  358. background: #ffffff;
  359. padding: 10upx 20upx;
  360. margin: 25upx;
  361. border-radius: 6upx;
  362. box-shadow: 1px 1px 3px #EEEEEE;
  363. .check-row{
  364. display: flex;
  365. align-items: center;
  366. padding: 20upx 10upx;
  367. font-size: 28upx;
  368. .icon-xian{
  369. text-align: right;
  370. width: 40upx;
  371. }
  372. &:first-child{
  373. border-bottom: 1px dashed #F8F8F8;
  374. .createDate{
  375. // color: #666;
  376. font-size: 26upx;
  377. margin-left: 10upx;
  378. }
  379. }
  380. &:last-child{
  381. border-top: 1px dashed #F8F8F8;
  382. }
  383. > view{
  384. &:first-child{
  385. flex: 1;
  386. }
  387. }
  388. // 抄送标记
  389. .mark {
  390. color: #00C1DE;
  391. padding: 6upx;
  392. font-size: 24upx;
  393. border: 1px solid #00C1DE;
  394. border-radius: 6upx;
  395. margin-right: 10upx;
  396. }
  397. // 状态
  398. .status {
  399. display: inline-block;
  400. width: 150upx;
  401. color: red;
  402. }
  403. }
  404. }
  405. }
  406. }
  407. .slot-wrap {
  408. display: flex;
  409. align-items: center;
  410. /* 如果您想让slot内容占满整个导航栏的宽度 */
  411. flex: 1;
  412. /* 如果您想让slot内容与导航栏左右有空隙 */
  413. padding: 0 30rpx 0 0;
  414. color: #fff;
  415. font-size: 28upx;
  416. .left-icon{
  417. flex-grow: 1;
  418. font-size: 32upx;
  419. }
  420. .right-icon{
  421. padding-left:50upx;
  422. }
  423. .uni-icons{
  424. margin-right: 10upx;
  425. }
  426. }
  427. .search-popup{
  428. .search-title{
  429. text-align: center;
  430. padding: 22upx;
  431. color: #333;
  432. border-bottom: 1px solid #eee;
  433. }
  434. .uni-list{
  435. margin: 20upx;
  436. .uni-list-cell{
  437. display: flex;
  438. align-items: center;
  439. border-bottom: 1px dashed #EEEEEE;
  440. .uni-list-cell-db{
  441. flex: 1;
  442. }
  443. .uni-input{
  444. height: 2.5em;
  445. line-height: 2.5em;
  446. }
  447. }
  448. }
  449. .uni-list-btns{
  450. display: flex;
  451. padding: 20upx;
  452. uni-button{
  453. font-size: 28upx;
  454. margin: 0 30upx;
  455. flex:1;
  456. }
  457. }
  458. }
  459. </style>