瀏覽代碼

完成链长制3期需求

master
yangzhou-cyber 3 年之前
父節點
當前提交
eaa6fc2499
共有 7 個文件被更改,包括 502 次插入37 次删除
  1. +3
    -0
      src/api/chain/assessmentContent.js
  2. +21
    -0
      src/api/chain/summary.js
  3. +2
    -2
      src/config/setting.js
  4. +142
    -35
      src/views/chain/assessmentContent.vue
  5. +150
    -0
      src/views/chain/summary/table1.vue
  6. +13
    -0
      src/views/chain/summary/table2.vue
  7. +171
    -0
      src/views/chain/summary/table3.vue

+ 3
- 0
src/api/chain/assessmentContent.js 查看文件

@@ -15,4 +15,7 @@ export default{
delete(id){
return axios.delete('/chainindustry/delete/'+id)
},
editPoints(params){
return axios.post('/chainindustry/updateScore',params)
}
}

+ 21
- 0
src/api/chain/summary.js 查看文件

@@ -0,0 +1,21 @@
import axios from "@/config/axios"
export default{
getChainCategoryAnalysisInfo(){
return axios.get('/chainIndustryanalysis/getChainCategoryAnalysisInfo')
},
getChainIndustryDeptAnalysisInfo(){
return axios.get('/chainIndustryanalysis/getChainIndustryDeptAnalysisInfo')
},
uploadChainCategoryAnalysisAttach(data){
return axios.post('/chainIndustryanalysis/uploadChainCategoryAnalysisAttach/chainIndustry',data)
},
getChainCategoryAnalysisAttach(){
return axios.get('/chainIndustryanalysis/getChainCategoryAnalysisAttach')
},
uploadChainIndustryDeptAnalysisAttach(data){
return axios.post('/chainIndustryanalysis/uploadChainIndustryDeptAnalysisAttach/chainIndustry',data)
},
getChainIndustryDeptAnalysisAttach(){
return axios.get('/chainIndustryanalysis/getChainIndustryDeptAnalysisAttach')
}
}

+ 2
- 2
src/config/setting.js 查看文件

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

+ 142
- 35
src/views/chain/assessmentContent.vue 查看文件

@@ -13,15 +13,15 @@
<el-col :span="2" align="center" class="thead td"
><span class="cell">编号</span></el-col
>
<el-col :span="8" align="center" class="thead td"
<el-col :span="6" align="center" class="thead td"
><span class="cell">指标名称与全年目标</span></el-col
>
<el-col :span="2" align="center" class="thead td"
><span class="cell">分值</span></el-col
>
<!-- <el-col :span="2" align="center" class="thead td"
><span class="cell">得分</span></el-col
> -->
<el-col :span="2" align="center" class="thead td"
><span class="cell">最终得分</span></el-col
>
<el-col :span="3" align="center" class="thead td"
><span class="cell">第一牵头部门</span></el-col
>
@@ -31,9 +31,6 @@
<el-col :span="3" align="center" class="thead td"
><span class="cell">配合部门</span></el-col
>
<!-- <el-col :span="3" align="center" class="thead td"
><span class="cell">打分操作记录</span></el-col
> -->
<el-col :span="3" align="center" class="thead td"
><span class="cell">操作</span></el-col
>
@@ -55,15 +52,39 @@
<el-col :span="2" align="center" class="td"
><span class="cell">{{ i + 1 }}</span></el-col
>
<el-col :span="8" align="center" class="td"
<el-col :span="6" align="center" class="td"
><span class="cell">{{ detail.content }}</span></el-col
>
<el-col :span="2" align="center" class="td"
><span class="cell">{{ detail.points==0?'':detail.points }}</span></el-col
><span class="cell">{{
detail.points == 0 ? "" : detail.points
}}</span></el-col
>
<!-- <el-col :span="2" align="center" class="td"
><span class="cell">{{ detail.score==0?'':detail.score }}</span></el-col
> -->
<el-col :span="2" align="center" class="td">
<div
@dblclick="showText(i, true,detail)"
style="
height: 100%;
width: 100%;
display: flex;
align-items: center;
"
>
<el-input
:ref="'input' + index+ind+i"
v-model="detail.score"
v-if="detail.focus"
@hook:mounted="autoFocus(index,ind,i)"
@blur="
showText(i, false, detail);
updatePoints(detail, i);
"
></el-input>
<span v-else style="flex: 1">{{
detail.score || 0
}}</span>
</div>
</el-col>
<el-col :span="3" align="center" class="td"
><span class="cell">
<pre>{{ detail.leaderDeptList | formatList }}</pre>
@@ -89,7 +110,10 @@
icon="el-icon-edit"
type="primary"
:underline="false"
:disabled="user.user.deptId != 1 && user.user.deptId != detail.leaderDept"
:disabled="
user.user.deptId != 1 &&
user.user.deptId != detail.leaderDept
"
>修改</el-link
>
<el-popconfirm
@@ -133,7 +157,11 @@
@submit.native.prevent
:rules="rules"
>
<el-form-item label="产业链名称:" prop="categoryId" v-if="user.user.deptId == 1">
<el-form-item
label="产业链名称:"
prop="categoryId"
v-if="user.user.deptId == 1"
>
<el-select v-model="form.categoryId" filterable clearable>
<el-option
v-for="(item, index) of dataList"
@@ -143,7 +171,11 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="考核指标:" prop="type" v-if="user.user.deptId == 1">
<el-form-item
label="考核指标:"
prop="type"
v-if="user.user.deptId == 1"
>
<el-select v-model="form.type" filterable clearable>
<el-option
v-for="(item, index) of quotaList"
@@ -153,7 +185,11 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="指标内容:" prop="content" v-if="user.user.deptId == 1">
<el-form-item
label="指标内容:"
prop="content"
v-if="user.user.deptId == 1"
>
<el-input
type="textarea"
:rows="5"
@@ -161,13 +197,25 @@
v-model="form.content"
></el-input>
</el-form-item>
<el-form-item label="分值:" prop="points" v-if="user.user.deptId == 1">
<el-input placeholder="请输入分值" type="number" v-model="form.points"></el-input>
<el-form-item
label="分值:"
prop="points"
v-if="user.user.deptId == 1"
>
<el-input
placeholder="请输入分值"
type="number"
v-model="form.points"
></el-input>
</el-form-item>
<!-- <el-form-item label="得分:" prop="score">
<el-input placeholder="请输入得分" type="number" v-model="form.score"></el-input>
</el-form-item> -->
<el-form-item label="第一牵头部门:" prop="leaderDept" v-if="user.user.deptId == 1">
<el-form-item
label="第一牵头部门:"
prop="leaderDept"
v-if="user.user.deptId == 1"
>
<treeselect
v-model="form.leaderDept"
:disable-branch-nodes="true"
@@ -274,37 +322,98 @@ export default {
],
rules: {
categoryId: [
{ required: true, message: '请选择产品链名称', trigger: 'blur' },
],
type: [
{ required: true, message: '请选择考核指标', trigger: 'blur' }
{ required: true, message: "请选择产品链名称", trigger: "blur" },
],
type: [{ required: true, message: "请选择考核指标", trigger: "blur" }],
content: [
{ type: 'string', required: true, message: '请输入考核内容', trigger: 'change' }
{
type: "string",
required: true,
message: "请输入考核内容",
trigger: "change",
},
],
// points: [
// { required: true, message: '请输入分值', trigger: 'change' }
// ],
score: [
{ required: true, message: '请输入得分', trigger: 'change' }
],
score: [{ required: true, message: "请输入得分", trigger: "change" }],
leaderDept: [
{ required: true, message: '请选择第一牵头部门', trigger: 'blur' }
{ required: true, message: "请选择第一牵头部门", trigger: "blur" },
],
// cooperateDept: [
// { required: true, message: '请选择配合部门', trigger: 'blur' }
// ]
}
},
preValue:null
};
},
created() {
this.getList();
},
methods: {
showText(index, bool, row) {
try {
// data[index].focus = bool;
// this.dataList = data;
this.$set(row, "focus", bool);
if (bool) {
this.preValue = row.score;
}
} catch {}
},

autoFocus(index,ind,i) {
let info="input"+index+ind+i
this.$refs[info][0].focus();
},
updatePoints(row, index) {
if (row.score == this.preValue) {
return;
}
if (!row.id) {
this.$message({
type: "warning",
message: "请先拆分小条",
});
this.$set(row, "score", this.preValue);
return;
}
if (
row.score < 0 ||
!row.score.trim() ||
Number(row.score) !== Number(row.score)
) {
this.$message({
type: "warning",
message: "请输入正数值",
});
this.$set(row, "score", this.preValue);
return;
}
api
.editPoints({
chainIndustryId: row.id,
score: row.score,
})
.then((res) => {
let data = res.data;
if (data.code == 0) {
this.$message({ type: "success", message: "修改成功" });
} else {
this.$message.error(data.msg);
}
})
.catch(() => {
this.$message.error("修改失败");
})
.finally(() => {
this.getList();
});
},
isEmpty(data) {
for (let item of data.children) {
if(item.children.length>0){
return true
if (item.children.length > 0) {
return true;
}
}
return false;
@@ -374,7 +483,6 @@ export default {
try {
form.otherDept = form.otherDept.join(",");
form.cooperateDept = form.cooperateDept.join(",");

} catch (e) {
// console.log(e);
// this.$message({ type: "warning", message: "请完善信息" });
@@ -415,9 +523,9 @@ export default {
this.$message({
type: "error",
message: "请检查表单信息是否符合规则",
})
});
}
})
});
// let params = [
// "categoryId",
// "type",
@@ -465,7 +573,6 @@ export default {
// return;
// }
// }

},
},
computed: {

+ 150
- 0
src/views/chain/summary/table1.vue 查看文件

@@ -0,0 +1,150 @@
<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"
@click="uploadFile"
>上传文件</el-button
>
<input type="file" style="display: none" ref="file" />
<div
style="display: inline-block; margin-left: 20px; cursor: pointer"
v-show="Object.keys(file).length > 0"
:data-path="file.path"
@click="downloadFile"
>
{{ file.fileName }}
</div>
<span style="padding: 0 20px"></span>
<span style="color: red">(备注:支持Word,execl,ppt,pdf)</span>
</div>
<el-table
:data="dataList"
:loading="loading"
height="calc(100vh - 220px)"
>
<el-table-column label="名称" min-width="150" align="center" show-overflow-tooltip prop="categoryName"></el-table-column>
<el-table-column label="重点工作" min-width="100" align="center" show-overflow-tooltip prop="focusWork"></el-table-column>
<el-table-column label="重点任务" min-width="100" align="center"
show-overflow-tooltip prop="focusTask"></el-table-column>
<el-table-column label="加减分" min-width="100" align="center" show-overflow-tooltip prop="focusCheck"></el-table-column>
<el-table-column label="总分" min-width="100" align="center" show-overflow-tooltip prop="totalScore"></el-table-column>
</el-table>
</el-card>

</div>
</template>

<script>
import summaryApi from "@/api/chain/summary"
export default {
data() {
return {
uploading: false,
file: {},
loading:false,
dataList:[]
};
},
created(){
this.getDataList()
this.getFile()
},
methods: {
getDataList(){
this.loading=true
summaryApi.getChainCategoryAnalysisInfo().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
})
},
getFile() {
summaryApi
.getChainCategoryAnalysisAttach()
.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) => {
input.removeEventListener("change", upload);
if (this.uploading) {
this.$message({
type: "warning",
message: "正在上传",
});
return;
}
this.uploading = true;
let file = e.target.files[0];
if (!file) {
this.uploading = false;
return;
}
let MAXSIZE = 5 * 1024 * 1024;
if (file.size > MAXSIZE) {
this.$message.error("上传文件不得超过5M");
}
let formData = new FormData();
formData.append("file", file);
summaryApi
.uploadChainCategoryAnalysisAttach(formData)
.then((res) => {
let data = res.data;
if (data.code == 0) {
this.$message({
type: "success",
message: "上传文件成功",
});
} else {
this.$message.error(data.msg);
}
})
.catch((e) => {
this.$message.error(e);
})
.finally((e) => {
this.uploading = false;
this.getFile();
});
})
);
},
},
};
</script>

<style>
</style>

+ 13
- 0
src/views/chain/summary/table2.vue 查看文件

@@ -0,0 +1,13 @@
<template>
<div class="ele-body"></div>
</template>

<script>
export default {

}
</script>

<style>

</style>

+ 171
- 0
src/views/chain/summary/table3.vue 查看文件

@@ -0,0 +1,171 @@
<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"
@click="uploadFile"
>上传文件</el-button
>
<input type="file" style="display: none" ref="file" />
<div
style="display: inline-block; margin-left: 20px; cursor: pointer"
v-show="Object.keys(file).length > 0"
:data-path="file.path"
@click="downloadFile"
>
{{ file.fileName }}
</div>
<span style="padding: 0 20px"></span>
<span style="color: red">(备注:支持Word,execl,ppt,pdf)</span>
</div>
<el-table
:data="dataList"
:loading="loading"
height="calc(100vh - 220px)"
>
<el-table-column
label="部门名称"
min-width="150"
align="center"
prop="deptName"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="参与次数"
min-width="100"
align="center"
prop="partyNum"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="得分"
min-width="100"
align="center"
show-overflow-tooltip
>
<template slot-scope="{row}">
{{row.score||'/'}}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>

<script>
import summaryApi from "@/api/chain/summary"
export default {
data() {
return {
uploading: false,
file: {},
loading: false,
dataList: [],
};
},
created(){
this.getDataList();
this.getFile();
},
methods: {
getDataList() {
this.loading = true;
summaryApi
.getChainIndustryDeptAnalysisInfo()
.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;
});
},
getFile() {
summaryApi
.getChainIndustryDeptAnalysisAttach()
.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) => {
input.removeEventListener("change", upload);
if (this.uploading) {
this.$message({
type: "warning",
message: "正在上传",
});
return;
}
this.uploading = true;
let file = e.target.files[0];
if (!file) {
this.uploading = false;
return;
}
let MAXSIZE = 5 * 1024 * 1024;
if (file.size > MAXSIZE) {
this.$message.error("上传文件不得超过5M");
}
let formData = new FormData();
formData.append("file", file);
summaryApi
.uploadChainIndustryDeptAnalysisAttach(formData)
.then((res) => {
let data = res.data;
if (data.code == 0) {
this.$message({
type: "success",
message: "上传文件成功",
});
} else {
this.$message.error(data.msg);
}
})
.catch((e) => {
this.$message.error(e);
})
.finally((e) => {
this.uploading = false;
this.getFile();
});
})
);
},
},
};
</script>

<style>
</style>

Loading…
取消
儲存