橘猫敲代码 2024-11-01 14:49 采纳率: 64.1%
浏览 17
已结题

table新增一条数据,下拉框不显示


<el-table :data="QuotationProjectDetailList" border v-loading="loading"
            :max-height="$store.state.tableMaxHeight">
            <el-table-column label="仓库" prop="warehouseName" min-width="150">
              <template slot-scope="scope">
                <el-select style="width: 100%;" v-model="scope.row.warehouseId"
                  @change="selectWarehouse(scope.row.warehouseId,scope.$index)" filterable clearable v-fuzzy-search>
                  <el-option v-for="item in warehouseList" :key="item.id" :value="item.id"
                    :label="item.warehouseChnName">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="仓库信息" prop="warehouseDivision">
              <template slot-scope="scope">
                <span>
                  {{ scope.row.warehouseDivision }}
                </span>
                <br>
                <span>
                  {{ scope.row.warehouseTypeName }}
                </span>
                <br>
                <span>
                  {{scope.row.currencyName}}
                </span>
              </template>
            </el-table-column>
            <el-table-column label="库内报价" prop="warehouseCostProjectCount">
              <template slot-scope="scope">
                <el-select style="width: 100%;" v-model="scope.row.warehouseQuotationId"
                  @change="selectQuotation(scope.row.warehouseQuotationId,scope.$index)" filterable clearable
                  v-fuzzy-search>
                  <el-option v-for="item in scope.row.stockQuotationList" :key="item.id" :value="item.id"
                    :label="item.quotationName">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="最惠渠道" prop="warehouseCostProjectCount" min-width="136">
              <template slot-scope="scope">
                <span v-for="(item,index) in scope.row.fmsQuotationProjectDetailList" :key="index">
                  {{ item.enterpriseChannelName}}
                  <span v-if="index < scope.row.fmsQuotationProjectDetailList.length - 1"></span>
                  <br v-if="index < scope.row.fmsQuotationProjectDetailList.length - 1" />
                </span>
              </template>
            </el-table-column>
            <el-table-column label="报价物流账号-标准">
              <template slot-scope="scope">
                <div v-for="(item,index) in scope.row.fmsQuotationProjectDetailList" :key="index">
                  <span v-for="(ele,index3) in item.fmsFinalQuotationProjectDetailAssociationListNotSku" :key="index3">
                    <p class="content">
                    </p>
                    <el-select style="width: 100%;" v-model="ele.finalQuotationId1" filterable clearable multiple
                      v-fuzzy-search>
                      <el-option v-for="(item,index2) in scope.row.quotationLogisticsAccount" :key="index2"
                        :value="item.id" :label="item.logisticsAccountName">
                      </el-option>
                    </el-select>
                  </span>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="报价物流账号-SKU定制">
              <template slot-scope="scope">
                <div v-for="(item,index) in scope.row.fmsQuotationProjectDetailList" :key="index">
                  <span v-for="(ele,index3) in item.fmsFinalQuotationProjectDetailAssociationListSku" :key="index3">
                    <p class="content">
                    </p>
                    <el-select style="width: 100%;" v-model="ele.finalQuotationId2" filterable clearable multiple
                      v-fuzzy-search>
                      <el-option v-for="(item,index2) in scope.row.quotationLogisticsAccountSku" :key="index2"
                        :value="item.id" :label="item.logisticsAccountName">
                      </el-option>
                    </el-select>
                  </span>
                </div>
                <!-- <el-select style="width: 100%;" v-model="scope.row.finalQuotationId2" filterable clearable
                  v-fuzzy-search multiple>
                  <el-option v-for="item in scope.row.quotationLogisticsAccountSku" :key="item.id" :value="item.id"
                    :label="item.quotationName">
                  </el-option>
                </el-select> -->
              </template>
            </el-table-column>
            <el-table-column label="操作" fixed="right" width="170">
              <template slot-scope="scope">
                <el-tooltip class="item" effect="dark" content="删除" placement="bottom">
                  <i class="iconfont icon-shanchuicon" @click="delLine(scope.row.id,scope.$index)"></i>
                </el-tooltip>
              </template>
            </el-table-column>
          </el-table>


   insertLine() {
        if (this.QuotationProjectDetailList == null) {
          this.QuotationProjectDetailList = [];
        }
        this.QuotationProjectDetailList.push({
          warehouseId: null,
          warehouseQuotationId: null,
          fmsQuotationProjectDetailList: [{
            fmsFinalQuotationProjectDetailAssociationListNotSku: [],
            fmsFinalQuotationProjectDetailAssociationListSku: []
          }],
          quotationLogisticsAccount: [], // Add other properties as needed
        });
      },

img

为什么行内新增一条数据,报价物流账号-标准 不显示下拉框?是因为model绑定的值的原因吗?但是数据格式是这种嵌套形式的

  • 写回答

1条回答 默认 最新

  • 孤月葬花魂 2024-11-01 15:44
    关注

    fmsFinalQuotationProjectDetailAssociationListNotSku
    fmsFinalQuotationProjectDetailAssociationListSku
    这俩数组为空导致的

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 4月7日
  • 创建了问题 11月1日