|
|
@@ -1439,18 +1439,14 @@ void CKucunEditViewBase::InitShow()
|
|
|
{
|
|
|
CloseKeypad();
|
|
|
m_lines.clear();
|
|
|
- m_headNote.clear();
|
|
|
SeedLines();
|
|
|
|
|
|
- // 单据头的「备注」字段(Button 当单元格用)
|
|
|
- // 【R48】占位文案按页取(设计稿 p1「采购到货,含配送费」/ p2「晚市备料」/ p3「月末盘点」)
|
|
|
+ // 单据头的「备注」:【R56】起是常驻输入框(Edit),点进去直接打字,不再弹底部文字面板。
|
|
|
+ // 占位文案与占位色由 XML 的 tipvalue / tipvaluecolor 提供(设计稿 p1「采购到货,含配送费」/
|
|
|
+ // p2「晚市备料」/ p3「月末盘点」),这里只负责把它清回草稿态。
|
|
|
std::wstring hn = PrefixW() + L"_note";
|
|
|
- CButtonUI* pNote = FindC<CButtonUI>(hn.c_str());
|
|
|
- if (pNote != NULL)
|
|
|
- {
|
|
|
- pNote->SetText(HeadNotePh());
|
|
|
- pNote->SetTextColor(0xFFA8ADB3);
|
|
|
- }
|
|
|
+ CEditUI* pNote = FindC<CEditUI>(hn.c_str());
|
|
|
+ if (pNote != NULL) pNote->SetText(L"");
|
|
|
|
|
|
RefreshAll();
|
|
|
}
|
|
|
@@ -1555,11 +1551,14 @@ void CKucunEditViewBase::ApplyCellStyle(int i, int col)
|
|
|
// ---------------------------------------------------------------- 键盘面板
|
|
|
void CKucunEditViewBase::OpenKeypad(int row, int col)
|
|
|
{
|
|
|
+ // 【R56】单据头「备注」已改成常驻输入框,不再走这块面板;面板只服务明细行的三列。
|
|
|
+ // 原来的 row == -1 表示「单据头备注」,那条路已删干净,这里补一道合法性守卫。
|
|
|
+ if (row < 0 || row >= (int)m_lines.size()) return;
|
|
|
+
|
|
|
m_nEditRow = row;
|
|
|
m_nEditCol = col;
|
|
|
|
|
|
- if (row < 0) m_editBuf = m_headNote;
|
|
|
- else if (col == KC_ECOL_QTY) m_editBuf = m_lines[row].qty;
|
|
|
+ if (col == KC_ECOL_QTY) m_editBuf = m_lines[row].qty;
|
|
|
else if (col == KC_ECOL_PRICE) m_editBuf = m_lines[row].price;
|
|
|
else m_editBuf = m_lines[row].note;
|
|
|
|
|
|
@@ -1569,6 +1568,10 @@ void CKucunEditViewBase::OpenKeypad(int row, int col)
|
|
|
CControlUI* pKp = Find(L"kc_keypad");
|
|
|
if (pKp != NULL) pKp->SetVisible(true);
|
|
|
|
|
|
+ // 【R56】面板挤在「主体 ↔ 底栏」之间 ⇒ 主体的高度会变,主体内那些常驻的原生 Edit
|
|
|
+ // (单据头备注)必须手工催一次 SetPos,否则原生子窗口会停在旧位置(见 KcSyncNativeEdit)。
|
|
|
+ KcSyncNativeEditsIn(m_pHost);
|
|
|
+
|
|
|
for (int i = 0; i < (int)m_lines.size(); i++)
|
|
|
{
|
|
|
ApplyCellStyle(i, KC_ECOL_QTY);
|
|
|
@@ -1603,18 +1606,17 @@ void CKucunEditViewBase::KeypadRefresh()
|
|
|
std::wstring field;
|
|
|
std::wstring unit;
|
|
|
|
|
|
- if (m_nEditRow < 0) field = L"备注";
|
|
|
- else
|
|
|
- {
|
|
|
- field = m_lines[m_nEditRow].name;
|
|
|
- field += L" · ";
|
|
|
- // 【R49】数量列的字段名按页面给(入库数量 / 出库数量 / 实盘数量),见 QtyColLabel。
|
|
|
- field += (m_nEditCol == KC_ECOL_QTY) ? QtyColLabel()
|
|
|
- : ((m_nEditCol == KC_ECOL_PRICE) ? L"单价" : L"备注");
|
|
|
- // 【R49】设计稿 p6 左栏:数值后跟一个 16px 灰的小号单位(「80 斤」)。
|
|
|
- // 只有数量列有单位;单价列是「元」不显示(设计稿同)、备注列是文字。
|
|
|
- if (m_nEditCol == KC_ECOL_QTY) unit = m_lines[m_nEditRow].unit;
|
|
|
- }
|
|
|
+ // 【R56】面板只服务明细行(单据头备注已改成常驻输入框)
|
|
|
+ if (m_nEditRow < 0 || m_nEditRow >= (int)m_lines.size()) return;
|
|
|
+
|
|
|
+ field = m_lines[m_nEditRow].name;
|
|
|
+ field += L" · ";
|
|
|
+ // 【R49】数量列的字段名按页面给(入库数量 / 出库数量 / 实盘数量),见 QtyColLabel。
|
|
|
+ field += (m_nEditCol == KC_ECOL_QTY) ? QtyColLabel()
|
|
|
+ : ((m_nEditCol == KC_ECOL_PRICE) ? L"单价" : L"备注");
|
|
|
+ // 【R49】设计稿 p6 左栏:数值后跟一个 16px 灰的小号单位(「80 斤」)。
|
|
|
+ // 只有数量列有单位;单价列是「元」不显示(设计稿同)、备注列是文字。
|
|
|
+ if (m_nEditCol == KC_ECOL_QTY) unit = m_lines[m_nEditRow].unit;
|
|
|
|
|
|
SetLabel(L"kc_kp_field", field.c_str(), 0);
|
|
|
SetLabel(L"kc_kp_txtfield", field.c_str(), 0);
|
|
|
@@ -1685,28 +1687,8 @@ void CKucunEditViewBase::KpCommit()
|
|
|
{
|
|
|
CEditUI* pEdit = FindC<CEditUI>(L"kc_kp_edit");
|
|
|
|
|
|
- if (m_nEditRow < 0)
|
|
|
- {
|
|
|
- // 单据头备注
|
|
|
- if (pEdit != NULL) m_headNote = (LPCTSTR)pEdit->GetText();
|
|
|
- std::wstring hn = PrefixW() + L"_note";
|
|
|
- CButtonUI* pNote = FindC<CButtonUI>(hn.c_str());
|
|
|
- if (pNote != NULL)
|
|
|
- {
|
|
|
- if (m_headNote.empty())
|
|
|
- {
|
|
|
- pNote->SetText(HeadNotePh());
|
|
|
- pNote->SetTextColor(0xFFA8ADB3);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- pNote->SetText(m_headNote.c_str());
|
|
|
- pNote->SetTextColor(0xFF1F2329);
|
|
|
- }
|
|
|
- }
|
|
|
- CloseKeypad();
|
|
|
- return;
|
|
|
- }
|
|
|
+ // 【R56】单据头备注的提交分支已删:它现在是常驻输入框,值由 Edit 自己持有,不经过面板。
|
|
|
+ if (m_nEditRow < 0 || m_nEditRow >= (int)m_lines.size()) { CloseKeypad(); return; }
|
|
|
|
|
|
if (m_nEditCol == KC_ECOL_NOTE)
|
|
|
{
|
|
|
@@ -1739,6 +1721,8 @@ void CKucunEditViewBase::CloseKeypad()
|
|
|
// 键盘的文本面板里有原生 Edit:容器隐下去之后必须催一次 SetPos,
|
|
|
// 否则它会孤零零留在屏幕上(原因见 CKucunViews.h 里 KcSyncNativeEdit 的注释)。
|
|
|
if (pKp != NULL) KcSyncNativeEditsIn(pKp);
|
|
|
+ // 【R56】面板收起 ⇒ 主体高度还原,主体内的常驻 Edit(单据头备注)同样要重新定位。
|
|
|
+ KcSyncNativeEditsIn(m_pHost);
|
|
|
|
|
|
SyncFootTip(false); // 【R49】收起键盘 ⇔ 底栏提示还原
|
|
|
|
|
|
@@ -1773,7 +1757,8 @@ void CKucunEditViewBase::OnClick(TNotifyUI& msg)
|
|
|
if (n.size() <= pfx.size() || n.compare(0, pfx.size(), pfx) != 0) return;
|
|
|
std::wstring tail = n.substr(pfx.size()); // 例:"_qty_3"
|
|
|
|
|
|
- if (tail == L"_note") { OpenKeypad(-1, KC_ECOL_NOTE); return; } // 单据头备注
|
|
|
+ // 【R56】单据头「备注」已改成常驻输入框(Edit),「点它弹面板」这条路径已删。
|
|
|
+ // 它的名字形如 kc_rkn_note,落到下面是 tail == "_note"、rfind('_') == 0 ⇒ 直接 return,安全。
|
|
|
if (tail.size() < 4 || tail[0] != L'_') return;
|
|
|
|
|
|
std::wstring::size_type p = tail.rfind(L'_');
|