gaoyognxing 4 anos atrás
pai
commit
0b4a93e23f

+ 70 - 2
client/pages/common/index/index.js

@@ -92,7 +92,10 @@ Page({
       });    
       }else{
         // 判断缓存中是否上一次选过某个保姆或雇主,没有的话进入列表
-        if(userInfo.userType=='1'){
+            let emReNoStorage = my.getStorageSync({ key: 'employRelationNo' });
+            console.log(emReNoStorage);
+            if(emReNoStorage.data==null){
+                if(userInfo.userType=='1'){
             my.redirectTo({
       url: '../../customer/myServantList/myServantList'
       });  
@@ -101,6 +104,37 @@ Page({
       url: '../../servant/myCustomerList/myCustomerList'
       });  
         }
+            }else{
+              // 进入工作站
+               let emReNo=emReNoStorage.data;
+      
+        if(userInfo.userType=='1'){
+      
+        my.redirectTo({
+          url: '../../customer/customerCenter/customerCenter?emReNo='+emReNo
+        }); 
+        }else if(userInfo.userType=='2'){
+  
+       my.redirectTo({
+          url: '../../servant/servantCenter/servantCenter?emReNo='+emReNo
+        }); 
+        }
+
+            }
+
+
+    //     if(userInfo.userType=='1'){
+    //         my.redirectTo({
+    //   url: '../../customer/myServantList/myServantList'
+    //   });  
+    //     }else if(userInfo.userType=='2'){
+    // my.redirectTo({
+    //   url: '../../servant/myCustomerList/myCustomerList'
+    //   });  
+    //     }
+
+
+
       }
 
         }).catch(e=>{
@@ -135,7 +169,10 @@ Page({
       });    
       }else{
         // 判断缓存中是否上一次选过某个保姆或雇主,没有的话进入列表
-        if(userInfo.userType=='1'){
+let emReNoStorage = my.getStorageSync({ key: 'employRelationNo' });
+            console.log(emReNoStorage);
+            if(emReNoStorage.data==null){
+                if(userInfo.userType=='1'){
             my.redirectTo({
       url: '../../customer/myServantList/myServantList'
       });  
@@ -144,6 +181,37 @@ Page({
       url: '../../servant/myCustomerList/myCustomerList'
       });  
         }
+            }else{
+              // 进入工作站
+               let emReNo=emReNoStorage.data;
+      
+        if(userInfo.userType=='1'){
+      
+        my.redirectTo({
+          url: '../../customer/customerCenter/customerCenter?emReNo='+emReNo
+        }); 
+        }else if(userInfo.userType=='2'){
+  
+       my.redirectTo({
+          url: '../../servant/servantCenter/servantCenter?emReNo='+emReNo
+        }); 
+        }
+
+            }
+
+    //     if(userInfo.userType=='1'){
+    //         my.redirectTo({
+    //   url: '../../customer/myServantList/myServantList'
+    //   });  
+    //     }else if(userInfo.userType=='2'){
+    // my.redirectTo({
+    //   url: '../../servant/myCustomerList/myCustomerList'
+    //   });  
+    //     }
+
+
+
+
       }
         
       

+ 8 - 7
client/pages/customer/customerCenter/customerCenter.axml

@@ -1,9 +1,10 @@
+<import-sjs from="../../../util/formateFuc.sjs" name="formate"></import-sjs>
 <view class="common-page-padding">
  <!-- 信息面板 -->
  <view class="common-card top-panel {{isBind?'':'un-bind'}}">
        <view class="info-main">
            <view class="show-name">
-              <text>王阿姨</text>
+              <text>{{servantName}}</text>
               <image mode="aspectFill" src="/image/icon-edit.png" class="edit-btn" onTap="editServant"/>
            </view>
            <view class="switch-list"  onTap="switchList">
@@ -13,10 +14,10 @@
            </view>
             
        </view>
-       <view class="work-day">周一·周二·周三·周四·周五</view>
+       <view class="work-day">{{workDay}}</view>
        <view class="about-detail">
           <view class="about-left">
-              <view class="service-model">保姆工种:钟点工</view>
+              <view class="service-model">保姆工种:{{formate.serviceType(serviceType)}}</view>
               <view class="bind-code" a:if="{{!isBind}}">
               <text>关联码:{{bindCode}}</text>
               <text class="copy-btn" onTap="copyCode">复制</text>
@@ -34,15 +35,15 @@
      
  </view>
  <!-- 任务提醒 -->
-  <view class="common-card task-module">
+  <view class="common-card task-module"  onTap="switchTaskRemind">
      <view class="task-top">
       <view class="module-title">任务提醒
-       <text class="task-schedule"  a:if="{{taskListShow}}">完成进度7/10</text>
+       <text class="task-schedule"  a:if="{{taskListShow}}">完成进度{{completeTaskCount}}/{{totalTaskCount}}</text>
       </view>
       <view class="module-detail">高效沟通 任务提醒更可靠</view>
       </view>
      <!-- 暂未添加 -->
-     <view class="no-add" a:if="{{noAddTaskShow}}">
+     <view class="no-add" a:if="{{noAddTaskShow}}"  onTap="switchAddTask">
          +快速添加
      </view>
      <!-- 今天无任务 -->
@@ -62,7 +63,7 @@
       <view class="module-text">
       <view class="module-title">
       服务标准
-      <text class="no-service-standard">未设置</text>
+      <text class="no-service-standard"  a:if="{{noSetSerStan}}">未设置</text>
       </view>
       <view class="module-detail">标准化服务 更贴心</view>
       </view>

+ 212 - 11
client/pages/customer/customerCenter/customerCenter.js

@@ -1,16 +1,22 @@
+import request from '../../../util/http'
+import apiUrl from '../../../util/apiUrl'
+var app = getApp();
 Page({
   data: {
-    isBind:false,// 是否关联
+    servantName:'',//保姆姓名
+    workDay:'',//工作日
+    isBind:false,// 是否关联 0 未关联 1关联
     isOnlyOne:false,//切换列表是否只有一个
     noAddTaskShow:false,//未添加任务
     noTaskShow:false,//今天无任务
-    taskListShow:true,//任务列表
-    bindCode:'123456789',//关联码
-    taskList:['洗衣服','做晚饭','打扫卫生'],
+    taskListShow:false,//任务列表
+    bindCode:'',//关联码
+    taskList:[],
     noticeShow:true,//通知栏展示
-    unSetServiceModal:true,//未设置服务标准
+    unSetServiceModal:false,//未设置服务标准
     unSetTaskModal:false,//未设置任务提醒
     finishSetModal:false,//完成设置指引
+    noSetSerStan:false,//未设置服务标准
  
     unSetBtn: [
       { text: '现在设置', extClass: 'buttonBold' },
@@ -33,13 +39,193 @@ Page({
     // 从存储中获取是否完成首次设置,如果完成则不弹框提示
     // 如果是首次未设置,首先弹框提示服务标准设置,然后提示任务设置,首次从设置任务跳转过来展示完成指引
     console.log(query);
-    this.setData({
-      finishTitle:this.data.finishModalCase1[0],
-      finishTips:this.data.finishModalCase1[1],
-    });
+    // this.setData({
+    //   finishTitle:this.data.finishModalCase1[0],
+    //   finishTips:this.data.finishModalCase1[1],
+    // });
        let emReNo=query.emReNo;
     //  存储此次进入任务中心的关联码
     app.globalData.employRelationNo=emReNo;
+     my.setStorageSync({
+          key: 'employRelationNo',
+         data: emReNo
+           });
+  
+        this.initCustomerInfo();
+    // 如果携带创建任务完成时参数,弹框提示完成指引
+
+  },
+ onShow(query){
+    console.log(query);
+  },
+    // 获取雇佣关系详情
+  initCustomerInfo(){
+     let params={
+        "employRelationNo":app.globalData.employRelationNo
+    }
+     request.httpServiceGet(apiUrl.getRelationInfoPath,params).then(data=>{
+        console.log(data);
+        let servantSetState=data.servantSetState;
+      
+        let isOnlyOne=(data.isMoreServant<=1);
+         let  isInvalid=(data.isInvalid=='1');
+          this.setData({
+         servantName:data.servantName,
+         workDay:data.servantTaskPeriod.workDay,
+         serviceType:data.servantType,
+         isOnlyOne:isOnlyOne,
+         isBind:isInvalid,
+         bindCode:data.employIdentifier
+       });
+      // 未完成初次设置的
+        if(servantSetState=='0'){
+            this.setData({
+            //  unSetServiceModal:true,
+            //  noSetSerStan:true,
+             noAddTaskShow:true,
+             });
+          //  获取服务标准和任务设置的具体情况
+          this.isSetServiceAndTask();
+        }else{
+            this.setData({
+         unSetServiceModal:false,
+        });
+        // 获取任务设置和服务标准设置
+    this.isChooseSerStanSubject();
+    this.selectTodayTaskItem();
+        }
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+
+
+    // 是否设置服务标准
+    isChooseSerStanSubject(){
+     let params={
+        "employRelationNo":app.globalData.employRelationNo
+    }
+     request.httpServiceGet(apiUrl.isChooseSerStanSubjectPath,params).then(data=>{
+        console.log(data);
+        
+
+        let noSetSerStan=(data=='0'?true:false);
+          this.setData({
+         noSetSerStan:noSetSerStan,
+       });
+    
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+
+ // 是否每日任务,每日任务前三条
+    selectTodayTaskItem(){
+     let params={
+        "employRelationNo":app.globalData.employRelationNo
+    }
+     request.httpServiceGet(apiUrl.selectTodayTaskItemPath,params).then(data=>{
+        console.log(data);
+        // 未设置任务
+        if(!data.isSet){
+            this.setData({
+         noAddTaskShow:true,
+         noTaskShow:false,
+         taskListShow:false,
+       });
+        }else{
+            // 今天是休息日
+            if(data.servantTasks.length==0){
+                this.setData({
+         noAddTaskShow:false,
+         noTaskShow:true,
+         taskListShow:false,
+         taskList:data.servantTasks
+       });
+            }else{
+              // 今天有任务
+                this.setData({
+         noAddTaskShow:false,
+         noTaskShow:false,
+         taskListShow:true,
+         taskList:data.servantTasks,
+         completeTaskCount:data.completeTaskCount,
+         totalTaskCount:data.totalTaskCount
+         });
+            }
+        }
+
+    
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+
+
+   // 是否设置服务标准和任务
+    isSetServiceAndTask(){
+     let params={
+        "employRelationNo":app.globalData.employRelationNo
+    }
+     request.httpServiceGet(apiUrl.isSetServiceAndTaskPath,params).then(data=>{
+        console.log(data);
+        let service=data.service;
+        let  task=data.task;
+        if(!service && !task){
+          // 任务和服务标准都未设置
+           this.setData({
+      finishTitle:this.data.finishModalCase1[0],
+      finishTips:this.data.finishModalCase1[1],
+    });
+           this.setData({
+             unSetServiceModal:true,
+             noSetSerStan:true,
+             });
+        }else if(service &&!task){
+           // 服务标准设置,任务未设置
+            this.setData({
+      finishTitle:this.data.finishModalCase2[0],
+      finishTips:this.data.finishModalCase2[1],
+    });
+            this.setData({
+             unSetServiceModal:false,
+             noSetSerStan:false,
+             unSetTaskModal:true
+             });
+        }else if(service &&task){
+            // 服务标准完成,任务完成
+             this.setData({
+      finishTitle:this.data.finishModalCase3[0],
+      finishTips:this.data.finishModalCase3[1],
+    });
+          this.setData({
+             unSetServiceModal:false,
+             noSetSerStan:false,
+             unSetTaskModal:false,
+             finishSetModal:true,
+             });
+             this.selectTodayTaskItem();//获取任务前三条
+        }
+     
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+  switchAddTask(){
+    // 跳转到添加任务页面
+       my.navigateTo({
+      url: '../dailytasks/dailytasks'
+    });
+  },
+    switchTaskRemind(){
+      // 跳转到任务提醒器页面
+  //  my.navigateTo({
+  //     url: '../dailytasks/dailytasks'
+  //   });
   },
   switchList(){
     my.navigateTo({
@@ -96,9 +282,23 @@ Page({
       unSetTaskModal: false,
     });
     // 跳转到任务设置页面,传首次设置任务的参数
-  
+    my.navigateTo({
+      url: '../dailytasks/dailytasks?firstSetTask=1'
+    });
     }else{
       // 提醒完成设置
+    if(this.data.noSetSerStan&&this.data.noAddTaskShow){
+        this.setData({
+      finishTitle:this.data.finishModalCase1[0],
+      finishTips:this.data.finishModalCase1[1],
+    });
+    }else if(!this.data.noSetSerStan&&this.data.noAddTaskShow){
+          this.setData({
+      finishTitle:this.data.finishModalCase2[0],
+      finishTips:this.data.finishModalCase2[1],
+    });
+    }
+      
       this.setData({
       unSetTaskModal: false,
       finishSetModal:true
@@ -114,7 +314,8 @@ Page({
        this.setData({
       finishSetModal: false,
     });
-    // 首次设置完成标示缓存下来
+    // 首次设置完成提交后台完成引导设置
+
     }else{
      
     }

+ 1 - 14
client/pages/customer/myServantList/myServantList.js

@@ -14,20 +14,7 @@ Page({
       { text: '取消' },
       { text: '确定', extClass: 'buttonBold' },
     ],
-    servantList:[
-      {
-        name:'王阿姨',
-        workDay:'周一、周二、周三、周四、周五、周六',
-        serviceModel:'钟点工',
-        bindDate:'2020-09-19'
-    },
-   {
-        name:'张阿姨',
-        workDay:'周一、周二、周三、周四、周五、周六',
-        serviceModel:'钟点工',
-        bindDate:'2020-09-25'
-
-    }]
+    servantList:[]
   },
   onLoad() {
     // this.initServantList();

+ 2 - 2
client/pages/servant/servantCenter/servantCenter.axml

@@ -35,7 +35,7 @@
   <view class="common-card task-module" onTap="switchTaskRemind">
      <view class="task-top">
       <view class="module-title">任务提醒
-       <text class="task-schedule"  a:if="{{taskListShow}}">完成进度7/10</text>
+       <text class="task-schedule"  a:if="{{taskListShow}}">完成进度{{completeTaskCount}}/{{totalTaskCount}}</text>
       </view>
       <view class="module-detail">高效沟通 任务提醒更可靠</view>
       </view>
@@ -50,7 +50,7 @@
      <!-- 任务列表 -->
      <view class="task-list" a:if="{{taskListShow}}">
         <view class="task-item" a:for="{{taskList}}" key="{{index}}">
-        {{item}}
+        {{item.itemName}}
         </view>
      </view>
      

+ 13 - 6
client/pages/servant/servantCenter/servantCenter.js

@@ -8,7 +8,7 @@ Page({
     noAddTaskShow:true,//未添加任务
     noTaskShow:false,//今天无任务
     taskListShow:false,//任务列表
-    taskList:['洗衣服','做晚饭','打扫卫生'],
+    taskList:[],
     noticeShow:true,//通知栏展示
       editModalShow:false,//编辑弹框
       unSetModal:false,//未设置偏好
@@ -25,13 +25,21 @@ Page({
     customerName:'',//客户姓名
     editCustomerName:'',//编辑客户姓名
     workDay:'',//工作日
-    serviceType:''//保姆工种
+    serviceType:'',//保姆工种
+    completeTaskCount:'',
+    totalTaskCount:''
   },
   onLoad(query) {
      console.log(query);
      let emReNo=query.emReNo;
     //  存储此次进入任务中心的关联码
     app.globalData.employRelationNo=emReNo;
+  my.setStorageSync({
+          key: 'employRelationNo',
+         data: emReNo
+           });
+  
+
     this.initCustomerInfo();
     this.isChooseSerHobSubject();
     this.isChooseSerStanSubject();
@@ -130,14 +138,13 @@ Page({
          noAddTaskShow:false,
          noTaskShow:false,
          taskListShow:true,
+         taskList:data.servantTasks,
+         completeTaskCount:data.completeTaskCount,
+         totalTaskCount:data.totalTaskCount
          });
             }
         }
 
-        let noSetSerStan=(data=='0'?true:false);
-          this.setData({
-         noSetSerStan:noSetSerStan,
-       });
     
           }).catch(e=>{
            console.log(e);

+ 7 - 1
client/util/apiUrl.js

@@ -32,7 +32,11 @@ const getDailyTaskList = baseService + "/taskItem/selectDayTaskItem";
 //完成编辑任务
 const completeEditDailyTask = baseService + "/taskItem/createDayTaskItem";
 
+//GET  /notice/isSetServiceAndTask  雇主端通知:是否设置服务标准--->是否设置任务提醒
+const isSetServiceAndTaskPath=baseService+'/notice/isSetServiceAndTask';
 
+//post /employerRelation/updateEmploySetState  雇主端-设置雇佣之间第一次通知完成状态:0没有设置,1已设置完成,传EmployRelationNo和EmploySetState
+const updateEmploySetStatePath=baseService+'/employerRelation/updateEmploySetState';
 
 
 export default{
@@ -48,5 +52,7 @@ isChooseSerHobSubjectPath,
 isChooseSerStanSubjectPath,
 selectTodayTaskItemPath,
 getDailyTaskList,
-completeEditDailyTask
+completeEditDailyTask,
+isSetServiceAndTaskPath,
+updateEmploySetStatePath
 }