Commit d6bb46db by 胡鑫

库存盘点修改

parent 62dbef68
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
// Update button disabled state based on form state // Update button disabled state based on form state
function updateButtonVisibility() { function updateButtonVisibility() {
const hasId = !!state.formModel.id; const hasId = !!state.formModel.id;
const isCompletedOrCancelled = state.formModel.zt === '已完成' || state.formModel.zt === '取消'; const isCompleted = state.formModel.zt === '已完成';
const isCancelled = state.formModel.zt === '取消';
// Find the grid component that contains the buttons // Find the grid component that contains the buttons
const gridComponent = data.formDataProps.schemas.find(schema => schema.component === 'Grid' && schema.children); const gridComponent = data.formDataProps.schemas.find(schema => schema.component === 'Grid' && schema.children);
if (gridComponent && gridComponent.children) { if (gridComponent && gridComponent.children) {
...@@ -74,8 +75,8 @@ ...@@ -74,8 +75,8 @@
gridComponent.children.forEach(child => { gridComponent.children.forEach(child => {
if (child.list && child.list.length > 0) { if (child.list && child.list.length > 0) {
child.list.forEach(button => { child.list.forEach(button => {
// Disable all buttons in view mode or if status is completed or cancelled if (props.isView || isCancelled) {
if (props.isView || isCompletedOrCancelled) { // Disable all buttons in view mode or if status is cancelled
button.componentProps.disabled = true; button.componentProps.disabled = true;
button.componentProps.isShow = true; button.componentProps.isShow = true;
} else if (button.label === '开始盘点') { } else if (button.label === '开始盘点') {
...@@ -84,13 +85,13 @@ ...@@ -84,13 +85,13 @@
// Always show the button // Always show the button
button.componentProps.isShow = true; button.componentProps.isShow = true;
} else if (['确认盘点', '取消盘点'].includes(button.label)) { } else if (['确认盘点', '取消盘点'].includes(button.label)) {
// Disable these buttons in add mode // Disable these buttons in add mode or if status is completed
button.componentProps.disabled = !hasId; button.componentProps.disabled = !hasId || isCompleted;
// Always show the buttons // Always show the buttons
button.componentProps.isShow = true; button.componentProps.isShow = true;
} else if (button.label === '处理盈亏') { } else if (button.label === '处理盈亏') {
// Disable in add mode or when status is not completed // Disable in add mode or when status is not completed
button.componentProps.disabled = !hasId || state.formModel.zt !== '已完成'; button.componentProps.disabled = !hasId || !isCompleted;
// Always show the button // Always show the button
button.componentProps.isShow = true; button.componentProps.isShow = true;
} }
......
...@@ -755,7 +755,7 @@ export const formProps: FormProps = { ...@@ -755,7 +755,7 @@ export const formProps: FormProps = {
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2018581306872238081', itemId: '2018581306872238081',
style: { width: '100%' }, style: { width: '100%' },
...@@ -854,7 +854,7 @@ export const formProps: FormProps = { ...@@ -854,7 +854,7 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: false, disabled: true,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
...@@ -966,7 +966,7 @@ export const formProps: FormProps = { ...@@ -966,7 +966,7 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: false, disabled: true,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment