zhangdan пре 4 година
родитељ
комит
cc8926caab
5 измењених фајлова са 221 додато и 3 уклоњено
  1. 2 2
      package.json
  2. 18 0
      pages.json
  3. 77 0
      pages/spotCheckConfigure/addSpotCheck.vue
  4. 123 0
      pages/spotCheckConfigure/spotCheckList.vue
  5. 1 1
      pages/work/work.vue

+ 2 - 2
package.json

@@ -14,10 +14,10 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
-    "uview-ui": "^1.6.5",
     "async-validator": "^3.3.0",
     "lodash": "^4.17.19",
     "moment": "^2.27.0",
-    "qrcode": "^1.4.4"
+    "qrcode": "^1.4.4",
+    "uview-ui": "^1.6.5"
   }
 }

+ 18 - 0
pages.json

@@ -106,6 +106,24 @@
 		    	"navigationBarTitleText": "预览"
 		    }
 		},
+		{
+		    "path" : "pages/spotCheckConfigure/spotCheckList",
+		    "style": {
+				"navigationStyle": "custom",  //  是否显示导航栏  default显示,custom不显示
+		    	"navigationBarTitleText": "点检任务配置",
+				"app-plus":{
+					"titleView":false,
+					// 将回弹属性关掉
+					"bounce":"none"
+				}
+		    }
+		},
+		{
+		    "path" : "pages/spotCheckConfigure/addSpotCheck",
+		    "style": {
+		    	"navigationBarTitleText": "新增点检任务"
+		    }
+		},
 		{
             "path" : "pages/userCenter/userCenter",
             "style" : {

+ 77 - 0
pages/spotCheckConfigure/addSpotCheck.vue

@@ -0,0 +1,77 @@
+<template>
+	<view class="pageInfo">
+		<view>
+			<u-form :model="form" ref="uForm">
+				<u-form-item label="任务名称" label-width="160rpx"><u-input v-model="form.name" /></u-form-item>
+				<u-form-item label="任务周期" label-width="160rpx"><u-select v-model="form.name" :show="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
+				<!-- <u-icon name="arrow-right" @click="openSeleteType"></u-icon> -->
+				</u-form-item>
+				<u-form-item label="执行日期" label-width="160rpx"><u-input v-model="form.intro" /></u-form-item>
+				<u-form-item label="执行时间" label-width="160rpx"><u-input v-model="form.intro" /></u-form-item>
+				<u-form-item label="开始时间" label-width="160rpx"></u-form-item>
+				<u-form-item label="结束时间" label-width="160rpx"><u-input v-model="form.intro" /></u-form-item>
+				<u-form-item label="执行类型" label-width="160rpx"><u-input v-model="form.intro" /></u-form-item>
+				<u-form-item label="考评指标" label-width="160rpx"><u-input v-model="form.intro" /></u-form-item>
+				<u-form-item label="考评门店" label-width="160rpx"><u-input v-model="form.intro" /></u-form-item>
+				<u-form-item label="任务有效天数" label-width="180rpx"><u-input v-model="form.intro" /></u-form-item>
+			</u-form>
+			<view class="btns">
+				<u-button class="confirmBtn" type="primary" size="medium" @click="submit">提交</u-button>
+				<u-button class="cancelBtn" size="medium" @click="submit">取消</u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default{
+		data(){
+			return{
+				form: {
+					name: '',
+					intro: '',
+					sex: ''
+				},
+				show: false,
+				list: [
+					{
+						value: '1',
+						label: '江'
+					},
+					{
+						value: '2',
+						label: '湖'
+					}
+				],
+				mode: 'date'
+			}
+		},
+		methods:{
+			confirm(e){
+				console.log(e)
+			},
+			openSeleteType(){
+				this.show=true
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		height: 100%;
+	};
+	.pageInfo{
+		padding:0 40upx;
+		.btns{
+			text-align: center;
+			padding: 50upx 0;
+			.confirmBtn{
+				margin-right:20upx;
+			}
+			.cancelBtn{
+				margin-left:20upx;
+			}
+		}
+	}
+</style>

+ 123 - 0
pages/spotCheckConfigure/spotCheckList.vue

@@ -0,0 +1,123 @@
+<template>
+	<view class="pageInfo">
+		<!-- 自定义导航栏 -->
+		<u-navbar title-color="#fff" back-icon-size="30" back-icon-color="#fff" :border-bottom="false" :background="background">
+			<view class="slot-wrap">
+				<view class="left-icon">
+					点检任务配置
+				</view>
+				<!-- 新增 -->
+				<view class="right-icon" @click="openAddPage">
+					<u-icon name="plus-circle" size="30" color="#fff" label="新增" label-color="#fff"></u-icon>
+					<uni-font-icons type="icon-sousuo" size="16" color="#fff"></uni-font-icons> 
+				</view>
+			</view>
+		</u-navbar>
+		<!-- 任务列表 -->
+		<view class="pageBody">
+			<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>
+				</view>
+				<view class="itemName">
+					<span>{{item.time}}</span>
+					<span>
+						<u-button v-if="item.checked==false"type="warning" size="mini" style="margin-right: 15upx;">查看</u-button>
+						<u-button type="primary" size="mini" style="margin-right: 15upx;">编辑</u-button>
+						<u-button type="error" size="mini">删除</u-button>
+					</span>
+					
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default{
+		data(){
+			return{
+				background: {
+					// 渐变色
+					backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
+				},
+				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},
+					]
+			}
+		},
+		watch: {
+			checked(val) {
+				// 等于false,意味着用户手动关闭了switch
+				if (val == false) {
+					if(this.controlStatus == true) {
+						this.controlStatus = false;
+						return ;
+					}
+					// 重新打开switch,并让它处于加载中的状态
+					this.checked = true;
+					this.loading = true;
+					// 模拟向后端发起请求
+					this.getRestultFromServer();
+				}
+			}
+		},
+		methods:{
+			openAddPage(){
+				console.log('-------------------')
+				uni.navigateTo({
+					url:'/pages/spotCheckConfigure/addSpotCheck'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		height: 100%;
+		background-color: #eee;
+	}
+	.slot-wrap {
+			display: flex;
+			align-items: center;
+			/* 如果您想让slot内容占满整个导航栏的宽度 */
+			flex: 1;
+			/* 如果您想让slot内容与导航栏左右有空隙 */
+			padding: 0 30rpx 0 0;
+			color: #fff;
+			font-size: 28upx;
+			.left-icon{
+				flex-grow: 1;
+				font-size: 32upx;
+			}
+			.right-icon{
+				padding-left:50upx;
+			}
+			.uni-icons{
+				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;
+				}
+			}
+			
+			
+			
+		}
+</style>

+ 1 - 1
pages/work/work.vue

@@ -31,7 +31,7 @@
 						id: 'tcgl',
 						icon: '/static/navIcon/djpz.png',
 						name: '点检配置',
-						url:'/pages/workOrder/sellOrder/bundleList',
+						url:'/pages/spotCheckConfigure/spotCheckList',
 						target: 'page',
 						auth: true
 					},