shish před 1 rokem
rodič
revize
39cf83869e

+ 3 - 37
hdApp/src/admin/home/workbench.vue

@@ -293,7 +293,7 @@ import autoUpdateMixins from "@/mixins/autoUpdate";
 import { ghsList } from "@/api/purchase";
 import { changeDelStatus } from "@/api/ghs";
 import {currentShop} from "@/api/shop";
-import { clearLogin,hasNotice,delStaff } from "@/api/admin";
+import { clearLogin,hasNotice } from "@/api/admin";
 export default {
   name: "workbench",
   components: { NotLogin },
@@ -454,10 +454,8 @@ export default {
               // 店主显示改进建议
               that.suggest()
             }else{
-              // 员工显示离职确认
-              that.$util.confirmModal({content:'确认离职?'}, () => {
-                that.handleStaffResignation()
-              })
+              // 员工显示离职
+              that.$util.pageTo({url: '/admin/staff/dimission'})
             }
           }
           if(res.tapIndex == 2){
@@ -695,38 +693,6 @@ export default {
           success (res) {
           }
         })
-    },
-    handleStaffResignation() {
-      let that = this
-      // 显示加载提示
-      uni.showLoading({ title: '处理中...' })
-      
-      delStaff({adminId: that.loginInfo.admin.id, staffId: that.loginInfo.shopAdminId }).then(res => {
-        uni.hideLoading()
-        if(res.code == 1){
-          that.$msg('离职成功')
-          // 清理本地数据
-          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
-        } else {
-          that.$msg(res.msg || '离职失败,请重试')
-        }
-      }).catch(err => {
-        uni.hideLoading()
-        console.error('离职API调用失败:', err)
-        that.$msg('网络错误,请重试')
-      })
     }
   }
 };

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

@@ -0,0 +1,103 @@
+<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('离职成功')
+          // 清理本地数据
+          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
+        } else {
+          that.$msg(res.msg || '离职失败,请重试')
+        }
+      }).catch(err => {
+        uni.hideLoading()
+        console.error('离职API调用失败:', err)
+        that.$msg('网络错误,请重试')
+      })
+    }
+  }
+};
+</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>

+ 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": "申请离职" } }
 			]
 		},
 		{