完善企业编辑页面并修复采购建单重试

This commit is contained in:
2026-10-30 15:42:38 +08:00
parent d6ef770e48
commit 55868177cd
19 changed files with 568 additions and 224 deletions
@@ -4,7 +4,10 @@ import test from 'node:test'
const routerSource = fs.readFileSync(new URL('../routes.ts', import.meta.url), 'utf8')
const profileSource = fs.readFileSync(new URL('./CompanyProfileView.vue', import.meta.url), 'utf8')
const membersSource = fs.readFileSync(new URL('./MembersView.vue', import.meta.url), 'utf8')
const membersListSource = fs.readFileSync(new URL('./MembersView.vue', import.meta.url), 'utf8')
const memberEditorSource = fs.readFileSync(new URL('./MemberEditorView.vue', import.meta.url), 'utf8')
const membersSource = membersListSource + '\n' + memberEditorSource
const profileEditorSource = fs.readFileSync(new URL('./CompanyProfileEditView.vue', import.meta.url), 'utf8')
const rolesSource = fs.readFileSync(new URL('./RolesView.vue', import.meta.url), 'utf8')
const permissionsSource = fs.readFileSync(new URL('./PermissionsView.vue', import.meta.url), 'utf8')
const storeSource = fs.readFileSync(new URL('../store/tenantAdministration.ts', import.meta.url), 'utf8')
@@ -15,7 +18,7 @@ test('routes tenant administration modules to implemented views instead of the p
assert.match(routerSource, /path: 'organization\/members'[\s\S]*?MembersView\.vue/)
assert.match(routerSource, /path: 'organization\/roles'[\s\S]*?RolesView\.vue/)
assert.match(routerSource, /path: 'organization\/permissions'[\s\S]*?PermissionsView\.vue/)
assert.equal((routerSource.match(/release: 'active'/g) ?? []).length, 4)
assert.equal((routerSource.match(/release: 'active'/g) ?? []).length, 7)
assert.doesNotMatch(routerSource, /ModuleView\.vue/)
})
@@ -23,7 +26,7 @@ test('implements company details, contact information and qualification workflow
assert.match(profileSource, /企业基本信息/)
assert.match(profileSource, /联系信息/)
assert.match(profileSource, /资质文件/)
assert.match(profileSource, /async function saveProfile\(\)/)
assert.match(profileEditorSource, /async function saveProfile\(\)/)
assert.match(profileSource, /function submitQualification\(closeDialog = true\)/)
assert.match(profileSource, /validateQualificationFile/)
assert.match(profileSource, /function removeSelectedFile\(type: MerchantQualificationType\)/)
@@ -66,9 +69,9 @@ test('implements company details, contact information and qualification workflow
assert.doesNotMatch(profileSource, /<el-table class="desktop-qualification-table"/)
assert.doesNotMatch(profileSource, /class="profile-summary-card"/)
assert.match(profileSource, /class="info-panel-header"[\s\S]*auth\.hasPermission\('company:profile:edit'\)/)
assert.match(profileSource, /ref="profileFormRef" :model="draft" :rules="profileFormRules"/)
assert.match(profileSource, /prop="companyName" required><el-input v-model="draft\.companyName" placeholder="请输入公司名称"/)
assert.match(profileSource, /const valid = await profileFormRef\.value\?\.validate\(\)/)
assert.match(profileEditorSource, /ref="profileFormRef" :model="draft" :rules="profileFormRules"/)
assert.match(profileEditorSource, /prop="companyName" required><el-input v-model="draft\.companyName" placeholder="请输入公司名称"/)
assert.match(profileEditorSource, /const valid = await profileFormRef\.value\?\.validate\(\)/)
assert.match(profileSource, /const requiredQualificationTypes = qualificationTypes\.filter\(\(type\) => type\.required\)/)
assert.match(profileSource, /货代资质证书'.*required: false/)
assert.match(profileSource, /法人身份证'.*required: false/)
@@ -116,9 +119,9 @@ test('implements company details, contact information and qualification workflow
assert.match(profileSource, /<dt>注册资本<\/dt><dd>\{\{ store\.company\.registeredCapital/)
assert.match(profileSource, /<dt>联系微信<\/dt><dd>\{\{ store\.company\.contactWechat/)
assert.match(profileSource, /<dt>公司联系电话<\/dt><dd>\{\{ store\.company\.contactPhone/)
assert.match(profileSource, /label="公司联系电话" prop="contactPhone" required/)
assert.match(profileSource, /不会修改任何成员的登录手机号/)
assert.match(profileSource, /pattern: \/\^\[0-9-\]\{4,32\}\$\//)
assert.match(profileEditorSource, /label="公司联系电话" prop="contactPhone" required/)
assert.match(profileEditorSource, /不会修改任何成员的登录手机号/)
assert.match(profileEditorSource, /pattern: \/\^\[0-9-\]\{4,32\}\$\//)
assert.doesNotMatch(profileSource, /<dt>联系电话<\/dt><dd>\{\{ store\.company\.contactPhone/)
assert.match(storeSource, /expiresAt: item\.validTo \|\| '长期有效'/)
assert.match(storeSource, /fileName: item\.originalFileName\?\.trim\(\) \|\| '—'/)