Ver código fonte

雇主端-服务标准编辑

fuxubing 4 anos atrás
pai
commit
1a2d279532

+ 3 - 2
client/app.json

@@ -20,8 +20,9 @@
     "pages/servant/servantsettings/servantsettings",
     "pages/servant/servantedit/servantedit",
     "pages/customer/servantsettings/servantsettings",
-    "pages/servant/servantsettings/servantsettings",
-    "pages/customer/reportList/reportList"
+   "pages/customer/servantedit/servantedit",
+    "pages/customer/reportList/reportList",
+    "pages/customer/editDailyTask/editDailyTask"
   ],
   "window": {
     "defaultTitle": "保姆管家",

+ 1 - 1
client/pages/customer/customerCenter/customerCenter.axml

@@ -75,7 +75,7 @@
      <!-- 任务列表 -->
      <view class="task-list" a:if="{{taskListShow}}">
         <view class="task-item" a:for="{{taskList}}" key="{{index}}">
-        {{item}}
+        {{item.itemName}}
         </view>
      </view>
      

+ 8 - 5
client/pages/customer/dailytasks/dailytasks.js

@@ -67,14 +67,17 @@ Page({
   let employRelationNo = app.globalData.employRelationNo;
   let dailytasklist=[];
     for(let i=0;i<this.data.allList.length;i++){
-      let itemIds='';
+      let itemIds=[];
+      let t=0;
         for(let j=0;j<this.data.allList[i].TaskItems.length;j++){
-          if(this.data.allList[i].TaskItems[j].checked){
-            itemIds += '"'+this.data.allList[i].TaskItems[j].id+'"' +',';
+          if(this.data.allList[i].TaskItems[j].checked==true){
+            itemIds[t]=this.data.allList[i].TaskItems[j].id;
+            t++;
           }
         }
-        itemIds=itemIds.substring(0,itemIds.length - 1);
-        dailytasklist.push({categoryId:this.data.allList[i].categoryId,itemIds:[itemIds]});
+        if(itemIds.length>0){
+          dailytasklist.push({categoryId:this.data.allList[i].categoryId,itemIds:itemIds});
+        }
     }
     request.httpServicePost(apiUrl1.createDayTaskItem,{employRelationNo:employRelationNo,taskItems:dailytasklist}).then(data=>{
       my.alert({

+ 66 - 0
client/pages/customer/editDailyTask/editDailyTask.acss

@@ -0,0 +1,66 @@
+.daily-servant-page{
+  padding-top:24rpx;
+  padding-bottom: 10rpx;
+}
+.dailyitem{
+  padding:24rpx;
+  margin-bottom: 10rpx;
+}
+.every-week{
+  color: #666;
+  font-weight:normal;
+}
+.name-content{
+  padding-right:30rpx;
+}
+.name-input{
+  text-align: right;
+  width:100%;
+}
+.daily-list{
+  margin-top:24rpx;
+  display: flex;
+  flex-wrap: wrap;
+}
+.daily-item{
+  height: 52rpx;
+  line-height: 52rpx;
+  border:1rpx solid #999;
+  color: #999;
+  margin:0 20rpx 16rpx 0;
+  border-radius:52rpx;
+  text-align: center;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+}
+.daily-item-selected{
+  background: #E6F7FF;
+  border-color:#09AFFF;
+  color:#09AFFF;
+}
+.picker-wrapper{
+    padding:0 24rpx;
+  height: 102rpx;
+  margin-bottom:18rpx;
+  line-height: 102rpx;
+}
+
+.row{
+  display: flex;
+  align-items: center;
+}
+.row-title{
+  font-weight:bold;
+}
+.row-extra{
+  flex:1;
+  text-align: right;
+}
+.row-arrow{
+  width:12rpx;
+  height: 22rpx;
+  margin:0 0 0 10rpx;
+}
+.dailyitem-buttom{
+  height: 120rpx;
+}

+ 15 - 0
client/pages/customer/editDailyTask/editDailyTask.axml

@@ -0,0 +1,15 @@
+<view class="common-page-padding daily-servant-page">
+  <view a:for="{{allList}}" key="{{index}}">
+    <view class="common-card dailyitem">
+      <view class="cell-title">{{item.categoryName}}</view>
+      <view class="daily-list">
+        <view a:for="{{item.TaskItems}}"  a:for-item="dailyitem" class="daily-item {{dailyitem.checked==true ?'daily-item-selected':''}}" a:for-item="dailyitem" a:for-index='sdddd' key="{{index}}" data-id="{{dailyitem.id}}" data-index="{{dailyitem.categoryId}}" onTap="toggleWashinGandnursing">{{dailyitem.itemName}}</view>
+      </view>
+    </view>
+  </view>
+  <view class="dailyitem-buttom"></view>
+
+ <view class="common-button-wrapper">
+     <button type="primary" class="common-button" hover-class="active-button"  onTap="dailytasksdeit">完成编辑</button>
+  </view>
+</view>

+ 93 - 0
client/pages/customer/editDailyTask/editDailyTask.js

@@ -0,0 +1,93 @@
+import request from '../../../util/http'
+import apiUrl from '../../../util/apiUrl'
+import apiUrl1 from '../../../util/apiUrl1'
+var app = getApp();
+Page({
+  data: {
+    allList: []
+  },
+  onLoad(options) {
+    console.log(options);
+  },
+  onShow() {
+    this.initDailyTaskList();
+  },
+  //数据加载
+  initDailyTaskList() {
+    let params = {
+    }
+    request.httpServiceGet(apiUrl.getDailyTaskList, params).then(data => {
+      if (data.length > 0) {
+        //添加选中的状态列
+        let dailytasklist = data;
+        var that = this;
+        for(let i=0;i<dailytasklist.length;i++){
+          for(let j=0;j<dailytasklist[i].TaskItems.length;j++){
+            dailytasklist[i].TaskItems[j].checked=false;
+          }
+        }
+        this.setData({
+          allList: dailytasklist
+        });
+      } else {
+        this.setData({
+          allList: []
+        });
+      }
+    }).catch(e => {
+      console.log(e);
+    })
+
+  },
+  //点击选中任务
+  toggleWashinGandnursing(e) {
+    let currentIndex= e.target.dataset.index;//类型ID
+    let id = e.target.dataset.id;//选中当前ID
+    let dailytasklist=this.data.allList;
+    for(let i=0;i<dailytasklist.length;i++){
+      if(dailytasklist[i].categoryId==currentIndex){
+        for(let j=0;j<dailytasklist[i].TaskItems.length;j++){
+          if(dailytasklist[i].TaskItems[j].id==id){
+            if(dailytasklist[i].TaskItems[j].checked){
+              dailytasklist[i].TaskItems[j].checked=false;
+            }else{
+              dailytasklist[i].TaskItems[j].checked=true;
+            }
+          }
+        }
+      }
+    }
+    this.setData({
+          allList: dailytasklist
+        });
+
+  },
+  //提交数据
+  dailytasksdeit() {
+  let employRelationNo = app.globalData.employRelationNo;
+  let dailytasklist=[];
+    for(let i=0;i<this.data.allList.length;i++){
+      let itemIds=[];
+      let t=0;
+        for(let j=0;j<this.data.allList[i].TaskItems.length;j++){
+          if(this.data.allList[i].TaskItems[j].checked==true){
+            itemIds[t]=this.data.allList[i].TaskItems[j].id;
+            t++;
+          }
+        }
+        if(itemIds.length>0){
+          dailytasklist.push({categoryId:this.data.allList[i].categoryId,itemIds:itemIds});
+        }
+    }
+    request.httpServicePost(apiUrl1.createDayTaskItem,{employRelationNo:employRelationNo,taskItems:dailytasklist}).then(data=>{
+      my.alert({
+        title: '提示',
+        content: '保存完成',
+        buttonText: '确定',
+        success: () => {
+          my.navigateBack();
+        }
+      } );
+    });
+  },
+});

+ 3 - 0
client/pages/customer/editDailyTask/editDailyTask.json

@@ -0,0 +1,3 @@
+{
+   "defaultTitle": "每日任务"
+}

+ 58 - 171
client/pages/customer/monthReport/monthReport.js

@@ -11,19 +11,27 @@ import apiUrl from '../../../util/apiUrl'
 var app = getApp();
 Page({
   data: {
-    reportDate: '2020年11月',
-    servantName: '王阿姨',
-    serviceDay: '28',
-    percentTop: '88%',
-    expendTotal: '1888',
-    taskNum: '60',
+    reportDate: '',
+    servantName: '',
+    serviceDay: '',
+    percentTop: '',
+    expendTotal: '',
+    taskNum: '',
     reportInfo:'',
   },
   onLoad() {
     let reportInfo=app.globalData.reportInfo;
+    let serviceTime=JSON.parse(reportInfo.serviceTime);
+    let year=(serviceTime.year==null?'':serviceTime.year);
+    let month=(serviceTime.month==null?'':serviceTime.month);
     console.log(reportInfo);
     this.setData({
       reportInfo:reportInfo,
+      reportDate:year+'年'+month+'月',
+      servantName:serviceTime.nickName,
+      serviceDay:serviceTime.serviceDay,
+      percentTop:serviceTime.serviceQuality,
+      expendTotal:reportInfo.expenses
     })
   },
   onInitChart(F2, config) {
@@ -69,17 +77,14 @@ Page({
   onInitChart1(F2, config) {
     //  本月任务分布饼状图
     const chart = new F2.Chart(config);
-    let taskNum = this.data.taskNum;
-
-    // chart.plugins.register([ PieLabel ]);
-    const data = [
-      { name: '打扫房间', proportion: 0.4, a: '1' },
-      { name: '打扫厨房', proportion: 0.2, a: '1' },
-      { name: '带孩子', proportion: 0.18, a: '1' },
-      { name: '照顾老人', proportion: 0.15, a: '1' },
-      { name: '清洁厨房', proportion: 0.05, a: '1' },
-      { name: '其他', proportion: 0.02, a: '1' },
-    ];
+    let taskNum = JSON.parse(this.data.reportInfo.pieChart).taskSum;
+       let dataList=JSON.parse(this.data.reportInfo.pieChart).randList;
+       dataList.forEach(item => {
+          item.percentage=(item.percentage)*1;
+       });
+       const data =dataList;
+    // const data = JSON.parse(this.data.reportInfo.pieChart).randList;
+    //  const data=[{"taskName":"洗护类","percentage":100.00}]
 
     chart.source(data);
     chart.legend(false);
@@ -90,8 +95,8 @@ Page({
     chart.axis(false);
     chart
       .interval()
-      .position('a*proportion')
-      .color('name', [
+      .position('taskName*percentage')
+      .color('taskName', [
         '#EB6F49',
         '#00D98B',
         '#FDB628',
@@ -117,14 +122,14 @@ Page({
       activeShape: true,
       label1: function label1(data) {
         return {
-          text: data.name,
+          text: data.taskName,
           fill: '#7ED4F6',
           fontWeight: 'bold'
         };
       },
       label2: function label2(data) {
         return {
-          text: data.proportion,
+          text: data.percentage+'%',
           fill: '#7ED4F6'
         };
       },
@@ -141,17 +146,7 @@ Page({
   onInitChart2(F2, config) {
     //  本月任务完成情况
     const chart = new F2.Chart(config);
-    let taskNum = this.data.taskNum;
-
-    // chart.plugins.register([ PieLabel ]);
-    const data = [
-      { name: '打扫房间', proportion: 0.4, a: '1' },
-      { name: '打扫厨房', proportion: 0.2, a: '1' },
-      { name: '带孩子', proportion: 0.18, a: '1' },
-      { name: '照顾老人', proportion: 0.15, a: '1' },
-      { name: '清洁厨房', proportion: 0.05, a: '1' },
-      { name: '其他', proportion: 0.02, a: '1' },
-    ];
+    const data = JSON.parse(this.data.reportInfo.finishInfo);
 
     chart.source(data);
     chart.legend(false);
@@ -177,14 +172,14 @@ Page({
       activeShape: true,
       label1: function label1(data) {
         return {
-          text: data.name,
+          text: data.taskName,
           fill: '#7ED4F6',
           fontWeight: 'bold'
         };
       },
       label2: function label2(data) {
         return {
-          text: data.proportion,
+          text: data.percentage,
           fill: '#7ED4F6'
         };
       },
@@ -202,91 +197,19 @@ Page({
 
     //任务完成趋势图
     const chart = new F2.Chart(config);
- const data = [{
-  time: '2016-08-08 00:00:00',
-  value: 10,
-  type: '预期收益率'
-}, {
-  time: '2016-08-08 00:10:00',
-  value: 22,
-  type: '预期收益率'
-}, {
-  time: '2016-08-08 00:30:00',
-  value: 16,
-  type: '预期收益率'
-}, {
-  time: '2016-08-09 00:35:00',
-  value: 26,
-  type: '预期收益率'
-}, {
-  time: '2016-08-09 01:00:00',
-  value: 12,
-  type: '预期收益率'
-}, {
-  time: '2016-08-09 01:20:00',
-  value: 26,
-  type: '预期收益率'
-}, {
-  time: '2016-08-10 01:40:00',
-  value: 18,
-  type: '预期收益率'
-}, {
-  time: '2016-08-10 02:00:00',
-  value: 26,
-  type: '预期收益率'
-}, {
-  time: '2016-08-10 02:20:00',
-  value: 12,
-  type: '预期收益率'
-}, {
-  time: '2016-08-08 00:00:00',
-  value: 4,
-  type: '实际收益率'
-}, {
-  time: '2016-08-08 00:10:00',
-  value: 3,
-  type: '实际收益率'
-}, {
-  time: '2016-08-08 00:30:00',
-  value: 6,
-  type: '实际收益率'
-}, {
-  time: '2016-08-09 00:35:00',
-  value: -12,
-  type: '实际收益率'
-}, {
-  time: '2016-08-09 01:00:00',
-  value: 1,
-  type: '实际收益率'
-}, {
-  time: '2016-08-09 01:20:00',
-  value: 9,
-  type: '实际收益率'
-}, {
-  time: '2016-08-10 01:40:00',
-  value: 13,
-  type: '实际收益率'
-}, {
-  time: '2016-08-10 02:00:00',
-  value: -3,
-  type: '实际收益率'
-}, {
-  time: '2016-08-10 02:20:00',
-  value: 11,
-  type: '实际收益率'
-}];
+ const data = JSON.parse(this.data.reportInfo.taskTrend);
     chart.source(data, {
-      time: {
+      workDay: {
     type: 'timeCat',
-    tickCount: 3,
-    mask: 'hh:mm',
+    tickCount: 5,
+    // mask: 'hh:mm',
     range: [ 0, 1 ]
   },
-  value: {
+  taskNum: {
     tickCount: 3,
-    formatter: function formatter(ivalue) {
-      return ivalue + '%';
-    }
+    // formatter: function formatter(ivalue) {
+    //   return ivalue + '%';
+    // }
   }
     });
     // chart.tooltip({
@@ -298,7 +221,7 @@ Page({
     //     items[0].value = '¥ ' + items[0].value;
     //   }
     // });
-  chart.axis('time', {
+  chart.axis('workDay', {
   line: null,
   label: function label(text, index, total) {
     const textCfg = {};
@@ -325,8 +248,8 @@ chart.legend({
   offsetY: -5
 });
 chart.line()
-  .position('time*value')
-  .color('type');
+  .position('workDay*taskNum')
+  .color('name');
   
 
 chart.render();
@@ -336,62 +259,26 @@ chart.render();
   onInitChart4(F2, config) {
     //  任务类完成详细情况
     const chart = new F2.Chart(config);
-    let taskNum = this.data.taskNum;
-
-    // chart.plugins.register([ PieLabel ]);
-    const data = [
-      { name: '打扫房间', proportion: 0.4, a: '1' },
-      { name: '打扫厨房', proportion: 0.2, a: '1' },
-      { name: '带孩子', proportion: 0.18, a: '1' },
-      { name: '照顾老人', proportion: 0.15, a: '1' },
-      { name: '清洁厨房', proportion: 0.05, a: '1' },
-      { name: '其他', proportion: 0.02, a: '1' },
-    ];
-
-    chart.source(data);
-
-    chart.legend({
-      position: 'left'
-    });
-    chart.coord('polar', {
-      transposed: true,
-      innerRadius: 0.5,
+    // const data = [{"number":"20","typeName":"任务太多"},{"number":"0","typeName":"我不会"},{"number":"10","typeName":"任务不详细"}];
+    const data=JSON.parse(this.data.reportInfo.classfInish).lefts;
+    chart.source(data, {
+      sales: {
+        tickCount: 5
+      }
     });
-    chart.axis(false);
-    chart
-      .interval()
-      .position('a*proportion')
-      .color('name', [
-        '#EB6F49',
-        '#00D98B',
-        '#FDB628',
-        '#0091F1',
-        '#00E4EC',
-        '#8256E8',
-      ])
-      .adjust('stack')
-      .style({
-        lineWidth: 1,
-        stroke: '#4413A0',
-        lineJoin: 'round',
-        lineCap: 'round'
-      });
-    chart.guide()
-      .text({
-        position: ['50%', '50%'],
-        style: {
-          fill: '#7ED4F6',
-          fontSize: '12',
-          backgroundColor: '#fff',
-        },
-        content: `完成
-占比`,
-
-        limitInPlot: true,
-      });
-
+    // chart.tooltip({
+    //   showItemMarker: false,
+    //   onShow: function onShow(ev) {
+    //     const items = ev.items;
+    //     items[0].name = null;
+    //     items[0].name = items[0].title;
+    //     items[0].value = '¥ ' + items[0].value;
+    //   }
+    // });
+    chart.interval()
+      .position('taskClass*finishRate')
+      .color('l(90) 0:#FBEC9F 1:#F3D34D'); // 定义柱状图渐变色
     chart.render();
-
     // 注意:需要把chart return 出来
     return chart;
   },

+ 102 - 0
client/pages/customer/servantedit/servantedit.acss

@@ -0,0 +1,102 @@
+.servant-settings-page{
+  background-color: #F3F3F3;
+}
+.servant-setting-header{
+  height: 62rpx;
+  line-height: 62rpx;
+  background-color: #E6F7FF;
+  color: #09AFFF;
+  padding-left: 35rpx;
+  padding-right: 24rpx;
+  font-size: 22rpx;
+}
+.notice-style{
+  width: 23rpx;
+  height: 22rpx;
+  margin-right: 10rpx;
+  float: left;
+  margin-top: 21rpx;
+}
+.close-stle{
+  width: 17.87rpx;
+  height: 17.87rpx;
+  float: right;
+  margin-top: 20rpx;
+}
+.setting-list{
+  background: #FFFFFF;
+  border-radius: 18px;
+  margin: 25.99rpx 24rpx 20rpx 24rpx;
+}
+.setting-list-title{
+  color: #333333;
+  font-size: 32rpx;
+  font-weight: bold;
+  text-align: center;
+  height: 80rpx;
+  line-height: 80rpx;
+  padding-right: 24rpx; 
+}
+.setting-list-title text{
+  font-size: 26rpx;
+  float: right;
+}
+.setting-list-titlelabel{
+  width: 72prx;
+  height: 80rpx;
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #999999;
+  line-height: 80rpx;
+  display: inline-block;
+  float: left;
+  margin-left: 24rpx;
+}
+.icon-left{
+  width: 9rpx;
+  height: 16rpx;
+  margin-right: 7rpx;
+}
+.setting-list-item{
+  padding-left: 44rpx;
+  padding-top: 37rpx;
+  border-top: 1rpx solid #EEEEEE;
+  padding-bottom: 37rpx;
+}
+.item-title{
+  color: #333333;
+  font-size: 28rpx;
+  height: 28rpx;
+  line-height: 28rpx;
+  margin-bottom: 31rpx;
+  display: inline-block;
+}
+.item-body{
+  margin-bottom: 24rpx;
+  padding-left: 20rpx;
+}
+
+.item-body textarea{
+  background-color: #EEEEEE;
+  border: none;
+  height: 110rpx;
+  margin-left: 40rpx;
+  margin-right: 86rpx;
+  color: #CCCCCC;
+  font-size: 24rpx;
+  padding: 12rpx;
+  width: 80%;
+}
+.checkbox {
+  display: block;
+  margin-bottom: 20rpx;
+}
+
+button + button {
+  margin-top: 32rpx;
+}
+
+.checkbox-text {
+  font-size:34rpx;
+  line-height: 1.2;
+}

+ 42 - 0
client/pages/customer/servantedit/servantedit.axml

@@ -0,0 +1,42 @@
+<view class="servant-settings-page">
+<!--服务设置-->
+  <view class="servant-setting-header" a:if="{{tips}}">
+    <image mode="scaleToFill" src="/image/notice-blue.png" class="notice-style"/>
+    <text onTap="toservantdetail">您可以查看保姆偏好,双向沟通更清晰</text>
+    <image mode="scaleToFill" src="/image/close-blue.png" class="close-stle" onTap="closeTip"/>
+  </view>
+  <!--服务列表-->
+  <view class="setting-list">
+    <view  class="setting-list-title">
+      {{servanteditlist.subjectType}}
+    </view>
+    <view class="setting-list-item" a:for="{{servanteditlist.subjectList}}" a:for-item="subjectitem" key="{{subjectindex}}">
+      <view  a:if="{{subjectitem.isChoose}}" >
+        <text class="item-title">{{subjectitem.subject}}</text>
+          <view a:if="{{subjectitem.chooseType==1}}"> <!---单选-->
+            <checkbox-group onChange="answerselectedSingle"  data-id="{{subjectitem.subjectId}}">
+              <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">
+                <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" color="#09AFFF" />
+                <text class="checkbox-text">{{answeritem.answer}}</text>
+              </label>
+            </checkbox-group>                             
+          </view>
+          <view a:if="{{subjectitem.chooseType==2}}"><!---多选-->
+            <checkbox-group onChange="answerselected"  data-id="{{subjectitem.subjectId}}">
+              <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">
+                <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" color="#09AFFF" />
+                <text class="checkbox-text">{{answeritem.answer}}</text>
+              </label>
+            </checkbox-group>                             
+          </view>
+      </view>
+      <view class="item-body" a:if="{{subjectitem.isCustom==1}}">
+        <textarea placeholder="请输入文字" onBlur="customanswer" data-id="{{subjectitem.subjectId}}">{{subjectitem.customAnswer}}</textarea>
+      </view>
+    </view>
+  <!--提交按钮-->
+  <view  class="common-button-wrapper">
+     <button type="primary"  data-id="{{item.subtypeNo}}" class="common-button" hover-class="active-button" onTap="dailytasksdeit" >提交</button>
+  </view>
+  </view>
+</view>

+ 153 - 0
client/pages/customer/servantedit/servantedit.js

@@ -0,0 +1,153 @@
+import request from '../../../util/http'
+import apiUrl from '../../../util/apiUrl1'
+import util from '../../../util/util'
+import moment from 'moment'
+var app = getApp();
+
+Page({
+  data: {
+    tips:true,
+    servanteditlist:[],
+  },
+  onLoad(subtypeNo) {
+    this.loadpage(subtypeNo);
+  },
+  loadpage(subtypeNo){
+    let employRelationNo = app.globalData.employRelationNo;
+    let params = {employRelationNo:employRelationNo}
+    request.httpServiceGet(apiUrl.getEmployerSubjectWhenEdit, params).then(data => {
+      if (data.length > 0) {
+        //加载全部的类别
+        let subjectList={};
+        for(let i=0;i<data.length;i++){
+          if(data[i].subtypeNo==subtypeNo.subtypeNo){
+              subjectList=data[i];
+              console.log(subjectList);
+          }
+        }
+
+        this.setData({
+          servanteditlist: subjectList
+        });
+      } else {
+        this.setData({
+          servanteditlist: []
+        });
+      }
+    }).catch(e => {
+      console.log(e);
+    })
+  },
+  //提交数据
+  dailytasksdeit(){
+    let employRelationNo = app.globalData.employRelationNo;
+    let servantselectedlist=[];
+    for(let j=0;j<this.data.servanteditlist.subjectList.length;j++){
+      let answerstr='';
+        for(let t=0;t<this.data.servanteditlist.subjectList[j].answer.length;t++){
+            if(this.data.servanteditlist.subjectList[j].answer[t].isChoose){
+              answerstr += this.data.servanteditlist.subjectList[j].answer[t].answer +',';
+            }
+        }
+      //console.log(answerstr);
+      if(answerstr.length>0||this.data.servanteditlist.subjectList[j].customAnswer.length>0){
+        answerstr=answerstr.substring(0,answerstr.length - 1);
+        servantselectedlist.push({answer: [answerstr],customAnswer: this.data.servanteditlist.subjectList[j].customAnswer,subjectId: this.data.servanteditlist.subjectList[j].subjectId});
+      }
+    }
+      //console.log(servantselectedlist);
+      request.httpServicePost(apiUrl.updateEmployerLove,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002"}).then(data=>{
+        my.alert({
+          title: '提示',
+          content: '设置完成',
+          buttonText: '确定',
+          success: () => {
+            my.navigateBack();
+          }
+        } );
+      });
+  },
+  //选择问题 多选
+  answerselected(e){
+    let checkedlist=e.detail.value;
+    let servanteditlist=this.data.servanteditlist;
+    //先做清除
+    for(let j=0;j<servanteditlist.subjectList.length;j++){
+      if(servanteditlist.subjectList[j].subjectId==e.target.dataset.id){
+        for(let t=0;t<servanteditlist.subjectList[j].answer.length;t++){
+            servanteditlist.subjectList[j].answer[t].isChoose=0;
+        }
+      }
+    }
+    //添加选中
+    for(let j=0;j<servanteditlist.subjectList.length;j++){
+      if(servanteditlist.subjectList[j].subjectId==e.target.dataset.id){
+        for(let t=0;t<servanteditlist.subjectList[j].answer.length;t++){
+          for(let u=0;u<checkedlist.length;u++){
+            if(checkedlist[u]==servanteditlist.subjectList[j].answer[t].answer){
+              servanteditlist.subjectList[j].answer[t].isChoose=1;
+            }
+          }
+        }
+      }
+    }
+    this.setData({
+      servanteditlist: servanteditlist
+    })
+  },
+  //问题选择单选
+  answerselectedSingle(e){
+    let checkedlist=e.detail.value;
+    let servanteditlist=this.data.servanteditlist;
+    //先做清除
+    for(let j=0;j<servanteditlist.subjectList.length;j++){
+      if(servanteditlist.subjectList[j].subjectId==e.target.dataset.id){
+        for(let t=0;t<servanteditlist.subjectList[j].answer.length;t++){
+            servanteditlist.subjectList[j].answer[t].isChoose=0;
+        }
+      }
+    }
+    //添加选中
+    for(let j=0;j<servanteditlist.subjectList.length;j++){
+      if(servanteditlist.subjectList[j].subjectId==e.target.dataset.id){
+        for(let t=0;t<servanteditlist.subjectList[j].answer.length;t++){
+          for(let u=0;u<checkedlist.length;u++){
+            if(checkedlist[u]==servanteditlist.subjectList[j].answer[t].answer){
+              servanteditlist.subjectList[j].answer[t].isChoose=1;
+            }
+            else {
+              servanteditlist.subjectList[j].answer[t].isChoose=0;
+            }
+          }
+        }
+      }
+    }
+    this.setData({
+      servanteditlist: servanteditlist
+    })
+  },
+  //自定义问题
+  customanswer(e){
+    console.log(e.target.dataset.id);
+    let servanteditlist=this.data.servanteditlist;
+    for(let j=0;j<servanteditlist.subjectList.length;j++){
+      if(servanteditlist.subjectList[j].subjectId==e.target.dataset.id){
+          servanteditlist.subjectList[j].customAnswer = e.detail.value;
+          break;
+        }
+    }
+    this.setData({
+      servanteditlist: servanteditlist
+    })
+  },
+  closeTip(){
+    this.setData({
+      tips: false
+    })
+  },
+  toservantdetail(){
+    my.navigateTo({
+      url: '../servantdetail/servantdetail'
+    });
+  },
+});

+ 1 - 0
client/pages/customer/servantedit/servantedit.json

@@ -0,0 +1 @@
+{}

+ 2 - 23
client/pages/customer/servantlist/servantlist.axml

@@ -1,28 +1,7 @@
 <view class="common-page-padding servantlistpage">
 <!---服务列表-->
-  <view class="servantlistitem">
-     <view class="servantlistitem-left">打扫类</view>
-     <view class="servantlistitem-right">
-      <image mode="scaleToFill" src="/image/icon-right.png"/>
-     </view>
-  </view>
-  <view class="servantlistitem">
-     <view class="servantlistitem-left">做饭类</view>
-     <view class="servantlistitem-right">
-      <image mode="scaleToFill" src="/image/icon-right.png"/>
-     </view>
-  </view>
-  <view class="servantlistitem">
-     <view class="servantlistitem-left">
-      打扫类
-      <!-- <label class="noset">未设置</label> -->
-     </view>
-     <view class="servantlistitem-right">
-      <image mode="scaleToFill" src="/image/icon-right.png"/>
-     </view>
-  </view>
-  <view class="servantlistitem">
-     <view class="servantlistitem-left">做饭类</view>
+  <view class="servantlistitem" a:for="{{servantlist}}" key="{{index}}" data-id="{{item.subtypeNo}}" onTap="toEditPage">
+     <view class="servantlistitem-left">{{item.subjectType}}</view>
      <view class="servantlistitem-right">
       <image mode="scaleToFill" src="/image/icon-right.png"/>
      </view>

+ 32 - 1
client/pages/customer/servantlist/servantlist.js

@@ -1,4 +1,35 @@
+import request from '../../../util/http'
+import apiUrl from '../../../util/apiUrl1'
+import util from '../../../util/util'
+import moment from 'moment'
+var app = getApp();
 Page({
   data: {},
-  onLoad() {},
+  onLoad() {
+    this.loadpage();
+  },
+  loadpage(){
+    let params = {}
+    request.httpServiceGet(apiUrl.getEmployerSubjectWhenEdit, params).then(data => {
+      if (data.length > 0) {
+        //添加选中的状态列
+        let servantlist = data;
+        this.setData({
+          servantlist: servantlist
+        });
+      } else {
+        this.setData({
+          servantlist: []
+        });
+      }
+    }).catch(e => {
+      console.log(e);
+    })
+  },
+  toEditPage(e){
+    let subtypeNo=e.target.dataset.id;
+    my.navigateTo({
+      url: '../servantedit/servantedit?subtypeNo='+subtypeNo
+    });
+  },
 });

+ 11 - 1
client/pages/customer/taskreminder/taskreminder.acss

@@ -112,13 +112,23 @@
   float: right;
   background-color:#fff6f4;
 }
+.tasks-item-red{
+  width: 122rpx;
+  height: 102rpx;
+  float: right;
+  border-top-right-radius: 12rpx;
+  border-bottom-right-radius: 12rpx;
+  background-color:#FAFAFA;
+  color: #FF5030
+}
 .tasks-item-yes{
   width: 122rpx;
   height: 102rpx;
   float: right;
   border-top-right-radius: 12rpx;
   border-bottom-right-radius: 12rpx;
-  background-color:#f2fbff;
+  background-color:#FAFAFA;
+  color: rgb(54, 127, 236)
 }
 .tasks-list-item image{
   width: 35rpx;

+ 32 - 43
client/pages/customer/taskreminder/taskreminder.axml

@@ -36,60 +36,49 @@
         </view>
       </view>
       <!--任务列表-->
-      <view class="common-page-padding tasks-list">
-        <view class="cell-title">
-          <label>任务提醒</label>
-          <view class="tik-right">
-            <image mode="scaleToFill" src="/image/icon-edit.png"/>
-            <label>编辑每日任务</label>
+    <view class="common-page-padding tasks-list">
+      <view class="cell-title">
+        <label>任务提醒</label>
+        <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 class="tasks-list-item" a:if="{{item.state == 0}}">
+          <text> {{item.itemName}}</text>
+          <view class="tasks-item-red">
+            <text> 未完成</text>
           </view>
+          
         </view>
-        <!--有提醒任务-->
-        <view a:if="{{isreminds}}">
-          <view class="tasks-list-item">
-            <text>洗衣服</text>
-            <view class="tasks-item-yes">
-              <image mode="scaleToFill" src="/image/icon-yes.png"/>
-            </view>
-            <view class="tasks-item-no" onTap="showcancel">
-              <image mode="scaleToFill" src="/image/icon-no.png"/>
-            </view>
-          </view>
-          <view class="tasks-list-item">
-            <text>做完饭</text>
-            <view class="tasks-item-yes">
-              <image mode="scaleToFill" src="/image/icon-yes.png"/>
-            </view>
-            <view class="tasks-item-no" onTap="showcancel">
-              <image mode="scaleToFill" src="/image/icon-no.png"/>
-            </view>
-          </view>
-          <view class="tasks-list-item">
-            打扫卧室
-          </view>
-          <view class="tasks-list-item">
-            <text>打扫房间</text>
-            <label  class="nogood">任务不详细</label>
-            <view class="tasks-item-yes">
-              <image mode="scaleToFill" src="/image/icon-no.png"/>
-            </view>
+        <view class="tasks-list-item" a:if="{{item.state == 1}}">
+          <text> {{item.itemName}}</text>
+          <view class="tasks-item-yes">
+            <text> 已完成</text>
           </view>
         </view>
-        <!--没有任务-->
-        <view  a:if="{{!isreminds}}">
-          <view class="notasks">
-            <text>还没有任务</text>
+        <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="tasks-item-red">
+            <text> 未完成</text>
           </view>
         </view>
       </view>
+    </view>
+    <!--没有任务-->
+    <view a:if="{{!isreminds}}">
+      <view class="notasks">
+        <text>还没有任务</text>
+      </view>
+    </view>
       <!---没有任务花销计算不显示-->
       <view a:if="{{isreminds}}" class="tast-moneybox">
         <view class="tasks-list-money">
           <view class="tasks-list-pay">今日花销合计</view>
-          <view class="tasks-list-pay-right"><input placeholder="请输入"/><text>元</text></view>
-        </view>
-         <view class="tasks-set">
-          <button type="primary"  hover-class="active-button"  onTap="createServant">提交</button>
+          <text> {{item.itemName}}</text>
+          <text> {{item.itemName}}</text>
         </view>
       </view>
     </view>

+ 66 - 0
client/pages/customer/taskreminder/taskreminder.js

@@ -1,4 +1,7 @@
 var util = require('../../../util/util.js')
+import apiUrl1 from '../../../util/apiUrl1'
+import apiUrl from '../../../util/apiUrl'
+import request from '../../../util/http'
 var app = getApp();
 Page({
   data: {
@@ -12,6 +15,7 @@ Page({
     servantName: '',//保姆姓名
     weekday: '',//日前
     servantTypeValue: '',//保姆工种,
+    taskList: [],
   },
   onLoad() {
     //加载选中的时间
@@ -37,12 +41,20 @@ Page({
       servantTypeValue: app.globalData.relationInfo.servantType
     });
     //处理时间完成
+
+    this.selectDayTaskItem()
+    this.selectDayTaskCost()
   },
   showcancel(){
     this.setData({
       showcancelbox: true
     });
   },
+  switchEditTask(){
+    my.navigateTo({
+      url: '../editDailyTask/editDailyTask'
+    });
+  },
   hidecnacelbox(){
      this.setData({
       showcancelbox: false
@@ -97,4 +109,58 @@ Page({
   handleSelect(e) {
       console.log(e[0]);
   },
+
+// 查询保姆每日任务
+  selectDayTaskItem() {
+    let params = {
+      "employRelationNo": app.globalData.employRelationNo,
+      "date": this.data.nowselectTime
+    }
+    request.httpServiceGet(apiUrl1.selectDayTaskItemPath, params).then(data => {
+      console.log("今日任务=" + data);
+      // 未设置任务
+      if (data.length == 0) {
+        this.setData({
+          isreminds: false,
+        });
+      } else {
+        // 今天有任务
+        this.setData({
+          taskList: data,
+        });
+      }
+    }
+
+    ).catch(e => {
+      console.log(e);
+
+    })
+  },
+  //查询今天花销
+  selectDayTaskCost() {
+    let params = {
+      "employRelationNo": app.globalData.employRelationNo,
+      "date": this.data.nowselectTime
+    }
+    request.httpServiceGet(apiUrl.getEmployerCost, params).then(data => {
+      console.log("今日任务花费=" + data);
+      // 未设置任务
+      if (data.length == 0) {
+        this.setData({
+          isreminds: false,
+        });
+      } else {
+        // 今天有任务
+        this.setData({
+          taskList: data,
+        });
+      }
+    }
+
+    ).catch(e => {
+      console.log(e);
+
+    })
+  },
+
 });

+ 0 - 1
client/pages/servant/servantedit/servantedit.acss

@@ -66,7 +66,6 @@
 .item-title{
   color: #333333;
   font-size: 28rpx;
-  font-weight: bold;
   height: 28rpx;
   line-height: 28rpx;
   margin-bottom: 31rpx;

+ 0 - 1
client/pages/servant/servantsettings/servantsettings.acss

@@ -66,7 +66,6 @@
 .item-title{
   color: #333333;
   font-size: 28rpx;
-  font-weight: bold;
   height: 28rpx;
   line-height: 28rpx;
   margin-bottom: 31rpx;

+ 4 - 1
client/util/apiUrl.js

@@ -63,6 +63,8 @@ const selectMonthLyReportInfoPath = baseService + "/monthly/selectMonthLyReportI
 const employerServiceStandard = baseService + "/servicestandard/insertNewServiceStandards";
 //雇主端题目获取
 const getEmployerSubList = baseService + "/servicestandard/getSubjectWhenFirst";
+//雇主端花费
+const getEmployerCost = baseService + "/servantTask/selectDailyCost";
 
 export default{
 registerUserPath,
@@ -89,5 +91,6 @@ servantDescribleInfo,
 selectMonthlyReportPath,
 selectMonthLyReportInfoPath,
 employerServiceStandard,
-getEmployerSubList
+getEmployerSubList,
+getEmployerCost
 }