chenrui 4 yıl önce
ebeveyn
işleme
333207e024

+ 19 - 5
api/task.js

@@ -36,6 +36,17 @@ export const getTaskList = params => {
     data: params
   })
 }
+// 巡店列表
+export const getTasksList = params => {
+	const url = `task/queryList/${params.pageNo}/${params.pageSize}`
+	delete params.pageNo
+	delete params.pageSize
+	return axios.request({
+		url: url,
+		method: 'post',
+		data: params
+	})
+}
 // 查询门店当前任务是否进行
 export const queryCurrentTaskUsing = params => {
   return axios.request({
@@ -46,11 +57,14 @@ export const queryCurrentTaskUsing = params => {
 }
 // 我的巡店列表
 export const queryMyTask = params => {
-  return axios.request({
-    url: `task/queryMyTask/${params.pageNo}/${params.pageSize}`,
-    method: 'post',
-    data: params
-  })
+	const url = `task/queryMyTask/${params.pageNo}/${params.pageSize}`
+	delete params.pageNo
+	delete params.pageSize
+	return axios.request({
+		url: url,
+		method: 'post',
+		data: params
+	})
 }
 // (重新)开始巡店
 export const taskStart = params => {

+ 7 - 0
api/taskItem.js

@@ -12,4 +12,11 @@ export const delTaskItem = params => {
     url: `taskItem/del/${params.id}`,
     method: 'get'
   })
+}
+// 巡店考评项目明细
+export const detailsTaskItem = params => {
+  return axios.request({
+    url: `taskItem/details/${params.id}`,
+    method: 'get'
+  })
 }

+ 75 - 90
pages/myShopTour/myShopTour.vue

@@ -6,15 +6,15 @@
 			<swiper class="data-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
 				<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
 					<scroll-view scroll-y class="scroll-con" @scrolltolower="onreachBottom">
-						<view class="record-con">
+						<view class="record-con" :style="{'paddingTop': searchForm.beginDate ? '74upx' : ''}">
 							<!-- 筛选日期,近7天 -->
-							<view v-show="searchForm.creatTime.length != 0" class="alert-tips">
-								<text>{{searchForm.creatTime[0]}} ~ {{searchForm.creatTime[1]}}</text>
+							<view v-show="searchForm.beginDate" class="alert-tips">
+								<text>{{searchForm.beginDate}} ~ {{searchForm.endDate}}</text>
 							</view>
-							<view class="record-item" v-if="index==current" v-for="(item,sindex) in list" :key="item.id">
+							<view class="record-item" v-if="index==current" v-for="(item,sindex) in list" :key="item.id" @click="getDetails(item)">
 								<view class="item-head">
-									<text class="item-c-tit">{{item.name}}</text>
-									<u-tag class="item-c-type" :text="item.status" type="primary" />
+									<text class="item-c-tit">{{item.storeName}}</text>
+									<u-tag class="item-c-type" :text="item.status | taskStatus" type="primary" />
 								</view>
 								<view class="item-main">
 									<text class="item-tit">创建时间:</text>
@@ -22,11 +22,12 @@
 								</view>
 								<view class="item-main">
 									<text class="item-tit">完成时间:</text>
-									<text class="item-val">{{item.endTime}}</text>
+									<text class="item-val">{{item.endTime ? item.endTime : '--'}}</text>
 								</view>
 								<view class="item-main">
 									<text class="item-tit">巡店耗时:</text>
-									<text class="item-val">{{item.spendTime}}秒</text>
+									<text class="item-val" v-if="item.spendTime">{{ item.spendTime | formatTime }}</text>
+									<text class="item-val" v-else>--</text>
 								</view>
 								<u-grid class="item-grid" :col="4" hover-class="none">
 									<u-grid-item>
@@ -55,56 +56,25 @@
 			</swiper>
 		</view>
 		<!-- 筛选弹框 -->
-		<u-popup v-model="openScreen" mode="right" length="80%" class="screenModel-wrap">
-			<!-- 条件项 -->
-			<view class="condition-con">
-				<view class="screen-module">
-					<text class="screen-tit">创建时间:</text>
-					<view class="screen-time-val">
-						<text @click="onShowDatePicker('range')">{{ range.length == 0 ? '请选择' : range[0] + '~' + range[1] }}</text>
-						<u-icon v-show="range.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="range=[]"></u-icon>
-					</view>
-				</view>
-				<view class="screen-module">
-					<text class="screen-tit">门店:</text>
-					<view class="screen-inp-val">
-						<u-input class="screen-inp" v-model="storeName" :height="52" placeholder="请输入" type="text" :border="true" />
-					</view>
-				</view>
-			</view>
-			<!-- 按钮 -->
-			<view class="btns">
-				<u-button type="warning" shape="circle" size="mini" class="btn reset-btn" @click="resetF">重置</u-button>
-				<u-button type="error" shape="circle" size="mini" class="btn ok-btn" @click="submitF">确定</u-button>
-			</view>
-		</u-popup>
-		<!-- 选择创建时间 -->
-		<w-picker
-			:visible.sync="showPicker"
-			mode="range" 
-			startYear="2017" 
-			endYear="2030"
-			:value="searchForm.creatTime"
-			:current="false"
-			@confirm="onSelected($event,'range')"
-			@cancel="onSelected"
-			ref="range"></w-picker>
+		<search-modal :visible="openScreen" :defaultParams="searchForm" @openPicke="openPicker" @refresh="refresh" @close="openScreen=false"></search-modal>
 	</view>
 </template>
 
 <script>
+	import moment from "moment"
+	import searchModal from './searchModal.vue'
 	import wPicker from "@/components/w-picker/w-picker.vue"
 	import { queryMyTask } from '@/api/task.js'
 	export default {
-		components: { wPicker },
+		components: { wPicker, searchModal },
 		data() {
 			return {
 				tabList: [  //  tab切换  类型
 					{ dispName: '全部', code:'' },
-					{ dispName: '待处理', code:'0' },
-					{ dispName: '进行中', code:'1' },
-					{ dispName: '已完成', code:'2' },
-					{ dispName: '已过期', code:'3' }
+					{ dispName: '待处理', code:'PENDING' },
+					{ dispName: '进行中', code:'RUNNING' },
+					{ dispName: '已完成', code:'FINISHED' },
+					{ dispName: '已过期', code:'EXPIRED' }
 				],
 				current: 0,  //  tabs组件的current值,表示当前活动的tab选项
 				swiperCurrent: 0,  //  swiper组件的current值,表示当前那个swiper-item是活动的
@@ -115,22 +85,50 @@
 				noDataText: '暂无数据',  //  列表数据为空时提示文字
 				list: [],  //  数据列表
 				openScreen: false,  //  是否打开筛选
-				dateMode: 'range',  //  date单个日期  range日期范围
 				searchForm: {  //  查询条件
-					creatTime: [],  //  创建时间默认筛选近7天
-					store: ''
+					beginDate: '',  //  创建时间默认筛选近7天
+					endDate: '',  //  创建时间默认筛选近7天
+					sourceType: [],  //  检查方式
+					storeName: ''  //  门店名称
 				},
-				showPicker: false,  //  是否选择创建时间
-				range: [],  //  筛选创建时间的默认值
-				storeName: '',  //  筛选的门店名称
 				typeId: '',  //  记录状态
 				action:'swiperChange', // 操作类型,上划分页,或左右滑动
 			}
 		},
+		filters: {
+			// 任务类型
+			taskStatus(val){
+				let str = ''
+				if(val == 'PENDING'){
+					str = '待处理'
+				}else if(val == 'RUNNING'){
+					str = '进行中'
+				}else if(val == 'FINISHED'){
+					str = '已完成'
+				}else if(val == 'EXPIRED'){
+					str = '已过期'
+				}
+				return str
+			},
+			// 巡店耗时   秒转时分
+			formatTime(s){
+				let time = ''
+				if(moment.duration(s*1000).hours()){
+					time += moment.duration(s*1000).hours() + '时'
+				}
+				if(moment.duration(s*1000).minutes()){
+					time += moment.duration(s*1000).minutes() + '分'
+				}
+				if(moment.duration(s*1000).seconds()){
+					time += moment.duration(s*1000).seconds() + '秒'
+				}
+				return time
+			}
+		},
 		onLoad() {
+			this.searchForm.beginDate = this.get7day(-6)
+			this.searchForm.endDate = this.get7day(0)
 			this.resetPage()
-			this.range = [ this.get7day(-6), this.get7day(0) ]
-			this.searchForm.creatTime = [ this.get7day(-6), this.get7day(0) ]
 			uni.$on("updatePointTaskList",()=>{
 				this.resetPage()
 			})
@@ -139,6 +137,12 @@
 			uni.$off("updatePointTaskList")
 		},
 		methods: {
+			// 获取查询参数 刷新列表
+			refresh(params){
+				// console.log(params,'1111111111')
+				this.searchForm = params
+				this.pageInit(1)
+			},
 			// 查询列表
 			pageInit(pageNo){
 				if (pageNo) {
@@ -147,10 +151,11 @@
 				let params = {
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					beginDate: this.searchForm.creatTime[0],
-					endDate: this.searchForm.creatTime[1],
-					storeName: this.searchForm.store,
-					status: this.typeId==''?'':this.typeId // 任务状态
+					beginDate: this.searchForm.beginDate ? this.searchForm.beginDate : '',
+					endDate: this.searchForm.endDate ? this.searchForm.endDate : '',
+					storeName: this.searchForm.storeName ? this.searchForm.storeName : '',
+					typeList: this.searchForm.sourceType ? this.searchForm.sourceType : [],
+					status: this.typeId == '' ? '' : this.typeId // 任务状态
 				}
 				this.status = 'loading'
 				queryMyTask(params).then(res => {
@@ -170,6 +175,12 @@
 					
 				})
 			},
+			//  查看详情
+			getDetails(item){
+				uni.navigateTo({
+					url: '/pages/shopTourDetails/shopTourDetails?taskId=' + item.id
+				})
+			},
 			// tabs通知swiper切换
 			tabsChange(index) {
 				this.swiperCurrent = index
@@ -208,6 +219,10 @@
 					this.status = 'nomore'
 				}
 			},
+			//  打开筛选条件
+			onNavigationBarButtonTap(e) {
+				this.openScreen = true
+			},
 			//  初始化数据
 			resetPage(){
 				this.status = 'loading'
@@ -221,18 +236,6 @@
 					this.pageInit(1)
 				}
 			},
-			//  选择日期范围
-			onSelected(e){
-				this.showPicker = false
-				if(e) {
-					this.range = e.value
-				}
-			},
-			//  显示日期选择
-			onShowDatePicker(type){
-				this.showPicker = true
-				this.searchForm.creatTime = this.range
-			},
 			//  获取近几天的数据
 			get7day(day){
 				let today = new Date()
@@ -253,28 +256,11 @@
 			    }
 			    return m
 			},
-			//  打开筛选条件
-			onNavigationBarButtonTap(e) {
-				this.resetF()
-				this.openScreen = true
-			},
-			//  重置筛选条件
-			resetF(){
-				this.range = this.searchForm.creatTime
-				this.storeName = this.searchForm.store
-			},
-			//  确定筛选
-			submitF(){
-				this.searchForm.creatTime = this.range
-				this.searchForm.store = this.storeName
-				this.openScreen = false
-				this.pageInit()
-			},
 		}
 	}
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
 page {
 	background-color: #f8f8f8;
 	height: calc(100vh - 44px);
@@ -295,7 +281,6 @@ page {
 					overflow: auto;
 					// 列表
 					.record-con{
-						padding-top: 74upx;
 						position: relative;
 						.alert-tips{
 							position: fixed;

+ 243 - 0
pages/myShopTour/searchModal.vue

@@ -0,0 +1,243 @@
+<template>
+	<!-- 待办单查询 -->
+	<div class="modal-content">
+		<u-popup v-model="isShow" class="search-popup" mode="right" @close="handleClose" length="85%">
+			<view class="search-title">筛选</view>
+			<u-form class="form-content" :model="form" ref="uForm" label-width="150">
+				<u-form-item label="创建时间" prop="time">
+					<u-input clearable v-model="form.time" disabled placeholder="请选择创建时间区间" @click="openPicker" />
+					<u-icon v-show="form.time.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearTime"></u-icon>
+				</u-form-item>
+				<u-form-item label="门店" prop="storeName"><u-input v-model="form.storeName" :maxlength="30" placeholder="请输入门店名称" /></u-form-item>
+				<u-form-item label="检查方式" prop="sourceType" label-position="top">
+					<view :class="['status-item', item.checked ? 'active' : '']" v-for="item in sourceTypeList" :key="item.id" @click="chooseSourceType(item)">
+						{{ item.dispName }}
+					</view>
+				</u-form-item>
+			</u-form>
+			<view class="uni-list-btns">
+				<button type="primary" @click="handleSearch">查询</button>
+				<button type="info" @click="resetForm">重置</button>
+			</view>
+		</u-popup>
+		<!-- 时间选择器 -->
+		<w-picker
+			class="date-picker"
+			:visible.sync="showPicker"
+			mode="range"
+			:current="true"
+			fields="day"
+			@confirm="onSelected($event, 'range')"
+			@cancel="showPicker = false"
+			ref="date"
+		></w-picker>
+	</div>
+</template>
+
+<script>
+import wPicker from '@/components/w-picker/w-picker.vue'
+import { getLookUpDatas } from '@/api/data.js'
+export default {
+	components: { wPicker },
+	props: {
+		visible: {
+			type: Boolean,
+			default: false
+		},
+		defaultParams: {
+			type: Object,
+			default: () => {
+				return {};
+			}
+		}
+	},
+	watch: {
+		visible(newValue, oldValue) {
+			if (newValue) {
+				this.isShow = newValue
+			}
+		},
+		isShow(newValue, oldValue) {
+			if (newValue) {
+			} else {
+				this.init()
+				this.$emit('close')
+			}
+		}
+	},
+	data() {
+		return {
+			isShow: this.visible, // 显示隐藏
+			showPicker: false, // 是否显示时间弹窗
+			sourceTypeList: [], // 检查方式列表
+			form: {
+				time: '', // 发起时间区间
+				storeName: '', // 门店名称
+			},
+			beginDate: null, // 开始时间
+			endDate: null // 结束时间
+		};
+	},
+	computed: {
+		// 检查方式
+		sourceType() {
+			return this.filterData(this.sourceTypeList);
+		}
+	},
+	mounted() {
+		// 获取检查方式
+		this.getLookUpData('TASK_TYPE')
+		this.init()
+	},
+	methods: {
+		//  初始化数据
+		init(){
+			if(this.defaultParams.beginDate && this.defaultParams.endDate){
+				this.form.time = this.defaultParams.beginDate + ' ~ ' + this.defaultParams.endDate
+			}
+			this.beginDate = this.defaultParams.beginDate ? this.defaultParams.beginDate : ''
+			this.endDate = this.defaultParams.endDate ? this.defaultParams.endDate : ''
+			this.form.storeName = this.defaultParams.storeName ? this.defaultParams.storeName : ''
+			this.defaultSourceType()
+		},
+		//  默认检查方式
+		defaultSourceType(){
+			if(this.defaultParams.sourceType){
+				setTimeout(()=>{
+					this.sourceTypeList.map(item => {
+						if(this.defaultParams.sourceType.indexOf(item.code) != -1){
+							item.checked = true
+						}else{
+							item.checked = false
+						}
+					})
+				},0)
+			}
+		},
+		//  清空创建时间
+		clearTime(){
+			this.form.time = ''
+			this.beginDate = ''
+			this.endDate = ''
+		},
+		// 获取数据字典数据
+		getLookUpData(code) {
+			getLookUpDatas({ type: code }).then(res => {
+				if (res.status == 200) {
+					res.data.map(item => {
+						item.checked = false
+					})
+					if (code == 'TASK_TYPE') {
+						this.sourceTypeList = res.data
+					}
+				}
+			});
+		},
+		// 关闭弹窗
+		handleClose() {
+			this.isShow = false
+		},
+		// 打开时间选择弹框
+		openPicker() {
+			this.showPicker = true
+		},
+		// 确认日期选择
+		onSelected(v) {
+			this.form.time = v.value[0] + ' ~ ' + v.value[1]
+			this.beginDate = v.value[0]
+			this.endDate = v.value[1]
+			this.showPicker = false
+		},
+		// 过滤已选数据
+		filterData(data) {
+			let arr = []
+			data.map(item => {
+				if (item.checked) {
+					arr.push(item.code)
+				}
+			});
+			return arr
+		},
+		// 选择检查方式
+		chooseSourceType(item) {
+			item.checked = !item.checked
+		},
+		// 查询
+		handleSearch() {
+			let params = {
+				beginDate: this.beginDate,
+				endDate: this.endDate,
+				storeName: this.form.storeName,
+				sourceType: this.sourceType
+			};
+			this.$emit('refresh', params)
+			this.isShow = false
+		},
+		// 重置
+		resetForm() {
+			this.$refs.uForm.resetFields()
+			this.sourceTypeList.map(item => {
+				item.checked = false
+			});
+			this.$emit('refresh', {})
+			this.isShow = false
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.modal-content {
+	position: relative;
+}
+.search-popup {
+	.search-title {
+		text-align: center;
+		padding: 22upx;
+		color: #333;
+		border-bottom: 1px solid #eee;
+	}
+	.form-content {
+		padding: 0 20upx;
+		.status-item {
+			width: 30%;
+			text-align: center;
+			line-height: 60upx;
+			background-color: #e2e2e2;
+			color: #333;
+			font-size: 24upx;
+			margin: 0 10upx;
+		}
+		.active {
+			background-color: #ffaa00;
+			color: #fff;
+		}
+	}
+	.uni-list {
+		margin: 20upx;
+		.uni-list-cell {
+			display: flex;
+			align-items: center;
+			border-bottom: 1px dashed #eeeeee;
+			.uni-list-cell-db {
+				flex: 1;
+			}
+			.uni-input {
+				height: 2.5em;
+				line-height: 2.5em;
+			}
+		}
+	}
+	.uni-list-btns {
+		display: flex;
+		padding: 20upx;
+		uni-button {
+			font-size: 28upx;
+			margin: 0 30upx;
+			flex: 1;
+		}
+	}
+}
+.date-picker {
+}
+</style>

+ 11 - 19
pages/organization/organization.vue

@@ -44,14 +44,11 @@
 			return{
 				organizationNowList: [],  //  组织机构  当前显示 列表数据
 				organizationList: [],  //  组织机构  总列表数据
-				nowStructure: [  //  面包屑
-					'西安车领主网络科技有限公司'
-				],
-				nowInd: [],
+				nowStructure: [],  //  面包屑
+				nowInd: [],  //  下标数组
 				status: 'loading',  //  加载中状态
 				noDataText: '暂无数据',  //  数据异常提示
 				list: [],  //  门店数据列表
-				organizationData: []
 			}
 		},
 		onLoad() {
@@ -80,11 +77,13 @@
 			getOrgList(){
 				findUserInfo().then(res => {
 					if(res.status == 200){
+						this.nowStructure.push(res.data[0].name)
 						this.organizationList = res.data
-						this.organizationNowList = res.data
+						this.organizationNowList = res.data[0].children
 					}else{
 						this.organizationList = []
 						this.organizationNowList = []
+						this.nowStructure = []
 					}
 				})
 			},
@@ -103,8 +102,9 @@
 			checkedStructure(ind){
 				if(ind == 0){
 					this.nowInd = []
-					this.organizationNowList = this.organizationList
-					this.nowStructure = ['西安车领主网络科技有限公司']
+					this.organizationNowList = this.organizationList[0].children
+					this.nowStructure = []
+					this.nowStructure.push(this.organizationList[0].name)
 					this.getStoreList()
 				}else{
 					let subInd = JSON.parse(JSON.stringify(this.nowInd)).splice(0, ind)
@@ -112,8 +112,8 @@
 					let code = ''  //  组织机构编码
 					for(let i=0; i< subInd.length;i++){
 						if(i==0){
-							this.organizationNowList = this.organizationList[subInd[i]].children
-							code = this.organizationList[subInd[i]].code
+							this.organizationNowList = this.organizationList[0].children[subInd[i]].children
+							code = this.organizationList[0].children[subInd[i]].code
 						}else{
 							this.organizationNowList = this.organizationNowList[subInd[i]].children
 							code = this.organizationNowList[subInd[i]].code
@@ -158,15 +158,6 @@
 					}
 				})
 			}
-		},
-		watch: {
-			nowStructure(val){
-				if(val.length == 1){
-					this.nowStructure[0] = '西安车领主网络科技有限公司'
-				}else{
-					this.nowStructure[0] = '车领主'
-				}
-			}
 		}
 	}
 </script>
@@ -185,6 +176,7 @@
 			top: 0;
 			width: 100%;
 			padding: 20upx 30upx;
+			line-height: 48upx;
 			background-color: #fff;
 			border-bottom: 20upx solid #f8f8f8;
 			z-index: 1;

+ 12 - 2
pages/shopTourCompleted/shopTourCompleted.vue

@@ -53,7 +53,7 @@
 
 <script>
 	import moment from "moment"
-	import {getTaskDetail} from '@/api/task'
+	import { getTaskDetail } from '@/api/task.js'
 	export default{
 		data(){
 			return{
@@ -67,7 +67,17 @@
 		},
 		filters:{
 			formatTime(s){
-				return moment.duration(s*1000).hours() + '时' + moment.duration(s*1000).minutes() + '分';
+				let time = ''
+				if(moment.duration(s*1000).hours()){
+					time += moment.duration(s*1000).hours() + '时'
+				}
+				if(moment.duration(s*1000).minutes()){
+					time += moment.duration(s*1000).minutes() + '分'
+				}
+				if(moment.duration(s*1000).seconds()){
+					time += moment.duration(s*1000).seconds() + '秒'
+				}
+				return time
 			}
 		},
 		methods: {

+ 21 - 25
pages/shopTourDetails/commentPopup.vue

@@ -3,8 +3,8 @@
 		<view class="popup-con">
 			<view class="popup-tit">查看评论</view>
 			<view class="popup-main">
-				<u-swiper :list="list" class="popup-swiper" @click="clickSwiper"></u-swiper>
-				<view class="popup-des">未按规则着装,上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响上班时间玩手机抽烟等不良影响</view>
+				<u-swiper :list="list" :autoplay="false" :height="400" class="popup-swiper" @click="clickSwiper"></u-swiper>
+				<view class="popup-des">{{comments}}</view>
 			</view>
 		</view>
 	</u-popup>
@@ -17,24 +17,23 @@
 			openPopup: {
 				type: Boolean,
 				default: false
+			},
+			comments: {  //  评论
+				type: String,
+				default: ''
+			},
+			taskTargetPhotoList: {  //  评论图片
+				type: Array,
+				default: () => {
+					return []
+				}
 			}
 		},
 		data(){
 			return{
 				isShow: this.openPopup,  //  是否显示弹框
-				list: [{
-						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
-						title: '昨夜星辰昨夜风,画楼西畔桂堂东'
-					},
-					{
-						image: require('@/static/defaultMe.png'),
-						title: '身无彩凤双飞翼,心有灵犀一点通'
-					},
-					{
-						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
-						title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
-					}
-				],
+				list: this.taskTargetPhotoList,  //  评论图片
+				current: 0  //  幻灯片当前下标
 			}
 		},
 		methods: {
@@ -43,16 +42,7 @@
 				// 预览图片
 				uni.previewImage({
 					current: e,
-					urls: this.list[e],
-					longPressActions: {
-						itemList: ['发送给朋友', '保存图片', '收藏'],
-						success: function(data) {
-							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
-						},
-						fail: function(err) {
-							console.log(err.errMsg);
-						}
-					}
+					urls: this.list
 				})
 			}
 		},
@@ -64,6 +54,12 @@
 				if(!val){
 					this.$emit('close')
 				}
+			},
+			taskTargetPhotoList: {
+				handler(newV, oldV){
+					this.list = newV
+				},
+				deep: true
 			}
 		}
 	}

+ 41 - 40
pages/shopTourDetails/shopTourDetails.vue

@@ -2,77 +2,78 @@
 	<view class="shopTourDetails-wrap">
 		<scroll-view scroll-y class="scroll-con-l">
 			<view class="item-con" v-for="(item, index) in itemList" :key="index">
-				<view :class="['item-tit', nowInd==index ? 'active' : '']" @click="changeType(index)">{{item.name}}</view>
+				<view :class="['item-tit', nowInd==index ? 'active' : '']" @click="changeType(index)">{{item.assessItemName}}</view>
 			</view>
 		</scroll-view>
-		<scroll-view scroll-y class="scroll-con-r" @scrolltolower="onreachBottom">
+		<scroll-view scroll-y class="scroll-con-r">
 			<view class="item-con" v-for="(item, index) in evaluationItemsList" :key="index">
-				<view class="item-tit">{{item.name}}</view>
+				<view class="item-tit">{{item.assessTargetName}}</view>
 				<view class="item-main">
 					<view class="item-state">状态:
-						<text v-if="item.state == 0" class="green">合格</text>
-						<text v-if="item.state == 1" class="red">不合格</text>
-						<text v-if="item.state == 2" class="yellow">不适用</text>
+						<text :class="item.result == 'PASS' ? 'green' : item.result == 'NOT_PASS' ? 'red' : item.result == 'NOT_WORK' ? 'yellow' : ''">{{item.resultDictValue}}</text>
 					</view>
-					<text class="item-btn" @click="openPopup=true">查看评论</text>
+					<text v-if="item.comments || item.taskTargetPhotoList" class="item-btn" @click="getComments(item)">查看评论</text>
 				</view>
 				<view class="item-footer">
 					考核时间:2020-09-09 14:29
 				</view>
 			</view>
+			<u-empty text="暂无数据" img-width="120" v-if="evaluationItemsList.length == 0" mode="list"></u-empty>
 		</scroll-view>
 		<!-- 查看评论 -->
-		<comment-popup :openPopup="openPopup" @close="closePopup" />
+		<comment-popup :openPopup="openPopup" :comments="comments" :taskTargetPhotoList="taskTargetPhotoList" @close="closePopup" />
 	</view>
 </template>
 
 <script>
 	import CommentPopup from './commentPopup.vue'
+	import { detailsTaskItem } from '@/api/taskItem.js'
 	export default{
 		components: { CommentPopup },
 		data(){
 			return{
-				itemList: [  //  考评项目
-					{ name: '工作态度' },
-					{ name: '办事效率' },
-					{ name: '正常营业' },
-					{ name: '工作态度' },
-				],
-				evaluationItemsList: [  //  考评项
-					{ name: '按时完成工作', state: 0 },
-					{ name: '待人接物礼貌', state: 1 },
-					{ name: '按时完成工作', state: 2 },
-					{ name: '待人接物礼貌', state: 1 },
-					{ name: '按时完成工作', state: 0 },
-					{ name: '待人接物礼貌', state: 1 },
-					{ name: '按时完成工作', state: 2 },
-					{ name: '待人接物礼貌', state: 1 },
-					{ name: '按时完成工作', state: 0 },
-					{ name: '待人接物礼貌', state: 1 },
-					{ name: '按时完成工作', state: 2 },
-					{ name: '待人接物礼貌', state: 1 },
-					{ name: '按时完成工作', state: 0 },
-					{ name: '待人接物礼貌', state: 1 },
-					{ name: '按时完成工作', state: 2 },
-					{ name: '待人接物礼貌', state: 1 },
-				],
+				itemList: [],  //  考评项目
+				evaluationItemsList: [],  //  考评项
 				nowInd: 0,  //  当前考评分类
 				openPopup: false,  //  查看评论
+				detail: null,  //  详情
+				taskId: '',  //  任务id
+				comments: '',  //  评论
+				taskTargetPhotoList: [],  //  评论图片
 			}
 		},
+		onLoad(opts) {
+			this.taskId = opts.taskId
+			this.getTaskItem()
+		},
 		methods: {
-			// scroll-view到底部加载更多
-			onreachBottom() {
-				// if(this.list.length < this.total){
-				// 	this.pageNo += 1
-				// 	this.pageInit()
-				// }else{
-				// 	this.status = "nomore"
-				// }
+			getTaskItem(){
+				detailsTaskItem({ id: this.taskId }).then(res => {
+					if(res.status == 200){
+						this.itemList = res.data
+						this.nowInd = 0
+						this.evaluationItemsList = this.itemList[this.nowInd].taskTargetVOList ? this.itemList[this.nowInd].taskTargetVOList : []
+					}
+				})
 			},
 			//  切换分类
 			changeType(ind){
 				this.nowInd = ind
+				this.evaluationItemsList = this.itemList[this.nowInd].taskTargetVOList ? this.itemList[this.nowInd].taskTargetVOList : []
+			},
+			//  查看评论
+			getComments(item){
+				this.comments = item.comments ? item.comments : ''
+				if(item.taskTargetPhotoList){
+					let arr = []
+					item.taskTargetPhotoList.map(params => {
+						arr.push(params.photoBasePath + params.photoPath)
+					})
+					this.taskTargetPhotoList = arr
+				}else{
+					this.taskTargetPhotoList = []
+				}
+				this.openPopup = true
 			},
 			//  关闭   查看评论
 			closePopup(){

+ 254 - 0
pages/shopTourRecord/screenModule.vue

@@ -0,0 +1,254 @@
+<template>
+	<view>
+		<!-- 顶部筛选条件 -->
+		<u-dropdown ref="uDropdown" class="uDropdown">
+			<u-dropdown-item v-model="searchForm.inspectorId" :title="isAll" @change="dropdownChange" :options="screenClass"></u-dropdown-item>
+			<u-dropdown-item title="检查方式" class="screen-dropdown" @change="typeChange" @close="closeDropdownItem">
+				<view class="slot-content">
+					<scroll-view class="scroll-view" scroll-y="true">
+						<view class="screen-module">
+							<view :class="['status-item', item.checked ? 'active' : '']" v-for="item in sourceTypeList" :key="item.id" @click="chooseSourceType(item)">
+								{{ item.dispName }}
+							</view>
+						</view>
+					</scroll-view>
+					<u-button type="primary" @click="closeTypeDropdown">确定</u-button>
+				</view>
+			</u-dropdown-item>
+			<u-dropdown-item v-model="searchForm.status" title="状态" :options="screenState" @change="dropdownChange"></u-dropdown-item>
+			<u-dropdown-item title="筛选" class="screen-dropdown" @close="closeDropdownItem">
+				<view class="slot-content">
+					<scroll-view class="scroll-view" scroll-y="true">
+						<view class="screen-module">
+							<text class="screen-tit">时间区间:</text>
+							<view class="screen-time-val">
+								<text @click="onShowDatePicker('range')">{{ range.length == 0 ? '请选择' : range[0] + '~' + range[1] }}</text>
+								<u-icon v-show="range.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="range=[]"></u-icon>
+							</view>
+						</view>
+						<view class="screen-module">
+							<text class="screen-tit">门店:</text>
+							<view class="screen-inp-val">
+								<u-input class="screen-inp" v-model="searchForm.storeName" :height="52" placeholder="请输入" type="text" :border="true" />
+							</view>
+						</view>
+						<view class="screen-module">
+							<text class="screen-tit">巡店人:</text>
+							<view class="screen-inp-val">
+								<u-input class="screen-inp" v-model="searchForm.shopInspector" :height="52" placeholder="请输入" type="text" :border="true" />
+							</view>
+						</view>
+					</scroll-view>
+					<u-button type="primary" @click="closeDropdown">确定</u-button>
+				</view>
+			</u-dropdown-item>
+		</u-dropdown>
+		<!-- 选择时间区间 -->
+		<w-picker
+			:visible.sync="showPicker"
+			mode="range" 
+			startYear="2017" 
+			endYear="2030"
+			:value="searchForm.creatTime"
+			:current="false"
+			@confirm="onSelected($event,'range')"
+			@cancel="onSelected"
+			ref="range"></w-picker>
+	</view>
+</template>
+
+<script>
+	import wPicker from '@/components/w-picker/w-picker.vue'
+	import { getLookUpDatas } from '@/api/data.js'
+	export default{
+		components: { wPicker },
+		props: {
+			defaultParams: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			}
+		},
+		data(){
+			return{
+				searchForm: this.defaultParams,  //  筛选条件
+				screenClass: [  // 过滤条件  类型
+					{ label: '全部', value: '', },
+					{ label: '我的巡店', value: 2 }
+				],
+				screenMethod: [],  // 过滤条件  检查方式
+				screenState: [],  // 过滤条件  状态
+				showPicker: false,  //  是否选择创建时间
+				range: [],  //  筛选创建时间的默认值
+				sourceTypeList: [], // 检查方式列表
+			}
+		},
+		computed: {
+			isAll(){
+				let str = this.searchForm.inspectorId ? '我的巡店' : '全部'
+				return str
+			},
+			// 检查方式
+			sourceType() {
+				return this.filterData(this.sourceTypeList)
+			}
+		},
+		mounted() {
+			this.getLookUpData('TASK_TYPE')  // 获取检查方式
+			this.getLookUpData('TASK_STATUS')  // 获取状态
+			this.init()
+		},
+		methods: {
+			//  初始化
+			init(){
+				this.searchForm.creatTime = this.defaultParams.creatTime ? this.defaultParams.creatTime : []
+				this.range = this.searchForm.creatTime
+				this.searchForm.storeName = this.defaultParams.storeName ? this.defaultParams.storeName : ''
+				this.defaultSourceType()
+			},
+			//  巡店人、状态  筛选条件  change
+			dropdownChange(val){
+				this.$emit('refresh', this.searchForm)
+			},
+			//  检查方式  筛选条件
+			closeTypeDropdown(){
+				this.searchForm.typeList = this.sourceType
+				this.$emit('refresh', this.searchForm)
+				this.$refs.uDropdown.close()
+			},
+			//  筛选  筛选条件
+			closeDropdown(){
+				this.$emit('refresh', this.searchForm)
+				this.$refs.uDropdown.close()
+			},
+			//  默认检查方式
+			defaultSourceType(){
+				if(this.defaultParams.typeList){
+					setTimeout(()=>{
+						this.sourceTypeList.map(item => {
+							if(this.defaultParams.typeList.indexOf(item.code) != -1){
+								item.checked = true
+							}else{
+								item.checked = false
+							}
+						})
+					},0)
+				}
+			},
+			//  关闭
+			closeDropdownItem(){
+				
+			},
+			// 获取数据字典数据
+			getLookUpData(code) {
+				getLookUpDatas({ type: code }).then(res => {
+					if (res.status == 200) {
+						res.data.map(item => {
+							item.label = item.dispName
+							item.value = item.code
+							item.checked = false
+						})
+						if (code == 'TASK_TYPE') {  //  检查方式
+							this.sourceTypeList = res.data
+						}else if(code == 'TASK_STATUS'){  //  状态
+							res.data.unshift({label: '全部', value: ''})
+							this.screenState = res.data
+						}
+					}
+				});
+			},
+			// 选择检查方式
+			chooseSourceType(item) {
+				item.checked = !item.checked
+			},
+			// 过滤已选数据
+			filterData(data) {
+				let arr = []
+				data.map(item => {
+					if (item.checked) {
+						arr.push(item.code)
+					}
+				});
+				return arr
+			},
+			//  显示日期选择
+			onShowDatePicker(type){
+				this.showPicker = true
+			},
+			//  日期选择
+			onSelected(e) {
+				this.showPicker = false
+				if(e) {
+					this.range = e.value
+					this.searchForm.creatTime = this.range
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	// 筛选条件
+	.uDropdown{
+		background-color: #fff;
+		.screen-dropdown{
+			.slot-content{
+				background-color: #fff;
+				.scroll-view{
+					height: 300upx;
+					.screen-module{
+						margin: 20upx 30upx 20upx;
+						display: flex;
+						align-items: center;
+						.screen-tit{
+							color: #464646;
+							font-size: 26upx;
+							width: 140upx;
+							flex-shrink: 0;
+						}
+						.screen-time-val{
+							flex-grow: 1;
+							font-size: 26upx;
+							background-color: #f4f4f4;
+							border-radius: 12upx;
+							padding: 10upx 14upx;
+							margin: 10upx 0;
+							text-align: center;
+							text{
+								display: inline-block;
+								width: 85%;
+							}
+							.close-circle{
+								display: inline-block;
+								padding-left: 3%;
+								vertical-align: bottom;
+							}
+						}
+						.screen-inp-val{
+							flex-grow: 1;
+							.screen-inp{
+								color: #464646;
+								font-size: 26upx;
+							}
+						}
+					}
+					.status-item {
+						display: inline-block;
+						width: 30%;
+						text-align: center;
+						line-height: 60upx;
+						background-color: #e2e2e2;
+						color: #333;
+						font-size: 24upx;
+						margin: 0 10upx;
+					}
+					.active {
+						background-color: #ffaa00;
+						color: #fff;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 95 - 97
pages/shopTourRecord/shopTourRecord.vue

@@ -1,38 +1,7 @@
 <template>
 	<view class="shopTourRecord-wrap">
 		<u-sticky offset-top="0">
-			<!-- 顶部筛选条件 -->
-			<u-dropdown ref="uDropdown" class="uDropdown">
-				<u-dropdown-item v-model="searchForm.isAll" title="全部" :options="screenClass"></u-dropdown-item>
-				<u-dropdown-item v-model="searchForm.inspectionMethod" title="检查方式" :options="screenMethod"></u-dropdown-item>
-				<u-dropdown-item v-model="searchForm.state" title="状态" :options="screenState"></u-dropdown-item>
-				<u-dropdown-item title="筛选" class="screen-dropdown">
-					<view class="slot-content">
-						<scroll-view class="scroll-view" scroll-y="true">
-							<view class="screen-module">
-								<text class="screen-tit">时间区间:</text>
-								<view class="screen-time-val">
-									<text @click="onShowDatePicker('range')">{{ range.length == 0 ? '请选择' : range[0] + '~' + range[1] }}</text>
-									<u-icon v-show="range.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="range=[]"></u-icon>
-								</view>
-							</view>
-							<view class="screen-module">
-								<text class="screen-tit">门店:</text>
-								<view class="screen-inp-val">
-									<u-input class="screen-inp" v-model="searchForm.store" :height="52" placeholder="请输入" type="text" :border="true" />
-								</view>
-							</view>
-							<view class="screen-module">
-								<text class="screen-tit">巡店人:</text>
-								<view class="screen-inp-val">
-									<u-input class="screen-inp" v-model="searchForm.shopInspector" :height="52" placeholder="请输入" type="text" :border="true" />
-								</view>
-							</view>
-						</scroll-view>
-						<u-button type="primary" @click="closeDropdown">确定</u-button>
-					</view>
-				</u-dropdown-item>
-			</u-dropdown>
+			<screenModule :defaultParams="searchForm" @refresh="refresh" />
 		</u-sticky>
 		<!-- 列表数据 -->
 		<view class="list-con">
@@ -76,73 +45,38 @@
 						</u-grid>
 					</view>
 				</view>
-				<u-empty :text="noDataText" img-width="120" v-if="list.length == 0 && status != 'loading'" mode="list"></u-empty>
+				<u-empty :text="noDataText" img-width="120" :margin-top="400" v-if="list.length == 0 && status != 'loading'" mode="list"></u-empty>
 				<view style="padding: 20upx;"><u-loadmore v-if="total > pageSize || status == 'loading'" :status="status" /></view>
 			</scroll-view>
 		</view>
-		
-		<!-- 选择时间区间 -->
-		<w-picker
-			:visible.sync="showPicker"
-			mode="range" 
-			startYear="2017" 
-			endYear="2030"
-			:value="searchForm.creatTime"
-			:current="false"
-			@confirm="onSelected($event,'range')"
-			@cancel="onSelected"
-			ref="range"></w-picker>
 	</view>
 </template>
 
 <script>
-	import wPicker from "@/components/w-picker/w-picker.vue"
-	import { queryMyTask } from '@/api/task.js'
+	import screenModule from './screenModule.vue'
+	import { getTasksList } from '@/api/task.js'
 	export default{
-		components: { wPicker },
+		components: { screenModule },
 		data(){
 			return{
-				screenClass: [  // 过滤条件  类型
-					{ label: '全部', value: 1, },
-					{ label: '我的巡店', value: 2, }
-				],
-				screenMethod: [  // 过滤条件  检查方式
-					{ label: '现场巡店', value: 1, },
-					{ label: '视频巡店', value: 2, },
-					{ label: '点检任务', value: 3, }
-				],
-				screenState: [  // 过滤条件  状态
-					{ label: '全部', value: 1, },
-					{ label: '待处理', value: 2, },
-					{ label: '进行中', value: 3, },
-					{ label: '已完成', value: 4, },
-					{ label: '已过期', value: 5, }
-				],
 				searchForm: {
-					isAll: '1',  //  全部(全部、我的巡店
-					inspectionMethod: '',  //  检查方式(现场巡店、视频巡店、点检任务)
-					state: '1',  //  状态(全部、待处理、进行中、已完成、已过期)
-					creatTime: '',  //  时间区间(天)
-					store: '',  //  门店
+					inspectorId: '',  //  全部(全部为空、我的巡店为巡店人id)
+					typeList: [],  //  检查方式(现场巡店、视频巡店、点检任务)
+					status: '',  //  状态(全部、待处理、进行中、已完成、已过期)
+					creatTime: [],  //  时间区间(天)
+					storeName: '',  //  门店
 					shopInspector: ''  //  巡店人
 				},
-				showPicker: false,  //  是否选择创建时间
-				range: [],  //  筛选创建时间的默认值
 				pageNo: 1,  //  当前页码
 				pageSize: 15,  //  一页多少条
 				total: 0,  //  总条数
 				status: 'loadmore',  //  加载状态
 				noDataText: '暂无数据',  //  列表数据为空时提示文字
-				list: [  //  数据列表
-					{ name: '常青二店', creatTime: '2020-09-08 09:16', orderStatus: 'haveInHand', shopInspector: '张三' },
-					{ name: '常青二店', creatTime: '2020-09-08 09:16', orderStatus: 'invalid', shopInspector: '李四' },
-					{ name: '常青二店', creatTime: '2020-09-08 09:16', orderStatus: 'haveInHand', shopInspector: '王五' },
-					{ name: '常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店常青二店', creatTime: '2020-09-08 09:16', orderStatus: 'completed', shopInspector: '王权富贵' },
-					{ name: '常青二店', creatTime: '2020-09-08 09:16', orderStatus: 'completed', shopInspector: '钱六' },
-				],
+				list: [],  //  数据列表
 			}
 		},
 		onLoad() {
+			// console.log(this.$store.state.vuex_userData)
 			this.range = [ this.get7day(-6), this.get7day(0) ]
 			this.searchForm.creatTime = [ this.get7day(-6), this.get7day(0) ]
 			this.pageInit(1)
@@ -156,9 +90,16 @@
 				this.status = 'loading'
 				let params = {
 					pageNo: this.pageNo,
-					pageSize: this.pageSize
+					pageSize: this.pageSize,
+					beginDate: this.searchForm.creatTime[0] ? this.searchForm.creatTime[0] : '',
+					endDate: this.searchForm.creatTime[1] ? this.searchForm.creatTime[1] : '',
+					storeName: this.searchForm.storeName ? this.searchForm.storeName : '',
+					typeList: this.searchForm.typeList ? this.searchForm.typeList : [],
+					status: this.searchForm.status ? this.searchForm.status : '', // 任务状态
+					inspectorId: this.searchForm.inspectorId ? this.searchForm.inspectorId : '',
+					shopInspector: this.searchForm.shopInspector ? this.searchForm.shopInspector : '',
 				}
-				queryMyTask(params).then(res => {
+				getTasksList(params).then(res => {
 					if (res.status == 200) {
 						if (this.pageNo > 1) {
 							this.list = this.list.concat(res.data.list || [])
@@ -174,6 +115,12 @@
 					this.status = 'loadmore'
 				});
 			},
+			//  筛选
+			refresh(params){
+				console.log(params,'1111111111')
+				this.searchForm = params
+				this.pageInit(1)
+			},
 			//  获取近几天的数据
 			get7day(day){
 				let today = new Date()
@@ -203,27 +150,63 @@
 					this.status = 'nomore'
 				}
 			},
-			//  关闭筛选
-			closeDropdown() {
-				this.$refs.uDropdown.close()
-			},
-			//  显示日期选择
-			onShowDatePicker(type){
-				this.showPicker = true
-				this.searchForm.creatTime = this.range
-			},
-			//  日期选择
-			onSelected(e) {
-				this.showPicker = false
-				if(e) {
-					this.range = e.value
-				}
-			},
+			// //  关闭筛选
+			// closeDropdown() {
+			// 	this.$refs.uDropdown.close()
+			// },
+			// //  显示日期选择
+			// onShowDatePicker(type){
+			// 	this.showPicker = true
+			// 	this.searchForm.creatTime = this.range
+			// },
+			// //  日期选择
+			// onSelected(e) {
+			// 	this.showPicker = false
+			// 	if(e) {
+			// 		this.range = e.value
+			// 	}
+			// // },
+			
+			
+			// // 过滤已选数据
+			// filterData(data) {
+			// 	let arr = []
+			// 	data.map(item => {
+			// 		if (item.checked) {
+			// 			arr.push(item.code)
+			// 		}
+			// 	});
+			// 	return arr
+			// },
+			
+			
+			// // 选择检查方式
+			// chooseSourceType(item) {
+			// 	item.checked = !item.checked
+			// },
+			// 获取数据字典数据
+			// getLookUpData(code) {
+			// 	getLookUpDatas({ type: code }).then(res => {
+			// 		if (res.status == 200) {
+			// 			res.data.map(item => {
+			// 				item.label = item.dispName
+			// 				item.value = item.code
+			// 				item.checked = false
+			// 			})
+			// 			if (code == 'TASK_TYPE') {  //  检查方式
+			// 				this.sourceTypeList = res.data
+			// 			}else if(code == 'TASK_STATUS'){  //  状态
+			// 				res.data.unshift({label: '全部', value: ''})
+			// 				this.screenState = res.data
+			// 			}
+			// 		}
+			// 	});
+			// },
 		}
 	}
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
 	page {
 		background-color: #f8f8f8;
 		height: calc(100vh - 44px);
@@ -237,6 +220,7 @@
 					background-color: #fff;
 					.scroll-view{
 						height: 300upx;
+						// margin: 20upx 30upx 20upx;
 						.screen-module{
 							margin: 20upx 30upx 20upx;
 							display: flex;
@@ -273,6 +257,20 @@
 								}
 							}
 						}
+						.status-item {
+							display: inline-block;
+							width: 30%;
+							text-align: center;
+							line-height: 60upx;
+							background-color: #e2e2e2;
+							color: #333;
+							font-size: 24upx;
+							margin: 0 10upx;
+						}
+						.active {
+							background-color: #ffaa00;
+							color: #fff;
+						}
 					}
 				}
 			}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 3 - 3
unpackage/dist/dev/app-plus/app-service.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 36 - 36
unpackage/dist/dev/app-plus/app-view.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
unpackage/dist/dev/app-plus/view.umd.min.js


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor