This commit is contained in:
shijing 2026-05-22 15:39:05 +08:00
commit 0db43cc4c5
2 changed files with 45 additions and 2 deletions

View File

@ -56,6 +56,7 @@
</template> </template>
<script setup> <script setup>
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import { ElMessage } from 'element-plus'
import API from '@/api' import API from '@/api'
import TOOL from "@/utils/tool.js" import TOOL from "@/utils/tool.js"
import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js"; import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js";
@ -75,6 +76,11 @@ const drawerTitle = ref('资产入库');
const mode = ref('add'); const mode = ref('add');
const t_id = ref(null); const t_id = ref(null);
const handleAdd = () => { const handleAdd = () => {
const deptName = userInfo?.belong_dept_name || ''
if (!deptName.includes('运营保障部')) {
ElMessage.warning('只有运营保障部人员才可以发起审批流程!')
return
}
mode.value = 'add'; mode.value = 'add';
drawerVisible.value = true; drawerVisible.value = true;
} }

View File

@ -310,7 +310,8 @@ export default {
currentComponent: null, currentComponent: null,
ticketId: null, ticketId: null,
t_id: null, t_id: null,
dialogVisible: false dialogVisible: false,
userPostNames: []
}; };
}, },
mounted() { mounted() {
@ -391,7 +392,8 @@ export default {
let isDeptHead = false; let isDeptHead = false;
try { try {
const userPosts = await this.$API.system.userPost.list.req({ user: userInfo.id, page: 0 }); const userPosts = await this.$API.system.userPost.list.req({ user: userInfo.id, page: 0 });
isDeptHead = (userPosts || []).some(up => up.post_ && up.post_.name === "部门负责人"); this.userPostNames = (userPosts || []).map(up => up.post_ && up.post_.name).filter(Boolean);
isDeptHead = this.userPostNames.includes("部门负责人");
} catch (e) { } catch (e) {
console.error("获取用户岗位失败:", e); console.error("获取用户岗位失败:", e);
} }
@ -446,6 +448,41 @@ export default {
); );
}, },
startTicket(item) { startTicket(item) {
const userInfo = this.$TOOL.data.get("USER_INFO");
const deptName = userInfo?.belong_dept_name || "";
if (item.key === "wf_assetlogin") {
if (!deptName.includes("运营保障部")) {
this.$message.warning("只有运营保障部人员才可以发起审批流程!");
return;
}
}
if (item.key === "wf_supplieraudit") {
const isProcurement = this.userPostNames.includes("采购专员");
if (!deptName.includes("综合管理部") || !isProcurement) {
this.$message.warning("只有综合管理部采购专员才可以发起审批流程!");
return;
}
}
if (item.key === "wf_quotations") {
if (!deptName.includes("市场营销部")) {
this.$message.warning("只有市场营销部人员才可以发起审批流程!");
return;
}
}
if (item.key === "wf_empjoin") {
const isHr = this.userPostNames.includes("人事专员");
if (!deptName.includes("综合管理部") || !isHr) {
this.$message.warning("只有综合管理部人事专员才可以发起审批流程!");
return;
}
}
if (item.key === "wf_warehouse_entry") {
const isProcurement = this.userPostNames.includes("采购专员");
if (!deptName.includes("综合管理部") || !isProcurement) {
this.$message.warning("只有综合管理部采购专员才可以发起审批流程!");
return;
}
}
this.dialogVisible = false; this.dialogVisible = false;
this.drawer = true; this.drawer = true;
this.t_id = null; this.t_id = null;