cnf
2025-11-04 8e926ee4ea77060dacff32315ab988fac635cd62
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
@@ -397,6 +397,8 @@
            txt_ftranstype.ReadOnly = true;
            txt_fOwnerTypeIdHead.ReadOnly = true;
            txt_fOwnerTypeInIdHead.ReadOnly = true;
            txt_fBusinessType.Properties.ReadOnly = true;
            txt_djtype.Properties.ReadOnly = true;
        }
        /// <summary>
        /// 新增事件
@@ -413,6 +415,8 @@
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            //增加时,默认组织
            string deftOrg = UtilityHelper.GetFirstOrg(txt_fapporgid);
            txt_fBusinessType.Properties.ReadOnly = true;
            txt_djtype.Properties.ReadOnly = true;
        }
        /// <summary>
@@ -1078,5 +1082,47 @@
            };
            frm.ShowDialog();
        }
        /// <summary>
        ///  预计开工时间变化事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txt_fBillTypeID_EditValueChanged(object sender, EventArgs e)
        {
            string selectedValue = txt_fBillTypeID.EditValue?.ToString();
            if (string.IsNullOrEmpty(selectedValue))
                return;
            if (selectedValue == "委外调拨申请单(DBSQD02_WW)")
            {
                SetComboBoxValue(txt_fBusinessType, "委外(WW)");
                SetComboBoxValue(txt_djtype, "委外直接调拨单(WWDB01_SYS)");
            }
            else
            {
                SetComboBoxValue(txt_fBusinessType, "标准(NORMAL)");
                SetComboBoxValue(txt_djtype, "标准直接调拨单(ZJDB01_SYS)");
            }
        }
        private void SetComboBoxValue(ComboBoxEdit comboBox, string value)
        {
            if (comboBox.Properties.Items.Contains(value))
            {
                comboBox.EditValue = value;
            }
            else
            {
                // 如果值不存在,设置为第一个选项或空
                if (comboBox.Properties.Items.Count > 0)
                    comboBox.EditValue = comboBox.Properties.Items[0];
                else
                    comboBox.EditValue = null;
            }
        }
    }
}
}