<template>
<div id="addindex">
<div class="main_add simple">
<el-row type="flex" class="row-bg main_head" justify="space-between">
<el-col :span="6"><div class="addcolor" style="text-align:left">基本信息{{nodename}}</div></el-col>
</el-row>
<el-row :gutter="10" class="formWrap">
<el-col class="form-item" :span="10">
<div class="inputLabel" style="width:50px">节点编码</div>
<el-input :maxlength="20"></el-input>
</el-col>
<el-col class="form-item" :span="10">
<div class="inputLabel">节点名称</div>
<el-input v-model="nodename" :maxlength="20"></el-input>
</el-col>
</el-row>
<el-row :gutter="10" class="formWrap">
<el-col class="form-item" :span="10">
<div class="inputLabel">上级节点</div>
<el-input :maxlength="20"></el-input>
</el-col>
<el-col class="form-item" :span="10" style='text-align:left;margin-top:3px;'>
<div class="inputLabel" style='float:left;margin-right:5px'>节点状态</div>
<div style='display:flex;margin-top:20px' >
<el-radio class="radio" v-model="radio" label="1"><span style='font-size:13px'>启用</span></el-radio>
<el-radio class="radio" v-model="radio" label="2"><span style='font-size:13px'>禁用</span></el-radio>
</div>
</el-col>
</el-row>
<el-row :gutter="10" class="formWrap">
<el-col class="form-item" :span="10">
<div class="inputLabel">数据来源</div>
<el-input :maxlength="20"></el-input>
</el-col>
<el-col class="form-item" :span="10">
<div class="inputLabel">人事系统组织</div>
<el-input :maxlength="20" icon="search"></el-input>
</el-col>
</el-row>
<el-row :gutter="10" class="formWrap">
<el-col class="form-item" :span="10">
<div class="inputLabel">节点类型</div>
<el-select placeholder="全部">
<el-option></el-option>
</el-select>
</el-col>
</el-row>
<el-row :gutter="10" class="formWrap">
<el-col class="form-item" :span="24">
<div class="inputLabel">节点路径</div>
<el-input length="120"></el-input>
</el-col>
</el-row>
<el-row type="flex" class="row-bg main_head">
<el-col :span="6"><div class="addcolor" style="text-align:left;">财务段信息</div></el-col>
<el-col style="text-align:right">
<span class="toolButtonItem">
<img src="@/icons/icon_edit01.png" style="margin-bottom:-3px"> 编辑
</span>
<span class="toolButtonItem" @click='addList' >
<img src="@/icons/icon_add.png" style="margin-bottom:-3px"> 新增
</span>
<span class="toolButtonItem" @click='deleteList' >
<img src="@/icons/icon_delete.png" style="margin-bottom:-3px"> 删除
</span>
</el-col>
</el-row>
<el-row type="flex" class="row-bg">
<template>
<el-table
:data="tabledata"
@select="selectItem"
border
style="width: 100%">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
type="index"
label="序号"
width="100">
</el-table-column>
<el-table-column
label="账套"
>
<template>
<el-select>
<el-option></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
label="公司段"
>
<template >
<el-input icon="search"></el-input>
</template>
</el-table-column>
<el-table-column
label="成本中心">
<template >
<el-input icon="search"></el-input>
</template>
</el-table-column>
<el-table-column
label="业务段"
>
<template >
<el-input icon="search"></el-input>
</template>
</el-table-column>
<el-table-column
label="产品段"
>
<template>
<el-input icon="search"></el-input>
</template>
</el-table-column>
</el-table>
</template>
</el-row>
<el-row type="flex" class="row-bg main_head">
<el-col :span="6"><div class="addcolor" style="text-align:left">用户岗位信息</div></el-col>
<el-col style="text-align:right">
<span class="toolButtonItem" >
<img src="@/icons/icon_add.png" style="margin-bottom:-3px"> 新增岗位
</span>
<span class="toolButtonItem">
<img src="@/icons/icon_edit01.png" style="margin-bottom:-3px"> 编辑
</span>
<span class="toolButtonItem" @click='addpost' >
<img src="@/icons/icon_add.png" style="margin-bottom:-3px"> 新增
</span>
<span class="toolButtonItem" >
<img src="@/icons/icon_delete.png" style="margin-bottom:-3px"> 删除
</span>
</el-col>
</el-row>
<el-row type="flex" class="row-bg">
<template>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
type="index"
label="序号"
width="100">
</el-table-column>
<el-table-column
prop="post"
label="岗位"
width=250
align="left"
>
</el-table-column>
<el-table-column
prop="nameorcode"
align="left"
label="员工编码/员工名称"
>
</el-table-column>
</el-table>
</template>
</el-row>
</div>
<el-dialog
title="编辑岗位人员"
:visible.sync="dialogVisible_post"
size="full"
:showClose="false"
:modal="false"
:closeOnClickModal="false"
>
<AddPost></AddPost>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible_post = false" style="padding:10px 38px;margin-right:">关闭</el-button>
<el-button type="primary" @click="dialogVisible_post = false">保存并关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import AddPost from "./addpost";
export default{
name:"",
data(){
return{
radio:"",
currentdata:[],
nodename:"",
dialogVisible_post:false,
tableData:[
{
post:"部门长",
nameorcode:'18372 / 赵昭'
},
{
post:"部门预算员",
nameorcode:'19376 / 王婉'
},
{
post:"普通员工",
nameorcode:'12345 / 张申;12353 / 李丽;12385 / 程诚(兼岗);'
}
],
tabledata:[
{
post:"部门长",
nameorcode:'18372 / 赵昭'
},
{
post:"部门预算员",
nameorcode:'19376 / 王婉'
},
{
post:"普通员工",
nameorcode:'12345 / 张申;12353 / 李丽;12385 / 程诚(兼岗);'
}
]
}
},
methods: {
selectItem(val){
this.currentdata=val;
},
addList(){
var obj = JSON.parse(JSON.stringify(this.tabledata[0]));
for(var i in obj){
if(typeof obj[i] =="string"||typeof obj[i] =="number"){
obj[i]=""
}
};
this.tabledata.push(obj);
},
deleteList(){
this.tabledata.map((item, index) => {
this.currentdata.map((otem, ondex) => {
if (otem == item) {
this.tabledata.splice(index, 1)
}
})
})
},
addpost(){
this.dialogVisible_post = true;
}
},
components:{
AddPost
}
}
</script>
<style lang="css">
.main_add{
border: 1px solid rgb(217, 206, 191);
padding: 20px;
border-radius: 10px;
}
</style>