yangfeng
2023-10-11 b01b18c05b3e0d00576a02c9c83df8c8033e5986
src/views/other/payment/saleInvoice/index.vue
@@ -20,10 +20,11 @@
    </div>
    <TableCommonView
      ref="tableListRef"
      v-loading="loading"
      :table-list="tableList"
      :select-box="!isDetail"
      @selClientClick="selClientClick"
      @selCommonClick="selCommonClick"
      @getSelectArray="getSelectArray"
      @selTableCol="selTableCol"
    >
      <!-- <template slot="tableButton">
        <el-table-column label="操作" width="60" fixed="right">
@@ -108,7 +109,31 @@
      },
      search_map: {},
      keyword: "",
      keywordType: ""
      keywordType: "",
      tableColumn: [
        { label: "发票编号", prop: "invoiceNumber", default: true },
        { label: "主题", prop: "subject" },
        { label: "客户名称", prop: "client_name" },
        { label: "票据类型", prop: "invoiceType_name" },
        { label: "开票日期", prop: "invoiceDate" },
        { label: "销售负责人", prop: "principalId" },
        { label: "产品名称", prop: "name", isProductName: true },
        { label: "数量", prop: "amount", isProductAmount: true },
        { label: "含税单价", prop: "price", isProductPrice: true },
        { label: "价税合计", prop: "total", isProductTotal: true }
      ],
      showCol: [
        "发票编号",
        "主题",
        "客户名称",
        "票据类型",
        "开票日期",
        "销售负责人",
        "产品名称",
        "数量",
        "含税单价",
        "价税合计"
      ]
    }
  },
  created() {
@@ -125,20 +150,13 @@
  methods: {
    setTable() {
      this.tableList = {
        selectIndex: true,
        tableInfomation: [],
        tableColumn: [
          { label: "发票编号", prop: "invoiceNumber" },
          { label: "主题", prop: "subject" },
          { label: "客户名称", prop: "client_name" },
          { label: "票据类型", prop: "invoiceType_name" },
          { label: "开票日期", prop: "invoiceDate" },
          { label: "销售负责人", prop: "principalId" },
          { label: "产品名称", prop: "name", isProductName: true },
          { label: "数量", prop: "amount", isProductAmount: true },
          { label: "含税单价", prop: "price", isProductPrice: true },
          { label: "价税合计", prop: "total", isProductTotal: true }
        ]
        allcol: [],
        showcol: this.showCol,
        tableColumn: this.setColumnVisible(this.showCol)
      }
      this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
@@ -146,6 +164,18 @@
        this.searchOptions.push({ value: value, label: label })
      }
    },
    setColumnVisible(showCol) {
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn: showCol.includes(ele.label)
        }
      })
    },
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    // 请求数据
    async getData() {
      this.loading = true