| | |
| | | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <ElButton @click="handleCancel">取消</ElButton> |
| | | <ElButton type="primary" @click="handleSubmit">确定</ElButton> |
| | | <ElButton @click="handleCancel">{{ t('common.cancel') }}</ElButton> |
| | | <ElButton type="primary" @click="handleSubmit">{{ t('common.confirm') }}</ElButton> |
| | | </span> |
| | | </template> |
| | | </ElDialog> |
| | |
| | | |
| | | <script setup> |
| | | import { computed, nextTick, reactive, ref, watch } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import ArtForm from '@/components/core/forms/art-form/index.vue' |
| | | import { |
| | | buildBasStationAreaDialogModel, |
| | |
| | | }) |
| | | |
| | | const emit = defineEmits(['update:visible', 'submit']) |
| | | const { t } = useI18n() |
| | | const formRef = ref() |
| | | const form = reactive(createBasStationAreaFormState()) |
| | | |
| | | const isEdit = computed(() => props.dialogType === 'edit') |
| | | const dialogTitle = computed(() => (isEdit.value ? '编辑站点区域' : '新增站点区域')) |
| | | const dialogTitle = computed(() => |
| | | t(isEdit.value ? 'pages.basicInfo.basStationArea.dialog.titleEdit' : 'pages.basicInfo.basStationArea.dialog.titleAdd') |
| | | ) |
| | | |
| | | const rules = computed(() => ({ |
| | | stationAreaName: [{ required: true, message: '请输入站点区域名称', trigger: 'blur' }], |
| | | stationAreaId: [{ required: true, message: '请输入站点区域编号', trigger: 'blur' }], |
| | | type: [{ required: true, message: '请选择站点类型', trigger: 'change' }], |
| | | area: [{ required: true, message: '请选择所属库区', trigger: 'change' }], |
| | | containerType: [{ type: 'array', required: true, message: '请选择容器类型', trigger: 'change' }], |
| | | stationAlias: [{ type: 'array', required: true, message: '请选择站点别名', trigger: 'change' }] |
| | | stationAreaName: [{ required: true, message: t('pages.basicInfo.basStationArea.dialog.validation.stationAreaName'), trigger: 'blur' }], |
| | | stationAreaId: [{ required: true, message: t('pages.basicInfo.basStationArea.dialog.validation.stationAreaId'), trigger: 'blur' }], |
| | | type: [{ required: true, message: t('pages.basicInfo.basStationArea.dialog.validation.type'), trigger: 'change' }], |
| | | area: [{ required: true, message: t('pages.basicInfo.basStationArea.dialog.validation.area'), trigger: 'change' }], |
| | | containerType: [{ type: 'array', required: true, message: t('pages.basicInfo.basStationArea.dialog.validation.containerType'), trigger: 'change' }], |
| | | stationAlias: [{ type: 'array', required: true, message: t('pages.basicInfo.basStationArea.dialog.validation.stationAlias'), trigger: 'change' }] |
| | | })) |
| | | |
| | | const formItems = computed(() => [ |
| | | { |
| | | label: '站点区域名称', |
| | | label: t('pages.basicInfo.basStationArea.dialog.stationAreaName'), |
| | | key: 'stationAreaName', |
| | | type: 'input', |
| | | props: { |
| | | placeholder: '请输入站点区域名称', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.stationAreaName'), |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '站点区域编号', |
| | | label: t('pages.basicInfo.basStationArea.dialog.stationAreaId'), |
| | | key: 'stationAreaId', |
| | | type: 'input', |
| | | props: { |
| | | placeholder: '请输入站点区域编号', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.stationAreaId'), |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '站点类型', |
| | | label: t('pages.basicInfo.basStationArea.dialog.type'), |
| | | key: 'type', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择站点类型', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.type'), |
| | | clearable: true, |
| | | options: getBasStationAreaTypeOptions() |
| | | } |
| | | }, |
| | | { |
| | | label: '所属库区', |
| | | label: t('pages.basicInfo.basStationArea.dialog.area'), |
| | | key: 'area', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择所属库区', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.area'), |
| | | clearable: true, |
| | | filterable: true, |
| | | options: props.areaOptions || [] |
| | | } |
| | | }, |
| | | { |
| | | label: '可跨区库区', |
| | | label: t('pages.basicInfo.basStationArea.dialog.crossZoneArea'), |
| | | key: 'crossZoneArea', |
| | | type: 'select', |
| | | span: 24, |
| | | props: { |
| | | placeholder: '请选择可跨区库区', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.crossZoneArea'), |
| | | clearable: true, |
| | | multiple: true, |
| | | collapseTags: true, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '容器类型', |
| | | label: t('pages.basicInfo.basStationArea.dialog.containerType'), |
| | | key: 'containerType', |
| | | type: 'select', |
| | | span: 24, |
| | | props: { |
| | | placeholder: '请选择容器类型', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.containerType'), |
| | | clearable: true, |
| | | multiple: true, |
| | | collapseTags: true, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '站点别名', |
| | | label: t('pages.basicInfo.basStationArea.dialog.stationAlias'), |
| | | key: 'stationAlias', |
| | | type: 'select', |
| | | span: 24, |
| | | props: { |
| | | placeholder: '请选择站点别名', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.stationAlias'), |
| | | clearable: true, |
| | | multiple: true, |
| | | collapseTags: true, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '可入', |
| | | label: t('pages.basicInfo.basStationArea.dialog.inAble'), |
| | | key: 'inAble', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择可入', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.inAble'), |
| | | clearable: true, |
| | | options: getBasStationAreaBinaryOptions() |
| | | } |
| | | }, |
| | | { |
| | | label: '可出', |
| | | label: t('pages.basicInfo.basStationArea.dialog.outAble'), |
| | | key: 'outAble', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择可出', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.outAble'), |
| | | clearable: true, |
| | | options: getBasStationAreaBinaryOptions() |
| | | } |
| | | }, |
| | | { |
| | | label: '是否跨区', |
| | | label: t('pages.basicInfo.basStationArea.dialog.isCrossZone'), |
| | | key: 'isCrossZone', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择是否跨区', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.isCrossZone'), |
| | | clearable: true, |
| | | options: getBasStationAreaBinaryOptions() |
| | | } |
| | | }, |
| | | { |
| | | label: '是否WCS', |
| | | label: t('pages.basicInfo.basStationArea.dialog.isWcs'), |
| | | key: 'isWcs', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择是否WCS', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.isWcs'), |
| | | clearable: true, |
| | | options: getBasStationAreaBinaryOptions() |
| | | } |
| | | }, |
| | | { |
| | | label: '自动调拨', |
| | | label: t('pages.basicInfo.basStationArea.dialog.autoTransfer'), |
| | | key: 'autoTransfer', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择自动调拨', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.autoTransfer'), |
| | | clearable: true, |
| | | options: getBasStationAreaBinaryOptions() |
| | | } |
| | | }, |
| | | { |
| | | label: '使用状态', |
| | | label: t('pages.basicInfo.basStationArea.dialog.useStatus'), |
| | | key: 'useStatus', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择使用状态', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.useStatus'), |
| | | clearable: true, |
| | | filterable: true, |
| | | options: props.useStatusOptions || [] |
| | | } |
| | | }, |
| | | { |
| | | label: 'WCS数据', |
| | | label: t('pages.basicInfo.basStationArea.dialog.wcsData'), |
| | | key: 'wcsData', |
| | | type: 'input', |
| | | span: 24, |
| | | props: { |
| | | type: 'textarea', |
| | | rows: 3, |
| | | placeholder: '请输入WCS数据', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.wcsData'), |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '条码', |
| | | label: t('pages.basicInfo.basStationArea.dialog.barcode'), |
| | | key: 'barcode', |
| | | type: 'input', |
| | | props: { |
| | | placeholder: '请输入条码', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.barcode'), |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '状态', |
| | | label: t('pages.basicInfo.basStationArea.dialog.status'), |
| | | key: 'status', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择状态', |
| | | placeholder: t('pages.basicInfo.basStationArea.search.status'), |
| | | clearable: true, |
| | | options: getBasStationAreaStatusOptions() |
| | | } |
| | | }, |
| | | { |
| | | label: '备注', |
| | | label: t('pages.basicInfo.basStationArea.dialog.memo'), |
| | | key: 'memo', |
| | | type: 'input', |
| | | span: 24, |
| | | props: { |
| | | type: 'textarea', |
| | | rows: 3, |
| | | placeholder: '请输入备注', |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.memo'), |
| | | clearable: true |
| | | } |
| | | } |
| | |
| | | { deep: true } |
| | | ) |
| | | </script> |
| | | |