Bladeren bron

现场巡店

lilei 4 jaren geleden
bovenliggende
commit
a981d8f30a

+ 3 - 1
components/autograph-to-pic/autograph-to-pic.vue

@@ -41,7 +41,9 @@ export default {
 		//  是否为空校验
 		isEmpty: {
 			type: Array,
-			default: []
+			default: function(){
+				return []
+			}
 		}
 	},
 	data(){

+ 9 - 2
pages/shopTour/shopTour.vue

@@ -206,8 +206,7 @@
 					success: function(res) {
 						if (res.confirm || res.index == 0) {
 							submitTask({
-								storeId:_this.storeId,
-								taskId: _this.taskId
+								id: _this.taskId
 							}).then(ret=>{
 								console.log(ret)
 								if(ret.status == 200){
@@ -271,6 +270,14 @@
 			uni.$on("resetTaskKpItem",(schemeId)=>{
 				_this.updateTaskItem(schemeId)
 			})
+			
+			// 关闭当前页面
+			uni.$on("closeTour",(flag)=>{
+				if(flag==1){
+					this.isClose = true
+					uni.navigateBack()
+				}
+			})
 		},
 		// 监听返回键
 		onBackPress() {

+ 38 - 10
pages/shopTourOver/shopTourOver.vue

@@ -20,6 +20,7 @@
 
 <script>
 	import AutographToPic from '@/components/autograph-to-pic/autograph-to-pic.vue'
+	import {submitTask} from '@/api/task'
 	export default{
 		components: {
 			AutographToPic
@@ -29,20 +30,47 @@
 				isEmpty: [  //  是否为空判断
 					{name: 'handWriting-dz', state: false},
 					{name: 'handWriting-xd', state: false}
-				]
+				],
+				taskId: '',
+				inspectorSign:'', // 巡店人签名
+				storeManagerSign:'', // 店长签名
 			}
 		},
+		onLoad(opts) {
+			this.taskId = opts.taskId
+		},
 		methods: {
-			//  提交
+			// 提交本次任务
 			submitFun(){
-				// this.isEmpty = [
-				// 	{name: 'handWriting-dz', state: true},
-				// 	{name: 'handWriting-xd', state: true},
-				// ]
-				uni.navigateTo({
-					url: '/pages/shopTourCompleted/shopTourCompleted'
-				})
-			}
+				const _this = this;
+				clzConfirm({
+					title: '提示',
+					content: '确定提交本次巡店?',
+					success: function(res) {
+						if (res.confirm || res.index == 0) {
+							submitTask({
+								id: _this.taskId,
+								inspectorSign: _this.inspectorSign,
+								storeManagerSign: _this.storeManagerSign
+							}).then(ret=>{
+								console.log(ret)
+								if(ret.status == 200){
+									// 关闭上页
+									uni.$emit("closeTour",1)
+									// 打开完成页面
+									uni.redirectTo({
+										url:"/pages/shopTourCompleted/shopTourCompleted?taskId="+_this.taskId
+									})
+								}
+								uni.showToast({
+									icon:'none',
+									title: ret.message
+								})
+							})
+						}
+					}
+				});
+			},
 		}
 	}
 </script>

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


Some files were not shown because too many files changed in this diff