|
@@ -113,57 +113,101 @@ Page({
|
|
|
}
|
|
|
]
|
|
|
*/
|
|
|
- allList:[]
|
|
|
+ allList: []
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
console.log(options);
|
|
|
},
|
|
|
- onShow(){
|
|
|
+ onShow() {
|
|
|
this.initDailyTaskList();
|
|
|
},
|
|
|
- initDailyTaskList(){
|
|
|
- let params={
|
|
|
+ initDailyTaskList() {
|
|
|
+ let params = {
|
|
|
}
|
|
|
- request.httpServiceGet(apiUrl.getDailyTaskList,params).then(data=>{
|
|
|
- console.log(data);
|
|
|
- if(data.length>0){
|
|
|
- this.setData({
|
|
|
- allList:data
|
|
|
- });
|
|
|
- }else{
|
|
|
- this.setData({
|
|
|
- allList:[]
|
|
|
- });
|
|
|
- // my.alert({
|
|
|
- // content:JSON.stringify(data.dataList)
|
|
|
- // });
|
|
|
- }
|
|
|
+ request.httpServiceGet(apiUrl.getDailyTaskList, params).then(data => {
|
|
|
+ console.log(data);
|
|
|
+ if (data.length > 0) {
|
|
|
+ this.setData({
|
|
|
+ allList: data
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ allList: []
|
|
|
+ });
|
|
|
+ // my.alert({
|
|
|
+ // content:JSON.stringify(data.dataList)
|
|
|
+ // });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ }).catch(e => {
|
|
|
+ console.log(e);
|
|
|
|
|
|
- }).catch(e=>{
|
|
|
- console.log(e);
|
|
|
-
|
|
|
- })
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
- toggleWashinGandnursing(e){
|
|
|
-
|
|
|
- let id=e.target.dataset.id;
|
|
|
- if(this.data.washingandnursinglist.indexOf(id)==-1){
|
|
|
- let newArr=this.data.washingandnursinglist;
|
|
|
- newArr.push(id);
|
|
|
- this.setData({
|
|
|
- washingandnursinglist:newArr
|
|
|
- })
|
|
|
- }else{
|
|
|
- let newArr=this.data.washingandnursinglist;
|
|
|
- newArr.splice(newArr.indexOf(id),1);
|
|
|
- this.setData({
|
|
|
- washingandnursinglist:newArr
|
|
|
- })
|
|
|
- }
|
|
|
+ toggleWashinGandnursing(e) {
|
|
|
+
|
|
|
+ // let id = e.target.dataset.id;
|
|
|
+ let currentIndex= e.target.dataset.index;
|
|
|
+ console.log('index=' + currentIndex);
|
|
|
+ // console.log(id.currentIndex);
|
|
|
+ // let id=e.target.dataset.id;
|
|
|
+ // let isNew=this.data.allList[currentIndex].every(item=>{return id!=item.id});
|
|
|
+ // if(isNew){
|
|
|
+ // let newArr=this.data.allList[currentIndex];
|
|
|
+ // let obj={
|
|
|
+ // index:id,
|
|
|
+ // }
|
|
|
+ // newArr.push(obj);
|
|
|
+ // let newArrClass=this.data.allList[currentIndex];
|
|
|
+ // newArrClass.push(id);
|
|
|
+ // this.setData({
|
|
|
+ // workSelectedList:newArr,
|
|
|
+ // workSelectedClassList:newArrClass
|
|
|
+ // })
|
|
|
+ // }else{
|
|
|
+ // let spliceIndex='';
|
|
|
+ // this.data.workSelectedList.forEach((item,index)=> {
|
|
|
+ // if(item.index==id){
|
|
|
+ // console.log(item,index);
|
|
|
+ // spliceIndex=index;
|
|
|
+ // return;
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // let newArr=this.data.workSelectedList;
|
|
|
+ // let newArrClass=this.data.workSelectedClassList;
|
|
|
+ // newArr.splice(spliceIndex,1);
|
|
|
+ // newArrClass.splice(newArrClass.indexOf(id),1);
|
|
|
+ // this.setData({
|
|
|
+ // workSelectedList:newArr,
|
|
|
+ // workSelectedClassList:newArrClass
|
|
|
+ // })
|
|
|
+ // }
|
|
|
},
|
|
|
- dailytasksdeit(){
|
|
|
-
|
|
|
+ dailytasksdeit() {
|
|
|
+ /**
|
|
|
+ * {
|
|
|
+ "employRelationNo": "string",
|
|
|
+ "taskItems": [
|
|
|
+ {
|
|
|
+ "categoryId": 0,
|
|
|
+ "itemIds": [
|
|
|
+ "string"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ */
|
|
|
+ let params = {
|
|
|
+ }
|
|
|
+ request.httpServicePost(apiUrl.completeEditDailyTask, params).then(data => {
|
|
|
+ console.log(data);
|
|
|
+
|
|
|
+ }).catch(e => {
|
|
|
+ console.log(e);
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
});
|