Browse Source

合并提交

master
YF-yuan 3 years ago
parent
commit
a9c1402fa7
6 changed files with 422 additions and 68 deletions
  1. +43
    -22
      src/views/basicTable/category.vue
  2. +2
    -2
      src/views/chain/coordinationManage/applyCooperation.vue
  3. +7
    -0
      src/views/second/coordinationManage/applyCooperation/basicTarget.vue
  4. +2
    -2
      src/views/second/coordinationManage/applyCooperation/constraint.vue
  5. +2
    -2
      src/views/second/coordinationManage/applyCooperation/reward.vue
  6. +366
    -40
      src/views/second/segmentation/contentDetail.vue

+ 43
- 22
src/views/basicTable/category.vue View File

@current-change="getDataList()" @current-change="getDataList()"
/> />
</el-card> </el-card>
<el-dialog
<el-dialog
:title="dialogTitle" :title="dialogTitle"
:visible.sync="showAdd" :visible.sync="showAdd"
width="400px" width="400px"
> >
<el-form-item label="考核年度:" prop="year"> <el-form-item label="考核年度:" prop="year">
<el-date-picker <el-date-picker
:disabled='ischecked=="look"'
:disabled="ischecked == 'look'"
type="year" type="year"
placeholder="选择考核年度" placeholder="选择考核年度"
style="width: 100%" style="width: 100%"
</el-form-item> </el-form-item>
<el-form-item label="表格名称:" prop="name"> <el-form-item label="表格名称:" prop="name">
<el-input <el-input
:disabled='ischecked=="look"'
:disabled="ischecked == 'look'"
placeholder="请输入如表格名称" placeholder="请输入如表格名称"
clearable clearable
v-model="form.name" v-model="form.name"
</el-form-item> </el-form-item>
<el-form-item label="表编号:" prop="code"> <el-form-item label="表编号:" prop="code">
<el-input <el-input
:disabled='ischecked=="look"'
:disabled="ischecked == 'look'"
placeholder="请输入表编号" placeholder="请输入表编号"
clearable clearable
v-model="form.code" v-model="form.code"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注:"> <el-form-item label="备注:">
<el-input :disabled='ischecked=="look"' type="textarea" :rows="4" v-model="form.note"></el-input>
<el-input
:disabled="ischecked == 'look'"
type="textarea"
:rows="4"
v-model="form.note"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button @click="showAdd = false">取消</el-button>&nbsp; <el-button @click="showAdd = false">取消</el-button>&nbsp;
<el-button type="primary" @click="save" v-if="ischecked !== 'look'">保存</el-button>
<el-button type="primary" @click="save" v-if="ischecked !== 'look'"
>保存</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
loading: false, loading: false,
dataList: [], dataList: [],
count: 0, count: 0,
dialogTitle:'添加表',
ischecked: 'edit',
dialogTitle: "添加表",
ischecked: "edit",
page: { page: {
page: 1, page: 1,
limit: Math.floor( limit: Math.floor(
this.$store.dispatch("base/getQuota1List", 1); this.$store.dispatch("base/getQuota1List", 1);
}, },
methods: { methods: {
updateParams(data){
this.searchParams=data;
updateParams(data) {
this.searchParams = data;
this.resetCurrentPage(); this.resetCurrentPage();
this.getDataList(); this.getDataList();
}, },
getDataList() { getDataList() {
this.loading = true; this.loading = true;
api api
.getList(Object.assign({},this.searchParams,this.page))
.getList(Object.assign({}, this.searchParams, this.page))
.then((res) => { .then((res) => {
this.loading = false; this.loading = false;
let data = res.data.data.records; let data = res.data.data.records;
}); });
}, },
add() { add() {
this.dialogTitle = '添加表'
this.dialogTitle = "添加表";
this.form = { code: "", name: "", note: "", year: "" }; this.form = { code: "", name: "", note: "", year: "" };
this.showAdd = true; this.showAdd = true;
this.ischecked = 'add'
this.ischecked = "add";
}, },
look(row) { look(row) {
this.form = Object.assign({}, row)
this.dialogTitle = '查看表'
this.showAdd = true
this.ischecked = 'look'
this.form = Object.assign({}, row);
this.dialogTitle = "查看表";
this.showAdd = true;
this.ischecked = "look";
}, },
edit(row) { edit(row) {
this.form = Object.assign({}, row)
this.form = Object.assign({}, row);
this.showAdd = true; this.showAdd = true;
this.dialogTitle = '编辑表'
this.ischecked = 'edit'
this.dialogTitle = "编辑表";
this.ischecked = "edit";
}, },
remove(row) { remove(row) {
if (!row) { if (!row) {
this.loading = fa; this.loading = fa;
se; se;
this.$message.error("删失败"); this.$message.error("删失败");
}).finally(()=>{
})
.finally(() => {
this.getDataList(); this.getDataList();
}); });
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
this.$message.error("删除失败"); this.$message.error("删除失败");
}).finally(()=>{
})
.finally(() => {
this.getDataList(); this.getDataList();
}); });
} }
</script> </script>


<style lang="css" scoped> <style lang="css" scoped>
.el-row {
align-items: stretch;
}
.el-col {
border-bottom: 1px solid rgb(201, 201, 201);
border-right: 1px solid rgb(201, 201, 201);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
padding: 10px;
}
</style> </style>

+ 2
- 2
src/views/chain/coordinationManage/applyCooperation.vue View File

}, },
judge(row) { judge(row) {
let arr = [].concat( let arr = [].concat(
row.cooperateDept.split(",").map((item) => parseInt(item)),
row.leaderDept.split(",").map((item) => parseInt(item))
row.cooperateDept?row.cooperateDept.split(",").map((item) => parseInt(item)):[],
row.leaderDept?row.leaderDept.split(",").map((item) => parseInt(item)):[]
); );
let bool = arr.includes(this.user.user.deptId) || row.status == 1; let bool = arr.includes(this.user.user.deptId) || row.status == 1;
return bool; return bool;

+ 7
- 0
src/views/second/coordinationManage/applyCooperation/basicTarget.vue View File

methods: { methods: {
judge(row) { judge(row) {
let arr = [].concat( let arr = [].concat(
<<<<<<< HEAD
row.leaderDept, row.leaderDept,
row.cooperateDept.split(",").map((item) => parseInt(item)), row.cooperateDept.split(",").map((item) => parseInt(item)),
row.otherDept.split(",").map((item) => parseInt(item)) row.otherDept.split(",").map((item) => parseInt(item))
); );
let bool = arr.includes(this.user.user.deptId) || row.status == 1; let bool = arr.includes(this.user.user.deptId) || row.status == 1;
=======
row.cooperateDept?row.cooperateDept.split(",").map((item) => parseInt(item)):[],
row.leaderDept?row.leaderDept.split(",").map((item) => parseInt(item)):[]
);
let bool = arr.includes(this.user.user.deptId);
>>>>>>> 690237002de21be6eeb5ebc60c73daa2a09a1246
return bool; return bool;
}, },
updateParams(data) { updateParams(data) {

+ 2
- 2
src/views/second/coordinationManage/applyCooperation/constraint.vue View File

methods: { methods: {
judge(row) { judge(row) {
let arr = [].concat( let arr = [].concat(
row.cooperateDept.split(",").map((item) => parseInt(item)),
row.leaderDept.split(",").map((item) => parseInt(item))
row.cooperateDept?row.cooperateDept.split(",").map((item) => parseInt(item)):[],
row.leaderDept?row.leaderDept.split(",").map((item) => parseInt(item)):[]
); );
let bool = arr.includes(this.user.user.deptId) || row.status == 1; let bool = arr.includes(this.user.user.deptId) || row.status == 1;
return bool; return bool;

+ 2
- 2
src/views/second/coordinationManage/applyCooperation/reward.vue View File

methods: { methods: {
judge(row) { judge(row) {
let arr = [].concat( let arr = [].concat(
row.cooperateDept.split(",").map((item) => parseInt(item)),
row.leaderDept.split(",").map((item) => parseInt(item))
row.cooperateDept?row.cooperateDept.split(",").map((item) => parseInt(item)):[],
row.leaderDept?row.leaderDept.split(",").map((item) => parseInt(item)):[]
); );
let bool = arr.includes(this.user.user.deptId) || row.status == 1; let bool = arr.includes(this.user.user.deptId) || row.status == 1;
return bool; return bool;

+ 366
- 40
src/views/second/segmentation/contentDetail.vue View File

> >
<div class="base-info"> <div class="base-info">
<div class="title">基础信息:</div> <div class="title">基础信息:</div>
<div class="body">
<div class="base-body">
<el-row v-if="type == 1 || type == 2" type="flex"> <el-row v-if="type == 1 || type == 2" type="flex">
<el-col :span="5" class="grey"><span>一级指标</span></el-col> <el-col :span="5" class="grey"><span>一级指标</span></el-col>
<el-col :span="7" <el-col :span="7"
> >
</div> </div>
<div> <div>
<el-table
<!-- <el-table
:data="detailList" :data="detailList"
border border
highlight-current-row highlight-current-row
v-loading="tableLoading" v-loading="tableLoading"
:height="tableHeight"
> >
<el-table-column <el-table-column
type="index" type="index"
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="135"> <el-table-column label="操作" align="center" width="135">
<template slot-scope="{ row, $index }"> <template slot-scope="{ row, $index }">
<el-link
v-if="row.add || row.edit"
@click="add(row)"
icon="el-icon-edit"
type="primary"
:underline="false"
>保存</el-link
>
<template v-if="row.add || row.edit">
<el-link
@click="add(row)"
icon="el-icon-edit"
type="primary"
:underline="false"
>保存</el-link
>
<el-link
@click="remove('cancel', $index, row)"
icon="el-icon-edit"
type="primary"
:underline="false"
>取消</el-link
>
</template>

<template v-else> <template v-else>
<el-link <el-link
@click="change('edit', $index)"
@click="change('edit', $index, row)"
icon="el-icon-edit" icon="el-icon-edit"
type="primary" type="primary"
:underline="false" :underline="false"
> >
<el-popconfirm <el-popconfirm
title="确定要删除此表格?" title="确定要删除此表格?"
@confirm="remove(row.id)"
@confirm="remove('delete', row.id)"
class="ele-action" class="ele-action"
> >
<el-link <el-link
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
</el-table>
</el-table> -->
<div class="table" v-loading="tableLoading">
<div class="scroll-x">
<div class="header">
<el-row type="flex">
<el-col :span="1" align="center" class="thead td"
><span class="cell">编号</span></el-col
>
<el-col :span="4" align="center" class="thead td"
><span class="cell">小项内容</span></el-col
>
<el-col :span="1" 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
>
<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
>
<el-col :span="2" align="center" class="thead td"
><span class="cell">操作</span></el-col
>
</el-row>
</div>
<div class="body">
<el-row
type="flex"
v-for="(item, index) of detailList"
:key="index"
>
<el-col :span="1" align="center" class="thead td"
><span class="cell">{{ index + 1 }}</span></el-col
>
<el-col :span="4" align="center" class="thead td"
><span class="cell">
<el-input
type="textarea"
placeholder="请输入小项内容"
v-model="item.itemContent"
v-if="item.edit || item.add"
:row="5"
></el-input>
<span v-else>{{ item.itemContent }}</span>
</span></el-col
>
<el-col :span="1" align="center" class="thead td"
><span class="cell">
<el-input
placeholder="请输入分值"
v-if="item.edit || item.add"
v-model="item.points"
></el-input>
<span v-else>{{ item.points }}</span>
</span></el-col
>
<el-col :span="2" align="center" class="thead td"
><span class="cell">
<treeselect
:disable-branch-nodes="true"
@input="changePrincipal($event, 'leader')"
v-if="item.edit || item.add"
v-model="form.leaderDept"
:options="formatDep"
placeholder="请选择牵头部门"
:defaultExpandLevel="1"
:normalizer="
(d) => {
return {
id: d.id,
label: d.name,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
<span v-else>
<pre>{{ item.leaderDeptList | formatList }}</pre>
</span>
</span></el-col
>
<el-col :span="2" align="center" class="thead td"
><span class="cell">
<treeselect
:disable-branch-nodes="true"
:disable="true"
v-if="item.edit || item.add"
v-model="form.leaderPrincipal"
:options="principalList"
placeholder="请选择牵头部门责任领导"
:defaultExpandLevel="1"
:normalizer="
(d) => {
return {
id: d.id,
label: d.realname,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
<span v-else>
<pre>{{ item.leaderPrincipalList | formatList }}</pre>
</span>
</span></el-col
>
<el-col :span="3" align="center" class="thead td"
><span class="cell">
<treeselect
:disable-branch-nodes="true"
v-if="item.edit || item.add"
@input="changePrincipal($event, 'other')"
:multiple="true"
v-model="form.otherDept"
:options="formatDep"
placeholder="请选择其他牵头部门"
:defaultExpandLevel="1"
:normalizer="
(d) => {
return {
id: d.id,
label: d.name,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
<span v-else>
<pre>{{ item.otherDeptList | formatList }}</pre>
</span>
</span></el-col
>
<el-col :span="3" align="center" class="thead td"
><span class="cell">
<treeselect
:disable-branch-nodes="true"
:disabled="true"
v-if="item.edit || item.add"
:multiple="true"
v-model="form.otherPrincipal"
:options="principalList"
placeholder="请选择牵头部门责任领导"
:defaultExpandLevel="1"
:normalizer="
(d) => {
return {
id: d.id,
label: d.realname,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
<span v-else>
<pre>{{ item.otherPrincipalList | formatList }}</pre>
</span>
</span></el-col
>
<el-col :span="3" align="center" class="thead td"
><span class="cell">
<treeselect
:disable-branch-nodes="true"
@input="changePrincipal($event, 'cooperate')"
v-if="item.edit || item.add"
:multiple="true"
v-model="form.cooperateDept"
:options="formatDep"
placeholder="请选择配合部门"
:defaultExpandLevel="1"
:normalizer="
(d) => {
return {
id: d.id,
label: d.name,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
<span v-else>
<pre>{{ item.cooperateDeptList | formatList }}</pre>
</span>
</span></el-col
>
<el-col :span="3" align="center" class="thead td"
><span class="cell">
<treeselect
:disable-branch-nodes="true"
v-if="item.edit || item.add"
:multiple="true"
:disabled="true"
v-model="form.cooperatePrincipal"
:options="principalList"
placeholder="请选择配合部门责任领导"
:defaultExpandLevel="1"
:normalizer="
(d) => {
return {
id: d.id,
label: d.realname,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
<span v-else>
<pre>{{ item.cooperatePrincipalList | formatList }}</pre>
</span>
</span></el-col
>
<el-col :span="2" align="center" class="thead td"
><span class="cell">
<template v-if="item.add || item.edit">
<el-link
@click="add(item)"
icon="el-icon-edit"
type="primary"
:underline="false"
>保存</el-link
>
<el-link
@click="remove('cancel', index, item)"
icon="el-icon-edit"
type="primary"
:underline="false"
>取消</el-link
>
</template>

<template v-else>
<el-link
@click="change('edit', index, item)"
icon="el-icon-edit"
type="primary"
:underline="false"
>编辑</el-link
>
<el-popconfirm
title="确定要删除此表格?"
@confirm="remove('delete', item.id)"
class="ele-action"
>
<el-link
slot="reference"
icon="el-icon-delete"
type="danger"
:underline="false"
>删除</el-link
>
</el-popconfirm>
</template>
</span></el-col
>
</el-row>
</div>
</div>
<!-- <div class="line"></div> -->
</div>
</div> </div>
<div slot="footer" class="footer"> <div slot="footer" class="footer">
<el-button @click="close">返回</el-button>&nbsp; <el-button @click="close">返回</el-button>&nbsp;
tableLoading: false, tableLoading: false,
form: {}, form: {},
reducing: false, reducing: false,
tableHeight: document.documentElement.clientHeight - 750,
}; };
}, },
computed: { computed: {
this.tableLoading = false; this.tableLoading = false;
}); });
}, },
change(type, index) {
change(type, index, row) {
if (!this.reducing) { if (!this.reducing) {
if (type == "add") { if (type == "add") {
this.form = {}; this.form = {};
}); });
} }
}, },
remove(id) {
this.allLoading = true;
this.getApi()
.deleteItem(id)
.then((res) => {
this.$message({ type: "success", message: "删除小项成功" });
this.getData();
})
.catch((e) => {
console.log(e);
this.$message.error("删除小项失败");
})
.finally(() => {
this.allLoading = false;
});
remove(type, id, row) {
if (type == "delete") {
this.allLoading = true;
this.getApi()
.deleteItem(id)
.then((res) => {
this.$message({ type: "success", message: "删除小项成功" });
this.getData();
})
.catch((e) => {
console.log(e);
this.$message.error("删除小项失败");
})
.finally(() => {
this.allLoading = false;
});
}
if (type == "cancel") {
this.reducing = false;
if (row.add) {
this.$set(this.detailList[id], "add", null);
this.detailList.splice(id, 1);
}
if (row.edit) {
this.$set(this.detailList[id], "edit", null);
}
}
}, },
}, },
}; };
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.body {
border-left: 1px solid rgb(201, 201, 201);
border-top: 1px solid rgb(201, 201, 201);
.base-body {
border-left: 1px solid rgb(237, 237, 237);
border-top: 1px solid rgb(237, 237, 237);
max-width: 1200px; max-width: 1200px;
background: #fff; background: #fff;
} }
.header {
border-top: 1px solid rgb(237, 237, 237);
border-left: 1px solid rgb(237, 237, 237);
color: #262626;
background-color: #fafafa;
}
.el-row { .el-row {
align-items: stretch; align-items: stretch;
} }
.table{
overflow-x: scroll;
}
.table .el-row:hover {
background: #fafafa;
}
.el-col { .el-col {
border-bottom: 1px solid rgb(201, 201, 201);
border-right: 1px solid rgb(201, 201, 201);
border-bottom: 1px solid rgb(237, 237, 237);
border-right: 1px solid rgb(237, 237, 237);
text-align: center; text-align: center;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 10px; padding: 10px;
} }
.body {
border-left: 1px solid rgb(237, 237, 237);
position: relative;
width: calc(100%+16px);
box-sizing: border-box;
}
.scroll-x{
min-width:1500px;
}
.grey { .grey {
background: #eeeeee; background: #eeeeee;
} }
margin-top: 20px; margin-top: 20px;
text-align: center; text-align: center;
} }
/deep/ .cell,
.el-table,
/deep/ .el-table__body-wrapper,
.el-card {
overflow: visible;
}

</style> </style>

Loading…
Cancel
Save