fix(@vben/web-antdv-next): 适配 MES 组件 antdv-next 类型约束
parent
860a12a7e7
commit
15e274f812
|
|
@ -51,7 +51,7 @@ function handleToday() {
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #dateFullCellRender="{ current: date }">
|
||||
<template #fullCellRender="{ date }">
|
||||
<div class="h-[110px] text-left">
|
||||
<CalendarDateCell
|
||||
v-if="date.isSame(currentDate, 'month')"
|
||||
|
|
|
|||
|
|
@ -53,16 +53,17 @@ async function getList() {
|
|||
}
|
||||
|
||||
/** 点击日期:打开假期设置弹窗 */
|
||||
function handleDayClick(date: Dayjs) {
|
||||
function handleDayClick(date: unknown) {
|
||||
const current = dayjs(date as Dayjs);
|
||||
// 非当前月日期,不处理(避免切换月份)
|
||||
if (!date.isSame(currentDate.value, 'month')) {
|
||||
if (!current.isSame(currentDate.value, 'month')) {
|
||||
return;
|
||||
}
|
||||
if (!hasAccessByCodes(['mes:cal-holiday:create'])) {
|
||||
message.warning('没有假期设置权限');
|
||||
return;
|
||||
}
|
||||
holidayFormModalApi.setData({ day: date.format('YYYY-MM-DD') }).open();
|
||||
holidayFormModalApi.setData({ day: current.format('YYYY-MM-DD') }).open();
|
||||
}
|
||||
|
||||
/** 切换到上月 */
|
||||
|
|
@ -161,7 +162,7 @@ onMounted(getList);
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #dateFullCellRender="{ current: date }">
|
||||
<template #fullCellRender="{ date }">
|
||||
<div
|
||||
class="hover:bg-muted/50 h-[84px] cursor-pointer p-2 text-left transition"
|
||||
@click.stop="handleDayClick(date)"
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ const processId = computed(() => formData.value?.id);
|
|||
<Form class="mx-4" />
|
||||
<!-- 编辑/详情模式下展示工序操作步骤子表,新增模式下隐藏 -->
|
||||
<template v-if="processId">
|
||||
<Divider class="!my-3" orientation="left">操作步骤</Divider>
|
||||
<Divider class="!my-3" title-placement="start">操作步骤</Divider>
|
||||
<div class="mx-4">
|
||||
<ContentList :form-type="formType" :process-id="processId" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
const processList = ref<MesProRouteProcessApi.RouteProcess[]>([]); // 工序列表(用于 Tab)
|
||||
const activeProcessId = ref<number>(); // 当前选中的工序 Tab
|
||||
const activeProcessId = ref<string>(); // 当前选中的工序 Tab
|
||||
const list = ref<MesProRouteProductBomApi.RouteProductBom[]>([]); // 当前工序下的 BOM 列表
|
||||
|
||||
const [BomFormModal, bomFormModalApi] = useVbenModal({
|
||||
|
|
@ -53,7 +53,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||
async function loadProcessList() {
|
||||
processList.value = (await getRouteProcessListByRoute(props.routeId)) || [];
|
||||
if (processList.value.length > 0) {
|
||||
activeProcessId.value = processList.value[0]!.processId;
|
||||
activeProcessId.value = String(processList.value[0]!.processId);
|
||||
await getList();
|
||||
} else {
|
||||
activeProcessId.value = undefined;
|
||||
|
|
@ -64,13 +64,14 @@ async function loadProcessList() {
|
|||
|
||||
/** 加载当前工序下的 BOM 列表 */
|
||||
async function getList() {
|
||||
if (!activeProcessId.value) {
|
||||
const processId = Number(activeProcessId.value);
|
||||
if (!processId) {
|
||||
return;
|
||||
}
|
||||
gridApi.setLoading(true);
|
||||
try {
|
||||
list.value = await getRouteProductBomList({
|
||||
processId: activeProcessId.value,
|
||||
processId,
|
||||
productId: props.productId,
|
||||
routeId: props.routeId,
|
||||
});
|
||||
|
|
@ -86,9 +87,10 @@ function handleCreate() {
|
|||
message.warning('请先选择工序');
|
||||
return;
|
||||
}
|
||||
const processId = Number(activeProcessId.value);
|
||||
bomFormModalApi
|
||||
.setData({
|
||||
processId: activeProcessId.value,
|
||||
processId,
|
||||
productId: props.productId,
|
||||
routeId: props.routeId,
|
||||
})
|
||||
|
|
@ -100,7 +102,7 @@ function handleEdit(row: MesProRouteProductBomApi.RouteProductBom) {
|
|||
bomFormModalApi
|
||||
.setData({
|
||||
id: row.id,
|
||||
processId: activeProcessId.value!,
|
||||
processId: Number(activeProcessId.value),
|
||||
productId: props.productId,
|
||||
routeId: props.routeId,
|
||||
})
|
||||
|
|
@ -130,7 +132,7 @@ watch(
|
|||
<Tabs v-model:active-key="activeProcessId" @change="getList">
|
||||
<TabPane
|
||||
v-for="item in processList"
|
||||
:key="item.processId"
|
||||
:key="String(item.processId)"
|
||||
:tab="item.processName"
|
||||
/>
|
||||
</Tabs>
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
<Form class="mx-4" />
|
||||
<!-- 编辑模式下展示产品 BOM 子表,新增模式下隐藏 -->
|
||||
<template v-if="formData?.id && formData?.itemId">
|
||||
<Divider class="!my-3" orientation="left">产品 BOM 配置</Divider>
|
||||
<Divider class="!my-3" title-placement="start">产品 BOM 配置</Divider>
|
||||
<div class="mx-4">
|
||||
<ProductBomList
|
||||
:route-id="formData.routeId!"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ const isReadonly = computed(() => formType.value === 'detail'); // 详情态只
|
|||
const getTitle = computed(() =>
|
||||
formType.value === 'detail' ? '工单详情' : '生产排产',
|
||||
);
|
||||
const routeProcessStepItems = computed(() =>
|
||||
routeProcessList.value.map((item) => ({
|
||||
title: item.processName,
|
||||
})),
|
||||
);
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
|
|
@ -111,15 +116,10 @@ const [Modal, modalApi] = useVbenModal({
|
|||
<Steps
|
||||
v-model:current="activeProcessStep"
|
||||
class="my-4 px-4"
|
||||
:items="routeProcessStepItems"
|
||||
size="small"
|
||||
type="navigation"
|
||||
>
|
||||
<Steps.Step
|
||||
v-for="rp in routeProcessList"
|
||||
:key="rp.processId"
|
||||
:title="rp.processName"
|
||||
/>
|
||||
</Steps>
|
||||
/>
|
||||
<Card
|
||||
v-for="(rp, index) in routeProcessList"
|
||||
v-show="activeProcessStep === index"
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ function handleQualityStatusChange(value?: number) {
|
|||
emit('update:modelValue', undefined);
|
||||
emit('valueChange', {
|
||||
valueId: undefined,
|
||||
valueCode: value === null ? '' : String(value),
|
||||
valueCode: value === undefined || value === null ? '' : String(value),
|
||||
valueName: selected?.label || '',
|
||||
});
|
||||
}
|
||||
|
|
@ -109,14 +109,15 @@ async function loadCascadeData() {
|
|||
: undefined;
|
||||
return;
|
||||
}
|
||||
if (props.modelValue === null) {
|
||||
const valueId = props.modelValue;
|
||||
if (valueId === undefined || valueId === null) {
|
||||
return;
|
||||
}
|
||||
if (props.type === MesWmStockTakingParamTypeEnum.LOCATION) {
|
||||
const location = await getWarehouseLocation(props.modelValue);
|
||||
const location = await getWarehouseLocation(valueId);
|
||||
locationWarehouseId.value = location?.warehouseId;
|
||||
} else if (props.type === MesWmStockTakingParamTypeEnum.AREA) {
|
||||
const area = await getWarehouseArea(props.modelValue);
|
||||
const area = await getWarehouseArea(valueId);
|
||||
areaWarehouseId.value = area?.warehouseId;
|
||||
areaLocationId.value = area?.locationId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue