<el-col :xs="12" :sm="12" :md="12" :lg="8" :xl="8">
            <el-form-item label="使用范围" prop="confirmStoreId">
              <el-cascader
                v-model="queryParams.confirmStoreId"
                :options="accountList"
                clearable
                filterable
                collapse-tags
                collapse-tags-tooltip
                :props="categoryProps"
                placeholder="请选择使用范围"
                size="small"
                class="!w-100%"
              />
            </el-form-item>
          </el-col>

accountList 

// 获取仓库列表
const accountList = ref<any[]>([])
const getAccountList = async () => {
  const data = await SupplierApi.getRegionDataList()
  accountList.value = data.map((item: any) => ({
    id: item.cityCode,
    name: item.cityName,
    children: item.districts.map((district: any) => ({
      id: district.warehouseId,
      name: district.warehouseName
    }))
  }))
}

categoryProps

const categoryProps = {
  value: 'id',
  label: 'name',
  children: 'children',
  multiple: true,
  emitPath: false
}

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐