spotChecking.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view class="pagesCons">
  3. <view class="tab-body">
  4. <view>
  5. <u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
  6. swiperWidth="750"></u-tabs-swiper>
  7. </view>
  8. <swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
  9. <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;" v-for="(tabs, index) in tabList" :key="index">
  10. <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
  11. <view
  12. class="check-order-list"
  13. v-for="(item,index) in list"
  14. :key="item.id"
  15. >
  16. <view class="check-row" @click="viewRow(item)">
  17. <view class="createDate">{{item.createDate}}</view>
  18. <view>待处理</view>
  19. </view>
  20. <view class="check-row" @click="viewRow(item)">
  21. <view>
  22. <view style="font-size: 30upx;margin-bottom: 10upx;">夏季活动布置</view>
  23. <view style="color: #666666;">长青二路店</view>
  24. </view>
  25. <view>
  26. <text style="color: #007AFF;">开始点检</text>
  27. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
  28. </view>
  29. </view>
  30. </view>
  31. <u-empty :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  32. <view style="padding: 20upx;">
  33. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  34. </view>
  35. </scroll-view>
  36. </swiper-item>
  37. </swiper>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {getCheckResult, deleteCheckResult} from '@/api/checkOrder'
  43. import { getLookUpDatas, listLookUp } from '@/api/data'
  44. import { orderQueryLike, deleteOrder, finishOrder, smAddSerPerson } from '@/api/order'
  45. import { clzConfirm } from '@/libs/tools.js'
  46. export default {
  47. components: {
  48. },
  49. data() {
  50. return {
  51. showSearch: false,
  52. status: 'loadmore',
  53. canEdit: false,
  54. canFinish: false,
  55. canDel: false,
  56. canView: false,
  57. canPay: false,
  58. noDataText: '暂无数据',
  59. background: {
  60. // 渐变色
  61. backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
  62. },
  63. tabList: [
  64. {
  65. dispName: '待处理',
  66. typeId: 4
  67. },
  68. {
  69. dispName: '已完成',
  70. typeId: 3
  71. },
  72. {
  73. dispName: '已过期',
  74. typeId: 2
  75. },
  76. {
  77. dispName: '全部',
  78. typeId: 1
  79. },
  80. ],
  81. current: 0,
  82. swiperCurrent: 0,
  83. pageNo: 1,
  84. pageSize: 10,
  85. list: [],
  86. total: 0,
  87. }
  88. },
  89. onLoad() {
  90. this.getRow()
  91. },
  92. methods:{
  93. message(title){
  94. uni.showToast({
  95. icon:'none',
  96. title: title
  97. })
  98. },
  99. // tabs通知swiper切换
  100. tabsChange(index) {
  101. this.swiperCurrent = index;
  102. this.list = []
  103. this.status = "loading"
  104. },
  105. swiperChange(event){
  106. console.log(event.detail)
  107. this.list = []
  108. this.status = "loading"
  109. },
  110. // swiper-item左右移动,通知tabs的滑块跟随移动
  111. transition(e) {
  112. let dx = e.detail.dx;
  113. this.$refs.uTabs.setDx(dx);
  114. },
  115. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  116. // swiper滑动结束,分别设置tabs和swiper的状态
  117. animationfinish(e) {
  118. let current = e.detail.current;
  119. if(current != this.current){
  120. this.$refs.uTabs.setFinishCurrent(current);
  121. this.swiperCurrent = current;
  122. this.current = current;
  123. this.getRow()
  124. }
  125. },
  126. // scroll-view到底部加载更多
  127. onreachBottom() {
  128. console.log(this.list.length, this.total)
  129. if(this.list.length < this.total){
  130. this.pageNo += 1
  131. this.getRow()
  132. }else{
  133. this.status = "nomore"
  134. }
  135. },
  136. // 查询列表
  137. getRow (pageNo) {
  138. let _this = this
  139. if (pageNo) {
  140. this.pageNo = pageNo
  141. }
  142. let params = {
  143. pageNo: this.pageNo,
  144. pageSize: this.pageSize,
  145. queryWord: this.queryWord,
  146. queryBeginDate: this.beginDate,
  147. queryEndDate: this.endDate,
  148. typeId: this.typeId,
  149. finishFlag: this.finishFlag,
  150. orderFlag: this.orderFlag,
  151. orderFlags: this.orderFlags,
  152. orderSource: this.orderSource
  153. }
  154. this.status = "loading"
  155. orderQueryLike(params).then(res => {
  156. if (res.code == 200 || res.status == 204 || res.status == 200) {
  157. if(_this.pageNo>1){
  158. _this.list = _this.list.concat(res.data.list || [])
  159. }else{
  160. _this.list = res.data.list || []
  161. }
  162. _this.total = res.data.count || 0
  163. } else {
  164. _this.list = []
  165. _this.total = 0
  166. _this.noDataText = res.message
  167. }
  168. _this.status = "loadmore"
  169. })
  170. },
  171. // 查询条件
  172. openSearch(){
  173. this.showSearch = true
  174. },
  175. bindBeginDateChange(e){
  176. this.beginDate = e.target.value
  177. },
  178. bindEndDateChange(e){
  179. this.endDate = e.target.value
  180. },
  181. // 重置
  182. resetForm(){
  183. this.queryWord = ''
  184. this.beginDate = ''
  185. this.endDate = ''
  186. this.pageInit(true)
  187. },
  188. // 详细页
  189. viewRow(item){
  190. // 已完成的
  191. uni.navigateTo({
  192. url: "/pages/workOrder/orderDetails?id="+item.id
  193. })
  194. },
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. page{
  200. height: 100%;
  201. }
  202. .pagesCons{
  203. height: 100%;
  204. display: flex;
  205. flex-direction: column;
  206. .tab-body{
  207. .check-list{
  208. height: calc(100vh - 120px);
  209. }
  210. .check-order-list{
  211. background: #ffffff;
  212. padding: 10upx 20upx;
  213. margin: 25upx;
  214. border-radius: 6upx;
  215. box-shadow: 1px 1px 3px #EEEEEE;
  216. .check-row{
  217. display: flex;
  218. align-items: center;
  219. padding: 20upx 10upx;
  220. font-size: 28upx;
  221. &:first-child{
  222. border-bottom: 1px dashed #F8F8F8;
  223. font-size: 26upx;
  224. }
  225. &:last-child{
  226. border-top: 1px dashed #F8F8F8;
  227. }
  228. > view{
  229. &:first-child{
  230. flex-grow: 1;
  231. }
  232. }
  233. .action{
  234. margin: 0 6rpx;
  235. padding: 0 20rpx;
  236. color: #fff;
  237. }
  238. .edit{
  239. background-color: #f9ba09;
  240. }
  241. .view{
  242. background-color: #ff7801;
  243. }
  244. .del{
  245. background-color: #f72525;
  246. }
  247. .finish{
  248. background-color: #2d8cf0;
  249. }
  250. .pay{
  251. background-color: #10c71e;
  252. }
  253. .check-btns{
  254. width: '50%';
  255. display: flex;
  256. align-items: center;
  257. justify-content: flex-end;
  258. > view{
  259. margin-left: 35upx;
  260. font-size: 28upx;
  261. }
  262. }
  263. .u-tag{
  264. border-radius: 0;
  265. }
  266. .uni-icons{
  267. margin: 0 5upx;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. </style>