<style scoped>
|
.title .el-button {
|
height: 32px;
|
border: 1px solid rgba(190, 190, 190, 0.44);
|
box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
|
padding: 0 12px;
|
}
|
|
.title {
|
margin-bottom: 10px;
|
padding: 0 20px;
|
}
|
|
.title * {
|
font-size: 16px;
|
}
|
|
.choose {
|
padding: 21px 24px;
|
display: flex;
|
align-items: center;
|
background-color: #fff;
|
border-bottom: 3px solid rgb(245, 247, 251);
|
}
|
|
.choose * {
|
font-size: 14px;
|
}
|
|
.choose .el-button {
|
height: 32px;
|
border: 1px solid rgba(190, 190, 190, 0.44);
|
box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
|
padding: 0 12px;
|
}
|
|
.thing {
|
width: calc(100% - 44px);
|
height: calc(100% - 42px - 82px - 66px);
|
background-color: #fff;
|
overflow: auto;
|
padding: 33px 22px;
|
}
|
|
.table_do {
|
color: #004ea0;
|
cursor: pointer;
|
}
|
</style>
|
<style>
|
.record_content .title .el-button * {
|
font-size: 14px;
|
}
|
|
.record_content .title .el-button--default {
|
color: #004EA2;
|
}
|
|
.record_content .thing * {
|
font-size: 14px;
|
}
|
|
.record_content .has-gutter .el-table__cell {
|
background-color: #F0F1F5 !important;
|
color: #333;
|
}
|
|
.record_content .has-gutter .el-table__cell .cell {
|
font-size: 16px;
|
font-weight: 500;
|
}
|
|
.record_content .cell {
|
color: #333;
|
padding-left: 17px !important;
|
}
|
|
.record_content .el-table__body-wrapper {
|
height: 100%;
|
}
|
|
.raw_ins .el-table__body {
|
height: 100%;
|
}
|
</style>
|
|
<template>
|
<div class="record_content">
|
<div class="title">
|
<el-row>
|
<el-col :span="12" style="line-height: 32px;">记录内容维护</el-col>
|
<el-col :span="12" style="text-align: right;">
|
<el-button type="primary" icon="el-icon-plus" style="background: #004EA2;">新增</el-button>
|
<el-button icon="el-icon-edit-outline">修改</el-button>
|
<el-button icon="el-icon-delete">删除</el-button>
|
</el-col>
|
</el-row>
|
</div>
|
<div class="choose">
|
<span>类型:</span>
|
<el-select v-model="search.type" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
|
<el-option label="橡胶连接器" :value="0"></el-option>
|
<el-option label="金属连接器" :value="1"></el-option>
|
<el-option label="湿插拔电连接器" :value="2"></el-option>
|
<el-option label="分支组件" :value="3"></el-option>
|
</el-select>
|
<span>工序:</span>
|
<el-select v-model="search.name" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
|
<el-option v-for="(a, ai) in process" key="ai" :label="a.name" :value="a.id"></el-option>
|
</el-select>
|
<el-button size="mini" @click="clean()"><span>重 置</span></el-button>
|
<el-button size="mini" type="primary" style="background: #004EA2;"><span>查
|
询</span></el-button>
|
</div>
|
<div class="thing">
|
<el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)"
|
max-height="calc(100% - 50px)" @selection-change="handleSelectionChange" default-expand-all
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" row-key="id">
|
<el-table-column type="selection" width="50">
|
</el-table-column>
|
<el-table-column type="index" label="序号" width="70">
|
</el-table-column>
|
<el-table-column prop="name" label="工序">
|
<template slot-scope="scope">
|
<span>
|
<font>{{scope.row.ids}}</font>{{scope.row.name}}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="address" label="备注">
|
</el-table-column>
|
<el-table-column label="操作" width="130">
|
<template slot-scope="scope">
|
<span class="table_do">编辑 </span>
|
<span class="table_do" @click="deleteRow(scope.$index, tableData)">删除</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
search: {
|
type: 0,
|
name: null
|
},
|
process: [],
|
tableData: [{
|
id: 1,
|
date: '2016-05-02',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1518 弄'
|
}, {
|
id: 2,
|
date: '2016-05-04',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1517 弄'
|
}, {
|
id: 3,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄',
|
children: [{
|
id: 31,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄',
|
children: [{
|
id: 33,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄'
|
}, {
|
id: 34,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄'
|
}]
|
}, {
|
id: 32,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄'
|
}]
|
}, {
|
id: 4,
|
date: '2016-05-03',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1516 弄'
|
}],
|
selects: []
|
}
|
},
|
mounted() {
|
this.selectDataList()
|
},
|
methods: {
|
clean() {
|
this.search = {
|
type: null,
|
name: null
|
}
|
},
|
selectDataList(){
|
this.tableData.forEach(a=>{
|
a.ids = '01'
|
if(a.children!=undefined){
|
a.children.forEach(b=>{
|
b.ids = '02'
|
if(b.children!=undefined){
|
b.children.forEach(c=>{
|
c.ids = '03'
|
})
|
}
|
})
|
}
|
})
|
},
|
handleSelectionChange(val) {
|
this.selects = val;
|
},
|
del(ob) {
|
console.log(ob)
|
},
|
deleteRow(index, rows) {
|
console.log(index);
|
console.log(rows);
|
rows.splice(index, 1);
|
}
|
}
|
}
|
</script>
|