toDoList.vue 11 KB

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