import request from '../../../util/http' import apiUrl from '../../../util/apiUrl1' import util from '../../../util/util' import moment from 'moment' var app = getApp(); Page({ data: { servantlist:[], }, onLoad() { this.getservantlist("SN000002"); }, ///加载绑定数据 getservantlist(subjectType){ request.httpServiceGet(apiUrl.servantappletservicePath,{subjectType:subjectType}).then(data=>{ //console.log(data); let servantlist = data; var that = this; for(let i=0;i0||this.data.servantlist[i].subjectList[j].customAnswer.length>0){ answerstr=answerstr.substring(0,answerstr.length - 1); servantselectedlist.push({answer: [answerstr],customAnswer: this.data.servantlist[i].subjectList[j].customAnswer,subjectId: this.data.servantlist[i].subjectList[j].subjectId}); } } } //console.log(servantselectedlist); request.httpServicePost(apiUrl.insertNewservantappletservicePath,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002"}).then(data=>{ my.alert({ title: '提示', content: '设置完成', buttonText: '确定', success: () => { my.navigateBack(); } } ); }); }, //选择问题 多选 answerselected(e){ let checkedlist=e.detail.value; let servantlist=this.data.servantlist; //先做清除 for(let i=0;i