fix(pl): 按真实段序展示用证并区分证面单位与未关联合同。

This commit is contained in:
wuzilong committed 2026-11-01 23:00:02 +08:00
1 parent b764eb02a7
commit fb45466c0c
5 files changed
+57 -5

No files matched your search

@@ -68,3 +68,12 @@ for (const methodName of ['preview', 'loadContext'])
assert.equal(state.context.value, undefined)
assert.equal(state.busy.value, false)
})
test('existing usage table exposes each certificate quantity unit alongside reserved and used values', () => {
const template = parse(readFileSync(new URL('../src/components/business/pl-plan-quota-dialog/index.vue', import.meta.url), 'utf8')).descriptor.template!.content
const usageTable = template.slice(template.indexOf(':data="plan.usages"'), template.indexOf('</section>', template.indexOf(':data="plan.usages"')))
const columns = [...usageTable.matchAll(/prop="([^"]+)"/g)].map(match => match[1])
const visible = [{ certNoSnapshot:'BUY', reservedQty:100, usedQty:20, quantityUnit:'吨' }, { certNoSnapshot:'MOVE', reservedQty:100000, usedQty:20000, quantityUnit:'千克' }].map(row => Object.fromEntries(columns.map(key => [key, row[key as keyof typeof row]])))
assert.equal(visible[0].quantityUnit, '吨')
assert.equal(visible[1].quantityUnit, '千克')
})