zuozhengqing
2023-10-28 4b4438e7231bff0f260b0c17761072503e2af7b1
src/components/makepager/CommonFormTableView.vue
@@ -195,6 +195,32 @@
                  </el-select>
                </div>
              </el-form-item>
              <!-- 产品类型 -->
              <el-form-item v-else-if="item.productType" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                <div class="custom-name">
                  <span v-if="scope.row.isEdit || scope.row.editable">{{ scope.row[item.prop] }}</span>
                  <el-select
                    v-else
                    v-model="scope.row[item.prop]"
                    placeholder="请选择"
                    size="mini"
                    style="width: 80%"
                    @change="
                      (val) => {
                        selProductTypeClick(val)
                      }
                    "
                  >
                    <el-option
                      v-for="item in productTypeNameOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.name"
                    >
                    </el-option>
                  </el-select>
                </div>
              </el-form-item>
              <!-- 用户 -->
              <el-form-item v-else-if="item.user" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                <div class="custom-name">
@@ -249,6 +275,7 @@
import { getLocationList } from "@/api/warehouseManage/warehouse"
import { getCompanyList } from "@/api/common/other"
import { getRuleList } from "@/api/operate/inventoryAdjustment"
import { getProductCategoryList } from "@/api/product/productCategory"
import SimpleSearchInput from "@/components/makepager/SimpleSearchInput"
// import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
export default {
@@ -298,6 +325,7 @@
      },
      productIndex: 0,
      productNameOptions: [],
      productTypeNameOptions: [],
      memberOptions: [{ id: 1, name: "管理员" }],
      selOptions: [
        { id: 1, name: "件" },
@@ -312,6 +340,7 @@
      this.getRuleList()
    } else {
      this.getProductList()
      this.getProductCategoryList()
    }
    if (this.islistingrules) {
      this.getLocationList()
@@ -351,6 +380,21 @@
          const list = res.data ? res.data : []
          this.selLocationOptions = list.locationList
          this.productNameOptions = list.productList
        }
      })
    },
    // 获取产品类型列表
    async getProductCategoryList(){
      await getProductCategoryList({
        categoryId:0,
        keyWord:"",
        page:1,
        pageSize:15
      }).then((res) => {
        console.log(res,"看看产品类型列表")
        if (res.code === 200) {
          const list = res.data ? res.data : []
          this.productTypeNameOptions = list
        }
      })
    },
@@ -417,6 +461,14 @@
      console.log(this.tableList.tableData)
      this.$emit("selProductClick", item)
    },
    // 选择产品类型
    selProductTypeClick(item) {
      if (this.isinventory) {
        this.getProductCategoryList()
      }
      console.log(this.tableList.tableData)
      this.$emit("selProductTypeClick", item)
    },
    // 选择位置
    selLocationClick(item, prop) {
      console.log(item)