Bläddra i källkod

玩成需求

master
yangzhou-cyber 3 år sedan
förälder
incheckning
499144026e
6 ändrade filer med 220 tillägg och 36 borttagningar
  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 Visa fil

@@ -21,5 +21,8 @@ export default {
},
getItemDeptScoreList(id){
return axios.get('/basictaskitem/getItemDeptScoreList/'+id)
},
setItemDeptScore(data){
return axios.post('/basictaskitem/setItemDeptScore',data)
}
}

+ 6
- 0
src/api/second/taskSummary.js Visa fil

@@ -21,5 +21,11 @@ export default {
},
getSummaryList(){
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 Visa fil

@@ -2,14 +2,22 @@
<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
<el-button
type="primary"
size="small"
style="margin-right: 20px"
@click="uploadFile"
>上传文件</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; 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>
<el-table
height="calc(100vh - 220px)"
@@ -31,7 +39,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.leaderNum||'/' }}
{{ row.basicTaskInfo.leaderNum || "/" }}
</template>
</el-table-column>
<el-table-column
@@ -41,7 +49,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.cooperateNum||'/' }}
{{ row.basicTaskInfo.cooperateNum || "/" }}
</template>
</el-table-column>
<el-table-column
@@ -51,7 +59,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.bearScore||'/' }}
{{ row.basicTaskInfo.bearScore || "/" }}
</template>
</el-table-column>
<el-table-column
@@ -61,7 +69,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.basicTaskInfo.leaderBearScore||'/' }}
{{ row.basicTaskInfo.leaderBearScore || "/" }}
</template>
</el-table-column>
<el-table-column
@@ -70,9 +78,9 @@
min-width="100"
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 label="重点专项" align="center">
@@ -83,7 +91,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.specialPowerInfo.partyNum ||'/'}}
{{ row.specialPowerInfo.partyNum || "/" }}
</template>
</el-table-column>
<el-table-column
@@ -93,7 +101,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.specialPowerInfo.points||'/' }}
{{ row.specialPowerInfo.points || "/" }}
</template>
</el-table-column>
</el-table-column>
@@ -105,7 +113,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.rigidityConstraintInfo.partyNum||'/' }}
{{ row.rigidityConstraintInfo.partyNum || "/" }}
</template>
</el-table-column>
<el-table-column
@@ -115,7 +123,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.rigidityConstraintInfo.points||'/' }}
{{ row.rigidityConstraintInfo.points || "/" }}
</template>
</el-table-column>
</el-table-column>
@@ -127,7 +135,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.summaryInfo.partyNum ||'/'}}
{{ row.summaryInfo.partyNum || "/" }}
</template>
</el-table-column>
<el-table-column
@@ -137,7 +145,7 @@
show-overflow-tooltip
>
<template slot-scope="{ row }">
{{ row.summaryInfo.points||'/' }}
{{ row.summaryInfo.points || "/" }}
</template>
</el-table-column>
</el-table-column>
@@ -153,6 +161,7 @@ export default {
return {
dataList: [],
loading: false,
file: {},
};
},
created() {
@@ -173,6 +182,67 @@ export default {
.finally(() => {
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>

+ 117
- 12
src/views/second/taskSummary/basicTable.vue Visa fil

@@ -147,7 +147,7 @@
>编辑</el-link
>
<el-link
@click="showPoints = true"
@click="showPointsDialog(row)"
type="warning"
icon="el-icon-edit-outline"
>评分</el-link
@@ -389,7 +389,8 @@
</div>
</el-dialog>
<el-dialog
@closed="pointForm = {}"
:loading="pointLoading"
@closed="pointForm = []"
title="编辑分数"
custom-class="ele-dialog-form"
:lock-scroll="true"
@@ -397,6 +398,17 @@
width="500px"
: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">
<el-button type="primary" @click="savePoints">确定</el-button>
<el-button @click="showPoints = false">取消</el-button>&nbsp;
@@ -429,7 +441,8 @@ export default {
data() {
return {
showPoints: false,
pointForm: {},
pointLoading: false,
pointForm: [],
searchParams: {},
dataList: [],
loading: false,
@@ -444,6 +457,7 @@ export default {
),
},
preValue: null,
itemId:''
};
},
async created() {
@@ -459,22 +473,112 @@ export default {
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: {
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) {
this.$refs["input" + index].focus();
},
updatePoints(row, index) {
if(!row.id){
if (row.deduction == this.preValue) {
return;
}
if (!row.id) {
this.$message({
type:"warning",
message:"请想拆分小条"
})
type: "warning",
message: "请先拆分小条",
});
this.$set(this.dataList[index], "deduction", this.preValue);
return
}
if (row.deduction == this.preValue) {
return;
}
if (
@@ -504,7 +608,8 @@ export default {
})
.catch(() => {
this.$message.error("修改失败");
}).finally(()=>{
})
.finally(() => {
this.getDataList();
});
},

+ 3
- 3
src/views/second/taskSummary/constraint.vue Visa fil

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

+ 3
- 3
src/views/second/taskSummary/reward.vue Visa fil

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

Laddar…
Avbryt
Spara