feat(purchase): 人员选择组件增加部门名称显示

- 履约验收采购人员/资产管理员下拉显示部门名称
- OrgSelector组件已选列表、搜索结果增加部门名称和工号显示
- 格式统一为:部门名称 - 姓名 (工号)
This commit is contained in:
吴红兵
2026-03-04 12:06:20 +08:00
parent 501af39a14
commit 849d5df857
4 changed files with 29 additions and 11 deletions

View File

@@ -9,7 +9,7 @@
:type="item.type === 'dept' ? 'primary' : item.type === 'user' ? 'warning' : 'success'"
size="large"
>
{{ item.name }}
{{ getDisplayName(item) }}
</el-tag>
</div>
</template>
@@ -28,6 +28,16 @@ let props = defineProps({
},
});
const getDisplayName = (item) => {
if (item.type === 'user') {
const commonDeptName = item.commonDeptName || '';
const realName = item.realName || item.name || '';
const teacherNo = item.teacherNo || item.username || '';
return commonDeptName ? `${commonDeptName} - ${realName} (${teacherNo})` : `${realName} (${teacherNo})`;
}
return item.name;
};
const removeItem = (index, id, type) => {
emits(
'update:data',

View File

@@ -62,7 +62,11 @@
<div class="f11">
<upload-img v-model:image-url="item.avatar" disabled width="20px" height="20px"/>
</div>
<div class="f12">{{ item.name }}</div>
<div class="f12">
<span v-if="item.commonDeptName">{{ item.commonDeptName }} - </span>
<span>{{ item.realName || item.name }}</span>
<span v-if="item.teacherNo" style="color: #999; margin-left: 4px;">({{ item.teacherNo }})</span>
</div>
</div>
</el-checkbox>
</li>

View File

@@ -48,7 +48,11 @@
<div class="f11">
<upload-img v-model:image-url="item.avatar" disabled width="20px" height="20px" />
</div>
<div class="f12">{{ item.name }}</div>
<div class="f12">
<span v-if="item.commonDeptName">{{ item.commonDeptName }} - </span>
<span>{{ item.realName || item.name }}</span>
<span v-if="item.teacherNo" style="color: #999; margin-left: 4px;">({{ item.teacherNo }})</span>
</div>
<div class="f13">
<el-button size="small" text @click="cancel(item)" :icon="CircleClose"></el-button>
</div>