- 在 .env.production 中新增 VITE_AUTH_COOKIE_NAME 配置项用于设置认证cookie名称 - 将 AcceptanceException.vue 中的表单标签宽度从固定90px改为自动适配 - 在 ActionDialog.vue 中将多个表单项标记为必填项并调整标签宽度为自动适配 - 重构 ActionHistory.vue 中的按钮布局结构并添加表格列样式类名 - 更新 api-contract-audit.cjs 添加生产任务和BOM相关接口的契约测试 - 修改 auth.js 使用动态认证cookie键名替换硬编码的Admin-Token - 调整系统角色授权用户页面的表单布局和表格样式类名 - 优化 ReceiptDialog Batch 组件的对话框尺寸、表单验证和分页功能
10 lines
589 B
JavaScript
10 lines
589 B
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import {canReopenPurchase} from '../../src/utils/purchase-sheet-view.js'
|
|
test('confirmation can only be reversed before any pending, accepted or received goods',()=>{
|
|
const row={id:1,priceLocked:true,purchaseStatus:2}
|
|
assert.equal(canReopenPurchase(row),true)
|
|
for(const extra of [{historical:true},{priceLocked:false},{purchaseStatus:5},{acceptedQuantity:1},{pendingArrivalQuantity:1},{receivedQuantity:1}])assert.equal(canReopenPurchase({...row,...extra}),false)
|
|
assert.equal(canReopenPurchase(undefined),false)
|
|
})
|