Browse Source

2010-20-16bug修改

yangyongyong 4 years ago
parent
commit
72c30266d6

+ 13 - 1
client/pages/customer/servantsettings/servantsettings.js

@@ -48,12 +48,14 @@ Page({
   dailytasksdeit(){
     let employRelationNo = app.globalData.employRelationNo;
     let servantselectedlist=[];
+    let isnochecked=false;
     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 +',';
+                  isnochecked=true;
                 }
             }
           //console.log(answerstr);
@@ -63,7 +65,14 @@ Page({
           }
         }
     }
-        //console.log(servantselectedlist);
+    //判断是否为空,如果为空不让提交
+    if(!isnochecked){
+      my.alert({
+          title: '提示',
+          content: '任务不能为空',
+          buttonText: '确定'
+        } );
+    }else{
       request.httpServicePost(apiUr.employerServiceStandard,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000001"}).then(data=>{
         my.alert({
           title: '提示',
@@ -74,6 +83,9 @@ Page({
           }
         } );
       });
+    }
+
+      
   },
   //选择问题 多选
   answerselected(e){

+ 13 - 10
client/pages/customer/taskreminder/taskreminder.acss

@@ -110,34 +110,36 @@
   background: #FAFAFA;
   border-radius: 12px;
   font-size: 28rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
   font-weight: 400;
   color: #333333;
   line-height: 100rpx;
   padding-left: 28rpx;
   margin-top: 30rpx;
-  display: flex;
   flex-direction: row;
-  justify-content: space-between;
   align-items: center;
 }
+.tasksname{
+  margin-right: 18rpx;
+  float: left;
+}
 .tasks-item-no{
   width: 122rpx;
   height: 102rpx;
-  /* float: right; */
   background-color:#fff6f4;
 }
 .homecssname{
   color: #09AFFF;
+  float: left;
 }
 .tasks-item-red{
-  width: 122rpx;
   height: 102rpx;
-  /* float: right; */
   border-top-right-radius: 12rpx;
   border-bottom-right-radius: 12rpx;
   background-color:#FAFAFA;
-  color: #FF5030
+  color: #FF5030;
+  text-align: center;
+  float: right;
+  margin-right: 36rpx;
 }
 .tasks-item-yes{
   width: 122rpx;
@@ -171,16 +173,17 @@
   /* width: 60%; */
   /* float: left; */
 }
-.nogood{
+.tasksstate{
   width: 120rpx;
   height: 31rpx;
+  line-height: 31rpx;
   background: #FFEDEA;
   border-radius: 4px;
   color: #FF5030;
   font-size: 20rpx;
-  display: inline-block;
-  margin-left: 16rpx;
   text-align: center;
+  float: left;
+  margin-top: 38rpx;
 }
 .tasks-set{
   float: right;

+ 6 - 6
client/pages/customer/taskreminder/taskreminder.axml

@@ -47,9 +47,9 @@
         <view class="tik-right"  onTap="switchEditTask"><image mode="scaleToFill" src="/image/icon-edit.png"/><label>编辑每日任务</label></view>
       </view>
       <!--有提醒任务-->
-      <view a:if="{{isreminds}}" a:for="{{taskList}}" key="{{index}}">
+      <view a:if="{{isreminds}}" a:for="{{taskList.servantTasks}}" key="{{index}}">
         <view class="tasks-list-item" a:if="{{item.state == 0}}">
-          <text> {{item.itemName}}</text>
+          <view class="tasksname"> {{item.itemName}}</view>
           <view class="tasks-item-red" a:if="{{tomorrowtasksState}}">
             <text> 未完成</text>
           </view>
@@ -62,10 +62,10 @@
           </view>
         </view>
         <view class="tasks-list-item" a:if="{{item.state == 2}}">
-          <text>{{item.itemName}}</text>
-          <label class="nogood" a:if="{{item.incompleteReason == 1}}">任务太多</label>
-          <label class="nogood" a:if="{{item.incompleteReason == 2}}">我不会</label>
-          <label class="nogood" a:if="{{item.incompleteReason == 3}}">任务不详细</label>
+          <view class="tasksname"> {{item.itemName}}</view>
+          <view class="tasksstate" a:if="{{item.incompleteReason == 1}}">任务太多</view>
+          <view class="tasksstate" a:if="{{item.incompleteReason == 2}}">我不会</view>
+          <view class="tasksstate" a:if="{{item.incompleteReason == 3}}">任务不详细</view>
           <view class="tasks-item-red">
             <text> 未完成</text>
           </view>

+ 11 - 14
client/pages/customer/taskreminder/taskreminder.js

@@ -160,16 +160,14 @@ Page({
       "date": this.data.nowselectTime
     }
     request.httpServiceGet(apiUrl1.selectDayTaskItemPath, params).then(data => {
-      // 未设置任务
-      if (data.servantTasks.length == 0) {
-        this.setData({
-          isreminds: false,
-          workDay: true,
-          isremindscose:false
-        });
-      } else {
-        //判断是否是休息日
-        if(data.servantTasks.workDay){
+      if(data.workDay){
+        if (data.servantTasks.length == 0) {//没有任务
+          this.setData({
+            isreminds: false,
+            workDay: true,
+            isremindscose:false
+          });
+        }else{
           // 今天有任务
           this.setData({
             taskList: data,
@@ -177,15 +175,14 @@ Page({
             workDay: true,
             isremindscose:true
           });
-        }else{ //今天休息
-          this.setData({
+        }
+      }else{//今天是休息日
+        this.setData({ 
             workDay: false,
             isremindscose:false
           });
-        }
       }
     }
-
     ).catch(e => {
       console.log(e);
 

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

@@ -63,17 +63,16 @@ Page({
           }
         }
     }
-        //console.log(servantselectedlist);
-      request.httpServicePost(apiUrl.insertNewservantappletservicePath,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002"}).then(data=>{
-        my.alert({
-          title: '提示',
-          content: '设置完成',
-          buttonText: '确定',
-          success: () => {
-            my.navigateBack();
-          }
-        } );
-      });
+    request.httpServicePost(apiUrl.insertNewservantappletservicePath,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002"}).then(data=>{
+      my.alert({
+        title: '提示',
+        content: '设置完成',
+        buttonText: '确定',
+        success: () => {
+          my.navigateBack();
+        }
+      } );
+    });
   },
   //选择问题 多选
   answerselected(e){