<style scoped>
|
.title {
|
height: 60px;
|
line-height: 60px;
|
}
|
|
.search {
|
background-color: #fff;
|
height: 80px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_thing {
|
width: 350px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_label {
|
width: 110px;
|
font-size: 14px;
|
text-align: right;
|
}
|
|
.search_input {
|
width: calc(100% - 110px);
|
}
|
|
.table {
|
margin-top: 10px;
|
background-color: #fff;
|
width: calc(100% - 40px);
|
height: calc(100% - 60px - 80px - 10px - 40px);
|
padding: 20px;
|
}
|
>>>.cell{
|
display: flex;
|
align-items: center;
|
}
|
.page {
|
width: 100%;
|
height: 30px;
|
text-align: right;
|
margin-bottom: 10px;
|
}
|
</style>
|
|
<template>
|
<div class="role_manage">
|
<div>
|
<el-row class="title">
|
<el-col :span="12" style="padding-left: 20px;">样品缺陷指数</el-col>
|
</el-row>
|
</div>
|
<div class="search">
|
<div class="search_thing">
|
<div class="search_label">检验项目:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable
|
v-model="entity.laboratoryName" @keyup.enter.native="refreshTable()"></el-input></div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">委托编号:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable
|
v-model="entity.laboratoryNumber" @keyup.enter.native="refreshTable()"></el-input></div>
|
</div>
|
<div class="search_thing" style="padding-left: 30px;">
|
<el-button size="small" @click="refresh()">重 置</el-button>
|
<el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
|
</div>
|
</div>
|
<div class="table">
|
<el-table
|
:data="tableData"
|
style="width: 100%;margin-bottom: 10px;height: calc(100% - 40px);"
|
row-key="id"
|
v-loading="loading"
|
border
|
default-expand-all
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
<el-table-column
|
prop="date"
|
label="检验项目"
|
sortable
|
min-width="180">
|
<template slot-scope="scope">
|
<p>
|
<el-tag style="margin-right: 10px;height: 24px;border-radius: 10px;line-height: 24px;border: 0;" :type="scope.row.level==2?'success':''">{{ '0' + scope.row.level }}</el-tag>
|
<span>{{ scope.row.date }}</span>
|
</p>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="name"
|
label="委托编号"
|
sortable
|
min-width="180">
|
</el-table-column>
|
<el-table-column
|
prop="address"
|
label="检验人"
|
min-width="180">
|
</el-table-column>
|
<el-table-column
|
prop="address"
|
label="检验时间"
|
min-width="180">
|
</el-table-column>
|
</el-table>
|
<div class="page">
|
<el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="page.current"
|
:page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper"
|
:total="total" >
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
entity: {},
|
tableData: [{
|
id: 3,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄',
|
level:1,
|
children: [{
|
id: 31,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄',
|
level:2,
|
}, {
|
id: 32,
|
date: '2016-05-01',
|
name: '王小虎',
|
address: '上海市普陀区金沙江路 1519 弄',
|
level:2,
|
}]
|
}],
|
page:{
|
current:1,
|
size:20,
|
},
|
total:0,
|
loading:false,
|
}
|
},
|
mounted() {
|
|
this.getPower()
|
},
|
methods: {
|
refreshTable(){
|
this.loading = true
|
},
|
refresh(){
|
this.page.size = 20;
|
this.page.current = 1;
|
this.refreshTable();
|
},
|
sizeChange(val){
|
this.page.size = val
|
this.refreshTable()
|
},
|
currentChange(val){
|
this.page.current = val
|
this.refreshTable()
|
},
|
// 权限分配
|
getPower(radio) {
|
let power = JSON.parse(sessionStorage.getItem('power'));
|
let up = false
|
let del = false
|
let add = false
|
for (var i = 0; i < power.length; i++) {
|
if (power[i].menuMethod == 'upParameter') {
|
up = true
|
}
|
if (power[i].menuMethod == 'delParameter') {
|
del = true
|
}
|
if (power[i].menuMethod == 'addParameter') {
|
add = true
|
}
|
}
|
if (!del) {
|
this.componentData.do.splice(1, 1)
|
}
|
if (!up) {
|
this.componentData.do.splice(0, 1)
|
}
|
this.addPower = add
|
}
|
}
|
}
|
</script>
|