htc 3 napja
szülő
commit
e559ab2329

+ 1 - 1
components/QuestionItem/index2.vue

@@ -5,7 +5,7 @@
 			{{index+1}}. {{item.question}}
 		</div>
 		<div class="lb_box" v-for="(ua,ui) in item.userAnswer" :key="ui">
-			<div class="memo">{{assessmentMethodCfg[ua.assessmentMethod]|''}}</div>
+			<div class="memo">{{assessmentMethodCfg[ua.assessmentMethod]||''}}</div>
 			<div class="lb_answers">
 				<u-radio-group
 					:value="ua.answer"

+ 1 - 1
components/QuestionItem/index3.vue

@@ -5,7 +5,7 @@
 		</view>
 		<view class="lb_card">
 			<view class="lb_box" v-for="(ua,ui) in item.userAnswer" :key="ui">
-				<view class="memo">{{assessmentMethodCfg[ua.assessmentMethod]|''}}</view>
+				<view class="memo">{{assessmentMethodCfg[ua.assessmentMethod]||''}}</view>
 				<view class="lb_answers">
 					<u-radio-group
 						:value="ua.answer"

+ 94 - 44
pagesHome/components/createList.vue

@@ -11,16 +11,16 @@
 							<view class="progress-left adfac">
 								<view class="progress-left-text">作答进度:</view>
 								<view class="progress-left-box">
-									<view class="progress-left-box-current" :style="{'width':(item.yzdNum/item.sum*100)+'%'}"></view>
+									<view class="progress-left-box-current" :style="{'width':(item.finishNum/item.userNum*100)+'%'}"></view>
 								</view>
 							</view>
-							<view class="progress-right"><span>{{item.yzdNum}}/</span>{{item.sum}}</view>
+							<view class="progress-right"><span>{{item.finishNum}}/</span>{{item.userNum}}</view>
 						</view>
 						<view class="bottom adfacjb">
 							<view class="bottom-left">截止时间:{{item.endTime}}</view>
 							<view class="bottom-right" v-if="item.status===0" @click.stop="handleAnswer(item)">立即作答</view>
-							<view class="bottom-right" v-else-if="item.status===1" @click.stop="createReport(item)">生成报告</view>
-							<view class="bottom-right" v-else-if="item.status===2" @click.stop="sendReport(item)">发送报告</view>
+							<view class="bottom-right" v-else-if="item.status===1&&!item.fileUrl" @click.stop="createReport(item)">生成报告</view>
+							<view class="bottom-right" v-else-if="item.status===1&&item.fileUrl" @click.stop="sendReport(item)">发送报告</view>
 						</view>
 					</view>
 				</up-list-item>
@@ -40,13 +40,13 @@
 					<view class="dbox-progress-left adfac">
 						<view class="dbox-progress-left-text">作答进度:</view>
 						<view class="dbox-progress-left-box">
-							<view class="dbox-progress-left-box-current" :style="{'width':(dto.yzdNum/dto.sum*100)+'%'}"></view>
+							<view class="dbox-progress-left-box-current" :style="{'width':(dto.finishNum/dto.userNum*100)+'%'}"></view>
 						</view>
 					</view>
-					<view class="dbox-progress-right"><span>{{dto.yzdNum}}/</span>{{dto.sum}}</view>
+					<view class="dbox-progress-right"><span>{{dto.finishNum}}/</span>{{dto.userNum}}</view>
 				</view>
 				<view class="dbox-menu">
-					<view class="dbox-menu-pre adffcac" v-for="(item,index) in menuList" :key="index" @click="handleMenuClick(index)">
+					<view class="dbox-menu-pre adffcac" v-for="(item,index) in menuListCopy" :key="index" @click="handleMenuClick(item,index)">
 						<image :src="item.img"></image>
 						<text>{{item.text}}</text>
 					</view>
@@ -58,7 +58,7 @@
 				<view class="dialog-box-title">团队信息</view>
 				<image class="dialog-box-close" :src="imgBase+'remind_close.png'" @click="teamInfoShow=false"></image>
 				<view class="dialog-box-teaminfo">
-					<cus-team-info-fill confirmText="保存" @handleConfirm="handleConfirm"></cus-team-info-fill>
+					<cus-team-info-fill ref="teamRef" confirmText="保存" @handleConfirm="handleConfirm"></cus-team-info-fill>
 				</view>
 			</view>
 		</view>
@@ -123,32 +123,35 @@
 						text:'发送报告'
 					}
 				],
+				menuListCopy:[],
 				teamUserList:[
-					{
-						name:'张三',
-						email:'2233983769@qq.com',
-						type:1,
-						status:0
-					},
-					{
-						name:'李四',
-						email:'2233983769@qq.com',
-						type:2,
-						status:0
-					},
-					{
-						name:'王五',
-						email:'2233983769@qq.com',
-						type:3,
-						status:1
-					},
-					{
-						name:'赵六',
-						email:'2233983769@qq.com',
-						type:1,
-						status:1
-					}
+					// {
+					// 	name:'张三',
+					// 	email:'2233983769@qq.com',
+					// 	type:1,
+					// 	status:0
+					// },
+					// {
+					// 	name:'李四',
+					// 	email:'2233983769@qq.com',
+					// 	type:2,
+					// 	status:0
+					// },
+					// {
+					// 	name:'王五',
+					// 	email:'2233983769@qq.com',
+					// 	type:3,
+					// 	status:1
+					// },
+					// {
+					// 	name:'赵六',
+					// 	email:'2233983769@qq.com',
+					// 	type:1,
+					// 	status:1
+					// }
 				],
+				teamScaleData:[],
+				teamLevelData:[],
 			}
 		},
 		methods:{
@@ -157,29 +160,76 @@
 			},
 			showDialog(item){
 				this.dto = item;
+				if(this.dto.type==1) this.menuListCopy = this.menuList.filter((_, index) => index !== 4);
+				else this.menuListCopy = JSON.parse(JSON.stringify(this.menuList))
 				this.show = true;
 			},
-			handleMenuClick(type){
-				if(type===0){
+			async getTeamScaleData(){
+				return new Promise((resolve,reject)=>{
+					this.$api.get('/getListByType/team_scale').then(({data:res})=>{
+						if(res.code!==0) return this.$showToast(res.msg)
+						this.teamScaleData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
+						resolve()
+					})
+				})	
+			},
+			async getTeamHierarchyData(){
+				return new Promise((resolve,reject)=>{
+					this.$api.get('/getListByType/team_hierarchy').then(({data:res})=>{
+						if(res.code!==0) return this.$showToast(res.msg)
+						this.teamLevelData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
+						resolve()
+					})
+				})	
+			},
+			async handleMenuClick(item){
+				if(item.text==='编辑问卷'){
 					uni.navigateTo({
 						url:`/pagesHome/questionnaireEdit?teamQuestionnaireId=${this.dto.teamQuestionnaireId}&type=${this.dto.type}&questionnaireName=${this.dto.title}`
 					})
-				}else if(type===1){
+				}else if(item.text==='分享问卷'){
 					
-				}else if(type===2) this.teamInfoShow = true 
-				else if(type===3) {
+				}else if(item.text==='团队信息'){
+					this.teamInfoShow = true;
+					await this.getTeamScaleData()
+					await this.getTeamHierarchyData()
+					this.$api.get(`/core/user/team/${this.dto.teamId}`).then(({data:res})=>{
+						if(res.code!==0) return this.$showToast(res.msg)
+						this.$refs.teamRef.setTeamInfo(res.data)
+						this.$refs.teamRef.teamInfo.functionIds = res.data.functions.map(f=>f.id);
+						this.$refs.teamRef.teamInfo.orgIds = res.data.organizations.map(o=>o.id);
+						this.$refs.teamRef.areaText = res.data.provinceName+res.data.cityName;
+						this.$refs.teamRef.industryText = res.data.industryName;
+						this.$refs.teamRef.functionTypeText = res.data.functions.map(f=>f.functionName).join('、');
+						this.$refs.teamRef.architectureTypeText = res.data.organizations.map(f=>f.orgName).join('、');
+						this.$refs.teamRef.teamScaleText = this.teamScaleData.find(d=>d.id==res.data.scale).name;
+						this.$refs.teamRef.teamLevelText = this.teamLevelData.find(d=>d.id==res.data.hierarchy).name;
+					})
+				} 
+				else if(item.text==='复制链接') {
 					this.$showToast('复制成功')
 				}
-				else if(type===4) this.teamUserShow = true
-				else if(type===5){
-					this.$showToast('问卷未完成,全部团队人员作答后才能生成报告')
+				else if(item.text==='团队人员'){
+					this.$api.get(`/core/member/listByQueTeamId/${this.dto.teamQuestionnaireId}`).then(({data:res})=>{
+						if(res.code!==0) return this.$showToast(res.msg)
+						this.teamUserShow = true
+					})
+				} 
+				else if(item.text==='生成报告'){
+					if(this.dto.status==0) return this.$showToast('问卷未完成,全部团队人员作答后才能生成报告')
+					
 				}
-				else if(type===6){
-					this.alertShow = true;
+				else if(item.text==='发送报告'){
+					if(this.dto.status==0) return this.$showToast('请先生成报告后再进行发送报告')
 				}
 			},
-			handleConfirm(){
-				this.teamInfoShow = false;
+			handleConfirm(data){
+				data.coachId = JSON.parse(uni.getStorageSync('userInfo')).id;
+				this.$api.put('/core/user/team',data).then(({data:res})=>{
+					if(res.code!==0) return this.$showToast(res.msg)
+					this.$showToast('保存成功')
+					this.teamInfoShow = false;
+				})
 			},
 			handleAnswer(item){
 				uni.navigateTo({

+ 2 - 2
pagesHome/questionnaire.vue

@@ -54,13 +54,13 @@
 				}
 			},
 			getReceiveList(){
-				this.$api.get('/core/teammember/que/listByUser',{queType:1,teamName:this.keyword}).then(({data:res})=>{
+				this.$api.get('/core/teammember/que/personalList',{teamName:this.keyword}).then(({data:res})=>{
 					if(res.code!==0) return this.$showToast(res.msg)
 					this.receiveList = res.data
 				})
 			},
 			getCreateList(){
-				this.$api.get('/core/teammember/que/listByUser',{queType:0,teamName:this.keyword}).then(({data:res})=>{
+				this.$api.get('/core/teammember/que/createList',{teamName:this.keyword}).then(({data:res})=>{
 					if(res.code!==0) return this.$showToast(res.msg)
 					this.createList = res.data
 				})

+ 5 - 3
pagesHome/questionnaireEdit.vue

@@ -43,7 +43,7 @@
 			<view class="box-num adfacjb" v-if="limit">
 				<view class="box-num-title">可提交次数</view>
 				<view class="box-num-right">
-					<cus-number-box :min="1" :number="dto.answerSetting" @valChange="valChange"></cus-number-box>
+					<cus-number-box ref="cnbRef" :min="1" :number="dto.answerSetting" @valChange="valChange"></cus-number-box>
 				</view>
 			</view>
 		</view>
@@ -120,12 +120,13 @@
 				return value
 			},
 			valChange(e){
-				this.dto.submitNum = e;
+				this.dto.answerSetting = e;
 			},
 			getDetail(){
 				this.$api.get('/core/team/questionnaire/'+this.teamQuestionnaireId).then(({data:res})=>{
 					if(res.code!==0) return this.$showToast(res.msg)
 					this.dto = {...this.dto,...res.data}
+					this.$refs.cnbRef.value = this.dto.answerSetting;
 					this.teamName = res.data.teamName;
 				})
 			},
@@ -143,7 +144,7 @@
 			},
 			handlePreview(){
 				uni.navigateTo({
-					url:'/pagesPublish/questionnairePreview'
+					url:`/pagesPublish/questionnairePreview?questionnaireName=${this.questionnaireName}&teamQuestionnaireId=${this.teamQuestionnaireId}`
 				})
 			},
 			addTeam(){
@@ -155,6 +156,7 @@
 						}
 					}
 				})
+				this.teamShow = false;
 			},
 			addTeamUser(){
 				

+ 17 - 32
pagesPublish/questionnairePreview.vue

@@ -2,13 +2,13 @@
 	<view class="default_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
 		<cus-header title='问卷预览'></cus-header>
 		<view class="top">
-			<view class="top-title">{{'GW+MC PREILL36测评题库版本'}}</view>
+			<view class="top-title">{{questionnaireName}}</view>
 			<view class="top-progress adfac">
 				<view class="top-progress-text">测评进度</view>
 				<view class="top-progress-box">
-					<view class="top-progress-box-current" :style="{'width':(0/36*100)+'%'}"></view>
+					<view class="top-progress-box-current" :style="{'width':(0/total*100)+'%'}"></view>
 				</view>
-				<view class="top-progress-num"><span>{{0}}</span>/{{36}}</view>
+				<view class="top-progress-num"><span>{{0}}</span>/{{total}}</view>
 			</view>
 		</view>
 		<view class="list">
@@ -26,38 +26,23 @@
 		components:{ QuestionItem },
 		data(){
 			return {
-				list:[
-					{
-						question:'我们的团队成员可以清晰阐述团队的共享目的 We can collectively and clearly articulate our shared purpose',
-						userAnswer:[
-							{
-								assessmentMethod:1,
-								answer:'',
-								questionOption:[
-									{ questionOption:'1-强烈不同意(Strongly disagree)' },
-									{ questionOption:'2-不同意(Disagree)' },
-									{ questionOption:'3-中立(Neutral)' },
-									{ questionOption:'4-同意(Agree)' },
-									{ questionOption:'5-完全同意(Totally agree)' }
-								]
-							},
-							{
-								assessmentMethod:2,
-								answer:'',
-								questionOption:[
-									{ questionOption:'1-强烈不同意(Strongly disagree)' },
-									{ questionOption:'2-不同意(Disagree)' },
-									{ questionOption:'3-中立(Neutral)' },
-									{ questionOption:'4-同意(Agree)' },
-									{ questionOption:'5-完全同意(Totally agree)' }
-								]
-							},
-						]
-					}
-				],
+				questionnaireName:'',
+				total:0,
+				list:[],
 			}
 		},
+		onLoad(options) {
+			this.questionnaireName = options.questionnaireName;
+			this.getData(options.teamQuestionnaireId)
+		},
 		methods:{
+			getData(id){
+				this.$api.get(`/core/team/member/answer/listByUser/${id}`).then(({data:res})=>{
+					if(res.code!==0) return this.$showToast(res.msg)
+					this.list = res.data;
+					this.total = res.data.length;
+				})
+			},
 			handleBack(){
 				uni.navigateBack();
 			}