43 changed files with 11835 additions and 187 deletions
@ -0,0 +1,42 @@ |
|||||
|
// 考核纬度api
|
||||
|
import request from '@/utils/request' |
||||
|
//考核维度
|
||||
|
export const dutyclasslist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/dutyclasslist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加考核类别
|
||||
|
export const adddutyclass = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/adddutyclass', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//查询考核维度详情
|
||||
|
export const getdutyclassinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getdutyclassinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//编辑考核维度内容
|
||||
|
export const eitedutyclassinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eitedutyclassinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//删除或改变考核维度状态
|
||||
|
export const statedutyclass = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/statedutyclass', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
@ -0,0 +1,115 @@ |
|||||
|
// 定性考核api
|
||||
|
import request from '@/utils/request' |
||||
|
//定性考核列表
|
||||
|
export const getqualevallist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getqualevallist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加定性考核
|
||||
|
export const addqualeval = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/addqualeval', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//根据条件获取组合指标
|
||||
|
export const gettasktarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/gettasktarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//根据条件获取组合指标子栏目
|
||||
|
export const gettasktargetsun = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/gettasktargetsun', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//根据条件获取考核详情
|
||||
|
export const gettasktargetcontary = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/gettasktargetcontary', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加定量考核
|
||||
|
export const addration = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/addration', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//考核表列表
|
||||
|
export const departmenttasklist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/departmenttasklist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//删除考核
|
||||
|
export const delrationlist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/delrationlist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//删除定性考核内容
|
||||
|
export const delqualevalcont = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/delqualevalcont', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//删除考核细则方案内容
|
||||
|
export const deldepartmenttasklist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/deldepartmenttasklist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//获取定量考核详情
|
||||
|
export const getrationlist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getrationlist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//修改定量考核
|
||||
|
export const eiterationlist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eiterationlist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//获取部门考核指标详情
|
||||
|
export const getqualeval = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getqualeval', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//修改定性考核内容
|
||||
|
export const eitequalevalcont = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eitequalevalcont', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,162 @@ |
|||||
|
// 集团api
|
||||
|
import service from '@/utils/request' |
||||
|
// @Tags api
|
||||
|
// @Summary 获取集团详情 不分页
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const getgroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getgroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 获取子公司详情
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.CreateApiParams true "创建api"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/createApi [post]
|
||||
|
export const getsubsidiaryinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getsubsidiaryinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags menu
|
||||
|
// @Summary 添加集团信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.GetById true "添加集团信息"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /menu/getApiById [post]
|
||||
|
export const addgroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/addgroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 获取工段详情
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.CreateApiParams true "获取工段详情"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
|
// @Router /api/updateApi [post]
|
||||
|
export const getgrouppositioninfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getgrouppositioninfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 修改集团信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.CreateApiParams true "修改集团信息"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
|
// @Router /group/eitegroupinfo [post]
|
||||
|
export const eitegroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/eitegroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 删除集团框架相应信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /group/delgroupinfo [post]
|
||||
|
export const delgroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/delgroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 获取集团架构
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body dbModel.Api true "获取集团架构"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /group/grouplist [get]
|
||||
|
export const grouplist = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/grouplist', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags Api
|
||||
|
// @Summary 获取集团架构(集团+分厂)
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body dbModel.Api true "获取集团架构"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /group/grouplist [get]
|
||||
|
export const getgroupdepartmap = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getgroupdepartmap', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags Api
|
||||
|
// @Summary 获取集团架构人员信息对照表
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body dbModel.Api true "获取集团架构"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /group/grouplist [get]
|
||||
|
export const getgroupuser = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getgroupuser', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags Api
|
||||
|
// @Summary 获取分厂部室列表
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body dbModel.Api true "获取集团架构"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /group/grouplist [get]
|
||||
|
export const departmentlist = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/departmentlist', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,82 @@ |
|||||
|
// 考核项目api
|
||||
|
import request from '@/utils/request' |
||||
|
//考核项目列表
|
||||
|
export const assessList = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/assessList', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加考核项目
|
||||
|
export const addassessinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/addassessinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//查询考核项目详情
|
||||
|
export const getassessinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getassessinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//编辑考核项目内容
|
||||
|
export const eiteassessinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eiteassessinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//删除或改变考核项目状态
|
||||
|
export const eiteassessstate = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eiteassessstate', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//获取考核指标列表
|
||||
|
export const gettarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/gettarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加考核指标
|
||||
|
export const addtarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/addtarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//获取考核指标详细内容
|
||||
|
export const gettargetinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/gettargetinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//删除指标/更改考核指标状态
|
||||
|
export const deltarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/deltarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//编辑指标内容
|
||||
|
export const eitetarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eitetarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
// 定量/定性指标api
|
||||
|
import request from '@/utils/request' |
||||
|
//定量/定性指标列表
|
||||
|
export const dutylist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/dutylist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加定量/定性指标
|
||||
|
export const adddutyinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/adddutyinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//查询定量/定性指标详情
|
||||
|
export const getdutyinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getdutyinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//编辑定量/定性指标内容
|
||||
|
export const eitedutyinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eitedutyinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//删除或改变定量/定性指标状态
|
||||
|
export const eitedutystate = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eitedutystate', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
@ -0,0 +1,83 @@ |
|||||
|
// 考核细则api
|
||||
|
import request from '@/utils/request' |
||||
|
//考核细则列表
|
||||
|
export const getqualitativetargetlist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getqualitativetargetlist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加定性指标子栏目
|
||||
|
export const addqualitativetarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/addqualitativetarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//获取定性指标子栏目详细内容
|
||||
|
export const getqualitativetargetinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getqualitativetargetinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//修改定性指标子栏目详细内容
|
||||
|
export const eitequalitativetargetinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eitequalitativetargetinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//修改定性指标子栏目状态或删除
|
||||
|
export const delqualitativetargetinfo = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/delqualitativetargetinfo', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//添加考核细则
|
||||
|
export const adddetailedtarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/adddetailedtarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//获取考核细则内容
|
||||
|
export const getdetailedtarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getdetailedtarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//获取考核细则列表
|
||||
|
export const getdetailedtargetlist = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/getdetailedtargetlist', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//编辑考核细则内容
|
||||
|
export const eitedetailedtarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/eitedetailedtarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
//编辑考核细则内容
|
||||
|
export const deldetailedtarget = (data) => { |
||||
|
return request({ |
||||
|
url: '/duty/deldetailedtarget', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,151 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<div> |
||||
|
<el-button size="small" @click="showDialog()">选择考核项目</el-button> |
||||
|
</div> |
||||
|
|
||||
|
<el-dialog title="提示" :visible.sync="dialogVisible" width="60%" :append-to-body="true"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="projectSearchInfo"> |
||||
|
<el-form-item label="考核项目名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="projectSearchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item label="考核项目状态"> |
||||
|
<el-select v-model="projectSearchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item label="所属考核类别"> |
||||
|
<el-select v-model="projectSearchInfo.parentId" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<!-- <el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> --> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<el-table :data="assessList"> |
||||
|
<!-- <el-table-column |
||||
|
type="selection" |
||||
|
width="55" |
||||
|
/> --> |
||||
|
<el-table-column align="left" label="所属考核类别" prop="parentTitle"/> |
||||
|
<el-table-column align="left" label="考核项目名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核项目说明" prop="content"/> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button type="primary" round @click="checked(scope.row)">选中</el-button> |
||||
|
|
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
:current-page="projectSearchInfo.page" |
||||
|
:page-size="projectSearchInfo.pageSize" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@current-change="handleCurrentChange" |
||||
|
@size-change="handleSizeChange" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- <span slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
|
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> |
||||
|
</span> --> |
||||
|
</el-dialog> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
dutyclasslist |
||||
|
} from '@/api/duty/dimension' |
||||
|
import { |
||||
|
assessList, |
||||
|
} from '@/api/duty/project' |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
projectTitle:'', |
||||
|
total:'', |
||||
|
searchList:{ |
||||
|
page:1, |
||||
|
pagesize:10000, |
||||
|
}, |
||||
|
dutyclasslist:{}, |
||||
|
projectSearchInfo:{ |
||||
|
page: 1, |
||||
|
pageSize: 10, |
||||
|
state:1, |
||||
|
}, |
||||
|
dialogVisible: false, |
||||
|
assessList:null, |
||||
|
} |
||||
|
}, |
||||
|
created () { |
||||
|
this.getProjectList(); |
||||
|
this.getDutyclasslist(); |
||||
|
}, |
||||
|
methods: { |
||||
|
// 条件搜索前端看此方法 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
|
||||
|
this.getProjectList() |
||||
|
}, |
||||
|
// pagesize改变 |
||||
|
handleSizeChange(val) { |
||||
|
this.projectSearchInfo.pageSize=val |
||||
|
}, |
||||
|
// 页码改变 |
||||
|
handleCurrentChange(val) { |
||||
|
this.projectSearchInfo.page=val |
||||
|
}, |
||||
|
// 获取考核类别列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.searchList) |
||||
|
this.dutyclasslist=res.data.list; |
||||
|
}, |
||||
|
// 点击按钮事件 |
||||
|
showDialog(){ |
||||
|
this.dialogVisible=true; |
||||
|
}, |
||||
|
// 获取考核项目列表 |
||||
|
async getProjectList(){ |
||||
|
const res = await assessList(this.projectSearchInfo) |
||||
|
this.assessList=res.data.list; |
||||
|
this.projectSearchInfo.page=res.data.page; |
||||
|
this.projectSearchInfo.pageSize=res.data.pageSize; |
||||
|
this.total=res.data.total; |
||||
|
}, |
||||
|
// 选中 |
||||
|
checked(row){ |
||||
|
this.projectTitle=row.title; |
||||
|
this.$emit('checkedInfo',row) |
||||
|
this.dialogVisible=false |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,129 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px"> |
||||
|
<el-table-column prop="id" label="ID" width="180"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="name" label="姓名"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="amount1" label="数值 1(元)"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="amount2" label="数值 2(元)"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="amount3" label="数值 3(元)"> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { lookdepartmentassessinfo } from '@/api/dutys' |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
tableData: [{ |
||||
|
id: '12987122', |
||||
|
name: '王小虎', |
||||
|
amount1: '234', |
||||
|
amount2: '3.2', |
||||
|
amount3: 10 |
||||
|
}, { |
||||
|
id: '12987124', |
||||
|
name: '王小虎', |
||||
|
amount1: '324', |
||||
|
amount2: '1.9', |
||||
|
amount3: 9 |
||||
|
}, { |
||||
|
id: '12987124', |
||||
|
name: '王小虎', |
||||
|
amount1: '165', |
||||
|
amount2: '4.43', |
||||
|
amount3: 12 |
||||
|
}, { |
||||
|
id: '12987125', |
||||
|
name: '王小虎', |
||||
|
amount1: '621', |
||||
|
amount2: '2.2', |
||||
|
amount3: 17 |
||||
|
}, { |
||||
|
id: '12987126', |
||||
|
name: '王小虎1', |
||||
|
amount1: '539', |
||||
|
amount2: '4.1', |
||||
|
amount3: 15 |
||||
|
}], |
||||
|
spanArr: [] |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
mounted() { |
||||
|
this.rowspan(); |
||||
|
}, |
||||
|
methods: { |
||||
|
getSpanArr(data) { |
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.spanArr.push(1); |
||||
|
this.pos = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].classID === data[i - 1].classID) { |
||||
|
this.spanArr[this.pos] += 1; |
||||
|
this.spanArr.push(0); |
||||
|
} else { |
||||
|
this.spanArr.push(1); |
||||
|
this.pos = i; |
||||
|
} |
||||
|
} |
||||
|
console.log(this.spanArr); |
||||
|
} |
||||
|
}, |
||||
|
rowspan() { |
||||
|
//每次调用清空数据 |
||||
|
this.spanArr = []; |
||||
|
this.position = 0 |
||||
|
this.tableData.forEach((item, index) => { |
||||
|
if (index === 0) { |
||||
|
this.spanArr.push(1); |
||||
|
this.position = 0; |
||||
|
} else { |
||||
|
// id 为需要合并查询的项 |
||||
|
if (this.tableData[index].id === this.tableData[index - 1].id) { |
||||
|
this.spanArr[this.position] += 1; |
||||
|
this.spanArr.push(0); |
||||
|
} else { |
||||
|
this.spanArr.push(1); |
||||
|
this.position = index; |
||||
|
} |
||||
|
// id 为需要合并查询的项 |
||||
|
// if (this.tableData[index].id === this.tableData[index - 1].id) { |
||||
|
// this.spanArr[this.position] += 1; |
||||
|
// this.spanArr.push(0); |
||||
|
// } else { |
||||
|
// this.spanArr.push(1); |
||||
|
// this.position = index; |
||||
|
// } |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
//合并 |
||||
|
objectSpanMethod({row,column,rowIndex,columnIndex}) { //表格合并行 |
||||
|
// 添加合并行判断 |
||||
|
if (columnIndex === 0) { |
||||
|
const _row = this.spanArr[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,17 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import {HotTable} from '@handsontable/vue'; |
||||
|
import Handsontable from 'handsontable'; |
||||
|
export default { |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,326 @@ |
|||||
|
<template> |
||||
|
<!-- 考核维度录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="考核维度名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核维度状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="考核维度ID" prop="outId"/> |
||||
|
<el-table-column align="left" label="考核维度名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核维度状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyclassinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await adddutyclass(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitedutyclassinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutyclasslist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,851 @@ |
|||||
|
<template> |
||||
|
<!-- 部门考核录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<!-- <div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属定量考核"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> --> |
||||
|
<div class="gva-table-box"> |
||||
|
<!-- <div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-setting" @click="showDimension()">设置维度权重</el-button> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-setting" @click="showIndex()">设置指标权重</el-button> |
||||
|
</div> --> |
||||
|
<el-table :data="tableData" border :span-method="objectSpanMethod"> |
||||
|
<el-table-column prop="parentname" label="部门"></el-table-column> |
||||
|
<el-table-column prop="dimensionname" label="考核维度"></el-table-column> |
||||
|
<el-table-column prop="dimensionweight" label="维度权重"></el-table-column> |
||||
|
<el-table-column prop="targetname" label="考核指标"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link v-if="scope.row.type==1" type="primary" @click="showMethod(scope.row)">{{scope.row.targetname}}</el-link> |
||||
|
<div v-if="scope.row.type==2">{{scope.row.targetname}}</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="targetweight" label="指标权重"></el-table-column> |
||||
|
<el-table-column prop="unit" label="单位"/> |
||||
|
<el-table-column prop="referencescore" label="分值"/> |
||||
|
<el-table-column prop="cycle" label="周期"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-tag v-if="scope.row.cycle==1">班</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==2">天</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==3">周</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==4">月</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==5">季度</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==6">年</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="cycleattr" label="频次"> |
||||
|
<template slot-scope="scope"> |
||||
|
<div v-if="scope.row.cycle==1">每班{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==2">每天{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==3">每周{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==4">每月{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==5">每季度{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==6">每年{{scope.row.cycleattr}}次</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="userlist" label="执行人"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-view" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showUserList(scope.row)" |
||||
|
>查看</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="100%"> |
||||
|
|
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属公司" prop="title"> |
||||
|
<el-select v-model="form.group" clearable placeholder="请选择" @change="selectGroup"> |
||||
|
<el-option |
||||
|
v-for="item in companyList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属部门" prop="title" v-if="form.group!=''"> |
||||
|
<el-select multiple v-model="form.parentid" clearable placeholder="请选择" @change="selectDepartment"> |
||||
|
<el-option |
||||
|
v-for="item in departmentList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="考核维度"> |
||||
|
<el-select v-model="form.dimension" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属部门" prop="title" v-if="form.group!=''"> |
||||
|
<el-select multiple v-model="form.parentid" clearable placeholder="请选择" @change="selectDepartment"> |
||||
|
<el-option |
||||
|
v-for="item in departmentList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-form-item v-if="form.parentid!=''"> |
||||
|
<!-- 表格表单提交 --> |
||||
|
<el-table |
||||
|
:data="indexList" |
||||
|
style="width: 100%"> |
||||
|
|
||||
|
<el-table-column |
||||
|
label="名称" |
||||
|
align="center" |
||||
|
prop="title" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="考核周期" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="辅助计数" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.cycleattr" autocomplete="off" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="单位" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.unites"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!-- <el-table-column |
||||
|
label="分值" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model.number="scope.row.referencescore"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
<el-table-column |
||||
|
label="数据提报" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-cascader clearable v-model="scope.row.reportlist" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteRow(scope)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 人员弹框 --> |
||||
|
<el-dialog :visible.sync="showUser" title="执行人" width="30%"> |
||||
|
<el-descriptions class="margin-top" :column="3" size="medium" border> |
||||
|
<el-descriptions-item v-for="item in userlistary" :key="item.key"> |
||||
|
<template slot="label"> |
||||
|
<i class="el-icon-user"></i> |
||||
|
姓名 |
||||
|
</template> |
||||
|
{{item.name}} |
||||
|
</el-descriptions-item> |
||||
|
</el-descriptions> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="editChildInfo.title!=''">{{editChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getEditCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 考核办法弹框 --> |
||||
|
<el-dialog :visible.sync="methodShow" title="考核办法" width="60%"> |
||||
|
<el-table :data="methodList" border :span-method="methodSpanMethod"> |
||||
|
<el-table-column prop="targetsunname" label="考核项目"></el-table-column> |
||||
|
<!-- <el-table-column prop="targetsunname" label="权重"></el-table-column> --> |
||||
|
<el-table-column prop="detailedtargetname" label="考核标准"></el-table-column> |
||||
|
<el-table-column prop="content" label="考核办法"></el-table-column> |
||||
|
<!-- <el-table-column prop="unit" label="单位"/> --> |
||||
|
<el-table-column prop="referencescore" label="标准分"/> |
||||
|
|
||||
|
</el-table> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist } from '@/api/duty/dimension' |
||||
|
import { gettasktarget,gettasktargetsun,gettasktargetcontary,addqualeval,addration,departmenttasklist } from '@/api/duty/duty' |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
grouplist, |
||||
|
departmentlist, |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
// 执行人列表 |
||||
|
userlistary:[], |
||||
|
// 执行人列表弹窗 |
||||
|
showUser:false, |
||||
|
// 选择员工配置项 |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false, |
||||
|
multiple: true |
||||
|
}, |
||||
|
// 员工列表 |
||||
|
grouplistBackup:[], |
||||
|
// 周期列表 |
||||
|
options: [{ |
||||
|
value: 1, |
||||
|
label: '班' |
||||
|
}, { |
||||
|
value: 2, |
||||
|
label: '天' |
||||
|
}, { |
||||
|
value: 3, |
||||
|
label: '周' |
||||
|
}, { |
||||
|
value: 4, |
||||
|
label: '月' |
||||
|
}, { |
||||
|
value: 5, |
||||
|
label: '季度' |
||||
|
}, { |
||||
|
value: 6, |
||||
|
label: '年' |
||||
|
}], |
||||
|
// 考核细则表格显示 |
||||
|
tableShow:false, |
||||
|
// 子栏目列表 |
||||
|
targetsunList:[], |
||||
|
// 细则列表 |
||||
|
rulesList:[], |
||||
|
// 细则拷贝 |
||||
|
rulesCopyList:[], |
||||
|
// 考核指标列表 |
||||
|
indexList:[], |
||||
|
// 考核纬度列表 |
||||
|
dutyclasslist:[], |
||||
|
// 考核纬度请求值 |
||||
|
dutyClassFrom:{ |
||||
|
page: 1, //分页页码,数字类型 |
||||
|
pagesize: 100000, |
||||
|
state: 1 //状态(查询用) |
||||
|
}, |
||||
|
// 部门列表 |
||||
|
departmentList:[], |
||||
|
// 公司列表 |
||||
|
companyList:[], |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:1, |
||||
|
group:'', |
||||
|
parentid:'', |
||||
|
target:'', |
||||
|
targetsun:'', |
||||
|
rationlist:[], |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
pos:'', |
||||
|
pos1:'', |
||||
|
pos2:'', |
||||
|
spanArr:[], |
||||
|
spanArr1:[], |
||||
|
spanArr2:[], |
||||
|
methodSpanArr:[], |
||||
|
methodList:[], |
||||
|
methodPos:'', |
||||
|
methodShow:false, |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
group: "3", |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
// title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getDutyclasslist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
// 监听数据 |
||||
|
watch: { |
||||
|
methodList() { |
||||
|
this.$nextTick(() => { |
||||
|
this.methodSpanArr=[], |
||||
|
this.methodPos='', |
||||
|
//此时就可以获取到在created赋值后的dataList了 |
||||
|
this.getMethodSpanArr(this.methodList); |
||||
|
}); |
||||
|
}, |
||||
|
tableData() { |
||||
|
this.$nextTick(() => { |
||||
|
this.spanArr=[], |
||||
|
this.spanArr1=[], |
||||
|
this.spanArr2=[], |
||||
|
this.pos2='', |
||||
|
this.pos='', |
||||
|
this.pos1='', |
||||
|
|
||||
|
//此时就可以获取到在created赋值后的dataList了 |
||||
|
this.getSpanArr(this.tableData); |
||||
|
this.getSpanArr1(this.tableData); |
||||
|
this.getSpanArr2(this.tableData); |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
methods: { |
||||
|
// 考核办法列表合并行 |
||||
|
methodSpanMethod({ row, column, rowIndex, columnIndex }) { |
||||
|
if (columnIndex === 0) { |
||||
|
const _row = this.methodSpanArr[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
return { |
||||
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
}; |
||||
|
} |
||||
|
}, |
||||
|
getMethodSpanArr(data) { |
||||
|
|
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.methodSpanArr.push(1); |
||||
|
this.methodPos = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].targetsun === data[i - 1].targetsun) { |
||||
|
this.methodSpanArr[this.methodPos] += 1; |
||||
|
this.methodSpanArr.push(0); |
||||
|
} else { |
||||
|
this.methodSpanArr.push(1); |
||||
|
this.methodPos = i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 查看考核办法 |
||||
|
async showMethod(row){ |
||||
|
const methodData={ |
||||
|
type: 1, //1:定性考核;2:定量考核 |
||||
|
group: row.group, //归属集团 |
||||
|
departmentid: row.parentid, //被考核部门 |
||||
|
dimension: row.dimension, //维度 |
||||
|
target: row.target, //考核指标 |
||||
|
} |
||||
|
const res = await departmenttasklist(methodData) |
||||
|
if (res.code==0) { |
||||
|
this.methodList=res.data |
||||
|
this.methodShow=true |
||||
|
} |
||||
|
}, |
||||
|
// 指标合并 |
||||
|
getSpanArr2(data) { |
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.spanArr2.push(1); |
||||
|
this.pos2 = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].target === data[i - 1].target) { |
||||
|
this.spanArr2[this.pos2] += 1; |
||||
|
this.spanArr2.push(0); |
||||
|
} else { |
||||
|
this.spanArr2.push(1); |
||||
|
this.pos2 = i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 点击查看人员列表 |
||||
|
showUserList(row){ |
||||
|
this.showUser=true |
||||
|
this.userlistary=row.userlistary |
||||
|
}, |
||||
|
getSpanArr(data) { |
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.spanArr.push(1); |
||||
|
this.pos = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].parentid === data[i - 1].parentid) { |
||||
|
this.spanArr[this.pos] += 1; |
||||
|
this.spanArr.push(0); |
||||
|
} else { |
||||
|
this.spanArr.push(1); |
||||
|
this.pos = i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
getSpanArr1(data) { |
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.spanArr1.push(1); |
||||
|
this.pos1 = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].dimension === data[i - 1].dimension) { |
||||
|
this.spanArr1[this.pos1] += 1; |
||||
|
this.spanArr1.push(0); |
||||
|
} else { |
||||
|
this.spanArr1.push(1); |
||||
|
this.pos1 = i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 合并行 |
||||
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) { |
||||
|
if (columnIndex === 0) { |
||||
|
const _row = this.spanArr[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
return { |
||||
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
}; |
||||
|
} |
||||
|
if (columnIndex === 1||columnIndex === 2) { |
||||
|
const _row = this.spanArr1[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
return { |
||||
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
}; |
||||
|
} |
||||
|
if (columnIndex === 3||columnIndex === 4||columnIndex === 5||columnIndex === 6||columnIndex === 7||columnIndex === 8||columnIndex === 9) { |
||||
|
const _row = this.spanArr2[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
return { |
||||
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
}; |
||||
|
} |
||||
|
}, |
||||
|
// 删除行 |
||||
|
deleteRow(row){ |
||||
|
this.rulesCopyList.splice(row.$index,1); |
||||
|
}, |
||||
|
// 选中指标后获取子栏目 |
||||
|
async selectIndex(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await gettasktargetsun(from) |
||||
|
this.targetsunList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 选中子栏目后获取对应的考核细则 |
||||
|
async selectTargetsun(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
type: 1, //1:定性考核;2:定量考核 |
||||
|
targetid: this.form.target.toString(), //指标 |
||||
|
targetsunid: val.toString() //子栏目 |
||||
|
|
||||
|
} |
||||
|
const res = await gettasktargetcontary(from) |
||||
|
this.rulesList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.rulesCopyList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.tableShow=true |
||||
|
} |
||||
|
}, |
||||
|
// 选中部门后获取指定的指标列表 |
||||
|
async selectDepartment(val){ |
||||
|
if (val!='') { |
||||
|
const indexFrom={ |
||||
|
type:2, |
||||
|
group:this.form.group.toString(), |
||||
|
parentid:val.map(String), |
||||
|
} |
||||
|
const res = await gettasktarget(indexFrom) |
||||
|
this.indexList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 获取考核纬度列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.dutyClassFrom) |
||||
|
this.dutyclasslist=res.data.list |
||||
|
}, |
||||
|
// 选中的公司值 |
||||
|
async selectGroup(val){ |
||||
|
if (val!='') { |
||||
|
const departmentFrom={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await departmentlist(departmentFrom) |
||||
|
this.departmentList=res.data |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取公司 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.companyList=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
this.editChildInfo.title=res.data.parentTitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
console.log("this.rulesCopyList") |
||||
|
console.log(this.rulesCopyList) |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const that=this |
||||
|
this.indexList.forEach(function(item, index) { |
||||
|
//item 就是当日按循环到的对象 |
||||
|
//index是循环的索引,从0开始 |
||||
|
that.form.rationlist.push({id:item.id.toString(),unit:item.unites,cycle:item.cycle,cycleattr:item.cycleattr,userlist:item.reportlist}) |
||||
|
}) |
||||
|
this.form.group=this.form.group.toString(); |
||||
|
this.form.parentid=this.form.parentid.map(String); |
||||
|
const res = await addration(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await eitedutyinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await departmenttasklist(this.searchInfo) |
||||
|
this.tableData = res.data |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,326 @@ |
|||||
|
<template> |
||||
|
<!-- 岗位录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="岗位名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="岗位状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="岗位ID" prop="outId"/> |
||||
|
<el-table-column align="left" label="岗位名称" prop="title"/> |
||||
|
<el-table-column align="left" label="岗位状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="岗位名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="岗位名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyclassinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await adddutyclass(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitedutyclassinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutyclasslist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,472 @@ |
|||||
|
<template> |
||||
|
<!-- 考核项目录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="考核项目名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属考核类别"> |
||||
|
<el-select v-model="searchInfo.parentId" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="所属考核类别" prop="parentTitle"/> |
||||
|
|
||||
|
<el-table-column align="left" label="考核项目名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核周期" prop="outId"> |
||||
|
<template #default="scope"> |
||||
|
<el-tag v-if="scope.row.cycle==1">天</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==2">周</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==3">月</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==4">季度</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==5">年</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="计量单位" prop="unites"/> |
||||
|
<el-table-column align="left" label="辅助计数" prop="cycleattr"/> |
||||
|
<el-table-column align="left" label="考核项目说明" prop="content"/> |
||||
|
<el-table-column align="left" label="考核项目状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="30%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属考核类别" prop="parentId"> |
||||
|
<el-select v-model="form.parentId" clearable placeholder="请选择考核类别"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计量单位" prop="unittitle"> |
||||
|
<el-input v-model="form.unittitle" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核周期" prop="title"> |
||||
|
<el-select v-model="form.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="辅助计数" prop="cycleattr"> |
||||
|
<el-input v-model="form.cycleattr" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="form.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核类别" prop="parentId"> |
||||
|
<el-select v-model="editAdd.parentId" class="m-2" placeholder="Select" size="large" @change="$forceUpdate()"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId" |
||||
|
> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
<!-- <el-select v-model="editAdd.parentId" clearable placeholder="请选择考核类别"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> --> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计量单位" prop="unites"> |
||||
|
<el-input v-model="editAdd.unites" autocomplete="off"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核周期" prop="title"> |
||||
|
<el-select v-model="editAdd.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="辅助计数" prop="cycleattr"> |
||||
|
<el-input v-model="editAdd.cycleattr" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist } from '@/api/duty/dimension' |
||||
|
import { assessList,addassessinfo,getassessinfo,eiteassessinfo,eiteassessstate } from '@/api/duty/project' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
options: [{ |
||||
|
value: 1, |
||||
|
label: '天' |
||||
|
}, { |
||||
|
value: 2, |
||||
|
label: '周' |
||||
|
}, { |
||||
|
value: 3, |
||||
|
label: '月' |
||||
|
}, { |
||||
|
value: 4, |
||||
|
label: '季度' |
||||
|
}, { |
||||
|
value: 5, |
||||
|
label: '年' |
||||
|
}], |
||||
|
dutyclasslist:{}, |
||||
|
searchList:{ |
||||
|
page:1, |
||||
|
pagesize:10000, |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
unittitle:'', |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
content: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
parentId: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
unittitle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycleattr: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
content: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
parentId: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
unites: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycleattr: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getDutyclasslist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取考核纬度列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.searchList) |
||||
|
this.dutyclasslist=res.data.list |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getassessinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
console.log("this.editAdd") |
||||
|
console.log(this.editAdd) |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eiteassessstate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eiteassessstate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.cycleattr =parseInt(this.form.cycleattr) |
||||
|
const res = await addassessinfo(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.editAdd.cycleattr =parseInt(this.editAdd.cycleattr) |
||||
|
this.editAdd.unittitle =this.editAdd.unites |
||||
|
const res = await eiteassessinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await assessList(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,725 @@ |
|||||
|
<template> |
||||
|
<!-- 定性指标录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<table border style="width: 100%" cellspacing='0'> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>公司</th> |
||||
|
<th>部门</th> |
||||
|
<th>考核纬度</th> |
||||
|
<th>考核指标</th> |
||||
|
<th>考核指标子栏目</th> |
||||
|
<th>考核细则</th> |
||||
|
<th>考核细则</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<div v-for="(item,i) in tableData"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</td> |
||||
|
<td> |
||||
|
<div v-for="(item,i) in tableData"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang first"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</td> |
||||
|
<td> |
||||
|
<div v-for="(item,i) in tableData"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang first"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang two"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td> |
||||
|
<div v-for="(item,i) in tableData"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang first"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang two"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang three"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td> |
||||
|
<div v-for="(item,i) in tableData"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang first"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang two"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang three"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang four"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td> |
||||
|
<div v-for="(item,i) in tableData"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang first"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang two"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang three"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang four"> |
||||
|
<div v-for="(item,i) in item.child" class="kuang fives"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
|
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="100%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属公司" prop="title"> |
||||
|
<el-select v-model="form.group" clearable placeholder="请选择" @change="selectGroup"> |
||||
|
<el-option |
||||
|
v-for="item in companyList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属部门" prop="title" v-if="form.group!=''"> |
||||
|
<el-select multiple v-model="form.parentid" clearable placeholder="请选择" @change="selectDepartment"> |
||||
|
<el-option |
||||
|
v-for="item in departmentList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核维度"> |
||||
|
<el-select v-model="form.dimension" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核指标" v-if="form.parentid!=''"> |
||||
|
<el-select v-model="form.target" clearable placeholder="请选择状态" @change="selectIndex"> |
||||
|
<el-option |
||||
|
v-for="item in indexList" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核指标子栏目" v-if="form.target!=''"> |
||||
|
<el-select v-model="form.targetsun" clearable placeholder="请选择状态" @change="selectTargetsun"> |
||||
|
<el-option |
||||
|
v-for="item in targetsunList" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item v-if="form.targetsun!=''"> |
||||
|
<!-- 表格表单提交 --> |
||||
|
<el-table |
||||
|
:data="rulesCopyList" |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
label="细则名称" |
||||
|
align="center" |
||||
|
prop="name" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="细则说明" |
||||
|
align="center" |
||||
|
prop="content" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="考核周期" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="辅助计数" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.cycleattr" autocomplete="off" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="单位" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.unit"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="分值" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model.number="scope.row.referencescore"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="分值" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-cascader clearable v-model="scope.row.userlist" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteRow(scope)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="editChildInfo.title!=''">{{editChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getEditCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist } from '@/api/duty/dimension' |
||||
|
import { gettasktarget,gettasktargetsun,gettasktargetcontary,addqualeval,getqualevallist } from '@/api/duty/duty' |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
grouplist, |
||||
|
departmentlist, |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
// 选择员工配置项 |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false, |
||||
|
multiple: true |
||||
|
}, |
||||
|
// 员工列表 |
||||
|
grouplistBackup:[], |
||||
|
// 周期列表 |
||||
|
options: [{ |
||||
|
value: 1, |
||||
|
label: '班' |
||||
|
}, { |
||||
|
value: 2, |
||||
|
label: '天' |
||||
|
}, { |
||||
|
value: 3, |
||||
|
label: '周' |
||||
|
}, { |
||||
|
value: 4, |
||||
|
label: '月' |
||||
|
}, { |
||||
|
value: 5, |
||||
|
label: '季度' |
||||
|
}, { |
||||
|
value: 6, |
||||
|
label: '年' |
||||
|
}], |
||||
|
// 考核细则表格显示 |
||||
|
tableShow:false, |
||||
|
// 子栏目列表 |
||||
|
targetsunList:[], |
||||
|
// 细则列表 |
||||
|
rulesList:[], |
||||
|
// 细则拷贝 |
||||
|
rulesCopyList:[], |
||||
|
// 考核指标列表 |
||||
|
indexList:[], |
||||
|
// 考核纬度列表 |
||||
|
dutyclasslist:[], |
||||
|
// 考核纬度请求值 |
||||
|
dutyClassFrom:{ |
||||
|
page: 1, //分页页码,数字类型 |
||||
|
pagesize: 100000, |
||||
|
state: 1 //状态(查询用) |
||||
|
}, |
||||
|
// 部门列表 |
||||
|
departmentList:[], |
||||
|
// 公司列表 |
||||
|
companyList:[], |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:1, |
||||
|
group:'', |
||||
|
parentid:'', |
||||
|
target:'', |
||||
|
targetsun:'' |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
// title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getDutyclasslist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除行 |
||||
|
deleteRow(row){ |
||||
|
this.rulesCopyList.splice(row.$index,1); |
||||
|
}, |
||||
|
// 选中指标后获取子栏目 |
||||
|
async selectIndex(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await gettasktargetsun(from) |
||||
|
this.targetsunList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 选中子栏目后获取对应的考核细则 |
||||
|
async selectTargetsun(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
type: 1, //1:定性考核;2:定量考核 |
||||
|
targetid: this.form.target.toString(), //指标 |
||||
|
targetsunid: val.toString() //子栏目 |
||||
|
|
||||
|
} |
||||
|
const res = await gettasktargetcontary(from) |
||||
|
this.rulesList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.rulesCopyList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.tableShow=true |
||||
|
} |
||||
|
}, |
||||
|
// 选中部门后获取指定的指标列表 |
||||
|
async selectDepartment(val){ |
||||
|
if (val!='') { |
||||
|
const indexFrom={ |
||||
|
type:1, |
||||
|
group:this.form.group.toString(), |
||||
|
department:val.map(String), |
||||
|
} |
||||
|
const res = await gettasktarget(indexFrom) |
||||
|
this.indexList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 获取考核纬度列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.dutyClassFrom) |
||||
|
this.dutyclasslist=res.data.list |
||||
|
}, |
||||
|
// 选中的公司值 |
||||
|
async selectGroup(val){ |
||||
|
if (val!='') { |
||||
|
const departmentFrom={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await departmentlist(departmentFrom) |
||||
|
this.departmentList=res.data |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取公司 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.companyList=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
this.editChildInfo.title=res.data.parentTitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
console.log("this.rulesCopyList") |
||||
|
console.log(this.rulesCopyList) |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.evaluationlist=this.rulesCopyList |
||||
|
this.form.group=this.form.group.toString(); |
||||
|
this.form.target=this.form.target.toString(); |
||||
|
this.form.targetsun=this.form.targetsun.toString(); |
||||
|
this.form.parentid=this.form.parentid.map(String); |
||||
|
const res = await addqualeval(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
this.rulesCopyList=[] |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await eitedutyinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await getqualevallist(this.searchInfo) |
||||
|
this.tableData = res.data |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
.kuang{ |
||||
|
border-bottom :solid 1px ; |
||||
|
} |
||||
|
.cluster-rs { |
||||
|
text-align: center; |
||||
|
} |
||||
|
.annotation-rs{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
border: none; |
||||
|
td{ |
||||
|
width: 155px; |
||||
|
padding: 5px; |
||||
|
border-right: none; |
||||
|
text-align: center; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
} |
||||
|
tr:last-child{ |
||||
|
td{ |
||||
|
border-bottom: none; |
||||
|
} |
||||
|
} |
||||
|
.first{ |
||||
|
height: 600px; |
||||
|
} |
||||
|
.two{ |
||||
|
height: 400px; |
||||
|
} |
||||
|
.three{ |
||||
|
height: 300px; |
||||
|
} |
||||
|
.four{ |
||||
|
height: 200px; |
||||
|
} |
||||
|
.fives{ |
||||
|
height: 100px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,679 @@ |
|||||
|
<template> |
||||
|
<!-- 定性指标录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData" border> |
||||
|
<el-table-column align="left" label="公司" prop="name"/> |
||||
|
<el-table-column align="left" label="部门" prop="title"> |
||||
|
<template #default="scope"> |
||||
|
<div v-for="(item,i) in scope.row.child" style="height:400px" class="kuang"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="考核纬度" prop="contenting"> |
||||
|
<template #default="scope"> |
||||
|
<div v-for="(item,i) in scope.row.child" style="height:400px"> |
||||
|
<div v-for="(item,i) in item.child" style="height:300px" class="kuang"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="考核指标"> |
||||
|
<template #default="scope" > |
||||
|
<div v-for="(item,i) in scope.row.child" style="height:400px"> |
||||
|
<div v-for="(item,i) in item.child" style="height:300px"> |
||||
|
<div v-for="(item,i) in item.child" > |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="考核指标子栏目"> |
||||
|
<template #default="scope"> |
||||
|
<div v-for="(item,i) in scope.row.child" style="height:400px"> |
||||
|
<div v-for="(item,i) in item.child" style="height:300px"> |
||||
|
<div v-for="(item,i) in item.child" > |
||||
|
<div v-for="(item,i) in item.child"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="考核细则"> |
||||
|
<template #default="scope"> |
||||
|
<div v-for="(item,i) in scope.row.child" style="height:400px"> |
||||
|
<div v-for="(item,i) in item.child" style="height:300px"> |
||||
|
<div v-for="(item,i) in item.child" > |
||||
|
<div v-for="(item,i) in item.child"> |
||||
|
<div v-for="(item,i) in item.child"> |
||||
|
{{item.name}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="100%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属公司" prop="title"> |
||||
|
<el-select v-model="form.group" clearable placeholder="请选择" @change="selectGroup"> |
||||
|
<el-option |
||||
|
v-for="item in companyList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属部门" prop="title" v-if="form.group!=''"> |
||||
|
<el-select multiple v-model="form.parentid" clearable placeholder="请选择" @change="selectDepartment"> |
||||
|
<el-option |
||||
|
v-for="item in departmentList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核维度"> |
||||
|
<el-select v-model="form.dimension" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核指标" v-if="form.parentid!=''"> |
||||
|
<el-select v-model="form.target" clearable placeholder="请选择状态" @change="selectIndex"> |
||||
|
<el-option |
||||
|
v-for="item in indexList" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核指标子栏目" v-if="form.target!=''"> |
||||
|
<el-select v-model="form.targetsun" clearable placeholder="请选择状态" @change="selectTargetsun"> |
||||
|
<el-option |
||||
|
v-for="item in targetsunList" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item v-if="form.targetsun!=''"> |
||||
|
<!-- 表格表单提交 --> |
||||
|
<el-table |
||||
|
:data="rulesCopyList" |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
label="细则名称" |
||||
|
align="center" |
||||
|
prop="name" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="细则说明" |
||||
|
align="center" |
||||
|
prop="content" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="考核周期" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="辅助计数" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.cycleattr" autocomplete="off" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="单位" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.unit"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="分值" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model.number="scope.row.referencescore"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="分值" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-cascader clearable v-model="scope.row.userlist" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteRow(scope)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="editChildInfo.title!=''">{{editChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getEditCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist } from '@/api/duty/dimension' |
||||
|
import { gettasktarget,gettasktargetsun,gettasktargetcontary,addqualeval,getqualevallist } from '@/api/duty/duty' |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
grouplist, |
||||
|
departmentlist, |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
// 选择员工配置项 |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false, |
||||
|
multiple: true |
||||
|
}, |
||||
|
// 员工列表 |
||||
|
grouplistBackup:[], |
||||
|
// 周期列表 |
||||
|
options: [{ |
||||
|
value: 1, |
||||
|
label: '班' |
||||
|
}, { |
||||
|
value: 2, |
||||
|
label: '天' |
||||
|
}, { |
||||
|
value: 3, |
||||
|
label: '周' |
||||
|
}, { |
||||
|
value: 4, |
||||
|
label: '月' |
||||
|
}, { |
||||
|
value: 5, |
||||
|
label: '季度' |
||||
|
}, { |
||||
|
value: 6, |
||||
|
label: '年' |
||||
|
}], |
||||
|
// 考核细则表格显示 |
||||
|
tableShow:false, |
||||
|
// 子栏目列表 |
||||
|
targetsunList:[], |
||||
|
// 细则列表 |
||||
|
rulesList:[], |
||||
|
// 细则拷贝 |
||||
|
rulesCopyList:[], |
||||
|
// 考核指标列表 |
||||
|
indexList:[], |
||||
|
// 考核纬度列表 |
||||
|
dutyclasslist:[], |
||||
|
// 考核纬度请求值 |
||||
|
dutyClassFrom:{ |
||||
|
page: 1, //分页页码,数字类型 |
||||
|
pagesize: 100000, |
||||
|
state: 1 //状态(查询用) |
||||
|
}, |
||||
|
// 部门列表 |
||||
|
departmentList:[], |
||||
|
// 公司列表 |
||||
|
companyList:[], |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:1, |
||||
|
group:'', |
||||
|
parentid:'', |
||||
|
target:'', |
||||
|
targetsun:'' |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
// title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getDutyclasslist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除行 |
||||
|
deleteRow(row){ |
||||
|
this.rulesCopyList.splice(row.$index,1); |
||||
|
}, |
||||
|
// 选中指标后获取子栏目 |
||||
|
async selectIndex(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await gettasktargetsun(from) |
||||
|
this.targetsunList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 选中子栏目后获取对应的考核细则 |
||||
|
async selectTargetsun(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
type: 1, //1:定性考核;2:定量考核 |
||||
|
targetid: this.form.target.toString(), //指标 |
||||
|
targetsunid: val.toString() //子栏目 |
||||
|
|
||||
|
} |
||||
|
const res = await gettasktargetcontary(from) |
||||
|
this.rulesList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.rulesCopyList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.tableShow=true |
||||
|
} |
||||
|
}, |
||||
|
// 选中部门后获取指定的指标列表 |
||||
|
async selectDepartment(val){ |
||||
|
if (val!='') { |
||||
|
const indexFrom={ |
||||
|
type:1, |
||||
|
group:this.form.group.toString(), |
||||
|
department:val.map(String), |
||||
|
} |
||||
|
const res = await gettasktarget(indexFrom) |
||||
|
this.indexList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 获取考核纬度列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.dutyClassFrom) |
||||
|
this.dutyclasslist=res.data.list |
||||
|
}, |
||||
|
// 选中的公司值 |
||||
|
async selectGroup(val){ |
||||
|
if (val!='') { |
||||
|
const departmentFrom={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await departmentlist(departmentFrom) |
||||
|
this.departmentList=res.data |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取公司 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.companyList=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
this.editChildInfo.title=res.data.parentTitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
console.log("this.rulesCopyList") |
||||
|
console.log(this.rulesCopyList) |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.evaluationlist=this.rulesCopyList |
||||
|
this.form.group=this.form.group.toString(); |
||||
|
this.form.target=this.form.target.toString(); |
||||
|
this.form.targetsun=this.form.targetsun.toString(); |
||||
|
this.form.parentid=this.form.parentid.map(String); |
||||
|
const res = await addqualeval(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
this.rulesCopyList=[] |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await eitedutyinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await getqualevallist(this.searchInfo) |
||||
|
this.tableData = res.data |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
.kuang{ |
||||
|
border :solid 1px ; |
||||
|
} |
||||
|
</style> |
||||
File diff suppressed because it is too large
@ -0,0 +1,903 @@ |
|||||
|
<template> |
||||
|
<!-- 定量考核录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属定量考核"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<!-- <el-table :data="tableData" border :span-method="objectSpanMethod"> |
||||
|
<el-table-column prop="parentname" label="部门"></el-table-column> |
||||
|
<el-table-column prop="dimensionname" label="考核维度"></el-table-column> |
||||
|
<el-table-column prop="targetname" label="考核指标"></el-table-column> |
||||
|
<el-table-column prop="unit" label="单位"/> |
||||
|
<el-table-column prop="referencescore" label="分值"/> |
||||
|
<el-table-column prop="cycle" label="周期"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-tag v-if="scope.row.cycle==1">班</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==2">天</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==3">周</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==4">月</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==5">季度</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==6">年</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="cycleattr" label="辅助计数"/> |
||||
|
<el-table-column prop="userlist" label="执行人"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-view" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showUserList(scope.row)" |
||||
|
>查看</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> --> |
||||
|
<el-table :data="tableData" border :span-method="objectSpanMethod"> |
||||
|
<el-table-column prop="parentname" label="部门"></el-table-column> |
||||
|
<el-table-column prop="dimensionname" label="考核维度"> |
||||
|
|
||||
|
</el-table-column> |
||||
|
<el-table-column prop="targetname" label="考核指标"> |
||||
|
<template slot-scope="scope"> |
||||
|
{{scope.row.targetname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="unit" label="单位"/> |
||||
|
<!-- <el-table-column prop="referencescore" label="分值"/> --> |
||||
|
<el-table-column prop="cycle" label="周期"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-tag v-if="scope.row.cycle==1">班</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==2">天</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==3">周</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==4">月</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==5">季度</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==6">年</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="cycleattr" label="频次"> |
||||
|
<template slot-scope="scope"> |
||||
|
<div v-if="scope.row.cycle==1">每班{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==2">每天{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==3">每周{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==4">每月{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==5">每季度{{scope.row.cycleattr}}次</div> |
||||
|
<div v-if="scope.row.cycle==6">每年{{scope.row.cycleattr}}次</div> |
||||
|
|
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="userlist" label="执行人"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-view" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showUserList(scope.row)" |
||||
|
>查看</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>修改</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!-- <el-table-column label="考核办法"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-view" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showMethod(scope.row)" |
||||
|
>查看</el-button> |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
|
||||
|
</el-table> |
||||
|
|
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="65%"> |
||||
|
|
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属公司" prop="title"> |
||||
|
<el-select v-model="form.group" clearable placeholder="请选择" @change="selectGroup"> |
||||
|
<el-option |
||||
|
v-for="item in companyList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属部门" prop="title" v-if="form.group!=''"> |
||||
|
<el-select multiple v-model="form.parentid" clearable placeholder="请选择" @change="selectDepartment"> |
||||
|
<el-option |
||||
|
v-for="item in departmentList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="考核维度"> |
||||
|
<el-select v-model="form.dimension" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
|
||||
|
</el-row> |
||||
|
<el-form-item v-if="form.parentid!=''"> |
||||
|
<!-- 表格表单提交 --> |
||||
|
<el-table |
||||
|
:data="indexList" |
||||
|
style="width: 100%"> |
||||
|
|
||||
|
<el-table-column |
||||
|
label="名称" |
||||
|
align="center" |
||||
|
prop="title" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="考核周期" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="辅助计数" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.cycleattr" autocomplete="off" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="单位" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.unites"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!-- <el-table-column |
||||
|
label="分值" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model.number="scope.row.referencescore"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
<el-table-column |
||||
|
label="数据提报" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-cascader clearable v-model="scope.row.reportlist" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteRow(scope)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 人员弹框 --> |
||||
|
<el-dialog :visible.sync="showUser" title="执行人" width="30%"> |
||||
|
<el-descriptions class="margin-top" :column="3" size="medium" border> |
||||
|
<el-descriptions-item v-for="item in userlistary" :key="item.key"> |
||||
|
<template slot="label"> |
||||
|
<i class="el-icon-user"></i> |
||||
|
姓名 |
||||
|
</template> |
||||
|
{{item.name}} |
||||
|
</el-descriptions-item> |
||||
|
</el-descriptions> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="65%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item> |
||||
|
<!-- 表格表单提交 --> |
||||
|
<el-table |
||||
|
:data="editAdd.list" |
||||
|
style="width: 100%"> |
||||
|
|
||||
|
<el-table-column |
||||
|
label="名称" |
||||
|
align="center" |
||||
|
prop="name" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="考核周期" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="频次" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model.number="scope.row.cycleattr" autocomplete="off" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="单位" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.unit"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!-- <el-table-column |
||||
|
label="分值" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model.number="scope.row.referencescore"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
<el-table-column |
||||
|
label="数据提报人员" |
||||
|
align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-cascader clearable v-model="scope.row.userlist" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!-- <el-table-column align="left" fixed="right" label="操作"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteRow(scope)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
</el-table> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist } from '@/api/duty/dimension' |
||||
|
import { eiterationlist,gettasktarget,gettasktargetsun,gettasktargetcontary,addqualeval,addration,departmenttasklist,delqualevalcont,delrationlist,getrationlist } from '@/api/duty/duty' |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
grouplist, |
||||
|
departmentlist, |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
// 执行人列表 |
||||
|
userlistary:[], |
||||
|
// 执行人列表弹窗 |
||||
|
showUser:false, |
||||
|
// 选择员工配置项 |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false, |
||||
|
multiple: true |
||||
|
}, |
||||
|
// 员工列表 |
||||
|
grouplistBackup:[], |
||||
|
// 周期列表 |
||||
|
options: [{ |
||||
|
value: 1, |
||||
|
label: '班' |
||||
|
}, { |
||||
|
value: 2, |
||||
|
label: '天' |
||||
|
}, { |
||||
|
value: 3, |
||||
|
label: '周' |
||||
|
}, { |
||||
|
value: 4, |
||||
|
label: '月' |
||||
|
}, { |
||||
|
value: 5, |
||||
|
label: '季度' |
||||
|
}, { |
||||
|
value: 6, |
||||
|
label: '年' |
||||
|
}], |
||||
|
// 考核细则表格显示 |
||||
|
tableShow:false, |
||||
|
// 子栏目列表 |
||||
|
targetsunList:[], |
||||
|
// 细则列表 |
||||
|
rulesList:[], |
||||
|
// 细则拷贝 |
||||
|
rulesCopyList:[], |
||||
|
// 考核指标列表 |
||||
|
indexList:[], |
||||
|
// 考核纬度列表 |
||||
|
dutyclasslist:[], |
||||
|
// 考核纬度请求值 |
||||
|
dutyClassFrom:{ |
||||
|
page: 1, //分页页码,数字类型 |
||||
|
pagesize: 100000, |
||||
|
state: 1 //状态(查询用) |
||||
|
}, |
||||
|
// 部门列表 |
||||
|
departmentList:[], |
||||
|
// 公司列表 |
||||
|
companyList:[], |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:1, |
||||
|
group:'', |
||||
|
parentid:'', |
||||
|
target:'', |
||||
|
targetsun:'', |
||||
|
rationlist:[], |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
pos:'', |
||||
|
pos1:'', |
||||
|
pos2:'', |
||||
|
spanArr:[], |
||||
|
spanArr1:[], |
||||
|
spanArr2:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
type:1, |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
// title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editDepartmentFrom:{ |
||||
|
|
||||
|
}, |
||||
|
editDepartmentList:[], |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getDutyclasslist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
// 监听数据 |
||||
|
watch: { |
||||
|
tableData() { |
||||
|
this.$nextTick(() => { |
||||
|
this.spanArr=[], |
||||
|
this.spanArr1=[], |
||||
|
this.spanArr2=[], |
||||
|
this.pos='', |
||||
|
this.pos1='', |
||||
|
this.pos2='', |
||||
|
//此时就可以获取到在created赋值后的dataList了 |
||||
|
this.getSpanArr(this.tableData); |
||||
|
this.getSpanArr1(this.tableData); |
||||
|
this.getSpanArr2(this.tableData); |
||||
|
}); |
||||
|
}, |
||||
|
// 'editAdd.group'(newValue, oldValue) { |
||||
|
// console.log("newValue") |
||||
|
// console.log(newValue) |
||||
|
// this.editDepartmentFrom.id=newValue |
||||
|
// this.getDepart() |
||||
|
// } |
||||
|
}, |
||||
|
methods: { |
||||
|
async getDepart(){ |
||||
|
const respon = await departmentlist(this.editDepartmentFrom) |
||||
|
this.editDepartmentList=respon.data |
||||
|
}, |
||||
|
// 点击查看人员列表 |
||||
|
showUserList(row){ |
||||
|
this.showUser=true |
||||
|
this.userlistary=row.userlistary |
||||
|
}, |
||||
|
// 部门列合并 |
||||
|
getSpanArr(data) { |
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.spanArr.push(1); |
||||
|
this.pos = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].parentid === data[i - 1].parentid) { |
||||
|
this.spanArr[this.pos] += 1; |
||||
|
this.spanArr.push(0); |
||||
|
} else { |
||||
|
this.spanArr.push(1); |
||||
|
this.pos = i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 维度列合并 |
||||
|
getSpanArr1(data) { |
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.spanArr1.push(1); |
||||
|
this.pos1 = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].dimension === data[i - 1].dimension) { |
||||
|
this.spanArr1[this.pos1] += 1; |
||||
|
this.spanArr1.push(0); |
||||
|
} else { |
||||
|
this.spanArr1.push(1); |
||||
|
this.pos1 = i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 指标合并 |
||||
|
getSpanArr2(data) { |
||||
|
// data就是我们从后台拿到的数据 |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (i === 0) { |
||||
|
this.spanArr2.push(1); |
||||
|
this.pos2 = 0; |
||||
|
} else { |
||||
|
// 判断当前元素与上一个元素是否相同 |
||||
|
if (data[i].target === data[i - 1].target) { |
||||
|
this.spanArr2[this.pos2] += 1; |
||||
|
this.spanArr2.push(0); |
||||
|
} else { |
||||
|
this.spanArr2.push(1); |
||||
|
this.pos2 = i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 合并行 |
||||
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) { |
||||
|
if (columnIndex === 0) { |
||||
|
const _row = this.spanArr[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
console.log(`rowspan:${_row} colspan:${_col}`); |
||||
|
return { |
||||
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
}; |
||||
|
} |
||||
|
if (columnIndex === 1) { |
||||
|
const _row = this.spanArr1[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
console.log(`rowspan:${_row} colspan:${_col}`); |
||||
|
return { |
||||
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
}; |
||||
|
} |
||||
|
if (columnIndex === 2||3||4||5||6||7) { |
||||
|
const _row = this.spanArr2[rowIndex]; |
||||
|
const _col = _row > 0 ? 1 : 0; |
||||
|
// console.log(`rowspan:${_row} colspan:${_col}`); |
||||
|
return { |
||||
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
}; |
||||
|
} |
||||
|
}, |
||||
|
// 删除行 |
||||
|
deleteRow(row){ |
||||
|
this.rulesCopyList.splice(row.$index,1); |
||||
|
}, |
||||
|
// 选中指标后获取子栏目 |
||||
|
async selectIndex(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await gettasktargetsun(from) |
||||
|
this.targetsunList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 选中子栏目后获取对应的考核细则 |
||||
|
async selectTargetsun(val){ |
||||
|
if (val!='') { |
||||
|
const from={ |
||||
|
type: 1, //1:定性考核;2:定量考核 |
||||
|
targetid: this.form.target.toString(), //指标 |
||||
|
targetsunid: val.toString() //子栏目 |
||||
|
|
||||
|
} |
||||
|
const res = await gettasktargetcontary(from) |
||||
|
this.rulesList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.rulesCopyList=JSON.parse(JSON.stringify(res.data)) |
||||
|
this.tableShow=true |
||||
|
} |
||||
|
}, |
||||
|
// 选中部门后获取指定的指标列表 |
||||
|
async selectDepartment(val){ |
||||
|
if (val!='') { |
||||
|
const indexFrom={ |
||||
|
type:2, |
||||
|
group:this.form.group.toString(), |
||||
|
parentid:val.map(String), |
||||
|
} |
||||
|
const res = await gettasktarget(indexFrom) |
||||
|
this.indexList=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 获取考核纬度列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.dutyClassFrom) |
||||
|
this.dutyclasslist=res.data.list |
||||
|
}, |
||||
|
// 选中的公司值 |
||||
|
async selectGroup(val){ |
||||
|
if (val!='') { |
||||
|
const departmentFrom={ |
||||
|
id:val |
||||
|
} |
||||
|
const res = await departmentlist(departmentFrom) |
||||
|
this.departmentList=res.data |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取公司 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.companyList=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
console.log("row") |
||||
|
console.log(row) |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
const deleFrom={ |
||||
|
type: 2, //1:定性考核;2:定量考核 |
||||
|
group: row.group, //归属集团 |
||||
|
departmentid: row.parentid, //被考核部门 |
||||
|
dimension: row.dimension, //维度 |
||||
|
target: row.target, //考核指标 |
||||
|
// targetsun: row.targetsun //考核指标子栏目 |
||||
|
} |
||||
|
const res = await delrationlist(deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
const editFrom={ |
||||
|
group: row.group, //归属集团 |
||||
|
departmentid: row.parentid, //被考核部门 |
||||
|
dimension: row.dimension //维度 |
||||
|
} |
||||
|
console.log(row) |
||||
|
const res = await getrationlist(editFrom) |
||||
|
this.editAdd = res.data |
||||
|
|
||||
|
|
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
console.log("this.rulesCopyList") |
||||
|
console.log(this.rulesCopyList) |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const that=this |
||||
|
this.indexList.forEach(function(item, index) { |
||||
|
//item 就是当日按循环到的对象 |
||||
|
//index是循环的索引,从0开始 |
||||
|
that.form.rationlist.push({id:item.id.toString(),unit:item.unites,cycle:item.cycle,cycleattr:item.cycleattr,userlist:item.reportlist}) |
||||
|
}) |
||||
|
this.form.group=this.form.group.toString(); |
||||
|
this.form.parentid=this.form.parentid.map(String); |
||||
|
const res = await addration(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eiterationlist(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await departmenttasklist(this.searchInfo) |
||||
|
this.tableData = res.data |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,409 @@ |
|||||
|
<template> |
||||
|
<!-- 考核细则录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属定性考核子类" prop="parentid"> |
||||
|
<el-select v-model="parentid" clearable placeholder="请选择" value-key="outid" @change="changeData"> |
||||
|
<el-option |
||||
|
v-for="item in targetList" |
||||
|
:key="item.outid" |
||||
|
:label="item.title" |
||||
|
:value="item"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核细则名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核细则状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="定性指标子栏目" prop="parentsuntitle"/> |
||||
|
<el-table-column align="left" label="名称" prop="title"/> |
||||
|
<el-table-column align="left" label="说明" prop="content"/> |
||||
|
<el-table-column align="left" label="考核维度状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outid)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="考核细则名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核细则说明" prop="title"> |
||||
|
<el-input v-model="form.content" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属定性考核子栏目" prop="parentid"> |
||||
|
<el-select v-model="addParentid" clearable placeholder="请选择" value-key="outid" @change="changeAddData"> |
||||
|
<el-option |
||||
|
v-for="item in targetList" |
||||
|
:key="item.outid" |
||||
|
:label="item.title" |
||||
|
:value="item"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="考核细则名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核细则说明" prop="title"> |
||||
|
<el-input v-model="editAdd.content" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属定性考核子栏目" prop="parentid"> |
||||
|
<el-select v-model="editParentid" clearable placeholder="请选择" value-key="outid" @change="changeEditData"> |
||||
|
<el-option |
||||
|
v-for="item in targetList" |
||||
|
:key="item.outid" |
||||
|
:label="item.title" |
||||
|
:value="item"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { adddetailedtarget,getdetailedtargetlist,getdetailedtarget,eitedetailedtarget,deldetailedtarget,getqualitativetargetlist } from '@/api/duty/rules' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
editParentid:'', |
||||
|
addParentid:'', |
||||
|
targetList:[], |
||||
|
targetSearchInfo:{ |
||||
|
page:1, |
||||
|
pagesize:10000, |
||||
|
}, |
||||
|
parentid:'', |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
parentid:'', |
||||
|
parentidsun:'' |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
|
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
parentid: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.gettargetList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 查询时获取的select值 |
||||
|
changeData(data){ |
||||
|
this.searchInfo.parentid=data.parentidstr |
||||
|
this.searchInfo.parentidsun=data.outid |
||||
|
console.log(data) |
||||
|
}, |
||||
|
// 添加时获取的select值 |
||||
|
changeAddData(data){ |
||||
|
console.log(data) |
||||
|
this.form.parentid=data.parentidstr |
||||
|
this.form.parentidsun=data.outid |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改时获取的select值 |
||||
|
changeEditData(data){ |
||||
|
this.editAdd.parentid=data.parentidstr |
||||
|
this.editAdd.parentidsun=data.outid |
||||
|
}, |
||||
|
// 获取定性指标 |
||||
|
async gettargetList(){ |
||||
|
const res = await getqualitativetargetlist(this.targetSearchInfo) |
||||
|
this.targetList = res.data.list |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outid; |
||||
|
const res = await deldetailedtarget(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outid |
||||
|
const res = await getdetailedtarget(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editParentid=res.data.parentsuntitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await deldetailedtarget(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await deldetailedtarget(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
console.log("addParentid") |
||||
|
console.log(this.addParentid) |
||||
|
const res = await adddetailedtarget(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.editAdd.parentidsun=this.editAdd.parentidsun.toString() |
||||
|
this.editAdd.parentid=this.editAdd.parentidstr.toString() |
||||
|
const res = await eitedetailedtarget(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = { |
||||
|
parentid:'', |
||||
|
parentidsun:'' |
||||
|
}, |
||||
|
this.addParentid='', |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await getdetailedtargetlist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,373 @@ |
|||||
|
<template> |
||||
|
<!-- 定性指标子栏目录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属定性考核" prop="parentid"> |
||||
|
<el-select v-model="searchInfo.parentid" clearable placeholder="请选择考核维度"> |
||||
|
<el-option |
||||
|
v-for="item in targetList" |
||||
|
:key="item.outid" |
||||
|
:label="item.title" |
||||
|
:value="item.outid"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标子栏目名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标子栏目状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="定性指标" prop="parenttitle"/> |
||||
|
<el-table-column align="left" label="名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核维度状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outid)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="定性指标子栏目名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属定性考核" prop="parentid"> |
||||
|
<el-select v-model="form.parentid" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in targetList" |
||||
|
:key="item.outid" |
||||
|
:label="item.title" |
||||
|
:value="item.outid"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="定性指标子栏目名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属定性考核" prop="parentid"> |
||||
|
<el-select v-model="editAdd.parentidstr" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in targetList" |
||||
|
:key="item.outid" |
||||
|
:label="item.title" |
||||
|
:value="item.outid"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { gettarget } from '@/api/duty/project' |
||||
|
import { addqualitativetarget,getqualitativetargetlist,getqualitativetargetinfo,eitequalitativetargetinfo,delqualitativetargetinfo } from '@/api/duty/rules' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
targetList:[], |
||||
|
targetSearchInfo:{ |
||||
|
type:1, |
||||
|
page:1, |
||||
|
pagesize:10000, |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
parentid: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
parentid: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.gettargetList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取定性指标 |
||||
|
async gettargetList(){ |
||||
|
const res = await gettarget(this.targetSearchInfo) |
||||
|
this.targetList = res.data.list |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outid; |
||||
|
const res = await delqualitativetargetinfo(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outid |
||||
|
const res = await getqualitativetargetinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await delqualitativetargetinfo(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await delqualitativetargetinfo(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await addqualitativetarget(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
this.editAdd.parentid=this.editAdd.parentidstr.toString() |
||||
|
const res = await eitequalitativetargetinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await getqualitativetargetlist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,326 @@ |
|||||
|
<template> |
||||
|
<!-- 考核维度录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="考核维度名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核维度状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="考核维度ID" prop="outId"/> |
||||
|
<el-table-column align="left" label="考核维度名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核维度状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyclassinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await adddutyclass(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitedutyclassinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutyclasslist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,326 @@ |
|||||
|
<template> |
||||
|
<!-- 岗位录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="岗位名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="岗位状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="岗位ID" prop="outId"/> |
||||
|
<el-table-column align="left" label="岗位名称" prop="title"/> |
||||
|
<el-table-column align="left" label="岗位状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="岗位名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="岗位名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyclassinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await adddutyclass(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitedutyclassinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutyclasslist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,472 @@ |
|||||
|
<template> |
||||
|
<!-- 考核项目录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="考核项目名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属考核类别"> |
||||
|
<el-select v-model="searchInfo.parentId" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="所属考核类别" prop="parentTitle"/> |
||||
|
|
||||
|
<el-table-column align="left" label="考核项目名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核周期" prop="outId"> |
||||
|
<template #default="scope"> |
||||
|
<el-tag v-if="scope.row.cycle==1">天</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==2">周</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==3">月</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==4">季度</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==5">年</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="计量单位" prop="unites"/> |
||||
|
<el-table-column align="left" label="辅助计数" prop="cycleattr"/> |
||||
|
<el-table-column align="left" label="考核项目说明" prop="content"/> |
||||
|
<el-table-column align="left" label="考核项目状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="30%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属考核类别" prop="parentId"> |
||||
|
<el-select v-model="form.parentId" clearable placeholder="请选择考核类别"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计量单位" prop="unittitle"> |
||||
|
<el-input v-model="form.unittitle" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核周期" prop="title"> |
||||
|
<el-select v-model="form.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="辅助计数" prop="cycleattr"> |
||||
|
<el-input v-model="form.cycleattr" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="form.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核类别" prop="parentId"> |
||||
|
<el-select v-model="editAdd.parentId" class="m-2" placeholder="Select" size="large" @change="$forceUpdate()"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId" |
||||
|
> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
<!-- <el-select v-model="editAdd.parentId" clearable placeholder="请选择考核类别"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> --> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计量单位" prop="unites"> |
||||
|
<el-input v-model="editAdd.unites" autocomplete="off"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核周期" prop="title"> |
||||
|
<el-select v-model="editAdd.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="辅助计数" prop="cycleattr"> |
||||
|
<el-input v-model="editAdd.cycleattr" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核项目说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist } from '@/api/duty/dimension' |
||||
|
import { assessList,addassessinfo,getassessinfo,eiteassessinfo,eiteassessstate } from '@/api/duty/project' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
options: [{ |
||||
|
value: 1, |
||||
|
label: '天' |
||||
|
}, { |
||||
|
value: 2, |
||||
|
label: '周' |
||||
|
}, { |
||||
|
value: 3, |
||||
|
label: '月' |
||||
|
}, { |
||||
|
value: 4, |
||||
|
label: '季度' |
||||
|
}, { |
||||
|
value: 5, |
||||
|
label: '年' |
||||
|
}], |
||||
|
dutyclasslist:{}, |
||||
|
searchList:{ |
||||
|
page:1, |
||||
|
pagesize:10000, |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
unittitle:'', |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
content: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
parentId: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
unittitle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycleattr: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
content: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
parentId: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
unites: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycleattr: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getDutyclasslist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取考核纬度列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.searchList) |
||||
|
this.dutyclasslist=res.data.list |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getassessinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
console.log("this.editAdd") |
||||
|
console.log(this.editAdd) |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eiteassessstate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eiteassessstate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.cycleattr =parseInt(this.form.cycleattr) |
||||
|
const res = await addassessinfo(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.editAdd.cycleattr =parseInt(this.editAdd.cycleattr) |
||||
|
this.editAdd.unittitle =this.editAdd.unites |
||||
|
const res = await eiteassessinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await assessList(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,431 @@ |
|||||
|
<template> |
||||
|
<!-- 定性指标录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="所属考核项目" prop="parentTitle"/> |
||||
|
<el-table-column align="left" label="定性指标名称" prop="title"/> |
||||
|
<el-table-column align="left" label="定性指标说明" prop="contenting"/> |
||||
|
<el-table-column align="left" label="定性指标状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="addChildInfo.title!=''">{{addChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="form.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="editChildInfo.title!=''">{{editChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getEditCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,adddutyinfo,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:2 |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取部门 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.grouplist=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
this.editChildInfo.title=res.data.parentTitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.parentId=this.addChildInfo.outId |
||||
|
const res = await adddutyinfo(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await eitedutyinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutylist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,432 @@ |
|||||
|
<template> |
||||
|
<!-- 定量指标录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="所属考核项目" prop="parentTitle"/> |
||||
|
<el-table-column align="left" label="定量指标名称" prop="title"/> |
||||
|
<el-table-column align="left" label="定量指标说明" prop="contenting"/> |
||||
|
<el-table-column align="left" label="定量指标状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="addChildInfo.title!=''">{{addChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="form.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="editChildInfo.title!=''">{{editChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getEditCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,adddutyinfo,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:2 |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取部门 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.grouplist=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
this.editChildInfo.title=res.data.parentTitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.parentId=this.addChildInfo.outId |
||||
|
const res = await adddutyinfo(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await eitedutyinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutylist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
@ -0,0 +1,326 @@ |
|||||
|
<template> |
||||
|
<!-- 考核维度录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="考核维度名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核维度状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="考核维度ID" prop="outId"/> |
||||
|
<el-table-column align="left" label="考核维度名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核维度状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyclassinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await adddutyclass(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitedutyclassinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutyclasslist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,326 @@ |
|||||
|
<template> |
||||
|
<!-- 考核维度录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="考核维度名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核维度状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="考核维度ID" prop="outId"/> |
||||
|
<el-table-column align="left" label="考核维度名称" prop="title"/> |
||||
|
<el-table-column align="left" label="考核维度状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="考核维度名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyclassinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await adddutyclass(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitedutyclassinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutyclasslist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,326 @@ |
|||||
|
<template> |
||||
|
<!-- 岗位录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="岗位名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="岗位状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="岗位ID" prop="outId"/> |
||||
|
<el-table-column align="left" label="岗位名称" prop="title"/> |
||||
|
<el-table-column align="left" label="岗位状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="岗位名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="岗位名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyclassinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await statedutyclass(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await adddutyclass(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitedutyclassinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutyclasslist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,583 @@ |
|||||
|
<template> |
||||
|
<!-- 考核指标录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="考核指标"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否通用" prop="share"> |
||||
|
<el-select v-model="searchInfo.share" placeholder="请选择是否通用"> |
||||
|
<el-option label="通用指标" :value=1></el-option> |
||||
|
<el-option label="个性指标" :value=2></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item label="考核维度"> |
||||
|
<el-select v-model="searchInfo.parentId" clearable placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item label="指标性质" prop="type"> |
||||
|
<el-select v-model="searchInfo.type" placeholder="请选择指标性质"> |
||||
|
<el-option label="定性指标" :value=1></el-option> |
||||
|
<el-option label="定量指标" :value=2></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<!-- <el-table-column align="left" label="考核维度" prop="parentTitle"/> --> |
||||
|
<el-table-column align="left" label="考核指标" prop="title"/> |
||||
|
<el-table-column align="left" label="考核周期" prop="outId"> |
||||
|
<template #default="scope"> |
||||
|
|
||||
|
<el-tag v-if="scope.row.cycle==1">班</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==2">天</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==3">周</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==4">月</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==5">季度</el-tag> |
||||
|
<el-tag v-if="scope.row.cycle==6">年</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="是否通用"> |
||||
|
<template #default="scope"> |
||||
|
<div v-if="scope.row.share==1">通用指标</div> |
||||
|
<div v-if="scope.row.share==2">个性指标</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="指标性质"> |
||||
|
<template #default="scope"> |
||||
|
<div v-if="scope.row.type==1">定性指标</div> |
||||
|
<div v-if="scope.row.type==2">定量指标</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="关联部门"> |
||||
|
<template #default="scope"> |
||||
|
<div v-for="item in scope.row.relevantdepartmentsmap" :key="item.key">{{item.title}}</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="数据提交"> |
||||
|
<template #default="scope"> |
||||
|
<div v-for="item in scope.row.reportmap" :key="item.key">{{item.title}}</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="计量单位" prop="unites"/> |
||||
|
<el-table-column align="left" label="辅助计数" prop="cycleattr"/> |
||||
|
<el-table-column align="left" label="状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outid)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="30%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
|
||||
|
<el-form-item label="指标名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否通用" prop="share"> |
||||
|
<el-select v-model="form.share" placeholder="请选择是否通用"> |
||||
|
<el-option label="通用指标" :value=1></el-option> |
||||
|
<el-option label="个性指标" :value=2></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item v-if="form.share==2" label="关联部门" prop="relevantdepartments"> |
||||
|
<el-cascader clearable v-model="form.relevantdepartments" :options="grouplist" :show-all-levels="false" :props="props"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item label="所属考核维度" prop="dimension"> |
||||
|
<el-select v-model="form.dimension" clearable placeholder="请选择考核维度"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item label="指标性质" prop="type"> |
||||
|
<el-select v-model="form.type" placeholder="请选择指标性质"> |
||||
|
<el-option label="定性指标" :value=1></el-option> |
||||
|
<el-option label="定量指标" :value=2></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计量单位" prop="unites"> |
||||
|
<el-input v-model="form.unites" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="数据提交" prop="report"> |
||||
|
<el-cascader clearable v-model="form.report" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="辅助计数" prop="cycleattr"> |
||||
|
<el-input v-model="form.cycleattr" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核周期" prop="cycle"> |
||||
|
<el-select v-model="form.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
|
||||
|
<el-form-item label="指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否通用" prop="share"> |
||||
|
<el-select v-model="editAdd.share" placeholder="请选择是否通用"> |
||||
|
<el-option label="通用指标" :value=1></el-option> |
||||
|
<el-option label="个性指标" :value=2></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item v-if="editAdd.share==2" label="关联部门" prop="relevantdepartmentsmap"> |
||||
|
<el-cascader clearable v-model="editAdd.relevantdepartmentsmap" :options="grouplist" :show-all-levels="false" :props="props"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item label="所属考核维度" prop="dimension"> |
||||
|
<el-select v-model="form.dimension" clearable placeholder="请选择考核维度"> |
||||
|
<el-option |
||||
|
v-for="item in dutyclasslist" |
||||
|
:key="item.outId" |
||||
|
:label="item.title" |
||||
|
:value="item.outId"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item label="指标性质" prop="type"> |
||||
|
<el-select v-model="editAdd.type" placeholder="请选择指标性质"> |
||||
|
<el-option label="定性指标" :value=1></el-option> |
||||
|
<el-option label="定量指标" :value=2></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计量单位" prop="unites"> |
||||
|
<el-input v-model="editAdd.unites" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="数据提交" prop="report"> |
||||
|
<el-cascader clearable v-model="editAdd.reportmap" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="辅助计数" prop="cycleattr"> |
||||
|
<el-input v-model="editAdd.cycleattr" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="考核周期" prop="cycle"> |
||||
|
<el-select v-model="editAdd.cycle" placeholder="请选择考核周期"> |
||||
|
<el-option |
||||
|
v-for="item in options" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { dutyclasslist } from '@/api/duty/dimension' |
||||
|
import { gettarget,addtarget,gettargetinfo,eiteassessinfo,eitetarget,deltarget } from '@/api/duty/project' |
||||
|
import { |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
data() { |
||||
|
return { |
||||
|
grouplistBackup:[], |
||||
|
grouplist:[], |
||||
|
// 1:班;2:天;3:周;4:月;5:季度;6:年 |
||||
|
options: [{ |
||||
|
value: 1, |
||||
|
label: '班' |
||||
|
}, { |
||||
|
value: 2, |
||||
|
label: '天' |
||||
|
}, { |
||||
|
value: 3, |
||||
|
label: '周' |
||||
|
}, { |
||||
|
value: 4, |
||||
|
label: '月' |
||||
|
}, { |
||||
|
value: 5, |
||||
|
label: '季度' |
||||
|
}, { |
||||
|
value: 6, |
||||
|
label: '年' |
||||
|
}], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false, |
||||
|
multiple: true |
||||
|
}, |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false, |
||||
|
multiple: true |
||||
|
}, |
||||
|
dutyclasslist:{}, |
||||
|
searchList:{ |
||||
|
page:1, |
||||
|
pagesize:10000, |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
unittitle:'', |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
type: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
share: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
relevantdepartments: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
dimension: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
report: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
unites: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycleattr: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
type: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
share: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
relevantdepartments: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
dimension: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
report: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
unites: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycle: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
cycleattr: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getDutyclasslist() |
||||
|
this.getSystemadminlist() |
||||
|
this.getGrouplist() |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取人员列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取部门 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.grouplist=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 获取考核纬度列表 |
||||
|
async getDutyclasslist(){ |
||||
|
const res = await dutyclasslist(this.searchList) |
||||
|
this.dutyclasslist=res.data.list |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outid; |
||||
|
const res = await deltarget(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
console.log(this.dialogFormVisible) |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outid |
||||
|
const res = await gettargetinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
console.log("this.editAdd") |
||||
|
console.log(this.editAdd) |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await deltarget(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await deltarget(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
if(this.form.relevantdepartments!=null){ |
||||
|
this.form.relevantdepartments=this.form.relevantdepartments.map(String) |
||||
|
} |
||||
|
this.form.cycleattr =parseInt(this.form.cycleattr) |
||||
|
const res = await addtarget(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
if(this.editAdd.relevantdepartmentsmap!=null){ |
||||
|
this.editAdd.relevantdepartments=this.editAdd.relevantdepartmentsmap.map(String) |
||||
|
} |
||||
|
if(this.editAdd.relevantdepartmentsmap==null){ |
||||
|
this.editAdd.relevantdepartments=this.editAdd.relevantdepartments.split(',') |
||||
|
} |
||||
|
if(this.editAdd.visiblerangedepartmap==null){ |
||||
|
this.editAdd.visiblerange=this.editAdd.visiblerange.split(',') |
||||
|
} |
||||
|
if(this.editAdd.visiblerangegroupmap==null){ |
||||
|
this.editAdd.visiblerangegroup=this.editAdd.visiblerangegroup.split(',') |
||||
|
} |
||||
|
console.log(this.editAdd.relevantdepartments) |
||||
|
this.editAdd.report=this.editAdd.reportmap |
||||
|
this.editAdd.dimension=this.editAdd.dimension.toString(); |
||||
|
this.editAdd.cycleattr =parseInt(this.editAdd.cycleattr) |
||||
|
const res = await eitetarget(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
console.log("closeDialog") |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
console.log("initForm") |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form = {} |
||||
|
console.log(this.form) |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = {} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await gettarget(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,437 @@ |
|||||
|
<template> |
||||
|
<!-- 定性指标录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="所属考核项目" prop="parentTitle"/> |
||||
|
<el-table-column align="left" label="定性指标名称" prop="title"/> |
||||
|
<el-table-column align="left" label="定性指标说明" prop="contenting"/> |
||||
|
<el-table-column align="left" label="定性指标状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="addChildInfo.title!=''">{{addChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item v-if="" label="关联部门" prop="userid"> |
||||
|
<el-cascader clearable v-model="form.groupId" :options="grouplist" :show-all-levels="false" :props="props"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="数据提交" prop="userid"> |
||||
|
<el-cascader clearable v-model="form.userid" :options="grouplistBackup" :show-all-levels="false" :props="userProps"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="form.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="editChildInfo.title!=''">{{editChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getEditCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定性指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,adddutyinfo,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:2 |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取部门 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.grouplist=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
this.editChildInfo.title=res.data.parentTitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.parentId=this.addChildInfo.outId |
||||
|
const res = await adddutyinfo(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await eitedutyinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutylist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,432 @@ |
|||||
|
<template> |
||||
|
<!-- 定量指标录入 --> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="childInfo.title!=''">{{childInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedInfo"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标名称"> |
||||
|
<el-input |
||||
|
placeholder="请输入名称" |
||||
|
v-model="searchInfo.title" |
||||
|
clearable> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标状态"> |
||||
|
<el-select v-model="searchInfo.state" clearable placeholder="请选择状态"> |
||||
|
<el-option :value=1 label="正常">正常</el-option> |
||||
|
<el-option :value=2 label="禁止">禁止</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column align="left" label="所属考核项目" prop="parentTitle"/> |
||||
|
<el-table-column align="left" label="定量指标名称" prop="title"/> |
||||
|
<el-table-column align="left" label="定量指标说明" prop="contenting"/> |
||||
|
<el-table-column align="left" label="定量指标状态"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
inline-prompt |
||||
|
active-text="正常" |
||||
|
inactive-text="禁止" |
||||
|
v-model="scope.row.state" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
:active-value=1 |
||||
|
:inactive-value=2 |
||||
|
@change="changeVal($event,scope.row.outId)" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:page-size="searchInfo.pagesize" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 新增弹框 --> |
||||
|
<el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="20%"> |
||||
|
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="addChildInfo.title!=''">{{addChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标名称" prop="title"> |
||||
|
<el-input v-model="form.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="form.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 编辑弹框 --> |
||||
|
<el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%"> |
||||
|
<el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px"> |
||||
|
<el-form-item label="所属考核项目"> |
||||
|
<span> |
||||
|
<el-tag v-if="editChildInfo.title!=''">{{editChildInfo.title}}</el-tag> |
||||
|
<projectDialog @checkedInfo="getEditCheckedfrom"></projectDialog> |
||||
|
</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标名称" prop="title"> |
||||
|
<el-input v-model="editAdd.title" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="定量指标说明" prop="content"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 2, maxRows: 4}" |
||||
|
placeholder="请输入内容" |
||||
|
v-model="editAdd.content"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="editCloseDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import projectDialog from '@/components/projectDialog/index.vue' |
||||
|
import { dutylist,adddutyinfo,getdutyinfo,eitedutyinfo,eitedutystate } from '@/api/duty/quantitativeIndicators' |
||||
|
import { |
||||
|
getgroupdepartmap, |
||||
|
getgroupuser |
||||
|
} from '@/api/duty/group' |
||||
|
export default { |
||||
|
name: 'Dashboard', |
||||
|
components: { |
||||
|
projectDialog |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
editChildInfo:{}, |
||||
|
grouplist:[], |
||||
|
props: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
userProps: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "groupUser", |
||||
|
emitPath:false |
||||
|
}, |
||||
|
addChildInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
childInfo:{ |
||||
|
title:'' |
||||
|
}, |
||||
|
// 查询详情的数据 |
||||
|
editFrom:{}, |
||||
|
// 修改状态提交数据 |
||||
|
switchFrom:{}, |
||||
|
// 删除数据提交 |
||||
|
deleFrom:{}, |
||||
|
// 编辑时数据 |
||||
|
editAdd:{ |
||||
|
parentId:'' |
||||
|
}, |
||||
|
assessList:{}, |
||||
|
// 添加数据 |
||||
|
form:{ |
||||
|
type:2 |
||||
|
}, |
||||
|
// 弹窗变量 |
||||
|
dialogFormVisible:false, |
||||
|
// 修改弹窗 |
||||
|
editDialogFormVisible:false, |
||||
|
total: 0, |
||||
|
tableData:[], |
||||
|
// 条件查询变量 |
||||
|
searchInfo: { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
}, |
||||
|
// 条件查询变量 |
||||
|
abc:{ |
||||
|
aaa:"111", |
||||
|
bbb:"222" |
||||
|
}, |
||||
|
// 添加时验证规则 |
||||
|
rules: { |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules:{ |
||||
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.$store.state.user.token) |
||||
|
if (this.$store.state.user.token=='') { |
||||
|
this.$router.push('/login') |
||||
|
} |
||||
|
// 页面渲染时获取初始数据 |
||||
|
this.getDataList() |
||||
|
this.getGrouplist() |
||||
|
this.getSystemadminlist() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 编辑获取选中组件值 |
||||
|
getEditCheckedfrom(data){ |
||||
|
this.editChildInfo=data |
||||
|
this.editAdd.parentId=this.editChildInfo.outId |
||||
|
}, |
||||
|
// 获取员工列表 |
||||
|
async getSystemadminlist(){ |
||||
|
const res = await getgroupuser() |
||||
|
this.grouplistBackup=res.data.list |
||||
|
}, |
||||
|
// 获取部门 |
||||
|
async getGrouplist(){ |
||||
|
const res = await getgroupdepartmap() |
||||
|
this.grouplist=res.data.list |
||||
|
|
||||
|
}, |
||||
|
// 添加获取选中组件值 |
||||
|
getCheckedfrom(data){ |
||||
|
this.addChildInfo=data |
||||
|
}, |
||||
|
// 获取选中组件值 |
||||
|
getCheckedInfo(data){ |
||||
|
this.childInfo=data |
||||
|
}, |
||||
|
//删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
this.deleFrom.state=3; |
||||
|
this.deleFrom.outid=row.outId; |
||||
|
const res = await statedutyclass(this.deleFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增按钮 |
||||
|
showAdd(){ |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 编辑按钮 |
||||
|
async showEdit(row){ |
||||
|
this.editFrom.outid=row.outId |
||||
|
const res = await getdutyinfo(this.editFrom) |
||||
|
this.editAdd = res.data |
||||
|
this.editAdd.parentId=res.data.parentIdStr |
||||
|
this.editChildInfo.title=res.data.parentTitle |
||||
|
this.editDialogFormVisible=true; |
||||
|
|
||||
|
}, |
||||
|
// 开关状态监听 |
||||
|
async changeVal(val,id){ |
||||
|
console.log(val) |
||||
|
this.switchFrom.outid=id |
||||
|
if (val==1) { |
||||
|
this.switchFrom.state=1; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} else { |
||||
|
this.switchFrom.state=2; |
||||
|
const res = await eitedutystate(this.switchFrom) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '修改状态成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 重置搜索条件 |
||||
|
onReset() { |
||||
|
this.searchInfo = { |
||||
|
assesstype:2, |
||||
|
page: 1, |
||||
|
pagesize: 10 |
||||
|
} |
||||
|
this.childInfo={ |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
// 条件搜索 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.searchInfo.parentId=this.childInfo.outId |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 日期时间戳转日期格式 |
||||
|
formatDate(nS) { |
||||
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); |
||||
|
}, |
||||
|
|
||||
|
// 提交按钮 |
||||
|
async enterDialog(){ |
||||
|
|
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
this.form.parentId=this.addChildInfo.outId |
||||
|
const res = await adddutyinfo(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.closeDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 编辑提交按钮 |
||||
|
async editEnterDialog(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
|
||||
|
const res = await eitedutyinfo(this.editAdd) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getDataList(); |
||||
|
this.editCloseDialog(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 添加框关闭 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 修改框关闭 |
||||
|
editCloseDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
// 添加重置表单 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.form={ |
||||
|
type:2 |
||||
|
} |
||||
|
}, |
||||
|
// 修改重置表单 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editAdd = { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 改变pageSize |
||||
|
handleSizeChange(val) { |
||||
|
this.searchInfo.pagesize=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 改变page |
||||
|
handleCurrentChange(val) { |
||||
|
this.searchInfo.page=val |
||||
|
this.getDataList(this.searchInfo) |
||||
|
}, |
||||
|
// 获取初始数据 |
||||
|
async getDataList() { |
||||
|
const res = await dutylist(this.searchInfo) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
this.searchInfo.page = res.data.page |
||||
|
this.searchInfo.pagesize = res.data.pageSize |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"folders": [ |
||||
|
{ |
||||
|
"path": "..\\..\\.." |
||||
|
} |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"folders": [ |
||||
|
{ |
||||
|
"path": "." |
||||
|
} |
||||
|
] |
||||
|
} |
||||
Loading…
Reference in new issue