yangfeng
2023-09-27 496ab649c883f9be20fa982da9918889cdd18282
新建库存调整接口联调
2个文件已修改
52 ■■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/inventoryAdjustment/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue
@@ -154,8 +154,8 @@
                    "
                  >
                    <el-option
                      v-for="item in selLocationOptions"
                      :key="item.id"
                      v-for="(item, index) in selLocationOptions"
                      :key="index"
                      :label="item.name"
                      :value="{ value: item.id, label: item.name }"
                    >
@@ -249,6 +249,7 @@
import { getProductList } from "@/api/product/product"
import { getLocationList } from "@/api/warehouseManage/warehouse"
import { getCompanyList } from "@/api/common/other"
import { getRuleList } from "@/api/operate/inventoryAdjustment"
// import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
export default {
  name: "CommmonFormTableView",
@@ -307,9 +308,10 @@
    }
  },
  created() {
    this.getProductList()
    if (this.isinventory) {
      this.getLocationList()
      this.getRuleList()
    } else {
      this.getProductList()
    }
    if (this.islistingrules) {
      this.getLocationList()
@@ -335,6 +337,20 @@
          if (res.data && res.data.length > 0) {
            this.productNameOptions = res.data
          }
        }
      })
    },
    // 库存调整获取位置和产品
    async getRuleList() {
      await getRuleList({
        locationId: 0,
        productId: ""
      }).then((res) => {
        console.log(res)
        if (res.code === 200) {
          const list = res.data ? res.data : []
          this.selLocationOptions = list.locationList
          this.productNameOptions = list.productList
        }
      })
    },
@@ -384,6 +400,18 @@
          ite.unit = item.unit
        }
      })
      if (this.isinventory) {
        getRuleList({
          locationId: 0,
          productId: item.value
        }).then((res) => {
          console.log(res)
          if (res.code === 200) {
            const list = res.data ? res.data : []
            this.selLocationOptions = list.locationList
          }
        })
      }
      console.log(this.tableList.tableData)
      this.$emit("selProductClick", item)
    },
@@ -391,6 +419,19 @@
    selLocationClick(item, prop) {
      console.log(item)
      console.log(this.tableList.tableData)
      if (this.isinventory) {
        getRuleList({
          locationId: item.value,
          productId: ""
        }).then((res) => {
          console.log(res)
          if (res.code === 200) {
            const list = res.data ? res.data : []
            // this.selLocationOptions = list.locationList
            this.productNameOptions = list.productList
          }
        })
      }
      this.$emit("selLocationClick", item, prop)
    },
    // 选择单位/用户
src/views/operate/inventoryAdjustment/index.vue
@@ -16,6 +16,7 @@
    <div class="list-view">
      <div class="table">
        <CommonFormTableView
          ref="tablelistRef"
          :isinventory="true"
          :product-table-list="tableList"
          @inputContent="inputContent"
@@ -141,7 +142,7 @@
    addProductClick() {
      console.log(this.tableData)
      this.isSel()
      this.isSel()
      this.$refs.tablelistRef.getRuleList()
      if (this.isNoProduct && this.addTitle === "新建") {
        this.addTitle = "保存"
        this.showDiscard = true