diff --git a/.gitignore b/.gitignore index ef84ab63..f0ae10a0 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,5 @@ application-my.yaml /nl-ui-app/unpackage/ .DS_Store -**/.DS_Store \ No newline at end of file +**/.DS_Store +/.superpowers/ diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue index 55a937bb..3faaea02 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue @@ -23,6 +23,7 @@ async function loadMaterialTypeTree() { const selectedRows = ref([]); const isMultiple = ref(false); +const selectModalGridHeight = 600; function handleRadioChange({ row }: { row: any }) { selectedRows.value = row ? [row] : []; @@ -71,8 +72,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, gridOptions: { columns: [{ type: 'radio', width: 40 }, ...baseColumns], - height: 'auto', - maxHeight: '500px', + height: selectModalGridHeight, keepSource: true, proxyConfig: { ajax: { diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue index 965c347f..ef4cf7e0 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue @@ -14,6 +14,7 @@ const emit = defineEmits(['select']); const selectedRows = ref([]); const isMultiple = ref(false); +const selectModalGridHeight = 600; function handleRadioChange({ row }: { row: any }) { selectedRows.value = row ? [row] : []; @@ -48,7 +49,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, gridOptions: { columns: [{ type: 'radio', width: 40 }, ...baseColumns], - height: 'auto', + height: selectModalGridHeight, keepSource: true, proxyConfig: { ajax: { diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts index f16c409e..f9829c20 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts @@ -45,8 +45,9 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', component: 'Select', componentProps: { + disabled: true, options: getDictOptions(DICT_TYPE.WMS_VEHICLE_TYPE), - placeholder: '请选择载具类型', + placeholder: '选择载具后会自动回填', }, }, { @@ -87,6 +88,14 @@ export function useFormSchema(): VbenFormSchema[] { placeholder: '请输入木箱号', }, }, + { + fieldName: 'qty', + label: '物料数量', + component: 'Input', + componentProps: { + placeholder: '请输入物料数量', + }, + }, { fieldName: 'qtyUnitId', label: '数量单位', @@ -94,6 +103,10 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入数量计量单位标识', }, + dependencies: { + triggerFields: [''], + show: () => false, + }, }, { fieldName: 'qtyUnitName', @@ -103,14 +116,6 @@ export function useFormSchema(): VbenFormSchema[] { placeholder: '请输入数量计量单位名称', }, }, - { - fieldName: 'qty', - label: '物料数量', - component: 'Input', - componentProps: { - placeholder: '请输入物料数量', - }, - }, { fieldName: 'vehicleWeight', label: '托盘重量', @@ -127,6 +132,10 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入重量计量单位标识', }, + dependencies: { + triggerFields: [''], + show: () => false, + }, }, { fieldName: 'weightUnitName', diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/modules/form.vue index ece1de3c..3c28fdb8 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/modules/form.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/modules/form.vue @@ -13,10 +13,12 @@ import { $t } from '#/locales'; import { useFormSchema } from '../data'; import MaterialSelectModalComponent from '../../../base/materialbase/components/MaterialSelectModal.vue'; +import MeasureUnitSelectModalComponent from '../../../base/measureunit/components/MeasureUnitSelectModal.vue'; import StorageVehicleSelectModalComponent from '../../storagevehicleinfo/components/StorageVehicleSelectModal.vue'; const emit = defineEmits(['success']); const formData = ref(); +const activeMeasureUnitField = ref<'qty' | 'weight'>('qty'); const getTitle = computed(() => { return formData.value?.storageVehicleExtId ? $t('ui.actionTitle.edit', ['载具扩展属性信息']) @@ -44,6 +46,37 @@ function handleMaterialSelect(rows: any[]) { } } +/** 璁¢噺鍗曚綅閫夋嫨寮圭獥 */ +const [MeasureUnitSelectModal, measureUnitSelectModalApi] = useVbenModal({ + connectedComponent: MeasureUnitSelectModalComponent, +}); + +function openMeasureUnitSelect(field: 'qty' | 'weight') { + activeMeasureUnitField.value = field; + measureUnitSelectModalApi.setData({ multiple: false }).open(); +} + +function handleMeasureUnitSelect(rows: any[]) { + if (rows.length > 0) { + const row = rows[0]; + const currentValues = formApi.getValues(); + const values = + activeMeasureUnitField.value === 'qty' + ? { + qtyUnitId: row.measureUnitId, + qtyUnitName: row.unitName, + } + : { + weightUnitId: row.measureUnitId, + weightUnitName: row.unitName, + }; + formApi.setValues({ + ...currentValues, + ...values, + }); + } +} + /** 载具信息选择弹窗 */ const [StorageVehicleSelectModal, storageVehicleSelectModalApi] = useVbenModal({ connectedComponent: StorageVehicleSelectModalComponent, @@ -88,6 +121,30 @@ const schema = useFormSchema().map((field) => { }, }; } + if (field.fieldName === 'qtyUnitName') { + return { + ...field, + componentProps: { + ...field.componentProps, + placeholder: '请选择数量单位', + readonly: true, + style: 'cursor: pointer', + onClick: () => openMeasureUnitSelect('qty'), + }, + }; + } + if (field.fieldName === 'weightUnitName') { + return { + ...field, + componentProps: { + ...field.componentProps, + placeholder: '请选择重量单位', + readonly: true, + style: 'cursor: pointer', + onClick: () => openMeasureUnitSelect('weight'), + }, + }; + } return field; }); @@ -149,6 +206,7 @@ const [Modal, modalApi] = useVbenModal({
+