Prechádzať zdrojové kódy

fix(mobile-oa-h5): hide collector staff on protocol UI

Keep collectorUserId in form state as a hidden field with create defaults.

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 2 týždňov pred
rodič
commit
90c1b83a54

+ 0 - 1
mobile-oa-h5/src/market/list-presenter.js

@@ -177,7 +177,6 @@ function protocolCard(item) {
       field('新生儿体重(克)', item.newbornWeightGram),
       field('采集地区', referenceName(item.regionName, item.regionId)),
       field('采集医院', referenceName(item.hospitalName, item.hospitalId)),
-      field('采集专员', personName(item.collectorUserName, item.collectorUserId)),
       field('市场专员', personName(item.salesUserName, item.salesUserId)),
       field('样本采集时间', item.sampleCollectTime),
       field('创建时间', item.createTime)

+ 1 - 1
mobile-oa-h5/src/market/list-presenter.test.js

@@ -267,7 +267,7 @@ test('list cards hide unresolved reference and dictionary codes while retaining
   assert.ok(protocol.subtitle.includes('S-KEEP-1'))
   assert.ok(protocol.subtitle.startsWith('未知 ·'))
   assert.equal(protocol.status, '未知')
-  assert.equal(protocol.fields.find((field) => field.label === '采集专员').value, '未知人员')
+  assert.ok(!protocol.fields.some((field) => field.label === '采集专员'))
   assert.equal(protocol.fields.find((field) => field.label === '采集地区').value, '未知')
 
   const freight = buildMarketCard('freight', 'manager', {

+ 1 - 1
mobile-oa-h5/src/market/mobile-parity-ui.test.js

@@ -566,7 +566,7 @@ test('protocol cards expose the same business fields as the web list', async ()
   assert.deepEqual(card.fields.map((field) => field.label), [
     '样本编码', '登记日期', '母亲电话', '母亲身份证号', '父亲姓名',
     '新生儿性别', '分娩方式', '新生儿体重(克)', '采集地区', '采集医院',
-    '采集专员', '市场专员', '样本采集时间', '创建时间'
+    '市场专员', '样本采集时间', '创建时间'
   ])
   assert.ok(card.fields.every((field) => !field.wide))
   assert.deepEqual(card.actions, ['view', 'edit', 'delete'])

+ 3 - 1
mobile-oa-h5/src/market/module-contracts.test.js

@@ -205,7 +205,9 @@ test('payment adapters initialize only editable fields from real detail shapes',
 
 test('protocol personnel fields use isolated hydrated option collections', () => {
   const fields = getMarketModule('protocol').formSections.flatMap((section) => section.fields)
-  assert.equal(fields.find((field) => field.key === 'collectorUserId').optionKey, 'collectorStaff')
+  const collector = fields.find((field) => field.key === 'collectorUserId')
+  assert.equal(collector.optionKey, 'collectorStaff')
+  assert.equal(collector.hidden, true)
   assert.equal(fields.find((field) => field.key === 'salesUserId').optionKey, 'salesStaff')
   assert.equal(fields.find((field) => field.key === 'regionManagerUserId').optionKey, 'managerStaff')
 })

+ 1 - 2
mobile-oa-h5/src/market/modules/protocol.js

@@ -457,7 +457,6 @@ export default {
             tagType: bizStatus.tagType
           },
           { label: source === 'research_donation' ? '捐赠日期' : '登记日期', value: value(basic, dateKey) },
-          { label: '采集专员', value: person(basic?.collectorUserName, basic?.collectorUserId) },
           ...(source === 'cell_storage' ? [{ label: '协议总金额', value: value(basic, 'protocolTotalAmount') }] : []),
           { label: '备注', value: value(basic, 'remark') },
           { label: '创建时间', value: value(basic, 'createTime') },
@@ -737,7 +736,7 @@ export default {
       { key: 'donationNo', label: '捐赠编号', source: 'research_donation', hidden: true },
       { key: 'registerDate', label: '登记日期', type: 'date', valueFormat: 'YYYYMMDD', source: 'cell_storage' },
       { key: 'donationDate', label: '捐赠日期', type: 'date', valueFormat: 'YYYYMMDD', source: 'research_donation' },
-      { key: 'collectorUserId', label: '采集专员', type: 'select', optionKey: 'collectorStaff' },
+      { key: 'collectorUserId', label: '采集专员', type: 'select', optionKey: 'collectorStaff', hidden: true },
       // 展示在缴费信息面板(ProtocolSamplePaymentPanel / ProtocolV1PaymentPanel)
       { key: 'protocolTotalAmount', label: '协议总金额', type: 'number', source: 'cell_storage', hidden: true },
       { key: 'remark', label: '备注', type: 'textarea' }