|
@@ -25,8 +25,8 @@ Page({
|
|
ruleVal: "规则分类",
|
|
ruleVal: "规则分类",
|
|
|
|
|
|
page: 1,
|
|
page: 1,
|
|
- popupCx: '',
|
|
|
|
- rule_item_id:'',//细则ID
|
|
|
|
|
|
+ popupCx: '',
|
|
|
|
+ rule_item_id: '',//细则ID
|
|
},
|
|
},
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
that = this;
|
|
that = this;
|
|
@@ -35,27 +35,27 @@ Page({
|
|
var arr = typeArr.concat(app.globalData.types);
|
|
var arr = typeArr.concat(app.globalData.types);
|
|
arr = app.globalData.arrRemoveObj(arr, arr[1]);
|
|
arr = app.globalData.arrRemoveObj(arr, arr[1]);
|
|
dd.setNavigationBar({ title: "积分事件" });
|
|
dd.setNavigationBar({ title: "积分事件" });
|
|
- if (e.month||e.employee_ids) {
|
|
|
|
|
|
+ if (e.month || e.employee_ids) {
|
|
var typesIndex = "0";
|
|
var typesIndex = "0";
|
|
if (e.type) {
|
|
if (e.type) {
|
|
- if(arr){
|
|
|
|
- arr.map((item, index) => {
|
|
|
|
- if (item.code == e.type) {
|
|
|
|
- typesIndex = index
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if (arr) {
|
|
|
|
+ arr.map((item, index) => {
|
|
|
|
+ if (item.code == e.type) {
|
|
|
|
+ typesIndex = index
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
- date: e.month? e.month:app.globalData.month,
|
|
|
|
|
|
+ date: e.month ? e.month : app.globalData.month,
|
|
typesIndex: typesIndex,
|
|
typesIndex: typesIndex,
|
|
- employee_ids:e.employee_ids ? e.employee_ids:[userData.id],
|
|
|
|
- staffVal:e.userName ? e.userName:userData.name,
|
|
|
|
|
|
+ employee_ids: e.employee_ids ? e.employee_ids : [userData.id],
|
|
|
|
+ staffVal: e.userName ? e.userName : userData.name,
|
|
selectDateVal: e.month == app.globalData.month ? '本月' : '月',
|
|
selectDateVal: e.month == app.globalData.month ? '本月' : '月',
|
|
defaultDate: { type: '1', date: e.month },
|
|
defaultDate: { type: '1', date: e.month },
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- if(e.rule_item_id){//周报进来
|
|
|
|
|
|
+ if (e.rule_item_id) {//周报进来
|
|
this.setData({
|
|
this.setData({
|
|
rule_item_id: e.rule_item_id,
|
|
rule_item_id: e.rule_item_id,
|
|
})
|
|
})
|
|
@@ -88,16 +88,35 @@ Page({
|
|
url: '../../noJurisdiction/noJurisdiction'
|
|
url: '../../noJurisdiction/noJurisdiction'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- },function(){})
|
|
|
|
|
|
+ }, function () { })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onReset() {
|
|
|
|
+ this.setData({
|
|
|
|
+ page: 1,
|
|
|
|
+ isVal: false,
|
|
|
|
+ keyword: ''
|
|
|
|
+ })
|
|
|
|
+ this.getData();
|
|
|
|
+ },
|
|
|
|
+ bindKeyInput(e) {
|
|
|
|
+ this.setData({
|
|
|
|
+ page: 1,
|
|
|
|
+ isVal: e.detail.value ? true : false,
|
|
|
|
+ keyword: e.detail.value ? e.detail.value : '',
|
|
|
|
+ })
|
|
|
|
+ this.getData();
|
|
|
|
+ },
|
|
getData(is) {
|
|
getData(is) {
|
|
var data = {
|
|
var data = {
|
|
page: that.data.page,
|
|
page: that.data.page,
|
|
page_size: 20,
|
|
page_size: 20,
|
|
rule_id: that.data.rule_id,
|
|
rule_id: that.data.rule_id,
|
|
pt_id: that.data.types.length > 0 ? that.data.types[that.data.typesIndex].id : '2',
|
|
pt_id: that.data.types.length > 0 ? that.data.types[that.data.typesIndex].id : '2',
|
|
- employee_ids: that.data.employee_ids
|
|
|
|
|
|
+ employee_ids: that.data.employee_ids,
|
|
|
|
+ keyword:that.data.keyword,
|
|
|
|
+ dc_status: JSON.stringify([1]),
|
|
|
|
+ order_key:'update_time'
|
|
}
|
|
}
|
|
if (that.data.date_type == 2) {
|
|
if (that.data.date_type == 2) {
|
|
data.start_day = that.data.dateObj[0];
|
|
data.start_day = that.data.dateObj[0];
|
|
@@ -105,8 +124,8 @@ Page({
|
|
} else {
|
|
} else {
|
|
data.month = that.data.dateObj || that.data.date;
|
|
data.month = that.data.dateObj || that.data.date;
|
|
}
|
|
}
|
|
- if(that.data.rule_item_id){//周报进来的细则ID
|
|
|
|
- data.item_id=that.data.rule_item_id
|
|
|
|
|
|
+ if (that.data.rule_item_id) {//周报进来的细则ID
|
|
|
|
+ data.item_id = that.data.rule_item_id
|
|
}
|
|
}
|
|
app.$get('api/integral/statistics/integral', data).then((res) => {
|
|
app.$get('api/integral/statistics/integral', data).then((res) => {
|
|
var data = res.data.data.list;
|
|
var data = res.data.data.list;
|
|
@@ -176,7 +195,7 @@ Page({
|
|
date_type: data.type == 1 ? 3 : data.type,
|
|
date_type: data.type == 1 ? 3 : data.type,
|
|
page: 1,
|
|
page: 1,
|
|
selectDateVal: data.type == 1 ? (data.date == that.data.date ? '本月' : '月') : '日',
|
|
selectDateVal: data.type == 1 ? (data.date == that.data.date ? '本月' : '月') : '日',
|
|
- rule_item_id:''
|
|
|
|
|
|
+ rule_item_id: ''
|
|
})
|
|
})
|
|
this.getData();
|
|
this.getData();
|
|
},
|
|
},
|
|
@@ -187,7 +206,7 @@ Page({
|
|
showStaff: false,
|
|
showStaff: false,
|
|
showRuleTwo: false,
|
|
showRuleTwo: false,
|
|
popupCx: '',
|
|
popupCx: '',
|
|
- rule_item_id:''
|
|
|
|
|
|
+ rule_item_id: ''
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//选择积分分类
|
|
//选择积分分类
|
|
@@ -195,14 +214,14 @@ Page({
|
|
this.setData({
|
|
this.setData({
|
|
typesIndex: e.detail.value,
|
|
typesIndex: e.detail.value,
|
|
page: 1,
|
|
page: 1,
|
|
- rule_item_id:''
|
|
|
|
|
|
+ rule_item_id: ''
|
|
});
|
|
});
|
|
this.getData();
|
|
this.getData();
|
|
},
|
|
},
|
|
//选择员工
|
|
//选择员工
|
|
onConfirmStaff(data) {
|
|
onConfirmStaff(data) {
|
|
if (!data) {
|
|
if (!data) {
|
|
- this.setData({ staffVal: '员工', employee_ids: '', page: 1,rule_item_id:'' })
|
|
|
|
|
|
+ this.setData({ staffVal: '员工', employee_ids: '', page: 1, rule_item_id: '' })
|
|
this.getData();
|
|
this.getData();
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -215,12 +234,12 @@ Page({
|
|
arr.push(item.id);
|
|
arr.push(item.id);
|
|
})
|
|
})
|
|
var employee_ids = arr.join(',');
|
|
var employee_ids = arr.join(',');
|
|
- this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids: employee_ids, page: 1,rule_item_id:'' })
|
|
|
|
|
|
+ this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids: employee_ids, page: 1, rule_item_id: '' })
|
|
} else {
|
|
} else {
|
|
- this.setData({ staffVal: data[0].name, employee_ids: [data[0].id], page: 1,rule_item_id:'' })
|
|
|
|
|
|
+ this.setData({ staffVal: data[0].name, employee_ids: [data[0].id], page: 1, rule_item_id: '' })
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- this.setData({ staffVal: '员工', employee_ids: [], page: 1,rule_item_id:'' })
|
|
|
|
|
|
+ this.setData({ staffVal: '员工', employee_ids: [], page: 1, rule_item_id: '' })
|
|
}
|
|
}
|
|
this.getData();
|
|
this.getData();
|
|
},
|
|
},
|
|
@@ -230,7 +249,7 @@ Page({
|
|
rule_id: e.id ? e.id : '',
|
|
rule_id: e.id ? e.id : '',
|
|
page: 1,
|
|
page: 1,
|
|
ruleVal: e.name,
|
|
ruleVal: e.name,
|
|
- rule_item_id:''
|
|
|
|
|
|
+ rule_item_id: ''
|
|
})
|
|
})
|
|
this.getData();
|
|
this.getData();
|
|
},
|
|
},
|