Explorar o código

Merge branch 'master' of http://47.102.110.240:3000/yuxiangpei/tbServantMini_cloud

una %!s(int64=4) %!d(string=hai) anos
pai
achega
7c45c933e0

+ 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">

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

@@ -20,11 +20,30 @@ 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.data.servantlist.length;i++){
+        for(let j=0;j<this.data.servantlist[i].subjectList.length;j++){
+          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+',';
+                }
+            }
+          console.log(answerstr);
+          servantselectedlist.push({answer: [answerstr],customAnswer: this.data.servantlist[i].subjectList[j].subject,subjectId: this.data.servantlist[i].subjectList[j].subjectId});
+        }
+    }
+        console.log(servantselectedlist);
+      request.httpServicePost(apiUrl.insertNewservantappletservicePath,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002"}).then(data=>{
+        alert(data);
       });
   },
+  answerselected(e){
+      let checkeditem=e.detail.value;
+      console.log(checkeditem);
+  },
 });
+
+

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

@@ -18,7 +18,7 @@
         <label>周日</label>
       </view>
         <view class="cell-type">
-          保工种:<label>钟点工</label>
+          保工种:<label>钟点工</label>
         </view>
       </view>
       <!---一周任务查看器-->

+ 6 - 3
mini.project.json

@@ -1,5 +1,8 @@
 {
-  "cloud": {
-    "type": "CLOUDAPP"
-  }
+    "cloud": {
+        "type": "CLOUDAPP"
+    },
+    "exclude": [
+        "server/**"
+    ]
 }