32 changed files with 2870 additions and 224 deletions
@ -0,0 +1,208 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false" customClass="customWidth"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="部门名称" prop="deptId" label-width="120px"> |
|||
<el-cascader |
|||
ref="name" |
|||
v-model="dataForm.joinDeptIdsArr" |
|||
:options="options" |
|||
:props="{ multiple: false, emitPath: false, checkStrictly: true }" |
|||
@visible-change="changeHandle" |
|||
style="width:90%;" |
|||
:disabled="dataForm.id?true:false" |
|||
> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" prop="monthYear" label-width="120px"> |
|||
<el-date-picker v-model="dataForm.monthYear" :disabled="dataForm.id?true:false" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM" style="width:40%"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="民主协商机制" prop="democraticConsultationMechanism" label-width="120px"> |
|||
<el-input-number v-model="dataForm.democraticConsultationMechanism" :min="0" :max="3" label="民主协商机制分数" :precision="1" style="width:40%"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="居民公约制度" prop="residentConventionSystem" label-width="120px"> |
|||
<el-input-number v-model="dataForm.residentConventionSystem" :min="0" :max="3" label="居民公约制度分数" :precision="1" style="width:40%"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="网格协商案例" prop="gridNegotiationCase" label-width="120px"> |
|||
<el-input-number v-model="dataForm.gridNegotiationCase" :min="0" :max="4" label="网格协商案例分数" :precision="1" style="width:40%"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
deptId: '', |
|||
deptName: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
democraticConsultationMechanism: '', |
|||
residentConventionSystem: '', |
|||
gridNegotiationCase: '', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
delFlag: '', |
|||
joinDeptIdsArr: '' |
|||
}, |
|||
options: [], |
|||
isAble: false |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
deptId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptTypeKey: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
monthYear: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
democraticConsultationMechanism: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
residentConventionSystem: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
gridNegotiationCase: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
joinDeptIdsArr: [ |
|||
{ required: false, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
} |
|||
}) |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
changeHandle (value, selectedData) { |
|||
let parentDeptIds = '' |
|||
let parentDeptNames = '' |
|||
let allDeptIds = '' |
|||
let allDeptNames = '' |
|||
let deptId = '' |
|||
let deptName = '' |
|||
if (this.$refs['name'].getCheckedNodes() !== null && this.$refs['name'].getCheckedNodes().length > 0) { |
|||
var path = this.$refs['name'].getCheckedNodes()[0].path |
|||
var pathLabels = this.$refs['name'].getCheckedNodes()[0].pathLabels |
|||
for (var i = 0; i < path.length; i++) { |
|||
if (i < path.length - 1) { |
|||
parentDeptIds += path[i] + ',' |
|||
} else { |
|||
deptId = path[i] |
|||
} |
|||
allDeptIds += path[i] + ',' |
|||
} |
|||
for (var j = 0; j < pathLabels.length; j++) { |
|||
if (j < pathLabels.length - 1) { |
|||
parentDeptNames += pathLabels[j] + '-' |
|||
} else { |
|||
deptName = pathLabels[j] |
|||
} |
|||
allDeptNames += pathLabels[j] + '-' |
|||
} |
|||
} |
|||
this.dataForm.parentDeptIds = parentDeptIds.length > 0 ? parentDeptIds.substring(0, parentDeptIds.length - 1) : parentDeptIds |
|||
this.dataForm.parentDeptNames = parentDeptNames.length > 0 ? parentDeptNames.substring(0, parentDeptNames.length - 1) : parentDeptNames |
|||
this.dataForm.allDeptIds = allDeptIds.length > 0 ? allDeptIds.substring(0, allDeptIds.length - 1) : allDeptIds |
|||
this.dataForm.allDeptNames = allDeptNames.length > 0 ? allDeptNames.substring(0, allDeptNames.length - 1) : allDeptNames |
|||
this.dataForm.deptId = deptId |
|||
this.dataForm.deptName = deptName |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/kpi/kpicommunitybuilding/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.joinDeptIdsArr = this.dataForm.deptId |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/kpi/kpicommunitybuilding/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss"> |
|||
.customWidth { |
|||
width:50% |
|||
} |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-kpi__kpicommunitybuilding}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()"> |
|||
<el-form-item> |
|||
<el-form-item label="部门" label-width="90px"> |
|||
<el-cascader |
|||
v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
filterable |
|||
clearable |
|||
></el-cascader> |
|||
</el-form-item> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" label-width="70px"> |
|||
<el-date-picker v-model="dataForm.monthYear" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<br> |
|||
<el-form-item label="部门类型" prop="deptTypeKey" label-width="90px"> |
|||
<el-select v-model="dataForm.deptTypeKey" placeholder="部门类型" clearable> |
|||
<el-option v-for="item in paramNameArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" ></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="exportTemplate()">导出录入模板</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-upload class="upload-demo" |
|||
ref="upload" |
|||
v-loading="dataListLoading" |
|||
:action="uploadUrl" |
|||
:limit="1" |
|||
:on-success='uploadSuccess' |
|||
:on-error='errorExceed' |
|||
accept=".xls,.xlsx"> |
|||
<el-button type="primary">导入打分结果</el-button> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('kpi:kpicommunitybuilding:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" header-align="center" align="center" width="50px"> |
|||
<template slot-scope="scope"> |
|||
{{scope.$index+1}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="deptName" label="部门" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="deptTypeKey" label="部门类型" header-align="center" align="center" :formatter = "stateFormat" width="120"></el-table-column> |
|||
<el-table-column prop="monthYear" label="年月" header-align="center" align="center" width="180"></el-table-column> |
|||
<el-table-column prop="democraticConsultationMechanism" label="民主协商机制分数" header-align="center" align="center" width="140"></el-table-column> |
|||
<el-table-column prop="residentConventionSystem" label="居民公约制度分数" header-align="center" align="center" width="140"></el-table-column> |
|||
<el-table-column prop="gridNegotiationCase" label="网格协商案例分数" header-align="center" align="center" width="140"></el-table-column> |
|||
<el-table-column prop="parentDeptNames" label="上级部门" header-align="center" align="center" min-width="120" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="allDeptNames" label="所有部门" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button v-if="$hasPermission('kpi:kpicommunitybuilding:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './kpicommunitybuilding-add-or-update' |
|||
import Cookies from 'js-cookie' |
|||
import qs from 'qs' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/kpi/kpicommunitybuilding/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/kpi/kpicommunitybuilding', |
|||
deleteIsBatch: true, |
|||
exportTemplateURL: '/kpi/kpicommunitybuilding/exportTemplate' |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
deptId: '' |
|||
}, |
|||
// 所属机构配置 |
|||
deptIdList: [], |
|||
options: [], |
|||
paramNameArr: [] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length === 0) { |
|||
this.dataForm.deptId = '' |
|||
} else if (val.length > 0) { |
|||
this.dataForm.deptId = this.deptIdList[val.length - 1] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getParamListInfo('dept_type') |
|||
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/kpi/kpicommunitybuilding/importManualScoreExcel?token=${Cookies.get('token')}` |
|||
}, |
|||
methods: { |
|||
stateFormat (row, column) { |
|||
for (var i = 0; i < this.paramNameArr.length; i++) { |
|||
if (row.deptTypeKey === this.paramNameArr[i].dictValue) { |
|||
return this.paramNameArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getParamListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'dept_type') { |
|||
this.paramNameArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
exportTemplate () { |
|||
let remindInfo = '' |
|||
let monthYear = this.dataForm.monthYear |
|||
let deptTypeKey = this.dataForm.deptTypeKey |
|||
let deptId = this.dataForm.deptId |
|||
if (!deptId) { |
|||
remindInfo += '部门、' |
|||
} |
|||
if (!monthYear) { |
|||
remindInfo += '考核周期起始月、' |
|||
} |
|||
if (!deptTypeKey) { |
|||
remindInfo += '部门类型、' |
|||
} |
|||
if (remindInfo.length > 0) { |
|||
remindInfo = remindInfo.substring(0, remindInfo.length - 1) |
|||
return this.$message.error(remindInfo + '不能为空!') |
|||
} |
|||
let params = qs.stringify({ |
|||
'token': Cookies.get('token'), |
|||
'monthYear': monthYear, |
|||
'deptTypeKey': deptTypeKey, |
|||
'deptId': deptId |
|||
}) |
|||
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportTemplateURL}?${params}` |
|||
}, |
|||
errorExceed (file, fileList) { |
|||
this.$message.error('上传失败请重试') |
|||
}, |
|||
uploadSuccess (response, file, fileList) { |
|||
this.dataListLoading = false |
|||
this.$refs.upload.clearFiles() |
|||
if (response.code !== 0 || (response.data !== null && response.data.length > 0)) { |
|||
this.errordataList = response.data |
|||
if (this.errordataList != null && this.errordataList.length > 0) { |
|||
this.faultDataVisible = true |
|||
} else { |
|||
this.$message.error(response.msg) |
|||
} |
|||
return |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.deptIdList = '' |
|||
this.dataForm.deptId = '' |
|||
this.getDataList() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,246 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false" customClass="customWidth"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="部门名称" prop="deptId" label-width="120px"> |
|||
<el-cascader |
|||
ref="name" |
|||
v-model="dataForm.joinDeptIdsArr" |
|||
:options="options" |
|||
:props="{ multiple: false, emitPath: false, checkStrictly: true }" |
|||
@visible-change="changeHandle" |
|||
style="width:90%;" |
|||
:disabled="dataForm.id?true:false" |
|||
> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" prop="monthYear" label-width="120px"> |
|||
<el-date-picker v-model="dataForm.monthYear" :disabled="dataForm.id?true:false" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM" style="width:40%;"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="边界分数" prop="stationEstablishmentBorder" label-width="120px"> |
|||
<el-input-number v-model="dataForm.stationEstablishmentBorder" :min="0" :max="1" label="边界分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="布局分数" prop="stationEstablishmentLayout" label-width="120px"> |
|||
<el-input-number v-model="dataForm.stationEstablishmentLayout" :min="0" :max="2" label="布局分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="标准分数" prop="stationEstablishmentStandard" label-width="120px"> |
|||
<el-input-number v-model="dataForm.stationEstablishmentStandard" :min="0" :max="1" label="标准分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="工作人员分数" prop="staffingPlacementOfficer" label-width="120px"> |
|||
<el-input-number v-model="dataForm.staffingPlacementOfficer" :min="0" :max="1" label="工作人员分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="信息采集分数" prop="staffingPlacementInformation" label-width="120px"> |
|||
<el-input-number v-model="dataForm.staffingPlacementInformation" :min="0" :max="1" label="信息采集分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="人才储备分数" prop="staffingPlacementPersonnel" label-width="120px"> |
|||
<el-input-number v-model="dataForm.staffingPlacementPersonnel" :min="0" :max="1" label="人才储备分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="工作计划分数" prop="gridOperationWorkplan" label-width="120px"> |
|||
<el-input-number v-model="dataForm.gridOperationWorkplan" :min="0" :max="1" label="工作计划分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="运行机制分数" prop="gridOperationOperational" label-width="120px"> |
|||
<el-input-number v-model="dataForm.gridOperationOperational" :min="0" :max="2" label="运行机制分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
deptId: '', |
|||
deptName: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
stationEstablishment: '', |
|||
stationEstablishmentBorder: '', |
|||
stationEstablishmentLayout: '', |
|||
stationEstablishmentStandard: '', |
|||
staffingPlacement: '', |
|||
staffingPlacementOfficer: '', |
|||
staffingPlacementInformation: '', |
|||
staffingPlacementPersonnel: '', |
|||
gridOperation: '', |
|||
gridOperationWorkplan: '', |
|||
gridOperationOperational: '', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
delFlag: '', |
|||
joinDeptIdsArr: '' |
|||
}, |
|||
options: [], |
|||
isAble: false |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
deptId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptTypeKey: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
monthYear: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
stationEstablishmentBorder: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
stationEstablishmentLayout: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
stationEstablishmentStandard: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
staffingPlacementOfficer: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
staffingPlacementInformation: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
staffingPlacementPersonnel: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
gridOperationWorkplan: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
gridOperationOperational: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
joinDeptIdsArr: [ |
|||
{ required: false, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
} |
|||
}) |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
changeHandle (value, selectedData) { |
|||
let parentDeptIds = '' |
|||
let parentDeptNames = '' |
|||
let allDeptIds = '' |
|||
let allDeptNames = '' |
|||
let deptId = '' |
|||
let deptName = '' |
|||
if (this.$refs['name'].getCheckedNodes() !== null && this.$refs['name'].getCheckedNodes().length > 0) { |
|||
var path = this.$refs['name'].getCheckedNodes()[0].path |
|||
var pathLabels = this.$refs['name'].getCheckedNodes()[0].pathLabels |
|||
for (var i = 0; i < path.length; i++) { |
|||
if (i < path.length - 1) { |
|||
parentDeptIds += path[i] + ',' |
|||
} else { |
|||
deptId = path[i] |
|||
} |
|||
allDeptIds += path[i] + ',' |
|||
} |
|||
for (var j = 0; j < pathLabels.length; j++) { |
|||
if (j < pathLabels.length - 1) { |
|||
parentDeptNames += pathLabels[j] + '-' |
|||
} else { |
|||
deptName = pathLabels[j] |
|||
} |
|||
allDeptNames += pathLabels[j] + '-' |
|||
} |
|||
} |
|||
this.dataForm.parentDeptIds = parentDeptIds.length > 0 ? parentDeptIds.substring(0, parentDeptIds.length - 1) : parentDeptIds |
|||
this.dataForm.parentDeptNames = parentDeptNames.length > 0 ? parentDeptNames.substring(0, parentDeptNames.length - 1) : parentDeptNames |
|||
this.dataForm.allDeptIds = allDeptIds.length > 0 ? allDeptIds.substring(0, allDeptIds.length - 1) : allDeptIds |
|||
this.dataForm.allDeptNames = allDeptNames.length > 0 ? allDeptNames.substring(0, allDeptNames.length - 1) : allDeptNames |
|||
this.dataForm.deptId = deptId |
|||
this.dataForm.deptName = deptName |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/kpi/kpigridentity/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.joinDeptIdsArr = this.dataForm.deptId |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/kpi/kpigridentity/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss"> |
|||
.customWidth { |
|||
width:50% |
|||
} |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-kpi__kpigridentity}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()"> |
|||
<el-form-item> |
|||
<el-form-item label="部门" label-width="90px"> |
|||
<el-cascader |
|||
v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
filterable |
|||
clearable |
|||
></el-cascader> |
|||
</el-form-item> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" label-width="70px"> |
|||
<el-date-picker v-model="dataForm.monthYear" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<br> |
|||
<el-form-item label="部门类型" prop="deptTypeKey" label-width="90px"> |
|||
<el-select v-model="dataForm.deptTypeKey" placeholder="部门类型" clearable> |
|||
<el-option v-for="item in paramNameArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" ></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="exportTemplate()">导出录入模板</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-upload class="upload-demo" |
|||
ref="upload" |
|||
v-loading="dataListLoading" |
|||
:action="uploadUrl" |
|||
:limit="1" |
|||
:on-success='uploadSuccess' |
|||
:on-error='errorExceed' |
|||
accept=".xls,.xlsx"> |
|||
<el-button type="primary">导入打分结果</el-button> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('kpi:kpigridentity:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" header-align="center" align="center" width="50px"> |
|||
<template slot-scope="scope"> |
|||
{{scope.$index+1}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="monthYear" label="年月" header-align="center" align="center" width="180"></el-table-column> |
|||
<el-table-column prop="deptTypeKey" label="部门类型" header-align="center" align="center" :formatter = "stateFormat" width="120"></el-table-column> |
|||
<el-table-column prop="stationEstablishment" label="建站达标分数" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="staffingPlacement" label="人员配备分数" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="gridOperation" label="网格运行分数" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="parentDeptNames" label="上级部门" header-align="center" align="center" min-width="120" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="allDeptNames" label="所有部门" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button v-if="$hasPermission('kpi:kpigridentity:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './kpigridentity-add-or-update' |
|||
import Cookies from 'js-cookie' |
|||
import qs from 'qs' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/kpi/kpigridentity/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/kpi/kpigridentity', |
|||
deleteIsBatch: true, |
|||
exportTemplateURL: '/kpi/kpigridentity/exportTemplate' |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
deptId: '' |
|||
}, |
|||
// 所属机构配置 |
|||
deptIdList: [], |
|||
options: [], |
|||
paramNameArr: [] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length === 0) { |
|||
this.dataForm.deptId = '' |
|||
} else if (val.length > 0) { |
|||
this.dataForm.deptId = this.deptIdList[val.length - 1] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getParamListInfo('dept_type') |
|||
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/kpi/kpigridentity/importManualScoreExcel?token=${Cookies.get('token')}` |
|||
}, |
|||
methods: { |
|||
stateFormat (row, column) { |
|||
for (var i = 0; i < this.paramNameArr.length; i++) { |
|||
if (row.deptTypeKey === this.paramNameArr[i].dictValue) { |
|||
return this.paramNameArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getParamListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'dept_type') { |
|||
this.paramNameArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
exportTemplate () { |
|||
let remindInfo = '' |
|||
let monthYear = this.dataForm.monthYear |
|||
let deptTypeKey = this.dataForm.deptTypeKey |
|||
let deptId = this.dataForm.deptId |
|||
if (!deptId) { |
|||
remindInfo += '部门、' |
|||
} |
|||
if (!monthYear) { |
|||
remindInfo += '考核周期起始月、' |
|||
} |
|||
if (!deptTypeKey) { |
|||
remindInfo += '部门类型、' |
|||
} |
|||
if (remindInfo.length > 0) { |
|||
remindInfo = remindInfo.substring(0, remindInfo.length - 1) |
|||
return this.$message.error(remindInfo + '不能为空!') |
|||
} |
|||
let params = qs.stringify({ |
|||
'token': Cookies.get('token'), |
|||
'monthYear': monthYear, |
|||
'deptTypeKey': deptTypeKey, |
|||
'deptId': deptId |
|||
}) |
|||
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportTemplateURL}?${params}` |
|||
}, |
|||
errorExceed (file, fileList) { |
|||
this.$message.error('上传失败请重试') |
|||
}, |
|||
uploadSuccess (response, file, fileList) { |
|||
this.dataListLoading = false |
|||
this.$refs.upload.clearFiles() |
|||
if (response.code !== 0 || (response.data !== null && response.data.length > 0)) { |
|||
this.errordataList = response.data |
|||
if (this.errordataList != null && this.errordataList.length > 0) { |
|||
this.faultDataVisible = true |
|||
} else { |
|||
this.$message.error(response.msg) |
|||
} |
|||
return |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.deptIdList = '' |
|||
this.dataForm.deptId = '' |
|||
this.getDataList() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,217 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false" customClass="customWidth"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="部门名称" prop="deptId" label-width="120px"> |
|||
<el-cascader |
|||
ref="name" |
|||
v-model="dataForm.joinDeptIdsArr" |
|||
:options="options" |
|||
:props="{ multiple: false, emitPath: false, checkStrictly: true }" |
|||
@visible-change="changeHandle" |
|||
style="width:90%;" |
|||
:disabled="dataForm.id?true:false" |
|||
> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="考核年份" prop="year" label-width="120px"> |
|||
<el-date-picker v-model="dataForm.year" :disabled="dataForm.id?true:false" |
|||
type="year" clearable placeholder="选择年" |
|||
value-format="yyyy" format="yyyy" style="width:45%;"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="满意" prop="satisfied" label-width="120px"> |
|||
<el-input-number v-model="dataForm.satisfied" :min="0" :max="20" label="满意分数" :precision="1" style="width:45%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="基本满意" prop="basicSatisfaction" label-width="120px"> |
|||
<el-input-number v-model="dataForm.basicSatisfaction" :min="0" :max="20" label="基本满意分数" :precision="1" style="width:45%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="不满意" prop="dissatisfied" label-width="120px"> |
|||
<el-input-number v-model="dataForm.dissatisfied" :min="0" :max="20" label="不满意分数" :precision="1" style="width:45%;"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
deptId: '', |
|||
deptName: '', |
|||
deptTypeKey: '', |
|||
year: '', |
|||
satisfied: '', |
|||
basicSatisfaction: '', |
|||
dissatisfied: '', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
delFlag: '', |
|||
joinDeptIdsArr: '' |
|||
}, |
|||
options: [], |
|||
isAble: false |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
deptId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptTypeKey: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
year: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
satisfied: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
basicSatisfaction: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
dissatisfied: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
joinDeptIdsArr: [ |
|||
{ required: false, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.getOptions() |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
} |
|||
}) |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
changeHandle (value, selectedData) { |
|||
let parentDeptIds = '' |
|||
let parentDeptNames = '' |
|||
let allDeptIds = '' |
|||
let allDeptNames = '' |
|||
let deptId = '' |
|||
let deptName = '' |
|||
if (this.$refs['name'].getCheckedNodes() !== null && this.$refs['name'].getCheckedNodes().length > 0) { |
|||
var path = this.$refs['name'].getCheckedNodes()[0].path |
|||
var pathLabels = this.$refs['name'].getCheckedNodes()[0].pathLabels |
|||
for (var i = 0; i < path.length; i++) { |
|||
if (i < path.length - 1) { |
|||
parentDeptIds += path[i] + ',' |
|||
} else { |
|||
deptId = path[i] |
|||
} |
|||
allDeptIds += path[i] + ',' |
|||
} |
|||
for (var j = 0; j < pathLabels.length; j++) { |
|||
if (j < pathLabels.length - 1) { |
|||
parentDeptNames += pathLabels[j] + '-' |
|||
} else { |
|||
deptName = pathLabels[j] |
|||
} |
|||
allDeptNames += pathLabels[j] + '-' |
|||
} |
|||
} |
|||
this.dataForm.parentDeptIds = parentDeptIds.length > 0 ? parentDeptIds.substring(0, parentDeptIds.length - 1) : parentDeptIds |
|||
this.dataForm.parentDeptNames = parentDeptNames.length > 0 ? parentDeptNames.substring(0, parentDeptNames.length - 1) : parentDeptNames |
|||
this.dataForm.allDeptIds = allDeptIds.length > 0 ? allDeptIds.substring(0, allDeptIds.length - 1) : allDeptIds |
|||
this.dataForm.allDeptNames = allDeptNames.length > 0 ? allDeptNames.substring(0, allDeptNames.length - 1) : allDeptNames |
|||
this.dataForm.deptId = deptId |
|||
this.dataForm.deptName = deptName |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/kpi/kpimassevaluation/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.joinDeptIdsArr = this.dataForm.deptId |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
// 校验分数是否总计未超过20 |
|||
let satisfied = this.dataForm.satisfied |
|||
let basicSatisfaction = this.dataForm.basicSatisfaction |
|||
let dissatisfied = this.dataForm.dissatisfied |
|||
if ((satisfied + basicSatisfaction + dissatisfied) > 20) { |
|||
return this.$message.error('评价分数总和不能超过20分!') |
|||
} |
|||
this.isAble = true |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/kpi/kpimassevaluation/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss"> |
|||
.customWidth { |
|||
width:35% |
|||
} |
|||
</style> |
|||
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-kpi__kpimassevaluation}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()"> |
|||
<el-form-item> |
|||
<el-form-item label="部门" label-width="68px"> |
|||
<el-cascader |
|||
v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
filterable |
|||
clearable |
|||
></el-cascader> |
|||
</el-form-item> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月"> |
|||
<el-date-picker v-model="dataForm.year" |
|||
type="year" clearable placeholder="选择年" |
|||
value-format="yyyy" format="yyyy"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<br/> |
|||
<el-form-item label="部门类型" prop="deptTypeKey"> |
|||
<el-select v-model="dataForm.deptTypeKey" placeholder="部门类型" clearable> |
|||
<el-option v-for="item in paramNameArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" ></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="getDataListSearch()" type="success">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="exportTemplate()">导出录入模板</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-upload class="upload-demo" |
|||
ref="upload" |
|||
v-loading="dataListLoading" |
|||
:action="uploadUrl" |
|||
:limit="1" |
|||
:on-success='uploadSuccess' |
|||
:on-error='errorExceed' |
|||
accept=".xls,.xlsx"> |
|||
<el-button type="primary">导入打分结果</el-button> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('kpi:kpimassevaluation:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" header-align="center" align="center" width="50px"> |
|||
<template slot-scope="scope"> |
|||
{{scope.$index+1}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="deptTypeKey" label="部门类型" header-align="center" align="center" :formatter = "stateFormat"></el-table-column> |
|||
<el-table-column prop="year" label="年份" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="satisfied" label="满意分数" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="basicSatisfaction" label="基本满意分数" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="dissatisfied" label="不满意分数" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="parentDeptNames" label="上级部门" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="allDeptNames" label="所有部门" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button v-if="$hasPermission('kpi:kpimassevaluation:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './kpimassevaluation-add-or-update' |
|||
import Cookies from 'js-cookie' |
|||
import qs from 'qs' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/kpi/kpimassevaluation/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/kpi/kpimassevaluation', |
|||
deleteIsBatch: true, |
|||
exportTemplateURL: '/kpi/kpimassevaluation/exportTemplate' |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
deptTypeKey: '', |
|||
year: '', |
|||
deptId: '' |
|||
}, |
|||
// 所属机构配置 |
|||
deptIdList: [], |
|||
options: [], |
|||
paramNameArr: [] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length === 0) { |
|||
this.dataForm.deptId = '' |
|||
} else if (val.length > 0) { |
|||
this.dataForm.deptId = this.deptIdList[val.length - 1] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getParamListInfo('dept_type') |
|||
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/kpi/kpimassevaluation/importManualScoreExcel?token=${Cookies.get('token')}` |
|||
}, |
|||
methods: { |
|||
getDataListNew () { |
|||
this.page = 1 |
|||
this.getDataList() |
|||
}, |
|||
stateFormat (row, column) { |
|||
for (var i = 0; i < this.paramNameArr.length; i++) { |
|||
if (row.deptTypeKey === this.paramNameArr[i].dictValue) { |
|||
return this.paramNameArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getParamListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'dept_type') { |
|||
this.paramNameArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
exportTemplate () { |
|||
let remindInfo = '' |
|||
let year = this.dataForm.year |
|||
let deptTypeKey = this.dataForm.deptTypeKey |
|||
let deptId = this.dataForm.deptId |
|||
if (!deptId) { |
|||
remindInfo += '部门、' |
|||
} |
|||
if (!year) { |
|||
remindInfo += '考核周期起始年、' |
|||
} |
|||
if (!deptTypeKey) { |
|||
remindInfo += '部门类型、' |
|||
} |
|||
if (remindInfo.length > 0) { |
|||
remindInfo = remindInfo.substring(0, remindInfo.length - 1) |
|||
return this.$message.error(remindInfo + '不能为空!') |
|||
} |
|||
let params = qs.stringify({ |
|||
'token': Cookies.get('token'), |
|||
'year': year, |
|||
'deptTypeKey': deptTypeKey, |
|||
'deptId': deptId |
|||
}) |
|||
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportTemplateURL}?${params}` |
|||
}, |
|||
errorExceed (file, fileList) { |
|||
this.$message.error('上传失败请重试') |
|||
}, |
|||
uploadSuccess (response, file, fileList) { |
|||
this.dataListLoading = false |
|||
this.$refs.upload.clearFiles() |
|||
if (response.code !== 0 || (response.data !== null && response.data.length > 0)) { |
|||
this.errordataList = response.data |
|||
if (this.errordataList != null && this.errordataList.length > 0) { |
|||
this.faultDataVisible = true |
|||
} else { |
|||
this.$message.error(response.msg) |
|||
} |
|||
return |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.deptIdList = '' |
|||
this.dataForm.deptId = '' |
|||
this.getDataList() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,217 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false" customClass="customWidth"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="部门名称" prop="deptId"> |
|||
<el-cascader |
|||
ref="name" |
|||
v-model="dataForm.joinDeptIdsArr" |
|||
:options="options" |
|||
:props="{ multiple: false, emitPath: false, checkStrictly: true }" |
|||
@visible-change="changeHandle" |
|||
style="width:90%;" |
|||
:disabled="dataForm.id?true:false" |
|||
> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" prop="monthYear"> |
|||
<el-date-picker v-model="dataForm.monthYear" :disabled="dataForm.id?true:false" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM" style="width:40%;"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="扣分类别" prop="deductionCategory"> |
|||
<el-select v-model="dataForm.deductionCategory" placeholder="扣分类别" :disabled="dataForm.id?true:false" style="width:40%;"> |
|||
<el-option v-for="item in deductionCategoryArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="扣分分值" prop="deduction"> |
|||
<el-input-number v-model="dataForm.deduction" :min="-1" :max="-0.1" label="扣分分值" :step="0.1" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
deptId: '', |
|||
deptName: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
deductionCategory: '', |
|||
deduction: '-0.1', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
delFlag: '', |
|||
joinDeptIdsArr: '' |
|||
}, |
|||
options: [], |
|||
isAble: false, |
|||
deductionCategoryArr: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
deptId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptTypeKey: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
monthYear: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deductionCategory: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deduction: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
joinDeptIdsArr: [ |
|||
{ required: false, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getdeductionCategoryListInfo('deduction_category') |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
} |
|||
}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getdeductionCategoryListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'deduction_category') { |
|||
this.deductionCategoryArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
changeHandle (value, selectedData) { |
|||
let parentDeptIds = '' |
|||
let parentDeptNames = '' |
|||
let allDeptIds = '' |
|||
let allDeptNames = '' |
|||
let deptId = '' |
|||
let deptName = '' |
|||
if (this.$refs['name'].getCheckedNodes() !== null && this.$refs['name'].getCheckedNodes().length > 0) { |
|||
var path = this.$refs['name'].getCheckedNodes()[0].path |
|||
var pathLabels = this.$refs['name'].getCheckedNodes()[0].pathLabels |
|||
for (var i = 0; i < path.length; i++) { |
|||
if (i < path.length - 1) { |
|||
parentDeptIds += path[i] + ',' |
|||
} else { |
|||
deptId = path[i] |
|||
} |
|||
allDeptIds += path[i] + ',' |
|||
} |
|||
for (var j = 0; j < pathLabels.length; j++) { |
|||
if (j < pathLabels.length - 1) { |
|||
parentDeptNames += pathLabels[j] + '-' |
|||
} else { |
|||
deptName = pathLabels[j] |
|||
} |
|||
allDeptNames += pathLabels[j] + '-' |
|||
} |
|||
} |
|||
this.dataForm.parentDeptIds = parentDeptIds.length > 0 ? parentDeptIds.substring(0, parentDeptIds.length - 1) : parentDeptIds |
|||
this.dataForm.parentDeptNames = parentDeptNames.length > 0 ? parentDeptNames.substring(0, parentDeptNames.length - 1) : parentDeptNames |
|||
this.dataForm.allDeptIds = allDeptIds.length > 0 ? allDeptIds.substring(0, allDeptIds.length - 1) : allDeptIds |
|||
this.dataForm.allDeptNames = allDeptNames.length > 0 ? allDeptNames.substring(0, allDeptNames.length - 1) : allDeptNames |
|||
this.dataForm.deptId = deptId |
|||
this.dataForm.deptName = deptName |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/kpi/kpimattersresponse/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.joinDeptIdsArr = this.dataForm.deptId |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/kpi/kpimattersresponse/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss"> |
|||
.customWidth { |
|||
width:35% |
|||
} |
|||
</style> |
|||
@ -0,0 +1,171 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-kpi__kpimattersresponse}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()"> |
|||
<el-form-item> |
|||
<el-form-item label="部门" label-width="80px"> |
|||
<el-cascader |
|||
v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
filterable |
|||
clearable |
|||
></el-cascader> |
|||
</el-form-item> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" label-width="70px"> |
|||
<el-date-picker v-model="dataForm.monthYear" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="部门类型" prop="deptTypeKey" label-width="90px"> |
|||
<el-select v-model="dataForm.deptTypeKey" placeholder="部门类型" clearable> |
|||
<el-option v-for="item in paramNameArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" ></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="扣分类别" prop="deductionCategory" label-width="80px"> |
|||
<el-select v-model="dataForm.deductionCategory" placeholder="扣分类别" clearable> |
|||
<el-option v-for="item in deductionCategoryArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('kpi:kpimattersresponse:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" header-align="center" align="center" width="50px"> |
|||
<template slot-scope="scope"> |
|||
{{scope.$index+1}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="monthYear" label="年月" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="deptTypeKey" label="部门类型" header-align="center" align="center" :formatter = "deptTypeKeyFormat"></el-table-column> |
|||
<el-table-column prop="deductionCategory" label="扣分类别" header-align="center" align="center" :formatter = "stateFormat"></el-table-column> |
|||
<el-table-column prop="deduction" label="扣分分值" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="parentDeptNames" label="上级部门" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="allDeptNames" label="所有部门" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button v-if="$hasPermission('kpi:kpimattersresponse:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './kpimattersresponse-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/kpi/kpimattersresponse/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/kpi/kpimattersresponse', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
deptId: '', |
|||
deductionCategory: '' |
|||
}, |
|||
// 所属机构配置 |
|||
deptIdList: [], |
|||
options: [], |
|||
paramNameArr: [], |
|||
deductionCategoryArr: [] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length === 0) { |
|||
this.dataForm.deptId = '' |
|||
} else if (val.length > 0) { |
|||
this.dataForm.deptId = this.deptIdList[val.length - 1] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getParamListInfo('dept_type') |
|||
this.getdeductionCategoryListInfo('deduction_category') |
|||
}, |
|||
methods: { |
|||
stateFormat (row, column) { |
|||
for (var i = 0; i < this.deductionCategoryArr.length; i++) { |
|||
if (row.deductionCategory === this.deductionCategoryArr[i].dictValue) { |
|||
return this.deductionCategoryArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
deptTypeKeyFormat (row, column) { |
|||
for (var i = 0; i < this.paramNameArr.length; i++) { |
|||
if (row.deptTypeKey === this.paramNameArr[i].dictValue) { |
|||
return this.paramNameArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getParamListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'dept_type') { |
|||
this.paramNameArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getdeductionCategoryListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'deduction_category') { |
|||
this.deductionCategoryArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,208 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false" customClass="customWidth"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="部门名称" prop="deptId" label-width="120px"> |
|||
<el-cascader |
|||
ref="name" |
|||
v-model="dataForm.joinDeptIdsArr" |
|||
:options="options" |
|||
:props="{ multiple: false, emitPath: false, checkStrictly: true }" |
|||
@visible-change="changeHandle" |
|||
style="width:90%;" |
|||
:disabled="dataForm.id?true:false" |
|||
> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" prop="monthYear" label-width="120px"> |
|||
<el-date-picker v-model="dataForm.monthYear" :disabled="dataForm.id?true:false" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM" style="width:40%;"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="宣传基础" prop="publicityFoundation" label-width="120px"> |
|||
<el-input-number v-model="dataForm.publicityFoundation" :min="0" :max="5" label="宣传基础分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="创新突破" prop="innovationBreakthrough" label-width="120px"> |
|||
<el-input-number v-model="dataForm.innovationBreakthrough" :min="0" :max="3" label="创新突破分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="舆情应对" prop="publicOpinionResponse" label-width="120px"> |
|||
<el-input-number v-model="dataForm.publicOpinionResponse" :min="0" :max="2" label="舆情应对分数" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
deptId: '', |
|||
deptName: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
publicityFoundation: '', |
|||
innovationBreakthrough: '', |
|||
publicOpinionResponse: '', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
delFlag: '', |
|||
joinDeptIdsArr: '' |
|||
}, |
|||
options: [], |
|||
isAble: false |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
deptId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptTypeKey: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
monthYear: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
publicityFoundation: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
innovationBreakthrough: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
publicOpinionResponse: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
joinDeptIdsArr: [ |
|||
{ required: false, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
} |
|||
}) |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
changeHandle (value, selectedData) { |
|||
let parentDeptIds = '' |
|||
let parentDeptNames = '' |
|||
let allDeptIds = '' |
|||
let allDeptNames = '' |
|||
let deptId = '' |
|||
let deptName = '' |
|||
if (this.$refs['name'].getCheckedNodes() !== null && this.$refs['name'].getCheckedNodes().length > 0) { |
|||
var path = this.$refs['name'].getCheckedNodes()[0].path |
|||
var pathLabels = this.$refs['name'].getCheckedNodes()[0].pathLabels |
|||
for (var i = 0; i < path.length; i++) { |
|||
if (i < path.length - 1) { |
|||
parentDeptIds += path[i] + ',' |
|||
} else { |
|||
deptId = path[i] |
|||
} |
|||
allDeptIds += path[i] + ',' |
|||
} |
|||
for (var j = 0; j < pathLabels.length; j++) { |
|||
if (j < pathLabels.length - 1) { |
|||
parentDeptNames += pathLabels[j] + '-' |
|||
} else { |
|||
deptName = pathLabels[j] |
|||
} |
|||
allDeptNames += pathLabels[j] + '-' |
|||
} |
|||
} |
|||
this.dataForm.parentDeptIds = parentDeptIds.length > 0 ? parentDeptIds.substring(0, parentDeptIds.length - 1) : parentDeptIds |
|||
this.dataForm.parentDeptNames = parentDeptNames.length > 0 ? parentDeptNames.substring(0, parentDeptNames.length - 1) : parentDeptNames |
|||
this.dataForm.allDeptIds = allDeptIds.length > 0 ? allDeptIds.substring(0, allDeptIds.length - 1) : allDeptIds |
|||
this.dataForm.allDeptNames = allDeptNames.length > 0 ? allDeptNames.substring(0, allDeptNames.length - 1) : allDeptNames |
|||
this.dataForm.deptId = deptId |
|||
this.dataForm.deptName = deptName |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/kpi/kpipublicopinion/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.joinDeptIdsArr = this.dataForm.deptId |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/kpi/kpipublicopinion/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss"> |
|||
.customWidth { |
|||
width:50% |
|||
} |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-kpi__kpipublicopinion}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()"> |
|||
<el-form-item> |
|||
<el-form-item label="部门名称" label-width="80px"> |
|||
<el-cascader |
|||
v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
filterable |
|||
clearable |
|||
></el-cascader> |
|||
</el-form-item> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" label-width="70px"> |
|||
<el-date-picker v-model="dataForm.monthYear" |
|||
type="month" clearable placeholder="选择月" |
|||
value-format="yyyy-MM" format="yyyy-MM"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<br> |
|||
<el-form-item label="部门类型" prop="deptTypeKey" label-width="80px"> |
|||
<el-select v-model="dataForm.deptTypeKey" placeholder="部门类型" clearable> |
|||
<el-option v-for="item in paramNameArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" ></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="exportTemplate()">导出录入模板</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-upload class="upload-demo" |
|||
ref="upload" |
|||
v-loading="dataListLoading" |
|||
:action="uploadUrl" |
|||
:limit="1" |
|||
:on-success='uploadSuccess' |
|||
:on-error='errorExceed' |
|||
accept=".xls,.xlsx"> |
|||
<el-button type="primary">导入打分结果</el-button> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('kpi:kpipublicopinion:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" header-align="center" align="center" width="50px"> |
|||
<template slot-scope="scope"> |
|||
{{scope.$index+1}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="deptTypeKey" label="部门类型" header-align="center" align="center" :formatter = "stateFormat" width="120"></el-table-column> |
|||
<el-table-column prop="monthYear" label="年月" header-align="center" align="center" width="180"></el-table-column> |
|||
<el-table-column prop="publicityFoundation" label="宣传基础分数" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="innovationBreakthrough" label="创新突破分数" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="publicOpinionResponse" label="舆情应对分数" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="parentDeptNames" label="上级部门" header-align="center" align="center" min-width="120" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="allDeptNames" label="所有部门" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button v-if="$hasPermission('kpi:kpipublicopinion:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './kpipublicopinion-add-or-update' |
|||
import Cookies from 'js-cookie' |
|||
import qs from 'qs' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/kpi/kpipublicopinion/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/kpi/kpipublicopinion', |
|||
deleteIsBatch: true, |
|||
exportTemplateURL: '/kpi/kpipublicopinion/exportTemplate' |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
deptTypeKey: '', |
|||
monthYear: '', |
|||
deptId: '' |
|||
}, |
|||
// 所属机构配置 |
|||
deptIdList: [], |
|||
options: [], |
|||
paramNameArr: [] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length === 0) { |
|||
this.dataForm.deptId = '' |
|||
} else if (val.length > 0) { |
|||
this.dataForm.deptId = this.deptIdList[val.length - 1] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getParamListInfo('dept_type') |
|||
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/kpi/kpipublicopinion/importManualScoreExcel?token=${Cookies.get('token')}` |
|||
}, |
|||
methods: { |
|||
stateFormat (row, column) { |
|||
for (var i = 0; i < this.paramNameArr.length; i++) { |
|||
if (row.deptTypeKey === this.paramNameArr[i].dictValue) { |
|||
return this.paramNameArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getParamListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'dept_type') { |
|||
this.paramNameArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
exportTemplate () { |
|||
let remindInfo = '' |
|||
let monthYear = this.dataForm.monthYear |
|||
let deptTypeKey = this.dataForm.deptTypeKey |
|||
let deptId = this.dataForm.deptId |
|||
if (!deptId) { |
|||
remindInfo += '部门、' |
|||
} |
|||
if (!monthYear) { |
|||
remindInfo += '考核周期起始月、' |
|||
} |
|||
if (!deptTypeKey) { |
|||
remindInfo += '部门类型、' |
|||
} |
|||
if (remindInfo.length > 0) { |
|||
remindInfo = remindInfo.substring(0, remindInfo.length - 1) |
|||
return this.$message.error(remindInfo + '不能为空!') |
|||
} |
|||
let params = qs.stringify({ |
|||
'token': Cookies.get('token'), |
|||
'monthYear': monthYear, |
|||
'deptTypeKey': deptTypeKey, |
|||
'deptId': deptId |
|||
}) |
|||
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportTemplateURL}?${params}` |
|||
}, |
|||
errorExceed (file, fileList) { |
|||
this.$message.error('上传失败请重试') |
|||
}, |
|||
uploadSuccess (response, file, fileList) { |
|||
this.dataListLoading = false |
|||
this.$refs.upload.clearFiles() |
|||
if (response.code !== 0 || (response.data !== null && response.data.length > 0)) { |
|||
this.errordataList = response.data |
|||
if (this.errordataList != null && this.errordataList.length > 0) { |
|||
this.faultDataVisible = true |
|||
} else { |
|||
this.$message.error(response.msg) |
|||
} |
|||
return |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.deptIdList = '' |
|||
this.dataForm.deptId = '' |
|||
this.getDataList() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,258 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false" customClass="customWidth"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="部门名称" prop="deptId"> |
|||
<el-cascader |
|||
ref="name" |
|||
v-model="dataForm.joinDeptIdsArr" |
|||
:options="options" |
|||
:props="{ multiple: false, emitPath: false, checkStrictly: true }" |
|||
@visible-change="changeHandle" |
|||
style="width:90%;" |
|||
:disabled="dataForm.id?true:false" |
|||
> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="考核年" prop="year"> |
|||
<el-date-picker v-model="dataForm.year" :disabled="dataForm.id?true:false" |
|||
type="year" clearable placeholder="选择年" |
|||
value-format="yyyy" format="yyyy" style="width:40%;"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="加分类别" prop="bonusCategory"> |
|||
<el-select v-model="dataForm.bonusCategory" placeholder="加分类别" :disabled="dataForm.id?true:false" style="width:40%;" @change="selectModel($event)"> |
|||
<el-option v-for="item in bonusCategoryArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" > |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="加分级别" prop="bonusLevel" v-if="isShowBonusLevel"> |
|||
<el-select v-model="dataForm.bonusLevel" placeholder="加分级别" :disabled="dataForm.id?true:false" style="width:40%;"> |
|||
<el-option v-for="item in bonusLevelArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" > |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="加分分值" prop="bonus"> |
|||
<el-input-number v-model="dataForm.bonus" :min="1" :max="5" label="加分分值" :precision="1" style="width:40%;"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
deptId: '', |
|||
deptName: '', |
|||
deptTypeKey: '', |
|||
year: '', |
|||
bonusCategory: '', |
|||
bonus: '1', |
|||
bonusLevel: '', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
delFlag: '', |
|||
joinDeptIdsArr: '' |
|||
}, |
|||
options: [], |
|||
isAble: false, |
|||
bonusCategoryArr: [], |
|||
bonusLevelArr: [], |
|||
isShowBonusLevel: true |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
deptId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptTypeKey: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
year: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
bonusCategory: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
bonus: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
bonusLevel: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
joinDeptIdsArr: [ |
|||
{ required: false, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getBonusCategoryListInfo('bonus_category') |
|||
this.getBonusLevelListInfo('bonus_level') |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.isShowBonusLevel = true |
|||
this.dataForm.bonusLevel = '' |
|||
} |
|||
}) |
|||
}, |
|||
// 参数名称取值变化事件 |
|||
selectModel (id) { |
|||
if (id === '1') { |
|||
this.isShowBonusLevel = false |
|||
this.dataForm.bonusLevel = '' |
|||
} else { |
|||
this.isShowBonusLevel = true |
|||
} |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getBonusCategoryListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'bonus_category') { |
|||
this.bonusCategoryArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getBonusLevelListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'bonus_level') { |
|||
this.bonusLevelArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
changeHandle (value, selectedData) { |
|||
let parentDeptIds = '' |
|||
let parentDeptNames = '' |
|||
let allDeptIds = '' |
|||
let allDeptNames = '' |
|||
let deptId = '' |
|||
let deptName = '' |
|||
if (this.$refs['name'].getCheckedNodes() !== null && this.$refs['name'].getCheckedNodes().length > 0) { |
|||
var path = this.$refs['name'].getCheckedNodes()[0].path |
|||
var pathLabels = this.$refs['name'].getCheckedNodes()[0].pathLabels |
|||
for (var i = 0; i < path.length; i++) { |
|||
if (i < path.length - 1) { |
|||
parentDeptIds += path[i] + ',' |
|||
} else { |
|||
deptId = path[i] |
|||
} |
|||
allDeptIds += path[i] + ',' |
|||
} |
|||
for (var j = 0; j < pathLabels.length; j++) { |
|||
if (j < pathLabels.length - 1) { |
|||
parentDeptNames += pathLabels[j] + '-' |
|||
} else { |
|||
deptName = pathLabels[j] |
|||
} |
|||
allDeptNames += pathLabels[j] + '-' |
|||
} |
|||
} |
|||
this.dataForm.parentDeptIds = parentDeptIds.length > 0 ? parentDeptIds.substring(0, parentDeptIds.length - 1) : parentDeptIds |
|||
this.dataForm.parentDeptNames = parentDeptNames.length > 0 ? parentDeptNames.substring(0, parentDeptNames.length - 1) : parentDeptNames |
|||
this.dataForm.allDeptIds = allDeptIds.length > 0 ? allDeptIds.substring(0, allDeptIds.length - 1) : allDeptIds |
|||
this.dataForm.allDeptNames = allDeptNames.length > 0 ? allDeptNames.substring(0, allDeptNames.length - 1) : allDeptNames |
|||
this.dataForm.deptId = deptId |
|||
this.dataForm.deptName = deptName |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/kpi/kpitypicalculture/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.joinDeptIdsArr = this.dataForm.deptId |
|||
if (this.dataForm.bonusCategory === '1') { |
|||
this.isShowBonusLevel = false |
|||
this.dataForm.bonusLevel = '' |
|||
} else { |
|||
this.isShowBonusLevel = true |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/kpi/kpitypicalculture/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.dataForm.joinDeptIdsArr = '' |
|||
this.dataForm.deptId = '' |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss"> |
|||
.customWidth { |
|||
width:35% |
|||
} |
|||
</style> |
|||
@ -0,0 +1,202 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-kpi__kpitypicalculture}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()"> |
|||
<div> |
|||
<el-form-item label="部门名称" label-width="80px"> |
|||
<el-cascader |
|||
v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
filterable |
|||
clearable |
|||
style="width:250px;" |
|||
></el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="考核年月" label-width="90px"> |
|||
<el-date-picker v-model="dataForm.year" |
|||
type="year" clearable placeholder="选择年" |
|||
value-format="yyyy" format="yyyy" |
|||
style="width:250px;"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="部门类型" prop="deptTypeKey" label-width="90px"> |
|||
<el-select v-model="dataForm.deptTypeKey" placeholder="部门类型" clearable style="width:250px;"> |
|||
<el-option v-for="item in paramNameArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" ></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</div> |
|||
<el-form-item label="加分类别" prop="bonusCategory" label-width="80px"> |
|||
<el-select v-model="dataForm.bonusCategory" placeholder="加分类别" clearable style="width:250px;"> |
|||
<el-option v-for="item in bonusCategoryArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" > |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="加分级别" prop="bonusLevel" label-width="90px"> |
|||
<el-select v-model="dataForm.bonusLevel" placeholder="加分级别" clearable style="width:250px;"> |
|||
<el-option v-for="item in bonusLevelArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" > |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('kpi:kpitypicalculture:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" header-align="center" align="center" width="50px"> |
|||
<template slot-scope="scope"> |
|||
{{scope.$index+1}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="deptTypeKey" label="部门类别" header-align="center" align="center" :formatter = "deptTypeKeyFormat" width="120"></el-table-column> |
|||
<el-table-column prop="year" label="年份" header-align="center" align="center" width="180"></el-table-column> |
|||
<el-table-column prop="bonusCategory" label="加分类别" header-align="center" align="center" :formatter = "bonusCategoryFormat" width="120"></el-table-column> |
|||
<el-table-column prop="bonus" label="加分分值" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="bonusLevel" label="加分级别" header-align="center" align="center" :formatter = "bonusLevelFormat" width="120"></el-table-column> |
|||
<el-table-column prop="parentDeptNames" label="上级部门" header-align="center" align="center" min-width="120" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="allDeptNames" label="所有部门" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button v-if="$hasPermission('kpi:kpitypicalculture:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './kpitypicalculture-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/kpi/kpitypicalculture/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/kpi/kpitypicalculture', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
deptTypeKey: '', |
|||
year: '', |
|||
deptId: '', |
|||
bonusCategory: '', |
|||
bonusLevel: '' |
|||
}, |
|||
// 所属机构配置 |
|||
deptIdList: [], |
|||
options: [], |
|||
paramNameArr: [], |
|||
bonusCategoryArr: [], |
|||
bonusLevelArr: [] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length === 0) { |
|||
this.dataForm.deptId = '' |
|||
} else if (val.length > 0) { |
|||
this.dataForm.deptId = this.deptIdList[val.length - 1] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getOptions() |
|||
this.getParamListInfo('dept_type') |
|||
this.getBonusCategoryListInfo('bonus_category') |
|||
this.getBonusLevelListInfo('bonus_level') |
|||
}, |
|||
methods: { |
|||
deptTypeKeyFormat (row, column) { |
|||
for (var i = 0; i < this.paramNameArr.length; i++) { |
|||
if (row.deptTypeKey === this.paramNameArr[i].dictValue) { |
|||
return this.paramNameArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
bonusCategoryFormat (row, column) { |
|||
for (var i = 0; i < this.bonusCategoryArr.length; i++) { |
|||
if (row.bonusCategory === this.bonusCategoryArr[i].dictValue) { |
|||
return this.bonusCategoryArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
bonusLevelFormat (row, column) { |
|||
for (var i = 0; i < this.bonusLevelArr.length; i++) { |
|||
if (row.bonusLevel === this.bonusLevelArr[i].dictValue) { |
|||
return this.bonusLevelArr[i].dictName |
|||
} |
|||
} |
|||
}, |
|||
getOptions () { |
|||
this.$http |
|||
.get(`/sys/user/deptOptions/getAllDeptPartyByUser`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.options = res.data.options |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getParamListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'dept_type') { |
|||
this.paramNameArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getBonusCategoryListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'bonus_category') { |
|||
this.bonusCategoryArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
// 获取参数名称code下拉信息 |
|||
getBonusLevelListInfo (dictType) { |
|||
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
if (dictType === 'bonus_level') { |
|||
this.bonusLevelArr = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
Loading…
Reference in new issue