347617796@qq.com 3 vuotta sitten
vanhempi
commit
1ffcc4a7af

+ 2 - 2
app.js

@@ -1,8 +1,8 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 
-const baseUrl = "https://test-ding.g107.com/";//测试
-// const baseUrl = "https://ding.insys.g107.com/";//正式
+// const baseUrl = "https://test-ding.g107.com/";//测试
+const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;

+ 4 - 3
pages/statistics/assaign/assaign.js

@@ -423,12 +423,13 @@ Page({
     app.$post(url, items).then((res) => {
       this.showToast(res.data.msg);
       setTimeout(() => {
-        this.setData({ disabled: false });
         dd.navigateBack({ delta: 1 })
       }, 1000);
-    }).finally(err => {
+    }).catch(err => {
       this.setData({ disabled: false });
-    })
+    }).finally(err => {
+	  this.setData({ disabled: false });
+	})
   },
   //选择时间
   openDate(e) {

+ 2 - 3
pages/statistics/assaign_set/assaign_set.js

@@ -71,8 +71,6 @@ Page({
           })
         }
       }
-
-
       this.setData({
         selectRule:item.item_id? item.point_config.item_info:'',
         reviewerObj: [{ name: item.reviewer_name, id: item.reviewer_id }],
@@ -414,11 +412,12 @@ Page({
     app.$post('api/integral/work/update', items).then((res) => {
       page1.getDetail(items.id, function () {
         app.globalData.showToast(res.data.msg);
-        this.setData({ disabled: false });
         setTimeout(() => {
           dd.navigateBack({ delta: 1 })
         }, 1000);
       })
+    }).catch(err => {
+      this.setData({ disabled: false });
     }).finally(err => {
       this.setData({ disabled: false });
     })

+ 2 - 0
pages/statistics/grant/grant.js

@@ -47,6 +47,8 @@ Page({
       setTimeout(() => {
         dd.navigateBack({ delta: 1 })
       }, 1000);
+    }).catch(err => {
+      this.setData({ disabled: false });
     }).finally(err => {
       this.setData({ disabled: false });
     })

+ 2 - 1
pages/statistics/offerAreward/offerAreward.js

@@ -425,9 +425,10 @@ Page({
     app.$post(url, items).then((res) => {
       this.showToast(res.data.msg);
       setTimeout(() => {
-        this.setData({ disabled: false });
         dd.navigateBack({ delta: 1 })
       }, 1000);
+    }).catch(err => {
+      this.setData({ disabled: false });
     }).finally(err => {
       this.setData({ disabled: false });
     })

+ 2 - 0
pages/statistics/offerAreward_set/offerAreward_set.js

@@ -440,6 +440,8 @@ Page({
               dd.navigateBack({ delta: 1 })
             }, 1000);
         })
+    }).catch(err => {
+      this.setData({ disabled: false });
     }).finally(err => {
       this.setData({ disabled: false });
     })

+ 2 - 0
pages/statistics/openPerform/openPerform.js

@@ -53,6 +53,8 @@ Page({
           }, 1000);
         })
       }
+    }).catch(e => {
+      this.setData({ disabled: false })
     }).finally(e => {
       this.setData({ disabled: false })
     })

+ 2 - 0
pages/statistics/workpoints/workpoints.js

@@ -77,6 +77,8 @@ Page({
           dd.navigateBack({ delta: 1 })
         }, 1000);
       })
+    }).catch(e => {
+      this.setData({ disabled: false })
     }).finally(e => {
       this.setData({ disabled: false })
     })

+ 17 - 10
pages/workbench/index/index.js

@@ -35,8 +35,8 @@ Page({
     title: '',//系统消息标题
     textId: '',//系统消息ID
 
-    isSubject:false,//判断是否是个人版进入
-    mainCorpId:'',//如果是个人版,这个企业ID是登录者所在的企业ID,不是钉钉那边提供的隐藏企业ID
+    isSubject: false,//判断是否是个人版进入
+    mainCorpId: '',//如果是个人版,这个企业ID是登录者所在的企业ID,不是钉钉那边提供的隐藏企业ID
   },
   onLoad() {
     that = this;
@@ -49,9 +49,16 @@ Page({
       that.setData({
         isAdministrator: app.globalData.isAdministrator,
         getRole_four: app.globalData.isCreator,
-        isSubject:app.globalData.userData.is_personal==1? true:false,
-        mainCorpId:app.globalData.userData.main_corp_id
+        isSubject: app.globalData.userData.is_personal == 1 ? true : false,
+        mainCorpId: app.globalData.userData.main_corp_id
       })
+      if (app.globalData.isCreator) {
+        that.setMenuList("creator");
+      } else if (app.globalData.isAdministrator) {
+        that.setMenuList("admin");
+      } else if (!app.globalData.isCreator && !app.globalData.isAdministrator) {
+        that.setMenuList("employee");
+      }
     } else {
       app.login(app.globalData.corpId, function (is) {
         if (is) {
@@ -64,11 +71,11 @@ Page({
           }
           that.getGg();
           that.getUserData();
-          that.setData({ 
+          that.setData({
             isAdministrator: app.globalData.isAdministrator,
             getRole_four: app.globalData.isCreator,
-            isSubject:app.globalData.userData.is_personal==1? true:false,
-            mainCorpId:app.globalData.userData.main_corp_id
+            isSubject: app.globalData.userData.is_personal == 1 ? true : false,
+            mainCorpId: app.globalData.userData.main_corp_id
           })
         } else {
           dd.reLaunch({
@@ -79,11 +86,11 @@ Page({
     }
   },
   openGly() {
-    contactAdminToUseApp({ id: '55493', corpId: that.data.mainCorpId})
-    .catch((err) => {
+    contactAdminToUseApp({ id: '55493', corpId: that.data.mainCorpId })
+      .catch((err) => {
         // 入参不正确,或者遇到技术异常时才会进入这个链路
         console.error(err);
-    })
+      })
   },
   openUrl(e) {
     var url = e.target.dataset.url;