<template>
|
<div>
|
<avue-crud
|
class="company-box"
|
:option="punishOption"
|
:search.sync="punishSearch"
|
:table-loading="punishLoading"
|
:data="punishData"
|
ref="punishCrud"
|
:page.sync="punishPage"
|
@selection-change="punishSelectionChange"
|
@search-change="punishSearchChange"
|
@search-reset="punishSearchReset"
|
@current-change="punishCurrentChange"
|
@size-change="punishSizeChange"
|
@refresh-change="punishRefreshcCange"
|
@on-load="punishOnLoad"
|
>
|
<template slot="menuLeft">
|
<el-button
|
icon="el-icon-warning"
|
@click.stop="punishOpen(row)"
|
type="danger"
|
size="small"
|
plain
|
v-if="form.see"
|
>处罚</el-button
|
>
|
</template>
|
</avue-crud>
|
</div>
|
|
<!-- @on-load="punishOnLoad" -->
|
</template>
|
|
<script>
|
import { getListPunish } from "@/api/securityCompany/security";
|
import { punishColimn } from "../column";
|
|
export default {
|
props: ["form"],
|
watch: {
|
"form.news"() {
|
if (this.form.see) {
|
this.refreshChange();
|
}
|
},
|
},
|
data() {
|
return {
|
punishOption: {
|
// 操作栏多余按钮去除
|
delBtn: false,
|
editBtn: false,
|
// searchShowBtn: false,
|
addBtn: false,
|
selection: true,
|
border: true,
|
menu: false,
|
|
align: "center",
|
height: "auto",
|
calcHeight: 270,
|
tip: false,
|
searchShow: true,
|
searchMenuSpan: 4,
|
index: false,
|
viewBtn: true,
|
//dialogType: 'drawer',
|
dialogClickModal: false,
|
// 操作栏宽度
|
menuWidth: 156,
|
|
column: punishColimn,
|
},
|
punishSearch: {},
|
punishLoading: true,
|
punishData: [],
|
punishPage: {
|
pageSize: 10,
|
currentPage: 1,
|
total: 0,
|
},
|
punishQuery: {},
|
punishSelectionList: [],
|
};
|
},
|
mounted() {
|
console.log(this.form, "pu");
|
console.log(this.punishOption.column, "pu");
|
// this.punishOnLoad(this.punishPage);
|
// setTimeout(() => {
|
var searchs = () => {
|
if (this.form.see) {
|
this.punishOption.column[1].search = true;
|
this.punishOption.column[2].search = true;
|
this.punishOption.column[3].search = true;
|
}
|
};
|
if (this.form.see) {
|
searchs();
|
}
|
// }, 500);
|
this.$refs.punishCrud.refreshTable();
|
this.$refs.punishCrud.doLayout();
|
},
|
methods: {
|
punishOpen() {
|
this.form.that.punish();
|
},
|
refreshChange() {
|
this.punishOnLoad(this.punishPage, this.punishQuery);
|
},
|
punishOnLoad(page, params = {}) {
|
this.punishLoading = true;
|
// console.log(this.form.departmentid);
|
getListPunish(
|
page.currentPage,
|
page.pageSize,
|
Object.assign(params, this.punishQuery),
|
this.form.departmentid
|
).then((res) => {
|
const data = res.data.data;
|
this.punishPage.total = data.total;
|
this.punishData = data.records;
|
for (var k in this.punishData) {
|
this.punishData[k]["enterprisename"] = this.form.enterprisename;
|
}
|
// console.log(this.punishData, "pu123");
|
|
this.punishLoading = false;
|
this.$refs.punishCrud.refreshTable();
|
this.$refs.punishCrud.doLayout();
|
this.punishSelectionClear();
|
});
|
},
|
punishSelectionClear() {
|
this.punishSelectionList = [];
|
this.$refs.punishCrud.toggleSelection();
|
},
|
punishSelectionChange(list) {
|
this.punishSelectionList = list;
|
},
|
punishSearchChange(params, done) {
|
this.punishQuery = params;
|
this.punishPage.currentPage = 1;
|
this.punishOnLoad(this.punishPage, params);
|
done();
|
},
|
punishSearchReset() {
|
this.punishQuery = {};
|
this.punishOnLoad(this.punishPage);
|
},
|
punishCurrentChange(currentPage) {
|
this.punishPage.currentPage = currentPage;
|
},
|
punishSizeChange(pageSize) {
|
this.punishPage.pageSize = pageSize;
|
},
|
punishRefreshcCange() {
|
this.punishOnLoad(this.punishPage, this.punishQuery);
|
},
|
},
|
};
|
</script>
|
|
<style>
|
</style>
|