| | |
| | | <!-- >新增</el-button>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item v-if="isAdmin" label="企业:" > |
| | | <el-select v-model="data.queryParams.companyId" placeholder="请选择" clearable> |
| | | <el-select v-model="data.queryParams.companyId" placeholder="请选择" clearable @change="getList"> |
| | | <el-option |
| | | v-for="item in companyList" |
| | | :key="item.id" |
| | |
| | | <el-table v-loading="loading" :data="caluseList" class="caluseTable" :border="true" :span-method="arraySpanMethod"> |
| | | <el-table-column label="条款号" prop="clauseNum" align="center"/> |
| | | <el-table-column label="条款内容/要素" prop="content" align="left"/> |
| | | <el-table-column label="总经理" prop="manage" align="center"> |
| | | <template #default="scope"> |
| | | <el-checkbox v-model="scope.row.manage" disabled size="large" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="管理者代表" prop="represent" align="center"> |
| | | <template #default="scope"> |
| | | <el-checkbox v-model="scope.row.represent" disabled size="large" /> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="总经理" prop="manage" align="center">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-checkbox v-model="scope.row.manage" disabled size="large" />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column label="管理者代表" prop="represent" align="center">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-checkbox v-model="scope.row.represent" disabled size="large" />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column v-for="column in deptList" :key="column.deptId" :prop="column.deptId" :label="column.deptName" align="center"> |
| | | <template #default="scope"> |
| | | <el-checkbox v-model="scope.row[column.deptId]" :disabled="!isEdit" size="large" @change="changeStatus(scope.row)"/> |
| | |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {delUser, getUser} from "@/api/onlineEducation/user"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import {getCompany, getDepart, getDistribution, initDistribution, saveDistribution} from "@/api/orgStructure/depart"; |
| | | import { |
| | | getCompany, |
| | | getDepart, |
| | | getDistribution, |
| | | getSysClause, |
| | | initDistribution, |
| | | saveDistribution |
| | | } from "@/api/orgStructure/depart"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | |
| | | isEdit: false, |
| | | dataList: [], |
| | | deptList: [], |
| | | caluseList: [ |
| | | {clauseNum: '4', content: '组织环境'}, |
| | | {clauseNum: '4.1', content: '理解组织及其环境',manage: true,represent: false}, |
| | | {clauseNum: '4.2', content: '理解相关方的需求和期望',manage: true,represent: false}, |
| | | {clauseNum: '4.3', content: '确定质量管理体系的范围',manage: false,represent: true}, |
| | | {clauseNum: '4.4', content: '质量管理体系及其过程',manage: false,represent: true}, |
| | | {clauseNum: '5', content: '领导作用'}, |
| | | {clauseNum: '5.1', content: '领导作用和承诺',manage: true,represent: false}, |
| | | {clauseNum: '5.2', content: '方针',manage: true,represent: false}, |
| | | {clauseNum: '5.3', content: '组织内的角色、职责和权限',manage: true,represent: false}, |
| | | {clauseNum: '6', content: ''}, |
| | | {clauseNum: '6.1', content: '应对风险和机遇的措施',manage: true,represent: false}, |
| | | {clauseNum: '6.2', content: '质量目标及其实现的策划',manage: false,represent: true}, |
| | | {clauseNum: '6.3', content: '变更的策划',manage: false,represent: true}, |
| | | {clauseNum: '7', content: '支持'}, |
| | | {clauseNum: '7.1', content: '资源',manage: true,represent: false}, |
| | | {clauseNum: '7.1.1', content: '总则',manage: true,represent: false}, |
| | | {clauseNum: '7.1.2', content: '人员',manage: true,represent: false}, |
| | | {clauseNum: '7.1.3', content: '基础设施',manage: false,represent: true}, |
| | | {clauseNum: '7.1.4', content: '过程运行环境',manage: false,represent: true}, |
| | | {clauseNum: '7.1.5', content: '监视和测量资源',manage: false,represent: true}, |
| | | {clauseNum: '7.1.6', content: '组织的知识',manage: false,represent: true} |
| | | ], |
| | | caluseList: [], |
| | | form: { |
| | | companyId: null, |
| | | list: [] |
| | |
| | | const { queryParams,isEdit, dataList,deptList, isAdmin, companyList, caluseList, form } = toRefs(data); |
| | | |
| | | onMounted(async ()=>{ |
| | | await getSysClauseList() |
| | | if(userStore.roles.includes('admin')){ |
| | | data.isAdmin = true |
| | | await getCompanyList() |
| | |
| | | onUnmounted(()=>{ |
| | | |
| | | }) |
| | | |
| | | const getSysClauseList = async ()=> { |
| | | const res = await getSysClause() |
| | | if(res.code == 200){ |
| | | data.caluseList = res.data.map(i=>{ |
| | | return { |
| | | clauseNum: i.clauseNum, |
| | | content: i.name |
| | | } |
| | | }) |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | const changeStatus = (val)=>{ |
| | | const excludeFields = ['clauseNum', 'content', 'manage', 'represent'] |
| | |
| | | return |
| | | } |
| | | loading.value = true |
| | | data.form.companyId = data.queryParams.companyId |
| | | const res = await saveDistribution(data.form) |
| | | if(res.code == 200){ |
| | | ElMessage.success(res.message) |
| | |
| | | rowIndex, |
| | | columnIndex, |
| | | }) => { |
| | | if (rowIndex === 0 || rowIndex === 5 ||rowIndex === 9 ||rowIndex === 13) { |
| | | const mergeValues = ['4','5','6','7','7.1','8','8.2','8.3','8.4','8.5','9','9.1','10'] |
| | | if (mergeValues.includes(row.clauseNum)) { |
| | | if (columnIndex === 0) { |
| | | return [1, 1] |
| | | } else if(columnIndex === 1){ |
| | |
| | | const res = await getDistribution(data.queryParams) |
| | | if(res.code == 200){ |
| | | data.dataList = res.data |
| | | if(!data.dataList || data.dataList.length == 0){ |
| | | ElMessage.warning('该企业暂无部门信息') |
| | | } |
| | | for(let item of data.caluseList){ |
| | | const sameNum = data.dataList.filter(i=>i.clauseNum == item.clauseNum).map(j=> { |
| | | return { |
| | |
| | | |
| | | const getDeptList = async () => { |
| | | loading.value = true |
| | | const res = await getDepart({pageNum: 1, pageSize: 999, companyId: data.queryParams.companyId}) |
| | | const res = await getDepart({responsType: 1, companyId: data.queryParams.companyId}) |
| | | if(res.code == 200){ |
| | | data.deptList = res.data |
| | | }else{ |
| | |
| | | <style lang="scss"> |
| | | .caluseTable{ |
| | | .el-table__cell{ |
| | | padding: 4px 0 !important; |
| | | padding: 0 !important; |
| | | .is-disabled{ |
| | | .el-checkbox__label{ |
| | | color: #606266 !important |
| | |
| | | } |
| | | } |
| | | .cell{ |
| | | padding: 0 6px !important; |
| | | padding: 0 4px !important; |
| | | } |
| | | } |
| | | </style> |