补齐证书齐备、证件折算、移动用证和合同绑定,并带上报销批量发放、付款备注以及个人开发流程升级,便于继续讨论已安排计划的调整规则。 Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
import assert from 'node:assert/strict'
|
|
import test from 'node:test'
|
|
import type { ContractStatistics } from '../src/api/pl/quota-cert'
|
|
import { certDetailStatus, contractProductRows } from '../src/views/m/pl/plan-cert/contract-usage-model'
|
|
|
|
test('contract certificate products keep the web by-product columns', () => {
|
|
const detail = {
|
|
certificates: [
|
|
{
|
|
certType: 'purchase',
|
|
certId: 'cert',
|
|
certNo: 'G-1',
|
|
quantityUnit: 'ton',
|
|
totalQty: '10',
|
|
reservedQty: '2',
|
|
usedQty: '1',
|
|
availableQty: '7',
|
|
sellerName: '销售方',
|
|
buyerName: '购买方',
|
|
validUseText: '多次有效',
|
|
validTo: '2026-12-01',
|
|
products: [
|
|
{
|
|
id: 'scope',
|
|
contractProductId: 'product',
|
|
productName: '硫酸',
|
|
model: '98%',
|
|
unit: 'ton',
|
|
reservedQty: '2',
|
|
usedQty: '1',
|
|
scopeStatus: 'inactive'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} as ContractStatistics
|
|
const [row] = contractProductRows(detail)
|
|
assert.equal(row.productName, '硫酸')
|
|
assert.equal(row.model, '98%')
|
|
assert.equal(row.certKind, '购买证')
|
|
assert.equal(row.certNo, 'G-1')
|
|
assert.equal(row.totalQty, '10')
|
|
assert.equal(row.salePartyName, '销售方')
|
|
assert.equal(row.buyPartyName, '购买方')
|
|
assert.equal(row.validUseText, '多次有效')
|
|
assert.equal(row.expiryAlert, '')
|
|
assert.equal(row.availableQty, '7')
|
|
assert.equal(row.scopeStatus, 'inactive')
|
|
assert.equal(certDetailStatus('active'), '证件已启用')
|
|
assert.equal(certDetailStatus('void'), '证件已作废')
|
|
})
|