Browse Source

玩成需求

master
yangzhou-cyber 3 years ago
parent
commit
499144026e
6 changed files with 220 additions and 36 deletions
  1. +3
    -0
      src/api/second/segmentation/basicTable.js
  2. +6
    -0
      src/api/second/taskSummary.js
  3. +88
    -18
      src/views/second/summary/index.vue
  4. +117
    -12
      src/views/second/taskSummary/basicTable.vue
  5. +3
    -3
      src/views/second/taskSummary/constraint.vue
  6. +3
    -3
      src/views/second/taskSummary/reward.vue

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

}, },
getItemDeptScoreList(id){ getItemDeptScoreList(id){
return axios.get('/basictaskitem/getItemDeptScoreList/'+id) return axios.get('/basictaskitem/getItemDeptScoreList/'+id)
},
setItemDeptScore(data){
return axios.post('/basictaskitem/setItemDeptScore',data)
} }
} }

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

}, },
getSummaryList(){ getSummaryList(){
return axios.get('/statistics/reportDataSummary') return axios.get('/statistics/reportDataSummary')
},
uploadReportDataSummaryAttach(data){
return axios.post('/statistics/uploadReportDataSummaryAttach/test2',data)
},
getReportDataSummaryAttach(){
return axios.get('/statistics/getReportDataSummaryAttach')
} }
} }

+ 88
- 18
src/views/second/summary/index.vue View File

<div class="ele-body"> <div class="ele-body">
<el-card shadow="never"> <el-card shadow="never">
<div class="upload" style="margin-bottom: 20px"> <div class="upload" style="margin-bottom: 20px">
<el-button type="primary" size="small" style="margin-right: 20px"
>上传</el-button
<el-button
type="primary"
size="small"
style="margin-right: 20px"
@click="uploadFile"
>上传文件</el-button
> >
<input type="file" style="display: none" ref="file" /> <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; cursor: pointer"
v-show="Object.keys(file).length > 0"
:data-path="file.path"
@click="downloadFile"
> >
<div style="display: inline-block; margin-left: 20px"></div>
{{ file.fileName }}
</div>
</div> </div>
<el-table <el-table
height="calc(100vh - 220px)" height="calc(100vh - 220px)"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.basicTaskInfo.leaderNum||'/' }}
{{ row.basicTaskInfo.leaderNum || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.basicTaskInfo.cooperateNum||'/' }}
{{ row.basicTaskInfo.cooperateNum || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.basicTaskInfo.bearScore||'/' }}
{{ row.basicTaskInfo.bearScore || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.basicTaskInfo.leaderBearScore||'/' }}
{{ row.basicTaskInfo.leaderBearScore || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
min-width="100" min-width="100"
show-overflow-tooltip show-overflow-tooltip
> >
<tempalte slot-scope="{ row }">
{{ row.basicTaskInfo.points||'/' }}
</tempalte>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.points || "/" }}
</template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="重点专项" align="center"> <el-table-column label="重点专项" align="center">
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.specialPowerInfo.partyNum ||'/'}}
{{ row.specialPowerInfo.partyNum || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.specialPowerInfo.points||'/' }}
{{ row.specialPowerInfo.points || "/" }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.rigidityConstraintInfo.partyNum||'/' }}
{{ row.rigidityConstraintInfo.partyNum || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.rigidityConstraintInfo.points||'/' }}
{{ row.rigidityConstraintInfo.points || "/" }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.summaryInfo.partyNum ||'/'}}
{{ row.summaryInfo.partyNum || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.summaryInfo.points||'/' }}
{{ row.summaryInfo.points || "/" }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
return { return {
dataList: [], dataList: [],
loading: false, loading: false,
file: {},
}; };
}, },
created() { created() {
.finally(() => { .finally(() => {
this.loading = false; this.loading = false;
}); });
this.getFile()
},
methods: {
getFile() {
summaryApi
.getReportDataSummaryAttach()
.then((res) => {
let data = res.data;
if (data.code == 0) {
this.file = {
fileName: data.data.fileName,
path: data.data.filePath,
};
} else {
this.file = {};
}
})
.catch((e) => {
this.file = {};
});
},
downloadFile($event) {
let element = $event.target;
let path = element.getAttribute("data-path");
window.location.href = path;
},
uploadFile() {
let input = this.$refs.file;
input.click();
let upload;
input.addEventListener(
"change",
(upload = (e) => {
let file = e.target.files[0];
let MAXSIZE = 5 * 1024 * 1024;
if (file.size > MAXSIZE) {
this.$message.error("上传文件不得超过5M");
}
let formData = new FormData();
formData.append("file", file);
summaryApi
.uploadReportDataSummaryAttach(formData)
.then((res) => {
let data = res.data;
if (data.code == 0) {
this.$message({
type: "success",
message: "上传文件成功",
});
} else {
this.$message.error(data.code);
}
})
.catch((e) => {
this.$message.error("上传文件失败");
}).catch(e=>{
this.getFile()
});
})
);
},
}, },
}; };
</script> </script>

+ 117
- 12
src/views/second/taskSummary/basicTable.vue View File

>编辑</el-link >编辑</el-link
> >
<el-link <el-link
@click="showPoints = true"
@click="showPointsDialog(row)"
type="warning" type="warning"
icon="el-icon-edit-outline" icon="el-icon-edit-outline"
>评分</el-link >评分</el-link
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
@closed="pointForm = {}"
:loading="pointLoading"
@closed="pointForm = []"
title="编辑分数" title="编辑分数"
custom-class="ele-dialog-form" custom-class="ele-dialog-form"
:lock-scroll="true" :lock-scroll="true"
width="500px" width="500px"
:visible.sync="showPoints" :visible.sync="showPoints"
> >
<el-form label-width="50%">
<template v-for="(item, index) of pointForm">
<el-form-item :label="item | formatLabel" :key="index">
<el-input
placeholder="请输入得分"
v-model="item.actualPoints"
clearable
></el-input>
</el-form-item>
</template>
</el-form>
<div slot="footer"> <div slot="footer">
<el-button type="primary" @click="savePoints">确定</el-button> <el-button type="primary" @click="savePoints">确定</el-button>
<el-button @click="showPoints = false">取消</el-button>&nbsp; <el-button @click="showPoints = false">取消</el-button>&nbsp;
data() { data() {
return { return {
showPoints: false, showPoints: false,
pointForm: {},
pointLoading: false,
pointForm: [],
searchParams: {}, searchParams: {},
dataList: [], dataList: [],
loading: false, loading: false,
), ),
}, },
preValue: null, preValue: null,
itemId:''
}; };
}, },
async created() { async created() {
return val.join("\n"); return val.join("\n");
} }
}, },
formatLabel(data) {
if (data.isLeader == 1) {
return "第一牵头" + data.deptName + "得分:";
} else if (data.isLeader == 2) {
return "其他牵头" + data.deptName + "得分:";
} else if (data.isLeader == 3) {
return "配合部门" + data.deptName + "得分:";
} else {
return "";
}
},
}, },
methods: { methods: {
savePoints() {},
showPointsDialog(row) {
if (!row.id) {
this.$message({
type: "warning",
message: "请先拆分小条",
});
return;
}
this.showPoints = true;
this.getItemDeptScoreList(row.id);
},
getItemDeptScoreList(id) {
this.pointLoading = true;
editApi
.getItemDeptScoreList(id)
.then((res) => {
let data = res.data;
if (data.code == 0) {
this.pointForm = data.data;
this.itemId=id
} else {
this.pointForm = [];
this.showPoints = false;
this.$message({
type: "warning",
message: "当前无数据",
});
}
})
.catch((e) => {
this.pointForm = [];
this.showPoints = false;
this.$message({
type: "warning",
message: "当前无数据",
});
})
.finally(() => {
this.pointLoading = false;
});
},
savePoints() {
let list=JSON.parse(JSON.stringify(this.pointForm));
for(let obj of list){
console.log(obj.actualPoints)
if(!(obj.actualPoints+'').trim()){
this.$message({
type:"warning",
message:"请输入"+obj.deptName+"的得分"
})
return
}
if(Number(obj.actualPoints)!==Number(obj.actualPoints)){
this.$message({
type:"warning",
message:obj.deptName+"的得分请输入数值"
})
return
}
}
let obj={}
list.forEach(item=>{
obj[item.deptId]=item.actualPoints
})
editApi.setItemDeptScore(Object.assign({itemId:this.itemId,deptScore:obj})).then(res=>{
let data=res.data
if(data.code==0){
this.$message({
type:"success",
message:"编辑分数成功"
})
this.showPoints=false
this.getDataList()
}else{
this.$message.error(data.msg)
}
}).catch(e=>{
this.$message.error('编辑分数失败')
})
},
autoFocus(index) { autoFocus(index) {
this.$refs["input" + index].focus(); this.$refs["input" + index].focus();
}, },
updatePoints(row, index) { updatePoints(row, index) {
if(!row.id){
if (row.deduction == this.preValue) {
return;
}
if (!row.id) {
this.$message({ this.$message({
type:"warning",
message:"请想拆分小条"
})
type: "warning",
message: "请先拆分小条",
});
this.$set(this.dataList[index], "deduction", this.preValue); this.$set(this.dataList[index], "deduction", this.preValue);
return
}
if (row.deduction == this.preValue) {
return; return;
} }
if ( if (
}) })
.catch(() => { .catch(() => {
this.$message.error("修改失败"); this.$message.error("修改失败");
}).finally(()=>{
})
.finally(() => {
this.getDataList(); this.getDataList();
}); });
}, },

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

this.$refs["input" + index].focus(); this.$refs["input" + index].focus();
}, },
updatePoints(row, index) { updatePoints(row, index) {
if (row.deduction == this.preValue) {
return;
}
if (!row.id) { if (!row.id) {
this.$message({ this.$message({
type: "warning", type: "warning",
this.$set(this.dataList[index], "deduction", this.preValue); this.$set(this.dataList[index], "deduction", this.preValue);
return return
} }
if (row.deduction == this.preValue) {
return;
}
if ( if (
row.deduction < 0 || row.deduction < 0 ||
!row.deduction.trim() || !row.deduction.trim() ||

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

this.$refs["input" + index].focus(); this.$refs["input" + index].focus();
}, },
updatePoints(row, index) { updatePoints(row, index) {
if (row.bonus == this.preValue) {
return;
}
if (!row.id) { if (!row.id) {
this.$message({ this.$message({
type: "warning", type: "warning",
this.$set(this.dataList[index], "deduction", this.preValue); this.$set(this.dataList[index], "deduction", this.preValue);
return; return;
} }
if (row.bonus == this.preValue) {
return;
}
if ( if (
row.bonus < 0 || row.bonus < 0 ||
!row.bonus.trim() || !row.bonus.trim() ||

Loading…
Cancel
Save