| | |
| | | <el-form-item > |
| | | <el-button v-if="isAdmin" type="primary" @click="getList">查询</el-button> |
| | | <el-button v-if="isAdmin" type="primary" plain @click="reset">重置</el-button> |
| | | <el-button type="primary" @click="initDistribute">生成智能分配表</el-button> |
| | | <el-button type="primary" @click="initDistribute">生成职能分配表</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | const res = await getCompany(queryParams) |
| | | if (res.code == 200) { |
| | | data.companyList = res.data.list?res.data.list:[] |
| | | data.queryParams.companyId = data.companyList[0].id |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | const openDialog = (type, value) => { |
| | | dialogRef.value.openDialog(type, value, data.queryParams.companyId); |
| | | dialogRef.value.openDialog(type, value, data.queryParams.companyId, data.isAdmin, data.companyList ); |
| | | } |
| | | const openDutyDialog = (value) =>{ |
| | | dutyDialogRef.value.openDialog(value); |
| | |
| | | const download = async (val) => { |
| | | const templatePath = '/dutyFile.docx' |
| | | const data = await getDeptDetail(val.deptId) |
| | | console.log(data) |
| | | try { |
| | | generateWordDocument(templatePath, data, `${data.deptName}职责表.docx`); |
| | | } catch (error){ |
| | |
| | | tableData.tableData = sortResponsibilities(res.data.sysDeptResponsibilitys.map(i=>{ |
| | | return { |
| | | ...i, |
| | | leader: i.leader || '', |
| | | evidenceMaterials: i.evidenceMaterials || '', |
| | | managementDocuments: i.managementDocuments || '', |
| | | technicalDocuments: i.technicalDocuments || '', |
| | |
| | | } |
| | | })) |
| | | }else{ |
| | | tableData.tableData = [...data.firstFive,...res.data.sysDeptResponsibilitys.map(i=>{ |
| | | tableData.tableData = [...data.firstFive,...res.data.sysDeptResponsibilitys,...data.lastTwo].map(i=>{ |
| | | return { |
| | | ...i, |
| | | leader: i.leader || '', |
| | | evidenceMaterials: i.evidenceMaterials || '', |
| | | managementDocuments: i.managementDocuments || '', |
| | | technicalDocuments: i.technicalDocuments || '', |
| | | existingRecords: i.existingRecords || '', |
| | | } |
| | | }),...data.lastTwo] |
| | | }) |
| | | } |
| | | return tableData |
| | | }else{ |