10 changed files with 860 additions and 23 deletions
@ -0,0 +1,804 @@ |
|||
<template> |
|||
<!-- 指标目标录入 --> |
|||
<div class="dashboard-container"> |
|||
<div class="gva-search-box"> |
|||
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
|||
<el-form-item label="部门"> |
|||
<el-select v-model.string="searchInfo.departmentid" clearable placeholder="请选择" @change="shouWei"> |
|||
<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.number="searchInfo.year" placeholder="请选择"> |
|||
<el-option |
|||
v-for="item in yearList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</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 align="left" label="部门" prop="dimensiontitle"/> |
|||
<el-table-column align="left" label="年度" prop="year"/> |
|||
<el-table-column align="left" label="考核指标" prop="targettitle"/> |
|||
<el-table-column align="left" label="考核指标" prop="type"> |
|||
<template #default="scope"> |
|||
<el-tag v-if="scope.row.type==1">年度</el-tag> |
|||
<el-tag v-if="scope.row.type==2">季度</el-tag> |
|||
<el-tag v-if="scope.row.type==3">月度</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column align="left" fixed="right" label="奖值" width="200"> |
|||
<template #default="scope"> |
|||
<el-button |
|||
icon="el-icon-view" |
|||
size="small" |
|||
type="text" |
|||
@click="showJiang(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> |
|||
<!-- 新增弹框 --> |
|||
<el-dialog :close-on-click-modal="false" :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="60%"> |
|||
<el-form ref="addForm" :model="form" :rules="rules" label-width="150px"> |
|||
<el-form-item label="年度"> |
|||
<el-select v-model.number="form.year" placeholder="请选择"> |
|||
<el-option |
|||
v-for="item in yearList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="所属部门"> |
|||
<el-select v-model="form.department" clearable placeholder="请选择" @change="shouWei"> |
|||
<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="请选择" @change="shouZhi"> |
|||
<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.dimension!=''"> |
|||
<el-select v-model="form.target" clearable placeholder="请选择"> |
|||
<el-option |
|||
v-for="item in zhibiaoList" |
|||
:key="item.target" |
|||
:label="item.targetname" |
|||
:value="item.target"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="周期"> |
|||
<el-select v-model="form.cycle" placeholder="请选择" @change="selectZhou"> |
|||
<el-option |
|||
v-for="item in cycleList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="" v-if="form.cycle==1"> |
|||
<el-table |
|||
border |
|||
:data="nian" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
label="零奖值" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model.number="scope.row.zeroprize" autocomplete="off" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="全奖值" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model.number="scope.row.allprize" autocomplete="off" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form-item> |
|||
<el-form-item label="" v-if="form.cycle==2"> |
|||
<el-table |
|||
border |
|||
:data="jidu" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
label="季度" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
第{{scope.row.id}}季度 |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="零奖值" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model.number="scope.row.zeroprize" autocomplete="off" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="全奖值" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model.number="scope.row.allprize" autocomplete="off" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form-item> |
|||
<el-form-item label="" v-if="form.cycle==3"> |
|||
<el-table |
|||
border |
|||
:data="yue" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
label="月份" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
第{{scope.row.id}}月 |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="零奖值" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model.number="scope.row.zeroprize" autocomplete="off" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="全奖值" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model.number="scope.row.allprize" autocomplete="off" /> |
|||
</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="考核维度名称" prop="title"> |
|||
<el-input v-model="editAdd.title" autocomplete="off" /> |
|||
</el-form-item> |
|||
<el-form-item label="排序" prop="sort"> |
|||
<el-input v-model.number="editAdd.sort" 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> |
|||
<!-- 奖值弹窗 --> |
|||
<el-dialog :visible.sync="jiangZhiDialogFormVisible" title="奖值" width="40%"> |
|||
<el-table |
|||
border |
|||
:data="jiangzhiList" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
label="月份" |
|||
align="center" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div v-if="scope.row.type==3">第{{scope.row.timecopy}}月</div> |
|||
<div v-if="scope.row.type==2">第{{scope.row.timecopy}}季度</div> |
|||
<div v-if="scope.row.type==1">{{scope.row.timecopy}}</div> |
|||
|
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="零奖值" |
|||
align="center" |
|||
prop="zeroprize" |
|||
> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="全奖值" |
|||
align="center" |
|||
prop="allprize" |
|||
> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { gettasktarget,gettasktargetsun,gettasktargetcontary,addqualeval,addration,departmenttasklist,addqubatch,bumenList,departmentlistnew,adddepartmentdutyinfo,lookquantitativeconfig,setevaluationobjectives } from '@/api/duty/duty' |
|||
import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension' |
|||
import { |
|||
grouplist, |
|||
departmentlist, |
|||
getgroupdepartmap, |
|||
getgroupuser |
|||
} from '@/api/duty/group' |
|||
export default { |
|||
name: 'Dashboard', |
|||
data() { |
|||
return { |
|||
// 奖值弹窗 |
|||
jiangZhiDialogFormVisible:false, |
|||
|
|||
departmentList:[], |
|||
// 考核纬度请求值 |
|||
dutyClassFrom:{ |
|||
page: 1, //分页页码,数字类型 |
|||
pagesize: 100000, |
|||
state: 1 //状态(查询用) |
|||
}, |
|||
nian:[ |
|||
{ |
|||
id: 1, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
], |
|||
jiangZhi:Number, |
|||
jidu:[ |
|||
{ |
|||
id: 1, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 2, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 3, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 4, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
], |
|||
yue:[ |
|||
{ |
|||
id: 1, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 2, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 3, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 4, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 5, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 6, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 7, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 8, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 9, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 10, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 11, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
{ |
|||
id: 12, //季度与月度辅助值 |
|||
zeroprize: 0, //零奖值 |
|||
allprize: 100 //全奖值 |
|||
}, |
|||
], |
|||
cycleList:[{ |
|||
value: 1, |
|||
label: '年度' |
|||
},{ |
|||
value: 2, |
|||
label: '季度' |
|||
},{ |
|||
value: 3, |
|||
label: '月度' |
|||
},], |
|||
yearList:[{ |
|||
value: '2021', |
|||
label: '2021' |
|||
}, { |
|||
value: '2022', |
|||
label: '2022' |
|||
}, { |
|||
value: '2023', |
|||
label: '2023' |
|||
}, { |
|||
value: '2024', |
|||
label: '2024' |
|||
}, { |
|||
value: '2025', |
|||
label: '2025' |
|||
}, { |
|||
value: '2026', |
|||
label: '2026' |
|||
}, { |
|||
value: '2027', |
|||
label: '2027' |
|||
}, { |
|||
value: '2028', |
|||
label: '2028' |
|||
}, { |
|||
value: '2029', |
|||
label: '2029' |
|||
}, { |
|||
value: '2030', |
|||
label: '2030' |
|||
}], |
|||
jiangzhiList:[], |
|||
// 查询详情的数据 |
|||
editFrom:{}, |
|||
// 修改状态提交数据 |
|||
switchFrom:{}, |
|||
// 删除数据提交 |
|||
deleFrom:{}, |
|||
// 编辑时数据 |
|||
editAdd:{}, |
|||
assessList:{}, |
|||
// 添加数据 |
|||
form:{ |
|||
group:3, |
|||
}, |
|||
// 弹窗变量 |
|||
dialogFormVisible:false, |
|||
// 修改弹窗 |
|||
editDialogFormVisible:false, |
|||
total: 0, |
|||
tableData:[], |
|||
// 纬度列表 |
|||
dutyclasslist:[], |
|||
// 条件查询变量 |
|||
searchInfo: { |
|||
groupid:"3", |
|||
|
|||
}, |
|||
pos:'', |
|||
spanArr:[], |
|||
pos1:'', |
|||
spanArr1:[], |
|||
// 条件查询变量 |
|||
abc:{ |
|||
aaa:"111", |
|||
bbb:"222" |
|||
}, |
|||
zhibiaoList:[], |
|||
zhibiaoShow:false, |
|||
// 添加时验证规则 |
|||
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.selectGroup() |
|||
this.getDutyclasslist() |
|||
}, |
|||
watch:{ |
|||
tableData() { |
|||
this.$nextTick(() => { |
|||
this.spanArr=[], |
|||
this.pos='', |
|||
this.spanArr1=[], |
|||
this.pos1='', |
|||
//此时就可以获取到在created赋值后的dataList了 |
|||
this.getSpanArr(this.tableData); |
|||
this.getSpanArr1(this.tableData); |
|||
}); |
|||
}, |
|||
}, |
|||
methods: { |
|||
// 奖值 |
|||
async showJiang(row){ |
|||
const from = { |
|||
groupid: row.group.toString(), //集团 |
|||
departmentid: row.departmentid.toString(), //部门 |
|||
dimension: row.dimensionid, //维度 |
|||
target: row.target.toString(), //指标 |
|||
year: row.year, //年度 |
|||
} |
|||
const res = await lookquantitativeconfig(from) |
|||
this.jiangzhiList=res.data |
|||
this.jiangZhiDialogFormVisible=true |
|||
console.log("showJiang") |
|||
console.log(res) |
|||
}, |
|||
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].dimension === data[i - 1].dimension) { |
|||
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].time === data[i - 1].time) { |
|||
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||2||3||4) { |
|||
const _row = this.spanArr1[rowIndex]; |
|||
const _col = _row > 0 ? 1 : 0; |
|||
return { |
|||
// [0,0] 表示这一行不显示, [2,1]表示行的合并数 |
|||
rowspan: _row, |
|||
colspan: _col |
|||
}; |
|||
} |
|||
}, |
|||
// 选中周期 |
|||
selectZhou(val){ |
|||
if (val==1) { |
|||
this.jiangZhi=1 |
|||
} |
|||
if (val==2) { |
|||
this.jiangZhi=1 |
|||
} |
|||
if (val==3) { |
|||
this.jiangZhi=1 |
|||
} |
|||
}, |
|||
// 选中纬度后展示对应指标 |
|||
async shouZhi(val){ |
|||
const methodData={ |
|||
type: 2, //1:定性考核;2:定量考核 |
|||
group: 3, //归属集团 |
|||
departmentid: this.form.department, //被考核部门 |
|||
dimension: this.form.dimension, //维度 |
|||
} |
|||
const res = await departmenttasklist(methodData) |
|||
if (res.code==0) { |
|||
this.zhibiaoList=res.data |
|||
} |
|||
}, |
|||
// 获取考核纬度列表 |
|||
async getDutyclasslist(){ |
|||
const res = await dutyclasslist(this.dutyClassFrom) |
|||
this.dutyclasslist=res.data.list |
|||
}, |
|||
// 选中的公司值 |
|||
async selectGroup(){ |
|||
const departmentFrom={ |
|||
id:3 |
|||
} |
|||
const res = await departmentlist(departmentFrom) |
|||
this.departmentList=res.data |
|||
}, |
|||
// 选中部门后显示纬度卡片 |
|||
async shouWei(val){ |
|||
const methodData={ |
|||
type: 2, //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 |
|||
} |
|||
}, |
|||
// 删除操作 |
|||
//删除操作 |
|||
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 = { |
|||
groupid:"3", |
|||
} |
|||
}, |
|||
// 条件搜索 |
|||
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.cycle==1) { |
|||
this.form.cycleadded=this.nian |
|||
} |
|||
if (this.form.cycle==2) { |
|||
this.form.cycleadded=this.jidu |
|||
} |
|||
if (this.form.cycle==3) { |
|||
this.form.cycleadded=this.yue |
|||
} |
|||
const res = await setevaluationobjectives(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() { |
|||
console.log(this.searchInfo.departmentid) |
|||
if (this.searchInfo.departmentid!=undefined) { |
|||
this.searchInfo.departmentid=this.searchInfo.departmentid.toString() |
|||
} |
|||
|
|||
const res = await lookquantitativeconfig(this.searchInfo) |
|||
this.tableData = res.data |
|||
this.searchInfo = { |
|||
groupid:"3", |
|||
departmentid:'' |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.dashboard { |
|||
&-container { |
|||
margin: 30px; |
|||
} |
|||
&-text { |
|||
font-size: 30px; |
|||
line-height: 46px; |
|||
} |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue