属性绑定
<Boyo-Filter :filter="filterInfo"
:listTypeInfo="listTypeInfo"
@handleClick="handleSearch">
</Boyo-Filter>
<Boyo-Content ref="BoyoContent"
:visible="filterInfo.visible"
:loading="content.loading">
<BoyoButton :buttonList="buttonList"
:fieldList="tableInfo.fieldList"
@handClick="handClick">
</BoyoButton>
<Boyo-Table :tableInfo="tableInfo"
:filterInfo="filterInfo.data"
:listTypeInfo="listTypeInfo"
@TableEvent="TableEvent"
@handleSizeChange="handleSizeChange"
@handleCurrentChange="handleCurrentChange">
</Boyo-Table>
<Boyo-Dialog :dialogInfo="dialogInfo"
@dialogEvent="dialogEvent">
<Boyo-Form :formInfo="formInfo"
:refObj.sync="formInfo.ref"
:listTypeInfo="listTypeInfo"
@hanClick="formClick"
@on-success="handleAvatarSuccess">
</Boyo-Form>
</Boyo-Dialog>
</Boyo-Content>
export default {
name:'',
props: {},
data () {
return {
timer: null,
addCarrecordShow: false,
filterInfo: {
visible: null,
data: {},
list: [],
},
listTypeInfo: {},
printInfo: [],
buttonList: {
left: [],
right: [
{ icon: 'el-icon-search', type: 'button', event: 'filter' },
{ icon: 'el-icon-refresh', type: 'button', event: 'refresh' },
{ icon: 'el-icon-s-grid', type: 'button', event: 'mode' },
{ icon: 'el-icon-arrow-down', type: 'down', event: 'table-menu' }
]
},
content: {
loading: null
},
tableInfo: {
selection: false,
selectReset: null,
mode: null,
data: [],
total: 100,
pager: true,
multipleSelection: [],
fieldList: [
{
value: 'deliverNo',
label: '单号',
show: true,
dropdown: true,
sortable: true
},
{
value: 'supplierName',
label: '供应商',
show: true,
dropdown: true
},
{
value: 'button',
label: '操作',
type: 'button',
show: true,
dropdown: true,
width: 210
}
],
btList: []
},
dialogInfo: {
visible: false,
width: '41%',
title: {
add: '车辆入场',
write: '编辑'
},
type: 'add',
btList: [
{
label: '确定',
type: 'primary',
icon: '',
event: 'save',
loading: false
},
{ label: '关闭', type: '', icon: '', event: 'close', loading: false }
]
},
formInfo: {
ref: null,
labelWidth: '25%',
data: {
id: null,
carNumber: '',
supplierId: '',
goodsName: '废铁',
driverLicense: '',
travelLicense: ''
},
list: [
{
type: 'select',
label: '供应商:',
value: 'supplierId',
style: 'width:80%',
list: 'supplier',
required: true
}
],
rules: {
phone: [{ required: true, validator: validateTel, trigger: 'blur' }]
}
}
created (){
const buttonList = this.menuList[1].item[3]
const tableBt = this.tableInfo.btList
const leftBtn = this.buttonList.left
if (buttonList.addAuth) {
leftBtn.push({
icon: 'el-icon-plus',
style: 'background:#1a7bb9',
desc: '车辆入场',
event: 'arrive'
})
}
if (buttonList.editAuth) {
tableBt.push({
label: '编辑',
icon: 'el-icon-edit',
style: 'background:#1a7bb9',
event: 'write'
})
}
if (buttonList.printAuth) {
tableBt.push({
label: '补打',
icon: 'el-icon-printer',
style: 'background:#f8ac59',
event: 'print'
})
}
if (!tableBt.length) {
this.tableInfo.fieldList.pop()
} else {
this.tableInfo.fieldList[this.tableInfo.fieldList.length - 1].width =
tableBt.length * 100
}
},
mounted () {
this.getInfo()
this.init()
},
methods: {
init(){},
getInfo(){},
handleSearch (val, data) {
switch (val) {
case 'search':
Object.assign(this.filterInfo.data, data)
this.getInfo()
break
case 'refresh':
for (let i in data) {
data[i] = ''
}
for (let i in this.filterInfo.data) {
this.filterInfo.data[i] = ''
}
this.filterInfo.data.pageNumber = 1
this.filterInfo.data.pageSize = 20
this.getInfo()
break
}
},
}
}