Преглед изворни кода

Merge branch 'shizhongqi-createShop'

shish пре 1 година
родитељ
комит
ddd9222642

+ 16 - 5
hdApp/src/admin/home/workbench.vue

@@ -35,7 +35,7 @@
             {{ $util.numberFormat(data.todayData.order) || 0 }}
           </div>
         </navigator>
-        <div class="info-list" @click="">
+        <div class="info-list">
           <div class="info-list-name">昨天</div>
           <div class="info-list-value">
             {{ $util.numberFormat(0) || 0 }}
@@ -438,14 +438,25 @@ export default {
 		},
     goMore(){
       let that = this
+      let shopkeeper = this.loginInfo.staff && this.loginInfo.staff.founder == 2 //判断店主(老板)
+      let items = ['已屏蔽商家', '我已离职', '开关商城', '也要一个此商城', '修改密码', '退出登录'];
+      if(shopkeeper) {
+        items = ['已屏蔽商家', '改进建议', '开关商城', '也要一个此商城', '修改密码', '退出登录'];
+      }
       uni.showActionSheet({
-        itemList: ['已屏蔽商家', '改进建议','开关商城','也要一个此商城','修改密码','退出登录'],
+        itemList: items,
         success: function (res) {
           if(res.tapIndex == 0){
             that.$util.pageTo({url: '/pagesPurchase/pb'})
           }
           if(res.tapIndex == 1){
-            that.suggest()
+            if(shopkeeper){
+              // 店主显示改进建议
+              that.suggest()
+            }else{
+              // 员工显示离职
+              that.$util.pageTo({url: '/admin/staff/dimission'})
+            }
           }
           if(res.tapIndex == 2){
             that.$util.pageTo({url:'/pagesPurchase/open'})
@@ -460,7 +471,7 @@ export default {
             that.$util.confirmModal({content:'确认退出?'},() => {
               // #ifdef APP-PLUS
               uni.clearStorage()
-              that.$store.commit("setLoginInfo", {})
+              that.$store.commit("setLoginInfo", {})
               plus.runtime.restart()
               // #endif
               // #ifdef MP-WEIXIN
@@ -682,7 +693,7 @@ export default {
           success (res) {
           }
         })
-    },
+    }
   }
 };
 </script>

+ 100 - 0
hdApp/src/admin/staff/dimission.vue

@@ -0,0 +1,100 @@
+<template>
+  <div class="app-content">
+    <div>
+      <form>
+        <div class="module-com input-line-wrap" style="padding:20upx 26upx 0upx 26upx;font-size:32upx;">
+          您正在申请离职,如你之前有注册过门店,离职后将会回到你自己的门店。如没有注册过,离职后将退出登录。
+        </div>
+        <div class="confirm-btn">
+          <button class="admin-button-com big blue" @click="confirmDim()">确认离职</button>
+          <button class="admin-button-com big default" style="margin-top:30upx;" @click="changeCg(1)">返回</button>
+        </div>
+      </form>
+    </div>
+  </div>
+</template>
+<script>
+import { mapGetters } from "vuex";
+import { delStaff } from "@/api/admin";
+export default {
+  name: "dimission",
+  data() {
+    return {
+    };
+  },
+  computed: {
+    ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo",myShopInfo:"getMyShopInfo" })
+  },
+  methods: {
+    init(){
+    },
+    confirmDim(){
+        this.$util.confirmModal({content:'确认离职?'},() => {
+            this.handleStaffResignation()
+        })
+    },
+    handleStaffResignation() {
+      let that = this
+      // 显示加载提示
+      uni.showLoading({ title: '处理中...' })
+      delStaff().then(res => {
+        uni.hideLoading()
+        if(res.code == 1){
+
+          that.$msg('操作成功')
+
+          if(res.data.hasShop == 0){
+            // 没有门店,清理本地数据
+            uni.clearStorage()
+            that.$store.commit("setLoginInfo", {})
+          }
+          
+          // 根据不同平台处理重启
+          // #ifdef APP-PLUS
+          plus.runtime.restart()
+          // #endif
+          // #ifdef MP-WEIXIN
+          uni.reLaunch({url:'/admin/home/workbench'})
+          // #endif
+          // #ifdef H5
+          window.location.reload()
+          // #endif
+        }
+      })
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20upx);
+  padding-top: 20upx;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30upx;
+  margin-bottom: 30upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  .member-wrap {
+    .member-det {
+      font-size: 24upx;
+      margin-left: 20upx;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240upx;
+    }
+  }
+}
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 60upx 30upx 20upx;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 5 - 1
hdApp/src/api/admin/index.js

@@ -31,4 +31,8 @@ export const modifyPassword = data => {
 
 export const hasNotice = data => {
 	return https.get("/admin/has-notice", data);
-};
+};
+
+export const delStaff = data => {
+	return https.post('/admin/del-staff', data)
+}

+ 2 - 1
hdApp/src/pages.json

@@ -228,7 +228,8 @@
 				{ "path": "admin","style": {"navigationBarTitleText": "个人资料"}},
 				{ "path": "sel-member", "style": { "navigationBarTitleText": "客户列表" } },
 				{ "path": "achieve", "style": { "navigationBarTitleText": "员工业绩" } },
-				{ "path": "miniAutoLogin", "style": { "navigationBarTitleText": "绑定账号" } }
+				{ "path": "miniAutoLogin", "style": { "navigationBarTitleText": "绑定账号" } },
+				{ "path": "dimission", "style": { "navigationBarTitleText": "申请离职" } }
 			]
 		},
 		{