新增羊只时的羊只类型,各页面导出功能需求,改品种功能的原品种回显需求,完成

This commit is contained in:
zyh
2026-03-01 14:14:30 +08:00
parent f05ab75821
commit 6ade881750
14 changed files with 162 additions and 73 deletions

View File

@@ -157,7 +157,13 @@
</el-button>
</div>
<el-form-item label="原品种" prop="varietyOld">
<el-input v-model="form.varietyOld" placeholder="页面自动获取展示" disabled />
<span v-if="batchSheep.length === 0" class="placeholder-text">请输入耳号后自动获取</span>
<div v-else class="variety-old-list">
<el-tag v-for="(sheep, idx) in batchSheep" :key="sheep.id" type="warning" effect="plain" size="small"
style="margin: 2px 4px 2px 0;">
{{ sheep.varietyName || '未知品种' }}
</el-tag>
</div>
</el-form-item>
<el-form-item label="新品种" prop="varietyNew">
<el-select v-model="form.varietyNew" placeholder="请选择新品种" clearable filterable :disabled="!isAdd">
@@ -437,12 +443,18 @@ function handleDelete(row) {
/** 导出按钮操作 */
function handleExport() {
proxy.download('changeVariety/changeVariety/export', {
...queryParams.value
}, `changeVariety_${new Date().getTime()}.xlsx`)
queryParams.value.ids = ids.value;
try {
proxy.download('changeVariety/changeVariety/export',
{ ...queryParams.value },
`改品种记录_${Date.now()}.xlsx`
);
} finally {
queryParams.value.ids = null;
}
}
//加载羊舍数据
const sheepfoldOptions = ref([])
function getSheepfoldOptions() {
@@ -589,4 +601,34 @@ onMounted(() => {
flex-wrap: wrap;
align-items: center;
}
.variety-old-list {
min-height: 32px;
/* 与el-input高度一致 */
max-height: 150px;
overflow-y: auto;
padding: 4px 8px;
background-color: #f5f7fa;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
box-sizing: border-box;
width: 100%;
}
.placeholder-text {
display: block;
min-height: 32px;
line-height: 32px;
padding: 0 8px;
background-color: #f5f7fa;
border: 1px solid #dcdfe6;
border-radius: 4px;
color: #c0c4cc;
font-size: 14px;
box-sizing: border-box;
width: 100%;
}
</style>