123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <template>
- <basic-container>
- <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"
- >
- <template slot="menuLeft">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="small"
- @click.stop="newAdd()"
- >新 建</el-button
- >
- </template>
- <template slot="corpIdSearch">
- <select-component
- v-model="search.corpId"
- :configuration="configuration"
- ></select-component>
- </template>
- <template slot-scope="scope" slot="corpId">
- {{ scope.row.corpsName }}
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button
- type="text"
- icon="el-icon-view"
- size="small"
- @click.stop="beforeOpenPage(scope.row, scope.index)"
- >查看
- </el-button>
- <el-button
- type="text"
- icon="el-icon-edit"
- size="small"
- @click.stop="editOpen(scope.row, scope.index)"
- >编辑
- </el-button>
- <el-button
- type="text"
- icon="el-icon-delete"
- size="small"
- @click.stop="rowDel(scope.row, scope.index)"
- >删除
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </template>
- <script>
- import option from "./config/mainList.json";
- import { getList, remove } from "@/api/basicData/customerInquiry";
- import { orderStateFormat } from "@/enums/order-stauts";
- export default {
- name: "customerInformation",
- data() {
- return {
- configuration: {
- multipleChoices: false,
- multiple: false,
- collapseTags: false,
- placeholder: "请点击右边按钮选择",
- dicData: []
- },
- search: {},
- option: option,
- parentId: 0,
- dataList: [{}],
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- }
- };
- },
- methods: {
- //删除列表后面的删除按钮触发触发(row, index, done)
- rowDel(row, index, done) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- remove(row.id);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.page.currentPage = 1;
- this.onLoad(this.page);
- });
- },
- //查看跳转页面
- beforeOpenPage(row, index) {
- this.$router.push({
- path: "/exportcustomerInquiry_detailsPage",
- query: { id: JSON.stringify(row.id) }
- });
- },
- //新增跳转页面
- beforeOpen(row) {
- console.log(row);
- this.$router.push({
- path: "/exportInvoice_detailsPage",
- query: { id: JSON.stringify(row.id) }
- });
- },
- editOpen(row) {
- this.$router.push({
- path: "/exportcustomerInquiry_detailsPage",
- query: { id: JSON.stringify(row.id) }
- });
- },
- //点击搜索按钮触发
- 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) {
- getList(page.currentPage, page.pageSize, params).then(res => {
- this.dataList = res.data.data.records ? res.data.data.records : [];
- this.page.total = res.data.data.total;
- if (this.page.total) {
- this.option.height = window.innerHeight - 380;
- } else {
- this.option.height = window.innerHeight - 305;
- }
- });
- },
- refreshChange() {
- this.onLoad(this.page, this.search);
- },
- newAdd() {
- this.$router.push({
- path: "/exportcustomerInquiry_detailsPage"
- });
- }
- }
- };
- </script>
- <style scoped>
- ::v-deep .select-component {
- display: flex;
- }
- </style>
|