Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
0db43cc4c5
|
|
@ -56,6 +56,7 @@
|
|||
</template>
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import API from '@/api'
|
||||
import TOOL from "@/utils/tool.js"
|
||||
import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js";
|
||||
|
|
@ -75,6 +76,11 @@ const drawerTitle = ref('资产入库');
|
|||
const mode = ref('add');
|
||||
const t_id = ref(null);
|
||||
const handleAdd = () => {
|
||||
const deptName = userInfo?.belong_dept_name || ''
|
||||
if (!deptName.includes('运营保障部')) {
|
||||
ElMessage.warning('只有运营保障部人员才可以发起审批流程!')
|
||||
return
|
||||
}
|
||||
mode.value = 'add';
|
||||
drawerVisible.value = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,7 +310,8 @@ export default {
|
|||
currentComponent: null,
|
||||
ticketId: null,
|
||||
t_id: null,
|
||||
dialogVisible: false
|
||||
dialogVisible: false,
|
||||
userPostNames: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -391,7 +392,8 @@ export default {
|
|||
let isDeptHead = false;
|
||||
try {
|
||||
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) {
|
||||
console.error("获取用户岗位失败:", e);
|
||||
}
|
||||
|
|
@ -446,6 +448,41 @@ export default {
|
|||
);
|
||||
},
|
||||
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.drawer = true;
|
||||
this.t_id = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue