chenrui 4 лет назад
Родитель
Сommit
053ef3f384

+ 7 - 1
pages.json

@@ -145,11 +145,17 @@
 			}
 		},
 		{
-			"path": "pages/shopTourDetails/shopTourDetails", //  现场巡店-巡店详情
+			"path": "pages/shopTourDetails/shopTourDetails", //  巡店详情
 			"style": {
 				"navigationBarTitleText": "巡店详情"
 			}
 		},
+		{
+			"path": "pages/spotCheckDetails/spotCheckDetails", //  点检详情
+			"style": {
+				"navigationBarTitleText": "点检详情"
+			}
+		},
 		{
 			"path": "pages/spotCheckCenter/spotChecking",
 			"style": {

+ 7 - 2
pages/login/forget-pass.vue

@@ -3,7 +3,7 @@
 		<form class="login-form" @submit="formSubmit">
 			<view v-show="state == 0">
 				<view class="form-item">
-					<input v-model="form.phone" class="item-inp" name="phone" type="number" maxlength="11" placeholder="请输入登录手机号" />
+					<input v-model="form.phone" class="item-inp" name="phone" placeholder="请输入登录手机号" />
 				</view>
 				<view class="form-item">
 					<input v-model="form.verifyCode" class="item-inp" name="verifyCode" type="number" maxlength="6" placeholder="请输入短信验证码" />
@@ -47,7 +47,7 @@
 			return{
 				state: 0,  //  忘记密码当前状态
 				form: {
-					phone: this.$store.state.vuex_user.account,
+					phone: '',
 					verifyCode: '',
 					password: '',
 					passwords: ''
@@ -61,6 +61,11 @@
 				randomCode: '',  //  图片验证码随机码
 			}
 		},
+		onLoad(opts) {
+			if(opts.username){
+				this.form.phone = opts.username
+			}
+		},
 		methods: {
 			//  下一步
 			goStep(){

+ 14 - 7
pages/myShopTour/myShopTour.vue

@@ -64,18 +64,13 @@
 	import moment from "moment"
 	import searchModal from './searchModal.vue'
 	import wPicker from "@/components/w-picker/w-picker.vue"
+	import { getLookUpDatas } from '@/api/data.js'
 	import { queryMyTask } from '@/api/task.js'
 	export default {
 		components: { wPicker, searchModal },
 		data() {
 			return {
-				tabList: [  //  tab切换  类型
-					{ dispName: '全部', code:'' },
-					{ dispName: '待处理', code:'PENDING' },
-					{ dispName: '进行中', code:'RUNNING' },
-					{ dispName: '已完成', code:'FINISHED' },
-					{ dispName: '已过期', code:'EXPIRED' }
-				],
+				tabList: [],  //  tab切换  类型
 				current: 0,  //  tabs组件的current值,表示当前活动的tab选项
 				swiperCurrent: 0,  //  swiper组件的current值,表示当前那个swiper-item是活动的
 				pageNo: 1,  //  当前页码
@@ -126,6 +121,7 @@
 			}
 		},
 		onLoad() {
+			this.getLookUpData('TASK_STATUS')  // 获取任务状态
 			this.searchForm.beginDate = this.get7day(-6)
 			this.searchForm.endDate = this.get7day(0)
 			this.resetPage()
@@ -143,6 +139,17 @@
 				this.searchForm = params
 				this.pageInit(1)
 			},
+			// 获取数据字典数据
+			getLookUpData(code) {
+				getLookUpDatas({ type: code }).then(res => {
+					if (res.status == 200) {
+						if(code == 'TASK_STATUS'){  //  状态
+							res.data.unshift({dispName: '全部', code: ''})
+							this.tabList = res.data
+						}
+					}
+				})
+			},
 			// 查询列表
 			pageInit(pageNo){
 				if (pageNo) {

+ 1 - 0
pages/shopTourDetails/shopTourDetails.vue

@@ -47,6 +47,7 @@
 			this.getTaskItem()
 		},
 		methods: {
+			//  获取详情
 			getTaskItem(){
 				getTaskItem({ id: this.taskId }).then(res => {
 					if(res.status == 200){

+ 1 - 1
pages/shopTourRecord/screenModule.vue

@@ -75,7 +75,7 @@
 				searchForm: this.defaultParams,  //  筛选条件
 				screenClass: [  // 过滤条件  类型
 					{ label: '全部', value: '', },
-					{ label: '我的巡店', value: 2 }
+					{ label: '我的巡店', value: 0 }
 				],
 				screenMethod: [],  // 过滤条件  检查方式
 				screenState: [],  // 过滤条件  状态

+ 9 - 3
pages/shopTourRecord/shopTourRecord.vue

@@ -133,9 +133,15 @@
 			},
 			//  查看详情
 			getDetails(item){
-				uni.navigateTo({
-					url: '/pages/shopTourDetails/shopTourDetails?taskId=' + item.id
-				})
+				if(item.type == 'POINT_INSPECTION'){  //  点检任务
+					uni.navigateTo({
+						url: '/pages/spotCheckDetails/spotCheckDetails?taskId=' + item.id
+					})
+				}else{  //  现场巡店、视频巡店
+					uni.navigateTo({
+						url: '/pages/shopTourDetails/shopTourDetails?taskId=' + item.id
+					})
+				}
 			},
 			//  筛选
 			refresh(params){

+ 29 - 34
pages/spotCheckCenter/spotChecking.vue

@@ -15,7 +15,7 @@
 						:key="item.id">
 							<view class="check-row" @click="viewRow(item)">
 								<view class="createDate">{{ item.createDate }}</view>
-								<view :class="clsStatus(item.status)">{{ item.status }}</view>
+								<view :class="clsStatus(item.status)">{{ item.statusDictValue }}</view>
 							</view>
 							<view class="check-row" @click="viewRow(item)">
 								<view>
@@ -23,9 +23,9 @@
 									<view style="color: #666666;">{{ item.storeName }}</view>
 								</view>
 								<view>
-									<text v-if="item.status=='待处理'" style="color: #007AFF;">开始点检</text>
-									<text v-if="item.status=='已完成'" style="color: #007AFF;">查看结果</text>
-									<u-icon v-if="item.status!='已过期'" name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
+									<text v-if="item.status=='PENDING'" style="color: #007AFF;">开始点检</text>
+									<text v-if="item.status=='FINISHED'" style="color: #007AFF;">查看结果</text>
+									<u-icon v-if="item.status!='EXPIRED'" name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
 								</view>
 							</view>
 						</view>
@@ -39,32 +39,15 @@
 </template>
 
 <script>
-import { getTaskList } from '@/api/task.js';
-import { getLookUpDatas, listLookUp } from '@/api/data';
+import { getTasksList } from '@/api/task.js';
+import { getLookUpDatas } from '@/api/data';
 import { clzConfirm } from '@/libs/tools.js';
 export default {
 	data() {
 		return {
 			status: 'loadmore',
 			noDataText: '暂无数据',
-			tabList: [
-				{
-					dispName: '全部',
-					code: 1
-				},
-				{
-					dispName: '待处理',
-					code: 5
-				},
-				{
-					dispName: '已完成',
-					code: 3
-				},
-				{
-					dispName: '已过期',
-					code: 2
-				},
-			],
+			tabList: [],
 			typeId:'1',
 			current: 0,
 			swiperCurrent: 0,
@@ -76,6 +59,7 @@ export default {
 		};
 	},
 	onLoad() {
+		this.getLookUpData('POINT_TASK_STATUS')  // 获取任务状态
 		this.resetPage();
 		uni.$on("updatePointTaskList",()=>{
 			this.resetPage();
@@ -91,6 +75,17 @@ export default {
 				title: title
 			});
 		},
+		// 获取数据字典数据
+		getLookUpData(code) {
+			getLookUpDatas({ type: code }).then(res => {
+				if (res.status == 200) {
+					if(code == 'POINT_TASK_STATUS'){  //  状态
+						res.data.unshift({dispName: '全部', code: ''})
+						this.tabList = res.data
+					}
+				}
+			})
+		},
 		// tabs通知swiper切换
 		tabsChange(index) {
 			this.swiperCurrent = index;
@@ -150,11 +145,11 @@ export default {
 			let params = {
 				pageNo: this.pageNo,
 				pageSize: this.pageSize,
-				type: '点检任务', // 任务类型
+				type: 'POINT_INSPECTION', // 任务类型
 				status: this.typeId=='1'?'':this.typeId // 任务状态
 			};
 			this.status = 'loading';
-			getTaskList(params).then(res => {
+			getTasksList(params).then(res => {
 				if (res.status == 200) {
 					if (_this.pageNo > 1) {
 						_this.list = _this.list.concat(res.data.list || []);
@@ -173,29 +168,29 @@ export default {
 		//判断状态,待处理的跳转的开始点检页面,已完成的查看点检结果,已过期的不处理
 		viewRow(item) {
 			// 已完成的
-			if(item.status == '已完成'){
+			if(item.status == 'FINISHED'){
 				uni.navigateTo({
 					url: '/pages/spotCheckCenter/spotCheckResult?id=' + item.id
 				});
 			}
 			// 待处理,开始点检
-			if(item.status == '待处理'){
+			if(item.status == 'PENDING'){
 				uni.navigateTo({
 					url: '/pages/spotCheck/spotCheck?taskId=' + item.id + '&types=video&storeId='+item.storeId+'&storeName='+item.storeName
 				});
 			}
 		},
 		clsStatus(status){
-			if(status == '待处理'){
+			if(status == 'PENDING'){  //  待处理
 				return 'dcl'
 			}
-			if(status == '进行中'){
-				return 'jxz'
-			}
-			if(status == '已完成'){
+			// if(status == '进行中'){
+			// 	return 'jxz'
+			// }
+			if(status == 'FINISHED'){  //  已完成
 				return 'ywc'
 			}
-			if(status == '已过期'){
+			if(status == 'EXPIRED'){  //  已过期
 				return 'ygq'
 			}
 		}

+ 14 - 10
pages/spotCheckDetails/spotCheckDetails.vue

@@ -63,24 +63,28 @@
 						remarks: '未穿工服、办公桌面不整洁',
 						state: 2
 					},
-				]
+				],
+				taskId: ''  //  任务id
 			}
 		},
+		onLoad(opts) {
+			this.taskId = opts.taskId ? opts.taskId : ''
+			this.getDetails()
+		},
 		methods: {
 			//  查看评论大图
 			clickPic(index,ind){
 				// 预览图片
 				uni.previewImage({
 					current: ind,
-					urls: this.list[index].picList[ind],
-					longPressActions: {
-						itemList: ['发送给朋友', '保存图片', '收藏'],
-						success: function(data) {
-							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
-						},
-						fail: function(err) {
-							console.log(err.errMsg);
-						}
+					urls: this.list[index].picList
+				})
+			},
+			//  获取详情
+			getDetails(){
+				getTaskItem({ id: this.taskId }).then(res => {
+					if(res.status == 200){
+						this.list = res.data
 					}
 				})
 			}