| | |
| | | <el-button link type="primary" @click="openDialog('view',scope.row)">查看</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="primary" @click="downloadFile(scope.row)">导出</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button> |
| | | <el-button v-if="isAuthority" link type="danger" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | }, |
| | | dataLoader: {}, |
| | | api: {}, |
| | | checkDate: [] |
| | | checkDate: [], |
| | | isAuthority: false |
| | | }); |
| | | |
| | | const { queryParams, total, dataList,deptList, userList, formConfig, dataLoader, api, checkTypeList, checkDate } = toRefs(state); |
| | | const { queryParams, total, dataList,deptList, userList, formConfig, dataLoader, api, checkTypeList, checkDate, isAuthority } = toRefs(state); |
| | | const userStore = useUserStore() |
| | | onMounted(async ()=>{ |
| | | await getList() |
| | | await getDeptList() |
| | | await getUserList() |
| | | if(userStore.roles.includes('admin') || userStore.roles.includes('sys_admin') || userStore.roles.includes('place_safety_officer')){ |
| | | state.isAuthority = true |
| | | }else{ |
| | | state.isAuthority = false |
| | | } |
| | | }) |
| | | |
| | | onUnmounted(()=>{ |
| | |
| | | |
| | | const openDialog = (type, value) => { |
| | | const initalData = JSON.parse(JSON.stringify(value)) |
| | | if (initalData.dailySafetyInspectionDepts && Array.isArray(initalData.dailySafetyInspectionDepts)) { |
| | | initalData.dailySafetyInspectionDepts = initalData.dailySafetyInspectionDepts.map(item => item.deptId) |
| | | } |
| | | dialogRef.value.openDialog(type, initalData) |
| | | } |
| | | |
| | |
| | | |
| | | const handleSubmit = async (data, type) => { |
| | | const params = JSON.parse(JSON.stringify(data)) |
| | | console.log(params.dailySafetyInspectionDepts,555) |
| | | params.dailySafetyInspectionDepts = params.dailySafetyInspectionDepts.map(i=>{ |
| | | return { |
| | | deptId: i, |