|
@@ -0,0 +1,149 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basic-container class="page-crad">
|
|
|
+ <avue-crud ref="crud" :option="option" :data="dataList" v-model="form" :page.sync="page"
|
|
|
+ :search.sync="search" @search-change="searchChange" @current-change="currentChange"
|
|
|
+ @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading"
|
|
|
+ @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle"
|
|
|
+ @search-criteria-switch="searchCriteriaSwitch">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button type="primary" icon="el-icon-bottom" size="small">导入
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-top" size="small">导出
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row,index}" slot="menu">
|
|
|
+ <el-button type="text" icon="el-icon-delete" size="small" @click="$refs.crud.rowView(row, index)">
|
|
|
+ 查看</el-button>
|
|
|
+ <el-button type="text" icon="el-icon-delete" size="small" @click="$refs.crud.rowEdit(row, index)">
|
|
|
+ 编辑</el-button>
|
|
|
+ <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(row, index)">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import option from "./config/mainList.json";
|
|
|
+import _ from "lodash";
|
|
|
+export default {
|
|
|
+ name: "customerInformation",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ search: {},
|
|
|
+ form: {},
|
|
|
+ option: {},
|
|
|
+ dataList: [],
|
|
|
+ page: {
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
+ loading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(182), option);
|
|
|
+ this.option.height = window.innerHeight - 210;
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ searchCriteriaSwitch(type) {
|
|
|
+ if (type) {
|
|
|
+ this.option.height = this.option.height - 191;
|
|
|
+ } else {
|
|
|
+ this.option.height = this.option.height + 191;
|
|
|
+ }
|
|
|
+ this.$refs.crud.getTableHeight();
|
|
|
+ },
|
|
|
+ cellStyle() {
|
|
|
+ return "padding:0;height:40px;";
|
|
|
+ },
|
|
|
+ rowDel(row, index, done) {
|
|
|
+ // this.$confirm("确定删除数据?", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning"
|
|
|
+ // }).then(() => {
|
|
|
+ // this.$message({
|
|
|
+ // type: "success",
|
|
|
+ // message: "删除成功!"
|
|
|
+ // });
|
|
|
+ // this.onLoad(this.page, this.search);
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ //点击搜索按钮触发
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ currentChange(val) {
|
|
|
+ this.page.currentPage = val;
|
|
|
+ },
|
|
|
+ sizeChange(val) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.page.pageSize = val;
|
|
|
+ },
|
|
|
+ onLoad(page, params) {
|
|
|
+ // let data = this.deepClone(Object.assign(params, this.search));
|
|
|
+ // this.loading = true;
|
|
|
+ // getList(page.currentPage, page.pageSize, data)
|
|
|
+ // .then(res => {
|
|
|
+ // this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
|
+ // this.page.total = res.data.data.total;
|
|
|
+ // })
|
|
|
+ // .finally(() => {
|
|
|
+ // this.loading = false;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+ newAdd() {
|
|
|
+
|
|
|
+ },
|
|
|
+ async saveColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(182),
|
|
|
+ this.option
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async resetColumn() {
|
|
|
+ this.option = option;
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(182), this.option);
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+::v-deep .select-component {
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.page-crad ::v-deep .basic-container__card {
|
|
|
+ height: 94.2vh;
|
|
|
+}
|
|
|
+
|
|
|
+.itemTable ::v-deep .el-table {
|
|
|
+ width: 738px;
|
|
|
+}
|
|
|
+</style>
|