优化混炼示方
This commit is contained in:
@@ -88,6 +88,9 @@ export const mainSchema: FormSchema[] = [
|
||||
|
||||
//update-begin---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】橡胶及配合剂明细列展示设置-----------
|
||||
export const materialColumns: JVxeColumn[] = [
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A55】混炼示方明细关联密炼物料ID-----------
|
||||
{ title: '密炼物料ID', key: 'mixerMaterialId', type: JVxeTypes.hidden },
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A55】混炼示方明细关联密炼物料ID-----------
|
||||
{ title: '物料大类', key: 'materialMajor', type: JVxeTypes.input, width: 100, minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH },
|
||||
{ title: '物料小类', key: 'materialMinor', type: JVxeTypes.input, width: 120, minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH },
|
||||
{ title: '种类', key: 'materialKind', type: JVxeTypes.input, width: 80, minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH },
|
||||
@@ -219,7 +222,7 @@ function isMixingMaterialDataRow(row: Recordable): boolean {
|
||||
if (!row) {
|
||||
return false;
|
||||
}
|
||||
return !!(row.mixerMaterialName || row.materialKind || row.unitWeight != null && row.unitWeight !== '');
|
||||
return !!(row.mixerMaterialId || row.mixerMaterialName || row.materialKind || row.unitWeight != null && row.unitWeight !== '');
|
||||
}
|
||||
|
||||
/** 规范化种类字段,用于连续行分组 */
|
||||
@@ -1100,6 +1103,9 @@ export function applyMixingMaterialFromSelection(row: Recordable, material: Reco
|
||||
if (!row || !material) {
|
||||
return;
|
||||
}
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A55】选料回填密炼物料ID-----------
|
||||
row.mixerMaterialId = material.id || material.mixerMaterialId || '';
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A55】选料回填密炼物料ID-----------
|
||||
row.mixerMaterialName = material.materialName || material.materialCode || '';
|
||||
row.mixerMaterialDesc = material.materialDesc || material.materialName || material.materialCode || '';
|
||||
row.materialMajor = material.majorCategoryId_dictText || '';
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
size="small"
|
||||
class="mixing-step-select"
|
||||
popup-class-name="mixing-step-select-dropdown"
|
||||
:list-height="listHeight"
|
||||
:placeholder="placeholder"
|
||||
:get-popup-container="getPopupContainer"
|
||||
@update:value="handleChange"
|
||||
@@ -19,9 +20,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
/** 下拉单项高度(与 ant-design-vue small Select 选项行高一致) */
|
||||
const STEP_SELECT_ITEM_HEIGHT = 32;
|
||||
/** 下拉最多可见条数 */
|
||||
const STEP_SELECT_MAX_VISIBLE = 20;
|
||||
|
||||
const props = defineProps<{
|
||||
row: Recordable;
|
||||
field: string;
|
||||
@@ -34,6 +40,14 @@
|
||||
const { createMessage } = useMessage();
|
||||
const dropdownOpen = ref(false);
|
||||
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A57】混合步骤动作/组合下拉最多展示20条-----------
|
||||
const listHeight = computed(() => {
|
||||
const count = props.options?.length ?? 0;
|
||||
const visibleCount = count > 0 ? Math.min(count, STEP_SELECT_MAX_VISIBLE) : STEP_SELECT_MAX_VISIBLE;
|
||||
return visibleCount * STEP_SELECT_ITEM_HEIGHT;
|
||||
});
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A57】混合步骤动作/组合下拉最多展示20条-----------
|
||||
|
||||
function handleChange(value: string | undefined) {
|
||||
props.row[props.field] = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user