Browse Source

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
代办修改

1004749546@qq.com 4 years ago
parent
commit
35950cb6cb
2 changed files with 133 additions and 33 deletions
  1. 19 9
      pages/toDoList/addBacklog.vue
  2. 114 24
      pages/toDoList/toDoList.vue

+ 19 - 9
pages/toDoList/addBacklog.vue

@@ -2,19 +2,18 @@
 	<view class="back-body">
 		<view class="back-content">
 			<!-- 轮播图 -->
-			<view class="paizhao">
-				<view class="icon">
-					<u-icon name="xianchangpaishe" custom-prefix="xd-icon" size="64" color="#888888"></u-icon>
-				</view>
-			</view>
 			<swiper v-if="backlogPhotoList.length" class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
 				<swiper-item v-for="(item,index) in backlogPhotoList" :key="index">
 					<div class="swiper-item uni-bg-red">
-						<!-- <image class="swiper-item-imgse" :fade-show='true' :src="item.photo"></image> -->
-						<u-image mode="scaleToFill" width="750upx" height="400upx" :src="item.photo"></u-image>
+						<u-image mode="scaleToFill" width="750upx" height="400upx" :src="item"></u-image>
 					</div>
 				</swiper-item>
 			</swiper>
+			<view v-else class="paizhao">
+				<view class="icon" @click="takePhone">
+					<u-icon name="xianchangpaishe" custom-prefix="xd-icon" size="64" color="#888888"></u-icon>
+				</view>
+			</view>
 			<u-form class="form-content" :model="form" ref="uForm" label-width="180">
 				<u-form-item label="门店" prop="storeName">
 					<u-input @click="chooseStore" input-align="right" v-model="form.storeName" disabled placeholder="请选择门店" />
@@ -70,8 +69,19 @@
 		},
 		onLoad(option) {
 			
-		},
-		methods: {
+		}, 
+		methods: { 
+			// 拍照 或从相册选相片
+			takePhone () {
+				let _this = this
+				uni.chooseImage({
+				    count: 6, //默认9
+				    success: function (res) {
+				        console.log(JSON.stringify(res.tempFilePaths));
+						_this.backlogPhotoList = res.tempFilePaths
+				    }
+				})
+			},
 			// 确认日期选择
 			onSelected (v) {
 				console.log(v,'vvvvvvvv')

+ 114 - 24
pages/toDoList/toDoList.vue

@@ -15,21 +15,25 @@
 					 swiperWidth="750"></u-tabs-swiper>
 				</view>
 				<view class="all-filter" v-show="current==2">
-					<u-row>
+					<u-dropdown>
+						<u-dropdown-item v-model="createTimeSort" title="发起时间" :options="createTimeSortList"></u-dropdown-item>
+						<u-dropdown-item v-model="handleTimeSort" title="处理时间" :options="handleTimeSortList"></u-dropdown-item>
+					</u-dropdown>
+					<!-- <u-row>
 						<text>发起时间</text>
 						<view class="filter-icon">
-							<u-icon name="arrow-up-fill" color="#888888" size="24"></u-icon>
-							<u-icon name="arrow-down-fill" color="#2979ff" size="24"></u-icon>
+							<u-icon @click="changeSort(0)" name="arrow-up-fill" :color="(sortIndex===0)?'#2979ff':'#888888'" size="24"></u-icon>
+							<u-icon @click="changeSort(1)" name="arrow-down-fill" :color="(sortIndex===1)?'#2979ff':'#888888'" size="24"></u-icon>
 						</view>
 					</u-row>
 					<u-row>
 						<text>处理时间</text>
 						<view class="filter-icon">
-							<u-icon name="arrow-up-fill" color="#888888" size="24"></u-icon>
-							<u-icon name="arrow-down-fill" color="#888888" size="24"></u-icon>
+							<u-icon @click="changeSort(2)" name="arrow-up-fill" :color="(sortIndex===2)?'#2979ff':'#888888'" size="24"></u-icon>
+							<u-icon @click="changeSort(3)" name="arrow-down-fill" :color="(sortIndex===3)?'#2979ff':'#888888'" size="24"></u-icon>
 						</view>
-					</u-row>
-					<view @click="showSearch=true">
+					</u-row> -->
+					<view class="filter" @click="showSearch=true">
 						<text>筛选</text>
 						<u-icon name="shaixuan" custom-prefix="xd-icon" size="32" color="#888888"></u-icon>
 					</view>
@@ -53,7 +57,7 @@
 										 {{item.clsName}}
 									</view>
 									 <view class="text-right">
-										 <text>{{item.userName}}</text>
+										 <text>{{item.putUserName}}</text>
 									 </view>
 									 <view class="icon-xian" >
 										 <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
@@ -95,7 +99,7 @@
 		data() {
 			return {
 				showSearch: false, // 是否显示搜索弹框
-				searchParams: null, // 查询数据参数
+				searchParams: null, // 全部查询数据参数
 				status: 'loadmore',
 				noDataText: '暂无数据',
 				background: {
@@ -105,15 +109,18 @@
 				tabList: [
 					  {
 						  dispName: '发给我的',
-						  typeId: 3
+						  typeId: 3,
+						  queryLabel: 'TO_ME' // tab参数
 					   },
 					  {
 					    dispName: '我创建的',
-					  	typeId: 1
+					  	typeId: 1,
+						queryLabel: 'FROM_ME' // tab参数
 					  },
 					  {
 					    dispName: '全部',
-					  	typeId: 2
+					  	typeId: 2,
+						queryLabel: 'ALL' // tab参数
 					  },
 				  ],
 				current: 0,
@@ -122,6 +129,58 @@
 				pageSize: 10,
 				list: [],
 				total: 0,
+				action:'swiperChange', // 操作类型,上划分页,或左右滑动
+				sortField: 'create_time', // 全部  排序字段 默认按发起时间
+				sortOrder: 'desc', // 全部  排序字段 默认按发起时间降序
+				createTimeSort: 'desc',
+				handleTimeSort: null,
+				createTimeSortList: [
+					{
+						label: '默认排序',
+						value: ''
+					},
+					{
+						label: '升序',
+						value: 'asc'
+					},
+					{
+						label: '降序',
+						value: 'desc'
+					},
+				],
+				handleTimeSortList: [
+					{
+						label: '默认排序',
+						value: ''
+					},
+					{
+						label: '升序',
+						value: 'asc'
+					},
+					{
+						label: '降序',
+						value: 'desc'
+					},
+				],
+				sortList: [  // 排序列表
+					{
+						sortField: 'create_time',
+						sortOrder: 'asc'
+					},
+					{
+						sortField: 'create_time',
+						sortOrder: 'desc'
+					},
+					{
+						sortField: 'handle_time',
+						sortOrder: 'asc'
+					},
+					{
+						sortField: 'handle_time',
+						sortOrder: 'desc'
+					}
+				],
+				sortIndex: 1, // 排序下标 默认按发起时间降序
 			}
 		},
 		onLoad() {
@@ -131,10 +190,9 @@
 			// tabs通知swiper切换
 			tabsChange(index) {
 				this.swiperCurrent = index;
-				this.resetPage()
 			},
 			swiperChange(event){
-				this.list = [];
+				this.action = 'swiperChange'
 				this.status = 'loading'
 			},
 			// swiper-item左右移动,通知tabs的滑块跟随移动
@@ -146,14 +204,24 @@
 			// swiper滑动结束,分别设置tabs和swiper的状态
 			animationfinish(e) {
 				let current = e.detail.current;
-				this.$refs.uTabs.setFinishCurrent(current);
-				this.swiperCurrent = current;
-				this.current = current;
-				this.resetPage()
+				let isCurtab = this.current == current
+				if(this.status!="nomore"){
+					let loadData = this.action == 'swiperChange' ? !isCurtab : isCurtab;
+					if(loadData){
+						this.$refs.uTabs.setFinishCurrent(current);
+						this.swiperCurrent = current;
+						this.current = current;
+						this.resetPage();
+					}
+				}
+			},
+			// 全部 排序
+			changeSort (index) {
+				this.sortIndex = this.sortIndex === index ? null : index
 			},
 			// scroll-view到底部加载更多
 			onreachBottom() {
-				console.log(this.list.length, this.total)
+				this.action = 'onreachBottom'
 				if(this.list.length < this.total){
 					this.pageNo += 1
 					this.getRow()
@@ -167,10 +235,21 @@
 			  if (pageNo) {
 			    this.pageNo = pageNo
 			  }
-			  
 			  let params = {
 			    pageNo: this.pageNo,
-			    pageSize: this.pageSize
+			    pageSize: this.pageSize,
+			    queryLabel: this.tabList[this.current].queryLabel, // tab分类
+			    status: '', // 状态(pending 待整改 check_pending待审核 finished 整改完成 expired 已过期)
+			    sourceType: '', // 问题来源(远程巡店 VIDEO_INSPECTION /现场巡店 SPOT_INSPECTION/点检 POINT_INSPECTION /手动创建  MANUAL)
+			    putUserName: '', // 巡店人
+			    storeName: '', // 门店名称
+				createTime: '', // 发起时间
+				sortField: '', // 排序字段 create_time  发起时间  handle_time 处理时间
+				sortOrder: '' // asc 升序    desc 降序
+			  }
+			  if (params.queryLabel == 'ALL') {
+				  params.sortField = this.sortIndex === null ? '' :this.sortList[this.sortIndex].sortField
+				  params.sortOrder = this.sortIndex === null ? '' :this.sortList[this.sortIndex].sortOrder
 			  }
 			  this.status = "loading"
 			  getBackLogList(params).then(res => {
@@ -191,8 +270,15 @@
 			},
 			resetPage(){
 				this.status = 'loading';
-				this.list = [];
-				this.getRow(1);
+				// 上划分页
+				if(this.action == 'onreachBottom'){
+					this.getRow();
+				}
+				// 左右切换tab
+				if(this.action == 'swiperChange'){
+					this.list = [];
+					this.getRow(1);
+				}
 			},
 			// 查询刷新
 			refresh(params){
@@ -282,7 +368,7 @@
 					}
 				}
 			}
-			// 全部筛选
+			// 全部筛选 
 			.all-filter{
 				width: 100%;
 				height: 100upx;
@@ -295,6 +381,10 @@
 					flex-direction: column;
 					margin-left: 10upx;
 				}
+				.filter{
+					width: 30%;
+					text-align: center;
+				}
 			}
 			// 列表样式
 			.check-order-list{