feat: 完善协议缴费分期、样本编码搜索与鸿蒙附件选择
支持移动端样本编码远程关键字检索、分期起始日刷新与鸿蒙微信附件选取,并同步收款账户选择、角色页与相关设计文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6e2656f999
commit
063727a7d8
45 files changed
+42669
-34713
No files matched your search
@@ -442,6 +442,79 @@ def test_protocol_form_options_filter_sample_codes_by_code_filter():
|
||||
assert 'OTHER-002' in codes
|
||||
|
||||
|
||||
def test_protocol_form_options_search_sample_codes_by_keyword():
|
||||
"""弹窗输入的编码走 keyword,并仍受样本类型 codeFilter 约束,不受最新 100 条截断。"""
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from app.services.market_support import get_form_options
|
||||
|
||||
db = _session()
|
||||
_seed_options(db)
|
||||
base = datetime(2020, 1, 1)
|
||||
db.add(
|
||||
BizSampleCode(
|
||||
id='sample-code-target',
|
||||
sample_code='ZKZX34000987',
|
||||
tenant_no='tenant-a',
|
||||
create_dept_id='',
|
||||
del_flag=0,
|
||||
create_time=base,
|
||||
)
|
||||
)
|
||||
db.add(
|
||||
BizSampleCode(
|
||||
id='sample-code-other-hit',
|
||||
sample_code='OTHER34000987',
|
||||
tenant_no='tenant-a',
|
||||
create_dept_id='',
|
||||
del_flag=0,
|
||||
create_time=base + timedelta(days=400),
|
||||
)
|
||||
)
|
||||
db.add_all(
|
||||
[
|
||||
BizSampleCode(
|
||||
id=f'sample-code-new-{index}',
|
||||
sample_code=f'ZKZXN{index:05d}',
|
||||
tenant_no='tenant-a',
|
||||
create_dept_id='',
|
||||
del_flag=0,
|
||||
create_time=base + timedelta(days=index + 1),
|
||||
)
|
||||
for index in range(201)
|
||||
]
|
||||
)
|
||||
db.commit()
|
||||
|
||||
hidden = get_form_options(
|
||||
db,
|
||||
module='protocol',
|
||||
ctx=_ctx('manager', 'user-b'),
|
||||
user_info=_user('user-b'),
|
||||
region_id='rb',
|
||||
code_filter='ZKZX',
|
||||
)
|
||||
hidden_codes = {item['sampleCode'] for item in hidden['sampleCodes']}
|
||||
assert 'ZKZX34000987' not in hidden_codes
|
||||
|
||||
found = get_form_options(
|
||||
db,
|
||||
module='protocol',
|
||||
ctx=_ctx('manager', 'user-b'),
|
||||
user_info=_user('user-b'),
|
||||
region_id='rb',
|
||||
code_filter='ZKZX',
|
||||
sample_code_keyword='34000987',
|
||||
)
|
||||
assert found['sampleCodes'] == [
|
||||
{
|
||||
'value': 'sample-code-target',
|
||||
'label': 'ZKZX34000987',
|
||||
'sampleCode': 'ZKZX34000987',
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def test_protocol_form_options_hide_occupied_sample_codes():
|
||||
from app.services.market_support import get_form_options
|
||||
|
||||
|
||||
Reference in new issue
Block a user