bug修复以及数据分离操作

This commit is contained in:
zyh
2026-02-09 20:22:46 +08:00
parent ab3efaa405
commit 5555d6a747
11 changed files with 975 additions and 448 deletions

View File

@@ -59,8 +59,9 @@
style="max-width: 160px;" />
</el-form-item>
<el-form-item label="技术员" prop="technician">
<el-input v-model="queryParams.technician" placeholder="请输入技术员" clearable @keyup.enter="handleQuery"
style="max-width: 160px;" />
<el-select v-model="queryParams.technician" placeholder="请选择技术员" clearable filterable style="max-width: 160px">
<el-option v-for="item in technicalOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="是否在群" prop="inGroup">
<el-select v-model="queryParams.inGroup" placeholder="全部" clearable style="width:120px">
@@ -155,10 +156,13 @@
<el-input v-model="form.newTag" placeholder="请输入新耳号/电子耳号" @blur="checkNewTagExists" :disabled="!isAddMode" />
</el-form-item>
<el-form-item label="旧耳号" prop="oldTag">
<el-input v-model="form.oldTag" placeholder="请输入旧耳号/电子耳号" disabled />
<el-input v-model="form.oldTag" placeholder="自动获取" disabled />
</el-form-item>
<el-form-item label="技术员" prop="technician">
<el-input v-model="form.technician" placeholder="请输入技术员" :disabled="!isAddMode" />
<el-select v-model="form.technician" placeholder="请选择技术员" :disabled="!isAddMode" clearable filterable
style="width: 100%">
<el-option v-for="item in technicalOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="事件日期" prop="eventDate">
<el-date-picker v-model="form.eventDate" type="date" placeholder="请选择事件日期" value-format="YYYY-MM-DD"
@@ -184,8 +188,28 @@ import { listSheepfold_management as listSheepfold } from '@/api/fileManagement/
import dayjs from 'dayjs'
import { nextTick } from 'vue'
import { Plus, Delete, ArrowUp, ArrowDown } from '@element-plus/icons-vue'
import { getUserByPost } from '@/api/common/user'
const { proxy } = getCurrentInstance()
// 技术员下拉选项
const technicalOptions = ref([])
// 获取技术员列表岗位编码techs
const fetchTechnicalList = () => {
getUserByPost({ postCode: "techs" })
.then(res => {
if (res.code === 200 && Array.isArray(res.data)) {
technicalOptions.value = res.data.map(item => ({
value: item.nickName,
label: item.nickName
}))
} else {
technicalOptions.value = []
}
})
.catch(() => {
technicalOptions.value = []
})
}
const changeEarList = ref([])
const open = ref(false)
const loading = ref(true)
@@ -240,9 +264,6 @@ const data = reactive({
],
eventDate: [
{ required: true, message: "请选择事件日期", trigger: "change" }
],
comment: [
{ required: true, message: "请输入备注", trigger: "blur" }
]
}
})
@@ -417,7 +438,6 @@ function fetchOldTag() {
if (!earNumber || earType === null) {
form.value.oldTag = '';
form.value.sheepId = null;
form.value.comment = '';
return;
}
@@ -429,20 +449,16 @@ function fetchOldTag() {
if (!sheep || !sheep.id) {
form.value.oldTag = '';
form.value.sheepId = null;
form.value.comment = '';
proxy.$modal.warning("未找到对应的羊只");
return;
}
form.value.oldTag = oldTag;
form.value.sheepId = sheep.id;
form.value.comment = sheep.comment || '';
}).catch(error => {
console.error("查询失败:", error);
form.value.oldTag = '';
form.value.sheepId = null;
form.value.comment = '';
proxy.$modal.error("查询耳号失败,请重试");
});
}
@@ -531,6 +547,7 @@ function removeEarNumber(tag) {
onMounted(() => {
getSheepfoldOptions();
getList();
fetchTechnicalList();
});
</script>