zuozhengqing
2023-11-15 624dbdf2b7e3dc1bbcb9d6ebe8fd9d2ab36e214a
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: {
@@ -90,7 +102,7 @@
        selectBox: false,
        selectIndex: true,
        tableColumn: [
          { label: "产品", prop: "productName", product: true },
          { label: "产品", prop: "productName", product: true,width:"150px" },
          { label: "位置", prop: "locationName", defaultLocation: true },
          { label: "在库数量", prop: "amount" },
          { label: "预测数量", prop: "prediction" },
@@ -105,6 +117,7 @@
    // 请求数据
    async getData() {
      await getReorderRuleList({
        productId: this.queryProductId ? this.queryProductId : null,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
@@ -121,7 +134,7 @@
            }
            return {
              ...item,
              productName: item.product.name,
              productName:item.product.name,
              locationName: item.location.name,
              isSet: false,
              isEdit: true,
@@ -280,7 +293,7 @@
        this.tableData.map((item, index) => {
          if (index === rowIndex) {
            item.isEdit = false
            item.editable = true
            item.editable = false
            item.isOrder = true
          } else {
            item.isEdit = true
@@ -319,6 +332,11 @@
    // 获取当前时间
    currentTime() {
      return currentTime()
    },
    // 删除产品
    delSelectClick() {
      this.queryProductId = ""
      this.getData()
    }
  }
}