|
@@ -19,13 +19,23 @@ Page({
|
|
|
this.getBmData();
|
|
|
this.getUserData(0);
|
|
|
},
|
|
|
- tbDd(){
|
|
|
- var http1= app.$post("api/ding/employee_sync",{});
|
|
|
- var http2= app.$post("api/ding/department_sync",{});
|
|
|
- Promise.all([http1,http2]).then((item)=>{
|
|
|
- app.globalData.showToast(item[1].data.msg);
|
|
|
- console.log(item);
|
|
|
- })
|
|
|
+ tbDd() {
|
|
|
+ dd.confirm({
|
|
|
+ title: '温馨提示',
|
|
|
+ content: '下次同步时间需在两小时之后,是否同步',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ success: (result) => {
|
|
|
+ if (result.confirm) {
|
|
|
+ var http1 = app.$post("api/ding/employee_sync", {});
|
|
|
+ var http2 = app.$post("api/ding/department_sync", {});
|
|
|
+ Promise.all([http1, http2]).then((item) => {
|
|
|
+ app.globalData.showToast("已同步");
|
|
|
+ console.log(item);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
bindKeyInput(e) {
|
|
|
app.$get("api/employee/list", { dept_id: 0 }).then((res) => {
|
|
@@ -73,15 +83,15 @@ Page({
|
|
|
});
|
|
|
this.getUserData(item.id);
|
|
|
},
|
|
|
- //获取部门列表
|
|
|
+ //获取部门列表
|
|
|
getBmData() {
|
|
|
- app.$get("api/department/tree", {}).then((res) => {
|
|
|
- var list = res.data.data.list;
|
|
|
- this.setData({
|
|
|
- rule_tree: list,
|
|
|
- all_rule_list: list
|
|
|
- })
|
|
|
+ app.$get("api/department/tree", {}).then((res) => {
|
|
|
+ var list = res.data.data.list;
|
|
|
+ this.setData({
|
|
|
+ rule_tree: list,
|
|
|
+ all_rule_list: list
|
|
|
})
|
|
|
+ })
|
|
|
},
|
|
|
//获取员工信息
|
|
|
getUserData(dept_id) {
|
|
@@ -92,7 +102,7 @@ Page({
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- getMessage(){
|
|
|
+ getMessage() {
|
|
|
app.$get("api/site/info").then((res) => {
|
|
|
this.setData({
|
|
|
gsData: res.data.data
|