Browse Source

修改评分

master
yangzhou-cyber 3 years ago
parent
commit
f8dbcf70bd
9 changed files with 338 additions and 74 deletions
  1. +6
    -0
      src/api/second/segmentation/basicTable.js
  2. +3
    -0
      src/api/second/segmentation/constraint.js
  3. +3
    -0
      src/api/second/segmentation/reward.js
  4. +3
    -0
      src/api/second/taskSummary.js
  5. +2
    -2
      src/config/setting.js
  6. +181
    -0
      src/views/second/summary/index.vue
  7. +63
    -26
      src/views/second/taskSummary/basicTable.vue
  8. +34
    -20
      src/views/second/taskSummary/constraint.vue
  9. +43
    -26
      src/views/second/taskSummary/reward.vue

+ 6
- 0
src/api/second/segmentation/basicTable.js View File

}, },
deleteItem(id){ deleteItem(id){
return axios.delete("/basictaskitem/deleteItem/"+id) return axios.delete("/basictaskitem/deleteItem/"+id)
},
editPoints(params){
return axios.post('/basictaskitem/updateItemDeduction',params)
},
getItemDeptScoreList(id){
return axios.get('/basictaskitem/getItemDeptScoreList/'+id)
} }
} }

+ 3
- 0
src/api/second/segmentation/constraint.js View File

}, },
deleteItem(id){ deleteItem(id){
return axios.delete("/rigidityconstraintitem/deleteItem/"+id) return axios.delete("/rigidityconstraintitem/deleteItem/"+id)
},
editPoints(params){
return axios.post('/rigidityconstraintitem/updateItemDeduction',params)
} }
} }

+ 3
- 0
src/api/second/segmentation/reward.js View File

}, },
deleteItem(id){ deleteItem(id){
return axios.delete("/specialpoweritem/deleteItem/"+id) return axios.delete("/specialpoweritem/deleteItem/"+id)
},
editPoints(params){
return axios.post('/specialpoweritem/updateItemBonus',params)
} }
} }

+ 3
- 0
src/api/second/taskSummary.js View File

}, },
exportRewardList(params){ exportRewardList(params){
return axios.get('/specialpoweritem/export',{params}) return axios.get('/specialpoweritem/export',{params})
},
getSummaryList(){
return axios.get('/statistics/reportDataSummary')
} }
} }

+ 2
- 2
src/config/setting.js View File

export default { export default {
version: '1.0', version: '1.0',
name: 'JNDZ考核管理系统', // 项目名称 name: 'JNDZ考核管理系统', // 项目名称
baseURL: 'http://121.40.249.52:9031/api/', // 接口地址
// baseURL: 'http://121.40.249.52:9031/api/', // 正式环境
baseURL:'http://47.98.157.120:9031/api/', //测试环境
whiteList: ['/login', '/forget'], // 路由白名单(不需要登录的) whiteList: ['/login', '/forget'], // 路由白名单(不需要登录的)
keepAliveList: [], // 需要缓存的组件名称 keepAliveList: [], // 需要缓存的组件名称
menuUrl: '/index/getMenuList', // 菜单数据接口 menuUrl: '/index/getMenuList', // 菜单数据接口

+ 181
- 0
src/views/second/summary/index.vue View File

<template>
<div class="ele-body">
<el-card shadow="never">
<div class="upload" style="margin-bottom: 20px">
<el-button type="primary" size="small" style="margin-right: 20px"
>上传</el-button
>
<input type="file" style="display: none" ref="file" />
<el-button type="default" size="small" @click="$refs.file.click()"
>选择文件</el-button
>
<div style="display: inline-block; margin-left: 20px"></div>
</div>
<el-table
height="calc(100vh - 220px)"
:data="dataList"
:loading="loading"
>
<el-table-column
label="部门名称"
align="center"
min-width="120"
show-overflow-tooltip
prop="deptName"
></el-table-column>
<el-table-column label="基础目标" align="center">
<el-table-column
label="牵头次数"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.leaderNum||'/' }}
</template>
</el-table-column>
<el-table-column
label="配合次数"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.cooperateNum||'/' }}
</template>
</el-table-column>
<el-table-column
label="承担分数"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.bearScore||'/' }}
</template>
</el-table-column>
<el-table-column
label="牵头承担分数"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.leaderBearScore||'/' }}
</template>
</el-table-column>
<el-table-column
label="评分"
align="center"
min-width="100"
show-overflow-tooltip
>
<tempalte slot-scope="{ row }">
{{ row.basicTaskInfo.points||'/' }}
</tempalte>
</el-table-column>
</el-table-column>
<el-table-column label="重点专项" align="center">
<el-table-column
label="参与次数"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.specialPowerInfo.partyNum ||'/'}}
</template>
</el-table-column>
<el-table-column
label="评分"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.specialPowerInfo.points||'/' }}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="刚性约束" align="center">
<el-table-column
label="参与次数"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.rigidityConstraintInfo.partyNum||'/' }}
</template>
</el-table-column>
<el-table-column
label="评分"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.rigidityConstraintInfo.points||'/' }}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="总分" align="center">
<el-table-column
label="参与次数"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.summaryInfo.partyNum ||'/'}}
</template>
</el-table-column>
<el-table-column
label="评分"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.summaryInfo.points||'/' }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-card>
</div>
</template>

<script>
import summaryApi from "@/api/second/taskSummary";
export default {
data() {
return {
dataList: [],
loading: false,
};
},
created() {
this.loading = true;
summaryApi
.getSummaryList()
.then((res) => {
let data = res.data;
if (data.code == 0) {
this.dataList = data.data;
} else {
this.dataList = [];
}
})
.catch((e) => {
this.dataList = [];
})
.finally(() => {
this.loading = false;
});
},
};
</script>

<style>
</style>

+ 63
- 26
src/views/second/taskSummary/basicTable.vue View File

align="center" align="center"
prop="points" prop="points"
></el-table-column> ></el-table-column>
<!-- <el-table-column label="扣分" width="80" align="center">
<el-table-column label="最终扣分" width="80" align="center">
<template slot-scope="{ row, $index }"> <template slot-scope="{ row, $index }">
<div @click="showText($index, true)" style="height: 100%">
<div
@dblclick="showText($index, true) && refs['input' + $index].focus"
style="height: 100%"
>
<el-input <el-input
:ref="'input' + $index" :ref="'input' + $index"
v-model="row.deptPoints"
v-model="row.deduction"
v-if="row.focus" v-if="row.focus"
@hook:mounted="autoFocus($index)"
@blur=" @blur="
showText($index, false); showText($index, false);
updatePoints(row, $index); updatePoints(row, $index);
" "
></el-input> ></el-input>
<span v-else>{{ row.deptPoints || 0 }}</span>
<span v-else>{{ row.deduction || 0 }}</span>
</div> </div>
</template> </template>
</el-table-column> -->
</el-table-column>
<el-table-column <el-table-column
label="区牵头单位" label="区牵头单位"
width="95" width="95"
<pre>{{ row.cooperatePrincipalList | formatList }}</pre> <pre>{{ row.cooperatePrincipalList | formatList }}</pre>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80" align="center" fixed="right">
<el-table-column label="操作" width="150" align="center" fixed="right">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link <el-link
slot="reference" slot="reference"
fixed="right" fixed="right"
>编辑</el-link >编辑</el-link
> >
<el-link
@click="showPoints = true"
type="warning"
icon="el-icon-edit-outline"
>评分</el-link
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-button @click="showEdit = false">取消</el-button>&nbsp; <el-button @click="showEdit = false">取消</el-button>&nbsp;
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
@closed="pointForm = {}"
title="编辑分数"
custom-class="ele-dialog-form"
:lock-scroll="true"
:destroy-on-close="true"
width="500px"
:visible.sync="showPoints"
>
<div slot="footer">
<el-button type="primary" @click="savePoints">确定</el-button>
<el-button @click="showPoints = false">取消</el-button>&nbsp;
</div>
</el-dialog>
</el-card> </el-card>
</div> </div>
</template> </template>
], ],
data() { data() {
return { return {
showPoints: false,
pointForm: {},
searchParams: {}, searchParams: {},
dataList: [], dataList: [],
loading: false, loading: false,
preValue: null, preValue: null,
}; };
}, },
created() {
this.getDataList();
async created() {
await this.getDataList();
this.$store.dispatch("base/getPrincipalList"); this.$store.dispatch("base/getPrincipalList");
}, },
computed: { computed: {
}, },
}, },
methods: { methods: {
savePoints() {},
autoFocus(index) {
this.$refs["input" + index].focus();
},
updatePoints(row, index) { updatePoints(row, index) {
if (row.deptPoints == this.preValue) {
if(!row.id){
this.$message({
type:"warning",
message:"请想拆分小条"
})
this.$set(this.dataList[index], "deduction", this.preValue);
return
}
if (row.deduction == this.preValue) {
return; return;
} }
if ( if (
row.deptPoints < 0 ||
row.deptPoints > row.points ||
!row.deptPoints.trim()
row.deduction < 0 ||
!row.deduction.trim() ||
Number(row.deduction) !== Number(row.deduction)
) { ) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "请输入数值0~" + row.points,
message: "请输入数值",
}); });
let data = this.dataList;
data[index].deptPoints = this.preValue;
this.dataList = data;
this.$set(this.dataList[index], "deduction", this.preValue);
return; return;
} }
editApi editApi
.editItem({
.editPoints({
itemId: row.id, itemId: row.id,
expectedPoints: row.deptPoints,
deduction: row.deduction,
}) })
.then((res) => { .then((res) => {
this.$message({ type: "success", message: "修改成功" });
let data = res.data;
if (data.code == 0) {
this.$message({ type: "success", message: "修改成功" });
} else {
this.$message.error(data.msg);
}
}) })
.catch(() => { .catch(() => {
this.$message.error("修改失败"); this.$message.error("修改失败");
}).finally(()=>{
this.getDataList(); this.getDataList();
}); });
}, },
// this.dataList = data; // this.dataList = data;
this.$set(this.dataList[index], "focus", bool); this.$set(this.dataList[index], "focus", bool);
if (bool) { if (bool) {
this.preValue = data[index].deptPoints;
this.preValue = data[index].deduction;
} }
this.$nextTick(() => {
this.$refs["input" + index].focus();
});
} catch (e) {
console.log(e);
}
} catch {}
}, },
exportData(data) { exportData(data) {
this.loading = true; this.loading = true;

+ 34
- 20
src/views/second/taskSummary/constraint.vue View File

prop="itemContent" prop="itemContent"
></el-table-column> ></el-table-column>


<!-- <el-table-column label="扣分" width="80" align="center">
<el-table-column label="最终扣分" width="80" align="center">
<template slot-scope="{ row, $index }"> <template slot-scope="{ row, $index }">
<div @click="showText($index, true)" style="height: 100%">
<div @dblclick="showText($index, true)" style="height: 100%">
<el-input <el-input
:ref="'input' + $index" :ref="'input' + $index"
v-model="row.deptPoints"
v-model="row.deduction"
v-if="row.focus" v-if="row.focus"
@hook:mounted="autoFocus($index)"
@blur=" @blur="
showText($index, false); showText($index, false);
updatePoints(row, $index); updatePoints(row, $index);
" "
></el-input> ></el-input>
<span v-else>{{ row.deptPoints || 0 }}</span>
<span v-else>{{ row.deduction || 0 }}</span>
</div> </div>
</template> </template>
</el-table-column> -->
</el-table-column>
<el-table-column <el-table-column
label="区牵头单位" label="区牵头单位"
width="95" width="95"
}, },
}, },
methods: { methods: {
autoFocus(index) {
this.$refs["input" + index].focus();
},
updatePoints(row, index) { updatePoints(row, index) {
if (row.deptPoints == this.preValue) {
if (!row.id) {
this.$message({
type: "warning",
message: "请想拆分小条",
});
this.$set(this.dataList[index], "deduction", this.preValue);
return
}
if (row.deduction == this.preValue) {
return; return;
} }
if ( if (
row.deptPoints < 0 ||
row.deptPoints > row.points ||
!row.deptPoints.trim()
row.deduction < 0 ||
!row.deduction.trim() ||
Number(row.deduction) !== Number(row.deduction)
) { ) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "请输入数值0~" + row.points,
message: "请输入数值",
}); });
let data = this.dataList;
data[index].deptPoints = this.preValue;
this.dataList = data;
this.$set(this.dataList[index], "deduction", this.preValue);
return; return;
} }
editApi editApi
.editItem({
.editPoints({
itemId: row.id, itemId: row.id,
expectedPoints: row.deptPoints,
deduction: row.deduction,
}) })
.then((res) => { .then((res) => {
this.$message({ type: "success", message: "修改成功" });
let data = res.data;
if (data.code == 0) {
this.$message({ type: "success", message: "修改成功" });
} else {
this.$message.error(data.msg);
}
}) })
.catch(() => { .catch(() => {
this.$message.error("修改失败"); this.$message.error("修改失败");
})
.finally(() => {
this.getDataList(); this.getDataList();
}); });
}, },
// this.dataList = data; // this.dataList = data;
this.$set(this.dataList[index], "focus", bool); this.$set(this.dataList[index], "focus", bool);
if (bool) { if (bool) {
this.preValue = data[index].deptPoints;
this.preValue = data[index].deduction;
} }
this.$nextTick(() => {
this.$refs["input" + index].focus();
});
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }

+ 43
- 26
src/views/second/taskSummary/reward.vue View File

align="center" align="center"
prop="points" prop="points"
></el-table-column> ></el-table-column>
<!-- <el-table-column label="加分" width="80" align="center">
<el-table-column label="最终加分" width="80" align="center">
<template slot-scope="{ row, $index }"> <template slot-scope="{ row, $index }">
<div @click="showText($index, true)" style="height: 100%">
<div @dblclick="showText($index, true)" style="height: 100%">
<el-input <el-input
:ref="'input' + $index" :ref="'input' + $index"
v-model="row.deptPoints"
v-model="row.bonus"
v-if="row.focus" v-if="row.focus"
@hook:mounted="autoFocus($index)"
@blur=" @blur="
showText($index, false); showText($index, false);
updatePoints(row, $index); updatePoints(row, $index);
" "
></el-input> ></el-input>
<span v-else>{{ row.deptPoints || 0 }}</span>
<span v-else>{{ row.bonus || 0 }}</span>
</div> </div>
</template> </template>
</el-table-column> -->
</el-table-column>
<el-table-column <el-table-column
label="区牵头单位" label="区牵头单位"
width="95" width="95"
type="primary" type="primary"
:underline="false" :underline="false"
@click="edit(row)" @click="edit(row)"
:disabled="!row.id || (user.user.deptId != 1 && user.user.deptId != row.leaderDept)"
:disabled="
!row.id ||
(user.user.deptId != 1 && user.user.deptId != row.leaderDept)
"
icon="el-icon-edit" icon="el-icon-edit"
>编辑</el-link >编辑</el-link
> >
}; };
} }
" "
/>
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
(document.documentElement.clientHeight - 260 - 45) / 45 (document.documentElement.clientHeight - 260 - 45) / 45
), ),
}, },
preValue: null
preValue: null,
}; };
}, },
created() { created() {
}, },
}, },
methods: { methods: {
autoFocus(index) {
this.$refs["input" + index].focus();
},
updatePoints(row, index) { updatePoints(row, index) {
if (row.deptPoints == this.preValue) {
if (!row.id) {
this.$message({
type: "warning",
message: "请想拆分小条",
});
this.$set(this.dataList[index], "deduction", this.preValue);
return;
}
if (row.bonus == this.preValue) {
return; return;
} }
if ( if (
row.deptPoints < 0 ||
row.deptPoints > row.points ||
!row.deptPoints.trim()
row.bonus < 0 ||
!row.bonus.trim() ||
Number(row.bonus) !== Number(row.bonus)
) { ) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "请输入数值0~" + row.points,
message: "请输入数值",
}); });
let data = this.dataList;
data[index].deptPoints = this.preValue;
this.dataList = data;
this.$set(this.dataList[index], "bonus", this.preValue);
return; return;
} }
editApi editApi
.editItem({
.editPoints({
itemId: row.id, itemId: row.id,
expectedPoints: row.deptPoints,
bonus: row.bonus,
}) })
.then((res) => { .then((res) => {
this.$message({ type: "success", message: "修改成功" });
let data = res.data;
if (data.code == 0) {
this.$message({ type: "success", message: "修改成功" });
} else {
this.$message.error(data.msg);
}
}) })
.catch(() => { .catch(() => {
this.$message.error("修改失败"); this.$message.error("修改失败");
})
.finally(() => {
this.getDataList(); this.getDataList();
}); });
}, },
// this.dataList = data; // this.dataList = data;
this.$set(this.dataList[index], "focus", bool); this.$set(this.dataList[index], "focus", bool);
if (bool) { if (bool) {
this.preValue = data[index].deptPoints;
this.preValue = data[index].bonus;
} }
this.$nextTick(() => {
this.$refs["input" + index].focus();
});
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
.then((res) => { .then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
// window.open(res.data.data); // window.open(res.data.data);
window.location.href=res.data.data
window.location.href = res.data.data;
this.$message({ this.$message({
type: "success", type: "success",
message: "导出成功", message: "导出成功",
} }
} }
} else { } else {
if (param!="points"&&!form[param]) {
if (param != "points" && !form[param]) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "请完善信息", message: "请完善信息",
} }
if ( if (
param == "points" && param == "points" &&
form[param]&&
form[param] &&
parseInt(form[param]) !== parseInt(form[param]) parseInt(form[param]) !== parseInt(form[param])
) { ) {
this.$message({ this.$message({

Loading…
Cancel
Save