Explorar el Código

人日系统移动端审批上报权限和页面样式修改

XuZinan hace 3 años
padre
commit
553058e15d
Se han modificado 2 ficheros con 45 adiciones y 40 borrados
  1. 4 30
      pages.json
  2. 41 10
      pages/index/index.vue

+ 4 - 30
pages.json

@@ -1,45 +1,19 @@
 {
   "pages": [
     {
-      "path": "pages/index/index",
-      "style": {
-        "navigationBarTitleText": "人日系统",
-        "app-plus": {
-          "bounce": "vertical",
-          "titleNView": {
-            "buttons": [
-              {
-                "text": "审批",
-                "fontSize": "16px"
-              }
-            ]
-          }
-        }
-      }
+      "path": "pages/index/index"
     },
     {
-      "path": "pages/login/login",
-      "style": {
-        "navigationBarTitleText": "",
-        "navigationBarBackgroundColor": "#7399DB"
-      }
+      "path": "pages/login/login"
     },
     {
-      "path": "pages/index/add",
-      "style": {
-        "navigationBarTitleText": "新增工时"
-      }
+      "path": "pages/index/add"
     },
     {
-      "path": "pages/audit/index",
-      "style": {
-        "navigationBarTitleText": "人日系统-审批"
-      }
+      "path": "pages/audit/index"
     }
   ],
   "globalStyle": {
-    "navigationBarTextStyle": "black",
-    "navigationBarTitleText": "uni-app",
     "navigationBarBackgroundColor": "#F8F8F8",
     "backgroundColor": "#F8F8F8",
     "app-plus": {

+ 41 - 10
pages/index/index.vue

@@ -94,11 +94,26 @@
       :typeList="typeList"
     /> -->
     <view class="group">
-      <button @click="onHandleAudit({}, 2)" type="primary">上报本月工时</button>
       <button
+        class="approval"
+        v-if="permission['func-05-mobile-works-approval']"
+        @click="onHandleApproval()"
+      >
+        审批工时
+      </button>
+      <button
+        v-if="permission['func-05-mobile-works-commit']"
+        @click="onHandleAudit({}, 2)"
+        type="primary"
+        class="commit"
+      >
+        上报本月工时
+      </button>
+      <button
+        v-if="permission['func-05-mobile-works-commit']"
         v-show="collapseList.length > 0"
         @click="onHandleAudit({}, 1)"
-        class="button"
+        class="commit"
       >
         上报今日工时
       </button>
@@ -145,13 +160,9 @@ export default {
       auditType: 0,
       day: moment().format("YYYY-MM-DD"),
       monthDate: moment(),
+      permission: {},
     };
   },
-  onNavigationBarButtonTap(e) {
-    uni.navigateTo({
-      url: "../audit/index",
-    });
-  },
   onLoad() {
     this.init();
   },
@@ -181,13 +192,14 @@ export default {
       this.queryWorkHours();
     },
     change(e) {
-      console.log(e);
       this.day = e.fulldate;
       this.currentList = e.extraInfo.list || [];
     },
     monthSwitch(e) {
       this.monthDate = moment(`${e.year}-${e.month}-01`, "YYYY-MM-DD");
-      this.day = `${e.year}-${e.month < 10 ? "0" + e.month : e.month}-${moment(this.day).format("DD")}`;
+      this.day = `${e.year}-${e.month < 10 ? "0" + e.month : e.month}-${moment(
+        this.day
+      ).format("DD")}`;
       this.currentList = [];
       this.queryWorkHours();
       // this.day = e.fulldate;
@@ -207,6 +219,11 @@ export default {
       this.auditType = type;
       this.$refs.auditDialog.open();
     },
+    onHandleApproval() {
+      uni.navigateTo({
+        url: "../audit/index",
+      });
+    },
     async dialogInputConfirm(workload) {
       let item = this.currentItem;
       if (isNaN(workload)) {
@@ -338,6 +355,14 @@ export default {
         }
       });
       this.info.selected = selected;
+      let permission = {};
+      user.Permissions?.forEach((item) => {
+        permission = {
+          ...permission,
+          ...item.Menus,
+        };
+      });
+      this.permission = permission;
     },
     toAdd() {
       uni.navigateTo({
@@ -400,10 +425,16 @@ export default {
   width: 100%;
   display: flex;
   position: fixed;
+  flex-wrap: wrap;
   justify-content: flex-start;
   bottom: 0;
   left: 0;
-  button {
+  .approval {
+    width: 100%;
+    border-radius: 0;
+    margin: inherit;
+  }
+  .commit {
     width: 50%;
     border-radius: 0;
     margin: inherit;