yangfeng
2023-11-03 47121dff8da689923f2f1af9daf63854f385c395
src/views/warehouseManage/listingRules/index.vue
@@ -4,12 +4,14 @@
      <SearchCommonView
        :add-title="addTitle"
        :show-discard="showDiscard"
        :placeholder="'请输入位置/产品'"
        :placeholder="'请输入产品/产品类别'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addProductClick"
        @searchClick="getList"
        @discardBtnClick="discardBtnClick"
        @applyBtnClick="applyBtnClick"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
@@ -94,10 +96,27 @@
      currentRowId: 0,
      rowIndex:-1,
      RuleType:0,
      queryProductId: null,
      categoryId: null,
      searchTaskMap: []
    }
  },
  created() {
    this.setTable()
    let query = this.$route.query
    if (query) {
      console.log("aaaaaaaaaaaaa", query)
      this.queryProductId = query.productId?.length ? query.productId : null
      this.categoryId = query.id ? Number(query.id) : null
      this.pagerOptions.currPage = 1
      this.searchTaskMap =
        query?.id > 0
          ? [{ categoryId: this.categoryId, title: query.categoryName }]
          : query.productId?.length > 0
          ? [{ productId: this.queryProductId, title: query.productName }]
          : []
      console.log(this.searchTaskMap)
    }
    this.getData()
  },
  methods: {
@@ -118,7 +137,8 @@
    // 请求数据
    async getData() {
      await getListingRulesList({
        // keyword: this.keyword,
        productId: this.queryProductId ? this.queryProductId : null,
        productCategoryId: this.categoryId ? this.categoryId : null,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
@@ -181,7 +201,7 @@
      } else {
        if (this.areaId === 0) {
          this.$message.error("请选择当前产品到达位置")
        } else if (this.productId === 0 && this.productCategoryId==='') {
        } else if (this.productId === 0 && this.productCategoryId === "") {
          this.$message.error("请选择产品或产品类别")
        } else if (this.subLocationId === 0) {
          this.$message.error("请选择存储到子位置")
@@ -204,8 +224,8 @@
              id: this.currentRowId,
              areaId: this.areaId,
              locationId: this.subLocationId,
              productCategoryId: this.productCategoryId||'',
              productId: this.productId||''
            productCategoryId: this.productCategoryId || "",
            productId: this.productId || ""
          }).then((res) => {
            console.log(res)
            if (res.code === 200) {
@@ -300,7 +320,10 @@
        this.subLocationId = row.locationId
        this.productCategoryId = row.productCategoryId
        this.productId = row.productId
        if(this.tableList.tableData[rowIndex].productName===""||this.tableList.tableData[rowIndex].productName===" "){
        if (
          this.tableList.tableData[rowIndex].productName === "" ||
          this.tableList.tableData[rowIndex].productName === " "
        ) {
          this.tableList.tableColumn[1].product=false
          this.tableList.tableColumn[2].productType=true
        }else{
@@ -356,8 +379,8 @@
        this.productCategoryId=item.value
      }else{
        this.tableList.tableColumn[1].product=false
        this.tableList.tableData[this.rowIndex].productName=' '
        this.productId=''
        this.tableList.tableData[this.rowIndex].productName = " "
        this.productId = ""
        this.productCategoryId=this.tableList.tableData[this.rowIndex].productCategoryId
      }
    },
@@ -370,6 +393,12 @@
          this.getData()
        }
      })
    },
    // 删除产品类型
    delSelectClick() {
      this.categoryId = 0
      this.queryProductId = ""
      this.getData()
    }
  },
  watch:{