Explorar o código

服务标准提交数据

WFADLMOXAOK6T5N\Administrator %!s(int64=3) %!d(string=hai) anos
pai
achega
5ce3c494db

+ 1 - 1
client/pages/servant/servantsettings/servantsettings.axml

@@ -14,7 +14,7 @@
       <view  a:if="{{subjectitem.isChoose}}">
         <text class="item-title">{{subjectitem.subject}}</text>
         <view class="item-body" a:for="{{subjectitem.answer}}" a:for-item="answeritem" key="{{answerindex}}">
-          <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" class="item-body-checkbox"/><text>{{answeritem.answer}}</text>
+          <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" onChange="answerselected" class="item-body-checkbox"/><text>{{answeritem.answer}}</text>
         </view>
       </view>
       <view class="item-body">

+ 11 - 6
client/pages/servant/servantsettings/servantsettings.js

@@ -21,17 +21,18 @@ Page({
   },
   dailytasksdeit(){
     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++){
+    for(let i=0;i<this.data.servantlist.length;i++){
+        for(let j=0;j<this.data.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+',';
+            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+',';
                 }
             }
           console.log(answerstr);
-          servantselectedlist.push({answer: [answerstr],customAnswer: this.servantlist[i].subjectList[j].subject,subjectId: this.servantlist[i].subjectList[j].subjectId});
+          servantselectedlist.push({answer: [answerstr],customAnswer: this.data.servantlist[i].subjectList[j].subject,subjectId: this.data.servantlist[i].subjectList[j].subjectId});
         }
     }
         console.log(servantselectedlist);
@@ -39,6 +40,10 @@ Page({
         alert(data);
       });
   },
+  answerselected(e){
+      let checkeditem=e.detail.value;
+      console.log(checkeditem);
+  },
 });