Files
platforms/frontend/platform_admin/scripts/check-gasorder-assignment-linkage.mjs
2026-08-15 19:19:15 +08:00

23 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 功能:静态检查配送订单分配动作是否保留合同履约范围、配送点级联和有效资质约束。
* 版本v1.0.0
*/
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const resources = readFileSync(new URL('../src/api/resources.ts', import.meta.url), 'utf8');
const dialog = readFileSync(new URL('../src/views/resource/ResourceActionDialog.vue', import.meta.url), 'utf8');
const staffPolicy = readFileSync(new URL('../src/api/resource-staff-relation.ts', import.meta.url), 'utf8');
assert.match(resources, /resource: '\/gasorder_basic\/:identity\/assign'/, '缺少订单分配动作');
assert.match(resources, /relationFilters: \{ status: '1' \}/, '配送点候选必须限定启用状态');
assert.match(resources, /validCredentialOnly: true/, '配送人员候选必须限定有效资质');
assert.match(dialog, /lockedAssignmentDeliveryIdentity/, '合同或订单已有配送点时必须锁定');
assert.match(dialog, /assignmentDeliveryFilters/, '配送点候选必须按订单气站过滤');
assert.match(dialog, /assignmentStaffFilters/, '配送人员候选必须按气站和配送点过滤');
assert.match(dialog, /form\.staff_account_identity = undefined/, '切换配送点必须清空旧配送人员');
assert.match(dialog, /initializeGasorderAssignment/, '分配弹窗不得预加载全平台候选');
assert.match(staffPolicy, /valid_credential_only = '1'/, '有效资质策略必须转换为服务端筛选参数');
console.log('配送订单分配联动检查通过:配送点受合同与气站约束,配送人员按点和有效资质筛选。');