zuozhengqing
2023-10-31 0358c535963edb19780cd53c8e133bf298da6419
上架规则列表修改
2个文件已修改
45 ■■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/listingRules/index.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue
@@ -216,7 +216,10 @@
                      v-for="item in productTypeNameOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.name"
                      :value="{
                        value: item.id,
                        label: item.name,
                      }"
                    >
                    </el-option>
                  </el-select>
@@ -463,7 +466,6 @@
    },
    // 选择产品
    selProductClick(item) {
      console.log(item)
      this.tableList.tableData.map((ite) => {
        if (ite.productName.label === item.label) {
          ite.productId = item.value
@@ -491,6 +493,12 @@
    },
    // 选择产品类型
    selProductTypeClick(item) {
      this.tableList.tableData.map((ite) => {
        if (ite.productCategory.label === item.label) {
          ite.productCategoryId = item.value
          ite.productCategory = item.label
        }
      })
      if (this.isinventory) {
        this.getProductCategoryList()
      }
src/views/warehouseManage/listingRules/index.vue
@@ -89,6 +89,7 @@
      isRowClick: false,
      areaId: 0,
      productId: 0,
      productCategoryId:0,
      subLocationId: 0,
      currentRowId: 0,
      rowIndex:-1,
@@ -180,8 +181,8 @@
      } else {
        if (this.areaId === 0) {
          this.$message.error("请选择当前产品到达位置")
        } else if (this.productId === 0) {
          this.$message.error("请选择产品")
        } else if (this.productId === 0 && this.productCategoryId==='') {
          this.$message.error("请选择产品或产品类别")
        } else if (this.subLocationId === 0) {
          this.$message.error("请选择存储到子位置")
        } else {
@@ -203,8 +204,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) {
@@ -220,7 +221,7 @@
    isSel() {
      for (let i = 0; i < this.tableData.length; i++) {
        if (this.tableData[i].productName.length === 0) {
          this.isNoProduct = false
          this.isNoProduct = true
          break
        } else {
          this.isNoProduct = true
@@ -299,15 +300,12 @@
        this.subLocationId = row.locationId
        this.productCategoryId = row.productCategoryId
        this.productId = row.productId
        if(this.tableList.tableData[rowIndex].productCategory===""){
          this.tableList.tableColumn[2].productType=false
        }else{
          this.tableList.tableColumn[2].productType=true
        }
        if(this.tableList.tableData[rowIndex].productName===""||this.tableList.tableData[rowIndex].productName===" "){
          this.tableList.tableColumn[1].product=false
          this.tableList.tableColumn[2].productType=true
        }else{
          this.tableList.tableColumn[1].product=true
          this.tableList.tableColumn[2].productType=false
        }
    }
    },
@@ -354,11 +352,14 @@
    // 选中产品类型方法
    selProductTypeClick(item) {
      this.RuleType=2
      console.log(item,"产品类型",this.tableList.tableData[this.rowIndex])
      // this.tableList.tableColumn[1].product=false
      if(this.currentRowId===0){
        this.productCategoryId=item.value
      }else{
        this.tableList.tableColumn[1].product=false
      this.tableList.tableData[this.rowIndex].productName=' '
      this.productId=''
      this.productCategoryId=this.tableList.tableData[this.rowIndex].productCategoryId
      }
    },
    // 删除
    async delClick(scope) {
@@ -373,16 +374,12 @@
  },
  watch:{
    rowIndex(newVal){
      console.log(this.tableList.tableData[newVal].productName.length,"watch")
      if(this.tableList.tableData[newVal].productCategory.length===0){
        this.tableList.tableColumn[2].productType=false
      }else{
        this.tableList.tableColumn[2].productType=true
      }
      if(this.tableList.tableData[newVal].productName===" "){
        this.tableList.tableColumn[1].product=false
        this.tableList.tableColumn[2].productType=true
      }else{
        this.tableList.tableColumn[1].product=true
        this.tableList.tableColumn[2].productType=false
      }
    }
  }