| | |
| | | <!-- 岗位职责 --> |
| | | <template> |
| | | <div class="view"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-form ref="page" size="small" :inline="true"> |
| | | <el-form-item label="员工"> |
| | | <el-input v-model="userName" clearable placeholder="请输入员工" size="small" style="width: 20vh;"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <div style="display: flex;"> |
| | | <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> |
| | | <span style="width: 50px;font-size: 14px;font-weight: 700;color: #606266;">员工</span> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="userName" |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button size="small" type="primary" @click="refreshTable">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | </div> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button size="small" type="primary" @click="addPost">新增</el-button> |
| | | <!-- <el-button size="small" type="primary">导出excel</el-button>--> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <el-table :data="tableData" v-loading="tableLoading" height="66.5vh" style="width: 100%"> |
| | | <el-table :data="tableData" v-loading="tableLoading" height="66.5vh" style="width: 100%" |
| | | :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border> |
| | | <el-table-column label="序号" type="index" width="60"></el-table-column> |
| | | <el-table-column label="员工编号" min-width="120" prop="account"></el-table-column> |
| | | <el-table-column label="岗位名称" min-width="180" prop="postName"></el-table-column> |
| | |
| | | <el-table-column fixed="right" label="操作" width="140" align="center"> |
| | | <template v-slot="scope"> |
| | | <el-button v-if="!isDepartment || scope.row.currentState === '关闭'" size="small" type="text" |
| | | @click="handleViewClick(scope.row, 'view')">查看 |
| | | @click="handleViewClick(scope.row, 'view')">查看 |
| | | </el-button> |
| | | <el-button v-if="isDepartment && scope.row.currentState !== '关闭'" size="small" type="text" |
| | | @click="handleViewClick(scope.row, 'edit')">编辑 |
| | | @click="handleViewClick(scope.row, 'edit')">编辑 |
| | | </el-button> |
| | | <el-button size="small" type="text" @click="downLoadPost(scope.row)">导出</el-button> |
| | | <el-button v-if="isDepartment" size="small" style="color: #f56c6c" type="text" @click="deletePost(scope.row)">删除</el-button> |
| | | <el-button v-if="isDepartment" size="small" style="color: #f56c6c" type="text" |
| | | @click="deletePost(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" |
| | | background |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" background style="margin-top: 10px" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <!-- 新增岗位职责 --> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" |
| | | title="新增岗位职责" |
| | | width="50%" @close="resetForm"> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" title="新增岗位职责" |
| | | width="50%" @close="resetForm"> |
| | | <el-steps :active="currentStep" align-center finish-status="success"> |
| | | <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer" |
| | | @click.native="choiceStep(i)"></el-step> |
| | | @click.native="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px"> |
| | | <div> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="岗位名称:" prop="postName"> |
| | | <el-input v-model="form.postName" :disabled="currentStep !== 0 || operationType === 'view'" |
| | | size="small"></el-input> |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="工作目标:" prop="jobObjective"> |
| | | <el-input v-model="form.jobObjective" :disabled="currentStep !== 0 || operationType === 'view'" |
| | | size="small" |
| | | type="textarea"></el-input> |
| | | size="small" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="岗位职责:" prop="jobResponsibilities"> |
| | | <el-input v-model="form.jobResponsibilities" :disabled="currentStep !== 0 || operationType === 'view'" |
| | | size="small" |
| | | type="textarea"></el-input> |
| | | size="small" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="currentStep === 0 || operationType === 'view'" :span="12"> |
| | | <el-form-item |
| | | :rules="[{ required: currentStep === 0, message: '请选择任职人', trigger: 'change' }]" |
| | | label="任职人:" |
| | | prop="incumbentId"> |
| | | <el-select v-model="form.incumbentId" :disabled="operationType === 'view'" clearable |
| | | filterable |
| | | placeholder="请选择任职人" size="small" style="width: 100%;"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: '请选择任职人', trigger: 'change' }]" |
| | | label="任职人:" prop="incumbentId"> |
| | | <el-select v-model="form.incumbentId" :disabled="operationType === 'view'" clearable filterable |
| | | placeholder="请选择任职人" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="currentStep === 1 || operationType === 'view'" :span="12"> |
| | | <el-form-item |
| | | :rules="[{ required: currentStep === 1, message: '请选择主管', trigger: 'blur' }]" |
| | | label="主管:" |
| | | <el-form-item :rules="[{ required: currentStep === 1, message: '请选择主管', trigger: 'blur' }]" label="主管:" |
| | | prop="supervisorId"> |
| | | <el-select v-model="form.supervisorId" :disabled="currentStep !== 1 || operationType === 'view'" |
| | | clearable filterable |
| | | placeholder="请选择主管" size="small" style="width: 100%;"> |
| | | clearable filterable placeholder="请选择主管" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button v-if="currentStep !== 0 && currentStep !== 3" @click="submitForm('3reject')">驳回</el-button> |
| | | <el-button v-if="currentStep === 0" @click="submitForm('2save')">保存</el-button> |
| | | <el-button v-if="currentStep !== 3" type="primary" |
| | | @click="submitForm('1submit')">{{ currentStep === 0 ? '提交' : '通过' }}</el-button> |
| | | <el-button v-if="currentStep !== 3" type="primary" @click="submitForm('1submit')">{{ currentStep === 0 ? '提交' : |
| | | '通过' |
| | | }}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | personJobResponsibilitiesSave, |
| | | personJobResponsibilitiesSelect |
| | | } from "@/api/cnas/personal/personJobResponsibilities"; |
| | | import {selectUserCondition} from "@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment"; |
| | | import {mapGetters} from "vuex"; |
| | | import { selectUserCondition } from "@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment"; |
| | | import { mapGetters } from "vuex"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | departmentId: this.search.userId, |
| | | size: this.search.size, |
| | | current: this.search.current, |
| | | }: { |
| | | } : { |
| | | userName: this.userName, |
| | | userId: this.search.userId, |
| | | size: this.search.size, |
| | |
| | | }, |
| | | // 下载岗位职责 |
| | | downLoadPost(row) { |
| | | exportPersonJobResponsibilities({id:row.id}).then(res => { |
| | | const blob = new Blob([res],{ type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, row.incumbentName+'-岗位职责'+'.docx'); |
| | | this.$message.success('导出成功') |
| | | exportPersonJobResponsibilities({ id: row.id }).then(res => { |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, row.incumbentName + '-岗位职责' + '.docx'); |
| | | }) |
| | | }, |
| | | // 删除岗位职责 |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | personJobResponsibilitiesDelete({id: row.id}).then(res => { |
| | | personJobResponsibilitiesDelete({ id: row.id }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('删除成功'); |
| | | this.getPostList(this.departId); |
| | |
| | | }, |
| | | // 获取负责人信息接口 |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | selectUserCondition({type: 2}).then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | </style> |
| | | <style scoped></style> |