소스 검색

修改chain

master
yangzhou-cyber 3 년 전
부모
커밋
83eaf36107
1개의 변경된 파일77개의 추가작업 그리고 18개의 파일을 삭제
  1. +77
    -18
      src/views/chain/assessmentContent.vue

+ 77
- 18
src/views/chain/assessmentContent.vue 파일 보기

@@ -61,13 +61,13 @@
>
<el-col :span="3" align="center" class="td"
><span class="cell">
<pre>{{ detail.leaderDeptName }}</pre>
<pre>{{ detail.leaderDeptList | formatList }}</pre>
</span></el-col
>
<el-col :span="3" align="center" class="td"
><span class="cell">{{
detail.cooperateDeptName
}}</span></el-col
><span class="cell">
<pre>{{ detail.cooperateDeptList | formatList }}</pre>
</span></el-col
>
<!-- <el-col :span="3" align="center" class="td"
><span class="cell">打分操作记录</span></el-col
@@ -75,19 +75,25 @@
<el-col :span="4" align="center" class="td"
><span class="cell"
><el-link
@click="edit('edit', index, ind)"
@click="edit('edit', detail)"
icon="el-icon-edit"
type="primary"
:underline="false"
>修改</el-link
>
<el-link
slot="reference"
icon="el-icon-delete"
type="danger"
:underline="false"
>删除</el-link
></span
<el-popconfirm
title="确定要删除此考核内容?"
@confirm="remove(detail)"
class="ele-action"
>
<el-link
slot="reference"
icon="el-icon-delete"
type="danger"
:underline="false"
>删除</el-link
>
</el-popconfirm></span
></el-col
>
</el-row>
@@ -255,24 +261,55 @@ export default {
this.loading = false;
});
},
edit(type, index, ind) {
remove(detail) {
api
.delete(detail.id)
.then((res) => {
this.$message({
type: "success",
message: "删除考核目标内容成功",
});
this.getList();
})
.catch((e) => {
this.$message.error("删除考核目标内容失败");
});
},
edit(type, detail) {
this.showEdit = true;
let title;

if (type == "edit") {
title = "编辑考核内容";
this.action = "edit";
detail = JSON.parse(JSON.stringify(detail));
detail.leaderDept =
detail.leaderDept &&
detail.leaderDept.split(",").map((item) => parseInt(item));
detail.cooperateDept =
detail.cooperateDept &&
detail.cooperateDept.split(",").map((item) => parseInt(item));
this.form = detail;
}
if (type == "add") {
title = "新增考核内容";
this.action = "add";
this.form = {};
}
this.dialogTitle = title;
},
save(type) {
let params = [
"categoryId",
"type",
"content",
"points",
"score",
"leaderDept",
"cooperateDept",
];
let form = JSON.parse(JSON.stringify(this.form));
for (let key in form) {
console.log(key, form[key]);
for (let key of params) {
if (!form[key]) {
this.$message({
type: "warning",
@@ -311,9 +348,23 @@ export default {
form.cooperateDept = form.cooperateDept.join(",");
} catch (e) {
this.$message({ type: "warning", message: "请完善信息" });
return
return;
}
form.completion = "暂无";
if (this.action == "edit") {
api
.edit(form)
.then((res) => {
this.$message({
type: "success",
message: "修改考核目标内容成功",
});
this.showEdit = false;
this.getList();
})
.catch((e) => {
this.$message.error("修改考核目标内容失败");
});
}
if (this.action == "add") {
api
@@ -321,11 +372,12 @@ export default {
.then((res) => {
this.$message({
type: "success",
message: "添加考核目标内容失败",
message: "添加考核目标内容成功",
});
this.showEdit = false;
this.getList();
})
.then((e) => {
.catch((e) => {
this.$message.error("添加考核目标内容失败");
});
}
@@ -334,6 +386,13 @@ export default {
computed: {
...mapGetters(["formatDep"]),
},
filters: {
formatList(val) {
if (val) {
return val.join("\n");
}
},
},
};
</script>


Loading…
취소
저장