yangfeng
2023-11-03 917bfeda968449930bf41b33f2a26d723ab0492c
src/views/productManage/reorderRules/index.vue
@@ -7,9 +7,11 @@
        :show-apply="false"
        :placeholder="'请输入位置/产品'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addProductClick"
        @searchClick="getList"
        @discardBtnClick="discardBtnClick"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
@@ -76,11 +78,21 @@
      maxInventory: 0,
      orderNumber: 0,
      unit: "",
      reorderId: 0
      reorderId: 0,
      queryProductId: null,
      searchTaskMap: []
    }
  },
  created() {
    this.setTable()
    let query = this.$route.query
    if (query) {
      this.queryProductId = query.productId?.length ? query.productId : null
      this.pagerOptions.currPage = 1
      this.searchTaskMap =
        query.productId?.length > 0 ? [{ productId: this.queryProductId, title: query.productName }] : []
      console.log(this.searchTaskMap)
    }
    this.getData()
  },
  methods: {
@@ -105,6 +117,7 @@
    // 请求数据
    async getData() {
      await getReorderRuleList({
        productId: this.queryProductId ? this.queryProductId : null,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
@@ -319,6 +332,11 @@
    // 获取当前时间
    currentTime() {
      return currentTime()
    },
    // 删除产品
    delSelectClick() {
      this.queryProductId = ""
      this.getData()
    }
  }
}