Browse Source

xiugai1

master
yangzhou-cyber 3 years ago
parent
commit
8e355a4925
1 changed files with 305 additions and 302 deletions
  1. +305
    -302
      src/views/second/segmentation/contentDetail.vue

+ 305
- 302
src/views/second/segmentation/contentDetail.vue View File

@@ -351,290 +351,296 @@
</template>
</el-table-column>
</el-table> -->
<div class="table" v-loading="tableLoading" :style="{'height':tableHeight+'px',}">
<div
class="table"
v-loading="tableLoading"
:style="{ height: tableHeight + 'px' }"
>
<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="form.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="form.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
<div class="body 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="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>
<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="form.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="form.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"
>
<template v-else>
<el-link
slot="reference"
icon="el-icon-delete"
type="danger"
@click="change('edit', index, item)"
icon="el-icon-edit"
type="primary"
:underline="false"
>删除</el-link
>编辑</el-link
>
</el-popconfirm>
</template>
</span></el-col
>
</el-row>
</div>
<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>
@@ -788,18 +794,18 @@ export default {
}
if (type == "edit") {
let form = JSON.parse(JSON.stringify(row));
form.cooperateDept =
form.cooperateDept ?
form.cooperateDept.split(",").map((item) => parseInt(item)):[];
form.cooperatePrincipal =
form.cooperatePrincipal ?
form.cooperatePrincipal.split(",").map((item) => parseInt(item)):[];
form.otherDept =
form.otherDept ?
form.otherDept.split(",").map((item) => parseInt(item)):[];
form.otherPrincipal =
form.otherPrincipal ?
form.otherPrincipal.split(",").map((item) => parseInt(item)):[];
form.cooperateDept = form.cooperateDept
? form.cooperateDept.split(",").map((item) => parseInt(item))
: [];
form.cooperatePrincipal = form.cooperatePrincipal
? form.cooperatePrincipal.split(",").map((item) => parseInt(item))
: [];
form.otherDept = form.otherDept
? form.otherDept.split(",").map((item) => parseInt(item))
: [];
form.otherPrincipal = form.otherPrincipal
? form.otherPrincipal.split(",").map((item) => parseInt(item))
: [];
this.form = form;
this.$set(this.data[map[this.type]][index], "edit", true);
}
@@ -812,7 +818,7 @@ export default {
}
},
close() {
console.log('===============')
console.log("===============");
this.$router.back(-1);
},
add(data) {
@@ -840,7 +846,7 @@ export default {
}
for (let item of form[param]) {
if (!item && item != 0) {
debugger
debugger;
this.$message({
type: "warning",
message: "请完善信息",
@@ -850,7 +856,7 @@ export default {
}
} else {
if (!form[param]) {
debugger
debugger;
this.$message({
type: "warning",
message: "请完善信息",
@@ -862,7 +868,7 @@ export default {
typeof form[param] == "string" &&
form[param].trim() == ""
) {
debugger
debugger;
this.$message({
type: "warning",
message: "请完善信息",
@@ -977,7 +983,6 @@ export default {
</script>

<style scoped>

.title {
font-size: 18px;
font-weight: 700;
@@ -992,15 +997,13 @@ export default {
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 {
align-items: stretch;
}
.table{
.table {
overflow-x: scroll;
}
.table .el-row:hover {
@@ -1021,9 +1024,10 @@ export default {
width: calc(100%+16px);
box-sizing: border-box;
}
.scroll-x{
min-width:1500px;
overflow-y:visible;
.scroll-x {
min-width: 1500px;
overflow-y: visible;
border-top:1px solid rgb(237, 237, 237);
}
.grey {
background: #fafafa;
@@ -1033,5 +1037,4 @@ export default {
margin-top: 20px;
text-align: center;
}

</style>

Loading…
Cancel
Save