From d85d9ae08781a5b0d9b7f854460d3f07d043595a Mon Sep 17 00:00:00 2001 From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com> Date: 星期五, 11 七月 2025 13:27:22 +0800 Subject: [PATCH] 修改新增 --- src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue | 21 +- src/views/build/conpanyFunctionConsult/staffManage/staffRegister/index.vue | 11 + src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/dutyDialog.vue | 22 +- src/views/build/conpanyFunctionConsult/orgStructure/dutyDistributeChart/index.vue | 175 +++++++++++++++++++++--- public/qualityFile.docx | 0 src/api/orgStructure/depart.js | 8 + src/views/build/conpanyFunctionConsult/staffManage/staffRegister/components/staffDialog.vue | 141 ++++++++++++------- src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/departDialog.vue | 13 + 8 files changed, 290 insertions(+), 101 deletions(-) diff --git a/public/qualityFile.docx b/public/qualityFile.docx index 89a6e24..5e181b3 100644 --- a/public/qualityFile.docx +++ b/public/qualityFile.docx Binary files differ diff --git a/src/api/orgStructure/depart.js b/src/api/orgStructure/depart.js index cc57c8c..089a827 100644 --- a/src/api/orgStructure/depart.js +++ b/src/api/orgStructure/depart.js @@ -88,6 +88,14 @@ }) } +export function getFunctionalRemarkList(params) { + return request({ + url: '/system/dept/functionalRemarkList', + method: 'get', + params: params + }) +} + export function saveDistribution(data) { return request({ url: '/system/dept/saveFunctionalDistribution', diff --git a/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue b/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue index 745679e..a5d5418 100644 --- a/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue +++ b/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue @@ -183,7 +183,7 @@ const getDeptList = async (val) => { const res = await getDepart({responsType: 1, companyId: val.companyId}) if(res.code == 200){ - data.originDeptList = res.data + data.originDeptList = JSON.parse(JSON.stringify(res.data)) data.deptList.deptName = val.companyName data.deptList.children = proxy.handleTree(res.data, "deptId") }else{ @@ -234,7 +234,8 @@ data.companyInfo.summaries = res.data.companySummaries ? res.data.companySummaries[0]?.companySummary : [] data.companyInfo.policies = res.data.companyQualityPolicies ? res.data.companyQualityPolicies[0]?.policy : [] const duties = transToTableData(res.data.sysFunctionalDistributions,data.originDeptList) - data.companyInfo.allDeptNames = duties.allDeptNames + data.companyInfo.allDepts = duties.allDepts + console.log(data.companyInfo.allDepts,'all') data.companyInfo.clauses = duties.clauses data.companyInfo.temps = res.data.companyIndustryTemplates?.map((item,index)=>{ return { @@ -250,7 +251,7 @@ const transToTableData=(duties,deptList)=>{ // 步骤1:获取所有唯一的部门和条款编号 // const allDeptNames = [...new Set(duties.map(item => item.deptName))]; - const allDeptNames = deptList ? deptList.map(item => item.deptName) : [...new Set(duties.map(item => item.deptName))] + const allDepts = deptList const allClauseNums = [...new Set([ ...data.caluseList.map(c => c.clauseNum), ...duties.map(d => d.clauseNum) @@ -261,11 +262,15 @@ const processedClauses = allClauseNums.map(clauseNum => { const clauseContent = data.caluseList.find(c => c.clauseNum === clauseNum)?.content || ""; // 为当前条款生成所有部门的数据(确保每个部门都有值) - const deptValues = allDeptNames.map(deptName => { + const deptValues = allDepts.map(dept => { const matchedDept = duties.find( - item => item.clauseNum === clauseNum && item.deptName === deptName - ); - return matchedDept ? (matchedDept.chooseLab==1?'●':'○' ): '○' + item => item.clauseNum === clauseNum && item.deptId === dept.deptId + ) + if(dept.deptType == '0'){ + return matchedDept ? (matchedDept.chooseLab==1?'●':'○' ): '○' + }else{ + return matchedDept ? (matchedDept.chooseLab==1?'▲':'○' ): '○' + } }); return { clauseNum, @@ -276,7 +281,7 @@ // 最终数据结构 return { clauses: processedClauses, - allDeptNames // 用于生成表头 + allDepts // 用于生成表头 }; } diff --git a/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/departDialog.vue b/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/departDialog.vue index e6be06a..134ef0d 100644 --- a/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/departDialog.vue +++ b/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/departDialog.vue @@ -56,6 +56,12 @@ <el-form-item label="部门名称:" prop="deptName"> <el-input v-model.trim="state.form.deptName" :disabled="state.title =='查看'" placeholder="部门名称"></el-input> </el-form-item> + <el-form-item label="是否是管理层:" prop="deptType" v-if="state.title !== '修改密码'"> + <el-radio-group v-model="state.form.deptType" :disabled="disabled"> + <el-radio :label="1">是</el-radio> + <el-radio :label="0">否</el-radio> + </el-radio-group> + </el-form-item> <el-form-item label="负责人:" prop="leaderUserId"> <el-select clearable v-model="state.form.leaderUserId" :disabled="state.title =='查看'" filterable placeholder="负责人" style="width: 100%"> <el-option @@ -140,7 +146,8 @@ companyId: null, responsType: 1, childDeptIds: [], - orderNum: 0 + orderNum: 0, + deptType: 0 }, isAdmin: false, companyList: [], @@ -182,6 +189,7 @@ state.oldClauseList = value.caluseVO1List state.form.childDeptIds = value.sysDeptManageVoList?.map(i=>i.subDeptId) state.form.responsType = Number(value.responsType) + state.form.deptType = Number(value.deptType) }else{ if(value.deptId && value.companyId){ state.form.parentId = value.deptId @@ -270,7 +278,8 @@ companyId: null, responsType: 1, childDeptIds: [], - orderNum: 0 + orderNum: 0, + deptType: 0 } superRef.value.clearValidate(); diff --git a/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/dutyDialog.vue b/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/dutyDialog.vue index c97c48e..d0d19e8 100644 --- a/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/dutyDialog.vue +++ b/src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/dutyDialog.vue @@ -110,17 +110,17 @@ </el-input> </template> </el-table-column> - <el-table-column label="相关证据材料" prop="evidenceMaterials" align="center"> - <template #default="scope"> - <el-input - v-model.trim="scope.row.evidenceMaterials" - size="large" - type="textarea" - style="width: 100%;" - > - </el-input> - </template> - </el-table-column> +<!-- <el-table-column label="相关证据材料" prop="evidenceMaterials" align="center">--> +<!-- <template #default="scope">--> +<!-- <el-input--> +<!-- v-model.trim="scope.row.evidenceMaterials"--> +<!-- size="large"--> +<!-- type="textarea"--> +<!-- style="width: 100%;"--> +<!-- >--> +<!-- </el-input>--> +<!-- </template>--> +<!-- </el-table-column>--> <el-table-column label="现有管理类文件" prop="managementDocuments" align="center" width="150"> <template #default="scope"> <el-input diff --git a/src/views/build/conpanyFunctionConsult/orgStructure/dutyDistributeChart/index.vue b/src/views/build/conpanyFunctionConsult/orgStructure/dutyDistributeChart/index.vue index 7d2d239..6b619b7 100644 --- a/src/views/build/conpanyFunctionConsult/orgStructure/dutyDistributeChart/index.vue +++ b/src/views/build/conpanyFunctionConsult/orgStructure/dutyDistributeChart/index.vue @@ -27,7 +27,7 @@ </el-form> </div> <div style="display: flex;justify-content: space-between;margin-bottom: 10px"> - <div>质量管理体系过程与部门职能矩阵</div> + <div>质量管理体系过程与部门职能矩阵(▲ 主管部门<span style="font-size: 24px;display: inline-block;margin-left: 20px">●</span> 归口部门<span style="font-size: 24px;display: inline-block;margin-left: 20px">○</span> 配合部门)</div> <div> <el-button type="primary" @click="initDistribute">重新生成</el-button> <el-button type="primary" v-if="!isEdit" @click="isEdit = true">编辑</el-button> @@ -35,6 +35,7 @@ </div> </div> <!-- 表格数据 --> + <el-form ref="noticeRef" :model="remarkForm" :rules="rules"> <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"/> @@ -50,10 +51,47 @@ <!-- </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)"/> + <el-checkbox v-if="isEdit" v-model="scope.row[column.deptId]" size="large" @change="changeStatus(scope.row,scope.$index)"/> + <div v-else> + <el-checkbox v-if="column.deptType == '0'" v-model="scope.row[column.deptId]" disabled size="large"/> + <div class="markBox" v-else> + <div class="triangle" v-show="scope.row[column.deptId]"></div> + <el-checkbox v-show="!scope.row[column.deptId]" v-model="scope.row[column.deptId]" disabled size="large"/> + </div> + </div> </template> </el-table-column> + + <el-table-column label="备注" prop="remark" align="center" width="170px" fixed="right"> + <template #default="scope"> + <div v-if="!mergeValues.includes(scope.row.clauseNum)"> + <el-form-item v-if="isEdit && getRowValueNum(scope.row) >= 2" :prop="`tableData.${scope.$index}.remark`" :rules="getRowValueNum(scope.row) >= 2 ? rules.remark : []"> + <el-input + v-model.trim="remarkForm.tableData[scope.$index].remark" + size="large" + type="textarea" + style="width: 100%;" + > + </el-input> + </el-form-item> + + <span v-else>{{ remarkForm.tableData[scope.$index].remark }}</span> + </div> + </template> + </el-table-column> + </el-table> + </el-form> +<!-- <el-dialog--> +<!-- v-model="dialogVisible"--> +<!-- title="备注"--> +<!-- width="700px"--> +<!-- :before-close="handleClose"--> +<!-- >--> +<!-- <el-form :model="remarkList" size="default" ref="superRef" :rules="formRules" label-width="150px">--> +<!-- <el-form-item label="企业:" prop="companyId"></el-form-item>--> +<!-- </el-form>--> +<!-- </el-dialog>--> </div> </template> @@ -65,7 +103,7 @@ import { getCompany, getDepart, - getDistribution, + getDistribution, getFunctionalRemarkList, getSysClause, initDistribution, saveDistribution @@ -83,15 +121,27 @@ isEdit: false, dataList: [], deptList: [], + subDepts: [], caluseList: [], + remarkForm: {}, form: { companyId: null, - list: [] - } + list: [], + remarks: [] + }, + originRemark: [], + remarkList: [], + dialogVisible: false, + rules: { + remark: [ + {required: true, message: "有两个归口部门请填写备注", trigger: "blur"}, + ], + }, + mergeValues: ['4','5','6','7','7.1','8','8.2','8.3','8.4','8.5','9','9.1','10'] }); -const { queryParams,isEdit, dataList,deptList, isAdmin, companyList, caluseList, form } = toRefs(data); - +const { queryParams,isEdit, dataList,deptList, isAdmin, companyList, caluseList, form,originRemark, remarkList,dialogVisible,mergeValues,remarkForm,rules } = toRefs(data); +const noticeRef = ref(); onMounted(async ()=>{ await getSysClauseList() if(userStore.roles.includes('admin')){ @@ -109,6 +159,23 @@ }) + +// 获取非管理层选中数量 +const getRowValueNum = (row)=>{ + let count = 0; + for (const key in row) { + // 检查键是否是数字(忽略非数字键) + if (!isNaN(key)) { + const numericKey = parseInt(key, 10); + // 检查数字键是否在subDepts中且值为true + if (data.subDepts.includes(numericKey) && row[key] === true) { + count++; + } + } + } + return count; +} + const getSysClauseList = async ()=> { const res = await getSysClause() if(res.code == 200){ @@ -123,9 +190,26 @@ } } -const changeStatus = (val)=>{ +const getRemarksList = async ()=> { + const res = await getFunctionalRemarkList({companyId: data.queryParams.companyId}) + if(res.code == 200){ + data.originRemark = res.data + for(let item of data.originRemark){ + const foundObj = data.caluseList.find(i=>i.clauseNum == item.clauseNum) + if(foundObj){ + foundObj.remark = item.remark + } + } + }else{ + ElMessage.warning(res.message) + } +} + +const changeStatus = (val,index)=>{ + if(getRowValueNum(val)<2){ + data.remarkForm.tableData[index].remark = '' + } const excludeFields = ['clauseNum', 'content', 'manage', 'represent'] - // 转换当前对象为临时数组 const currentList = Object.keys(val).filter(key => !excludeFields.includes(key)).map(key => ({ clauseNum: val.clauseNum, deptId: Number(key), @@ -147,22 +231,34 @@ } const confirmEdit = async ()=>{ - if(data.form.list.length == 0){ - data.isEdit = !data.isEdit + const valid = await noticeRef.value.validate() + if(valid){ + loading.value = true + data.form.remarks = data.remarkForm.tableData.filter(i=>i.remark && i.remark !== '').map(i=>{ + return { + companyId: data.queryParams.companyId, + clauseNum: i.clauseNum, + remark: i.remark + } + }) + if(data.form.list.length == 0 && data.form.remarks.length == 0){ + data.isEdit = !data.isEdit + await getList() + return + } + data.form.companyId = data.queryParams.companyId + const res = await saveDistribution(data.form) + if(res.code == 200){ + ElMessage.success(res.message) + }else{ + ElMessage.warning(res.message) + } + loading.value = false await getList() - return - } - loading.value = true - data.form.companyId = data.queryParams.companyId - const res = await saveDistribution(data.form) - if(res.code == 200){ - ElMessage.success(res.message) + data.isEdit = !data.isEdit }else{ - ElMessage.warning(res.message) + ElMessage.warning('条款有两个归口部门,要填写备注') } - loading.value = false - await getList() - data.isEdit = !data.isEdit } const arraySpanMethod = ({ @@ -171,12 +267,15 @@ rowIndex, columnIndex, }) => { - 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 (data.mergeValues.includes(row.clauseNum)) { + const totalColumns = data.deptList.length + 3 if (columnIndex === 0) { return [1, 1] } else if(columnIndex === 1){ - return [1,900] + return [1, Math.max(1, totalColumns - 2)]; + } + if (columnIndex < totalColumns - 1) { + return [0, 0]; } } } @@ -194,16 +293,22 @@ const sameNum = data.dataList.filter(i=>i.clauseNum == item.clauseNum).map(j=> { return { deptId: j.deptId, - chooseLab: j.chooseLab + chooseLab: j.chooseLab, + remark: j.remark } } ) for(let i of sameNum){ item[i.deptId] = i.chooseLab == 0?false:true + item.remark = i.remark } } + await getRemarksList() }else{ ElMessage.warning(res.message) + } + data.remarkForm = { + tableData: JSON.parse(JSON.stringify(data.caluseList)) } loading.value = false } @@ -213,6 +318,7 @@ const res = await getDepart({responsType: 1, companyId: data.queryParams.companyId}) if(res.code == 200){ data.deptList = res.data + data.subDepts = data.deptList.filter(i=>i.deptType == '0').map(i=>i.deptId) }else{ ElMessage.warning(res.message) } @@ -232,6 +338,10 @@ } else { ElMessage.warning(res.message) } +} + +const handleClose = ()=>{ + } const initDistribute = async ()=>{ @@ -319,6 +429,19 @@ } .cell{ padding: 0 4px !important; + + .markBox{ + width: 100%; + display: flex; + justify-content: center; + .triangle{ + width: 18px; + height: 16px; /* 高度 = 100 * (√3/2) */ + background-color: #333; + clip-path: polygon(0% 100%, 50% 0%, 100% 100%); + } + } + } } </style> \ No newline at end of file diff --git a/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/components/staffDialog.vue b/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/components/staffDialog.vue index 41e255b..b8fff89 100644 --- a/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/components/staffDialog.vue +++ b/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/components/staffDialog.vue @@ -21,6 +21,18 @@ <el-radio :label="1">女</el-radio> </el-radio-group> </el-form-item> + <el-form-item label="年龄:" prop="age" v-if="state.title !== '修改密码'"> + <el-input v-model.number.trim="state.form.age" type="number" :disabled="disabled" placeholder="请输入年龄"></el-input> + </el-form-item> + <el-form-item label="职称:" prop="positional" v-if="state.title !== '修改密码'"> + <el-input v-model.trim="state.form.positional" :disabled="disabled" placeholder="请输入职称"></el-input> + </el-form-item> + <el-form-item label="人员类别:" prop="personType" v-if="state.title !== '修改密码'"> + <el-radio-group v-model="state.form.personType" :disabled="disabled"> + <el-radio :label="1">技术</el-radio> + <el-radio :label="2">管理</el-radio> + </el-radio-group> + </el-form-item> <el-form-item label="身份证号:" prop="idCard" v-if="state.title !== '修改密码'"> <el-input v-model.trim="state.form.idCard" :maxlength="18" :disabled="disabled" placeholder="请输入身份证号"></el-input> </el-form-item> @@ -30,6 +42,14 @@ type="date" value-format="YYYY-MM-DD" placeholder="请选择入职时间" + /> + </el-form-item> + <el-form-item label="离职时间:" prop="resignTime" v-if="state.title !== '修改密码'" > + <el-date-picker + v-model="state.form.resignTime" + type="date" + value-format="YYYY-MM-DD" + placeholder="请选择离职时间" /> </el-form-item> <el-form-item label="密码:" prop="password" v-if="state.title == '新增' || state.title == '修改密码'"> @@ -43,14 +63,15 @@ </el-form-item> <el-form-item label="用户类型:" v-if="state.title !== '修改密码'" prop="userType"> <el-radio-group v-model="state.form.userType" :disabled="disabled" @change="changeType" v-if="state.title == '新增'"> - <el-radio :label="0">系统管理员</el-radio> - <el-radio :label="1">企业管理员</el-radio> - <el-radio :label="2">企业用户</el-radio> -<!-- <el-radio :label="3" v-if="!state.isAdmin">车间(岗位)级</el-radio>--> + <el-radio :label="0" v-if="state.currentUserType == 0">系统管理员</el-radio> + <el-radio :label="6" v-if="state.currentUserType == 0 || state.currentUserType == 6 ">企业管理员</el-radio> + <el-radio :label="1" v-if="state.currentUserType == 0 || state.currentUserType == 6 || state.currentUserType ==1">企业用户</el-radio> + <el-radio :label="2" v-if="state.currentUserType !== 3">部门级</el-radio> + <el-radio :label="3">车间(岗位)级</el-radio> <!-- <el-radio :label="4" v-if="state.currentUserType == 0">其他</el-radio>--> </el-radio-group> - <span v-else-if="state.title == '查看'">{{state.currentUserType === 0 ? '管理员' : state.currentUserType === 1 ? '企业级' : state.currentUserType === 2 ? '部门级' : state.currentUserType === 3 ? '车间级' :'其他'}}</span> - <span v-else-if="state.title == '编辑'">{{state.form.userType === 0 ? '管理员' : state.form.userType === 1 ? '企业级' : state.form.userType === 2 ? '部门级' : state.form.userType === 3 ? '车间级' :'其他'}}</span> + <span v-else-if="state.title == '查看'">{{state.currentUserType === 0 ? '系统管理员' : state.currentUserType === 1 ? '企业用户' : state.currentUserType === 6 ? '企业管理员' : state.currentUserType === 2 ? '部门级' : state.currentUserType === 3 ? '车间级' :'其他'}}</span> + <span v-else-if="state.title == '编辑'">{{state.form.userType === 0 ? '系统管理员' : state.form.userType === 1 ? '企业用户' : state.form.userType === 2 ? '部门级' : state.form.userType === 3 ? '车间级' :'其他'}}</span> <!-- <el-radio-group v-model="state.form.userType" :disabled="disabled" @change="changeType" v-else-if="state.title == '编辑'">--> <!-- <el-radio :label="0" v-if="state.currentUserType == 0">管理员</el-radio>--> <!-- <el-radio :label="1" >企业级</el-radio>--> @@ -103,7 +124,22 @@ </el-form-item> - <el-form-item label="部门:" prop="deptId" v-if="state.title !== '修改密码'"> + <el-form-item label="所属上级账号:" prop="companyName" v-if="showChild"> + <scorllSelect + :disabled="disabled || state.title =='编辑'" + ref="scrollRef" + v-model="state.form.parentName" + @getval = "getSelectUser" + placeholder="请选择" + clearable + style="width: 45%;" + filterable + remote + searchKey="username" + :methods="getUser"> + </scorllSelect> + </el-form-item> + <el-form-item label="部门:" prop="deptId" v-if="state.title !== '修改密码' && state.form.userType !== 0"> <el-select clearable v-model="state.form.deptId" @@ -120,26 +156,11 @@ /> </el-select> </el-form-item> - <el-form-item label="职务:" prop="duty" v-if="state.title !== '修改密码'" > + <el-form-item label="职务:" prop="duty" v-if="state.title !== '修改密码' && state.form.userType !== 0"> <el-input v-model.trim="state.form.duty" :disabled="disabled" placeholder="请输入职务"></el-input> </el-form-item> - <el-form-item label="专业:" prop="post" v-if="state.title !== '修改密码'" > + <el-form-item label="专业:" prop="post" v-if="state.title !== '修改密码' && state.form.userType !== 0"> <el-input v-model.trim="state.form.post" :disabled="disabled" placeholder="请输入专业"></el-input> - </el-form-item> - <el-form-item label="所属上级账号:" prop="companyName" v-if="showChild"> - <scorllSelect - :disabled="disabled || state.title =='编辑'" - ref="scrollRef" - v-model="state.form.parentName" - @getval = "getSelectUser" - placeholder="请选择" - clearable - style="width: 45%;" - filterable - remote - searchKey="username" - :methods="getUser"> - </scorllSelect> </el-form-item> </el-form> <template #footer v-if="state.title !='查看'"> @@ -265,10 +286,14 @@ companyName: '', parentId: null, entryTime: '', + resignTime: '', idCard: '', deptId: null, duty: '', - post: '' + post: '', + age: null, + personType: null, + positional: '' }, formRules:{ name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], @@ -277,12 +302,13 @@ username: [{ required: true, message: '请选择用户名', trigger: 'blur' }], password: [{ required: true, validator: validatePwd, trigger: 'blur' }], confirmPassword: [{ required: true, validator: equalToPassword, trigger: 'blur' }], - phone: [{ validator: validateUserPhone, trigger: 'blur' }], + // phone: [{ validator: validateUserPhone, trigger: 'blur' }], userType: [{ required: true, message: '请选择用户类型', trigger: 'blur' }], - idCard: [{ validator: verifyId, trigger: 'blur' }], + // idCard: [{ validator: verifyId, trigger: 'blur' }], entryTime: [{ required: true, message: '请选择入职时间', trigger: 'blur' }], - // duty: [{ required: true, message: '请输入职务', trigger: 'blur' }], - // post: [{ required: true, message: '请输入专业', trigger: 'blur' }] + age: [{ required: true, message: '请输入年龄', trigger: 'blur' }], + personType: [{ required: true, message: '请选择人员类别', trigger: 'blur' }], + positional: [{ required: true, message: '请输入职称', trigger: 'blur' }] }, companyList: [], userList: [], @@ -436,7 +462,7 @@ const onSubmit = async () => { const valid = await superRef.value.validate(); if(valid){ - if((state.form.userType ===1 && state.form.companyId ===null) || ((state.form.userType ===2 ||state.form.userType ===3) && (state.form.parentId ===null ||state.form.companyId===null))){ + if((state.form.userType ===2 ||state.form.userType ===3) && (state.form.parentId ===null ||state.form.companyId===null)){ ElMessage.warning('请选择所属父级账号') return; } @@ -468,8 +494,13 @@ parentId: data.parentId, idCard: data.idCard, entryTime: data.entryTime, + resignTime: data.resignTime, duty: data.duty, - post: data.post + post: data.post, + companyName: data.companyName, + age: data.age, + personType: data.personType, + positional: data.positional } const res = await editUser(param) @@ -512,28 +543,37 @@ state.form.companyId = null; state.form.companyName = ''; //当前是管理员级用户 + console.log(state.currentUserType,'type') if(state.currentUserType === 0){ if(state.form.userType === 0){ showCompany.value = false; showChild.value = false; }else { showCompany.value = true; - showChild.value = false; + if(state.form.userType === 3){ + showChild.value = true + }else{ + showChild.value = false; + } + } + }else{ + state.form.companyId = userInfo.value.companyId; + state.form.companyName = userInfo.value.companyName + showCompany.value = true } //当前是企业级/其他用户选择部门 - if((state.currentUserType === 1 && state.form.userType === 2) || (state.currentUserType === 4 && state.form.userType === 2)){ + if((state.currentUserType === 1 && state.form.userType === 2) || (state.currentUserType === 4 && state.form.userType === 2) || (state.currentUserType === 6 && state.form.userType === 2)){ state.form.parentId = userInfo.value.id; state.form.companyName = userInfo.value.companyName state.form.companyId = userInfo.value.companyId; showChild.value = false; - showCompany.value = true; + // showCompany.value = true; - } //当前是企业级/其他用户选择车间 - else if((state.currentUserType === 1 && state.form.userType === 3) || (state.currentUserType === 4 && state.form.userType === 3)){ + } else if((state.currentUserType === 1 && state.form.userType === 3) || (state.currentUserType === 4 && state.form.userType === 3)|| (state.currentUserType === 6 && state.form.userType === 3)){ state.form.companyName = userInfo.value.companyName state.form.companyId = userInfo.value.companyId; - showCompany.value = true; + // showCompany.value = true; showChild.value = true; const param = { userType: 2, @@ -548,22 +588,9 @@ state.form.parentId = userInfo.value.id; state.form.companyName = userInfo.value.companyName state.form.companyId = userInfo.value.companyId; - showCompany.value = true; + // showCompany.value = true; showChild.value = false; } - // if(state.isAdmin){ - // state.form.companyId = null; - // state.form.companyName = ''; - // } - // state.form.parentId = null; - // state.form.parentName = ''; - // if(state.form.userType === 2 || state.form.userType === 3 ){ - // const param = { - // userType: state.form.userType-1, - // companyId: state.form.companyId, - // } - // scrollRef.value.getList(param,'change'); - // } } const handleClose = () => { @@ -577,7 +604,17 @@ userType: null, sex: 0, companyId: null, - parentId: null + companyName: '', + parentId: null, + entryTime: '', + resignTime: '', + idCard: '', + deptId: null, + duty: '', + post: '', + age: null, + personType: null, + positional: '' } showCompany.value = false; showChild.value = false; diff --git a/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/index.vue b/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/index.vue index 5f3498e..4c3c7d3 100644 --- a/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/index.vue +++ b/src/views/build/conpanyFunctionConsult/staffManage/staffRegister/index.vue @@ -62,8 +62,15 @@ <!-- 表格数据 --> <el-table v-loading="loading" :data="dataList" :border="true"> <el-table-column label="序号" type="index" align="center" width="80" /> - <el-table-column label="用户名" prop="username" align="center" /> - <el-table-column label="姓名" prop="name" align="center" /> + <el-table-column label="用户名" prop="username" align="center"/> + <el-table-column label="姓名" prop="name" align="center"/> + <el-table-column label="年龄" prop="age" align="center"/> + <el-table-column label="职称" prop="positional" align="center"/> + <el-table-column label="人员类别" prop="personType" align="center"> + <template #default="scope"> + {{ scope.row.personType == 1?'技术':'管理' }} + </template> + </el-table-column> <el-table-column label="身份证号" prop="idCard" align="center" /> <el-table-column label="入职时间" prop="entryTime" align="center"/> <el-table-column label="部门" prop="deptName" align="center"/> -- Gitblit v1.9.2