songshankun
2023-09-28 6004e47724ae7e1a36c194ba6160a474a55e0038
feat: 报价单页列表配置列显隐控制
1个文件已修改
44 ■■■■ 已修改文件
src/views/sales/quotation/index.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/quotation/index.vue
@@ -33,6 +33,7 @@
              @selContactsClick="selContactsClick"
              @selCommonClick="selCommonClick"
              @getSelectArray="getSelectArray"
              @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="90">
@@ -131,7 +132,20 @@
      searchSel: {
        value: "number",
        label: "报价单号"
      }
      },
      tableColumn: [
        { label: "报价单号", prop: "number", min: 90, isCommonClick: true ,default:true}, // 报价单号
        { label: "客户名称", prop: "client_name", min: 120, isClientClick: true }, // 客户名称
        { label: "联系人姓名", prop: "contact_name", min: 90, isContactClick: true }, // 联系人姓名
        { label: "销售负责人", prop: "member_name" }, // 销售负责人
        { label: "有效期", prop: "validity_date", min: 100 }, // 修改时间
        // { label: "小计", prop: "subTotal" }, // 小计
        // { label: "合计", prop: "total" }, // 合计
        { label: "产品名称", prop: "productName", isProductName: true },
        { label: "数量", prop: "productNumber", isProductAmount: true },
        { label: "价税合计", prop: "priceTax", isProductTotal: true }
      ],
      showCol:["报价单号", "客户名称", "联系人姓名", "销售负责人", "有效期", "产品名称", "数量", "价税合计"]
    }
  },
  created() {
@@ -149,19 +163,11 @@
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "报价单号", prop: "number", min: 90, isCommonClick: true }, // 报价单号
          { label: "客户名称", prop: "client_name", min: 120, isClientClick: true }, // 客户名称
          { label: "联系人姓名", prop: "contact_name", min: 90, isContactClick: true }, // 联系人姓名
          { label: "销售负责人", prop: "member_name" }, // 销售负责人
          { label: "有效期", prop: "validity_date", min: 100 }, // 修改时间
          // { label: "小计", prop: "subTotal" }, // 小计
          // { label: "合计", prop: "total" }, // 合计
          { label: "产品名称", prop: "productName", isProductName: true },
          { label: "数量", prop: "productNumber", isProductAmount: true },
          { label: "价税合计", prop: "priceTax", 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
@@ -169,6 +175,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