最后小修
This commit is contained in:
@@ -38,6 +38,10 @@ const total = ref(0)
|
||||
// 采购经理只能操作采购合同,招商经理只能操作加盟合同(提前定义,供 form 初始化使用)
|
||||
const isProcurementManager = computed(() => getUserInfo()?.departmentName === 'procurement_manager')
|
||||
const isFranchiseManager = computed(() => getUserInfo()?.departmentName === 'franchise_manager')
|
||||
|
||||
//是否是管理员
|
||||
const isAdmin = computed(() => getUserInfo()?.departmentName === 'admin')
|
||||
|
||||
const getDefaultType = () => {
|
||||
if (isProcurementManager.value) return 'supply'
|
||||
if (isFranchiseManager.value) return 'franchise'
|
||||
@@ -349,19 +353,27 @@ const canUpdate = computed(() => hasPermission('contract', 'update'))
|
||||
const canDelete = computed(() => hasPermission('contract', 'delete'))
|
||||
const canOperate = computed(() => canUpdate.value || canDelete.value)
|
||||
|
||||
// 招商经理只能编辑加盟合同,采购经理只能编辑采购合同
|
||||
//获取用户数据
|
||||
const userInfo = computed(() => getUserInfo())
|
||||
|
||||
// 招商经理只能编辑加盟合同,采购经理只能编辑采购合同,且每个员工只能操作自己的合同(管理员除外)
|
||||
const canEditRow = (row) => {
|
||||
if (isAdmin.value) return true
|
||||
if (!canUpdate.value) return false
|
||||
if (isProcurementManager.value && row.type !== 'supply') return false
|
||||
if (isFranchiseManager.value && row.type !== 'franchise') return false
|
||||
if (userInfo.value.employee_id !== row.employee_id) return false
|
||||
return true
|
||||
}
|
||||
const canDeleteRow = (row) => {
|
||||
if (isAdmin.value) return true
|
||||
if (!canDelete.value) return false
|
||||
if (isProcurementManager.value && row.type !== 'supply') return false
|
||||
if (isFranchiseManager.value && row.type !== 'franchise') return false
|
||||
if (userInfo.value.employee_id !== row.employee_id) return false
|
||||
return true
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -493,7 +505,7 @@ const canDeleteRow = (row) => {
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="closeDetail">关闭</el-button>
|
||||
<el-button type="primary" @click="(() => { const d = currentDetail; closeDetail(); editContract(d) })()" v-if="canOperate">编辑</el-button>
|
||||
<el-button type="primary" @click="(() => { const d = currentDetail; closeDetail(); editContract(d) })()" v-if="userInfo.employee_id === currentDetail?.employee_id">编辑</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
@@ -297,14 +297,23 @@ const canDelete = computed(() => hasPermission('after_sale', 'delete'))
|
||||
const canOperate = computed(() => canUpdate.value || canDelete.value)
|
||||
|
||||
const isOperationsManager = computed(() => getUserInfo()?.departmentName === 'operations_manager')
|
||||
//是否是管理员
|
||||
const isAdmin = computed(() => getUserInfo()?.departmentName === 'admin')
|
||||
|
||||
const currentUserId = computed(() => getUserInfo()?.id)
|
||||
|
||||
|
||||
|
||||
const canEditRow = (row) => {
|
||||
if (isAdmin.value) return true
|
||||
if (!canUpdate.value) return false
|
||||
if (getUserInfo()?.employee_id !== row.employee_id) return false
|
||||
return true
|
||||
}
|
||||
const canDeleteRow = (row) => {
|
||||
if (isAdmin.value) return true
|
||||
if (!canDelete.value) return false
|
||||
if (getUserInfo()?.employee_id !== row.employee_id) return false
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -420,7 +429,7 @@ const canDeleteRow = (row) => {
|
||||
<el-tag :type="statusMap[currentDetail.handle_status]">{{ currentDetail.handle_status }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="售后日期">{{ formatDate(currentDetail.service_date) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">{{ currentDetail.responsible_user_name || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">{{ currentDetail.employee_name || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="反馈内容" :span="2">{{ currentDetail.feedback || '无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="处理方式" :span="2">{{ currentDetail.handle_method || '无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ currentDetail.remark || '无' }}</el-descriptions-item>
|
||||
@@ -428,7 +437,7 @@ const canDeleteRow = (row) => {
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="closeDetail">关闭</el-button>
|
||||
<el-button type="primary" @click="(() => { const d = currentDetail; closeDetail(); editService(d) })()" v-if="canOperate">编辑</el-button>
|
||||
<el-button type="primary" @click="(() => { const d = currentDetail; closeDetail(); editService(d) })()" v-if="getUserInfo()?.employee_id === currentDetail?.employee_id">编辑</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user