zhangdan 4 anni fa
parent
commit
adc4477ef0

+ 1 - 0
pages/spotCheckConfigure/addSpotCheck.vue

@@ -65,6 +65,7 @@
 <script>
 	import vSelect  from  '@/components/select/v-select.vue' 
 	import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue";
+	import { clzConfirm } from '@/libs/tools.js'
 	export default{
 		components: {
 			vSelect,MxDatePicker

+ 14 - 13
pages/spotCheckConfigure/spotCheckDetail/spotCheckDetail.vue

@@ -50,6 +50,7 @@
 </template>
 
 <script>
+	import {getCheckTaskConfig} from '../../../api/checkTaskConfig.js'
 	export default{
 		data(){
 			// const currentDate = this.getDate({
@@ -60,24 +61,24 @@
 				show: false,		// 是否显示消息提醒弹窗
 				content: '',		// 消息提醒内容
 				title:'',			// 消息提醒标题
-				showCancelButton:''	// 是否显示确认框的取消按钮  true 显示  false不显示
+				showCancelButton:''	,// 是否显示确认框的取消按钮  true 显示  false不显示
+				listData:[]
 			}
 		},
 		onLoad() {
-		},
-		// 判断员工性别
-		filters: {
-			sexFilter(sexTypeVal){
-				console.log(sexTypeVal,'---')
-				if(sexTypeVal == 1){
-					return '男'
-				}
-				if(userTypeVal == 0){
-					return '女'
-				}
-			}
+			this.getData()
 		},
 		methods:{
+			// 详情
+			getData(){
+				getCheckTaskConfig({id:89}).then(res=>{
+					console.log(res)
+					if(res.status==200){
+						this.listData=res.data[0]
+						console.log(this.listData)
+					}
+				})
+			},
 			// 查看已选考评门店详情
 			viewStores(){
 				uni.navigateTo({

+ 57 - 32
pages/spotCheckConfigure/spotCheckList.vue

@@ -14,27 +14,28 @@
 			</view>
 		</u-navbar>
 		<!-- 任务列表 -->
-		<view class="pageBody">
+		<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
 			<view v-for="item in listData" :key="item.id" class="itemInfo">
 				<view class="itemName">
-					<span class="name">{{item.name}}</span>
-					<u-switch size="40" v-model="item.checked"></u-switch>
+					<span class="name">{{listData.name}}</span>
+					<u-switch size="40" v-model="listData.status"></u-switch>
 				</view>
 				<view class="itemName">
-					<span>{{item.time}}</span>
+					<span>{{listData.startDate}}- {{listData.endDate}}</span>
 					<span>
-						<u-button v-if="item.checked==false" type="warning" size="mini" style="margin-right: 15upx;" @click="handetail">查看</u-button>
+						<u-button v-if="listData.status==1" type="warning" size="mini" style="margin-right: 15upx;" @click="handetail">查看</u-button>
 						<u-button type="primary" size="mini" style="margin-right: 15upx;" @click="handedit">编辑</u-button>
-						<u-button type="error" size="mini" @click="handelete">删除</u-button>
+						<u-button type="error" size="mini" @click="handelete(item)">删除</u-button>
 					</span>
 					
 				</view>
 			</view>
-		</view>
+		</scroll-view>
 	</view>
 </template>
 
 <script>
+	import {getCheckTaskConfigList,delCheckTaskConfig,enableCheckTaskConfig,saveBackLog} from '../../api/checkTaskConfig.js'
 	export default{
 		data(){
 			return{
@@ -42,11 +43,13 @@
 					// 渐变色
 					backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
 				},
+				status: 'loadmore',
+				noDataText: '暂无数据',
 				listData:[
-					{name:'夏季活动',time:'2020-05-20',checked:true,controlStatus: false},
-					{name:'夏季活动',time:'2020-05-20',checked:false},
-					{name:'夏季活动',time:'2020-05-20',checked:true},
-					{name:'夏季活动',time:'2020-05-20',checked:false},
+					// {name:'夏季活动',time:'2020-05-20',checked:true,controlStatus: false},
+					// {name:'夏季活动',time:'2020-05-20',checked:false},
+					// {name:'夏季活动',time:'2020-05-20',checked:true},
+					// {name:'夏季活动',time:'2020-05-20',checked:false},
 					]
 			}
 		},
@@ -54,8 +57,8 @@
 			checked(val) {
 				// 等于false,意味着用户手动关闭了switch
 				if (val == false) {
-					if(this.controlStatus == true) {
-						this.controlStatus = false;
+					if(this.listData.status == 0) {
+						this.listData.status = 1;
 						return ;
 					}
 					// 重新打开switch,并让它处于加载中的状态
@@ -66,7 +69,22 @@
 				}
 			}
 		},
+		onLoad() {
+			this.getListData()
+		},
 		methods:{
+			// 列表数据
+			getListData(){
+				getCheckTaskConfigList({pageNo:1,pageSize:10}).then(res=>{
+					console.log(res)
+					if(res.status==200){
+						this.listData=res.data[0].list[0]
+						this.listData.startDate=this.listData.startDate.substring(0,11)
+						this.listData.endDate=this.listData.endDate.substring(0,11)
+						console.log(this.listData.startDate)
+					}
+				})
+			},
 			openAddPage(){
 				console.log('-------------------')
 				uni.navigateTo({
@@ -76,7 +94,7 @@
 			// 查看详情
 			handetail(){
 				uni.navigateTo({
-					url:'/pages/spotCheckConfigure/spotCheckDetail/spotCheckDetail'
+					url:'/pages/spotCheckConfigure/spotCheckDetail/spotCheckDetail?id=${listData.id}'
 				})
 			},
 			// 编辑
@@ -86,8 +104,20 @@
 				})
 			},
 			// 删除
-			handelete(){
-				
+			handelete(item){
+				const _this=this
+				clzConfirm({
+					title: '提示',
+					content: '确认删除,删除后数据将无法恢复?',
+					// success: function(res) {
+					// 	if (res.confirm || res.index == 0) {
+					// 		_this.isClose = true
+					// 		uni.navigateBack({
+					// 			delta: 1
+					// 		});
+					// 	}
+					// }
+				});
 			}
 		}
 	}
@@ -118,22 +148,17 @@
 				margin-right: 10upx;
 			}
 		}
-		.pageBody{
-			.itemInfo{
-				margin: 20upx;
-				background-color: #fff;
-				border-radius: 3px;
-				.itemName{
-					padding: 25upx 35upx;
-					display: flex;
-					justify-content: space-between;
-				}
-				.itemName:first-child{
-					border-bottom: 1px solid #f8f8f8;
-				}
+		.itemInfo{
+			margin: 20upx;
+			background-color: #fff;
+			border-radius: 3px;
+			.itemName{
+				padding: 25upx 35upx;
+				display: flex;
+				justify-content: space-between;
+			}
+			.itemName:first-child{
+				border-bottom: 1px solid #f8f8f8;
 			}
-			
-			
-			
 		}
 </style>