htc 10 시간 전
부모
커밋
f6f3d44c41
3개의 변경된 파일93개의 추가작업 그리고 21개의 파일을 삭제
  1. 33 13
      pagesHome/questionnaireEdit.vue
  2. 55 6
      pagesMy/teamUser.vue
  3. 5 2
      pagesPublish/publishResult.vue

+ 33 - 13
pagesHome/questionnaireEdit.vue

@@ -27,9 +27,9 @@
 					<image :src="imgBase+'my_arrow_right.png'"></image>
 				</view>
 			</view>
-			<view class="box-time adfacjb">
+			<view class="box-time adfacjb" @click="endShow=true">
 				<view class="box-time-left">截止时间</view>
-				<view class="box-time-right adfac" @click="endShow=true">
+				<view class="box-time-right adfac">
 					<text>{{dto.endTime}}</text>
 					<image :src="imgBase+'my_arrow_right.png'"></image>
 				</view>
@@ -48,20 +48,20 @@
 			</view>
 		</view>
 		<view class="box" style="padding: 30rpx 24rpx 0;" v-if="type>1">
-			<view class="box-title adfacjb">
+			<view class="box-title adfacjb" style="margin-bottom: 21rpx;">
 				<text>团队人员</text>
 				<view class="box-add" @click="addTeamUser">+ 添加</view>
 			</view>
 			<view class="box-user">
-				<view class="box-user-item adfacjb" v-for="(item,index) in dto.memberInfos" :key="index">
+				<view class="box-user-item adfacjb" v-for="(item,index) in dto.memberList" :key="index">
 					<view class="box-user-item-left">
 						<view class="box-user-item-left-name adfac">
 							<text>{{item.realName}}</text>
-							<view class="type">{{'赞助人Sponsor'}}</view>
+							<view class="type">{{item.categoryName}}</view>
 						</view>
-						<view class="box-user-item-left-email">{{'123456789@qq.com'}}</view>
+						<view class="box-user-item-left-email">{{item.email}}</view>
 					</view>
-					<image class="box-user-item-right" :src="imgBase+'icon_delete.png'"></image>
+					<image class="box-user-item-right" :src="imgBase+'icon_delete.png'" @click="deleteTeamUser(item,index)"></image>
 				</view>
 			</view>
 		</view>
@@ -92,7 +92,9 @@
 				teamShow:false,
 				startShow:false,
 				endShow:false,
-				dto:{},
+				dto:{
+					memberList:[]
+				},
 				teamName:'请选择团队',
 				teamList:[],
 				minStartTime:new Date().getTime(),
@@ -111,6 +113,7 @@
 			if(this.type==2){
 				this.title = '发布问卷';
 				this.confirmText = '确认发布';
+				this.dto.answerSetting = 1;
 			}else if(this.type==1) this.getDetail()
 		},
 		methods:{
@@ -174,7 +177,17 @@
 				})
 			},
 			addTeamUser(){
-				
+				uni.navigateTo({
+					url:'/pagesMy/teamUser?type=select',
+					events:{
+						selectUserConfirm: data => {
+							this.dto.memberList = data;
+						}
+					}
+				})
+			},
+			deleteTeamUser(item,index){
+				this.dto.memberList.splice(index,1);
 			},
 			confirmTeam(item){
 				this.teamName = item.teamName;
@@ -194,14 +207,21 @@
 				let params = JSON.parse(JSON.stringify(this.dto));
 				params.coachId = JSON.parse(uni.getStorageSync('userInfo')).id;
 				params.type = this.type;
+				
+				if(!params?.teamId) return this.$showToast('请选择团队')
+				if(!params?.startTime) return this.$showToast('请选择开始时间')
+				if(!params?.endTime) return this.$showToast('请选择结束时间')
+				if(params?.memberList.length==0) return this.$showToast('请选择团队人员')
+				
 				let url = '/core/team/questionnaire';
 				if(this.type==2){
 					url = '/core/team/questionnaire/publish';
+					params.questionnaireId = this.questionnaireId
 				}
 				this.$api[this.type==2?'post':'put'](url,params).then(({data:res})=>{
 					if(res.code!==0) return this.$showToast(res.msg)
 					if(this.type==2){
-						uni.navigateTo({ url:'/pagesPublish/publishResult' })
+						uni.navigateTo({ url:'/pagesPublish/publishResult?title='+this.questionnaireName })
 					}else uni.navigateBack()
 				})
 			}
@@ -219,6 +239,7 @@
 			box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
 			border-radius: 24rpx;
 			margin-top: 20rpx;
+			overflow: hidden;
 			
 			&-title,&-title>text{
 				font-family: PingFang-SC, PingFang-SC;
@@ -310,7 +331,6 @@
 				text-align: center;
 			}
 			&-user{
-				margin-top: 21rpx;
 				&-item{
 					box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
 					border-radius: 24rpx;
@@ -325,14 +345,14 @@
 								line-height: 32rpx;
 							}
 							.type{
-								background: #F8F4F8;
+								background: #FFF7DC;
 								border-radius: 21rpx;
 								margin-left: 20rpx;
 								padding: 5rpx 16rpx;
 								font-family: PingFangSC, PingFang SC;
 								font-weight: 400;
 								font-size: 22rpx;
-								color: #9F6196;
+								color: #BA9B31;
 								line-height: 30rpx;
 								text-align: center;
 							}

+ 55 - 6
pagesMy/teamUser.vue

@@ -4,12 +4,12 @@
 		<view class="add" @click="handleAdd">+ 添加</view>
 		<view class="list" v-if="list.length">
 			<u-swipe-action>
-				<u-swipe-action-item   v-for="(item, index) in list" :key="index"
+				<u-swipe-action-item  v-for="(item, index) in list" :key="index"
 				  :options="options" @click="e=>deleteUser(item,e)" :ref="'swipeAction' + index" :threshold="5"
 				>
 					<view class="swipe-action u-border-top u-border-bottom">
 						<view class="swipe-action__content">
-							<view class="lbox adfac">
+							<view class="lbox adfac" @click.prevent="selectUser(item,index)">
 								<template v-if="type">
 									<image class="lbox-select" v-if="item.select" :src="imgBase+'selected.png'"></image>
 									<image class="lbox-select" v-else :src="imgBase+'not_select.png'"></image>
@@ -18,12 +18,15 @@
 									<view class="lbox-info-top adfac">
 										<text>{{item.realName}}</text>
 										<template v-if="type">
-											<view class="type">{{'赞助人Sponsor'}}</view>
+											<view class="type adfac" @click.stop="selectUserCategory(item,index)">
+												{{item.categoryName||'选择身份类型'}}
+												<image :src="imgBase+'icon_user_down.png'"></image>
+											</view>
 										</template>
 									</view>
 									<view class="lbox-info-email">{{item.email}}</view>
 								</view>
-								<view class="lbox-edit" @click="handleEdit(item)">
+								<view class="lbox-edit" @click.stop="handleEdit(item)">
 									<u-icon name="edit-pen" size="42rpx" color="#B9B9B9"></u-icon>
 								</view>
 							</view>
@@ -35,14 +38,16 @@
 		<view v-else class="adffcacjc" style="flex: 1;">
 			<empty text='暂无团队人员,请添加'></empty>
 		</view>
-		<view class="btn" v-if="type">确定</view>
+		<view class="btn" v-if="type" @click="handleConfirmAdd">确定</view>
+		<cus-select :show="show" title="选择身份类型" :list="categoryData" @close="show=false" @confirmTeam="selectConfirm"></cus-select>
 	</view>
 </template>
 
 <script>
 	import empty from '@/components/pageEmpty/index.vue'
+	import CusSelect from '@/components/CusSelect/index.vue'
 	export default {
-		components:{ empty },
+		components:{ empty, CusSelect },
 		data(){
 			return {
 				type:'',
@@ -63,6 +68,10 @@
 						}
 					}
 				],
+				show:false,
+				categoryData:[],
+				currentUser:null,
+				currentIndex:'',
 			}
 		},
 		onLoad(options) {
@@ -79,10 +88,30 @@
 				this.$api.get('/core/member/page',this.query).then(({data:res})=>{
 					if(res.code!==0) return this.$showToast(res.msg)
 					this.list = [...this.list,...res.data.list]
+					this.list.forEach((l,i)=>{
+						this.$set(this.list[i],'category','');
+						this.$set(this.list[i],'categoryName','');
+						this.$set(this.list[i],'select',false);
+					})
 					this.query.page++
 					if(this.length>=res.data.total) this.isOver = true
 				})
 			},
+			getCategoryData(){
+				this.$api.get('/getListByType/UserCategory').then(({data:res})=>{
+					if(res.code!==0) return this.$showToast(res.msg)
+					this.categoryData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
+					this.show = true;
+				})
+			},
+			selectUser(item,index){
+				this.$set(this.list[index],'select',!this.list[index].select);
+			},
+			selectUserCategory(item,index){
+				this.currentUser = item;
+				this.currentIndex = index;
+				this.getCategoryData()
+			},
 			deleteUser(item,index){
 				uni.showModal({
 					title:'温馨提示',
@@ -113,6 +142,21 @@
 					url:'/pagesMy/teamUserDetail?id='+item.id
 				})
 			},
+			selectConfirm(e){
+				this.$set(this.list[this.currentIndex],'category',e.id);
+				this.$set(this.list[this.currentIndex],'categoryName',e.name);
+				this.show = false;
+			},
+			handleConfirmAdd(){
+				let selectList = this.list.filter(l=>l.select);
+				if(selectList.length===0) return this.$showToast('请至少选择一位团队成员')
+				let sendList = selectList.map(l=>({realName:l.realName,id:l.id,category:l.category,categoryName:l.categoryName,email:l.email}))
+				let tempuser = selectList.find(s=>!s.category);
+				if(tempuser) return this.$showToast(`请为团队人员【${tempuser.realName}】选择身份类型`)
+				
+				this.getOpenerEventChannel().emit('selectUserConfirm',sendList)
+				uni.navigateBack()
+			}
 		}
 	}
 </script>
@@ -178,6 +222,11 @@
 							color: #BA9B31;
 							line-height: 30rpx;
 							margin-left: 20rpx;
+							image{
+								width: 24rpx;
+								height: 24rpx;
+								margin-left: 12rpx;
+							}
 						}
 					}
 					&-email{

+ 5 - 2
pagesPublish/publishResult.vue

@@ -3,7 +3,7 @@
 		<cus-header title='发布结果'></cus-header>
 		<view class="xcx">
 			<view class="box">
-				<view class="box-title">{{'GW+MC PREILL36测评题库版本'}}</view>
+				<view class="box-title">{{title}}</view>
 				<view class="box-fill">
 					<view class="box-fill-bottom adfacjb">
 						<view class="box-fill-bottom-left adfac">
@@ -43,9 +43,12 @@
 	export default {
 		data(){
 			return {
-				
+				title:''
 			}
 		},
+		onLoad(options){
+			this.title = options.title;
+		},
 		methods:{
 			
 		}