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

@@ -67,8 +67,9 @@
</el-select>
</el-form-item> -->
<el-form-item label="技术员" prop="technician">
<el-input v-model="queryParams.technician" placeholder="请输入技术员" clearable style="max-width: 160px"
@keyup.enter="handleQuery" />
<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="isDelete">
<el-select v-model="queryParams.isDelete" placeholder="全部" clearable style="min-width:120px">
@@ -156,7 +157,7 @@
</el-button>
</div>
<el-form-item label="原品种" prop="varietyOld">
<el-input v-model="form.varietyOld" placeholder="请输入原品种" disabled />
<el-input v-model="form.varietyOld" placeholder="页面自动获取展示" disabled />
</el-form-item>
<el-form-item label="新品种" prop="varietyNew">
<el-select v-model="form.varietyNew" placeholder="请选择新品种" clearable filterable :disabled="!isAdd">
@@ -168,10 +169,13 @@
:disabled="!isAdd" />
</el-form-item>
<el-form-item label="技术员" prop="technician">
<el-input v-model="form.technician" placeholder="请输入技术员" :disabled="!isAdd" />
<el-select v-model="form.technician" placeholder="请选择技术员" :disabled="!isAdd" 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="comment" v-if="!isAdd">
<el-input v-model="form.comment" placeholder="请输入备注" :disabled="!isAdd" />
<el-form-item label="备注" prop="comment">
<el-input v-model="form.comment" placeholder="请填写备注" type="textarea" rows="2" />
</el-form-item>
</el-form>
<template #footer>
@@ -191,8 +195,28 @@ import { listVariety } from '@/api/fileManagement/variety'
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 changeVarietyList = ref([])
const open = ref(false)
const loading = ref(true)
@@ -384,7 +408,7 @@ function submitForm() {
varietyNew: form.value.varietyNew,
eventDate: form.value.eventDate,
technician: form.value.technician,
comment: sheep.comment || ""
comment: form.value.comment || ''
}
return addChangeVariety(submitData)
})
@@ -513,7 +537,6 @@ async function onManageTagsBlur() {
if (!batchTags.value.length) { // 全部无效
form.value.varietyOld = ""
form.value.sheepId = null
form.value.comment = ""
return
}
@@ -524,7 +547,6 @@ async function onManageTagsBlur() {
const firstSheep = batchSheep.value[0]
form.value.varietyOld = firstSheep.varietyName || ""
form.value.sheepId = firstSheep.id
form.value.comment = firstSheep.comment || ""
}
// 删除单个批量耳号
@@ -551,6 +573,7 @@ function clearBatchTags() {
onMounted(() => {
loadVarietyOptions();
getSheepfoldOptions();
fetchTechnicalList();
getList();
});
</script>