shish 2 лет назад
Родитель
Сommit
ae2f9d359c
1 измененных файлов с 27 добавлено и 19 удалено
  1. 27 19
      hdApp/src/admin/staff/detail.vue

+ 27 - 19
hdApp/src/admin/staff/detail.vue

@@ -14,13 +14,23 @@
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">管理员权限</div>
+            <div class="tui-title">改库存改价</div>
             <view><switch style="transform:scale(0.7,0.7)" :checked="form.super == 0 ? false : true" @change="superChangeFn" /></view>
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">动态通知</div>
-            <div> <switch style="transform:scale(0.7,0.7)" :checked="form.remind == 0 ? false : true" @change="remindChangeFn" /> </div>
+            <div class="tui-title">查看财务</div>
+            <view><switch style="transform:scale(0.7,0.7)" :checked="form.finance == 0 ? false : true" @change="financeChangeFn" /></view>
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">分店切换</div>
+            <view><switch style="transform:scale(0.7,0.7)" :checked="form.switchShop == 0 ? false : true" @change="switchShopChangeFn" /></view>
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">新订单通知</div>
+            <view><switch style="transform:scale(0.7,0.7)" :checked="form.remind == 0 ? false : true" @change="remindChangeFn" /></view>
           </tui-list-cell>
 
           <tui-list-cell class="line-cell remark-wrap" :hover="false">
@@ -44,12 +54,7 @@
 import TuiListCell from "@/components/plugin/list-cell";
 import AppAvatarModule from "@/components/module/app-avatar";
 const form = require("@/utils/formValidation.js");
-// api
-import {
-  getRoleList,
-  getStaffDet as getDet,
-  updateStaff as update
-} from "@/api/staff";
+import { getRoleList, getStaffDet as getDet, updateStaff as update } from "@/api/staff";
 import { getDet as getMemberDet } from "@/api/member";
 import { prepareBind } from "@/api/shop-admin";
 export default {
@@ -61,12 +66,15 @@ export default {
   data() {
     return {
       form: {
+        name: "",
         roleId: "",
         remind: 1,
         password: "",
         status: 1,
         remark: "",
-        super:0
+        super:0,
+        finance:0,
+        switchShop:0
       },
       roleList: [],
       roleSelData: {},
@@ -84,6 +92,15 @@ export default {
     superChangeFn(e){
       this.form.super = e.detail.value ? 1 : 0;
     },
+    switchShopChangeFn(e){
+      this.form.switchShop = e.detail.value ? 1 : 0;
+    },
+    financeChangeFn(e){
+      this.form.finance = e.detail.value ? 1 : 0;
+    },
+    remindChangeFn(e) {
+      this.form.remind = e.detail.value ? 1 : 0;
+    },
     init() {
       let data = uni.getStorageSync("addStaffData");
       if (data) {
@@ -98,16 +115,13 @@ export default {
         this.memberData = memberData;
         this.form.userId = memberData.id;
       }
-
       if (data) return false;
-
       this._getRoleList().then(res => {
         if (this.option.id) {
           this._getDet();
         }
       });
     },
-    // api
     async _getRoleList() {
       await getRoleList().then(res => {
         if (this.$util.isEmpty(res.data)) return false;
@@ -168,15 +182,10 @@ export default {
         this.form.id = this.option.id;
       }
       hostFn(this.form).then(res => {
-        console.log('23rh23r23')
-        console.log(res)
-        console.log(this.option.id)
         if(typeof(this.option.id) == 'undefined'){
           this.showMiniCodeArea = true;
           this.miniCodeSrc = res.data.miniCode;
           this.showStaffArea = false;
-          console.log(this.miniCodeSrc)
-          console.log('--oo0oooo---')
         }else{
           let promptText = this.option.id ? "修改成功!" : "添加成功!";
           this.$msg(promptText);
@@ -184,7 +193,6 @@ export default {
             this.$util.pageTo(1);
           }, 1000);
         }
-        
       });
     },
     complete(){