<script setup lang="ts">
import { ref } from "vue"
import { useVModel } from "@vueuse/core"
import { httpOrderUsed } from "/@/api/netOrderEnter/netOrderEntry";


const props = defineProps<{ modelValue: string; }>()

const options = ref([])
const modelValue = useVModel(props, 'modelValue')


async function requestOrderUsed(){
  const { code, message, data } = await httpOrderUsed()
  if(code == 0){ options.value = (data.list || []).map(item => ({  value: item.id, label: item.order_use, status: item.status })) }
}

requestOrderUsed()
</script>

<template>
  <ElSelect v-model="modelValue" style="width: 100%">
    <ElOption 
      v-for="item in options" 
      :value="item.value"
      :label="item.label"
      :disabled="item.status != '1'"
    />
  </ElSelect>
</template>
