| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢é¨é¨å表 |
| | | export function listConfig(query) { |
| | | return request({ |
| | | url: '/staffCompetencyInspectItemConfig/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢é¨é¨åè¡¨ï¼æé¤èç¹ï¼ |
| | | export function listConfigExcludeChild(configId) { |
| | | return request({ |
| | | url: '/staffCompetencyInspectItemConfig/list/exclude/' + configId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢é¨é¨è¯¦ç» |
| | | export function getConfig(configId) { |
| | | return request({ |
| | | url: '/staffCompetencyInspectItemConfig/' + configId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢é¨é¨ |
| | | export function addConfig(data) { |
| | | return request({ |
| | | url: '/staffCompetencyInspectItemConfig', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹é¨é¨ |
| | | export function updateConfig(data) { |
| | | return request({ |
| | | url: '/staffCompetencyInspectItemConfig', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤é¨é¨ |
| | | export function delConfig(configId) { |
| | | return request({ |
| | | url: '/staffCompetencyInspectItemConfig/' + configId, |
| | | method: 'delete' |
| | | }) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // è·åç¨æ·ç级è¯å®å表 |
| | | export function getPageList(query) { |
| | | return request({ |
| | | url: '/StaffCompetencyLevelEvaluateRecord/getPageList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹ç¨æ·ç级 |
| | | export function changeLevel(data) { |
| | | return request({ |
| | | url: '/StaffCompetencyLevelEvaluateRecord/changeLevel', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 导åºäººåè½åå表 |
| | | export function exportRecords(data) { |
| | | return request({ |
| | | url: '/StaffCompetencyLevelEvaluateRecord/exportRecords', |
| | | method: 'get', |
| | | params: data, |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | |
| | | // æªè®¾ç½®ç¶æç åé»è®¤æåç¶æ |
| | | const code = res.data.code || 200; |
| | | // è·åéè¯¯ä¿¡æ¯ |
| | | const msg = errorCode[code] || res.data.msg || errorCode["default"]; |
| | | const msg = res.data.message || res.data.msg || errorCode[code] || errorCode["default"]; |
| | | // äºè¿å¶æ°æ®åç´æ¥è¿å |
| | | if ( |
| | | res.request.responseType === "blob" || |
| | |
| | | changeEnableReport(data).then(res=>{ |
| | | if(res.code===200){ |
| | | this.$message.success("æä½æå") |
| | | this.refreshTable() |
| | | this.$emit("changeEnable") |
| | | } |
| | | }) |
| | | }, |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="swingDate" label="è夿¶é´" min-width="150" width="150"></el-table-column> |
| | | <el-table-column label="ç¾å
¥/ç¾åºæ
åµ"> |
| | | <el-table-column prop="workDateTime" label="ä¸çæ¶é´" min-width="160" width="160"> |
| | | <el-table-column prop="workDateTime" label="ä¸çæ¶é´" min-width="160" > |
| | | <template slot-scope="scope"> |
| | | <el-tag type="success" v-if="scope.row.workDateTime && scope.row.workClockInState===1">{{ scope.row.workDateTime }}</el-tag> |
| | | <el-tag type="danger" v-else-if="scope.row.workDateTime && scope.row.workClockInState===0">{{ scope.row.workDateTime }}</el-tag> |
| | | <span v-else>{{ scope.row.workDateTime }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="offWorkDateTime" label="ä¸çæ¶é´" min-width="160" width="160"> |
| | | <el-table-column prop="offWorkDateTime" label="ä¸çæ¶é´" min-width="160" > |
| | | <template slot-scope="scope"> |
| | | <el-tag type="success" v-if="scope.row.offWorkDateTime && scope.row.offClockInState===1">{{ scope.row.offWorkDateTime }}</el-tag> |
| | | <el-tag type="danger" v-else-if="scope.row.offWorkDateTime && scope.row.offClockInState===0">{{ scope.row.offWorkDateTime }}</el-tag> |
| | |
| | | </el-table-column> |
| | | </el-table-column> |
| | | <el-table-column label="è夿¶é¿(h)"> |
| | | <el-table-column prop="plannedWorkHours" label="åºå¤æ¶é¿" min-width="80" width="80"></el-table-column> |
| | | <el-table-column prop="actualWorkHours" label="å®é
æ¶é¿" min-width="80" width="80"></el-table-column> |
| | | <el-table-column prop="absenceWorkHours" label="ç¼ºå¤æ¶é¿" min-width="80" width="80"></el-table-column> |
| | | <el-table-column prop="plannedWorkHours" label="åºå¤æ¶é¿" min-width="100" ></el-table-column> |
| | | <el-table-column prop="actualWorkHours" label="å®é
æ¶é¿" min-width="100"></el-table-column> |
| | | <el-table-column prop="absenceWorkHours" label="ç¼ºå¤æ¶é¿" min-width="100" ></el-table-column> |
| | | </el-table-column> |
| | | <el-table-column prop="isSync" label="æ°æ®æ¥æº" min-width="120"> |
| | | <el-table-column prop="isSync" label="æ°æ®æ¥æº" min-width="120" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.isSync===0" type="success">ICC忥</el-tag> |
| | | <el-tag v-else-if="scope.row.isSync===1" type="info">æå¨æ°å¢</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createUser" label="å建人" min-width="150" width="150" :formatter="(row)=>formatterUserName(row.createUser)"></el-table-column> |
| | | <el-table-column prop="createUser" label="å建人" min-width="120" width="120" :formatter="(row)=>formatterUserName(row.createUser)"></el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" min-width="180" width="180"></el-table-column> |
| | | <el-table-column prop="updateUser" label="æ´æ°äºº" min-width="150" width="150" :formatter="(row)=>formatterUserName(row.updateUser)"></el-table-column> |
| | | <el-table-column prop="updateUser" label="æ´æ°äºº" min-width="120" width="120" :formatter="(row)=>formatterUserName(row.updateUser)"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" min-width="180" width="180"></el-table-column> |
| | | <el-table-column fixed="right" width="180" label="æä½"> |
| | | <template slot-scope="scope"> |
| | |
| | | title="è¿åºè®°å½" |
| | | :visible.sync="dialogVisible" |
| | | width="60%"> |
| | | <staff-clock-in-record :key="Math.random()" :query-params="clockInQueryParams" ></staff-clock-in-record> |
| | | <staff-clock-in-record :query-params="clockInQueryParams" @changeEnable="refreshTable()"></staff-clock-in-record> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :title="attendanceForm.id?'ç¼è¾èå¤è®°å½':'æ°å¢èå¤è®°å½'" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- <el-form-item label="èå¤ç»æ" prop="result">--> |
| | | <!-- <el-select size="small" style="width:100%" clearable v-model="attendanceForm.result" placeholder="è¯·éæ©èå¤ç»æ">--> |
| | | <!-- <el-option v-for="(item,index) in resultList" :key="index" :label="item.label" :value="item.value"/>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider content-position="left">ç¾å
¥/ç¾åºæ
åµ</el-divider> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸çæ¶é´" prop="workTime"> |
| | | <el-form-item label="ä¸çæ¶é´" prop="workDateTime"> |
| | | <el-time-picker |
| | | style="width:100%" |
| | | value-format="HH:mm" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸çæ¶é´" prop="offWorkTime"> |
| | | <el-form-item label="ä¸çæ¶é´" prop="offWorkDateTime"> |
| | | <el-time-picker |
| | | style="width:100%" |
| | | value-format="HH:mm" |
| | |
| | | openAddAttendanceDialog(row){ |
| | | if(row){ |
| | | //å¤çä¸/ä¸çæ¶é´æ ¼å¼ |
| | | let workTime = row.workDateTime&&row.workDateTime.length>8?row.workDateTime.substring(11,16):row.workDateTime |
| | | let offWorkTime = row.offWorkDateTime&&row.offWorkDateTime.length>8?row.offWorkDateTime.substring(11,16):row.offWorkDateTime |
| | | row.workDateTime = workTime |
| | | row.offWorkDateTime = offWorkTime |
| | | this.attendanceForm = {...row} |
| | | let formData = {...row} |
| | | let workTime = formData.workDateTime&&formData.workDateTime.length>8?formData.workDateTime.substring(11,16):formData.workDateTime |
| | | let offWorkTime = formData.offWorkDateTime&&formData.offWorkDateTime.length>8?formData.offWorkDateTime.substring(11,16):formData.offWorkDateTime |
| | | formData.workDateTime = workTime |
| | | formData.offWorkDateTime = offWorkTime |
| | | this.attendanceForm = formData |
| | | } |
| | | this.addAttendanceVisible = true |
| | | }, |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" > |
| | | <el-form-item label="项ç¹åç§°" prop="itemName"> |
| | | <el-input v-model="queryParams.itemName" placeholder="请è¾å
¥é¡¹ç¹åç§°" clearable @keyup.enter.native="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="mini" @click="handleQuery">æ¥è¯¢</el-button> |
| | | <el-button size="mini" @click="resetQuery">éç½®</el-button> |
| | | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" >æ°å¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">å±å¼/æå </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table :height="tableHeight" v-if="refreshTable" v-loading="loading" :data="configList" row-key="id" |
| | | :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border |
| | | :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> |
| | | <el-table-column prop="itemName" label="项ç¹åç§°" width="260"></el-table-column> |
| | | <el-table-column prop="isEnable" label="ç¶æ" width="100" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.isEnable">å¯ç¨</el-tag> |
| | | <el-tag v-else type="info">ç¦ç¨</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">ä¿®æ¹</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)">æ°å¢</el-button> |
| | | <el-button v-if="!scope.row.children" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- æ·»å æä¿®æ¹æ£éªé¡¹ç¹å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="24" v-if="form.parentId > 0"> |
| | | <el-form-item label="ä¸çº§é¡¹ç¹" prop="parentId"> |
| | | <treeselect v-model="form.parentId" :options="configOptions" :normalizer="normalizer" |
| | | placeholder="éæ©ä¸çº§é¡¹ç¹" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç¹åç§°" prop="itemName"> |
| | | <el-input v-model="form.itemName" placeholder="请è¾å
¥é¡¹ç¹åç§°" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¾ç¤ºæåº" prop="sort"> |
| | | <el-input-number v-model="form.sort" controls-position="right" :min="0" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯å¦å¯ç¨" prop="isEnable"> |
| | | <el-switch v-model="form.isEnable"></el-switch> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listConfig, getConfig, delConfig, addConfig, updateConfig, listConfigExcludeChild } from "@/api/performance/staffCompetencyInspectItemConfig"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | |
| | | export default { |
| | | name: "StaffCompetencyInspectItemConfig", |
| | | components: { Treeselect }, |
| | | data() { |
| | | return { |
| | | //è¡¨æ ¼é«åº¦ |
| | | tableHeight:0, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // è¡¨æ ¼æ æ°æ® |
| | | configList: [], |
| | | // é¨é¨æ é项 |
| | | configOptions: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¯å¦å±å¼ï¼é»è®¤å
¨é¨å±å¼ |
| | | isExpandAll: true, |
| | | // éæ°æ¸²æè¡¨æ ¼ç¶æ |
| | | refreshTable: true, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | itemName: undefined |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | itemName: [ |
| | | { required: true, message: "项ç¹åç§°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | sort: [ |
| | | { required: true, message: "æ¾ç¤ºæåºä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.calcTableHeight() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.calcTableHeight); |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.calcTableHeight); |
| | | }, |
| | | methods: { |
| | | calcTableHeight(){ |
| | | const innerHeight = window.innerHeight |
| | | const outerHeight = 36 + 51 + 97 + 20 |
| | | this.tableHeight = innerHeight - outerHeight |
| | | }, |
| | | /** æ¥è¯¢æ£éªé¡¹ç¹å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listConfig(this.queryParams).then(response => { |
| | | this.configList = this.handleTree(response.data, "id"); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** è½¬æ¢æ£éªé¡¹ç¹æ°æ®ç»æ */ |
| | | normalizer(node) { |
| | | if (node.children && !node.children.length) { |
| | | delete node.children; |
| | | } |
| | | return { |
| | | id: node.id, |
| | | label: node.itemName, |
| | | children: node.children |
| | | }; |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: undefined, |
| | | parentId: undefined, |
| | | itemName: undefined, |
| | | sort: undefined, |
| | | isEnable: true |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd(row) { |
| | | this.reset(); |
| | | if (row != undefined) { |
| | | this.form.parentId = row.id; |
| | | } |
| | | this.open = true; |
| | | this.title = "æ·»å æ£éªé¡¹ç¹"; |
| | | listConfig().then(response => { |
| | | this.configOptions = this.handleTree(response.data, "id"); |
| | | this.configOptions = this.limitTreeDepth(this.configOptions, 2) |
| | | }); |
| | | }, |
| | | /** å±å¼/æå æä½ */ |
| | | toggleExpandAll() { |
| | | this.refreshTable = false; |
| | | this.isExpandAll = !this.isExpandAll; |
| | | this.$nextTick(() => { |
| | | this.refreshTable = true; |
| | | }); |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | getConfig(row.id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹æ£éªé¡¹ç¹"; |
| | | listConfigExcludeChild(row.id).then(response => { |
| | | this.configOptions = this.handleTree(response.data, "id"); |
| | | if (this.configOptions.length == 0) { |
| | | const noResultsOptions = { id: this.form.parentId, itemName: this.form.parentName, children: [] }; |
| | | this.configOptions.push(noResultsOptions); |
| | | } |
| | | this.configOptions = this.limitTreeDepth(this.configOptions, 2) |
| | | }); |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm: function () { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != undefined) { |
| | | updateConfig(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | this.$emit("refresh"); |
| | | }); |
| | | } else { |
| | | addConfig(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | this.$emit("refresh"); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.itemName + '"çæ°æ®é¡¹ï¼').then(function () { |
| | | return delConfig(row.id); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | this.$emit("refresh"); |
| | | }).catch(() => { }); |
| | | }, |
| | | // éå½å½æ°ï¼ç¨äºéå¶æ çæ·±åº¦ |
| | | limitTreeDepth(options, maxDepth, currentDepth = 1) { |
| | | return options.map(option => { |
| | | const newOption = { ...option }; |
| | | if (currentDepth < maxDepth && option.children) { |
| | | // 妿å½å深度å°äºæå¤§æ·±åº¦ä¸åå¨åèç¹ï¼åéå½å¤çåèç¹ |
| | | newOption.children = this.limitTreeDepth(option.children, maxDepth, currentDepth + 1); |
| | | } else { |
| | | // å¦åç§»é¤åèç¹ |
| | | delete newOption.children; |
| | | } |
| | | return newOption; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | | <el-form-item prop="keyword"> |
| | | <el-input |
| | | v-model="queryParams.keyword" |
| | | placeholder="工巿åå·¥åç§°" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item prop="postName"> |
| | | <el-select v-model="queryParams.postName" clearable placeholder="è¯·éæ©å²ä½" @change="handleQuery"> |
| | | <el-option |
| | | v-for="(post, index) in postList" |
| | | :key="index" |
| | | :label="post.postName" |
| | | :value="post.postName" |
| | | > |
| | | <span style="float: left">{{ post.postName }}</span> |
| | | <span style="float: right; color: #8492a6; font-size: 13px">{{ post.postCode }}</span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="mini" @click="handleQuery" |
| | | >æ¥è¯¢</el-button |
| | | > |
| | | <el-button plain size="mini" @click="resetQuery">éç½®</el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-setting" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | >æ£éªé¡¹é
ç½®</el-button |
| | | > |
| | | <el-button |
| | | type="success" |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | :loading="downloadLoading" |
| | | @click="downloadRecords()" |
| | | >导åº</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="recordList" |
| | | :height="tableHeight" |
| | | :cell-style="{ textAlign: 'center' }" |
| | | :header-cell-style="{ |
| | | background: '#f8f8f9', |
| | | color: '#515a6e', |
| | | textAlign: 'center', |
| | | }" |
| | | border |
| | | > |
| | | <el-table-column type="index" label="åºå·" width="80"></el-table-column> |
| | | <el-table-column |
| | | prop="userName" |
| | | label="人ååç§°" |
| | | min-width="120" |
| | | width="120" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="postName" |
| | | label="å²ä½" |
| | | min-width="120" |
| | | width="120" |
| | | ></el-table-column> |
| | | <!--卿å--> |
| | | <el-table-column v-for="(item, i) in tableHeaderList" :key="i" :prop="item.id + ''" :label="item.itemName"> |
| | | <el-table-column min-width="130" v-if="item.children" v-for="(children,k) in item.children" :key="k" :prop="children.id + ''" :label="children.itemName"> |
| | | <template slot-scope="scope"> |
| | | <el-select size="small" v-model="scope.row[children.id].level" clearable @change="changeSkillLevel(scope.row, children.id)"> |
| | | <el-option v-for="(dict,j) in levelDictList" :label="dict.dictLabel" :value="dict.dictValue" :key="j"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-drawer title="æ£éªé¡¹é
ç½®" :visible.sync="open"> |
| | | <ItemConfig @refresh="handleQuery()"></ItemConfig> |
| | | </el-drawer> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {transformExcel} from '@/utils/file' |
| | | import { listConfig } from "@/api/performance/staffCompetencyInspectItemConfig"; |
| | | import {optionSelect} from '@/api/system/post' |
| | | import { getPageList,changeLevel,exportRecords } from "@/api/performance/staffCompetencyLevelEvaluateRecord"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | import {getDicts} from "@/api/system/dict/data"; |
| | | import ItemConfig from "./components/config.vue"; |
| | | export default { |
| | | name: "Competency", |
| | | components: { |
| | | ItemConfig, |
| | | }, |
| | | data() { |
| | | return { |
| | | tableHeaderList: [], |
| | | // é®ç½©å± |
| | | loading: false, |
| | | // è¡¨æ ¼æ æ°æ® |
| | | recordList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¯å¦å±å¼ï¼é»è®¤å
¨é¨å±å¼ |
| | | isExpandAll: true, |
| | | // éæ°æ¸²æè¡¨æ ¼ç¶æ |
| | | refreshTable: true, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | keyword: undefined, |
| | | postName: undefined, |
| | | }, |
| | | //è½åç级åå
¸ |
| | | levelDictList:[], |
| | | tableHeight:0, |
| | | downloadLoading:false, |
| | | postList:[] |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getLevelDict() |
| | | this.getTableHeader(); |
| | | this.getList(); |
| | | this.getTableHeight() |
| | | this.getPostList() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener("resize", this.getTableHeight); |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener("resize", this.getTableHeight); |
| | | }, |
| | | methods: { |
| | | getPostList(){ |
| | | optionSelect().then(res=>{ |
| | | if(res.code===200){ |
| | | this.postList = res.data |
| | | } |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | downloadRecords(){ |
| | | this.downloadLoading = true |
| | | exportRecords(this.queryParams).then(res=>{ |
| | | transformExcel(res, "ä¸å¤©èä¸è´¨é鍿£éªåè½åç©éµå¾.xlsx") |
| | | this.$message.success("å¯¼åºæå") |
| | | this.$nextTick(()=>{ |
| | | this.downloadLoading = false |
| | | }) |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | getTableHeight() { |
| | | const innerHeight = window.innerHeight; |
| | | const otherHeight = 50+46+40+51; |
| | | this.tableHeight = innerHeight - otherHeight; |
| | | }, |
| | | changeSkillLevel(row, itemId){ |
| | | const configObj = {...row[itemId]} |
| | | let data = { |
| | | id:configObj.id, |
| | | level: configObj.level, |
| | | userId : row.userId, |
| | | itemConfigId : itemId |
| | | } |
| | | changeLevel(data).then(res=>{ |
| | | if(res.code===200){ |
| | | this.$message.success("ä¿®æ¹æå") |
| | | } |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | getLevelDict() { |
| | | getDicts("staff_level_type").then((response) => { |
| | | this.levelDictList = response.data; |
| | | }); |
| | | }, |
| | | getTableHeader() { |
| | | listConfig({ isEnable: true }).then((response) => { |
| | | this.tableHeaderList = this.handleTree(response.data, "id"); |
| | | }); |
| | | }, |
| | | /** æ¥è¯¢å表 */ |
| | | getList() { |
| | | this.loading = true |
| | | this.getTableHeader(); |
| | | getPageList(this.queryParams).then(res=>{ |
| | | if(res.code===200){ |
| | | this.recordList = res.data |
| | | } |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd(row) { |
| | | this.open = true; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |