yangfeng
2023-10-13 5bfc35975b10ad9cdccbd2a2c22f638dd940f02f
src/views/sales/salesReturn/index.vue
@@ -164,7 +164,7 @@
        showcol: this.showCol,
        tableColumn:this.setColumnVisible(this.showCol)
      }
      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
      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
@@ -173,7 +173,7 @@
      }
    },
    setColumnVisible(showCol){
      return  this.tableColumn.map(ele=>{
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn:showCol.includes(ele.label)
@@ -181,18 +181,29 @@
      })
    },
    selTableCol(val) {
      this.showcol = val;
      this.tableList.tableColumn = this.setColumnVisible(val);
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getSalesReturnList({
      let params = {}
      if (this.addConfig.id) {
        params = {
          sourceID: this.addConfig.id,
          sourceType: 1,
          page: this.pagerOptions.currPage,
          pageSize: this.pagerOptions.pageSize
        }
      } else {
        params = {
        keyword: this.keyword,
        keywordType: this.keywordType,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        }
      }
      await getSalesReturnList(params)
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
@@ -223,7 +234,7 @@
    },
    // 搜索
    onFilterSearch(searchText){
      this.keyword = searchText ?? ''
      this.keyword = searchText ?? ""
      this.keywordType = "销售退货单编号"
      this.pagerOptions.currPage = 1
      this.getData()