Bladeren bron

提交服务标准

WFADLMOXAOK6T5N\Administrator 4 jaren geleden
bovenliggende
commit
f121c8e93f
1 gewijzigde bestanden met toevoegingen van 17 en 5 verwijderingen
  1. 17 5
      client/pages/servant/servantsettings/servantsettings.js

+ 17 - 5
client/pages/servant/servantsettings/servantsettings.js

@@ -20,11 +20,23 @@ Page({
       });
   },
   dailytasksdeit(){
-      request.httpServicePost(apiUrl.insertNewservantappletservicePath,{servantlist:this.servantlist}).then(data=>{
-        console.log(data);
-        this.setData({
-          servantlist: data
-        });
+    let employRelationNo = app.globalData.employRelationNo;
+    let servantselectedlist=[];
+    for(let i=0;i<this.servantlist.length;i++){
+        for(let j=0;j<this.servantlist[i].subjectList.length;j++){
+          let answerstr='';
+            for(let t=0;t<this.servantlist[i].subjectList[j].answer.length;t++){
+                if(this.servantlist[i].subjectList[j].answer[t].isChoose){
+                  answerstr+=this.servantlist[i].subjectList[j].answer[t].answer+',';
+                }
+            }
+          servantselectedlist.push({answer: [answerstr],customAnswer: this.servantlist[i].subjectList[j].subject,subjectId: this.servantlist[i].subjectList[j].subjectId});
+        }
+    }
+      request.httpServicePost(apiUrl.insertNewservantappletservicePath,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002"}).then(data=>{
+        alert(data);
       });
   },
 });
+
+