gaoyognxing 4 lat temu
rodzic
commit
9807eea906

+ 17 - 7
client/pages/customer/servantsettings/servantsettings.js

@@ -37,7 +37,7 @@ Page({
         });
       });
   },
-  //提交数据
+ //提交数据
   dailytasksdeit(){
     let employRelationNo = app.globalData.employRelationNo;
     let servantselectedlist=[];
@@ -46,19 +46,26 @@ Page({
           let answerstr='';
             for(let t=0;t<this.data.servantlist[i].subjectList[j].answer.length;t++){
                 if(this.data.servantlist[i].subjectList[j].answer[t].isChoose){
-                  answerstr += this.data.servantlist[i].subjectList[j].answer[t].answer+',';
+                  answerstr += this.data.servantlist[i].subjectList[j].answer[t].answer +',';
                 }
             }
           //console.log(answerstr);
-          servantselectedlist.push({answer: [answerstr],customAnswer: this.data.servantlist[i].subjectList[j].subject,subjectId: this.data.servantlist[i].subjectList[j].subjectId});
+          if(answerstr.length>0||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("1111111111" + servantselectedlist);
+        //console.log(servantselectedlist);
       request.httpServicePost(apiUr.employerServiceStandard,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000001"}).then(data=>{
-        console.log("asasfsd" + data)
         my.alert({
-          title: data,
-        });
+          title: '提示',
+          content: '设置完成',
+          buttonText: '确定',
+          success: () => {
+            my.navigateBack();
+          }
+        } );
       });
   },
   //选择问题 多选
@@ -184,3 +191,6 @@ Page({
 });
 
 
+
+
+