Przeglądaj źródła

优化:个人版只有前四项必填,团队版全部必填;团队版选择团队时过滤团队为全部信息的团队

htc 5 dni temu
rodzic
commit
2b852a3fa0

+ 22 - 10
components/CusTeamInfoFill/index.vue

@@ -28,28 +28,28 @@
 				</view>
 			</view>
 			<view class="form-item adfacjb">
-				<view class="form-item-title red">团队职能类型</view>
+				<view class="form-item-title" :class="{'red':isqtype}">团队职能类型</view>
 				<view class="form-item-inp adfac" @click="turnPage('function')">
 					<text :class="{'active':functionTypeText!=='请选择'}">{{functionTypeText}}</text>
 					<u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
 				</view>
 			</view>
 			<view class="form-item adfacjb">
-				<view class="form-item-title red">团队架构类型</view>
+				<view class="form-item-title" :class="{'red':isqtype}">团队架构类型</view>
 				<view class="form-item-inp adfac" @click="turnPage('architecture')">
 					<text :class="{'active':architectureTypeText!=='请选择'}">{{architectureTypeText}}</text>
 					<u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
 				</view>
 			</view>
 			<view class="form-item adfacjb">
-				<view class="form-item-title red">团队规模</view>
+				<view class="form-item-title" :class="{'red':isqtype}">团队规模</view>
 				<view class="form-item-inp adfac" @click="selectShow('teamScaleShow')">
 					<text :class="{'active':teamScaleText!=='请选择'}">{{teamScaleText}}</text>
 					<u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
 				</view>
 			</view>
 			<view class="form-item adfacjb">
-				<view class="form-item-title red">团队层级</view>
+				<view class="form-item-title" :class="{'red':isqtype}">团队层级</view>
 				<view class="form-item-inp adfac" @click="selectShow('teamLevelShow')">
 					<text :class="{'active':teamLevelText!=='请选择'}">{{teamLevelText}}</text>
 					<u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
@@ -57,7 +57,7 @@
 			</view>
 		</view>
 		<view class="box">
-			<view class="box-title red">团队简介</view>
+			<view class="box-title" :class="{'red':isqtype}">团队简介</view>
 			<view class="box-textarea">
 				<u-textarea border="none" height="320rpx" maxlength="-1" style="color: #667E90;padding: 0;" :placeholderStyle="{'color':'#B3BFC8','font-size':'30rpx','line-height':'40rpx'}" 
 				v-model="teamInfo.brief" placeholder="示例:这是一个为公司ERP系统升级而组建的36人团队,成员由公司副总经理、各部门总监以及各部门核心骨干组成。团队成员工作地点分布在香港、上海、苏州、深圳和东莞等地。团队成员年龄在35-50岁之间,男女比例比较均衡,大部份成员在该公司同事超过十年。"></u-textarea>
@@ -77,12 +77,17 @@
 <script>
 	import CusSelect from '@/components/CusSelect/index.vue'
 	import CusProvinceCityArea from '@/components/CusProvinceCityArea/index.vue'
+import props from '../../uni_modules/uview-ui/libs/config/props'
 	export default {
 		components:{ CusSelect, CusProvinceCityArea },
 		props:{
 			confirmText:{
 				typeof:String,
 				default:'下一步'
+			},
+			qtype:{
+				typeof:Boolean,
+				default:false
 			}
 		},
 		options: { styleIsolation: 'shared' },
@@ -112,8 +117,13 @@
 				teamLevelShow:false,
 				teamLevelData:[],
 				teamLevelText:'请选择',
+				isqtype:false
 			}
 		},
+		mounted() {
+			console.log(this.$props);
+			this.isqtype = this.$props.qtype||false;
+		},
 		methods:{
 			getTeamScaleData(){
 				this.$api.get('/getListByType/team_scale').then(({data:res})=>{
@@ -194,11 +204,13 @@
 				if(!this.teamInfo.enterpriseName) return this.$showToast('请输入公司名称')
 				if(!this.teamInfo.districtId) return this.$showToast('请选择所属地区')
 				if(!this.teamInfo.industryId) return this.$showToast('请选择所属行业')
-				if(this.teamInfo.functionIds.length===0) return this.$showToast('请选择团队职能类型')
-				if(this.teamInfo.orgIds.length===0) return this.$showToast('请选择团队架构类型')
-				if(!this.teamInfo.scale) return this.$showToast('请选择团队规模')
-				if(!this.teamInfo.hierarchy) return this.$showToast('请选择团队层级')
-				if(!this.teamInfo.brief) return this.$showToast('请输入团队简介')
+				if(this.isqtype){
+					if(this.teamInfo.functionIds.length===0) return this.$showToast('请选择团队职能类型')
+					if(this.teamInfo.orgIds.length===0) return this.$showToast('请选择团队架构类型')
+					if(!this.teamInfo.scale) return this.$showToast('请选择团队规模')
+					if(!this.teamInfo.hierarchy) return this.$showToast('请选择团队层级')
+					if(!this.teamInfo.brief) return this.$showToast('请输入团队简介')
+				}
 				
 				this.$emit('handleConfirm',this.teamInfo)
 			},

+ 3 - 3
pagesHome/questionnaireEdit.vue

@@ -161,7 +161,7 @@
 					coachId:JSON.parse(uni.getStorageSync('userInfo')).id
 				}).then(({data:res})=>{
 					if(res.code!==0) return this.$showToast(res.msg)
-					this.teamList = res.data.list;
+					this.teamList = res.data.list.filter(l=>l.hierarchy&&l.scale);
 					this.teamList.forEach(t=>t.name=t.teamName)
 				})
 			},
@@ -172,7 +172,7 @@
 			},
 			addTeam(){
 				uni.navigateTo({
-					url:'/pagesPublish/fillTeamInfo?type=add&questionnaireId='+this.questionnaireId,
+					url:'/pagesPublish/fillTeamInfo?type=add&qtype=team&questionnaireId='+this.questionnaireId,
 					events:{
 						saveTeamInfo: data =>{
 							this.$api.get('/core/user/team/page',{
@@ -181,7 +181,7 @@
 								coachId:JSON.parse(uni.getStorageSync('userInfo')).id
 							}).then(({data:res})=>{
 								if(res.code!==0) return this.$showToast(res.msg)
-								this.teamList = res.data.list;
+								this.teamList = res.data.list.filter(l=>l.hierarchy&&l.scale);
 								this.teamList.forEach(t=>t.name=t.teamName)
 							})
 						}

+ 4 - 2
pagesPublish/fillTeamInfo.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
 		<cus-header title='填写所在团队信息'></cus-header>
-		<cus-team-info-fill @handleConfirm="handleConfirm" :confirmText="confirmText"></cus-team-info-fill>
+		<cus-team-info-fill @handleConfirm="handleConfirm" :confirmText="confirmText" :qtype="qtype"></cus-team-info-fill>
 	</view>
 </template>
 
@@ -15,12 +15,14 @@
 				type:'',
 				next:'',
 				questionnaireId:'',
-				confirmText:'下一步'
+				confirmText:'下一步',
+				qtype:''
 			}
 		},
 		onLoad(options) {
 			this.title = options.title||'';
 			this.type = options.type;
+			this.qtype = options.qtype||'';
 			this.questionnaireId = options.questionnaireId||'';
 			this.confirmText = options.type?'确定':'下一步';
 			this.next = options.next;