zuozhengqing
2023-10-31 0358c535963edb19780cd53c8e133bf298da6419
src/components/makepager/CommonFormTableView.vue
@@ -196,6 +196,35 @@
                  </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="{
                        value: item.id,
                        label: 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">
@@ -276,6 +305,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 {
@@ -325,6 +355,7 @@
      },
      productIndex: 0,
      productNameOptions: [],
      productTypeNameOptions: [],
      memberOptions: [{ id: 1, name: "管理员" }],
      selOptions: [
        { id: 1, name: "件" },
@@ -340,6 +371,7 @@
      this.getRuleList()
    } else {
      this.getProductList()
      this.getProductCategoryList()
    }
    if (this.islistingrules) {
      this.getLocationList()
@@ -382,6 +414,21 @@
        }
      })
    },
    // 获取产品类型列表
    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
        }
      })
    },
    // 位置
    async getLocationList() {
      await getLocationList({
@@ -419,7 +466,6 @@
    },
    // 选择产品
    selProductClick(item) {
      console.log(item)
      this.tableList.tableData.map((ite) => {
        if (ite.productName.label === item.label) {
          ite.productId = item.value
@@ -445,6 +491,20 @@
      console.log(this.tableList.tableData)
      this.$emit("selProductClick", item)
    },
    // 选择产品类型
    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()
      }
      console.log(this.tableList.tableData)
      this.$emit("selProductTypeClick", item)
    },
    // 选择位置
    selLocationClick(item, prop) {
      console.log(item)