Explorar el Código

Merge branch 'deploy' of http://git.chelingzhu.com/chelingzhu-web/storeCheck-app into deploy

1004749546@qq.com hace 4 años
padre
commit
e13afdcc1f

+ 5 - 0
components/select/v-select.vue

@@ -38,6 +38,11 @@ export default {
       default: ''
     },
   },
+  watch: {
+  	value(newValue, oldValue) {
+  		this.setVal(newValue)
+  	}
+  },
   created () {
     if (this.code) {
       if (this.placeholder) {

+ 0 - 6
pages.json

@@ -205,12 +205,6 @@
 				"navigationBarTitleText": "考评指标详情"
 			}
 		},
-		{
-			"path": "pages/spotCheckConfigure/spotCheckDetail/evaluateStoreDetail",
-			"style": {
-				"navigationBarTitleText": "考评门店详情"
-			}
-		},
 		{
 			"path": "pages/spotCheckConfigure/evaluateItem",
 			"style": {

+ 1 - 1
pages/shopTourCompleted/shopTourCompleted.vue

@@ -8,7 +8,7 @@
 				</view>
 				<view class="info-main">
 					<text class="info-tit">巡店人:</text>
-					<text class="info-val">{{detail.inspectorName}}</text>
+					<text class="info-val">{{detail.userName}}</text>
 				</view>
 				<view class="info-main">
 					<text class="info-tit">创建时间:</text>

+ 32 - 2
pages/spotCheckConfigure/addSpotCheck.vue

@@ -41,7 +41,7 @@
 					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888" @click="openMDpage"></u-icon>
 				</u-form-item>
 				<u-form-item label="有效天数" label-width="160rpx" prop="effectiveDay">
-					<u-input v-model="form.effectiveDay" type="number" input-align="right" placeholder="请输入任务有效天数" />
+					<u-input v-model="form.effectiveDay" type="number" input-align="right" placeholder="请输入任务有效天数" />
 				</u-form-item>
 			</u-form>
 			<view class="btns">
@@ -62,7 +62,7 @@
 <script>
 import vSelect from '@/components/select/v-select.vue';
 import { clzConfirm } from '@/libs/tools.js';
-import { saveBackLog } from '@/api/checkTaskConfig.js'
+import { saveBackLog,getCheckTaskConfig } from '@/api/checkTaskConfig.js'
 import moment from 'moment';
 export default {
 	components: {
@@ -109,6 +109,12 @@ export default {
 			}
 		};
 	},
+	onLoad(opts) {
+		if(opts.id){
+			// 编辑
+			this.getCheckTaskConfig(opts.id)
+		}
+	},
 	onReady() {
 		this.$refs.uForm.setRules(this.rules);
 		// 检测选择的考评指标
@@ -133,6 +139,30 @@ export default {
 		uni.$off('selKpStores');
 	},
 	methods: {
+		// 编辑信息
+		getCheckTaskConfig(id){
+			getCheckTaskConfig({id}).then(res => {
+				if(res.status==200){
+					console.log(res.data)
+					let data = res.data
+					this.form = Object.assign(this.form,{
+						id: data.id,
+						name: data.name, // 任务名称
+						cycleType: data.cycleType, // 周期类型
+						buildDateDay: data.buildDateDay, // 执行日期
+						buildDateWeekList: data.buildDateWeekList, // 周几
+						buildTime: data.buildTime, // 执行时间
+						startDate: data.startDate, // 开始日期
+						endDate: data.endDate, // 结束日期
+						assessList: data.assessTargetList, // 考评指标
+						storeList: data.storeList, // 考评门店
+						effectiveDay: Number(data.effectiveDay) // 任务有效天数
+					})
+					// 回显任务周期类型
+					this.$refs.cycleType.setVal(data.cycleType)
+				}
+			})
+		},
 		// 天类型的执行日期
 		confirmBuildDateDay(val) {
 			this.form.buildDateDay = val.year + '-' + val.month + '-' + val.day;

+ 2 - 1
pages/spotCheckConfigure/evaluateStore.vue

@@ -35,13 +35,14 @@
 		},
 		onLoad(opts) {
 			this.value = opts.item&&JSON.parse(opts.item)||[]
+			console.log(this.value)
 			this.value.map(item=>{
 				item.id = item.storeId || item.id
 			})
 			this.type = opts.type && opts.type || 'checkbox'
-			console.log(this.value)
 			// 查询门店
 			findStoreList({}).then(res=>{
+				onsole.log(res.data)
 				if(res.status == 200){
 					this.list = res.data || []
 				} else {

+ 12 - 90
pages/spotCheckConfigure/spotCheckDetail/evaluateItemDetail.vue

@@ -1,101 +1,23 @@
 <template>
-	<view class="kp-details">
-		<!-- 考评项 -->
-		<view class="kp-tabsBox">
-			<view class="kp-tabs">
-				<view class="active">
-					<view>正常营业</view>
-					<view>(4项)</view>
-				</view>
-				<view>
-					<view>正常营业</view>
-					<view>(4项)</view>
-				</view>
-				<view>
-					<view>正常营业</view>
-					<view>(4项)</view>
-				</view>
-			</view>
-			<view class="kp-items">
-				<view>
-					<view v-for="item in items" :key="item.id" class="checkbox-item">
-						{{item.name}}
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
+	<uni-check-list :listData="list" titleKeys="targetName" types="views"></uni-check-list>
 </template>
 
 <script>
-	export default{
-		data(){
-			return{
-				items: [
-					{name:"正常营业"},
-					{name:"干净整洁"},
-					{name:"晨会正常"},
-				]
+	export default {
+		data() {
+			return {
+				list: [],
 			}
 		},
-		methods:{
+		onLoad(options) {
+			this.list = JSON.parse(options.item)
+		},
+		methods: {
+			
 		}
 	}
 </script>
 
-<style lang="scss">
-	page{
-		height: 100%;
-		background: #F8F8F8;
-	}
-	.kp-details{
-		height: 100%;
-		display: flex;
-		flex-direction: column;
-		.kp-tabsBox{
-			flex-grow: 1;
-			overflow: auto;
-			display: flex;
-			.kp-tabs{
-				width: 30%;
-				text-align: center;
-				margin: 15upx;
-				> view{
-					padding: 15upx;
-					background: #fff;
-					border-radius: 6upx;
-					box-shadow: 1px 2px 3px #eee;
-					margin-bottom: 15upx;
-					> view{
-						&:last-child{
-							color: #666;
-						}
-					}
-				}
-				> view.active{
-					background: #00aaff;
-					color: #fff;
-					> view{
-						&:last-child{
-							color: #fff;
-						}
-					}
-				}
-			}
-			.kp-items{
-				width: 70%;
-				margin: 15upx 15upx 15upx 6upx;
-			}
-		}
-		.checkbox-item{
-			width:100%;
-			padding: 15upx;
-			border-radius: 6upx;
-			box-shadow: 1px 2px 3px #eee;
-			background: #fff;
-			display: flex;
-			justify-content: space-between;
-			margin-bottom: 15upx;
-		}
-	}
+<style>
+
 </style>

+ 0 - 56
pages/spotCheckConfigure/spotCheckDetail/evaluateStoreDetail.vue

@@ -1,56 +0,0 @@
-<template>
-	<!-- <uni-check-list :listData="list" types="checkbox" @ok="chooseOk" :showArrow="false">
-	</uni-check-list> -->
-	<view class="store-all">
-		<view>
-			<view v-for="item in items" :key="item.id" class="checkbox-item">
-				{{item.name}}
-			</view>
-		</view>
-	</view>
-	
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				items: [
-					{name:"常青二路"},
-					{name:"世家星城"},
-					{name:"咸宁东路"},
-				]
-			}
-		},
-		methods: {
-		}
-	}
-</script>
-
-<style lang="scss">
-	page{
-		height: 100%;
-	}
-	.store-all{
-		height: 100%;
-		display: flex;
-		flex-direction: column;
-		.uni-list{
-			width: 100%;
-			flex-grow: 1;
-			overflow: auto;
-			
-		}
-		
-	}
-	.checkbox-item{
-		width:100%;
-		padding: 15upx 30upx;
-		border-bottom: 1px solid #eee;
-		background: #fff;
-		display: flex;
-		justify-content: space-between;
-		margin-bottom: 15upx;
-	}
-	
-</style>

+ 42 - 37
pages/spotCheckConfigure/spotCheckDetail/spotCheckDetail.vue

@@ -1,49 +1,52 @@
 <template>
 	<view class="container">
-		<view class="content">
+		<view class="content" v-if="pageData">
 			<view class="content-item">
 				<text>任务名称</text>
-				<view>111</view>
+				<view>{{pageData.name}}</view>
 			</view>
 			<view class="content-item">
 				<text>任务周期</text>
-				<view></view>
+				<view>{{pageData.cycleType}}</view>
 			</view>
 			<view class="content-item">
 				<text>执行日期</text>
-				<view>2020/10/10</view>
+				<view>{{pageData.buildDateDay||pageData.buildDateWeekList}}</view>
 			</view>
 			<view class="content-item">
 				<text>执行时间</text>
-				<view>09:00</view>
+				<view>{{pageData.buildTime}}</view>
 			</view>
 			<view class="content-item">
 				<text>开始日期</text>
-				<view>2020/10/10</view>
+				<view>{{pageData.startDate}}</view>
 			</view>
 			<view class="content-item">
 				<text>结束日期</text>
-				<view>2020/10/11</view>
+				<view>{{pageData.endDate}}</view>
 			</view>
 			<view class="content-item">
-				<text>考评类型</text>
-				<view>点检</view>
-			</view>
-			<view class="content-item" @click="viewItem">
 				<text>考评指标</text>
 				<view style="color: #007AFF;" >
-					12个 <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
+					{{pageData.assessTargetList.length}} 项 
+					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888" @click="openZBpage"></u-icon>
 				</view>
 			</view>
-			<view class="content-item" @click="viewStores">
+			<view class="content-item">
 				<text>考评门店</text>
 				<view style="color: #007AFF;">
-					12个 <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
+					{{pageData.storeList.length}} 个 <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888" @click="viewStores"></u-icon>
 				</view>
 			</view>
 			<view class="content-item">
 				<text>任务有效期天数</text>
-				<view>3天</view>
+				<view>{{pageData.effectiveDay}}天</view>
+			</view>
+		</view>
+		<view v-else>
+			<view class="loadingStyle">
+				<u-loading mode="circle"></u-loading>
+				<view>正在加载</view>
 			</view>
 		</view>
 	</view>
@@ -53,49 +56,51 @@
 	import {getCheckTaskConfig} from '../../../api/checkTaskConfig.js'
 	export default{
 		data(){
-			// const currentDate = this.getDate({
-			// 	format: true
-			// })
 			return{
 				pageData:null,		// 接受上个页面传的数据
-				show: false,		// 是否显示消息提醒弹窗
-				content: '',		// 消息提醒内容
-				title:'',			// 消息提醒标题
-				showCancelButton:''	,// 是否显示确认框的取消按钮  true 显示  false不显示
-				listData:[]
+				id:''
 			}
 		},
-		onLoad() {
+		onLoad(opts) {
+			this.id = opts.id
 			this.getData()
 		},
 		methods:{
 			// 详情
 			getData(){
-				getCheckTaskConfig({id:89}).then(res=>{
+				getCheckTaskConfig({id:this.id}).then(res=>{
 					console.log(res)
 					if(res.status==200){
-						this.listData=res.data[0]
-						console.log(this.listData)
+						this.pageData=res.data
 					}
 				})
 			},
-			// 查看已选考评门店详情
-			viewStores(){
-				uni.navigateTo({
-					url: '/pages/spotCheckConfigure/spotCheckDetail/evaluateStoreDetail'
-				})
+			// 考评指标选择
+			openZBpage() {
+				let item = this.pageData.assessTargetList
+				if(item.length>0){
+					uni.navigateTo({
+						url: '/pages/spotCheckConfigure/spotCheckDetail/evaluateItemDetail?item='+encodeURIComponent(JSON.stringify(item))
+					})
+				}
 			},
-			// 查看已选考评指标详情
-			viewItem(){
-				uni.navigateTo({
-					url: '/pages/spotCheckConfigure/spotCheckDetail/evaluateItemDetail'
-				})
+			viewStores(){
+				let item = this.pageData.storeList
+				if(item.length>0){
+					uni.navigateTo({
+						url: '/pages/userCenter/viewStores?item='+encodeURIComponent(JSON.stringify(item))
+					})
+				}
 			}
 		}
 	}
 </script>
 
 <style lang="less">
+	.loadingStyle{
+		text-align: center;
+		padding: 10vh 0 10vh 0;
+	}
 	.container{
 		color:#666;
 		font-size: 28rpx;

+ 6 - 4
pages/spotCheckConfigure/spotCheckList.vue

@@ -9,8 +9,8 @@
 			<view class="itemName">
 				<span>{{ item.startDate }} 至 {{ item.endDate }}</span>
 				<span>
-					<u-button type="success" size="mini" style="margin-right: 15upx;" @click="handetail">查看</u-button>
-					<u-button v-if="item.status == 0&&item.taskGenerateFlag==0" type="primary" size="mini" style="margin-right: 15upx;" @click="handedit">编辑</u-button>
+					<u-button type="success" size="mini" style="margin-right: 15upx;" @click="handetail(item)">查看</u-button>
+					<u-button v-if="item.status == 0&&item.taskGenerateFlag==0" type="primary" size="mini" style="margin-right: 15upx;" @click="handedit(item)">编辑</u-button>
 					<u-button v-if="item.status == 0&&item.taskGenerateFlag==0" type="error" size="mini" @click="handelete(item)">删除</u-button>
 				</span>
 			</view>
@@ -93,10 +93,11 @@ export default {
 		// 启用禁用
 		changeItem(item){
 			let _this = this
-			enableCheckTaskConfig({id:item.id,flag:item.status}).then(res=>{
+			let status = item.status == 1 ? 0 : 1
+			enableCheckTaskConfig({id:item.id,flag: status}).then(res=>{
 				if(res.status == 200){
 					let i = _this.list.findIndex(a=>a.id == item.id)
-					_this.list[i].status = item.status == 1 ? 0 : 1
+					_this.list[i].status = status
 					_this.list.splice()
 				}
 				uni.showToast({
@@ -146,6 +147,7 @@ export default {
 <style lang="scss">
 page {
 	background: #f8f8f8;
+	height: auto;
 }
 .itemInfo {
 	margin: 20upx;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/dev/app-plus/app-config-service.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 12 - 13
unpackage/dist/dev/app-plus/app-view.js


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio